summaryrefslogtreecommitdiff
path: root/chromium/net
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-12 09:13:00 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-16 09:58:26 +0000
commit03561cae90f1d99b5c54b1ef3be69f10e882b25e (patch)
treecc5f0958e823c044e7ae51cc0117fe51432abe5e /chromium/net
parentfa98118a45f7e169f8846086dc2c22c49a8ba310 (diff)
downloadqtwebengine-chromium-03561cae90f1d99b5c54b1ef3be69f10e882b25e.tar.gz
BASELINE: Update Chromium to 88.0.4324.208
Change-Id: I3ae87d23e4eff4b4a469685658740a213600c667 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/net')
-rw-r--r--chromium/net/BUILD.gn19
-rw-r--r--chromium/net/DIR_METADATA12
-rw-r--r--chromium/net/OWNERS7
-rw-r--r--chromium/net/android/BUILD.gn1
-rw-r--r--chromium/net/android/http_auth_negotiate_android.h5
-rw-r--r--chromium/net/android/network_change_notifier_android.cc8
-rw-r--r--chromium/net/android/network_change_notifier_android.h6
-rw-r--r--chromium/net/android/network_change_notifier_delegate_android.h7
-rw-r--r--chromium/net/android/network_change_notifier_factory_android.h10
-rw-r--r--chromium/net/base/address_tracker_linux.cc2
-rw-r--r--chromium/net/base/address_tracker_linux.h4
-rw-r--r--chromium/net/base/address_tracker_linux_fuzzer.cc2
-rw-r--r--chromium/net/base/address_tracker_linux_unittest.cc2
-rw-r--r--chromium/net/base/backoff_entry.h5
-rw-r--r--chromium/net/base/backoff_entry_serializer_unittest.cc5
-rw-r--r--chromium/net/base/backoff_entry_unittest.cc4
-rw-r--r--chromium/net/base/chunked_upload_data_stream.cc6
-rw-r--r--chromium/net/base/chunked_upload_data_stream.h17
-rw-r--r--chromium/net/base/directory_lister.h12
-rw-r--r--chromium/net/base/elements_upload_data_stream.cc2
-rw-r--r--chromium/net/base/elements_upload_data_stream.h6
-rw-r--r--chromium/net/base/expiring_cache.h9
-rw-r--r--chromium/net/base/features.cc30
-rw-r--r--chromium/net/base/features.h45
-rw-r--r--chromium/net/base/file_stream.h5
-rw-r--r--chromium/net/base/file_stream_context.h11
-rw-r--r--chromium/net/base/file_stream_context_posix.cc2
-rw-r--r--chromium/net/base/file_stream_unittest.cc14
-rw-r--r--chromium/net/base/filename_util.cc37
-rw-r--r--chromium/net/base/filename_util_unittest.cc6
-rw-r--r--chromium/net/base/http_user_agent_settings.h10
-rw-r--r--chromium/net/base/idempotency.h28
-rw-r--r--chromium/net/base/isolation_info.cc64
-rw-r--r--chromium/net/base/isolation_info.h58
-rw-r--r--chromium/net/base/isolation_info_unittest.cc229
-rw-r--r--chromium/net/base/logging_network_change_observer.h6
-rw-r--r--chromium/net/base/mime_util.cc3
-rw-r--r--chromium/net/base/net_error_list.h5
-rw-r--r--chromium/net/base/net_info_source_list.h34
-rw-r--r--chromium/net/base/network_activity_monitor.h6
-rw-r--r--chromium/net/base/network_change_notifier.cc6
-rw-r--r--chromium/net/base/network_change_notifier.h34
-rw-r--r--chromium/net/base/network_change_notifier_fuchsia.cc9
-rw-r--r--chromium/net/base/network_change_notifier_fuchsia.h8
-rw-r--r--chromium/net/base/network_change_notifier_fuchsia_unittest.cc65
-rw-r--r--chromium/net/base/network_change_notifier_linux.cc9
-rw-r--r--chromium/net/base/network_change_notifier_linux.h6
-rw-r--r--chromium/net/base/network_change_notifier_mac.h8
-rw-r--r--chromium/net/base/network_change_notifier_mac.mm8
-rw-r--r--chromium/net/base/network_change_notifier_posix.h6
-rw-r--r--chromium/net/base/network_change_notifier_win.cc2
-rw-r--r--chromium/net/base/network_change_notifier_win.h13
-rw-r--r--chromium/net/base/network_change_notifier_win_unittest.cc14
-rw-r--r--chromium/net/base/network_config_watcher_mac.cc9
-rw-r--r--chromium/net/base/network_config_watcher_mac.h7
-rw-r--r--chromium/net/base/network_interfaces.h8
-rw-r--r--chromium/net/base/network_interfaces_getifaddrs.h13
-rw-r--r--chromium/net/base/network_isolation_key.cc54
-rw-r--r--chromium/net/base/network_isolation_key.h53
-rw-r--r--chromium/net/base/network_isolation_key_unittest.cc84
-rw-r--r--chromium/net/base/network_notification_thread_mac.cc5
-rw-r--r--chromium/net/base/port_util.cc1
-rw-r--r--chromium/net/base/port_util.h5
-rw-r--r--chromium/net/base/prioritized_dispatcher.cc3
-rw-r--r--chromium/net/base/prioritized_dispatcher.h7
-rw-r--r--chromium/net/base/prioritized_task_runner.h12
-rw-r--r--chromium/net/base/prioritized_task_runner_unittest.cc11
-rw-r--r--chromium/net/base/priority_queue.h6
-rw-r--r--chromium/net/base/proxy_delegate.h6
-rw-r--r--chromium/net/base/registry_controlled_domains/OWNERS2
-rw-r--r--chromium/net/base/schemeful_site.cc138
-rw-r--r--chromium/net/base/schemeful_site.h139
-rw-r--r--chromium/net/base/schemeful_site_unittest.cc219
-rw-r--r--chromium/net/base/test_completion_callback.cc7
-rw-r--r--chromium/net/base/test_completion_callback.h44
-rw-r--r--chromium/net/base/test_completion_callback_unittest.cc4
-rw-r--r--chromium/net/base/upload_bytes_element_reader.cc3
-rw-r--r--chromium/net/base/upload_bytes_element_reader.h12
-rw-r--r--chromium/net/base/upload_data_stream.h6
-rw-r--r--chromium/net/base/upload_element_reader.h10
-rw-r--r--chromium/net/base/upload_file_element_reader.h5
-rw-r--r--chromium/net/base/url_util.h5
-rw-r--r--chromium/net/cert/DIR_METADATA11
-rw-r--r--chromium/net/cert/OWNERS3
-rw-r--r--chromium/net/cert/cert_verify_proc_mac.cc8
-rw-r--r--chromium/net/cert/cert_verify_proc_unittest.cc9
-rw-r--r--chromium/net/cert/cert_verify_result.cc11
-rw-r--r--chromium/net/cert/cert_verify_result.h16
-rw-r--r--chromium/net/cert/coalescing_cert_verifier_unittest.cc2
-rw-r--r--chromium/net/cert/ct_verify_result.cc35
-rw-r--r--chromium/net/cert/ct_verify_result.h49
-rw-r--r--chromium/net/cert/internal/system_trust_store.cc15
-rw-r--r--chromium/net/cert/internal/system_trust_store.h6
-rw-r--r--chromium/net/cert/internal/trust_store_mac.cc20
-rw-r--r--chromium/net/cert/internal/trust_store_mac.h9
-rw-r--r--chromium/net/cert/multi_threaded_cert_verifier.cc2
-rw-r--r--chromium/net/cert/trial_comparison_cert_verifier_unittest.cc2
-rw-r--r--chromium/net/cert/x509_certificate.h10
-rw-r--r--chromium/net/cert_net/DIR_METADATA11
-rw-r--r--chromium/net/cert_net/OWNERS3
-rw-r--r--chromium/net/cert_net/cert_net_fetcher_url_request.cc7
-rw-r--r--chromium/net/cookies/DIR_METADATA11
-rw-r--r--chromium/net/cookies/OWNERS2
-rw-r--r--chromium/net/cookies/canonical_cookie.cc100
-rw-r--r--chromium/net/cookies/canonical_cookie.h90
-rw-r--r--chromium/net/cookies/canonical_cookie_fuzzer.cc5
-rw-r--r--chromium/net/cookies/canonical_cookie_unittest.cc521
-rw-r--r--chromium/net/cookies/cookie_constants.cc195
-rw-r--r--chromium/net/cookies/cookie_constants.h127
-rw-r--r--chromium/net/cookies/cookie_constants_unittest.cc37
-rw-r--r--chromium/net/cookies/cookie_deletion_info_unittest.cc33
-rw-r--r--chromium/net/cookies/cookie_inclusion_status.cc2
-rw-r--r--chromium/net/cookies/cookie_inclusion_status.h39
-rw-r--r--chromium/net/cookies/cookie_monster.cc270
-rw-r--r--chromium/net/cookies/cookie_monster.h99
-rw-r--r--chromium/net/cookies/cookie_monster_netlog_params.cc1
-rw-r--r--chromium/net/cookies/cookie_monster_store_test.cc4
-rw-r--r--chromium/net/cookies/cookie_monster_unittest.cc570
-rw-r--r--chromium/net/cookies/cookie_options.cc8
-rw-r--r--chromium/net/cookies/cookie_options.h24
-rw-r--r--chromium/net/cookies/cookie_store_unittest.h55
-rw-r--r--chromium/net/cookies/cookie_util.cc60
-rw-r--r--chromium/net/cookies/cookie_util.h18
-rw-r--r--chromium/net/cookies/cookie_util_unittest.cc2
-rw-r--r--chromium/net/cookies/parse_cookie_line_fuzzer.cc5
-rw-r--r--chromium/net/cookies/parsed_cookie.cc26
-rw-r--r--chromium/net/cookies/parsed_cookie.h23
-rw-r--r--chromium/net/cookies/parsed_cookie_unittest.cc97
-rw-r--r--chromium/net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict42
-rw-r--r--chromium/net/data/websocket/DIR_METADATA12
-rw-r--r--chromium/net/data/websocket/OWNERS3
-rw-r--r--chromium/net/der/DIR_METADATA11
-rw-r--r--chromium/net/der/OWNERS2
-rw-r--r--chromium/net/disk_cache/DIR_METADATA11
-rw-r--r--chromium/net/disk_cache/OWNERS2
-rw-r--r--chromium/net/disk_cache/backend_unittest.cc24
-rw-r--r--chromium/net/disk_cache/blockfile/backend_impl.cc2
-rw-r--r--chromium/net/disk_cache/blockfile/in_flight_backend_io.cc2
-rw-r--r--chromium/net/disk_cache/cache_util.cc39
-rw-r--r--chromium/net/disk_cache/cache_util.h4
-rw-r--r--chromium/net/disk_cache/cache_util_unittest.cc99
-rw-r--r--chromium/net/disk_cache/entry_unittest.cc20
-rw-r--r--chromium/net/disk_cache/simple/DIR_METADATA11
-rw-r--r--chromium/net/disk_cache/simple/OWNERS1
-rw-r--r--chromium/net/disk_cache/simple/simple_entry_impl.cc2
-rw-r--r--chromium/net/disk_cache/simple/simple_index.cc2
-rw-r--r--chromium/net/disk_cache/simple/simple_index_unittest.cc1
-rw-r--r--chromium/net/dns/BUILD.gn19
-rw-r--r--chromium/net/dns/DIR_METADATA11
-rw-r--r--chromium/net/dns/OWNERS2
-rw-r--r--chromium/net/dns/context_host_resolver_unittest.cc22
-rw-r--r--chromium/net/dns/dns_config.cc12
-rw-r--r--chromium/net/dns/dns_config.h9
-rw-r--r--chromium/net/dns/dns_config_service_posix.cc6
-rw-r--r--chromium/net/dns/dns_config_service_posix_unittest.cc2
-rw-r--r--chromium/net/dns/dns_query.cc5
-rw-r--r--chromium/net/dns/dns_response.cc52
-rw-r--r--chromium/net/dns/dns_response.h17
-rw-r--r--chromium/net/dns/dns_response_unittest.cc76
-rw-r--r--chromium/net/dns/dns_server_iterator.h1
-rw-r--r--chromium/net/dns/dns_test_util.cc402
-rw-r--r--chromium/net/dns/dns_test_util.h105
-rw-r--r--chromium/net/dns/dns_transaction.cc191
-rw-r--r--chromium/net/dns/dns_transaction.h10
-rw-r--r--chromium/net/dns/dns_transaction_unittest.cc1275
-rw-r--r--chromium/net/dns/dns_util.cc78
-rw-r--r--chromium/net/dns/dns_util.h24
-rw-r--r--chromium/net/dns/dns_util_unittest.cc323
-rw-r--r--chromium/net/dns/fuzzed_host_resolver_util.cc8
-rw-r--r--chromium/net/dns/host_cache.cc54
-rw-r--r--chromium/net/dns/host_cache.h22
-rw-r--r--chromium/net/dns/host_cache_unittest.cc2
-rw-r--r--chromium/net/dns/host_resolver.cc2
-rw-r--r--chromium/net/dns/host_resolver.h7
-rw-r--r--chromium/net/dns/host_resolver_manager.cc251
-rw-r--r--chromium/net/dns/host_resolver_manager_unittest.cc1462
-rw-r--r--chromium/net/dns/host_resolver_mdns_listener_impl.cc1
-rw-r--r--chromium/net/dns/host_resolver_mdns_task.cc4
-rw-r--r--chromium/net/dns/https_record_rdata.cc484
-rw-r--r--chromium/net/dns/https_record_rdata.h152
-rw-r--r--chromium/net/dns/https_record_rdata_fuzzer.cc88
-rw-r--r--chromium/net/dns/https_record_rdata_unittest.cc202
-rw-r--r--chromium/net/dns/httpssvc_metrics.cc228
-rw-r--r--chromium/net/dns/httpssvc_metrics.h31
-rw-r--r--chromium/net/dns/httpssvc_metrics_unittest.cc514
-rw-r--r--chromium/net/dns/public/dns_config_overrides.cc12
-rw-r--r--chromium/net/dns/public/dns_config_overrides.h2
-rw-r--r--chromium/net/dns/public/dns_protocol.h17
-rw-r--r--chromium/net/dns/public/dns_query_type.h10
-rw-r--r--chromium/net/dns/record_parsed.cc20
-rw-r--r--chromium/net/dns/record_parsed.h7
-rw-r--r--chromium/net/dns/record_parsed_unittest.cc109
-rw-r--r--chromium/net/dns/record_rdata.cc9
-rw-r--r--chromium/net/dns/record_rdata.h5
-rw-r--r--chromium/net/dns/resolve_context.cc161
-rw-r--r--chromium/net/dns/resolve_context.h68
-rw-r--r--chromium/net/dns/resolve_context_unittest.cc329
-rw-r--r--chromium/net/docs/proxy.md2
-rw-r--r--chromium/net/extras/sqlite/sqlite_persistent_cookie_store.cc97
-rw-r--r--chromium/net/extras/sqlite/sqlite_persistent_cookie_store_perftest.cc2
-rw-r--r--chromium/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc358
-rw-r--r--chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store.cc645
-rw-r--r--chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store_unittest.cc743
-rw-r--r--chromium/net/filter/DIR_METADATA11
-rw-r--r--chromium/net/filter/OWNERS3
-rw-r--r--chromium/net/ftp/DIR_METADATA11
-rw-r--r--chromium/net/ftp/OWNERS3
-rw-r--r--chromium/net/ftp/ftp_network_transaction.cc1
-rw-r--r--chromium/net/ftp/ftp_util.cc2
-rw-r--r--chromium/net/http/bidirectional_stream.cc21
-rw-r--r--chromium/net/http/bidirectional_stream.h13
-rw-r--r--chromium/net/http/bidirectional_stream_impl.h9
-rw-r--r--chromium/net/http/bidirectional_stream_unittest.cc38
-rw-r--r--chromium/net/http/http_auth_controller.cc2
-rw-r--r--chromium/net/http/http_auth_controller.h26
-rw-r--r--chromium/net/http/http_auth_handler.cc2
-rw-r--r--chromium/net/http/http_auth_handler_basic.cc10
-rw-r--r--chromium/net/http/http_auth_handler_basic_unittest.cc32
-rw-r--r--chromium/net/http/http_auth_handler_factory_unittest.cc54
-rw-r--r--chromium/net/http/http_auth_handler_negotiate.cc13
-rw-r--r--chromium/net/http/http_auth_preferences.h9
-rw-r--r--chromium/net/http/http_cache.cc64
-rw-r--r--chromium/net/http/http_cache.h19
-rw-r--r--chromium/net/http/http_cache_lookup_manager.cc6
-rw-r--r--chromium/net/http/http_cache_transaction.cc24
-rw-r--r--chromium/net/http/http_cache_unittest.cc74
-rw-r--r--chromium/net/http/http_cache_writers.cc2
-rw-r--r--chromium/net/http/http_network_session.cc119
-rw-r--r--chromium/net/http/http_network_session.h2
-rw-r--r--chromium/net/http/http_network_transaction.cc23
-rw-r--r--chromium/net/http/http_network_transaction_unittest.cc47
-rw-r--r--chromium/net/http/http_proxy_client_socket.cc1
-rw-r--r--chromium/net/http/http_request_headers.cc16
-rw-r--r--chromium/net/http/http_request_info.cc6
-rw-r--r--chromium/net/http/http_request_info.h22
-rw-r--r--chromium/net/http/http_response_headers.cc6
-rw-r--r--chromium/net/http/http_response_info.cc1
-rw-r--r--chromium/net/http/http_response_info.h4
-rw-r--r--chromium/net/http/http_server_properties.cc27
-rw-r--r--chromium/net/http/http_server_properties.h6
-rw-r--r--chromium/net/http/http_server_properties_manager.cc281
-rw-r--r--chromium/net/http/http_server_properties_manager.h27
-rw-r--r--chromium/net/http/http_server_properties_manager_unittest.cc323
-rw-r--r--chromium/net/http/http_server_properties_unittest.cc8
-rw-r--r--chromium/net/http/http_stream_factory_job.cc22
-rw-r--r--chromium/net/http/http_stream_factory_job_controller.cc26
-rw-r--r--chromium/net/http/http_stream_factory_job_controller_unittest.cc7
-rw-r--r--chromium/net/http/http_stream_factory_unittest.cc31
-rw-r--r--chromium/net/http/http_stream_parser.cc10
-rw-r--r--chromium/net/http/partial_data.cc2
-rw-r--r--chromium/net/http/transport_security_persister.cc113
-rw-r--r--chromium/net/http/transport_security_state.cc71
-rw-r--r--chromium/net/http/transport_security_state.h4
-rw-r--r--chromium/net/http/transport_security_state_static.json3282
-rw-r--r--chromium/net/http/transport_security_state_unittest.cc101
-rw-r--r--chromium/net/http2/platform/impl/http2_string_utils_impl.h8
-rw-r--r--chromium/net/log/DIR_METADATA11
-rw-r--r--chromium/net/log/OWNERS3
-rw-r--r--chromium/net/log/file_net_log_observer.cc45
-rw-r--r--chromium/net/log/file_net_log_observer.h13
-rw-r--r--chromium/net/log/file_net_log_observer_unittest.cc60
-rw-r--r--chromium/net/log/net_log_event_type_list.h6
-rw-r--r--chromium/net/log/net_log_util.cc124
-rw-r--r--chromium/net/log/net_log_util.h18
-rw-r--r--chromium/net/log/net_log_util_unittest.cc39
-rw-r--r--chromium/net/network_error_logging/DIR_METADATA14
-rw-r--r--chromium/net/network_error_logging/OWNERS6
-rw-r--r--chromium/net/network_error_logging/mock_persistent_nel_store.cc34
-rw-r--r--chromium/net/network_error_logging/mock_persistent_nel_store.h7
-rw-r--r--chromium/net/network_error_logging/mock_persistent_nel_store_unittest.cc90
-rw-r--r--chromium/net/network_error_logging/network_error_logging_service.cc208
-rw-r--r--chromium/net/network_error_logging/network_error_logging_service.h66
-rw-r--r--chromium/net/network_error_logging/network_error_logging_service_unittest.cc529
-rw-r--r--chromium/net/network_error_logging/network_error_logging_test_util.cc2
-rw-r--r--chromium/net/network_error_logging/network_error_logging_test_util.h4
-rw-r--r--chromium/net/nqe/DIR_METADATA11
-rw-r--r--chromium/net/nqe/OWNERS3
-rw-r--r--chromium/net/nqe/connectivity_monitor_unittest.cc2
-rw-r--r--chromium/net/nqe/network_quality_estimator.cc2
-rw-r--r--chromium/net/nqe/network_quality_estimator_unittest.cc44
-rw-r--r--chromium/net/nqe/throughput_analyzer_unittest.cc4
-rw-r--r--chromium/net/ntlm/DIR_METADATA11
-rw-r--r--chromium/net/ntlm/OWNERS3
-rw-r--r--chromium/net/proxy_resolution/DIR_METADATA11
-rw-r--r--chromium/net/proxy_resolution/OWNERS3
-rw-r--r--chromium/net/proxy_resolution/configured_proxy_resolution_request.cc2
-rw-r--r--chromium/net/proxy_resolution/configured_proxy_resolution_service.cc18
-rw-r--r--chromium/net/proxy_resolution/configured_proxy_resolution_service.h2
-rw-r--r--chromium/net/proxy_resolution/multi_threaded_proxy_resolver.cc1
-rw-r--r--chromium/net/proxy_resolution/network_delegate_error_observer_unittest.cc2
-rw-r--r--chromium/net/proxy_resolution/pac_file_decider.cc2
-rw-r--r--chromium/net/proxy_resolution/proxy_config_service_android_unittest.cc2
-rw-r--r--chromium/net/proxy_resolution/proxy_resolution_service.h5
-rw-r--r--chromium/net/proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.cc2
-rw-r--r--chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win.cc2
-rw-r--r--chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc2
-rw-r--r--chromium/net/proxy_resolution/win/proxy_config_service_win.cc3
-rw-r--r--chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc3
-rw-r--r--chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.h2
-rw-r--r--chromium/net/quic/DIR_METADATA11
-rw-r--r--chromium/net/quic/OWNERS3
-rw-r--r--chromium/net/quic/bidirectional_stream_quic_impl.cc2
-rw-r--r--chromium/net/quic/bidirectional_stream_quic_impl.h4
-rw-r--r--chromium/net/quic/bidirectional_stream_quic_impl_unittest.cc147
-rw-r--r--chromium/net/quic/crypto/proof_source_chromium.cc6
-rw-r--r--chromium/net/quic/crypto/proof_source_chromium.h6
-rw-r--r--chromium/net/quic/crypto/proof_test_chromium.cc2
-rw-r--r--chromium/net/quic/crypto/proof_verifier_chromium.cc66
-rw-r--r--chromium/net/quic/crypto/proof_verifier_chromium.h5
-rw-r--r--chromium/net/quic/crypto/proof_verifier_chromium_test.cc342
-rw-r--r--chromium/net/quic/mock_crypto_client_stream.cc9
-rw-r--r--chromium/net/quic/mock_decrypter.cc57
-rw-r--r--chromium/net/quic/mock_decrypter.h28
-rw-r--r--chromium/net/quic/mock_encrypter.cc27
-rw-r--r--chromium/net/quic/mock_encrypter.h21
-rw-r--r--chromium/net/quic/platform/impl/quic_cert_utils_impl.h5
-rw-r--r--chromium/net/quic/platform/impl/quic_file_utils_impl.h3
-rw-r--r--chromium/net/quic/platform/impl/quic_flags_impl.cc52
-rw-r--r--chromium/net/quic/platform/impl/quic_flags_impl.h12
-rw-r--r--chromium/net/quic/platform/impl/quic_flags_test.cc30
-rw-r--r--chromium/net/quic/platform/impl/quic_hostname_utils_impl.cc4
-rw-r--r--chromium/net/quic/platform/impl/quic_hostname_utils_impl.h4
-rw-r--r--chromium/net/quic/platform/impl/quic_mem_slice_span_impl.h4
-rw-r--r--chromium/net/quic/platform/impl/quic_socket_utils.cc7
-rw-r--r--chromium/net/quic/platform/impl/quic_test_impl.cc8
-rw-r--r--chromium/net/quic/platform/impl/quic_test_impl.h8
-rw-r--r--chromium/net/quic/platform/impl/quic_test_output_impl.cc14
-rw-r--r--chromium/net/quic/platform/impl/quic_test_output_impl.h9
-rw-r--r--chromium/net/quic/platform/impl/quic_testvalue_impl.h2
-rw-r--r--chromium/net/quic/quic_chromium_client_session.cc118
-rw-r--r--chromium/net/quic/quic_chromium_client_session.h21
-rw-r--r--chromium/net/quic/quic_chromium_client_session_test.cc61
-rw-r--r--chromium/net/quic/quic_chromium_client_stream.cc21
-rw-r--r--chromium/net/quic/quic_chromium_client_stream.h19
-rw-r--r--chromium/net/quic/quic_chromium_client_stream_test.cc82
-rw-r--r--chromium/net/quic/quic_client_session_cache_unittests.cc3
-rw-r--r--chromium/net/quic/quic_connection_logger.cc52
-rw-r--r--chromium/net/quic/quic_connection_logger.h14
-rw-r--r--chromium/net/quic/quic_connectivity_monitor.cc6
-rw-r--r--chromium/net/quic/quic_context.h3
-rw-r--r--chromium/net/quic/quic_crypto_framer_parse_message_fuzzer.cc3
-rw-r--r--chromium/net/quic/quic_end_to_end_unittest.cc6
-rw-r--r--chromium/net/quic/quic_event_logger.cc47
-rw-r--r--chromium/net/quic/quic_event_logger.h14
-rw-r--r--chromium/net/quic/quic_flags_list.h458
-rw-r--r--chromium/net/quic/quic_http3_logger.cc8
-rw-r--r--chromium/net/quic/quic_http3_logger.h4
-rw-r--r--chromium/net/quic/quic_http_stream.cc4
-rw-r--r--chromium/net/quic/quic_http_stream.h8
-rw-r--r--chromium/net/quic/quic_http_stream_test.cc25
-rw-r--r--chromium/net/quic/quic_http_utils.cc8
-rw-r--r--chromium/net/quic/quic_http_utils.h8
-rw-r--r--chromium/net/quic/quic_network_transaction_unittest.cc385
-rw-r--r--chromium/net/quic/quic_proxy_client_socket.cc7
-rw-r--r--chromium/net/quic/quic_proxy_client_socket.h4
-rw-r--r--chromium/net/quic/quic_proxy_client_socket_unittest.cc47
-rw-r--r--chromium/net/quic/quic_stream_factory.cc9
-rw-r--r--chromium/net/quic/quic_stream_factory_test.cc25
-rw-r--r--chromium/net/quic/quic_test_packet_maker.cc111
-rw-r--r--chromium/net/quic/quic_test_packet_maker.h46
-rw-r--r--chromium/net/quic/quic_test_packet_printer.cc29
-rw-r--r--chromium/net/quic/quic_transport_client.cc8
-rw-r--r--chromium/net/quic/quic_transport_client.h2
-rw-r--r--chromium/net/quic/quic_transport_end_to_end_test.cc5
-rw-r--r--chromium/net/quic/quic_transport_error.cc4
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_arraysize_impl.h12
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_endian_impl.h39
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_optional_impl.h19
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_ptr_util_impl.h22
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_str_cat_impl.h16
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_string_piece_impl.h8
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_text_utils_impl.h38
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.cc4
-rw-r--r--chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.h4
-rw-r--r--chromium/net/reporting/mock_persistent_reporting_store_unittest.cc2
-rw-r--r--chromium/net/reporting/reporting_cache_unittest.cc12
-rw-r--r--chromium/net/reporting/reporting_delivery_agent_unittest.cc14
-rw-r--r--chromium/net/reporting/reporting_header_parser.cc3
-rw-r--r--chromium/net/reporting/reporting_header_parser_unittest.cc174
-rw-r--r--chromium/net/reporting/reporting_service.cc33
-rw-r--r--chromium/net/reporting/reporting_service.h5
-rw-r--r--chromium/net/reporting/reporting_service_unittest.cc158
-rw-r--r--chromium/net/reporting/reporting_test_util.cc49
-rw-r--r--chromium/net/reporting/reporting_test_util.h8
-rw-r--r--chromium/net/reporting/reporting_uploader.cc6
-rw-r--r--chromium/net/server/http_server_unittest.cc1
-rw-r--r--chromium/net/socket/client_socket_handle.cc2
-rw-r--r--chromium/net/socket/client_socket_pool_base_unittest.cc2
-rw-r--r--chromium/net/socket/datagram_client_socket.h4
-rw-r--r--chromium/net/socket/socket_test_util.cc1
-rw-r--r--chromium/net/socket/ssl_client_socket_impl.cc42
-rw-r--r--chromium/net/socket/ssl_client_socket_impl.h12
-rw-r--r--chromium/net/socket/ssl_client_socket_unittest.cc70
-rw-r--r--chromium/net/socket/ssl_connect_job.cc2
-rw-r--r--chromium/net/socket/tcp_client_socket_unittest.cc2
-rw-r--r--chromium/net/socket/tcp_server_socket.cc2
-rw-r--r--chromium/net/socket/tcp_socket_unittest.cc2
-rw-r--r--chromium/net/socket/transport_client_socket_pool_unittest.cc4
-rw-r--r--chromium/net/socket/udp_client_socket.cc6
-rw-r--r--chromium/net/socket/udp_client_socket.h1
-rw-r--r--chromium/net/socket/udp_socket_posix.cc13
-rw-r--r--chromium/net/socket/udp_socket_posix.h3
-rw-r--r--chromium/net/socket/websocket_transport_client_socket_pool_unittest.cc2
-rw-r--r--chromium/net/spdy/DIR_METADATA11
-rw-r--r--chromium/net/spdy/OWNERS2
-rw-r--r--chromium/net/spdy/bidirectional_stream_spdy_impl.cc8
-rw-r--r--chromium/net/spdy/bidirectional_stream_spdy_impl.h11
-rw-r--r--chromium/net/spdy/bidirectional_stream_spdy_impl_unittest.cc12
-rw-r--r--chromium/net/spdy/buffered_spdy_framer.h4
-rw-r--r--chromium/net/spdy/buffered_spdy_framer_unittest.cc18
-rw-r--r--chromium/net/spdy/header_coalescer.cc2
-rw-r--r--chromium/net/spdy/header_coalescer.h4
-rw-r--r--chromium/net/spdy/header_coalescer_test.cc6
-rw-r--r--chromium/net/spdy/multiplexed_http_stream.cc2
-rw-r--r--chromium/net/spdy/multiplexed_http_stream.h6
-rw-r--r--chromium/net/spdy/platform/impl/spdy_endianness_util_impl.h34
-rw-r--r--chromium/net/spdy/platform/impl/spdy_flags_impl.cc11
-rw-r--r--chromium/net/spdy/platform/impl/spdy_flags_impl.h14
-rw-r--r--chromium/net/spdy/platform/impl/spdy_string_utils_impl.cc2
-rw-r--r--chromium/net/spdy/platform/impl/spdy_string_utils_impl.h18
-rw-r--r--chromium/net/spdy/spdy_http_stream.cc23
-rw-r--r--chromium/net/spdy/spdy_http_stream.h6
-rw-r--r--chromium/net/spdy/spdy_http_stream_unittest.cc2
-rw-r--r--chromium/net/spdy/spdy_http_utils.cc12
-rw-r--r--chromium/net/spdy/spdy_http_utils.h20
-rw-r--r--chromium/net/spdy/spdy_http_utils_unittest.cc4
-rw-r--r--chromium/net/spdy/spdy_log_util.cc11
-rw-r--r--chromium/net/spdy/spdy_log_util.h12
-rw-r--r--chromium/net/spdy/spdy_log_util_unittest.cc24
-rw-r--r--chromium/net/spdy/spdy_network_transaction_unittest.cc94
-rw-r--r--chromium/net/spdy/spdy_proxy_client_socket.cc9
-rw-r--r--chromium/net/spdy/spdy_proxy_client_socket.h6
-rw-r--r--chromium/net/spdy/spdy_proxy_client_socket_unittest.cc23
-rw-r--r--chromium/net/spdy/spdy_session.cc37
-rw-r--r--chromium/net/spdy/spdy_session.h10
-rw-r--r--chromium/net/spdy/spdy_session_fuzzer.cc6
-rw-r--r--chromium/net/spdy/spdy_session_pool.cc5
-rw-r--r--chromium/net/spdy/spdy_session_pool.h2
-rw-r--r--chromium/net/spdy/spdy_session_pool_unittest.cc28
-rw-r--r--chromium/net/spdy/spdy_session_unittest.cc152
-rw-r--r--chromium/net/spdy/spdy_stream.cc12
-rw-r--r--chromium/net/spdy/spdy_stream.h22
-rw-r--r--chromium/net/spdy/spdy_stream_test_util.cc22
-rw-r--r--chromium/net/spdy/spdy_stream_test_util.h22
-rw-r--r--chromium/net/spdy/spdy_stream_unittest.cc80
-rw-r--r--chromium/net/spdy/spdy_test_util_common.cc58
-rw-r--r--chromium/net/spdy/spdy_test_util_common.h36
-rw-r--r--chromium/net/ssl/DIR_METADATA11
-rw-r--r--chromium/net/ssl/OWNERS2
-rw-r--r--chromium/net/ssl/client_cert_store_mac.cc2
-rw-r--r--chromium/net/ssl/client_cert_store_nss.cc2
-rw-r--r--chromium/net/ssl/client_cert_store_win.cc1
-rw-r--r--chromium/net/ssl/openssl_ssl_util.cc2
-rw-r--r--chromium/net/ssl/ssl_info.cc10
-rw-r--r--chromium/net/ssl/ssl_info.h16
-rw-r--r--chromium/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java4
-rw-r--r--chromium/net/test/ct_test_util.cc1
-rw-r--r--chromium/net/test/embedded_test_server/default_handlers.cc155
-rw-r--r--chromium/net/test/embedded_test_server/embedded_test_server.cc24
-rw-r--r--chromium/net/test/embedded_test_server/embedded_test_server.h12
-rw-r--r--chromium/net/test/embedded_test_server/embedded_test_server_unittest.cc2
-rw-r--r--chromium/net/test/embedded_test_server/http_response.h2
-rw-r--r--chromium/net/test/quic_simple_test_server.cc4
-rw-r--r--chromium/net/test/spawned_test_server/base_test_server.cc2
-rw-r--r--chromium/net/test/spawned_test_server/base_test_server.h2
-rw-r--r--chromium/net/test/spawned_test_server/local_test_server.cc6
-rw-r--r--chromium/net/test/spawned_test_server/remote_test_server.cc4
-rw-r--r--chromium/net/third_party/nss/DIR_METADATA11
-rw-r--r--chromium/net/third_party/nss/OWNERS2
-rw-r--r--chromium/net/third_party/nss/README.chromium1
-rw-r--r--chromium/net/third_party/quiche/BUILD.gn16
-rw-r--r--chromium/net/third_party/quiche/DIR_METADATA11
-rw-r--r--chromium/net/third_party/quiche/OWNERS2
-rw-r--r--chromium/net/third_party/quiche/src/README.md2
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_arraysize.h12
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_optional.h21
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_ptr_util.h24
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_str_cat_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_string_piece.h7
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils.h87
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils_test.cc146
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils.h2
-rw-r--r--chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils_test.cc24
-rw-r--r--chromium/net/third_party/quiche/src/common/quiche_data_reader.cc36
-rw-r--r--chromium/net/third_party/quiche/src/common/quiche_data_reader.h28
-rw-r--r--chromium/net/third_party/quiche/src/common/quiche_data_writer.cc8
-rw-r--r--chromium/net/third_party/quiche/src/common/quiche_data_writer.h8
-rw-r--r--chromium/net/third_party/quiche/src/common/quiche_data_writer_test.cc43
-rw-r--r--chromium/net/third_party/quiche/src/common/quiche_endian.h (renamed from chromium/net/third_party/quiche/src/common/platform/api/quiche_endian.h)6
-rw-r--r--chromium/net/third_party/quiche/src/common/quiche_endian_test.cc (renamed from chromium/net/third_party/quiche/src/common/platform/api/quiche_endian_test.cc)3
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/decode_buffer.h4
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/decode_buffer_test.cc3
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/decode_http2_structures_test.cc21
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener_test_util.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_test.cc17
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/http2_structure_decoder_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/data_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/headers_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc7
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h15
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/ping_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/priority_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/settings_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.cc6
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.h9
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_decoder_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h7
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state_test.cc13
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.cc14
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h14
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc21
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables_test.cc5
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_test.cc15
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h4
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.cc8
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h10
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_type_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.cc6
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h6
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.cc4
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc5
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h2
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/hpack_string.cc17
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/hpack_string.h17
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/hpack_string_test.cc15
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.cc7
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h6
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc18
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.cc113
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h35
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_benchmark.cc60
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc79
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_transcoder_test.cc19
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.cc6
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.h4
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.cc4
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h14
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc11
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc7
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.h4
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc17
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/http2/http2_constants.cc5
-rw-r--r--chromium/net/third_party/quiche/src/http2/http2_constants_test.cc3
-rw-r--r--chromium/net/third_party/quiche/src/http2/http2_structures_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils.h8
-rw-r--r--chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils_test.cc8
-rw-r--r--chromium/net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h8
-rw-r--r--chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.cc36
-rw-r--r--chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.h94
-rw-r--r--chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/test_tools/http2_random.cc7
-rw-r--r--chromium/net/third_party/quiche/src/http2/test_tools/http2_random.h7
-rw-r--r--chromium/net/third_party/quiche/src/http2/test_tools/http2_random_test.cc3
-rw-r--r--chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.cc11
-rw-r--r--chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.h6
-rw-r--r--chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.h11
-rw-r--r--chromium/net/third_party/quiche/src/http2/tools/random_util.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_batch_writer_buffer.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_sendmmsg_batch_writer.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/chlo_extractor.cc41
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/chlo_extractor_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bandwidth_sampler.h9
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.cc29
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.h36
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_probe_bw.cc31
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.cc91
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_simulator_test.cc172
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.cc78
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.cc30
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h24
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender_test.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/general_loss_algorithm_test.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.cc36
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h18
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.cc41
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h22
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc31
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc37
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_decrypter_test.cc32
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_encrypter_test.cc55
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_decrypter_test.cc33
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_encrypter_test.cc43
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.cc19
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.h5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/boring_utils.h11
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.cc27
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.h13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor_test.cc63
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.cc132
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.h33
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_der_fuzzer.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_test.cc59
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.h1
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter_test.cc29
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter_test.cc34
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.h1
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc31
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc41
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/channel_id_test.cc13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.cc28
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.h17
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_empty.cc18
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_test.cc46
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.cc24
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.h13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer_test.cc31
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.cc20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_printer_bin.cc3
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h32
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_server_test.cc101
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.cc184
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.h55
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils_test.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.cc12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.h17
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.cc37
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.h25
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter_test.cc34
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.cc28
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.h22
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.cc13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.h9
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/proof_source.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.cc16
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/proof_verifier.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.h12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.cc64
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h30
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.cc158
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h30
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config_test.cc17
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.cc19
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h16
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.cc42
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.h46
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.cc12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.h25
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.cc25
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.h17
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc48
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters_test.cc34
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_ack_frame.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_frame.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_message_frame.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_new_token_frame.cc3
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_path_response_frame.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/handshaker_delegate_interface.h3
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/end_to_end_test.cc484
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/http_decoder.cc100
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/http_decoder.h24
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/http_decoder_test.cc329
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/http_encoder.cc31
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/http_encoder_test.cc57
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/http_frames.h20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_client_promised_info_test.cc25
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.h5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream_test.cc23
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.cc29
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream_test.cc13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream.cc24
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream_test.cc13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_server_session_base_test.cc50
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_session_test.cc30
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream_test.cc16
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base.cc12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base_test.cc39
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc152
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.h37
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session_test.cc328
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.cc65
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_test.cc238
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils_test.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/spdy_utils.cc16
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/http/spdy_utils_test.cc53
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.cc11
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator_test.cc34
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.cc64
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.cc18
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h11
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver_test.cc47
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender_test.cc45
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_test.cc276
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.cc52
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.h29
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.cc27
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h18
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver_test.cc77
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender_test.cc30
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_test.cc231
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.cc11
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table_test.cc22
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.cc33
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h31
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder_test.cc87
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.cc53
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h34
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder_test.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h23
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_offline_decoder_bin.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.cc25
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h17
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_round_trip_test.cc40
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.cc12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_receiver.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.cc21
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h22
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list_test.cc24
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_arena_scoped_ptr.h3
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.h20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_bandwidth_test.cc12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.h9
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_circular_deque_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_config.cc30
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_config.h55
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_config_test.cc83
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection.cc571
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection.h173
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection_id.cc12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection_id.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection_id_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.cc3
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.h9
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_connection_test.cc1604
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_constants.h12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.cc13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager_test.cc99
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.cc25
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker_test.cc9
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h16
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream_test.cc18
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.h3
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.cc46
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.cc22
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.h21
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_data_reader.cc9
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_data_reader.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_data_writer.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_data_writer.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_data_writer_test.cc68
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue_test.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.cc31
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.h15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc178
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_error_codes.cc95
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_error_codes.h171
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_error_codes_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_flags_list.h92
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_flow_controller_test.cc18
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_framer.cc389
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_framer.h101
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_framer_test.cc1263
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_interval_deque.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_interval_deque_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_interval_set.h19
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_interval_set_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_linux_socket_utils.h5
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_one_block_arena.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.cc181
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.h34
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_packet_creator_test.cc114
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_packets.cc24
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_packets.h20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_path_validator.cc128
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_path_validator.h135
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_path_validator_test.cc242
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h246
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_received_packet_manager.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.cc317
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h29
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager_test.cc153
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_session.cc253
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_session.h92
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_session_test.cc224
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_socket_address_coder_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream.cc194
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream.h55
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream_send_buffer_test.cc29
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.cc86
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.h28
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer_test.cc145
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_test.cc38
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_stream_test.cc244
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_tag.cc24
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_tag.h12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.cc12
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_trace_visitor.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_types.cc23
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_types.h20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.cc81
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h169
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map_test.cc118
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_utils.cc59
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_utils.h22
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_utils_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_version_manager.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_version_manager_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_versions.cc23
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_versions.h9
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_versions_test.cc20
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.cc13
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.h11
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/stream_delegate_interface.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.h16
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.cc258
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.h69
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker_test.cc38
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_handshaker.cc209
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_handshaker.h108
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.cc148
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.h67
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker_test.cc82
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.cc19
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager_test.cc36
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_client_bin.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_client_session.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_client_session.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_client_tools.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.cc13
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_epoll_client.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_epoll_client.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_server_session.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/masque/masque_server_session.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_aligned.h15
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_cert_utils.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h12
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_macros.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_port_utils.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_string_utils_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_test_output.h13
-rw-r--r--chromium/net/third_party/quiche/src/quic/platform/api/quic_testvalue.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.cc11
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_client.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_server_session.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.cc17
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/ip_range.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/netlink.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.cc11
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet_test.cc23
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_client.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_client.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_client_interface.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_client_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_control_stream.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.cc49
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.h25
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test.cc20
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test_tools.h12
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_session_test.cc25
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/qbone/qbone_stream_test.cc53
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session_test.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_integration_test.cc9
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream_test.cc10
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.cc9
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.h9
-rw-r--r--chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier_test.cc9
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.cc61
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils_test.cc11
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/first_flight.cc1
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/packet_dropping_test_writer.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h33
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.cc75
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.h29
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.cc3
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h9
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.h3
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.cc28
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h11
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.h20
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.cc30
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.cc23
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.cc27
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_test_server.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.cc171
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.h268
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h5
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.cc6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/simple_quic_framer.cc23
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/simulator/queue.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.cc5
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.h14
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/simulator/switch.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.cc28
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.h26
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.cc26
-rw-r--r--chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.h8
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/fake_proof_verifier.h5
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.h24
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_client_base.cc4
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_client_base.h10
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_client_interop_test_bin.cc55
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_client_test.cc7
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.cc127
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h91
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend_test.cc21
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_packet_printer_bin.cc34
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_reject_reason_decoder_bin.cc3
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_server.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_server_test.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.cc15
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.cc14
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.h12
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session_test.cc74
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.cc34
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h22
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream_test.cc140
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.cc46
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.h42
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_toy_client.cc17
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.cc9
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.h4
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.cc2
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h2
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_url.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/quic_url.h7
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.cc8
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.h6
-rw-r--r--chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter_test.cc7
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_constants.cc4
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.cc2
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h5
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter_test.cc70
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.cc48
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h17
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder_test.cc140
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.cc18
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h19
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.cc26
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h25
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table_test.cc11
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.cc4
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h6
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_benchmark.cc64
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_test.cc46
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.cc8
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h7
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream_test.cc14
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_round_trip_test.cc2
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.cc6
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table_test.cc4
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.cc4
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h8
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h7
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.cc38
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.h51
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.cc53
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h30
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format_test.cc64
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.cc20
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.h2
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.cc3
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.h18
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder_test.cc8
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.cc26
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.h6
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader_test.cc58
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_framer.cc11
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_framer.h2
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_framer_test.cc146
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.cc113
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.h119
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_header_block_test.cc129
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.cc23
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.h22
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage_test.cc16
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h5
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_intrusive_list_test.cc3
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_no_op_visitor.h8
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece.h6
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece_test.cc18
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_prefixed_buffer_reader_test.cc15
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.cc10
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.h33
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test.cc16
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.cc6
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_simple_arena_test.cc28
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.cc20
-rw-r--r--chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.h36
-rw-r--r--chromium/net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h44
-rw-r--r--chromium/net/third_party/quiche/src/spdy/platform/api/spdy_mem_slice_test.cc8
-rw-r--r--chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h9
-rw-r--r--chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils_test.cc6
-rw-r--r--chromium/net/third_party/uri_template/DIR_METADATA11
-rw-r--r--chromium/net/third_party/uri_template/OWNERS2
-rw-r--r--chromium/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc6
-rw-r--r--chromium/net/tools/quic/DIR_METADATA11
-rw-r--r--chromium/net/tools/quic/OWNERS2
-rw-r--r--chromium/net/tools/quic/crypto_message_printer_bin.cc2
-rw-r--r--chromium/net/tools/quic/quic_http_proxy_backend.cc2
-rw-r--r--chromium/net/tools/quic/quic_http_proxy_backend.h2
-rw-r--r--chromium/net/tools/quic/quic_http_proxy_backend_stream.cc14
-rw-r--r--chromium/net/tools/quic/quic_http_proxy_backend_stream.h11
-rw-r--r--chromium/net/tools/quic/quic_http_proxy_backend_stream_test.cc34
-rw-r--r--chromium/net/tools/quic/quic_http_proxy_backend_test.cc2
-rw-r--r--chromium/net/tools/stress_cache/stress_cache.cc2
-rw-r--r--chromium/net/tools/testserver/echo_message.py385
-rw-r--r--chromium/net/tools/testserver/run_testserver.cc53
-rwxr-xr-xchromium/net/tools/testserver/testserver.py160
-rw-r--r--chromium/net/tools/testserver/testserver.pydeps1
-rw-r--r--chromium/net/url_request/report_sender.cc5
-rw-r--r--chromium/net/url_request/report_sender.h5
-rw-r--r--chromium/net/url_request/report_sender_unittest.cc26
-rw-r--r--chromium/net/url_request/url_fetcher_core.cc2
-rw-r--r--chromium/net/url_request/url_request.cc2
-rw-r--r--chromium/net/url_request/url_request.h7
-rw-r--r--chromium/net/url_request/url_request_context_builder_unittest.cc2
-rw-r--r--chromium/net/url_request/url_request_http_job.cc45
-rw-r--r--chromium/net/url_request/url_request_http_job_unittest.cc18
-rw-r--r--chromium/net/url_request/url_request_quic_unittest.cc8
-rw-r--r--chromium/net/url_request/url_request_unittest.cc178
-rw-r--r--chromium/net/websockets/DIR_METADATA12
-rw-r--r--chromium/net/websockets/OWNERS3
-rw-r--r--chromium/net/websockets/websocket_basic_handshake_stream.cc28
-rw-r--r--chromium/net/websockets/websocket_basic_handshake_stream.h4
-rw-r--r--chromium/net/websockets/websocket_basic_stream_adapters.cc13
-rw-r--r--chromium/net/websockets/websocket_basic_stream_adapters.h8
-rw-r--r--chromium/net/websockets/websocket_basic_stream_adapters_test.cc44
-rw-r--r--chromium/net/websockets/websocket_channel.cc17
-rw-r--r--chromium/net/websockets/websocket_channel.h5
-rw-r--r--chromium/net/websockets/websocket_channel_test.cc90
-rw-r--r--chromium/net/websockets/websocket_end_to_end_test.cc17
-rw-r--r--chromium/net/websockets/websocket_event_interface.h10
-rw-r--r--chromium/net/websockets/websocket_handshake_stream_create_helper_test.cc15
-rw-r--r--chromium/net/websockets/websocket_http2_handshake_stream.cc34
-rw-r--r--chromium/net/websockets/websocket_http2_handshake_stream.h9
-rw-r--r--chromium/net/websockets/websocket_stream.cc49
-rw-r--r--chromium/net/websockets/websocket_stream.h8
-rw-r--r--chromium/net/websockets/websocket_stream_cookie_test.cc8
-rw-r--r--chromium/net/websockets/websocket_stream_create_test_base.cc5
-rw-r--r--chromium/net/websockets/websocket_stream_create_test_base.h2
-rw-r--r--chromium/net/websockets/websocket_stream_test.cc10
-rw-r--r--chromium/net/websockets/websocket_test_util.cc8
-rw-r--r--chromium/net/websockets/websocket_test_util.h13
1197 files changed, 32569 insertions, 16707 deletions
diff --git a/chromium/net/BUILD.gn b/chromium/net/BUILD.gn
index c399590e2b0..47cd72a16e2 100644
--- a/chromium/net/BUILD.gn
+++ b/chromium/net/BUILD.gn
@@ -103,12 +103,6 @@ if (is_linux || is_chromeos) {
net_configs += [ "//build/config/linux:libresolv" ]
}
-# Reset sources_assignment_filter for the BUILD.gn file to prevent
-# regression during the migration of Chromium away from the feature.
-# See docs/no_sources_assignment_filter.md for more information.
-# TODO(crbug.com/1018739): Remove this when migration is done.
-set_sources_assignment_filter([])
-
source_set("constants") {
sources = [ "base/trace_constants.h" ]
deps = [ "//base" ]
@@ -163,6 +157,8 @@ component("net") {
"base/rand_callback.h",
"base/registry_controlled_domains/registry_controlled_domain.cc",
"base/registry_controlled_domains/registry_controlled_domain.h",
+ "base/schemeful_site.cc",
+ "base/schemeful_site.h",
"base/sockaddr_storage.cc",
"base/sockaddr_storage.h",
"base/sys_addrinfo.h",
@@ -188,8 +184,6 @@ component("net") {
"cert/ct_policy_enforcer.h",
"cert/ct_policy_status.h",
"cert/ct_verifier.h",
- "cert/ct_verify_result.cc",
- "cert/ct_verify_result.h",
"cert/do_nothing_ct_verifier.cc",
"cert/do_nothing_ct_verifier.h",
"cert/internal/cert_error_id.cc",
@@ -445,6 +439,7 @@ component("net") {
"base/host_mapping_rules.cc",
"base/host_mapping_rules.h",
"base/http_user_agent_settings.h",
+ "base/idempotency.h",
"base/isolation_info.cc",
"base/isolation_info.h",
"base/load_flags.h",
@@ -933,7 +928,6 @@ component("net") {
"quic/quic_crypto_client_stream_factory.h",
"quic/quic_event_logger.cc",
"quic/quic_event_logger.h",
- "quic/quic_flags_list.h",
"quic/quic_http3_logger.cc",
"quic/quic_http3_logger.h",
"quic/quic_http_stream.cc",
@@ -952,13 +946,9 @@ component("net") {
"quic/quic_transport_client.h",
"quic/quic_transport_error.cc",
"quic/quic_transport_error.h",
- "quiche/common/platform/impl/quiche_arraysize_impl.h",
- "quiche/common/platform/impl/quiche_endian_impl.h",
"quiche/common/platform/impl/quiche_export_impl.h",
"quiche/common/platform/impl/quiche_logging_impl.h",
"quiche/common/platform/impl/quiche_map_util_impl.h",
- "quiche/common/platform/impl/quiche_optional_impl.h",
- "quiche/common/platform/impl/quiche_ptr_util_impl.h",
"quiche/common/platform/impl/quiche_str_cat_impl.h",
"quiche/common/platform/impl/quiche_string_piece_impl.h",
"quiche/common/platform/impl/quiche_text_utils_impl.h",
@@ -1042,9 +1032,7 @@ component("net") {
"spdy/multiplexed_session.h",
"spdy/platform/impl/spdy_bug_tracker_impl.h",
"spdy/platform/impl/spdy_containers_impl.h",
- "spdy/platform/impl/spdy_endianness_util_impl.h",
"spdy/platform/impl/spdy_estimate_memory_usage_impl.h",
- "spdy/platform/impl/spdy_flags_impl.cc",
"spdy/platform/impl/spdy_flags_impl.h",
"spdy/platform/impl/spdy_logging_impl.h",
"spdy/platform/impl/spdy_macros_impl.h",
@@ -4165,6 +4153,7 @@ test("net_unittests") {
"base/registry_controlled_domains/registry_controlled_domain_unittest.cc",
"base/scheme_host_port_matcher_rule_unittest.cc",
"base/scheme_host_port_matcher_unittest.cc",
+ "base/schemeful_site_unittest.cc",
"base/test_completion_callback_unittest.cc",
"base/test_proxy_delegate.cc",
"base/test_proxy_delegate.h",
diff --git a/chromium/net/DIR_METADATA b/chromium/net/DIR_METADATA
new file mode 100644
index 00000000000..c04cde4ab4b
--- /dev/null
+++ b/chromium/net/DIR_METADATA
@@ -0,0 +1,12 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network"
+}
+team_email: "net-dev@chromium.org" \ No newline at end of file
diff --git a/chromium/net/OWNERS b/chromium/net/OWNERS
index 2ee09fd6d7c..b459edd5520 100644
--- a/chromium/net/OWNERS
+++ b/chromium/net/OWNERS
@@ -1,8 +1,7 @@
agl@chromium.org
-asanka@chromium.org
davidben@chromium.org
+dschinazi@chromium.org
ericorth@chromium.org
-eroman@chromium.org
jkarlin@chromium.org
mattm@chromium.org
mmenke@chromium.org
@@ -10,12 +9,8 @@ morlovich@chromium.org
nharper@chromium.org
pauljensen@chromium.org
rsleevi@chromium.org
-zhongyi@chromium.org
file://net/quic/OWNERS # For QUICHE rolls only.
per-file BUILD.gn=file://net/nqe/OWNERS
per-file BUILD.gn=file://net/websockets/OWNERS
-
-# TEAM: net-dev@chromium.org
-# COMPONENT: Internals>Network
diff --git a/chromium/net/android/BUILD.gn b/chromium/net/android/BUILD.gn
index c8c9afb42be..ff9c668864e 100644
--- a/chromium/net/android/BUILD.gn
+++ b/chromium/net/android/BUILD.gn
@@ -197,7 +197,6 @@ android_library("net_javatests") {
}
java_cpp_template("net_errors_java") {
- package_path = "org/chromium/net"
sources = [ "java/NetError.template" ]
inputs = [ "../base/net_error_list.h" ]
}
diff --git a/chromium/net/android/http_auth_negotiate_android.h b/chromium/net/android/http_auth_negotiate_android.h
index cd72a6a73ee..92943c59db0 100644
--- a/chromium/net/android/http_auth_negotiate_android.h
+++ b/chromium/net/android/http_auth_negotiate_android.h
@@ -12,7 +12,6 @@
#include "base/android/jni_android.h"
#include "base/callback.h"
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/completion_once_callback.h"
#include "net/base/net_export.h"
@@ -69,6 +68,8 @@ class NET_EXPORT_PRIVATE HttpAuthNegotiateAndroid : public HttpAuthMechanism {
// authentication preferences. In particular they include the Android account
// type, which is used to connect to the correct Android Authenticator.
explicit HttpAuthNegotiateAndroid(const HttpAuthPreferences* prefs);
+ HttpAuthNegotiateAndroid(const HttpAuthNegotiateAndroid&) = delete;
+ HttpAuthNegotiateAndroid& operator=(const HttpAuthNegotiateAndroid&) = delete;
~HttpAuthNegotiateAndroid() override;
// HttpAuthMechanism implementation:
@@ -117,8 +118,6 @@ class NET_EXPORT_PRIVATE HttpAuthNegotiateAndroid : public HttpAuthMechanism {
net::CompletionOnceCallback completion_callback_;
base::WeakPtrFactory<HttpAuthNegotiateAndroid> weak_factory_{this};
-
- DISALLOW_COPY_AND_ASSIGN(HttpAuthNegotiateAndroid);
};
} // namespace android
diff --git a/chromium/net/android/network_change_notifier_android.cc b/chromium/net/android/network_change_notifier_android.cc
index 263ac455281..71517829c29 100644
--- a/chromium/net/android/network_change_notifier_android.cc
+++ b/chromium/net/android/network_change_notifier_android.cc
@@ -59,12 +59,12 @@
#include "net/android/network_change_notifier_android.h"
+#include <string>
#include <unordered_set>
#include "base/android/build_info.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/macros.h"
+#include "base/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
#include "base/task/post_task.h"
@@ -97,6 +97,8 @@ class NetworkChangeNotifierAndroid::BlockingThreadObjects {
// We're only interested in tunnel interface changes.
base::BindRepeating(NotifyNetworkChangeNotifierObservers),
std::unordered_set<std::string>()) {}
+ BlockingThreadObjects(const BlockingThreadObjects&) = delete;
+ BlockingThreadObjects& operator=(const BlockingThreadObjects&) = delete;
void Init() {
address_tracker_.Init();
@@ -110,8 +112,6 @@ class NetworkChangeNotifierAndroid::BlockingThreadObjects {
private:
// Used to detect tunnel state changes.
internal::AddressTrackerLinux address_tracker_;
-
- DISALLOW_COPY_AND_ASSIGN(BlockingThreadObjects);
};
NetworkChangeNotifierAndroid::~NetworkChangeNotifierAndroid() {
diff --git a/chromium/net/android/network_change_notifier_android.h b/chromium/net/android/network_change_notifier_android.h
index b96f2cd162c..e38020c37bd 100644
--- a/chromium/net/android/network_change_notifier_android.h
+++ b/chromium/net/android/network_change_notifier_android.h
@@ -9,7 +9,6 @@
#include "base/android/jni_android.h"
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "net/android/network_change_notifier_delegate_android.h"
#include "net/base/net_export.h"
@@ -50,6 +49,9 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid
: public NetworkChangeNotifier,
public NetworkChangeNotifierDelegateAndroid::Observer {
public:
+ NetworkChangeNotifierAndroid(const NetworkChangeNotifierAndroid&) = delete;
+ NetworkChangeNotifierAndroid& operator=(const NetworkChangeNotifierAndroid&) =
+ delete;
~NetworkChangeNotifierAndroid() override;
// NetworkChangeNotifier:
@@ -102,8 +104,6 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierAndroid
std::unique_ptr<BlockingThreadObjects, base::OnTaskRunnerDeleter>
blocking_thread_objects_;
bool force_network_handles_supported_for_testing_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierAndroid);
};
} // namespace net
diff --git a/chromium/net/android/network_change_notifier_delegate_android.h b/chromium/net/android/network_change_notifier_delegate_android.h
index e36d39cce6a..c537f452809 100644
--- a/chromium/net/android/network_change_notifier_delegate_android.h
+++ b/chromium/net/android/network_change_notifier_delegate_android.h
@@ -9,7 +9,6 @@
#include <string>
#include "base/android/jni_android.h"
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list_threadsafe.h"
#include "base/synchronization/lock.h"
@@ -55,6 +54,10 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierDelegateAndroid {
// // Creates Java NetworkChangeNotifierAutoDetect class instance.
// NetworkChangeNotifier.registerToReceiveNotificationsAlways();
NetworkChangeNotifierDelegateAndroid();
+ NetworkChangeNotifierDelegateAndroid(
+ const NetworkChangeNotifierDelegateAndroid&) = delete;
+ NetworkChangeNotifierDelegateAndroid& operator=(
+ const NetworkChangeNotifierDelegateAndroid&) = delete;
~NetworkChangeNotifierDelegateAndroid();
// Called from NetworkChangeNotifier.java on the JNI thread whenever
@@ -172,8 +175,6 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierDelegateAndroid {
double connection_max_bandwidth_;
NetworkHandle default_network_;
NetworkMap network_map_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierDelegateAndroid);
};
} // namespace net
diff --git a/chromium/net/android/network_change_notifier_factory_android.h b/chromium/net/android/network_change_notifier_factory_android.h
index db982e86c10..7e15474a9c6 100644
--- a/chromium/net/android/network_change_notifier_factory_android.h
+++ b/chromium/net/android/network_change_notifier_factory_android.h
@@ -5,8 +5,9 @@
#ifndef NET_ANDROID_NETWORK_CHANGE_NOTIFIER_FACTORY_ANDROID_H_
#define NET_ANDROID_NETWORK_CHANGE_NOTIFIER_FACTORY_ANDROID_H_
+#include <memory>
+
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "net/android/network_change_notifier_delegate_android.h"
#include "net/base/net_export.h"
#include "net/base/network_change_notifier_factory.h"
@@ -25,6 +26,11 @@ class NET_EXPORT NetworkChangeNotifierFactoryAndroid :
// Must be called on the JNI thread.
NetworkChangeNotifierFactoryAndroid();
+ NetworkChangeNotifierFactoryAndroid(
+ const NetworkChangeNotifierFactoryAndroid&) = delete;
+ NetworkChangeNotifierFactoryAndroid& operator=(
+ const NetworkChangeNotifierFactoryAndroid&) = delete;
+
// Must be called on the JNI thread.
~NetworkChangeNotifierFactoryAndroid() override;
@@ -34,8 +40,6 @@ class NET_EXPORT NetworkChangeNotifierFactoryAndroid :
private:
// Delegate passed to the instances created by this class.
NetworkChangeNotifierDelegateAndroid delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierFactoryAndroid);
};
} // namespace net
diff --git a/chromium/net/base/address_tracker_linux.cc b/chromium/net/base/address_tracker_linux.cc
index 2daccb4f91e..03537a91c11 100644
--- a/chromium/net/base/address_tracker_linux.cc
+++ b/chromium/net/base/address_tracker_linux.cc
@@ -10,7 +10,7 @@
#include <sys/ioctl.h>
#include <utility>
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/optional.h"
diff --git a/chromium/net/base/address_tracker_linux.h b/chromium/net/base/address_tracker_linux.h
index a18450dd3ca..8017b3ff5c8 100644
--- a/chromium/net/base/address_tracker_linux.h
+++ b/chromium/net/base/address_tracker_linux.h
@@ -21,7 +21,6 @@
#include "base/compiler_specific.h"
#include "base/files/file_descriptor_watcher_posix.h"
#include "base/files/scoped_file.h"
-#include "base/macros.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread_checker.h"
@@ -96,12 +95,13 @@ class NET_EXPORT_PRIVATE AddressTrackerLinux {
public:
AddressTrackerAutoLock(const AddressTrackerLinux& tracker,
base::Lock& lock);
+ AddressTrackerAutoLock(const AddressTrackerAutoLock&) = delete;
+ AddressTrackerAutoLock& operator=(const AddressTrackerAutoLock&) = delete;
~AddressTrackerAutoLock();
private:
const AddressTrackerLinux& tracker_;
base::Lock& lock_;
- DISALLOW_COPY_AND_ASSIGN(AddressTrackerAutoLock);
};
// A function that returns the name of an interface given the interface index
diff --git a/chromium/net/base/address_tracker_linux_fuzzer.cc b/chromium/net/base/address_tracker_linux_fuzzer.cc
index 449a2425097..124cf3298b5 100644
--- a/chromium/net/base/address_tracker_linux_fuzzer.cc
+++ b/chromium/net/base/address_tracker_linux_fuzzer.cc
@@ -5,7 +5,7 @@
#include <stddef.h>
#include <stdint.h>
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "net/base/address_tracker_linux.h"
namespace net {
diff --git a/chromium/net/base/address_tracker_linux_unittest.cc b/chromium/net/base/address_tracker_linux_unittest.cc
index eff90ed009e..bcf4f064430 100644
--- a/chromium/net/base/address_tracker_linux_unittest.cc
+++ b/chromium/net/base/address_tracker_linux_unittest.cc
@@ -11,7 +11,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/spin_wait.h"
#include "base/test/task_environment.h"
diff --git a/chromium/net/base/backoff_entry.h b/chromium/net/base/backoff_entry.h
index 2c4cd180665..aba8da1d119 100644
--- a/chromium/net/base/backoff_entry.h
+++ b/chromium/net/base/backoff_entry.h
@@ -7,7 +7,6 @@
#include <stdint.h>
-#include "base/macros.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
@@ -70,6 +69,8 @@ class NET_EXPORT BackoffEntry {
// |policy| pointer must be valid but isn't dereferenced during construction.
// |clock| pointer may be null.
BackoffEntry(const Policy* policy, const base::TickClock* clock);
+ BackoffEntry(const BackoffEntry&) = delete;
+ BackoffEntry& operator=(const BackoffEntry&) = delete;
virtual ~BackoffEntry();
// Inform this item that a request for the network resource it is
@@ -127,8 +128,6 @@ class NET_EXPORT BackoffEntry {
const base::TickClock* const clock_; // Not owned.
THREAD_CHECKER(thread_checker_);
-
- DISALLOW_COPY_AND_ASSIGN(BackoffEntry);
};
} // namespace net
diff --git a/chromium/net/base/backoff_entry_serializer_unittest.cc b/chromium/net/base/backoff_entry_serializer_unittest.cc
index 8fcf6549c19..6c30f974dce 100644
--- a/chromium/net/base/backoff_entry_serializer_unittest.cc
+++ b/chromium/net/base/backoff_entry_serializer_unittest.cc
@@ -4,7 +4,6 @@
#include "net/base/backoff_entry.h"
-#include "base/macros.h"
#include "base/time/tick_clock.h"
#include "base/values.h"
#include "net/base/backoff_entry_serializer.h"
@@ -31,6 +30,8 @@ BackoffEntry::Policy base_policy = {
class TestTickClock : public base::TickClock {
public:
TestTickClock() = default;
+ TestTickClock(const TestTickClock&) = delete;
+ TestTickClock& operator=(const TestTickClock&) = delete;
~TestTickClock() override = default;
TimeTicks NowTicks() const override { return now_ticks_; }
@@ -38,8 +39,6 @@ class TestTickClock : public base::TickClock {
private:
TimeTicks now_ticks_;
-
- DISALLOW_COPY_AND_ASSIGN(TestTickClock);
};
TEST(BackoffEntrySerializerTest, SerializeNoFailures) {
diff --git a/chromium/net/base/backoff_entry_unittest.cc b/chromium/net/base/backoff_entry_unittest.cc
index 191097a0ec6..6a18a38a5d8 100644
--- a/chromium/net/base/backoff_entry_unittest.cc
+++ b/chromium/net/base/backoff_entry_unittest.cc
@@ -4,7 +4,6 @@
#include "net/base/backoff_entry.h"
-#include "base/macros.h"
#include "base/time/tick_clock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,6 +19,8 @@ BackoffEntry::Policy base_policy = { 0, 1000, 2.0, 0.0, 20000, 2000, false };
class TestTickClock : public base::TickClock {
public:
TestTickClock() = default;
+ TestTickClock(const TestTickClock&) = delete;
+ TestTickClock& operator=(const TestTickClock&) = delete;
~TestTickClock() override = default;
TimeTicks NowTicks() const override { return now_ticks_; }
@@ -27,7 +28,6 @@ class TestTickClock : public base::TickClock {
private:
TimeTicks now_ticks_;
- DISALLOW_COPY_AND_ASSIGN(TestTickClock);
};
TEST(BackoffEntryTest, BaseTest) {
diff --git a/chromium/net/base/chunked_upload_data_stream.cc b/chromium/net/base/chunked_upload_data_stream.cc
index a3a63d9790a..9e812f379d9 100644
--- a/chromium/net/base/chunked_upload_data_stream.cc
+++ b/chromium/net/base/chunked_upload_data_stream.cc
@@ -27,11 +27,7 @@ ChunkedUploadDataStream::Writer::Writer(
: upload_data_stream_(upload_data_stream) {}
ChunkedUploadDataStream::ChunkedUploadDataStream(int64_t identifier)
- : UploadDataStream(true, identifier),
- read_index_(0),
- read_offset_(0),
- all_data_appended_(false),
- read_buffer_len_(0) {}
+ : UploadDataStream(true, identifier) {}
ChunkedUploadDataStream::~ChunkedUploadDataStream() = default;
diff --git a/chromium/net/base/chunked_upload_data_stream.h b/chromium/net/base/chunked_upload_data_stream.h
index 50f644f94bf..117765d5370 100644
--- a/chromium/net/base/chunked_upload_data_stream.h
+++ b/chromium/net/base/chunked_upload_data_stream.h
@@ -11,7 +11,6 @@
#include <memory>
#include <vector>
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/net_export.h"
@@ -36,6 +35,8 @@ class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream {
// The writer may only be used on the ChunkedUploadDataStream's thread.
class NET_EXPORT Writer {
public:
+ Writer(const Writer&) = delete;
+ Writer& operator=(const Writer&) = delete;
~Writer();
// Adds data to the stream. |is_done| should be true if this is the last
@@ -53,12 +54,12 @@ class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream {
explicit Writer(base::WeakPtr<ChunkedUploadDataStream> upload_data_stream);
const base::WeakPtr<ChunkedUploadDataStream> upload_data_stream_;
-
- DISALLOW_COPY_AND_ASSIGN(Writer);
};
explicit ChunkedUploadDataStream(int64_t identifier);
+ ChunkedUploadDataStream(const ChunkedUploadDataStream&) = delete;
+ ChunkedUploadDataStream& operator=(const ChunkedUploadDataStream&) = delete;
~ChunkedUploadDataStream() override;
// Creates a Writer for appending data to |this|. It's generally expected
@@ -85,22 +86,20 @@ class NET_EXPORT ChunkedUploadDataStream : public UploadDataStream {
int ReadChunk(IOBuffer* buf, int buf_len);
// Index and offset of next element of |upload_data_| to be read.
- size_t read_index_;
- size_t read_offset_;
+ size_t read_index_ = 0;
+ size_t read_offset_ = 0;
// True once all data has been appended to the stream.
- bool all_data_appended_;
+ bool all_data_appended_ = false;
std::vector<std::unique_ptr<std::vector<char>>> upload_data_;
// Buffer to write the next read's data to. Only set when a call to
// ReadInternal reads no data.
scoped_refptr<IOBuffer> read_buffer_;
- int read_buffer_len_;
+ int read_buffer_len_ = 0;
base::WeakPtrFactory<ChunkedUploadDataStream> weak_factory_{this};
-
- DISALLOW_COPY_AND_ASSIGN(ChunkedUploadDataStream);
};
} // namespace net
diff --git a/chromium/net/base/directory_lister.h b/chromium/net/base/directory_lister.h
index c9862735f00..e0318850ed8 100644
--- a/chromium/net/base/directory_lister.h
+++ b/chromium/net/base/directory_lister.h
@@ -11,7 +11,6 @@
#include "base/atomicops.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
@@ -45,7 +44,7 @@ class NET_EXPORT DirectoryLister {
virtual void OnListDone(int error) = 0;
protected:
- virtual ~DirectoryListerDelegate() {}
+ virtual ~DirectoryListerDelegate() = default;
};
// Listing options
@@ -66,6 +65,9 @@ class NET_EXPORT DirectoryLister {
ListingType type,
DirectoryListerDelegate* delegate);
+ DirectoryLister(const DirectoryLister&) = delete;
+ DirectoryLister& operator=(const DirectoryLister&) = delete;
+
// Will invoke Cancel().
~DirectoryLister();
@@ -89,6 +91,8 @@ class NET_EXPORT DirectoryLister {
class Core : public base::RefCountedThreadSafe<Core> {
public:
Core(const base::FilePath& dir, ListingType type, DirectoryLister* lister);
+ Core(const Core&) = delete;
+ Core& operator=(const Core&) = delete;
// May only be called on a worker pool thread.
void Start();
@@ -120,8 +124,6 @@ class NET_EXPORT DirectoryLister {
// worker pool thread for performance reasons and to ensure |lister_| isn't
// called after cancellation on the origin thread.
base::subtle::Atomic32 cancelled_;
-
- DISALLOW_COPY_AND_ASSIGN(Core);
};
// Call into the corresponding DirectoryListerDelegate. Must not be called
@@ -131,8 +133,6 @@ class NET_EXPORT DirectoryLister {
scoped_refptr<Core> core_;
DirectoryListerDelegate* const delegate_;
-
- DISALLOW_COPY_AND_ASSIGN(DirectoryLister);
};
} // namespace net
diff --git a/chromium/net/base/elements_upload_data_stream.cc b/chromium/net/base/elements_upload_data_stream.cc
index 70b9e2bf66a..a5f31896bda 100644
--- a/chromium/net/base/elements_upload_data_stream.cc
+++ b/chromium/net/base/elements_upload_data_stream.cc
@@ -4,6 +4,8 @@
#include "net/base/elements_upload_data_stream.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/check_op.h"
#include "net/base/io_buffer.h"
diff --git a/chromium/net/base/elements_upload_data_stream.h b/chromium/net/base/elements_upload_data_stream.h
index ba8f9457e7c..0806a9ec6ee 100644
--- a/chromium/net/base/elements_upload_data_stream.h
+++ b/chromium/net/base/elements_upload_data_stream.h
@@ -11,7 +11,6 @@
#include <memory>
#include <vector>
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "net/base/net_export.h"
@@ -30,6 +29,9 @@ class NET_EXPORT ElementsUploadDataStream : public UploadDataStream {
std::vector<std::unique_ptr<UploadElementReader>> element_readers,
int64_t identifier);
+ ElementsUploadDataStream(const ElementsUploadDataStream&) = delete;
+ ElementsUploadDataStream& operator=(const ElementsUploadDataStream&) = delete;
+
~ElementsUploadDataStream() override;
// Creates an ElementsUploadDataStream with a single reader. Returns a
@@ -81,8 +83,6 @@ class NET_EXPORT ElementsUploadDataStream : public UploadDataStream {
int read_error_;
base::WeakPtrFactory<ElementsUploadDataStream> weak_ptr_factory_{this};
-
- DISALLOW_COPY_AND_ASSIGN(ElementsUploadDataStream);
};
} // namespace net
diff --git a/chromium/net/base/expiring_cache.h b/chromium/net/base/expiring_cache.h
index 8f79800b09c..c64c768348d 100644
--- a/chromium/net/base/expiring_cache.h
+++ b/chromium/net/base/expiring_cache.h
@@ -11,7 +11,6 @@
#include <utility>
#include "base/gtest_prod_util.h"
-#include "base/macros.h"
#include "base/time/time.h"
namespace net {
@@ -74,6 +73,10 @@ template <typename KeyType,
ValueType,
ExpirationType> >
class ExpiringCache {
+ public:
+ ExpiringCache(const ExpiringCache&) = delete;
+ ExpiringCache& operator=(const ExpiringCache&) = delete;
+
private:
// Intentionally violate the C++ Style Guide so that EntryMap is known to be
// a dependent type. Without this, Clang's two-phase lookup complains when
@@ -96,7 +99,7 @@ class ExpiringCache {
: cache_(cache),
it_(cache_.entries_.begin()) {
}
- ~Iterator() {}
+ ~Iterator() = default;
bool HasNext() const { return it_ != cache_.entries_.end(); }
void Advance() { ++it_; }
@@ -211,8 +214,6 @@ class ExpiringCache {
EntryMap entries_;
ExpirationCompare expiration_comp_;
EvictionHandler eviction_handler_;
-
- DISALLOW_COPY_AND_ASSIGN(ExpiringCache);
};
} // namespace net
diff --git a/chromium/net/base/features.cc b/chromium/net/base/features.cc
index 8c19303eceb..90b9cfe31a3 100644
--- a/chromium/net/base/features.cc
+++ b/chromium/net/base/features.cc
@@ -17,6 +17,16 @@ const base::Feature kAcceptLanguageHeader{"AcceptLanguageHeader",
const base::Feature kCapReferrerToOriginOnCrossOrigin{
"CapReferrerToOriginOnCrossOrigin", base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kDnsTransactionDynamicTimeouts{
+ "DnsTransactionDynamicTimeouts", base::FEATURE_DISABLED_BY_DEFAULT};
+
+const base::FeatureParam<double> kDnsTransactionTimeoutMultiplier{
+ &kDnsTransactionDynamicTimeouts, "DnsTransactionTimeoutMultiplier", 7.5};
+
+const base::FeatureParam<base::TimeDelta> kDnsMinTransactionTimeout{
+ &kDnsTransactionDynamicTimeouts, "DnsMinTransactionTimeout",
+ base::TimeDelta::FromSeconds(12)};
+
const base::Feature kDnsHttpssvc{"DnsHttpssvc",
base::FEATURE_DISABLED_BY_DEFAULT};
@@ -82,6 +92,10 @@ const base::Feature kPartitionExpectCTStateByNetworkIsolationKey{
"PartitionExpectCTStateByNetworkIsolationKey",
base::FEATURE_DISABLED_BY_DEFAULT};
+const base::Feature kPartitionNelAndReportingByNetworkIsolationKey{
+ "PartitionNelAndReportingByNetworkIsolationKey",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+
const base::Feature kExpectCTPruning{"ExpectCTPruning",
base::FEATURE_ENABLED_BY_DEFAULT};
@@ -121,22 +135,6 @@ const base::Feature kShortLaxAllowUnsafeThreshold{
const base::Feature kSameSiteDefaultChecksMethodRigorously{
"SameSiteDefaultChecksMethodRigorously", base::FEATURE_DISABLED_BY_DEFAULT};
-const base::Feature kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics{
- "RecentHttpSameSiteAccessGrantsLegacyCookieSemantics",
- base::FEATURE_DISABLED_BY_DEFAULT};
-const base::FeatureParam<int>
- kRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsMilliseconds{
- &kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics,
- "RecentHttpSameSiteAccessGrantsLegacyCookieSemanticsMilliseconds", 0};
-
-const base::Feature kRecentCreationTimeGrantsLegacyCookieSemantics{
- "RecentCreationTimeGrantsLegacyCookieSemantics",
- base::FEATURE_DISABLED_BY_DEFAULT};
-const base::FeatureParam<int>
- kRecentCreationTimeGrantsLegacyCookieSemanticsMilliseconds{
- &kRecentCreationTimeGrantsLegacyCookieSemantics,
- "RecentCreationTimeGrantsLegacyCookieSemanticsMilliseconds", 0};
-
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
const base::Feature kCertVerifierBuiltinFeature{
"CertVerifierBuiltin", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chromium/net/base/features.h b/chromium/net/base/features.h
index 491b1e574f1..0baa0d60386 100644
--- a/chromium/net/base/features.h
+++ b/chromium/net/base/features.h
@@ -28,6 +28,16 @@ NET_EXPORT extern const base::Feature kCapReferrerToOriginOnCrossOrigin;
// Enables TLS 1.3 early data.
NET_EXPORT extern const base::Feature kEnableTLS13EarlyData;
+// Support for altering the parameters used for DNS transaction timeout. See
+// ResolveContext::SecureTransactionTimeout().
+NET_EXPORT extern const base::Feature kDnsTransactionDynamicTimeouts;
+// Multiplier applied to current fallback periods in determining a transaction
+// timeout.
+NET_EXPORT extern const base::FeatureParam<double>
+ kDnsTransactionTimeoutMultiplier;
+NET_EXPORT extern const base::FeatureParam<base::TimeDelta>
+ kDnsMinTransactionTimeout;
+
// Enables DNS queries for HTTPSSVC or INTEGRITY records, depending on feature
// parameters. These queries will only be made over DoH. HTTPSSVC responses may
// cause us to upgrade the URL to HTTPS and/or to attempt QUIC.
@@ -126,6 +136,18 @@ NET_EXPORT extern const base::Feature
NET_EXPORT extern const base::Feature
kPartitionExpectCTStateByNetworkIsolationKey;
+// Partitions Network Error Logging and Reporting API data by
+// NetworkIsolationKey. Also partitions all reports generated by other consumers
+// of the reporting API. Applies the NetworkIsolationKey to reports uploads as
+// well.
+//
+// When disabled, the main entry points of the reporting and NEL services ignore
+// NetworkIsolationKey parameters, and they're cleared while loading from the
+// cache, but internal objects can be created with them (e.g., endpoints), for
+// testing.
+NET_EXPORT extern const base::Feature
+ kPartitionNelAndReportingByNetworkIsolationKey;
+
// Enables limiting the size of Expect-CT table.
NET_EXPORT extern const base::Feature kExpectCTPruning;
@@ -190,29 +212,6 @@ NET_EXPORT extern const base::Feature kShortLaxAllowUnsafeThreshold;
// This only has an effect if the cookie defaults to SameSite=Lax.
NET_EXPORT extern const base::Feature kSameSiteDefaultChecksMethodRigorously;
-// If this is set and has a non-zero param value, any access to a cookie will be
-// granted Legacy access semantics if the last access to a cookie with the same
-// (name, domain, path) from a context that is same-site and permits
-// HttpOnly access occurred less than (param value) milliseconds ago. The last
-// eligible access must have occurred in the current browser session (i.e. it
-// does not persist across sessions). This feature does nothing if
-// kCookiesWithoutSameSiteMustBeSecure is not enabled.
-NET_EXPORT extern const base::Feature
- kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics;
-NET_EXPORT extern const base::FeatureParam<int>
- kRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsMilliseconds;
-
-// Recently created cookies are granted legacy access semantics. If this is set
-// and has a non-zero integer param value, then for the first (param value)
-// milliseconds after the cookie is created, the cookie will behave as if it
-// were "legacy" i.e. not handled according to SameSiteByDefaultCookies/
-// CookiesWithoutSameSiteMustBeSecure rules.
-// This does nothing if SameSiteByDefaultCookies is not enabled.
-NET_EXPORT extern const base::Feature
- kRecentCreationTimeGrantsLegacyCookieSemantics;
-NET_EXPORT extern const base::FeatureParam<int>
- kRecentCreationTimeGrantsLegacyCookieSemanticsMilliseconds;
-
#if BUILDFLAG(BUILTIN_CERT_VERIFIER_FEATURE_SUPPORTED)
// When enabled, use the builtin cert verifier instead of the platform verifier.
NET_EXPORT extern const base::Feature kCertVerifierBuiltinFeature;
diff --git a/chromium/net/base/file_stream.h b/chromium/net/base/file_stream.h
index 501bc975889..60f58bdd12f 100644
--- a/chromium/net/base/file_stream.h
+++ b/chromium/net/base/file_stream.h
@@ -15,7 +15,6 @@
#include <memory>
#include "base/files/file.h"
-#include "base/macros.h"
#include "net/base/completion_once_callback.h"
#include "net/base/net_export.h"
@@ -40,6 +39,8 @@ class NET_EXPORT FileStream {
FileStream(base::File file,
const scoped_refptr<base::TaskRunner>& task_runner);
+ FileStream(const FileStream&) = delete;
+ FileStream& operator=(const FileStream&) = delete;
// The underlying file is closed automatically.
virtual ~FileStream();
@@ -165,8 +166,6 @@ class NET_EXPORT FileStream {
// without explicitly calling Close, the file should be closed asynchronously
// without delaying FileStream's destructor.
std::unique_ptr<Context> context_;
-
- DISALLOW_COPY_AND_ASSIGN(FileStream);
};
} // namespace net
diff --git a/chromium/net/base/file_stream_context.h b/chromium/net/base/file_stream_context.h
index 7aae431b4d1..2b5009a00cf 100644
--- a/chromium/net/base/file_stream_context.h
+++ b/chromium/net/base/file_stream_context.h
@@ -31,7 +31,6 @@
#include "base/files/file.h"
#include "base/logging.h"
-#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_pump_for_io.h"
#include "base/single_thread_task_runner.h"
@@ -57,6 +56,7 @@ class FileStream::Context : public base::MessagePumpForIO::IOHandler {
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
class FileStream::Context {
#endif
+
public:
////////////////////////////////////////////////////////////////////////////
// Platform-dependent methods implemented in
@@ -65,6 +65,8 @@ class FileStream::Context {
explicit Context(scoped_refptr<base::TaskRunner> task_runner);
Context(base::File file, scoped_refptr<base::TaskRunner> task_runner);
+ Context(const Context&) = delete;
+ Context& operator=(const Context&) = delete;
#if defined(OS_WIN)
~Context() override;
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
@@ -118,12 +120,11 @@ class FileStream::Context {
OpenResult(base::File file, IOResult error_code);
OpenResult(OpenResult&& other);
OpenResult& operator=(OpenResult&& other);
+ OpenResult(const OpenResult&) = delete;
+ OpenResult& operator=(const OpenResult&) = delete;
base::File file;
IOResult error_code;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(OpenResult);
};
////////////////////////////////////////////////////////////////////////////
@@ -240,8 +241,6 @@ class FileStream::Context {
// Tracks the result of the IO completion operation. Set in OnIOComplete.
int result_ = 0;
#endif
-
- DISALLOW_COPY_AND_ASSIGN(Context);
};
} // namespace net
diff --git a/chromium/net/base/file_stream_context_posix.cc b/chromium/net/base/file_stream_context_posix.cc
index 17af1b948ab..e487633e366 100644
--- a/chromium/net/base/file_stream_context_posix.cc
+++ b/chromium/net/base/file_stream_context_posix.cc
@@ -8,8 +8,8 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/check.h"
#include "base/files/file_path.h"
#include "base/location.h"
diff --git a/chromium/net/base/file_stream_unittest.cc b/chromium/net/base/file_stream_unittest.cc
index b918da2f8e3..94023cb5d82 100644
--- a/chromium/net/base/file_stream_unittest.cc
+++ b/chromium/net/base/file_stream_unittest.cc
@@ -4,6 +4,7 @@
#include "net/base/file_stream.h"
+#include <string>
#include <utility>
#include "base/bind.h"
@@ -513,6 +514,11 @@ class TestWriteReadCompletionCallback {
base::MakeRefCounted<DrainableIOBuffer>(CreateTestDataBuffer(),
kTestDataSize)) {}
+ TestWriteReadCompletionCallback(const TestWriteReadCompletionCallback&) =
+ delete;
+ TestWriteReadCompletionCallback& operator=(
+ const TestWriteReadCompletionCallback&) = delete;
+
int WaitForResult() {
DCHECK(!waiting_for_result_);
while (!have_result_) {
@@ -591,8 +597,6 @@ class TestWriteReadCompletionCallback {
int* total_bytes_read_;
std::string* data_read_;
scoped_refptr<DrainableIOBuffer> drainable_;
-
- DISALLOW_COPY_AND_ASSIGN(TestWriteReadCompletionCallback);
};
TEST_F(FileStreamTest, WriteRead) {
@@ -650,6 +654,10 @@ class TestWriteCloseCompletionCallback {
drainable_(
base::MakeRefCounted<DrainableIOBuffer>(CreateTestDataBuffer(),
kTestDataSize)) {}
+ TestWriteCloseCompletionCallback(const TestWriteCloseCompletionCallback&) =
+ delete;
+ TestWriteCloseCompletionCallback& operator=(
+ const TestWriteCloseCompletionCallback&) = delete;
int WaitForResult() {
DCHECK(!waiting_for_result_);
@@ -698,8 +706,6 @@ class TestWriteCloseCompletionCallback {
FileStream* stream_;
int* total_bytes_written_;
scoped_refptr<DrainableIOBuffer> drainable_;
-
- DISALLOW_COPY_AND_ASSIGN(TestWriteCloseCompletionCallback);
};
TEST_F(FileStreamTest, WriteClose) {
diff --git a/chromium/net/base/filename_util.cc b/chromium/net/base/filename_util.cc
index 1471fb96757..0ca1ed83180 100644
--- a/chromium/net/base/filename_util.cc
+++ b/chromium/net/base/filename_util.cc
@@ -32,31 +32,26 @@ GURL FilePathToFileURL(const base::FilePath& path) {
// "file://///server/path" for UNC. The URL canonicalizer will fix up the
// latter case to be the canonical UNC form: "file://server/path"
base::FilePath::StringType url_string(kFileURLPrefix);
- url_string.append(path.value());
- // Now do replacement of some characters. Since we assume the input is a
- // literal filename, anything the URL parser might consider special should
- // be escaped here.
-
- // must be the first substitution since others will introduce percents as the
- // escape character
- base::ReplaceSubstringsAfterOffset(
- &url_string, 0, FILE_PATH_LITERAL("%"), FILE_PATH_LITERAL("%25"));
-
- // semicolon is supposed to be some kind of separator according to RFC 2396
- base::ReplaceSubstringsAfterOffset(
- &url_string, 0, FILE_PATH_LITERAL(";"), FILE_PATH_LITERAL("%3B"));
-
- base::ReplaceSubstringsAfterOffset(
- &url_string, 0, FILE_PATH_LITERAL("#"), FILE_PATH_LITERAL("%23"));
-
- base::ReplaceSubstringsAfterOffset(
- &url_string, 0, FILE_PATH_LITERAL("?"), FILE_PATH_LITERAL("%3F"));
+ // GURL() strips some whitespace and trailing control chars which are valid
+ // in file paths. It also interprets chars such as `%;#?` and maybe `\`, so we
+ // must percent encode these first. Reserve max possible length up front.
+ url_string.reserve(url_string.size() + (3 * path.value().size()));
+ for (auto c : path.value()) {
+ if (c == '%' || c == ';' || c == '#' || c == '?' ||
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
- base::ReplaceSubstringsAfterOffset(
- &url_string, 0, FILE_PATH_LITERAL("\\"), FILE_PATH_LITERAL("%5C"));
+ c == '\\' ||
#endif
+ c <= ' ') {
+ static const char kHexChars[] = "0123456789ABCDEF";
+ url_string += '%';
+ url_string += kHexChars[(c >> 4) & 0xf];
+ url_string += kHexChars[c & 0xf];
+ } else {
+ url_string += c;
+ }
+ }
return GURL(base::AsCrossPlatformPiece(url_string));
}
diff --git a/chromium/net/base/filename_util_unittest.cc b/chromium/net/base/filename_util_unittest.cc
index 8e3b6602669..8610b66754a 100644
--- a/chromium/net/base/filename_util_unittest.cc
+++ b/chromium/net/base/filename_util_unittest.cc
@@ -192,13 +192,15 @@ TEST(FilenameUtilTest, FileURLConversion) {
// Other percent-encoded characters that are left alone when displaying a
// URL are decoded in a file path (https://crbug.com/585422).
{L"C:\\foo\\\U0001F512.txt",
- "file:///C:/foo/%F0%9F%94%92.txt"}, // Blocked.
- {L"C:\\foo\\\u2001.txt", "file:///C:/foo/%E2%80%81.txt"}, // Blocked.
+ "file:///C:/foo/%F0%9F%94%92.txt"}, // Blocked.
+ {L"C:\\foo\\\u2001.txt", "file:///C:/foo/%E2%80%81.txt"}, // Blocked.
+ {L"C:\\foo\\\a\tbar\n ", "file:///C:/foo/%07%09bar%0A%20"}, // Blocked.
#elif defined(OS_POSIX) || defined(OS_FUCHSIA)
{L"/foo/bar.txt", "file:///foo/bar.txt"},
{L"/foo/BAR.txt", "file:///foo/BAR.txt"},
{L"/C:/foo/bar.txt", "file:///C:/foo/bar.txt"},
{L"/foo/bar?.txt", "file:///foo/bar%3F.txt"},
+ {L"/foo/\a\tbar\n ", "file:///foo/%07%09bar%0A%20"},
// %5C ('\\') is not special on POSIX, and is therefore decoded as normal.
{L"/foo/..\\bar", "file:///foo/..%5Cbar"},
{L"/some computer/foo/bar.txt", "file:///some%20computer/foo/bar.txt"},
diff --git a/chromium/net/base/http_user_agent_settings.h b/chromium/net/base/http_user_agent_settings.h
index eb3b2d00f59..9fed104e1fa 100644
--- a/chromium/net/base/http_user_agent_settings.h
+++ b/chromium/net/base/http_user_agent_settings.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/macros.h"
#include "net/base/net_export.h"
namespace net {
@@ -16,17 +15,16 @@ namespace net {
// and User-Agent header values.
class NET_EXPORT HttpUserAgentSettings {
public:
- HttpUserAgentSettings() {}
- virtual ~HttpUserAgentSettings() {}
+ HttpUserAgentSettings() = default;
+ HttpUserAgentSettings(const HttpUserAgentSettings&) = delete;
+ HttpUserAgentSettings& operator=(const HttpUserAgentSettings&) = delete;
+ virtual ~HttpUserAgentSettings() = default;
// Gets the value of 'Accept-Language' header field.
virtual std::string GetAcceptLanguage() const = 0;
// Gets the UA string.
virtual std::string GetUserAgent() const = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(HttpUserAgentSettings);
};
} // namespace net
diff --git a/chromium/net/base/idempotency.h b/chromium/net/base/idempotency.h
new file mode 100644
index 00000000000..d1b394d10b7
--- /dev/null
+++ b/chromium/net/base/idempotency.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_IDEMPOTENCY_H_
+#define NET_BASE_IDEMPOTENCY_H_
+
+namespace net {
+
+// Idempotency of the request, which determines that if it is safe to enable
+// 0-RTT for the request. By default, 0-RTT is only enabled for safe
+// HTTP methods, i.e., GET, HEAD, OPTIONS, and TRACE. For other methods,
+// enabling 0-RTT may cause security issues since a network observer can replay
+// the request. If the request has any side effects, those effects can happen
+// multiple times. It is only safe to enable the 0-RTT if it is known that
+// the request is idempotent.
+// A Java counterpart will be generated for this enum.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net
+// GENERATED_JAVA_CLASS_NAME_OVERRIDE: Idempotency
+enum Idempotency {
+ DEFAULT_IDEMPOTENCY = 0,
+ IDEMPOTENT = 1,
+ NOT_IDEMPOTENT = 2,
+};
+
+} // namespace net
+
+#endif // NET_BASE_IDEMPOTENCY_H_
diff --git a/chromium/net/base/isolation_info.cc b/chromium/net/base/isolation_info.cc
index 0fda1458378..0980f71fd84 100644
--- a/chromium/net/base/isolation_info.cc
+++ b/chromium/net/base/isolation_info.cc
@@ -36,14 +36,14 @@ bool ValidateSameSite(const url::Origin& origin,
// descriptions of consistent sets of values. Also allows values used by the
// 0-argument constructor. Additionally, |opaque_and_non_transient| can only be
// true if both origins are opaque and |site_for_cookies| is null.
-bool IsConsistent(IsolationInfo::RedirectMode redirect_mode,
+bool IsConsistent(IsolationInfo::RequestType request_type,
const base::Optional<url::Origin>& top_frame_origin,
const base::Optional<url::Origin>& frame_origin,
const SiteForCookies& site_for_cookies,
bool opaque_and_non_transient) {
// Check for the default-constructed case.
if (!top_frame_origin) {
- return redirect_mode == IsolationInfo::RedirectMode::kUpdateNothing &&
+ return request_type == IsolationInfo::RequestType::kOther &&
!frame_origin && site_for_cookies.IsNull() &&
!opaque_and_non_transient;
}
@@ -58,13 +58,13 @@ bool IsConsistent(IsolationInfo::RedirectMode redirect_mode,
return false;
if (opaque_and_non_transient) {
- return (redirect_mode == IsolationInfo::RedirectMode::kUpdateNothing &&
+ return (request_type == IsolationInfo::RequestType::kOther &&
top_frame_origin->opaque() && top_frame_origin == frame_origin &&
site_for_cookies.IsNull());
}
- switch (redirect_mode) {
- case IsolationInfo::RedirectMode::kUpdateTopFrame:
+ switch (request_type) {
+ case IsolationInfo::RequestType::kMainFrame:
// TODO(https://crbug.com/1056706): Check that |top_frame_origin| and
// |frame_origin| are the same, once the ViewSource code creates a
// consistent IsolationInfo object.
@@ -72,12 +72,12 @@ bool IsConsistent(IsolationInfo::RedirectMode redirect_mode,
// TODO(https://crbug.com/1060631): Once CreatePartial() is removed, check
// if SiteForCookies is non-null if the scheme is HTTP or HTTPS.
return true;
- case IsolationInfo::RedirectMode::kUpdateFrameOnly:
+ case IsolationInfo::RequestType::kSubFrame:
// For subframe navigations, the subframe's origin may not be consistent
// with the SiteForCookies, so SameSite cookies may be sent if there's a
// redirect to main frames site.
return true;
- case IsolationInfo::RedirectMode::kUpdateNothing:
+ case IsolationInfo::RequestType::kOther:
// SiteForCookies must consistent with the frame origin as well for
// subresources.
return ValidateSameSite(*frame_origin, site_for_cookies);
@@ -87,7 +87,7 @@ bool IsConsistent(IsolationInfo::RedirectMode redirect_mode,
} // namespace
IsolationInfo::IsolationInfo()
- : IsolationInfo(RedirectMode::kUpdateNothing,
+ : IsolationInfo(RequestType::kOther,
base::nullopt,
base::nullopt,
SiteForCookies(),
@@ -101,8 +101,7 @@ IsolationInfo& IsolationInfo::operator=(IsolationInfo&&) = default;
IsolationInfo IsolationInfo::CreateForInternalRequest(
const url::Origin& top_frame_origin) {
- return IsolationInfo(RedirectMode::kUpdateNothing, top_frame_origin,
- top_frame_origin,
+ return IsolationInfo(RequestType::kOther, top_frame_origin, top_frame_origin,
SiteForCookies::FromOrigin(top_frame_origin),
false /* opaque_and_non_transient */);
}
@@ -113,30 +112,29 @@ IsolationInfo IsolationInfo::CreateTransient() {
IsolationInfo IsolationInfo::CreateOpaqueAndNonTransient() {
url::Origin opaque_origin;
- return IsolationInfo(RedirectMode::kUpdateNothing, opaque_origin,
- opaque_origin, SiteForCookies(),
- true /* opaque_and_non_transient */);
+ return IsolationInfo(RequestType::kOther, opaque_origin, opaque_origin,
+ SiteForCookies(), true /* opaque_and_non_transient */);
}
-IsolationInfo IsolationInfo::Create(RedirectMode redirect_mode,
+IsolationInfo IsolationInfo::Create(RequestType request_type,
const url::Origin& top_frame_origin,
const url::Origin& frame_origin,
const SiteForCookies& site_for_cookies) {
- return IsolationInfo(redirect_mode, top_frame_origin, frame_origin,
+ return IsolationInfo(request_type, top_frame_origin, frame_origin,
site_for_cookies, false /* opaque_and_non_transient */);
}
IsolationInfo IsolationInfo::CreatePartial(
- RedirectMode redirect_mode,
+ RequestType request_type,
const net::NetworkIsolationKey& network_isolation_key) {
if (!network_isolation_key.IsFullyPopulated())
return IsolationInfo();
- url::Origin top_frame_origin = *network_isolation_key.GetTopFrameOrigin();
+ url::Origin top_frame_origin = *network_isolation_key.GetTopFrameSite();
url::Origin frame_origin;
- if (network_isolation_key.GetFrameOrigin().has_value()) {
- frame_origin = *network_isolation_key.GetFrameOrigin();
- } else if (redirect_mode == RedirectMode::kUpdateTopFrame) {
+ if (network_isolation_key.GetFrameSite().has_value()) {
+ frame_origin = *network_isolation_key.GetFrameSite();
+ } else if (request_type == RequestType::kMainFrame) {
frame_origin = top_frame_origin;
} else {
frame_origin = url::Origin();
@@ -146,42 +144,42 @@ IsolationInfo IsolationInfo::CreatePartial(
frame_origin.opaque() &&
!network_isolation_key.IsTransient();
- return IsolationInfo(redirect_mode, top_frame_origin, frame_origin,
+ return IsolationInfo(request_type, top_frame_origin, frame_origin,
SiteForCookies(), opaque_and_non_transient);
}
base::Optional<IsolationInfo> IsolationInfo::CreateIfConsistent(
- RedirectMode redirect_mode,
+ RequestType request_type,
const base::Optional<url::Origin>& top_frame_origin,
const base::Optional<url::Origin>& frame_origin,
const SiteForCookies& site_for_cookies,
bool opaque_and_non_transient) {
- if (!IsConsistent(redirect_mode, top_frame_origin, frame_origin,
+ if (!IsConsistent(request_type, top_frame_origin, frame_origin,
site_for_cookies, opaque_and_non_transient)) {
return base::nullopt;
}
- return IsolationInfo(redirect_mode, top_frame_origin, frame_origin,
+ return IsolationInfo(request_type, top_frame_origin, frame_origin,
site_for_cookies, opaque_and_non_transient);
}
IsolationInfo IsolationInfo::CreateForRedirect(
const url::Origin& new_origin) const {
- if (redirect_mode_ == RedirectMode::kUpdateNothing)
+ if (request_type_ == RequestType::kOther)
return *this;
- if (redirect_mode_ == RedirectMode::kUpdateFrameOnly) {
- return IsolationInfo(redirect_mode_, top_frame_origin_, new_origin,
+ if (request_type_ == RequestType::kSubFrame) {
+ return IsolationInfo(request_type_, top_frame_origin_, new_origin,
site_for_cookies_, opaque_and_non_transient_);
}
- DCHECK_EQ(RedirectMode::kUpdateTopFrame, redirect_mode_);
- return IsolationInfo(redirect_mode_, new_origin, new_origin,
+ DCHECK_EQ(RequestType::kMainFrame, request_type_);
+ return IsolationInfo(request_type_, new_origin, new_origin,
SiteForCookies::FromOrigin(new_origin),
opaque_and_non_transient_);
}
bool IsolationInfo::IsEqualForTesting(const IsolationInfo& other) const {
- return (redirect_mode_ == other.redirect_mode_ &&
+ return (request_type_ == other.request_type_ &&
top_frame_origin_ == other.top_frame_origin_ &&
frame_origin_ == other.frame_origin_ &&
network_isolation_key_ == other.network_isolation_key_ &&
@@ -190,12 +188,12 @@ bool IsolationInfo::IsEqualForTesting(const IsolationInfo& other) const {
}
IsolationInfo::IsolationInfo(
- RedirectMode redirect_mode,
+ RequestType request_type,
const base::Optional<url::Origin>& top_frame_origin,
const base::Optional<url::Origin>& frame_origin,
const SiteForCookies& site_for_cookies,
bool opaque_and_non_transient)
- : redirect_mode_(redirect_mode),
+ : request_type_(request_type),
top_frame_origin_(top_frame_origin),
frame_origin_(frame_origin),
network_isolation_key_(
@@ -205,7 +203,7 @@ IsolationInfo::IsolationInfo(
opaque_and_non_transient)),
site_for_cookies_(site_for_cookies),
opaque_and_non_transient_(opaque_and_non_transient) {
- DCHECK(IsConsistent(redirect_mode_, top_frame_origin_, frame_origin_,
+ DCHECK(IsConsistent(request_type_, top_frame_origin_, frame_origin_,
site_for_cookies_, opaque_and_non_transient_));
}
diff --git a/chromium/net/base/isolation_info.h b/chromium/net/base/isolation_info.h
index 7ad885b7e3c..f84076b38e5 100644
--- a/chromium/net/base/isolation_info.h
+++ b/chromium/net/base/isolation_info.h
@@ -29,32 +29,32 @@ class NET_EXPORT IsolationInfo {
public:
// The update-on-redirect patterns.
//
- // In general, almost everything should use kUpdateNothing, as a
- // kUpdateTopFrame request accidentally sent or redirected to an attacker
- // allows cross-site tracking, and kUpdateFrameOnly allows information
+ // In general, almost everything should use kOther, as a
+ // kMainFrame request accidentally sent or redirected to an attacker
+ // allows cross-site tracking, and kSubFrame allows information
// leaks between sites that iframe each other. Anything that uses
- // kUpdateTopFrame should be user triggered and user visible, like a main
+ // kMainFrame should be user triggered and user visible, like a main
// frame navigation or downloads.
//
- // The RedirectMode is a core part of an IsolationInfo, and using an
+ // The RequestType is a core part of an IsolationInfo, and using an
// IsolationInfo with one value to create an IsolationInfo with another
- // RedirectMode is generally not a good idea, unless the RedirectMode of the
- // new IsolationInfo is kUpdateNothing.
- enum class RedirectMode {
- // Update top level origin, frame origin, and SiteForCookies on redirect.
+ // RequestType is generally not a good idea, unless the RequestType of the
+ // new IsolationInfo is kOther.
+ enum class RequestType {
+ // Updates top level origin, frame origin, and SiteForCookies on redirect.
// These requests allow users to be recognized across sites on redirect, so
// should not generally be used for anything other than navigations.
- kUpdateTopFrame,
+ kMainFrame,
- // Only update frame origin on redirect.
- kUpdateFrameOnly,
+ // Only updates frame origin on redirect.
+ kSubFrame,
- // Update nothing on redirect.
- kUpdateNothing,
+ // Updates nothing on redirect.
+ kOther,
};
// Default constructor returns an IsolationInfo with empty origins, a null
- // SiteForCookies(), and a RedirectMode of kUpdateNothing.
+ // SiteForCookies(), and a RequestType of kOther.
IsolationInfo();
IsolationInfo(const IsolationInfo&);
IsolationInfo(IsolationInfo&&);
@@ -64,8 +64,8 @@ class NET_EXPORT IsolationInfo {
IsolationInfo& operator=(IsolationInfo&&);
// Simple constructor for internal requests. Sets |frame_origin| and
- // |site_for_cookies| match |top_frame_origin|. Sets |redirect_mode| to
- // kUpdateNothing. Will only send SameSite cookies to the site associated with
+ // |site_for_cookies| match |top_frame_origin|. Sets |request_type| to
+ // kOther. Will only send SameSite cookies to the site associated with
// the passed in origin.
static IsolationInfo CreateForInternalRequest(
const url::Origin& top_frame_origin);
@@ -82,19 +82,19 @@ class NET_EXPORT IsolationInfo {
// Creates an IsolationInfo with the provided parameters. If the parameters
// are inconsistent, DCHECKs. In particular:
- // * If |redirect_mode| is kUpdateTopFrame, |top_frame_origin| must equal
+ // * If |request_type| is kMainFrame, |top_frame_origin| must equal
// |frame_origin|, and |site_for_cookies| must be either null or first party
// with respect to them.
- // * If |redirect_mode| is kUpdateFrameOnly, |top_frame_origin| must be
+ // * If |request_type| is kSubFrame, |top_frame_origin| must be
// first party with respect to |site_for_cookies|, or |site_for_cookies|
// must be null.
- // * If |redirect_mode| is kUpdateNothing, |top_frame_origin| and
+ // * If |request_type| is kOther, |top_frame_origin| and
// |frame_origin| must be first party with respect to |site_for_cookies|, or
// |site_for_cookies| must be null.
//
// Note that the |site_for_cookies| consistency checks are skipped when
// |site_for_cookies| is not HTTP/HTTPS.
- static IsolationInfo Create(RedirectMode redirect_mode,
+ static IsolationInfo Create(RequestType request_type,
const url::Origin& top_frame_origin,
const url::Origin& frame_origin,
const SiteForCookies& site_for_cookies);
@@ -102,7 +102,7 @@ class NET_EXPORT IsolationInfo {
// Create an IsolationInfos that may not be fully correct - in particular,
// the SiteForCookies will always set to null, and if the NetworkIsolationKey
// only has a top frame origin, the frame origin will either be set to the top
- // frame origin, in the kUpdateTopFrame case, or be replaced by an opaque
+ // frame origin, in the kMainFrame case, or be replaced by an opaque
// origin in all other cases. If the NetworkIsolationKey is not fully
// populated, will create an empty IsolationInfo. This is intended for use
// while transitioning from NIKs being set on only some requests to
@@ -110,7 +110,7 @@ class NET_EXPORT IsolationInfo {
//
// TODO(https://crbug.com/1060631): Remove this once no longer needed.
static IsolationInfo CreatePartial(
- RedirectMode redirect_mode,
+ RequestType request_type,
const net::NetworkIsolationKey& network_isolation_key);
// Returns nullopt if the arguments are not consistent. Otherwise, returns a
@@ -120,7 +120,7 @@ class NET_EXPORT IsolationInfo {
//
// Intended for use by cross-process deserialization.
static base::Optional<IsolationInfo> CreateIfConsistent(
- RedirectMode redirect_mode,
+ RequestType request_type,
const base::Optional<url::Origin>& top_frame_origin,
const base::Optional<url::Origin>& frame_origin,
const SiteForCookies& site_for_cookies,
@@ -130,12 +130,16 @@ class NET_EXPORT IsolationInfo {
// unmodified.
IsolationInfo CreateForRedirect(const url::Origin& new_origin) const;
- RedirectMode redirect_mode() const { return redirect_mode_; }
+ RequestType request_type() const { return request_type_; }
bool IsEmpty() const { return !top_frame_origin_; }
// These may only be nullopt if created by the empty constructor. If one is
// nullopt, both are, and SiteForCookies is null.
+ //
+ // Note that these are the values the IsolationInfo was created with. In the
+ // case an IsolationInfo was created from a NetworkIsolationKey, they may be
+ // scheme + eTLD+1 instead of actual origins.
const base::Optional<url::Origin>& top_frame_origin() const {
return top_frame_origin_;
}
@@ -160,13 +164,13 @@ class NET_EXPORT IsolationInfo {
bool IsEqualForTesting(const IsolationInfo& other) const;
private:
- IsolationInfo(RedirectMode redirect_mode,
+ IsolationInfo(RequestType request_type,
const base::Optional<url::Origin>& top_frame_origin,
const base::Optional<url::Origin>& frame_origin,
const SiteForCookies& site_for_cookies,
bool opaque_and_non_transient);
- RedirectMode redirect_mode_;
+ RequestType request_type_;
base::Optional<url::Origin> top_frame_origin_;
base::Optional<url::Origin> frame_origin_;
diff --git a/chromium/net/base/isolation_info_unittest.cc b/chromium/net/base/isolation_info_unittest.cc
index 14e45776008..f15af69a80b 100644
--- a/chromium/net/base/isolation_info_unittest.cc
+++ b/chromium/net/base/isolation_info_unittest.cc
@@ -20,7 +20,7 @@ namespace {
void DuplicateAndCompare(const IsolationInfo& isolation_info) {
base::Optional<IsolationInfo> duplicate_isolation_info =
IsolationInfo::CreateIfConsistent(
- isolation_info.redirect_mode(), isolation_info.top_frame_origin(),
+ isolation_info.request_type(), isolation_info.top_frame_origin(),
isolation_info.frame_origin(), isolation_info.site_for_cookies(),
isolation_info.opaque_and_non_transient());
@@ -31,17 +31,19 @@ void DuplicateAndCompare(const IsolationInfo& isolation_info) {
class IsolationInfoTest : public testing::Test {
public:
const url::Origin kOrigin1 = url::Origin::Create(GURL("https://a.foo.test"));
+ const url::Origin kSite1 = url::Origin::Create(GURL("https://foo.test"));
const url::Origin kOrigin2 = url::Origin::Create(GURL("https://b.bar.test"));
+ const url::Origin kSite2 = url::Origin::Create(GURL("https://bar.test"));
const url::Origin kOrigin3 = url::Origin::Create(GURL("https://c.baz.test"));
const url::Origin kOpaqueOrigin;
};
-TEST_F(IsolationInfoTest, UpdateTopFrame) {
- IsolationInfo isolation_info = IsolationInfo::Create(
- IsolationInfo::RedirectMode::kUpdateTopFrame, kOrigin1, kOrigin1,
- SiteForCookies::FromOrigin(kOrigin1));
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame,
- isolation_info.redirect_mode());
+TEST_F(IsolationInfoTest, RequestTypeMainFrame) {
+ IsolationInfo isolation_info =
+ IsolationInfo::Create(IsolationInfo::RequestType::kMainFrame, kOrigin1,
+ kOrigin1, SiteForCookies::FromOrigin(kOrigin1));
+ EXPECT_EQ(IsolationInfo::RequestType::kMainFrame,
+ isolation_info.request_type());
EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin1, isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
@@ -56,8 +58,8 @@ TEST_F(IsolationInfoTest, UpdateTopFrame) {
IsolationInfo redirected_isolation_info =
isolation_info.CreateForRedirect(kOrigin3);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame,
- redirected_isolation_info.redirect_mode());
+ EXPECT_EQ(IsolationInfo::RequestType::kMainFrame,
+ redirected_isolation_info.request_type());
EXPECT_EQ(kOrigin3, redirected_isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin3, redirected_isolation_info.frame_origin());
EXPECT_TRUE(
@@ -70,12 +72,12 @@ TEST_F(IsolationInfoTest, UpdateTopFrame) {
EXPECT_FALSE(redirected_isolation_info.opaque_and_non_transient());
}
-TEST_F(IsolationInfoTest, UpdateFrameOnly) {
- IsolationInfo isolation_info = IsolationInfo::Create(
- IsolationInfo::RedirectMode::kUpdateFrameOnly, kOrigin1, kOrigin2,
- SiteForCookies::FromOrigin(kOrigin1));
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly,
- isolation_info.redirect_mode());
+TEST_F(IsolationInfoTest, RequestTypeSubFrame) {
+ IsolationInfo isolation_info =
+ IsolationInfo::Create(IsolationInfo::RequestType::kSubFrame, kOrigin1,
+ kOrigin2, SiteForCookies::FromOrigin(kOrigin1));
+ EXPECT_EQ(IsolationInfo::RequestType::kSubFrame,
+ isolation_info.request_type());
EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin2, isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
@@ -90,8 +92,8 @@ TEST_F(IsolationInfoTest, UpdateFrameOnly) {
IsolationInfo redirected_isolation_info =
isolation_info.CreateForRedirect(kOrigin3);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly,
- redirected_isolation_info.redirect_mode());
+ EXPECT_EQ(IsolationInfo::RequestType::kSubFrame,
+ redirected_isolation_info.request_type());
EXPECT_EQ(kOrigin1, redirected_isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin3, redirected_isolation_info.frame_origin());
EXPECT_TRUE(
@@ -104,10 +106,9 @@ TEST_F(IsolationInfoTest, UpdateFrameOnly) {
EXPECT_FALSE(redirected_isolation_info.opaque_and_non_transient());
}
-TEST_F(IsolationInfoTest, UpdateNothing) {
+TEST_F(IsolationInfoTest, RequestTypeOther) {
IsolationInfo isolation_info;
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_FALSE(isolation_info.top_frame_origin());
EXPECT_FALSE(isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.network_isolation_key().IsEmpty());
@@ -121,12 +122,11 @@ TEST_F(IsolationInfoTest, UpdateNothing) {
EXPECT_TRUE(isolation_info.IsEqualForTesting(redirected_isolation_info));
}
-TEST_F(IsolationInfoTest, UpdateNothingWithSiteForCookies) {
- IsolationInfo isolation_info = IsolationInfo::Create(
- IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin1,
- SiteForCookies::FromOrigin(kOrigin1));
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+TEST_F(IsolationInfoTest, RequestTypeOtherWithSiteForCookies) {
+ IsolationInfo isolation_info =
+ IsolationInfo::Create(IsolationInfo::RequestType::kOther, kOrigin1,
+ kOrigin1, SiteForCookies::FromOrigin(kOrigin1));
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin1, isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
@@ -146,12 +146,10 @@ TEST_F(IsolationInfoTest, UpdateNothingWithSiteForCookies) {
// Test case of a subresource for cross-site subframe (which has an empty
// site-for-cookies).
-TEST_F(IsolationInfoTest, UpdateNothingWithEmptySiteForCookies) {
- IsolationInfo isolation_info =
- IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing,
- kOrigin1, kOrigin2, SiteForCookies());
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+TEST_F(IsolationInfoTest, RequestTypeOtherWithEmptySiteForCookies) {
+ IsolationInfo isolation_info = IsolationInfo::Create(
+ IsolationInfo::RequestType::kOther, kOrigin1, kOrigin2, SiteForCookies());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin2, isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
@@ -170,8 +168,7 @@ TEST_F(IsolationInfoTest, UpdateNothingWithEmptySiteForCookies) {
TEST_F(IsolationInfoTest, CreateTransient) {
IsolationInfo isolation_info = IsolationInfo::CreateTransient();
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_TRUE(isolation_info.top_frame_origin()->opaque());
EXPECT_TRUE(isolation_info.frame_origin()->opaque());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
@@ -188,16 +185,14 @@ TEST_F(IsolationInfoTest, CreateTransient) {
TEST_F(IsolationInfoTest, CreateOpaqueAndNonTransient) {
IsolationInfo isolation_info = IsolationInfo::CreateOpaqueAndNonTransient();
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_TRUE(isolation_info.top_frame_origin()->opaque());
EXPECT_TRUE(isolation_info.frame_origin()->opaque());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
EXPECT_FALSE(isolation_info.network_isolation_key().IsTransient());
EXPECT_TRUE(
- isolation_info.network_isolation_key().GetTopFrameOrigin()->opaque());
- EXPECT_TRUE(
- isolation_info.network_isolation_key().GetFrameOrigin()->opaque());
+ isolation_info.network_isolation_key().GetTopFrameSite()->opaque());
+ EXPECT_TRUE(isolation_info.network_isolation_key().GetFrameSite()->opaque());
EXPECT_TRUE(isolation_info.site_for_cookies().IsNull());
EXPECT_TRUE(isolation_info.opaque_and_non_transient());
@@ -211,8 +206,7 @@ TEST_F(IsolationInfoTest, CreateOpaqueAndNonTransient) {
TEST_F(IsolationInfoTest, CreateForInternalRequest) {
IsolationInfo isolation_info =
IsolationInfo::CreateForInternalRequest(kOrigin1);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin1, isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
@@ -233,11 +227,11 @@ TEST_F(IsolationInfoTest, CreateForInternalRequest) {
TEST_F(IsolationInfoTest, CreatePartialUpdateTopFrame) {
const NetworkIsolationKey kNIK(kOrigin1, kOrigin1);
IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateTopFrame, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame,
- isolation_info.redirect_mode());
- EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
- EXPECT_EQ(kOrigin1, isolation_info.frame_origin());
+ IsolationInfo::RequestType::kMainFrame, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kMainFrame,
+ isolation_info.request_type());
+ EXPECT_EQ(kSite1, isolation_info.top_frame_origin());
+ EXPECT_EQ(kSite1, isolation_info.frame_origin());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
EXPECT_TRUE(isolation_info.site_for_cookies().IsNull());
EXPECT_FALSE(isolation_info.opaque_and_non_transient());
@@ -247,12 +241,12 @@ TEST_F(IsolationInfoTest, CreatePartialUpdateTopFrame) {
TEST_F(IsolationInfoTest, CreatePartialUpdateFrameOnly) {
const NetworkIsolationKey kNIK(kOrigin1, kOrigin2);
- IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateFrameOnly, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly,
- isolation_info.redirect_mode());
- EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
- EXPECT_EQ(kOrigin2, isolation_info.frame_origin());
+ IsolationInfo isolation_info =
+ IsolationInfo::CreatePartial(IsolationInfo::RequestType::kSubFrame, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kSubFrame,
+ isolation_info.request_type());
+ EXPECT_EQ(kSite1, isolation_info.top_frame_origin());
+ EXPECT_EQ(kSite2, isolation_info.frame_origin());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
EXPECT_TRUE(isolation_info.site_for_cookies().IsNull());
EXPECT_FALSE(isolation_info.opaque_and_non_transient());
@@ -262,12 +256,11 @@ TEST_F(IsolationInfoTest, CreatePartialUpdateFrameOnly) {
TEST_F(IsolationInfoTest, CreatePartialUpdateNothing) {
const NetworkIsolationKey kNIK(kOrigin1, kOrigin2);
- IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
- EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
- EXPECT_EQ(kOrigin2, isolation_info.frame_origin());
+ IsolationInfo isolation_info =
+ IsolationInfo::CreatePartial(IsolationInfo::RequestType::kOther, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
+ EXPECT_EQ(kSite1, isolation_info.top_frame_origin());
+ EXPECT_EQ(kSite2, isolation_info.frame_origin());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
EXPECT_TRUE(isolation_info.site_for_cookies().IsNull());
EXPECT_FALSE(isolation_info.opaque_and_non_transient());
@@ -277,12 +270,11 @@ TEST_F(IsolationInfoTest, CreatePartialUpdateNothing) {
TEST_F(IsolationInfoTest, CreatePartialTransient) {
const NetworkIsolationKey kNIK = NetworkIsolationKey::CreateTransient();
- IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
- EXPECT_EQ(*kNIK.GetTopFrameOrigin(), isolation_info.top_frame_origin());
- EXPECT_EQ(*kNIK.GetFrameOrigin(), isolation_info.frame_origin());
+ IsolationInfo isolation_info =
+ IsolationInfo::CreatePartial(IsolationInfo::RequestType::kOther, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
+ EXPECT_EQ(*kNIK.GetTopFrameSite(), isolation_info.top_frame_origin());
+ EXPECT_EQ(*kNIK.GetFrameSite(), isolation_info.frame_origin());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
EXPECT_TRUE(isolation_info.site_for_cookies().IsNull());
EXPECT_FALSE(isolation_info.opaque_and_non_transient());
@@ -293,12 +285,11 @@ TEST_F(IsolationInfoTest, CreatePartialTransient) {
TEST_F(IsolationInfoTest, CreatePartialOpaqueAndNonTransient) {
const NetworkIsolationKey kNIK =
NetworkIsolationKey::CreateOpaqueAndNonTransient();
- IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
- EXPECT_EQ(*kNIK.GetTopFrameOrigin(), isolation_info.top_frame_origin());
- EXPECT_EQ(*kNIK.GetFrameOrigin(), isolation_info.frame_origin());
+ IsolationInfo isolation_info =
+ IsolationInfo::CreatePartial(IsolationInfo::RequestType::kOther, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
+ EXPECT_EQ(*kNIK.GetTopFrameSite(), isolation_info.top_frame_origin());
+ EXPECT_EQ(*kNIK.GetFrameSite(), isolation_info.frame_origin());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
EXPECT_TRUE(isolation_info.site_for_cookies().IsNull());
EXPECT_TRUE(isolation_info.opaque_and_non_transient());
@@ -308,9 +299,8 @@ TEST_F(IsolationInfoTest, CreatePartialOpaqueAndNonTransient) {
TEST_F(IsolationInfoTest, CreatePartialEmpty) {
IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing, NetworkIsolationKey());
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+ IsolationInfo::RequestType::kOther, NetworkIsolationKey());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_FALSE(isolation_info.top_frame_origin());
EXPECT_FALSE(isolation_info.frame_origin());
EXPECT_EQ(NetworkIsolationKey(), isolation_info.network_isolation_key());
@@ -320,20 +310,19 @@ TEST_F(IsolationInfoTest, CreatePartialEmpty) {
DuplicateAndCompare(isolation_info);
}
-TEST_F(IsolationInfoTest,
- CreatePartialEmptyNoFrameOriginRedirectModeUpdateTopFrame) {
+TEST_F(IsolationInfoTest, CreatePartialEmptyNoFrameOriginRequestTypeMainFrame) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(
features::kAppendFrameOriginToNetworkIsolationKey);
const NetworkIsolationKey kNIK(kOrigin1, kOrigin1);
- EXPECT_FALSE(kNIK.GetFrameOrigin());
+ EXPECT_FALSE(kNIK.GetFrameSite());
IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateTopFrame, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateTopFrame,
- isolation_info.redirect_mode());
- EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
- EXPECT_EQ(kOrigin1, isolation_info.frame_origin());
+ IsolationInfo::RequestType::kMainFrame, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kMainFrame,
+ isolation_info.request_type());
+ EXPECT_EQ(kSite1, isolation_info.top_frame_origin());
+ EXPECT_EQ(kSite1, isolation_info.frame_origin());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
EXPECT_TRUE(isolation_info.site_for_cookies().IsNull());
EXPECT_FALSE(isolation_info.opaque_and_non_transient());
@@ -341,19 +330,18 @@ TEST_F(IsolationInfoTest,
DuplicateAndCompare(isolation_info);
}
-TEST_F(IsolationInfoTest,
- CreatePartialEmptyNoFrameOriginRedirectModeUpdateFrameOnly) {
+TEST_F(IsolationInfoTest, CreatePartialEmptyNoFrameOriginRequestTypeSubFrame) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(
features::kAppendFrameOriginToNetworkIsolationKey);
const NetworkIsolationKey kNIK(kOrigin1, kOrigin2);
- EXPECT_FALSE(kNIK.GetFrameOrigin());
- IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateFrameOnly, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateFrameOnly,
- isolation_info.redirect_mode());
- EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
+ EXPECT_FALSE(kNIK.GetFrameSite());
+ IsolationInfo isolation_info =
+ IsolationInfo::CreatePartial(IsolationInfo::RequestType::kSubFrame, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kSubFrame,
+ isolation_info.request_type());
+ EXPECT_EQ(kSite1, isolation_info.top_frame_origin());
ASSERT_TRUE(isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.frame_origin()->opaque());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
@@ -363,19 +351,17 @@ TEST_F(IsolationInfoTest,
DuplicateAndCompare(isolation_info);
}
-TEST_F(IsolationInfoTest,
- CreatePartialEmptyNoFrameOriginRedirectModeUpdateNothing) {
+TEST_F(IsolationInfoTest, CreatePartialEmptyNoFrameOriginRequestTypeOther) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndDisableFeature(
features::kAppendFrameOriginToNetworkIsolationKey);
const NetworkIsolationKey kNIK(kOrigin1, kOrigin2);
- EXPECT_FALSE(kNIK.GetFrameOrigin());
- IsolationInfo isolation_info = IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing, kNIK);
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
- EXPECT_EQ(kOrigin1, isolation_info.top_frame_origin());
+ EXPECT_FALSE(kNIK.GetFrameSite());
+ IsolationInfo isolation_info =
+ IsolationInfo::CreatePartial(IsolationInfo::RequestType::kOther, kNIK);
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
+ EXPECT_EQ(kSite1, isolation_info.top_frame_origin());
ASSERT_TRUE(isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.frame_origin()->opaque());
EXPECT_EQ(kNIK, isolation_info.network_isolation_key());
@@ -387,7 +373,7 @@ TEST_F(IsolationInfoTest,
// Test that in the UpdateNothing case, the SiteForCookies does not have to
// match the frame origin, unlike in the HTTP/HTTPS case.
-TEST_F(IsolationInfoTest, CustomSchemeUpdateNothing) {
+TEST_F(IsolationInfoTest, CustomSchemeRequestTypeOther) {
// Have to register the scheme, or url::Origin::Create() will return an opaque
// origin.
url::ScopedSchemeRegistryForTests scoped_registry;
@@ -397,10 +383,9 @@ TEST_F(IsolationInfoTest, CustomSchemeUpdateNothing) {
const url::Origin kCustomOrigin = url::Origin::Create(kCustomOriginUrl);
IsolationInfo isolation_info = IsolationInfo::Create(
- IsolationInfo::RedirectMode::kUpdateNothing, kCustomOrigin, kOrigin1,
+ IsolationInfo::RequestType::kOther, kCustomOrigin, kOrigin1,
SiteForCookies::FromOrigin(kCustomOrigin));
- EXPECT_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther, isolation_info.request_type());
EXPECT_EQ(kCustomOrigin, isolation_info.top_frame_origin());
EXPECT_EQ(kOrigin1, isolation_info.frame_origin());
EXPECT_TRUE(isolation_info.network_isolation_key().IsFullyPopulated());
@@ -422,73 +407,73 @@ TEST_F(IsolationInfoTest, CustomSchemeUpdateNothing) {
TEST_F(IsolationInfoTest, CreateIfConsistentFails) {
// Main frames with inconsistent SiteForCookies.
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateTopFrame, kOrigin1, kOrigin1,
+ IsolationInfo::RequestType::kMainFrame, kOrigin1, kOrigin1,
SiteForCookies::FromOrigin(kOrigin2),
false /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateTopFrame, kOpaqueOrigin,
- kOpaqueOrigin, SiteForCookies::FromOrigin(kOrigin1),
+ IsolationInfo::RequestType::kMainFrame, kOpaqueOrigin, kOpaqueOrigin,
+ SiteForCookies::FromOrigin(kOrigin1),
false /* opaque_and_non_transient */));
// Sub frame with inconsistent SiteForCookies.
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateFrameOnly, kOrigin1, kOrigin2,
+ IsolationInfo::RequestType::kSubFrame, kOrigin1, kOrigin2,
SiteForCookies::FromOrigin(kOrigin2),
false /* opaque_and_non_transient */));
// Sub resources with inconsistent SiteForCookies.
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin2,
+ IsolationInfo::RequestType::kOther, kOrigin1, kOrigin2,
SiteForCookies::FromOrigin(kOrigin1),
false /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin2,
+ IsolationInfo::RequestType::kOther, kOrigin1, kOrigin2,
SiteForCookies::FromOrigin(kOrigin2),
false /* opaque_and_non_transient */));
- // |opaque_and_non_transient| for wrong RedirectModes.
+ // |opaque_and_non_transient| for wrong RequestTypes.
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateTopFrame, kOpaqueOrigin,
- kOpaqueOrigin, SiteForCookies(), true /* opaque_and_non_transient */));
+ IsolationInfo::RequestType::kMainFrame, kOpaqueOrigin, kOpaqueOrigin,
+ SiteForCookies(), true /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateFrameOnly, kOpaqueOrigin,
- kOpaqueOrigin, SiteForCookies(), true /* opaque_and_non_transient */));
+ IsolationInfo::RequestType::kSubFrame, kOpaqueOrigin, kOpaqueOrigin,
+ SiteForCookies(), true /* opaque_and_non_transient */));
// |opaque_and_non_transient| with empty origins.
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateNothing, base::nullopt, base::nullopt,
+ IsolationInfo::RequestType::kOther, base::nullopt, base::nullopt,
SiteForCookies(), true /* opaque_and_non_transient */));
// |opaque_and_non_transient| with non-opaque origins.
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, kOrigin1,
- SiteForCookies(), true /* opaque_and_non_transient */));
+ IsolationInfo::RequestType::kOther, kOrigin1, kOrigin1, SiteForCookies(),
+ true /* opaque_and_non_transient */));
// Incorrectly have empty/non-empty origins:
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateNothing, base::nullopt, kOrigin1,
+ IsolationInfo::RequestType::kOther, base::nullopt, kOrigin1,
SiteForCookies(), false /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateNothing, kOrigin1, base::nullopt,
+ IsolationInfo::RequestType::kOther, kOrigin1, base::nullopt,
SiteForCookies(), false /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateTopFrame, base::nullopt, kOrigin1,
+ IsolationInfo::RequestType::kMainFrame, base::nullopt, kOrigin1,
SiteForCookies::FromOrigin(kOrigin1),
false /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateTopFrame, kOrigin1, base::nullopt,
+ IsolationInfo::RequestType::kMainFrame, kOrigin1, base::nullopt,
SiteForCookies::FromOrigin(kOrigin1),
false /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateFrameOnly, base::nullopt, kOrigin2,
+ IsolationInfo::RequestType::kSubFrame, base::nullopt, kOrigin2,
SiteForCookies(), false /* opaque_and_non_transient */));
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateFrameOnly, kOrigin1, base::nullopt,
+ IsolationInfo::RequestType::kSubFrame, kOrigin1, base::nullopt,
SiteForCookies(), false /* opaque_and_non_transient */));
// No origins with non-null SiteForCookies.
EXPECT_FALSE(IsolationInfo::CreateIfConsistent(
- IsolationInfo::RedirectMode::kUpdateNothing, base::nullopt, base::nullopt,
+ IsolationInfo::RequestType::kOther, base::nullopt, base::nullopt,
SiteForCookies::FromOrigin(kOrigin1),
false /* opaque_and_non_transient */));
}
diff --git a/chromium/net/base/logging_network_change_observer.h b/chromium/net/base/logging_network_change_observer.h
index 1d0d61e6e33..b6f26d4e7e4 100644
--- a/chromium/net/base/logging_network_change_observer.h
+++ b/chromium/net/base/logging_network_change_observer.h
@@ -5,7 +5,6 @@
#ifndef NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
#define NET_BASE_LOGGING_NETWORK_CHANGE_OBSERVER_H_
-#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/base/network_change_notifier.h"
@@ -24,6 +23,9 @@ class NET_EXPORT LoggingNetworkChangeObserver
// Note: |net_log| must remain valid throughout the lifetime of this
// LoggingNetworkChangeObserver.
explicit LoggingNetworkChangeObserver(NetLog* net_log);
+ LoggingNetworkChangeObserver(const LoggingNetworkChangeObserver&) = delete;
+ LoggingNetworkChangeObserver& operator=(const LoggingNetworkChangeObserver&) =
+ delete;
~LoggingNetworkChangeObserver() override;
private:
@@ -48,8 +50,6 @@ class NET_EXPORT LoggingNetworkChangeObserver
NetworkChangeNotifier::NetworkHandle network) override;
NetLog* net_log_;
-
- DISALLOW_COPY_AND_ASSIGN(LoggingNetworkChangeObserver);
};
} // namespace net
diff --git a/chromium/net/base/mime_util.cc b/chromium/net/base/mime_util.cc
index 1abed0341fe..7b534d41ed8 100644
--- a/chromium/net/base/mime_util.cc
+++ b/chromium/net/base/mime_util.cc
@@ -194,6 +194,9 @@ static const MimeInfo kSecondaryMappings[] = {
{"application/rss+xml", "rss"},
{"application/vnd.android.package-archive", "apk"},
{"application/vnd.mozilla.xul+xml", "xul"},
+ {"application/vnd.ms-excel", "xls"},
+ {"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
+ "xlsx"},
{"application/x-gzip", "gz,tgz"},
{"application/x-mpegurl", "m3u8"},
{"application/x-shockwave-flash", "swf,swl"},
diff --git a/chromium/net/base/net_error_list.h b/chromium/net/base/net_error_list.h
index 4e129bc9c24..d52314cc55b 100644
--- a/chromium/net/base/net_error_list.h
+++ b/chromium/net/base/net_error_list.h
@@ -127,11 +127,6 @@ NET_ERROR(BLOCKED_BY_CSP, -30)
// The request was blocked because of no H/2 or QUIC session.
NET_ERROR(H2_OR_QUIC_REQUIRED, -31)
-// The request was blocked because it is a private network request coming from
-// an insecure context in a less private IP address space. This is used to
-// enforce CORS-RFC1918: https://wicg.github.io/cors-rfc1918.
-NET_ERROR(INSECURE_PRIVATE_NETWORK_REQUEST, -32)
-
// A connection was closed (corresponding to a TCP FIN).
NET_ERROR(CONNECTION_CLOSED, -100)
diff --git a/chromium/net/base/net_info_source_list.h b/chromium/net/base/net_info_source_list.h
index 1f754f2e809..d947860220a 100644
--- a/chromium/net/base/net_info_source_list.h
+++ b/chromium/net/base/net_info_source_list.h
@@ -2,24 +2,20 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file intentionally does not have header guards, it's included
-// inside a macro to generate enum values. The following line silences a
-// presubmit and Tricium warning that would otherwise be triggered by this:
-// no-include-guard-because-multiply-included
-// NOLINT(build/header_guard)
+#ifndef NET_BASE_NET_INFO_SOURCE_LIST_H_
+#define NET_BASE_NET_INFO_SOURCE_LIST_H_
-// Flags used to request different types of information about the current state
-// of a URLRequestContext.
-//
-// The strings don't match the enums for historical reasons.
+// NetInfo Sources written to NetLog JSON files.
+const char kNetInfoProxySettings[] = "proxySettings";
+const char kNetInfoBadProxies[] = "badProxies";
+const char kNetInfoHostResolver[] = "hostResolverInfo";
+const char kNetInfoSocketPool[] = "socketPoolInfo";
+const char kNetInfoQuic[] = "quicInfo";
+const char kNetInfoSpdySessions[] = "spdySessionInfo";
+const char kNetInfoSpdyStatus[] = "spdyStatus";
+const char kNetInfoAltSvcMappings[] = "altSvcMappings";
+const char kNetInfoHTTPCache[] = "httpCacheInfo";
+const char kNetInfoReporting[] = "reportingInfo";
+const char kNetInfoFieldTrials[] = "activeFieldTrialGroups";
-NET_INFO_SOURCE(PROXY_SETTINGS, "proxySettings", 1 << 0)
-NET_INFO_SOURCE(BAD_PROXIES, "badProxies", 1 << 1)
-NET_INFO_SOURCE(HOST_RESOLVER, "hostResolverInfo", 1 << 2)
-NET_INFO_SOURCE(SOCKET_POOL, "socketPoolInfo", 1 << 3)
-NET_INFO_SOURCE(QUIC, "quicInfo", 1 << 4)
-NET_INFO_SOURCE(SPDY_SESSIONS, "spdySessionInfo", 1 << 5)
-NET_INFO_SOURCE(SPDY_STATUS, "spdyStatus", 1 << 6)
-NET_INFO_SOURCE(ALT_SVC_MAPPINGS, "altSvcMappings", 1 << 7)
-NET_INFO_SOURCE(HTTP_CACHE, "httpCacheInfo", 1 << 8)
-NET_INFO_SOURCE(REPORTING, "reportingInfo", 1 << 9)
+#endif // NET_BASE_NET_INFO_SOURCE_LIST_H_
diff --git a/chromium/net/base/network_activity_monitor.h b/chromium/net/base/network_activity_monitor.h
index 6f17c21bb0a..beab88bbbb4 100644
--- a/chromium/net/base/network_activity_monitor.h
+++ b/chromium/net/base/network_activity_monitor.h
@@ -8,7 +8,6 @@
#include <stdint.h>
#include "base/lazy_instance.h"
-#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
@@ -37,6 +36,9 @@ class NET_EXPORT_PRIVATE NetworkActivityMonitor {
// Returns the singleton instance of the monitor.
static NetworkActivityMonitor* GetInstance();
+ NetworkActivityMonitor(const NetworkActivityMonitor&) = delete;
+ NetworkActivityMonitor& operator=(const NetworkActivityMonitor&) = delete;
+
void IncrementBytesReceived(uint64_t bytes_received);
void IncrementBytesSent(uint64_t bytes_sent);
@@ -61,8 +63,6 @@ class NET_EXPORT_PRIVATE NetworkActivityMonitor {
base::TimeTicks last_received_ticks_;
base::TimeTicks last_sent_ticks_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkActivityMonitor);
};
} // namespace net
diff --git a/chromium/net/base/network_change_notifier.cc b/chromium/net/base/network_change_notifier.cc
index fdb6612e2a4..37c03d1e53d 100644
--- a/chromium/net/base/network_change_notifier.cc
+++ b/chromium/net/base/network_change_notifier.cc
@@ -9,7 +9,6 @@
#include <unordered_set>
#include <utility>
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
@@ -114,6 +113,9 @@ class NetworkChangeNotifier::NetworkChangeCalculator
AddIPAddressObserver(this);
}
+ NetworkChangeCalculator(const NetworkChangeCalculator&) = delete;
+ NetworkChangeCalculator& operator=(const NetworkChangeCalculator&) = delete;
+
~NetworkChangeCalculator() override {
DCHECK(thread_checker_.CalledOnValidThread());
RemoveConnectionTypeObserver(this);
@@ -176,8 +178,6 @@ class NetworkChangeNotifier::NetworkChangeCalculator
base::OneShotTimer timer_;
base::ThreadChecker thread_checker_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeCalculator);
};
class NetworkChangeNotifier::SystemDnsConfigObserver
diff --git a/chromium/net/base/network_change_notifier.h b/chromium/net/base/network_change_notifier.h
index db3907074bf..6f36e194fe2 100644
--- a/chromium/net/base/network_change_notifier.h
+++ b/chromium/net/base/network_change_notifier.h
@@ -10,7 +10,6 @@
#include <memory>
#include <vector>
-#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "base/observer_list_threadsafe.h"
#include "base/time/time.h"
@@ -109,6 +108,9 @@ class NET_EXPORT NetworkChangeNotifier {
// DEPRECATED. Please use NetworkChangeObserver instead. crbug.com/754695.
class NET_EXPORT IPAddressObserver {
public:
+ IPAddressObserver(const IPAddressObserver&) = delete;
+ IPAddressObserver& operator=(const IPAddressObserver&) = delete;
+
// Will be called when the IP address of the primary interface changes.
// This includes when the primary interface itself changes.
virtual void OnIPAddressChanged() = 0;
@@ -121,13 +123,13 @@ class NET_EXPORT NetworkChangeNotifier {
friend NetworkChangeNotifier;
scoped_refptr<base::ObserverListThreadSafe<IPAddressObserver>>
observer_list_;
-
- DISALLOW_COPY_AND_ASSIGN(IPAddressObserver);
};
// DEPRECATED. Please use NetworkChangeObserver instead. crbug.com/754695.
class NET_EXPORT ConnectionTypeObserver {
public:
+ ConnectionTypeObserver(const ConnectionTypeObserver&) = delete;
+ ConnectionTypeObserver& operator=(const ConnectionTypeObserver&) = delete;
// Will be called when the connection type of the system has changed.
// See NetworkChangeNotifier::GetConnectionType() for important caveats
// about the unreliability of using this signal to infer the ability to
@@ -142,12 +144,13 @@ class NET_EXPORT NetworkChangeNotifier {
friend NetworkChangeNotifier;
scoped_refptr<base::ObserverListThreadSafe<ConnectionTypeObserver>>
observer_list_;
-
- DISALLOW_COPY_AND_ASSIGN(ConnectionTypeObserver);
};
class NET_EXPORT DNSObserver {
public:
+ DNSObserver(const DNSObserver&) = delete;
+ DNSObserver& operator=(const DNSObserver&) = delete;
+
// Will be called when the DNS settings of the system may have changed.
virtual void OnDNSChanged() = 0;
@@ -158,12 +161,13 @@ class NET_EXPORT NetworkChangeNotifier {
private:
friend NetworkChangeNotifier;
scoped_refptr<base::ObserverListThreadSafe<DNSObserver>> observer_list_;
-
- DISALLOW_COPY_AND_ASSIGN(DNSObserver);
};
class NET_EXPORT NetworkChangeObserver {
public:
+ NetworkChangeObserver(const NetworkChangeObserver&) = delete;
+ NetworkChangeObserver& operator=(const NetworkChangeObserver&) = delete;
+
// OnNetworkChanged will be called when a change occurs to the host
// computer's hardware or software that affects the route network packets
// take to any network server. Some examples:
@@ -199,12 +203,13 @@ class NET_EXPORT NetworkChangeNotifier {
friend NetworkChangeNotifier;
scoped_refptr<base::ObserverListThreadSafe<NetworkChangeObserver>>
observer_list_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeObserver);
};
class NET_EXPORT MaxBandwidthObserver {
public:
+ MaxBandwidthObserver(const MaxBandwidthObserver&) = delete;
+ MaxBandwidthObserver& operator=(const MaxBandwidthObserver&) = delete;
+
// Called when a change occurs to the network's maximum bandwidth as
// defined in http://w3c.github.io/netinfo/. Also called on type change,
// even if the maximum bandwidth doesn't change. See the documentation of
@@ -221,8 +226,6 @@ class NET_EXPORT NetworkChangeNotifier {
friend NetworkChangeNotifier;
scoped_refptr<base::ObserverListThreadSafe<MaxBandwidthObserver>>
observer_list_;
-
- DISALLOW_COPY_AND_ASSIGN(MaxBandwidthObserver);
};
// Opaque handle for device-wide connection to a particular network. For
@@ -244,6 +247,9 @@ class NET_EXPORT NetworkChangeNotifier {
// unimplemented.
class NET_EXPORT NetworkObserver {
public:
+ NetworkObserver(const NetworkObserver&) = delete;
+ NetworkObserver& operator=(const NetworkObserver&) = delete;
+
// Called when device connects to |network|. For example device associates
// with a WiFi access point. This does not imply the network has Internet
// access as it may well be behind a captive portal.
@@ -266,13 +272,13 @@ class NET_EXPORT NetworkChangeNotifier {
private:
friend NetworkChangeNotifier;
scoped_refptr<base::ObserverListThreadSafe<NetworkObserver>> observer_list_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkObserver);
};
// An invalid NetworkHandle.
static const NetworkHandle kInvalidNetworkHandle;
+ NetworkChangeNotifier(const NetworkChangeNotifier&) = delete;
+ NetworkChangeNotifier& operator=(const NetworkChangeNotifier&) = delete;
virtual ~NetworkChangeNotifier();
// Returns the factory or nullptr if it is not set.
@@ -615,8 +621,6 @@ class NET_EXPORT NetworkChangeNotifier {
// Whether observers can be added. This may only be false during construction
// in tests. See comment above the constructor.
bool can_add_observers_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifier);
};
} // namespace net
diff --git a/chromium/net/base/network_change_notifier_fuchsia.cc b/chromium/net/base/network_change_notifier_fuchsia.cc
index 75d66bcb0ba..4e94fbf9166 100644
--- a/chromium/net/base/network_change_notifier_fuchsia.cc
+++ b/chromium/net/base/network_change_notifier_fuchsia.cc
@@ -77,6 +77,7 @@ NetworkChangeNotifierFuchsia::GetCurrentConnectionType() const {
void NetworkChangeNotifierFuchsia::ProcessInterfaceList(
std::vector<fuchsia::netstack::NetInterface> interfaces) {
+ ++pending_route_table_requests_;
netstack_->GetRouteTable(
[this, interfaces = std::move(interfaces)](
std::vector<fuchsia::netstack::RouteTableEntry> route_table) mutable {
@@ -87,6 +88,9 @@ void NetworkChangeNotifierFuchsia::ProcessInterfaceList(
void NetworkChangeNotifierFuchsia::OnRouteTableReceived(
std::vector<fuchsia::netstack::NetInterface> interfaces,
std::vector<fuchsia::netstack::RouteTableEntry> route_table) {
+ --pending_route_table_requests_;
+ DCHECK_GE(pending_route_table_requests_, 0);
+
// Create a set of NICs that have default routes (ie 0.0.0.0).
base::flat_set<uint32_t> default_route_ids;
for (const auto& route : route_table) {
@@ -146,7 +150,10 @@ void NetworkChangeNotifierFuchsia::OnRouteTableReceived(
NotifyObserversOfConnectionTypeChange();
}
- if (on_initial_interfaces_received_) {
+ // If this request was made during construction, and no further requests are
+ // in-flight, then we have an initial stable interface state and can safely
+ // allow the constructor to re-Bind() the Netstack channel, and return.
+ if (on_initial_interfaces_received_ && (pending_route_table_requests_ <= 0)) {
std::move(on_initial_interfaces_received_).Run();
}
}
diff --git a/chromium/net/base/network_change_notifier_fuchsia.h b/chromium/net/base/network_change_notifier_fuchsia.h
index b4c14970085..69e9d4cb73f 100644
--- a/chromium/net/base/network_change_notifier_fuchsia.h
+++ b/chromium/net/base/network_change_notifier_fuchsia.h
@@ -8,6 +8,8 @@
#include <fuchsia/netstack/cpp/fidl.h>
#include <lib/fidl/cpp/binding.h>
+#include <vector>
+
#include "base/atomicops.h"
#include "base/callback.h"
#include "base/containers/flat_set.h"
@@ -26,6 +28,9 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierFuchsia
// Interfaces are filtered by |required_features|.
explicit NetworkChangeNotifierFuchsia(
fuchsia::hardware::ethernet::Features required_features);
+ NetworkChangeNotifierFuchsia(const NetworkChangeNotifierFuchsia&) = delete;
+ NetworkChangeNotifierFuchsia& operator=(const NetworkChangeNotifierFuchsia&) =
+ delete;
~NetworkChangeNotifierFuchsia() override;
// NetworkChangeNotifier implementation.
@@ -60,6 +65,7 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierFuchsia
// Used to allow the constructor to block until the initial state is received
// from |netstack_|.
+ int pending_route_table_requests_ = 0;
base::OnceClosure on_initial_interfaces_received_;
// The ConnectionType of the default network interface, stored as an atomic
@@ -70,8 +76,6 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierFuchsia
base::flat_set<IPAddress> cached_addresses_;
THREAD_CHECKER(thread_checker_);
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierFuchsia);
};
} // namespace net
diff --git a/chromium/net/base/network_change_notifier_fuchsia_unittest.cc b/chromium/net/base/network_change_notifier_fuchsia_unittest.cc
index feadbce0f29..94b448389a7 100644
--- a/chromium/net/base/network_change_notifier_fuchsia_unittest.cc
+++ b/chromium/net/base/network_change_notifier_fuchsia_unittest.cc
@@ -7,6 +7,7 @@
#include <fuchsia/hardware/ethernet/cpp/fidl.h>
#include <fuchsia/netstack/cpp/fidl_test_base.h>
#include <memory>
+#include <string>
#include <utility>
#include <vector>
@@ -102,21 +103,34 @@ std::vector<fuchsia::netstack::NetInterface> CloneNetInterfaces(
// Partial fake implementation of a Netstack.
class FakeNetstack : public fuchsia::netstack::testing::Netstack_TestBase {
public:
- explicit FakeNetstack() : binding_(this) {}
+ FakeNetstack() = default;
+ FakeNetstack(const FakeNetstack&) = delete;
+ FakeNetstack& operator=(const FakeNetstack&) = delete;
~FakeNetstack() override = default;
void Bind(
fidl::InterfaceRequest<fuchsia::netstack::Netstack> netstack_request) {
CHECK_EQ(ZX_OK, binding_.Bind(std::move(netstack_request)));
- binding_.events().OnInterfacesChanged(CloneNetInterfaces(interfaces_));
+ SetInterfaces(std::move(interfaces_), std::move(second_interfaces_));
}
// Sets the interfaces reported by the fake Netstack and sends an
// OnInterfacesChanged() event to the client.
- void SetInterfaces(std::vector<fuchsia::netstack::NetInterface> interfaces) {
+ // If specified, |second_interfaces_| will be notified immediately after
+ // |interfaces|, ensuring that no requests could be processed in-between the
+ // two notifications.
+ void SetInterfaces(
+ std::vector<fuchsia::netstack::NetInterface> interfaces,
+ base::Optional<std::vector<fuchsia::netstack::NetInterface>>
+ second_interfaces = base::nullopt) {
interfaces_ = std::move(interfaces);
+ second_interfaces_ = std::move(second_interfaces);
if (binding_.is_bound()) {
binding_.events().OnInterfacesChanged(CloneNetInterfaces(interfaces_));
+ if (second_interfaces_) {
+ auto interfaces = std::move(second_interfaces_);
+ SetInterfaces(std::move(interfaces.value()));
+ }
}
}
@@ -143,18 +157,21 @@ class FakeNetstack : public fuchsia::netstack::testing::Netstack_TestBase {
}
std::vector<fuchsia::netstack::NetInterface> interfaces_;
- fidl::Binding<fuchsia::netstack::Netstack> binding_;
+ base::Optional<std::vector<fuchsia::netstack::NetInterface>>
+ second_interfaces_;
- DISALLOW_COPY_AND_ASSIGN(FakeNetstack);
+ fidl::Binding<fuchsia::netstack::Netstack> binding_{this};
};
class FakeNetstackAsync {
public:
- explicit FakeNetstackAsync() : thread_("Netstack Thread") {
+ FakeNetstackAsync() : thread_("Netstack Thread") {
base::Thread::Options options(base::MessagePumpType::IO, 0);
CHECK(thread_.StartWithOptions(options));
netstack_ = base::SequenceBound<FakeNetstack>(thread_.task_runner());
}
+ FakeNetstackAsync(const FakeNetstackAsync&) = delete;
+ FakeNetstackAsync& operator=(const FakeNetstackAsync&) = delete;
~FakeNetstackAsync() = default;
void Bind(
@@ -166,7 +183,17 @@ class FakeNetstackAsync {
void SetInterfaces(
const std::vector<fuchsia::netstack::NetInterface>& interfaces) {
netstack_.Post(FROM_HERE, &FakeNetstack::SetInterfaces,
- CloneNetInterfaces(interfaces));
+ CloneNetInterfaces(interfaces), base::nullopt);
+ }
+
+ // Asynchronously set both an initial state, and a second set of interfaces
+ // to report an update for immediately after the first.
+ void SetInterfacesAndImmediatelyReSet(
+ const std::vector<fuchsia::netstack::NetInterface>& interfaces,
+ const std::vector<fuchsia::netstack::NetInterface>& second_interfaces) {
+ netstack_.Post(FROM_HERE, &FakeNetstack::SetInterfaces,
+ CloneNetInterfaces(interfaces),
+ CloneNetInterfaces(second_interfaces));
}
// Ensures that any SetInterfaces() or SendOnInterfacesChanged() calls have
@@ -178,8 +205,6 @@ class FakeNetstackAsync {
private:
base::Thread thread_;
base::SequenceBound<FakeNetstack> netstack_;
-
- DISALLOW_COPY_AND_ASSIGN(FakeNetstackAsync);
};
template <class T>
@@ -294,7 +319,11 @@ class FakeIPAddressObserver : public NetworkChangeNotifier::IPAddressObserver {
class NetworkChangeNotifierFuchsiaTest : public testing::Test {
public:
- NetworkChangeNotifierFuchsiaTest() {}
+ NetworkChangeNotifierFuchsiaTest() = default;
+ NetworkChangeNotifierFuchsiaTest(const NetworkChangeNotifierFuchsiaTest&) =
+ delete;
+ NetworkChangeNotifierFuchsiaTest& operator=(
+ const NetworkChangeNotifierFuchsiaTest&) = delete;
~NetworkChangeNotifierFuchsiaTest() override = default;
// Creates a NetworkChangeNotifier and spins the MessageLoop to allow it to
@@ -341,9 +370,6 @@ class NetworkChangeNotifierFuchsiaTest : public testing::Test {
std::unique_ptr<FakeConnectionTypeObserver> type_observer_;
std::unique_ptr<FakeIPAddressObserver> ip_observer_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierFuchsiaTest);
};
TEST_F(NetworkChangeNotifierFuchsiaTest, InitialState) {
@@ -352,6 +378,19 @@ TEST_F(NetworkChangeNotifierFuchsiaTest, InitialState) {
notifier_->GetCurrentConnectionType());
}
+TEST_F(NetworkChangeNotifierFuchsiaTest, InterfacesChangeDuringConstruction) {
+ // Set a live interface with an IP address and create the notifier.
+ std::vector<fuchsia::netstack::NetInterface> interfaces(1);
+ interfaces[0] = DefaultNetInterface();
+ interfaces[0].features = fuchsia::hardware::ethernet::Features::WLAN;
+
+ // Trigger two notifications, to verify that the notifier copes with receiving
+ // notifications while waiting on the initial GetRouteTable() returning.
+ netstack_.SetInterfacesAndImmediatelyReSet(interfaces, interfaces);
+
+ CreateNotifier();
+}
+
TEST_F(NetworkChangeNotifierFuchsiaTest, NotifyNetworkChangeOnInitialIPChange) {
// Set a live interface with an IP address and create the notifier.
std::vector<fuchsia::netstack::NetInterface> interfaces(1);
diff --git a/chromium/net/base/network_change_notifier_linux.cc b/chromium/net/base/network_change_notifier_linux.cc
index ad8b5625342..cf30c4b2e11 100644
--- a/chromium/net/base/network_change_notifier_linux.cc
+++ b/chromium/net/base/network_change_notifier_linux.cc
@@ -4,10 +4,11 @@
#include "net/base/network_change_notifier_linux.h"
+#include <string>
+
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "base/sequenced_task_runner.h"
#include "base/task/post_task.h"
#include "base/task/task_traits.h"
@@ -23,6 +24,8 @@ class NetworkChangeNotifierLinux::BlockingThreadObjects {
public:
explicit BlockingThreadObjects(
const std::unordered_set<std::string>& ignored_interfaces);
+ BlockingThreadObjects(const BlockingThreadObjects&) = delete;
+ BlockingThreadObjects& operator=(const BlockingThreadObjects&) = delete;
// Plumbing for NetworkChangeNotifier::GetCurrentConnectionType.
// Safe to call from any thread.
@@ -43,8 +46,6 @@ class NetworkChangeNotifierLinux::BlockingThreadObjects {
// Used to detect online/offline state and IP address changes.
internal::AddressTrackerLinux address_tracker_;
NetworkChangeNotifier::ConnectionType last_type_;
-
- DISALLOW_COPY_AND_ASSIGN(BlockingThreadObjects);
};
NetworkChangeNotifierLinux::BlockingThreadObjects::BlockingThreadObjects(
diff --git a/chromium/net/base/network_change_notifier_linux.h b/chromium/net/base/network_change_notifier_linux.h
index 8c4c3255924..e81edfbf1a1 100644
--- a/chromium/net/base/network_change_notifier_linux.h
+++ b/chromium/net/base/network_change_notifier_linux.h
@@ -33,6 +33,10 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierLinux
explicit NetworkChangeNotifierLinux(
const std::unordered_set<std::string>& ignored_interfaces);
+ NetworkChangeNotifierLinux(const NetworkChangeNotifierLinux&) = delete;
+ NetworkChangeNotifierLinux& operator=(const NetworkChangeNotifierLinux&) =
+ delete;
+
~NetworkChangeNotifierLinux() override;
private:
@@ -54,8 +58,6 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierLinux
// Also used for DnsConfigService which also must live on blocking sequences.
std::unique_ptr<BlockingThreadObjects, base::OnTaskRunnerDeleter>
blocking_thread_objects_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierLinux);
};
} // namespace net
diff --git a/chromium/net/base/network_change_notifier_mac.h b/chromium/net/base/network_change_notifier_mac.h
index 516264d27d5..e76bf88112f 100644
--- a/chromium/net/base/network_change_notifier_mac.h
+++ b/chromium/net/base/network_change_notifier_mac.h
@@ -11,7 +11,6 @@
#include "base/compiler_specific.h"
#include "base/mac/scoped_cftyperef.h"
-#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
@@ -24,6 +23,8 @@ namespace net {
class NetworkChangeNotifierMac: public NetworkChangeNotifier {
public:
NetworkChangeNotifierMac();
+ NetworkChangeNotifierMac(const NetworkChangeNotifierMac&) = delete;
+ NetworkChangeNotifierMac& operator=(const NetworkChangeNotifierMac&) = delete;
~NetworkChangeNotifierMac() override;
// NetworkChangeNotifier implementation:
@@ -35,6 +36,8 @@ class NetworkChangeNotifierMac: public NetworkChangeNotifier {
public:
explicit Forwarder(NetworkChangeNotifierMac* net_config_watcher)
: net_config_watcher_(net_config_watcher) {}
+ Forwarder(const Forwarder&) = delete;
+ Forwarder& operator=(const Forwarder&) = delete;
// NetworkConfigWatcherMac::Delegate implementation:
void Init() override;
@@ -44,7 +47,6 @@ class NetworkChangeNotifierMac: public NetworkChangeNotifier {
private:
NetworkChangeNotifierMac* const net_config_watcher_;
- DISALLOW_COPY_AND_ASSIGN(Forwarder);
};
private:
@@ -75,8 +77,6 @@ class NetworkChangeNotifierMac: public NetworkChangeNotifier {
Forwarder forwarder_;
std::unique_ptr<const NetworkConfigWatcherMac> config_watcher_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierMac);
};
} // namespace net
diff --git a/chromium/net/base/network_change_notifier_mac.mm b/chromium/net/base/network_change_notifier_mac.mm
index 80d21a4c22d..7317270ad4a 100644
--- a/chromium/net/base/network_change_notifier_mac.mm
+++ b/chromium/net/base/network_change_notifier_mac.mm
@@ -113,6 +113,10 @@ NetworkChangeNotifierMac::CalculateConnectionType(
CTRadioAccessTechnologyeHRPD, nil];
NSSet<NSString*>* technologies_4g =
[NSSet setWithObjects:CTRadioAccessTechnologyLTE, nil];
+ // TODO: Use constants from CoreTelephony once Cronet builds with XCode 12.1
+ NSSet<NSString*>* technologies_5g =
+ [NSSet setWithObjects:@"CTRadioAccessTechnologyNRNSA",
+ @"CTRadioAccessTechnologyNR", nil];
int best_network = 0;
for (NSString* service in service_current_radio_access_technology) {
if (!service_current_radio_access_technology[service]) {
@@ -128,6 +132,8 @@ NetworkChangeNotifierMac::CalculateConnectionType(
current_network = 3;
} else if ([technologies_4g containsObject:network_type]) {
current_network = 4;
+ } else if ([technologies_5g containsObject:network_type]) {
+ current_network = 5;
} else {
// New technology?
NOTREACHED();
@@ -145,6 +151,8 @@ NetworkChangeNotifierMac::CalculateConnectionType(
return CONNECTION_3G;
case 4:
return CONNECTION_4G;
+ case 5:
+ return CONNECTION_5G;
default:
// Default to CONNECTION_3G to not change existing behavior.
return CONNECTION_3G;
diff --git a/chromium/net/base/network_change_notifier_posix.h b/chromium/net/base/network_change_notifier_posix.h
index 939338cb6de..d8e38934d02 100644
--- a/chromium/net/base/network_change_notifier_posix.h
+++ b/chromium/net/base/network_change_notifier_posix.h
@@ -8,7 +8,6 @@
#include <memory>
#include "base/gtest_prod_util.h"
-#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
@@ -29,6 +28,9 @@ class NET_EXPORT NetworkChangeNotifierPosix : public NetworkChangeNotifier {
NetworkChangeNotifierPosix(
NetworkChangeNotifier::ConnectionType initial_connection_type,
NetworkChangeNotifier::ConnectionSubtype initial_connection_subtype);
+ NetworkChangeNotifierPosix(const NetworkChangeNotifierPosix&) = delete;
+ NetworkChangeNotifierPosix& operator=(const NetworkChangeNotifierPosix&) =
+ delete;
~NetworkChangeNotifierPosix() override;
// These methods are used to notify this object that a network property has
@@ -71,8 +73,6 @@ class NET_EXPORT NetworkChangeNotifierPosix : public NetworkChangeNotifier {
NetworkChangeNotifier::ConnectionType
connection_type_; // Guarded by |lock_|.
double max_bandwidth_mbps_; // Guarded by |lock_|.
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierPosix);
};
} // namespace net
diff --git a/chromium/net/base/network_change_notifier_win.cc b/chromium/net/base/network_change_notifier_win.cc
index 099ead37300..6eb46ef723c 100644
--- a/chromium/net/base/network_change_notifier_win.cc
+++ b/chromium/net/base/network_change_notifier_win.cc
@@ -37,8 +37,6 @@ const int kWatchForAddressChangeRetryIntervalMs = 500;
NetworkChangeNotifierWin::NetworkChangeNotifierWin()
: NetworkChangeNotifier(NetworkChangeCalculatorParamsWin()),
- is_watching_(false),
- sequential_failures_(0),
blocking_task_runner_(
base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()})),
last_computed_connection_type_(RecomputeCurrentConnectionType()),
diff --git a/chromium/net/base/network_change_notifier_win.h b/chromium/net/base/network_change_notifier_win.h
index f6335f6b25e..619c274172d 100644
--- a/chromium/net/base/network_change_notifier_win.h
+++ b/chromium/net/base/network_change_notifier_win.h
@@ -11,7 +11,6 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
@@ -34,6 +33,8 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
public base::win::ObjectWatcher::Delegate {
public:
NetworkChangeNotifierWin();
+ NetworkChangeNotifierWin(const NetworkChangeNotifierWin&) = delete;
+ NetworkChangeNotifierWin& operator=(const NetworkChangeNotifierWin&) = delete;
~NetworkChangeNotifierWin() override;
// Begins listening for a single subsequent address change. If it fails to
@@ -47,9 +48,9 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
protected:
// For unit tests only.
- bool is_watching() { return is_watching_; }
+ bool is_watching() const { return is_watching_; }
void set_is_watching(bool is_watching) { is_watching_ = is_watching; }
- int sequential_failures() { return sequential_failures_; }
+ int sequential_failures() const { return sequential_failures_; }
private:
friend class NetworkChangeNotifierWinTest;
@@ -96,7 +97,7 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
// False when not currently watching for network change events. This only
// happens on initialization and when WatchForAddressChangeInternal fails and
// there is a pending task to try again. Needed for safe cleanup.
- bool is_watching_;
+ bool is_watching_ = false;
base::win::ObjectWatcher addr_watcher_;
OVERLAPPED addr_overlapped_;
@@ -104,7 +105,7 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
base::OneShotTimer timer_;
// Number of times WatchForAddressChange has failed in a row.
- int sequential_failures_;
+ int sequential_failures_ = 0;
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
@@ -121,8 +122,6 @@ class NET_EXPORT_PRIVATE NetworkChangeNotifierWin
// Used for calling WatchForAddressChange again on failure.
base::WeakPtrFactory<NetworkChangeNotifierWin> weak_factory_{this};
-
- DISALLOW_COPY_AND_ASSIGN(NetworkChangeNotifierWin);
};
} // namespace net
diff --git a/chromium/net/base/network_change_notifier_win_unittest.cc b/chromium/net/base/network_change_notifier_win_unittest.cc
index 77cd637727b..4c4a1bf21d3 100644
--- a/chromium/net/base/network_change_notifier_win_unittest.cc
+++ b/chromium/net/base/network_change_notifier_win_unittest.cc
@@ -7,7 +7,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/macros.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -33,6 +32,10 @@ class TestNetworkChangeNotifierWin : public NetworkChangeNotifierWin {
last_announced_offline_ = false;
}
+ TestNetworkChangeNotifierWin(const TestNetworkChangeNotifierWin&) = delete;
+ TestNetworkChangeNotifierWin& operator=(const TestNetworkChangeNotifierWin&) =
+ delete;
+
~TestNetworkChangeNotifierWin() override {
// This is needed so we don't try to stop watching for IP address changes,
// as we never actually started.
@@ -49,9 +52,6 @@ class TestNetworkChangeNotifierWin : public NetworkChangeNotifierWin {
// From NetworkChangeNotifierWin.
MOCK_METHOD0(WatchForAddressChangeInternal, bool());
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestNetworkChangeNotifierWin);
};
class TestIPAddressObserver : public NetworkChangeNotifier::IPAddressObserver {
@@ -60,14 +60,14 @@ class TestIPAddressObserver : public NetworkChangeNotifier::IPAddressObserver {
NetworkChangeNotifier::AddIPAddressObserver(this);
}
+ TestIPAddressObserver(const TestIPAddressObserver&) = delete;
+ TestIPAddressObserver& operator=(const TestIPAddressObserver&) = delete;
+
~TestIPAddressObserver() {
NetworkChangeNotifier::RemoveIPAddressObserver(this);
}
MOCK_METHOD0(OnIPAddressChanged, void());
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestIPAddressObserver);
};
bool ExitMessageLoopAndReturnFalse() {
diff --git a/chromium/net/base/network_config_watcher_mac.cc b/chromium/net/base/network_config_watcher_mac.cc
index 9e6eda1eeac..a520ed8fa00 100644
--- a/chromium/net/base/network_config_watcher_mac.cc
+++ b/chromium/net/base/network_config_watcher_mac.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
-#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_pump_type.h"
#include "base/metrics/histogram_macros.h"
@@ -120,7 +119,11 @@ void DynamicStoreCallback(SCDynamicStoreRef /* store */,
class NetworkConfigWatcherMacThread : public base::Thread {
public:
- NetworkConfigWatcherMacThread(NetworkConfigWatcherMac::Delegate* delegate);
+ explicit NetworkConfigWatcherMacThread(
+ NetworkConfigWatcherMac::Delegate* delegate);
+ NetworkConfigWatcherMacThread(const NetworkConfigWatcherMacThread&) = delete;
+ NetworkConfigWatcherMacThread& operator=(
+ const NetworkConfigWatcherMacThread&) = delete;
~NetworkConfigWatcherMacThread() override;
protected:
@@ -142,8 +145,6 @@ class NetworkConfigWatcherMacThread : public base::Thread {
int num_retry_;
#endif // !defined(OS_IOS)
base::WeakPtrFactory<NetworkConfigWatcherMacThread> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkConfigWatcherMacThread);
};
NetworkConfigWatcherMacThread::NetworkConfigWatcherMacThread(
diff --git a/chromium/net/base/network_config_watcher_mac.h b/chromium/net/base/network_config_watcher_mac.h
index 7e5ed593515..8c01b7a1ed4 100644
--- a/chromium/net/base/network_config_watcher_mac.h
+++ b/chromium/net/base/network_config_watcher_mac.h
@@ -10,7 +10,6 @@
#include <memory>
#include "base/mac/scoped_cftyperef.h"
-#include "base/macros.h"
namespace base {
class Thread;
@@ -25,7 +24,7 @@ class NetworkConfigWatcherMac {
// NetworkConfigWatcherMac.
class Delegate {
public:
- virtual ~Delegate() {}
+ virtual ~Delegate() = default;
// Called to let the delegate do any setup work the must be run on the
// notifier thread immediately after it starts.
@@ -47,6 +46,8 @@ class NetworkConfigWatcherMac {
};
explicit NetworkConfigWatcherMac(Delegate* delegate);
+ NetworkConfigWatcherMac(const NetworkConfigWatcherMac&) = delete;
+ NetworkConfigWatcherMac& operator=(const NetworkConfigWatcherMac&) = delete;
~NetworkConfigWatcherMac();
private:
@@ -54,8 +55,6 @@ class NetworkConfigWatcherMac {
// to the registered observers without posting back to the thread the object
// was created on.
std::unique_ptr<base::Thread> notifier_thread_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkConfigWatcherMac);
};
} // namespace net
diff --git a/chromium/net/base/network_interfaces.h b/chromium/net/base/network_interfaces.h
index 538adb27e66..c1c79944c6c 100644
--- a/chromium/net/base/network_interfaces.h
+++ b/chromium/net/base/network_interfaces.h
@@ -11,7 +11,6 @@
#include <string>
#include <vector>
-#include "base/macros.h"
#include "net/base/ip_address.h"
#include "net/base/net_export.h"
#include "net/base/network_change_notifier.h"
@@ -125,11 +124,10 @@ enum WifiOptions {
class NET_EXPORT ScopedWifiOptions {
public:
- ScopedWifiOptions() {}
+ ScopedWifiOptions() = default;
+ ScopedWifiOptions(const ScopedWifiOptions&) = delete;
+ ScopedWifiOptions& operator=(const ScopedWifiOptions&) = delete;
virtual ~ScopedWifiOptions();
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ScopedWifiOptions);
};
// Set temporary options on all wifi interfaces.
diff --git a/chromium/net/base/network_interfaces_getifaddrs.h b/chromium/net/base/network_interfaces_getifaddrs.h
index f2d9ae1578c..1adf0bd0f2b 100644
--- a/chromium/net/base/network_interfaces_getifaddrs.h
+++ b/chromium/net/base/network_interfaces_getifaddrs.h
@@ -13,12 +13,12 @@
// This file defines IfaddrsToNetworkInterfaceList() so it can be called in
// unittests.
+#include <string>
+
#include "build/build_config.h"
#include "net/base/net_export.h"
#include "net/base/network_interfaces.h"
-#include <string>
-
struct ifaddrs;
namespace net {
@@ -26,8 +26,10 @@ namespace internal {
class NET_EXPORT_PRIVATE IPAttributesGetter {
public:
- IPAttributesGetter() {}
- virtual ~IPAttributesGetter() {}
+ IPAttributesGetter() = default;
+ IPAttributesGetter(const IPAttributesGetter&) = delete;
+ IPAttributesGetter& operator=(const IPAttributesGetter&) = delete;
+ virtual ~IPAttributesGetter() = default;
virtual bool IsInitialized() const = 0;
// Returns false if the interface must be skipped. Otherwise sets |attributes|
@@ -38,9 +40,6 @@ class NET_EXPORT_PRIVATE IPAttributesGetter {
// Returns interface type for the given interface.
virtual NetworkChangeNotifier::ConnectionType GetNetworkInterfaceType(
const ifaddrs* if_addr) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(IPAttributesGetter);
};
// Converts ifaddrs list returned by getifaddrs() to NetworkInterfaceList. Also
diff --git a/chromium/net/base/network_isolation_key.cc b/chromium/net/base/network_isolation_key.cc
index 1ac44df58fc..a62158638cb 100644
--- a/chromium/net/base/network_isolation_key.cc
+++ b/chromium/net/base/network_isolation_key.cc
@@ -61,12 +61,15 @@ NetworkIsolationKey::NetworkIsolationKey(const url::Origin& top_frame_origin,
false /* opaque_and_non_transient */) {}
NetworkIsolationKey::NetworkIsolationKey()
- : use_frame_origin_(base::FeatureList::IsEnabled(
+ : use_frame_site_(base::FeatureList::IsEnabled(
net::features::kAppendFrameOriginToNetworkIsolationKey)) {}
NetworkIsolationKey::NetworkIsolationKey(
const NetworkIsolationKey& network_isolation_key) = default;
+NetworkIsolationKey::NetworkIsolationKey(
+ NetworkIsolationKey&& network_isolation_key) = default;
+
NetworkIsolationKey::~NetworkIsolationKey() = default;
NetworkIsolationKey& NetworkIsolationKey::operator=(
@@ -88,9 +91,9 @@ NetworkIsolationKey NetworkIsolationKey::CreateOpaqueAndNonTransient() {
NetworkIsolationKey NetworkIsolationKey::CreateWithNewFrameOrigin(
const url::Origin& new_frame_origin) const {
- if (!top_frame_origin_)
+ if (!top_frame_site_)
return NetworkIsolationKey();
- NetworkIsolationKey key(top_frame_origin_.value(), new_frame_origin);
+ NetworkIsolationKey key(top_frame_site_.value(), new_frame_origin);
key.opaque_and_non_transient_ = opaque_and_non_transient_;
return key;
}
@@ -103,19 +106,19 @@ std::string NetworkIsolationKey::ToString() const {
// This key is opaque but not transient.
DCHECK(opaque_and_non_transient_);
return "opaque non-transient " +
- top_frame_origin_->nonce_->token().ToString();
+ top_frame_site_->nonce_->token().ToString();
}
- return top_frame_origin_->Serialize() +
- (use_frame_origin_ ? " " + frame_origin_->Serialize() : "");
+ return top_frame_site_->Serialize() +
+ (use_frame_site_ ? " " + frame_site_->Serialize() : "");
}
std::string NetworkIsolationKey::ToDebugString() const {
- // The space-separated serialization of |top_frame_origin_| and
- // |frame_origin_|.
- std::string return_string = GetOriginDebugString(top_frame_origin_);
- if (use_frame_origin_) {
- return_string += " " + GetOriginDebugString(frame_origin_);
+ // The space-separated serialization of |top_frame_site_| and
+ // |frame_site_|.
+ std::string return_string = GetOriginDebugString(top_frame_site_);
+ if (use_frame_site_) {
+ return_string += " " + GetOriginDebugString(frame_site_);
}
if (IsFullyPopulated() && IsOpaque() && opaque_and_non_transient_) {
return_string += " non-transient";
@@ -124,8 +127,8 @@ std::string NetworkIsolationKey::ToDebugString() const {
}
bool NetworkIsolationKey::IsFullyPopulated() const {
- return top_frame_origin_.has_value() &&
- (!use_frame_origin_ || frame_origin_.has_value());
+ return top_frame_site_.has_value() &&
+ (!use_frame_site_ || frame_site_.has_value());
}
bool NetworkIsolationKey::IsTransient() const {
@@ -148,15 +151,14 @@ bool NetworkIsolationKey::ToValue(base::Value* out_value) const {
return false;
base::Optional<std::string> top_frame_value =
- top_frame_origin_->SerializeWithNonce();
+ top_frame_site_->SerializeWithNonce();
if (!top_frame_value)
return false;
*out_value = base::Value(base::Value::Type::LIST);
out_value->Append(std::move(*top_frame_value));
- if (use_frame_origin_) {
- base::Optional<std::string> frame_value =
- frame_origin_->SerializeWithNonce();
+ if (use_frame_site_) {
+ base::Optional<std::string> frame_value = frame_site_->SerializeWithNonce();
if (!frame_value)
return false;
out_value->Append(std::move(*frame_value));
@@ -220,29 +222,27 @@ bool NetworkIsolationKey::FromValue(
}
bool NetworkIsolationKey::IsEmpty() const {
- return !top_frame_origin_.has_value() && !frame_origin_.has_value();
+ return !top_frame_site_.has_value() && !frame_site_.has_value();
}
NetworkIsolationKey::NetworkIsolationKey(const url::Origin& top_frame_origin,
const url::Origin& frame_origin,
bool opaque_and_non_transient)
: opaque_and_non_transient_(opaque_and_non_transient),
- use_frame_origin_(base::FeatureList::IsEnabled(
+ use_frame_site_(base::FeatureList::IsEnabled(
net::features::kAppendFrameOriginToNetworkIsolationKey)),
- top_frame_origin_(
- SwitchToRegistrableDomainAndRemovePort(top_frame_origin)),
- original_top_frame_origin_(top_frame_origin) {
+ top_frame_site_(
+ SwitchToRegistrableDomainAndRemovePort(top_frame_origin)) {
DCHECK(!opaque_and_non_transient || top_frame_origin.opaque());
- if (use_frame_origin_) {
+ if (use_frame_site_) {
DCHECK(!opaque_and_non_transient || frame_origin.opaque());
- frame_origin_ = SwitchToRegistrableDomainAndRemovePort(frame_origin);
- original_frame_origin_ = frame_origin;
+ frame_site_ = SwitchToRegistrableDomainAndRemovePort(frame_origin);
}
}
bool NetworkIsolationKey::IsOpaque() const {
- return top_frame_origin_->opaque() ||
- (use_frame_origin_ && frame_origin_->opaque());
+ return top_frame_site_->opaque() ||
+ (use_frame_site_ && frame_site_->opaque());
}
} // namespace net
diff --git a/chromium/net/base/network_isolation_key.h b/chromium/net/base/network_isolation_key.h
index 066eba8e40c..2304f5d5f5a 100644
--- a/chromium/net/base/network_isolation_key.h
+++ b/chromium/net/base/network_isolation_key.h
@@ -33,6 +33,7 @@ class NET_EXPORT NetworkIsolationKey {
public:
// Full constructor. When a request is initiated by the top frame, it must
// also populate the |frame_origin| parameter when calling this constructor.
+ // Arguments can be either origins or schemeful sites.
NetworkIsolationKey(const url::Origin& top_frame_origin,
const url::Origin& frame_origin);
@@ -40,6 +41,7 @@ class NET_EXPORT NetworkIsolationKey {
NetworkIsolationKey();
NetworkIsolationKey(const NetworkIsolationKey& network_isolation_key);
+ NetworkIsolationKey(NetworkIsolationKey&& network_isolation_key);
~NetworkIsolationKey();
@@ -71,9 +73,8 @@ class NET_EXPORT NetworkIsolationKey {
// Compare keys for equality, true if all enabled fields are equal.
bool operator==(const NetworkIsolationKey& other) const {
- return std::tie(top_frame_origin_, frame_origin_,
- opaque_and_non_transient_) ==
- std::tie(other.top_frame_origin_, other.frame_origin_,
+ return std::tie(top_frame_site_, frame_site_, opaque_and_non_transient_) ==
+ std::tie(other.top_frame_site_, other.frame_site_,
other.opaque_and_non_transient_);
}
@@ -84,9 +85,8 @@ class NET_EXPORT NetworkIsolationKey {
// Provide an ordering for keys based on all enabled fields.
bool operator<(const NetworkIsolationKey& other) const {
- return std::tie(top_frame_origin_, frame_origin_,
- opaque_and_non_transient_) <
- std::tie(other.top_frame_origin_, other.frame_origin_,
+ return std::tie(top_frame_site_, frame_site_, opaque_and_non_transient_) <
+ std::tie(other.top_frame_site_, other.frame_site_,
other.opaque_and_non_transient_);
}
@@ -106,20 +106,15 @@ class NET_EXPORT NetworkIsolationKey {
// disk related to it (e.g., disk cache).
bool IsTransient() const;
- // Getters for the original top frame and frame origins used as inputs to
- // construct |this|. This could return different values from what the
- // isolation key eventually uses based on whether the NIK uses eTLD+1 or not.
- // WARNING(crbug.com/1032081): Note that these might not return the correct
- // value associated with a request if the NIK on which this is called is from
- // a component using multiple requests mapped to the same NIK.
- const base::Optional<url::Origin>& GetTopFrameOrigin() const {
- DCHECK_EQ(original_top_frame_origin_.has_value(),
- top_frame_origin_.has_value());
- return original_top_frame_origin_;
+ // Getters for the top frame and frame sites. These are actually scheme + site
+ // for HTTP/HTTPS origins, or original origins for other schemes and opaque
+ // origins. These accessors are primarily intended for IPC calls, and to be
+ // able to create an IsolationInfo from a NetworkIsolationKey.
+ const base::Optional<url::Origin>& GetTopFrameSite() const {
+ return top_frame_site_;
}
- const base::Optional<url::Origin>& GetFrameOrigin() const {
- DCHECK_EQ(original_frame_origin_.has_value(), frame_origin_.has_value());
- return original_frame_origin_;
+ const base::Optional<url::Origin>& GetFrameSite() const {
+ return frame_site_;
}
// Returns true if all parts of the key are empty.
@@ -143,11 +138,9 @@ class NET_EXPORT NetworkIsolationKey {
friend class IsolationInfo;
friend struct mojo::StructTraits<network::mojom::NetworkIsolationKeyDataView,
net::NetworkIsolationKey>;
- FRIEND_TEST_ALL_PREFIXES(NetworkIsolationKeyWithFrameOriginTest,
- UseRegistrableDomain);
- NetworkIsolationKey(const url::Origin& top_frame_origin,
- const url::Origin& frame_origin,
+ NetworkIsolationKey(const url::Origin& top_frame_site,
+ const url::Origin& frame_site,
bool opaque_and_non_transient);
bool IsOpaque() const;
@@ -156,20 +149,14 @@ class NET_EXPORT NetworkIsolationKey {
// created with |CreateOpaqueAndNonTransient|.
bool opaque_and_non_transient_ = false;
- // Whether or not to use the |frame_origin_| as part of the key.
- bool use_frame_origin_;
+ // Whether or not to use the |frame_site_| as part of the key.
+ bool use_frame_site_;
// The origin/etld+1 of the top frame of the page making the request.
- base::Optional<url::Origin> top_frame_origin_;
-
- // The original top frame origin sent to the constructor of this request.
- base::Optional<url::Origin> original_top_frame_origin_;
+ base::Optional<url::Origin> top_frame_site_;
// The origin/etld+1 of the frame that initiates the request.
- base::Optional<url::Origin> frame_origin_;
-
- // The original frame origin sent to the constructor of this request.
- base::Optional<url::Origin> original_frame_origin_;
+ base::Optional<url::Origin> frame_site_;
};
} // namespace net
diff --git a/chromium/net/base/network_isolation_key_unittest.cc b/chromium/net/base/network_isolation_key_unittest.cc
index dd7055bf3e6..11944646acb 100644
--- a/chromium/net/base/network_isolation_key_unittest.cc
+++ b/chromium/net/base/network_isolation_key_unittest.cc
@@ -303,11 +303,11 @@ TEST(NetworkIsolationKeyTest, UseRegistrableDomain) {
// Resultant NIK should have the same scheme as the initial origin and
// default port. Note that frame_origin will be empty as triple keying is not
// enabled.
- url::Origin expected_domain_a = url::Origin::Create(GURL("http://foo.test"));
+ url::Origin site_a = url::Origin::Create(GURL("http://foo.test"));
NetworkIsolationKey key(origin_a, origin_b);
- EXPECT_EQ(origin_a, key.GetTopFrameOrigin().value());
- EXPECT_FALSE(key.GetFrameOrigin().has_value());
- EXPECT_EQ(expected_domain_a.Serialize(), key.ToString());
+ EXPECT_EQ(site_a, key.GetTopFrameSite());
+ EXPECT_FALSE(key.GetFrameSite().has_value());
+ EXPECT_EQ(site_a.Serialize(), key.ToString());
// More tests for using registrable domain are in
// NetworkIsolationKeyWithFrameOriginTest.UseRegistrableDomain.
@@ -319,7 +319,7 @@ class OpaqueNonTransientNetworkIsolationKeyTest : public testing::Test {
~OpaqueNonTransientNetworkIsolationKeyTest() override = default;
std::string GetOriginNonceToString(const net::NetworkIsolationKey& key) {
- return key.GetTopFrameOrigin().value().nonce_->token().ToString();
+ return key.GetTopFrameSite()->nonce_->token().ToString();
}
};
@@ -335,7 +335,7 @@ TEST_F(OpaqueNonTransientNetworkIsolationKeyTest,
EXPECT_FALSE(key.IsEmpty());
EXPECT_EQ("opaque non-transient " + GetOriginNonceToString(key),
key.ToString());
- EXPECT_EQ(key.GetTopFrameOrigin()->GetDebugString() + " non-transient",
+ EXPECT_EQ(key.GetTopFrameSite()->GetDebugString() + " non-transient",
key.ToDebugString());
// |opaque_and_non_transient_| is kept when a new frame origin is opaque.
@@ -348,12 +348,12 @@ TEST_F(OpaqueNonTransientNetworkIsolationKeyTest,
EXPECT_EQ("opaque non-transient " + GetOriginNonceToString(new_frame_origin),
new_frame_origin.ToString());
EXPECT_EQ(
- new_frame_origin.GetTopFrameOrigin()->GetDebugString() + " non-transient",
+ new_frame_origin.GetTopFrameSite()->GetDebugString() + " non-transient",
new_frame_origin.ToDebugString());
// Should not be equal to a similar NetworkIsolationKey derived from it.
- EXPECT_NE(key, NetworkIsolationKey(*key.GetTopFrameOrigin(),
- *key.GetTopFrameOrigin()));
+ EXPECT_NE(
+ key, NetworkIsolationKey(*key.GetTopFrameSite(), *key.GetTopFrameSite()));
// To and back from a Value should yield the same key.
base::Value value;
@@ -377,8 +377,8 @@ TEST_F(OpaqueNonTransientNetworkIsolationKeyTest,
EXPECT_FALSE(key.IsEmpty());
EXPECT_EQ("opaque non-transient " + GetOriginNonceToString(key),
key.ToString());
- EXPECT_EQ(key.GetTopFrameOrigin()->GetDebugString() + " " +
- key.GetFrameOrigin()->GetDebugString() + " non-transient",
+ EXPECT_EQ(key.GetTopFrameSite()->GetDebugString() + " " +
+ key.GetFrameSite()->GetDebugString() + " non-transient",
key.ToDebugString());
// |opaque_and_non_transient_| is kept when a new frame origin is opaque.
@@ -390,14 +390,14 @@ TEST_F(OpaqueNonTransientNetworkIsolationKeyTest,
EXPECT_FALSE(new_frame_origin.IsEmpty());
EXPECT_EQ("opaque non-transient " + GetOriginNonceToString(new_frame_origin),
new_frame_origin.ToString());
- EXPECT_EQ(new_frame_origin.GetTopFrameOrigin()->GetDebugString() + " " +
- new_frame_origin.GetFrameOrigin()->GetDebugString() +
+ EXPECT_EQ(new_frame_origin.GetTopFrameSite()->GetDebugString() + " " +
+ new_frame_origin.GetFrameSite()->GetDebugString() +
" non-transient",
new_frame_origin.ToDebugString());
// Should not be equal to a similar NetworkIsolationKey derived from it.
- EXPECT_NE(key, NetworkIsolationKey(*key.GetTopFrameOrigin(),
- *key.GetFrameOrigin()));
+ EXPECT_NE(key,
+ NetworkIsolationKey(*key.GetTopFrameSite(), *key.GetFrameSite()));
// To and back from a Value should yield the same key.
base::Value value;
@@ -508,8 +508,8 @@ TEST_F(NetworkIsolationKeyWithFrameOriginTest, UseRegistrableDomain) {
url::Origin expected_domain_a = url::Origin::Create(GURL("http://foo.test"));
url::Origin expected_domain_b = url::Origin::Create(GURL("https://foo.test"));
NetworkIsolationKey key(origin_a, origin_b);
- EXPECT_EQ(origin_a, key.GetTopFrameOrigin().value());
- EXPECT_EQ(origin_b, key.GetFrameOrigin().value());
+ EXPECT_EQ(expected_domain_a, key.GetTopFrameSite());
+ EXPECT_EQ(expected_domain_b, key.GetFrameSite());
EXPECT_EQ(expected_domain_a.Serialize() + " " + expected_domain_b.Serialize(),
key.ToString());
@@ -517,17 +517,17 @@ TEST_F(NetworkIsolationKeyWithFrameOriginTest, UseRegistrableDomain) {
url::Origin origin_data =
url::Origin::Create(GURL("data:text/html,<body>Hello World</body>"));
key = NetworkIsolationKey(origin_data, origin_b);
- EXPECT_TRUE(key.top_frame_origin_->opaque());
+ EXPECT_TRUE(key.GetTopFrameSite()->opaque());
EXPECT_TRUE(key.ToString().empty());
- EXPECT_EQ(origin_data, key.top_frame_origin_.value());
- EXPECT_EQ(expected_domain_b, key.frame_origin_.value());
+ EXPECT_EQ(origin_data, key.GetTopFrameSite());
+ EXPECT_EQ(expected_domain_b, key.GetFrameSite());
// Top frame origin is non-opaque but frame origin is opaque.
key = NetworkIsolationKey(origin_a, origin_data);
- EXPECT_EQ(expected_domain_a, key.top_frame_origin_.value());
+ EXPECT_EQ(expected_domain_a, key.GetTopFrameSite());
EXPECT_TRUE(key.ToString().empty());
- EXPECT_EQ(origin_data, key.GetFrameOrigin().value());
- EXPECT_TRUE(key.frame_origin_->opaque());
+ EXPECT_EQ(origin_data, key.GetFrameSite());
+ EXPECT_TRUE(key.GetFrameSite()->opaque());
// Empty NIK stays empty.
NetworkIsolationKey empty_key;
@@ -539,17 +539,16 @@ TEST_F(NetworkIsolationKeyWithFrameOriginTest, UseRegistrableDomain) {
url::Origin origin_ipv6 = url::Origin::Create(GURL("https://[::1]"));
key = NetworkIsolationKey(origin_ipv4, origin_ipv6);
EXPECT_EQ(url::Origin::Create(GURL("http://127.0.0.1")),
- key.top_frame_origin_.value());
- EXPECT_EQ(origin_ipv6, key.frame_origin_.value());
+ key.GetTopFrameSite());
+ EXPECT_EQ(origin_ipv6, key.GetFrameSite());
// Nor should TLDs, recognized or not.
url::Origin origin_tld = url::Origin::Create(GURL("http://com"));
url::Origin origin_tld_unknown =
url::Origin::Create(GURL("https://bar:1234"));
key = NetworkIsolationKey(origin_tld, origin_tld_unknown);
- EXPECT_EQ(origin_tld, key.top_frame_origin_.value());
- EXPECT_EQ(url::Origin::Create(GURL("https://bar")),
- key.frame_origin_.value());
+ EXPECT_EQ(origin_tld, key.GetTopFrameSite());
+ EXPECT_EQ(url::Origin::Create(GURL("https://bar")), key.GetFrameSite());
// Check for two-part TLDs.
url::Origin origin_two_part_tld = url::Origin::Create(GURL("http://co.uk"));
@@ -557,9 +556,8 @@ TEST_F(NetworkIsolationKeyWithFrameOriginTest, UseRegistrableDomain) {
url::Origin::Create(GURL("https://a.b.co.uk"));
key =
NetworkIsolationKey(origin_two_part_tld, origin_two_part_tld_with_prefix);
- EXPECT_EQ(origin_two_part_tld, key.top_frame_origin_.value());
- EXPECT_EQ(url::Origin::Create(GURL("https://b.co.uk")),
- key.frame_origin_.value());
+ EXPECT_EQ(origin_two_part_tld, key.GetTopFrameSite());
+ EXPECT_EQ(url::Origin::Create(GURL("https://b.co.uk")), key.GetFrameSite());
// Two keys with different origins but same etld+1.
// Also test the getter APIs.
@@ -571,17 +569,17 @@ TEST_F(NetworkIsolationKeyWithFrameOriginTest, UseRegistrableDomain) {
EXPECT_EQ(key1, key2);
EXPECT_EQ(foo.Serialize() + " " + foo.Serialize(), key1.ToString());
EXPECT_EQ(foo.Serialize() + " " + foo.Serialize(), key2.ToString());
- EXPECT_EQ(origin_a_foo, key1.GetTopFrameOrigin());
- EXPECT_EQ(origin_a_foo, key1.GetFrameOrigin());
- EXPECT_EQ(origin_b_foo, key2.GetTopFrameOrigin());
- EXPECT_EQ(origin_b_foo, key2.GetFrameOrigin());
+ EXPECT_EQ(foo, key1.GetTopFrameSite());
+ EXPECT_EQ(foo, key1.GetFrameSite());
+ EXPECT_EQ(foo, key2.GetTopFrameSite());
+ EXPECT_EQ(foo, key2.GetFrameSite());
// Copying one key to another should also copy the original origins.
url::Origin origin_bar = url::Origin::Create(GURL("http://a.bar.com"));
NetworkIsolationKey key_bar = NetworkIsolationKey(origin_bar, origin_bar);
NetworkIsolationKey key_copied = key_bar;
- EXPECT_EQ(key_copied.GetTopFrameOrigin(), key_bar.GetTopFrameOrigin());
- EXPECT_EQ(key_copied.GetFrameOrigin(), key_bar.GetFrameOrigin());
+ EXPECT_EQ(key_copied.GetTopFrameSite(), key_bar.GetTopFrameSite());
+ EXPECT_EQ(key_copied.GetFrameSite(), key_bar.GetFrameSite());
EXPECT_EQ(key_copied, key_bar);
}
@@ -603,10 +601,10 @@ TEST(NetworkIsolationKeyTest, NonStandardScheme) {
ASSERT_EQ(origin.host(), "a.foo.com");
net::NetworkIsolationKey key(origin, origin);
- EXPECT_EQ(origin, key.GetTopFrameOrigin());
- EXPECT_FALSE(key.GetTopFrameOrigin()->opaque());
- EXPECT_EQ(key.GetTopFrameOrigin()->scheme(), "foo");
- EXPECT_EQ(key.GetTopFrameOrigin()->host(), "a.foo.com");
+ EXPECT_EQ(origin, key.GetTopFrameSite());
+ EXPECT_FALSE(key.GetTopFrameSite()->opaque());
+ EXPECT_EQ(key.GetTopFrameSite()->scheme(), "foo");
+ EXPECT_EQ(key.GetTopFrameSite()->host(), "a.foo.com");
EXPECT_EQ(origin.Serialize(), key.ToString());
}
@@ -617,8 +615,8 @@ TEST_F(NetworkIsolationKeyWithFrameOriginTest, CreateWithNewFrameOrigin) {
net::NetworkIsolationKey key(origin_a, origin_b);
NetworkIsolationKey key_c = key.CreateWithNewFrameOrigin(origin_c);
- EXPECT_EQ(origin_c, key_c.GetFrameOrigin());
- EXPECT_EQ(origin_a, key_c.GetTopFrameOrigin());
+ EXPECT_EQ(origin_c, key_c.GetFrameSite());
+ EXPECT_EQ(origin_a, key_c.GetTopFrameSite());
}
TEST(NetworkIsolationKeyTest, CreateTransient) {
diff --git a/chromium/net/base/network_notification_thread_mac.cc b/chromium/net/base/network_notification_thread_mac.cc
index 684bfc9b28e..cc2b870c813 100644
--- a/chromium/net/base/network_notification_thread_mac.cc
+++ b/chromium/net/base/network_notification_thread_mac.cc
@@ -14,6 +14,9 @@ namespace {
class NotificationThreadMac {
public:
+ NotificationThreadMac(const NotificationThreadMac&) = delete;
+ NotificationThreadMac& operator=(const NotificationThreadMac&) = delete;
+
scoped_refptr<base::SingleThreadTaskRunner> task_runner() const {
return task_runner_;
}
@@ -38,8 +41,6 @@ class NotificationThreadMac {
// Saved TaskRunner handle that can be accessed from any thread.
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
-
- DISALLOW_COPY_AND_ASSIGN(NotificationThreadMac);
};
} // namespace
diff --git a/chromium/net/base/port_util.cc b/chromium/net/base/port_util.cc
index 12bfd9a36a0..bf5a0a75fb4 100644
--- a/chromium/net/base/port_util.cc
+++ b/chromium/net/base/port_util.cc
@@ -73,7 +73,6 @@ const int kRestrictedPorts[] = {
532, // netnews
540, // uucp
548, // AFP (Apple Filing Protocol)
- 554, // rtsp
556, // remotefs
563, // nntp+ssl
587, // smtp (rfc6409)
diff --git a/chromium/net/base/port_util.h b/chromium/net/base/port_util.h
index b64b137be98..aa701b7ae5d 100644
--- a/chromium/net/base/port_util.h
+++ b/chromium/net/base/port_util.h
@@ -9,7 +9,6 @@
#include <string>
-#include "base/macros.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -36,12 +35,12 @@ NET_EXPORT void SetExplicitlyAllowedPorts(const std::string& allowed_ports);
class NET_EXPORT ScopedPortException {
public:
explicit ScopedPortException(int port);
+ ScopedPortException(const ScopedPortException&) = delete;
+ ScopedPortException& operator=(const ScopedPortException&) = delete;
~ScopedPortException();
private:
int port_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedPortException);
};
} // namespace net
diff --git a/chromium/net/base/prioritized_dispatcher.cc b/chromium/net/base/prioritized_dispatcher.cc
index 24c327ce9ca..0adfda6e990 100644
--- a/chromium/net/base/prioritized_dispatcher.cc
+++ b/chromium/net/base/prioritized_dispatcher.cc
@@ -18,8 +18,7 @@ PrioritizedDispatcher::Limits::~Limits() = default;
PrioritizedDispatcher::PrioritizedDispatcher(const Limits& limits)
: queue_(limits.reserved_slots.size()),
- max_running_jobs_(limits.reserved_slots.size()),
- num_running_jobs_(0) {
+ max_running_jobs_(limits.reserved_slots.size()) {
SetLimits(limits);
}
diff --git a/chromium/net/base/prioritized_dispatcher.h b/chromium/net/base/prioritized_dispatcher.h
index a0716ccf054..9e286541b41 100644
--- a/chromium/net/base/prioritized_dispatcher.h
+++ b/chromium/net/base/prioritized_dispatcher.h
@@ -9,7 +9,6 @@
#include <vector>
-#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/base/priority_queue.h"
@@ -70,6 +69,8 @@ class NET_EXPORT_PRIVATE PrioritizedDispatcher {
// Creates a dispatcher enforcing |limits| on number of running jobs.
explicit PrioritizedDispatcher(const Limits& limits);
+ PrioritizedDispatcher(const PrioritizedDispatcher&) = delete;
+ PrioritizedDispatcher& operator=(const PrioritizedDispatcher&) = delete;
~PrioritizedDispatcher();
size_t num_running_jobs() const { return num_running_jobs_; }
@@ -132,9 +133,7 @@ class NET_EXPORT_PRIVATE PrioritizedDispatcher {
// another job cannot be started.
std::vector<size_t> max_running_jobs_;
// Total number of running jobs.
- size_t num_running_jobs_;
-
- DISALLOW_COPY_AND_ASSIGN(PrioritizedDispatcher);
+ size_t num_running_jobs_ = 0;
};
} // namespace net
diff --git a/chromium/net/base/prioritized_task_runner.h b/chromium/net/base/prioritized_task_runner.h
index 8fa34f3e4de..815caf5fa5e 100644
--- a/chromium/net/base/prioritized_task_runner.h
+++ b/chromium/net/base/prioritized_task_runner.h
@@ -6,6 +6,7 @@
#define NET_BASE_PRIORITIZED_TASK_RUNNER_H_
#include <stdint.h>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -47,7 +48,9 @@ class NET_EXPORT_PRIVATE PrioritizedTaskRunner
: public base::RefCountedThreadSafe<PrioritizedTaskRunner> {
public:
enum class ReplyRunnerType { kStandard, kPrioritized };
- PrioritizedTaskRunner(scoped_refptr<base::TaskRunner> task_runner);
+ explicit PrioritizedTaskRunner(scoped_refptr<base::TaskRunner> task_runner);
+ PrioritizedTaskRunner(const PrioritizedTaskRunner&) = delete;
+ PrioritizedTaskRunner& operator=(const PrioritizedTaskRunner&) = delete;
// Similar to TaskRunner::PostTaskAndReply, except that the task runs at
// |priority|. Priority 0 is the highest priority and will run before other
@@ -88,6 +91,8 @@ class NET_EXPORT_PRIVATE PrioritizedTaskRunner
uint32_t priority,
uint32_t task_count);
Job();
+ Job(const Job&) = delete;
+ Job& operator=(const Job&) = delete;
~Job();
Job(Job&& other);
@@ -98,9 +103,6 @@ class NET_EXPORT_PRIVATE PrioritizedTaskRunner
base::OnceClosure reply;
uint32_t priority = 0;
uint32_t task_count = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Job);
};
struct JobComparer {
@@ -131,8 +133,6 @@ class NET_EXPORT_PRIVATE PrioritizedTaskRunner
// cause periodic priority inversion. This should be infrequent enough to be
// of negligible impact.
uint32_t task_count_ = 0;
-
- DISALLOW_COPY_AND_ASSIGN(PrioritizedTaskRunner);
};
} // namespace net
diff --git a/chromium/net/base/prioritized_task_runner_unittest.cc b/chromium/net/base/prioritized_task_runner_unittest.cc
index e764d9ce397..01c6e95a49e 100644
--- a/chromium/net/base/prioritized_task_runner_unittest.cc
+++ b/chromium/net/base/prioritized_task_runner_unittest.cc
@@ -6,10 +6,11 @@
#include <algorithm>
#include <limits>
+#include <string>
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
@@ -29,7 +30,10 @@ namespace {
class PrioritizedTaskRunnerTest : public testing::Test {
public:
- PrioritizedTaskRunnerTest() {}
+ PrioritizedTaskRunnerTest() = default;
+ PrioritizedTaskRunnerTest(const PrioritizedTaskRunnerTest&) = delete;
+ PrioritizedTaskRunnerTest& operator=(const PrioritizedTaskRunnerTest&) =
+ delete;
void PushName(const std::string& task_name) {
base::AutoLock auto_lock(callback_names_lock_);
@@ -101,9 +105,6 @@ class PrioritizedTaskRunnerTest : public testing::Test {
std::vector<std::string> callback_names_;
base::Lock callback_names_lock_;
base::WaitableEvent waitable_event_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PrioritizedTaskRunnerTest);
};
TEST_F(PrioritizedTaskRunnerTest, PostTaskAndReplyThreadCheck) {
diff --git a/chromium/net/base/priority_queue.h b/chromium/net/base/priority_queue.h
index c4c30fa45c0..b634a58c066 100644
--- a/chromium/net/base/priority_queue.h
+++ b/chromium/net/base/priority_queue.h
@@ -9,12 +9,12 @@
#include <stdint.h>
#include <list>
+#include <utility>
#include <vector>
#include "base/bind.h"
#include "base/callback.h"
#include "base/check_op.h"
-#include "base/macros.h"
#include "base/threading/thread_checker.h"
#if !defined(NDEBUG)
@@ -139,6 +139,8 @@ class PriorityQueue {
#endif
}
+ PriorityQueue(const PriorityQueue&) = delete;
+ PriorityQueue& operator=(const PriorityQueue&) = delete;
~PriorityQueue() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); }
// Adds |value| with |priority| to the queue. Returns a pointer to the
@@ -374,8 +376,6 @@ class PriorityQueue {
size_t size_;
THREAD_CHECKER(thread_checker_);
-
- DISALLOW_COPY_AND_ASSIGN(PriorityQueue);
};
} // namespace net
diff --git a/chromium/net/base/proxy_delegate.h b/chromium/net/base/proxy_delegate.h
index 6f68a442de7..92e622e7511 100644
--- a/chromium/net/base/proxy_delegate.h
+++ b/chromium/net/base/proxy_delegate.h
@@ -7,7 +7,6 @@
#include <string>
-#include "base/macros.h"
#include "net/base/net_errors.h"
#include "net/base/net_export.h"
#include "net/proxy_resolution/proxy_retry_info.h"
@@ -25,6 +24,8 @@ class ProxyServer;
class NET_EXPORT ProxyDelegate {
public:
ProxyDelegate() = default;
+ ProxyDelegate(const ProxyDelegate&) = delete;
+ ProxyDelegate& operator=(const ProxyDelegate&) = delete;
virtual ~ProxyDelegate() = default;
// Called as the proxy is being resolved for |url| for a |method| request.
@@ -56,9 +57,6 @@ class NET_EXPORT ProxyDelegate {
virtual Error OnTunnelHeadersReceived(
const ProxyServer& proxy_server,
const HttpResponseHeaders& response_headers) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ProxyDelegate);
};
} // namespace net
diff --git a/chromium/net/base/registry_controlled_domains/OWNERS b/chromium/net/base/registry_controlled_domains/OWNERS
index 10be63d79c3..2ba05a6168c 100644
--- a/chromium/net/base/registry_controlled_domains/OWNERS
+++ b/chromium/net/base/registry_controlled_domains/OWNERS
@@ -1,5 +1,3 @@
pam@chromium.org
pkasting@chromium.org
rsleevi@chromium.org
-
-# COMPONENT: Internals>Network
diff --git a/chromium/net/base/schemeful_site.cc b/chromium/net/base/schemeful_site.cc
new file mode 100644
index 00000000000..da94c794cc6
--- /dev/null
+++ b/chromium/net/base/schemeful_site.cc
@@ -0,0 +1,138 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/schemeful_site.h"
+
+#include "base/check.h"
+#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include "url/gurl.h"
+#include "url/url_canon.h"
+#include "url/url_constants.h"
+
+namespace net {
+
+// Return a tuple containing:
+// * a new origin using the registerable domain of `origin` if possible and
+// a port of 0; otherwise, the passed-in origin.
+// * a bool indicating whether `origin` had a non-null registerable domain.
+// (False if `origin` was opaque.)
+//
+// Follows steps specified in
+// https://html.spec.whatwg.org/multipage/origin.html#obtain-a-site
+SchemefulSite::ObtainASiteResult SchemefulSite::ObtainASite(
+ const url::Origin& origin) {
+ // There is currently no reason for getting the schemeful site of a web
+ // socket, so disallow passing in websocket origins.
+ DCHECK_NE(origin.scheme(), url::kWsScheme);
+ DCHECK_NE(origin.scheme(), url::kWssScheme);
+
+ // 1. If origin is an opaque origin, then return origin.
+ if (origin.opaque())
+ return {origin, false /* used_registerable_domain */};
+
+ std::string registerable_domain;
+
+ // Non-normative step.
+ // We only lookup the registerable domain for HTTP/HTTPS schemes, this is
+ // non-normative. Other schemes for non-opaque origins like "file" do not
+ // meaningfully have a registerable domain for their host, so they are
+ // skipped.
+ if (origin.scheme() == url::kHttpsScheme ||
+ origin.scheme() == url::kHttpScheme) {
+ registerable_domain = GetDomainAndRegistry(
+ origin, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
+ }
+
+ // If origin's host's registrable domain is null, then return (origin's
+ // scheme, origin's host).
+ //
+ // `GetDomainAndRegistry()` returns an empty string for IP literals and
+ // effective TLDs.
+ //
+ // Note that `registerable_domain` could still end up empty, since the
+ // `origin` might have a scheme that permits empty hostnames, such as "file".
+ bool used_registerable_domain = !registerable_domain.empty();
+ if (!used_registerable_domain)
+ registerable_domain = origin.host();
+
+ int port = url::DefaultPortForScheme(origin.scheme().c_str(),
+ origin.scheme().length());
+
+ // Provide a default port of 0 for non-standard schemes.
+ if (port == url::PORT_UNSPECIFIED)
+ port = 0;
+
+ return {url::Origin::CreateFromNormalizedTuple(origin.scheme(),
+ registerable_domain, port),
+ used_registerable_domain};
+}
+
+SchemefulSite::SchemefulSite(ObtainASiteResult result)
+ : site_as_origin_(std::move(result.origin)) {}
+
+SchemefulSite::SchemefulSite(const url::Origin& origin)
+ : SchemefulSite(ObtainASite(origin)) {}
+
+SchemefulSite::SchemefulSite(const GURL& url)
+ : SchemefulSite(url::Origin::Create(url)) {}
+
+SchemefulSite::SchemefulSite(const SchemefulSite& other) = default;
+SchemefulSite::SchemefulSite(SchemefulSite&& other) = default;
+
+SchemefulSite& SchemefulSite::operator=(const SchemefulSite& other) = default;
+SchemefulSite& SchemefulSite::operator=(SchemefulSite&& other) = default;
+
+base::Optional<SchemefulSite> SchemefulSite::CreateIfHasRegisterableDomain(
+ const url::Origin& origin) {
+ ObtainASiteResult result = ObtainASite(origin);
+ if (!result.used_registerable_domain)
+ return base::nullopt;
+ return SchemefulSite(std::move(result));
+}
+
+// static
+SchemefulSite SchemefulSite::Deserialize(const std::string& value) {
+ return SchemefulSite(GURL(value));
+}
+
+std::string SchemefulSite::Serialize() const {
+ return site_as_origin_.Serialize();
+}
+
+std::string SchemefulSite::GetDebugString() const {
+ return site_as_origin_.GetDebugString();
+}
+
+const url::Origin& SchemefulSite::GetInternalOriginForTesting() const {
+ return site_as_origin_;
+}
+
+bool SchemefulSite::operator==(const SchemefulSite& other) const {
+ return site_as_origin_ == other.site_as_origin_;
+}
+
+bool SchemefulSite::operator!=(const SchemefulSite& other) const {
+ return !(*this == other);
+}
+
+// Allows SchemefulSite to be used as a key in STL containers (for example, a
+// std::set or std::map).
+bool SchemefulSite::operator<(const SchemefulSite& other) const {
+ return site_as_origin_ < other.site_as_origin_;
+}
+
+// static
+base::Optional<SchemefulSite> SchemefulSite::DeserializeWithNonce(
+ const std::string& value) {
+ base::Optional<url::Origin> result = url::Origin::Deserialize(value);
+ if (!result)
+ return base::nullopt;
+ return SchemefulSite(result.value());
+}
+
+base::Optional<std::string> SchemefulSite::SerializeWithNonce() {
+ return site_as_origin_.SerializeWithNonceAndInitIfNeeded();
+}
+
+} // namespace net
diff --git a/chromium/net/base/schemeful_site.h b/chromium/net/base/schemeful_site.h
new file mode 100644
index 00000000000..958044f26be
--- /dev/null
+++ b/chromium/net/base/schemeful_site.h
@@ -0,0 +1,139 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_SCHEMEFUL_SITE_H_
+#define NET_BASE_SCHEMEFUL_SITE_H_
+
+#include <ostream>
+#include <string>
+
+#include "base/gtest_prod_util.h"
+#include "base/optional.h"
+#include "net/base/net_export.h"
+#include "url/origin.h"
+
+class GURL;
+
+namespace network {
+namespace mojom {
+class SchemefulSiteDataView;
+} // namespace mojom
+} // namespace network
+
+namespace mojo {
+template <typename DataViewType, typename T>
+struct StructTraits;
+} // namespace mojo
+
+namespace net {
+
+// Class which represents a scheme and etld+1 for an origin, as specified by
+// https://html.spec.whatwg.org/multipage/origin.html#obtain-a-site.
+//
+// A SchemefulSite is obtained from an input origin by normalizing, such that:
+// 1. Opaque origins have distinct SchemefulSites.
+// 2. http(s) origins have the same SchemefulSite iff they share a scheme, and
+// share a hostname or registrable domain.
+// 3. Non-http(s) origins have the same SchemefulSite iff they share a scheme
+// and host.
+// 4. Origins which differ only by port have the same SchemefulSite.
+// 5. Websocket origins cannot have a SchemefulSite (they trigger a DCHECK).
+class NET_EXPORT SchemefulSite {
+ public:
+ SchemefulSite() = default;
+
+ // The passed `origin` may not match the resulting internal representation in
+ // certain circumstances. See the comment, below, on the `site_as_origin_`
+ // member.
+ explicit SchemefulSite(const url::Origin& origin);
+
+ // Using the origin constructor is preferred as this is less efficient.
+ // Should only be used if the origin for a given GURL is not readily
+ // available.
+ explicit SchemefulSite(const GURL& url);
+
+ SchemefulSite(const SchemefulSite& other);
+ SchemefulSite(SchemefulSite&& other);
+
+ SchemefulSite& operator=(const SchemefulSite& other);
+ SchemefulSite& operator=(SchemefulSite&& other);
+
+ // Creates a SchemefulSite iff the passed-in origin has a registerable domain.
+ static base::Optional<SchemefulSite> CreateIfHasRegisterableDomain(
+ const url::Origin&);
+
+ // Deserializes a string obtained from `Serialize()` to a `SchemefulSite`.
+ // Returns an opaque `SchemefulSite` if the value was invalid in any way.
+ static SchemefulSite Deserialize(const std::string& value);
+
+ // Returns a serialized version of `site_as_origin_`. If the underlying origin
+ // is invalid, returns an empty string. If serialization of opaque origins
+ // with their associated nonce is necessary, see `SerializeWithNonce()`.
+ std::string Serialize() const;
+
+ std::string GetDebugString() const;
+
+ bool opaque() const { return site_as_origin_.opaque(); }
+
+ // Testing only function which allows tests to access the underlying
+ // `site_as_origin_` in order to verify behavior.
+ const url::Origin& GetInternalOriginForTesting() const;
+
+ bool operator==(const SchemefulSite& other) const;
+
+ bool operator!=(const SchemefulSite& other) const;
+
+ bool operator<(const SchemefulSite& other) const;
+
+ private:
+ // Mojo serialization code needs to access internal origin.
+ friend struct mojo::StructTraits<network::mojom::SchemefulSiteDataView,
+ SchemefulSite>;
+
+ FRIEND_TEST_ALL_PREFIXES(SchemefulSiteTest, OpaqueSerialization);
+
+ struct ObtainASiteResult {
+ url::Origin origin;
+ bool used_registerable_domain;
+ };
+
+ static ObtainASiteResult ObtainASite(const url::Origin&);
+
+ explicit SchemefulSite(ObtainASiteResult);
+
+ // Deserializes a string obtained from `SerializeWithNonce()` to a
+ // `SchemefulSite`. Returns nullopt if the value was invalid in any way.
+ static base::Optional<SchemefulSite> DeserializeWithNonce(
+ const std::string& value);
+
+ // Returns a serialized version of `site_as_origin_`. For an opaque
+ // `site_as_origin_`, this serializes with the nonce. See
+ // `url::origin::SerializeWithNonce()` for usage information.
+ base::Optional<std::string> SerializeWithNonce();
+
+ // Origin which stores the result of running the steps documented at
+ // https://html.spec.whatwg.org/multipage/origin.html#obtain-a-site.
+ // This is not an arbitrary origin. It must either be an opaque origin, or a
+ // scheme + eTLD+1 + default port.
+ //
+ // The `origin` passed into the SchemefulSite(const url::Origin&) constructor
+ // might not match this internal representation used by this class to track
+ // the scheme and eTLD+1 representing a schemeful site. This may be the case
+ // if, e.g., the passed `origin` has an eTLD+1 that is not equal to its
+ // hostname, or if the port number is not the default port for its scheme.
+ //
+ // In general, this `site_as_origin_` used for the internal representation
+ // should NOT be used directly by SchemefulSite consumers.
+ url::Origin site_as_origin_;
+};
+
+// Provided to allow gtest to create more helpful error messages, instead of
+// printing hex.
+inline void PrintTo(const SchemefulSite& ss, std::ostream* os) {
+ *os << ss.Serialize();
+}
+
+} // namespace net
+
+#endif // NET_BASE_SCHEMEFUL_SITE_H_
diff --git a/chromium/net/base/schemeful_site_unittest.cc b/chromium/net/base/schemeful_site_unittest.cc
new file mode 100644
index 00000000000..e5644b45fab
--- /dev/null
+++ b/chromium/net/base/schemeful_site_unittest.cc
@@ -0,0 +1,219 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/base/schemeful_site.h"
+
+#include "testing/gmock/include/gmock/gmock-matchers.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+#include "url/origin.h"
+#include "url/url_util.h"
+
+namespace net {
+
+TEST(SchemefulSiteTest, DifferentOriginSameRegisterableDomain) {
+ // List of origins which should all share a schemeful site.
+ url::Origin kTestOrigins[] = {
+ url::Origin::Create(GURL("http://a.foo.test")),
+ url::Origin::Create(GURL("http://b.foo.test")),
+ url::Origin::Create(GURL("http://foo.test")),
+ url::Origin::Create(GURL("http://a.b.foo.test"))};
+
+ for (const auto& origin_a : kTestOrigins) {
+ for (const auto& origin_b : kTestOrigins) {
+ EXPECT_EQ(SchemefulSite(origin_a), SchemefulSite(origin_b));
+ }
+ }
+}
+
+TEST(SchemefulSiteTest, Operators) {
+ // Create a list of origins that should all have different schemeful sites.
+ // These are in ascending order.
+ url::Origin kTestOrigins[] = {
+ url::Origin::Create(GURL("data:text/html,<body>Hello World</body>")),
+ url::Origin::Create(GURL("file://foo")),
+ url::Origin::Create(GURL("http://a.bar.test")),
+ url::Origin::Create(GURL("http://c.test")),
+ url::Origin::Create(GURL("http://d.test")),
+ url::Origin::Create(GURL("http://a.foo.test")),
+ url::Origin::Create(GURL("https://a.bar.test")),
+ url::Origin::Create(GURL("https://c.test")),
+ url::Origin::Create(GURL("https://d.test")),
+ url::Origin::Create(GURL("https://a.foo.test"))};
+
+ // Compare each origin to every other origin and ensure the operators work as
+ // expected.
+ for (size_t first = 0; first < base::size(kTestOrigins); ++first) {
+ SchemefulSite site1 = SchemefulSite(kTestOrigins[first]);
+ SCOPED_TRACE(site1.GetDebugString());
+
+ EXPECT_EQ(site1, site1);
+ EXPECT_FALSE(site1 < site1);
+
+ // Check the operators work on copies.
+ SchemefulSite site1_copy = site1;
+ EXPECT_EQ(site1, site1_copy);
+ EXPECT_FALSE(site1 < site1_copy);
+
+ for (size_t second = first + 1; second < base::size(kTestOrigins);
+ ++second) {
+ SchemefulSite site2 = SchemefulSite(kTestOrigins[second]);
+ SCOPED_TRACE(site2.GetDebugString());
+
+ EXPECT_TRUE(site1 < site2);
+ EXPECT_FALSE(site2 < site1);
+ EXPECT_FALSE(site1 == site2);
+ EXPECT_FALSE(site2 == site1);
+ }
+ }
+}
+
+TEST(SchemefulSiteTest, SchemeUsed) {
+ url::Origin origin_a = url::Origin::Create(GURL("https://foo.test"));
+ url::Origin origin_b = url::Origin::Create(GURL("http://foo.test"));
+ EXPECT_NE(SchemefulSite(origin_a), SchemefulSite(origin_b));
+}
+
+TEST(SchemefulSiteTest, PortIgnored) {
+ // Both origins are non-opaque.
+ url::Origin origin_a = url::Origin::Create(GURL("https://foo.test:80"));
+ url::Origin origin_b = url::Origin::Create(GURL("https://foo.test:2395"));
+
+ EXPECT_EQ(SchemefulSite(origin_a), SchemefulSite(origin_b));
+}
+
+TEST(SchemefulSiteTest, TopLevelDomainsNotModified) {
+ url::Origin origin_tld = url::Origin::Create(GURL("https://com"));
+ EXPECT_EQ(url::Origin::Create(GURL("https://com")),
+ SchemefulSite(origin_tld).GetInternalOriginForTesting());
+
+ // Unknown TLD's should not be modified.
+ url::Origin origin_tld_unknown =
+ url::Origin::Create(GURL("https://bar:1234"));
+ EXPECT_EQ(url::Origin::Create(GURL("https://bar")),
+ SchemefulSite(origin_tld_unknown).GetInternalOriginForTesting());
+
+ // Check for two-part TLDs.
+ url::Origin origin_two_part_tld = url::Origin::Create(GURL("http://a.co.uk"));
+ EXPECT_EQ(url::Origin::Create(GURL("http://a.co.uk")),
+ SchemefulSite(origin_two_part_tld).GetInternalOriginForTesting());
+}
+
+TEST(SchemefulSiteTest, NonStandardScheme) {
+ url::ScopedSchemeRegistryForTests scoped_registry;
+ url::AddStandardScheme("foo", url::SCHEME_WITH_HOST);
+ url::Origin origin = url::Origin::Create(GURL("foo://a.b.test"));
+ EXPECT_FALSE(origin.opaque());
+
+ // We should not use registerable domains for non-standard schemes, even if
+ // one exists for the host.
+ EXPECT_EQ(url::Origin::Create(GURL("foo://a.b.test")),
+ SchemefulSite(origin).GetInternalOriginForTesting());
+}
+
+TEST(SchemefulSiteTest, IPBasedOriginsRemovePort) {
+ // IPv4 and IPv6 origins should not be modified, except for removing their
+ // ports.
+ url::Origin origin_ipv4_a =
+ url::Origin::Create(GURL("http://127.0.0.1:1234"));
+ url::Origin origin_ipv4_b = url::Origin::Create(GURL("http://127.0.0.1"));
+ EXPECT_EQ(url::Origin::Create(GURL("http://127.0.0.1")),
+ SchemefulSite(origin_ipv4_a).GetInternalOriginForTesting());
+ EXPECT_EQ(SchemefulSite(origin_ipv4_a), SchemefulSite(origin_ipv4_b));
+
+ url::Origin origin_ipv6 = url::Origin::Create(GURL("https://[::1]"));
+ EXPECT_EQ(url::Origin::Create(GURL("https://[::1]")),
+ SchemefulSite(origin_ipv6).GetInternalOriginForTesting());
+}
+
+TEST(SchemefulSiteTest, OpaqueOrigins) {
+ url::Origin opaque_origin_a =
+ url::Origin::Create(GURL("data:text/html,<body>Hello World</body>"));
+
+ // The schemeful site of an opaque origin should always equal other schemeful
+ // site instances of the same origin.
+ EXPECT_EQ(SchemefulSite(opaque_origin_a), SchemefulSite(opaque_origin_a));
+
+ url::Origin opaque_origin_b =
+ url::Origin::Create(GURL("data:text/html,<body>Hello World</body>"));
+
+ // Two different opaque origins should never have the same SchemefulSite.
+ EXPECT_NE(SchemefulSite(opaque_origin_a), SchemefulSite(opaque_origin_b));
+}
+
+TEST(SchemefulSiteTest, FileOriginWithoutHostname) {
+ SchemefulSite site1(url::Origin::Create(GURL("file:///")));
+ SchemefulSite site2(url::Origin::Create(GURL("file:///path/")));
+
+ EXPECT_EQ(site1, site2);
+ EXPECT_TRUE(site1.GetInternalOriginForTesting().host().empty());
+}
+
+TEST(SchemefulSiteTest, SerializationConsistent) {
+ url::ScopedSchemeRegistryForTests scoped_registry;
+ url::AddStandardScheme("chrome", url::SCHEME_WITH_HOST);
+
+ // List of origins which should all share a schemeful site.
+ SchemefulSite kTestSites[] = {
+ SchemefulSite(url::Origin::Create(GURL("http://a.foo.test"))),
+ SchemefulSite(url::Origin::Create(GURL("https://b.foo.test"))),
+ SchemefulSite(url::Origin::Create(GURL("http://b.foo.test"))),
+ SchemefulSite(url::Origin::Create(GURL("http://a.b.foo.test"))),
+ SchemefulSite(url::Origin::Create(GURL("chrome://a.b.test")))};
+
+ for (const auto& site : kTestSites) {
+ SCOPED_TRACE(site.GetDebugString());
+ EXPECT_FALSE(site.GetInternalOriginForTesting().opaque());
+
+ base::Optional<SchemefulSite> deserialized_site =
+ SchemefulSite::Deserialize(site.Serialize());
+ EXPECT_TRUE(deserialized_site);
+ EXPECT_EQ(site, deserialized_site);
+ }
+}
+
+TEST(SchemefulSiteTest, OpaqueSerialization) {
+ // List of origins which should all share a schemeful site.
+ SchemefulSite kTestSites[] = {
+ SchemefulSite(), SchemefulSite(url::Origin()),
+ SchemefulSite(GURL("data:text/html,<body>Hello World</body>"))};
+
+ for (auto& site : kTestSites) {
+ base::Optional<SchemefulSite> deserialized_site =
+ SchemefulSite::DeserializeWithNonce(*site.SerializeWithNonce());
+ EXPECT_TRUE(deserialized_site);
+ EXPECT_EQ(site, *deserialized_site);
+ }
+}
+
+TEST(SchemefulSiteTest, CreateIfHasRegisterableDomain) {
+ for (const auto& site : std::initializer_list<std::string>{
+ "http://a.bar.test",
+ "http://c.test",
+ "http://a.foo.test",
+ "https://a.bar.test",
+ "https://c.test",
+ "https://a.foo.test",
+ }) {
+ url::Origin origin = url::Origin::Create(GURL(site));
+ EXPECT_THAT(SchemefulSite::CreateIfHasRegisterableDomain(origin),
+ testing::Optional(SchemefulSite(origin)))
+ << "site = \"" << site << "\"";
+ }
+
+ for (const auto& site : std::initializer_list<std::string>{
+ "data:text/html,<body>Hello World</body>",
+ "file:///",
+ "file://foo",
+ "http://127.0.0.1:1234",
+ "https://127.0.0.1:1234",
+ }) {
+ url::Origin origin = url::Origin::Create(GURL(site));
+ EXPECT_EQ(SchemefulSite::CreateIfHasRegisterableDomain(origin),
+ base::nullopt)
+ << "site = \"" << site << "\"";
+ }
+}
+
+} // namespace net
diff --git a/chromium/net/base/test_completion_callback.cc b/chromium/net/base/test_completion_callback.cc
index 009266100a1..2727128373e 100644
--- a/chromium/net/base/test_completion_callback.cc
+++ b/chromium/net/base/test_completion_callback.cc
@@ -5,7 +5,7 @@
#include "net/base/test_completion_callback.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/run_loop.h"
#include "net/base/io_buffer.h"
@@ -32,9 +32,8 @@ void TestCompletionCallbackBaseInternal::WaitForResult() {
have_result_ = false; // Auto-reset for next callback.
}
-TestCompletionCallbackBaseInternal::TestCompletionCallbackBaseInternal()
- : have_result_(false) {
-}
+TestCompletionCallbackBaseInternal::TestCompletionCallbackBaseInternal() =
+ default;
TestCompletionCallbackBaseInternal::~TestCompletionCallbackBaseInternal() =
default;
diff --git a/chromium/net/base/test_completion_callback.h b/chromium/net/base/test_completion_callback.h
index 500ee9745de..99d79564508 100644
--- a/chromium/net/base/test_completion_callback.h
+++ b/chromium/net/base/test_completion_callback.h
@@ -12,7 +12,6 @@
#include "base/callback.h"
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "net/base/completion_once_callback.h"
#include "net/base/net_errors.h"
@@ -41,6 +40,10 @@ namespace internal {
class TestCompletionCallbackBaseInternal {
public:
+ TestCompletionCallbackBaseInternal(
+ const TestCompletionCallbackBaseInternal&) = delete;
+ TestCompletionCallbackBaseInternal& operator=(
+ const TestCompletionCallbackBaseInternal&) = delete;
bool have_result() const { return have_result_; }
protected:
@@ -54,9 +57,7 @@ class TestCompletionCallbackBaseInternal {
// RunLoop. Only non-NULL during the call to WaitForResult, so the class is
// reusable.
std::unique_ptr<base::RunLoop> run_loop_;
- bool have_result_;
-
- DISALLOW_COPY_AND_ASSIGN(TestCompletionCallbackBaseInternal);
+ bool have_result_ = false;
};
template <typename R>
@@ -68,7 +69,11 @@ template <typename R, typename IsPendingHelper = NetErrorIsPendingHelper<R>>
class TestCompletionCallbackTemplate
: public TestCompletionCallbackBaseInternal {
public:
- virtual ~TestCompletionCallbackTemplate() override {}
+ TestCompletionCallbackTemplate(const TestCompletionCallbackTemplate&) =
+ delete;
+ TestCompletionCallbackTemplate& operator=(
+ const TestCompletionCallbackTemplate&) = delete;
+ ~TestCompletionCallbackTemplate() override = default;
R WaitForResult() {
TestCompletionCallbackBaseInternal::WaitForResult();
@@ -93,8 +98,6 @@ class TestCompletionCallbackTemplate
private:
R result_;
-
- DISALLOW_COPY_AND_ASSIGN(TestCompletionCallbackTemplate);
};
} // namespace internal
@@ -103,15 +106,14 @@ class TestClosure : public internal::TestCompletionCallbackBaseInternal {
public:
using internal::TestCompletionCallbackBaseInternal::WaitForResult;
- TestClosure() {}
+ TestClosure() = default;
+ TestClosure(const TestClosure&) = delete;
+ TestClosure& operator=(const TestClosure&) = delete;
~TestClosure() override;
base::OnceClosure closure() {
return base::BindOnce(&TestClosure::DidSetResult, base::Unretained(this));
}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestClosure);
};
// Base class overridden by custom implementations of TestCompletionCallback.
@@ -123,43 +125,45 @@ typedef internal::TestCompletionCallbackTemplate<int64_t>
class TestCompletionCallback : public TestCompletionCallbackBase {
public:
- TestCompletionCallback() {}
+ TestCompletionCallback() = default;
+ TestCompletionCallback(const TestCompletionCallback&) = delete;
+ TestCompletionCallback& operator=(const TestCompletionCallback&) = delete;
~TestCompletionCallback() override;
CompletionOnceCallback callback() {
return base::BindOnce(&TestCompletionCallback::SetResult,
base::Unretained(this));
}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestCompletionCallback);
};
class TestInt64CompletionCallback : public TestInt64CompletionCallbackBase {
public:
- TestInt64CompletionCallback() {}
+ TestInt64CompletionCallback() = default;
+ TestInt64CompletionCallback(const TestInt64CompletionCallback&) = delete;
+ TestInt64CompletionCallback& operator=(const TestInt64CompletionCallback&) =
+ delete;
~TestInt64CompletionCallback() override;
Int64CompletionOnceCallback callback() {
return base::BindOnce(&TestInt64CompletionCallback::SetResult,
base::Unretained(this));
}
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestInt64CompletionCallback);
};
// Makes sure that the buffer is not referenced when the callback runs.
class ReleaseBufferCompletionCallback: public TestCompletionCallback {
public:
explicit ReleaseBufferCompletionCallback(IOBuffer* buffer);
+ ReleaseBufferCompletionCallback(const ReleaseBufferCompletionCallback&) =
+ delete;
+ ReleaseBufferCompletionCallback& operator=(
+ const ReleaseBufferCompletionCallback&) = delete;
~ReleaseBufferCompletionCallback() override;
private:
void SetResult(int result) override;
IOBuffer* buffer_;
- DISALLOW_COPY_AND_ASSIGN(ReleaseBufferCompletionCallback);
};
} // namespace net
diff --git a/chromium/net/base/test_completion_callback_unittest.cc b/chromium/net/base/test_completion_callback_unittest.cc
index fe583b8d5aa..2c630cad965 100644
--- a/chromium/net/base/test_completion_callback_unittest.cc
+++ b/chromium/net/base/test_completion_callback_unittest.cc
@@ -9,7 +9,6 @@
#include "base/bind.h"
#include "base/check_op.h"
#include "base/location.h"
-#include "base/macros.h"
#include "base/notreached.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -38,6 +37,8 @@ void CallClosureAfterCheckingResult(base::OnceClosure closure,
class ExampleEmployer {
public:
ExampleEmployer();
+ ExampleEmployer(const ExampleEmployer&) = delete;
+ ExampleEmployer& operator=(const ExampleEmployer&) = delete;
~ExampleEmployer();
// Posts to the current thread a task which itself posts |callback| to the
@@ -48,7 +49,6 @@ class ExampleEmployer {
class ExampleWorker;
friend class ExampleWorker;
scoped_refptr<ExampleWorker> request_;
- DISALLOW_COPY_AND_ASSIGN(ExampleEmployer);
};
// Helper class; this is how ExampleEmployer schedules work.
diff --git a/chromium/net/base/upload_bytes_element_reader.cc b/chromium/net/base/upload_bytes_element_reader.cc
index b2fee1a4f7f..9dd22c84e54 100644
--- a/chromium/net/base/upload_bytes_element_reader.cc
+++ b/chromium/net/base/upload_bytes_element_reader.cc
@@ -12,8 +12,7 @@ namespace net {
UploadBytesElementReader::UploadBytesElementReader(const char* bytes,
uint64_t length)
- : bytes_(bytes), length_(length), offset_(0) {
-}
+ : bytes_(bytes), length_(length) {}
UploadBytesElementReader::~UploadBytesElementReader() = default;
diff --git a/chromium/net/base/upload_bytes_element_reader.h b/chromium/net/base/upload_bytes_element_reader.h
index 8e5ee0ac2c9..dd39f580342 100644
--- a/chromium/net/base/upload_bytes_element_reader.h
+++ b/chromium/net/base/upload_bytes_element_reader.h
@@ -11,7 +11,6 @@
#include <vector>
#include "base/compiler_specific.h"
-#include "base/macros.h"
#include "net/base/net_export.h"
#include "net/base/upload_element_reader.h"
@@ -22,6 +21,8 @@ namespace net {
class NET_EXPORT UploadBytesElementReader : public UploadElementReader {
public:
UploadBytesElementReader(const char* bytes, uint64_t length);
+ UploadBytesElementReader(const UploadBytesElementReader&) = delete;
+ UploadBytesElementReader& operator=(const UploadBytesElementReader&) = delete;
~UploadBytesElementReader() override;
const char* bytes() const { return bytes_; }
@@ -40,9 +41,7 @@ class NET_EXPORT UploadBytesElementReader : public UploadElementReader {
private:
const char* const bytes_;
const uint64_t length_;
- uint64_t offset_;
-
- DISALLOW_COPY_AND_ASSIGN(UploadBytesElementReader);
+ uint64_t offset_ = 0;
};
// A subclass of UplodBytesElementReader which owns the data given as a vector.
@@ -51,6 +50,9 @@ class NET_EXPORT UploadOwnedBytesElementReader
public:
// |data| is cleared by this ctor.
explicit UploadOwnedBytesElementReader(std::vector<char>* data);
+ UploadOwnedBytesElementReader(const UploadOwnedBytesElementReader&) = delete;
+ UploadOwnedBytesElementReader& operator=(
+ const UploadOwnedBytesElementReader&) = delete;
~UploadOwnedBytesElementReader() override;
// Creates UploadOwnedBytesElementReader with a string.
@@ -59,8 +61,6 @@ class NET_EXPORT UploadOwnedBytesElementReader
private:
std::vector<char> data_;
-
- DISALLOW_COPY_AND_ASSIGN(UploadOwnedBytesElementReader);
};
} // namespace net
diff --git a/chromium/net/base/upload_data_stream.h b/chromium/net/base/upload_data_stream.h
index 807efa13978..a1b6bd254bb 100644
--- a/chromium/net/base/upload_data_stream.h
+++ b/chromium/net/base/upload_data_stream.h
@@ -10,7 +10,6 @@
#include <memory>
#include <vector>
-#include "base/macros.h"
#include "net/base/completion_once_callback.h"
#include "net/base/net_export.h"
#include "net/base/upload_progress.h"
@@ -30,6 +29,9 @@ class NET_EXPORT UploadDataStream {
// sessions. A value of 0 is used to indicate an unspecified identifier.
UploadDataStream(bool is_chunked, int64_t identifier);
+ UploadDataStream(const UploadDataStream&) = delete;
+ UploadDataStream& operator=(const UploadDataStream&) = delete;
+
virtual ~UploadDataStream();
// Initializes the stream. This function must be called before calling any
@@ -146,8 +148,6 @@ class NET_EXPORT UploadDataStream {
CompletionOnceCallback callback_;
NetLogWithSource net_log_;
-
- DISALLOW_COPY_AND_ASSIGN(UploadDataStream);
};
} // namespace net
diff --git a/chromium/net/base/upload_element_reader.h b/chromium/net/base/upload_element_reader.h
index c00fbd166fd..b774c08cf00 100644
--- a/chromium/net/base/upload_element_reader.h
+++ b/chromium/net/base/upload_element_reader.h
@@ -7,7 +7,6 @@
#include <stdint.h>
-#include "base/macros.h"
#include "net/base/completion_once_callback.h"
#include "net/base/net_export.h"
@@ -20,8 +19,10 @@ class UploadFileElementReader;
// An interface to read an upload data element.
class NET_EXPORT UploadElementReader {
public:
- UploadElementReader() {}
- virtual ~UploadElementReader() {}
+ UploadElementReader() = default;
+ UploadElementReader(const UploadElementReader&) = delete;
+ UploadElementReader& operator=(const UploadElementReader&) = delete;
+ virtual ~UploadElementReader() = default;
// Returns this instance's pointer as UploadBytesElementReader when possible,
// otherwise returns NULL.
@@ -60,9 +61,6 @@ class NET_EXPORT UploadElementReader {
virtual int Read(IOBuffer* buf,
int buf_length,
CompletionOnceCallback callback) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(UploadElementReader);
};
} // namespace net
diff --git a/chromium/net/base/upload_file_element_reader.h b/chromium/net/base/upload_file_element_reader.h
index 706137af85e..cfb2b9437de 100644
--- a/chromium/net/base/upload_file_element_reader.h
+++ b/chromium/net/base/upload_file_element_reader.h
@@ -13,7 +13,6 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
-#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
@@ -55,6 +54,8 @@ class NET_EXPORT UploadFileElementReader : public UploadElementReader {
uint64_t range_length,
const base::Time& expected_modification_time);
+ UploadFileElementReader(const UploadFileElementReader&) = delete;
+ UploadFileElementReader& operator=(const UploadFileElementReader&) = delete;
~UploadFileElementReader() override;
const base::FilePath& path() const { return path_; }
@@ -130,8 +131,6 @@ class NET_EXPORT UploadFileElementReader : public UploadElementReader {
bool init_called_while_operation_pending_;
base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_{this};
-
- DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader);
};
} // namespace net
diff --git a/chromium/net/base/url_util.h b/chromium/net/base/url_util.h
index 41793202b2b..bc499fe6cd0 100644
--- a/chromium/net/base/url_util.h
+++ b/chromium/net/base/url_util.h
@@ -12,7 +12,6 @@
#include <string>
-#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "net/base/net_export.h"
@@ -61,6 +60,8 @@ NET_EXPORT GURL AppendOrReplaceQueryParameter(const GURL& url,
class NET_EXPORT QueryIterator {
public:
explicit QueryIterator(const GURL& url);
+ QueryIterator(const QueryIterator&) = delete;
+ QueryIterator& operator=(const QueryIterator&) = delete;
~QueryIterator();
std::string GetKey() const;
@@ -77,8 +78,6 @@ class NET_EXPORT QueryIterator {
url::Component key_;
url::Component value_;
std::string unescaped_value_;
-
- DISALLOW_COPY_AND_ASSIGN(QueryIterator);
};
// Looks for |search_key| in the query portion of |url|. Returns true if the
diff --git a/chromium/net/cert/DIR_METADATA b/chromium/net/cert/DIR_METADATA
new file mode 100644
index 00000000000..c97d1840b0a
--- /dev/null
+++ b/chromium/net/cert/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Certificate"
+} \ No newline at end of file
diff --git a/chromium/net/cert/OWNERS b/chromium/net/cert/OWNERS
index c5d05bc8cd1..72ba933e303 100644
--- a/chromium/net/cert/OWNERS
+++ b/chromium/net/cert/OWNERS
@@ -1,7 +1,4 @@
davidben@chromium.org
-eroman@chromium.org
mattm@chromium.org
rsleevi@chromium.org
svaldez@chromium.org
-
-# COMPONENT: Internals>Network>Certificate
diff --git a/chromium/net/cert/cert_verify_proc_mac.cc b/chromium/net/cert/cert_verify_proc_mac.cc
index 62eb02ad787..7d38a4763da 100644
--- a/chromium/net/cert/cert_verify_proc_mac.cc
+++ b/chromium/net/cert/cert_verify_proc_mac.cc
@@ -47,14 +47,6 @@
using base::ScopedCFTypeRef;
-extern "C" {
-// Declared in <Security/SecTrust.h>, available in 10.14.2+
-// TODO(mattm): Remove this weak_import once chromium compiles against the
-// macOS 10.14 SDK.
-OSStatus SecTrustSetSignedCertificateTimestamps(SecTrustRef, CFArrayRef)
- __attribute__((weak_import));
-} // extern "C"
-
namespace net {
namespace {
diff --git a/chromium/net/cert/cert_verify_proc_unittest.cc b/chromium/net/cert/cert_verify_proc_unittest.cc
index 82182acc616..708e25e2e70 100644
--- a/chromium/net/cert/cert_verify_proc_unittest.cc
+++ b/chromium/net/cert/cert_verify_proc_unittest.cc
@@ -1604,7 +1604,14 @@ TEST_P(CertVerifyProcInternalTest, PublicKeyHashes) {
// the required key usage for serverAuth.
// TODO(mattm): This cert fails for many reasons, replace with a generated one
// that tests only the desired case.
-TEST_P(CertVerifyProcInternalTest, WrongKeyPurpose) {
+//
+// Disabled on Android, crbug.com/1167663.
+#if defined(OS_ANDROID)
+#define MAYBE_WrongKeyPurpose DISABLED_WrongKeyPurpose
+#else
+#define MAYBE_WrongKeyPurpose WrongKeyPurpose
+#endif
+TEST_P(CertVerifyProcInternalTest, MAYBE_WrongKeyPurpose) {
base::FilePath certs_dir = GetTestCertsDirectory();
scoped_refptr<X509Certificate> server_cert =
diff --git a/chromium/net/cert/cert_verify_result.cc b/chromium/net/cert/cert_verify_result.cc
index 5d88b7fbd76..f3c87403b09 100644
--- a/chromium/net/cert/cert_verify_result.cc
+++ b/chromium/net/cert/cert_verify_result.cc
@@ -8,6 +8,8 @@
#include "base/values.h"
#include "net/base/net_errors.h"
+#include "net/cert/ct_policy_status.h"
+#include "net/cert/ct_signed_certificate_timestamp_log_param.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_certificate_net_log_param.h"
@@ -38,6 +40,9 @@ CertVerifyResult& CertVerifyResult::operator=(const CertVerifyResult& other) {
public_key_hashes = other.public_key_hashes;
ocsp_result = other.ocsp_result;
+ scts = other.scts;
+ policy_compliance = other.policy_compliance;
+
ClearAllUserData();
CloneDataFrom(other);
@@ -58,6 +63,10 @@ void CertVerifyResult::Reset() {
public_key_hashes.clear();
ocsp_result = OCSPVerifyResult();
+ scts.clear();
+ policy_compliance =
+ ct::CTPolicyCompliance::CT_POLICY_COMPLIANCE_DETAILS_NOT_AVAILABLE;
+
ClearAllUserData();
}
@@ -89,6 +98,8 @@ base::Value CertVerifyResult::NetLogParams(int net_error) const {
hashes.Append(public_key_hash.ToString());
results.SetKey("public_key_hashes", std::move(hashes));
+ results.SetKey("scts", net::NetLogSignedCertificateTimestampParams(&scts));
+
return std::move(results);
}
diff --git a/chromium/net/cert/cert_verify_result.h b/chromium/net/cert/cert_verify_result.h
index 5663b284978..35dee11958f 100644
--- a/chromium/net/cert/cert_verify_result.h
+++ b/chromium/net/cert/cert_verify_result.h
@@ -11,13 +11,19 @@
#include "base/supports_user_data.h"
#include "net/base/net_export.h"
#include "net/cert/cert_status_flags.h"
+#include "net/cert/ct_policy_status.h"
#include "net/cert/ocsp_verify_result.h"
+#include "net/cert/signed_certificate_timestamp_and_status.h"
#include "net/cert/x509_cert_types.h"
namespace base {
class Value;
}
+namespace ct {
+enum class CTPolicyCompliance;
+} // namespace ct
+
namespace net {
class X509Certificate;
@@ -97,6 +103,16 @@ class NET_EXPORT CertVerifyResult : public base::SupportsUserData {
// Verification of stapled OCSP response, if present.
OCSPVerifyResult ocsp_result;
+
+ // `scts` contains the result of verifying any provided or embedded SCTs for
+ // this certificate against the set of known logs. Consumers should not simply
+ // check this for the presence of a successfully verified SCT to determine CT
+ // compliance. Instead look at `policy_compliance`.
+ SignedCertificateTimestampAndStatusList scts;
+
+ // The result of evaluating whether the certificate complies with the
+ // Certificate Transparency policy.
+ ct::CTPolicyCompliance policy_compliance;
};
} // namespace net
diff --git a/chromium/net/cert/coalescing_cert_verifier_unittest.cc b/chromium/net/cert/coalescing_cert_verifier_unittest.cc
index c90f9898f7b..124444bcfcc 100644
--- a/chromium/net/cert/coalescing_cert_verifier_unittest.cc
+++ b/chromium/net/cert/coalescing_cert_verifier_unittest.cc
@@ -7,7 +7,7 @@
#include <memory>
#include "base/bind.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
diff --git a/chromium/net/cert/ct_verify_result.cc b/chromium/net/cert/ct_verify_result.cc
deleted file mode 100644
index 9da8828d2f3..00000000000
--- a/chromium/net/cert/ct_verify_result.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/cert/ct_verify_result.h"
-
-#include "net/cert/ct_policy_status.h"
-
-namespace net {
-
-namespace ct {
-
-CTVerifyResult::CTVerifyResult()
- : policy_compliance(
- ct::CTPolicyCompliance::CT_POLICY_COMPLIANCE_DETAILS_NOT_AVAILABLE),
- policy_compliance_required(false) {}
-
-CTVerifyResult::CTVerifyResult(const CTVerifyResult& other) = default;
-
-CTVerifyResult::~CTVerifyResult() = default;
-
-SCTList SCTsMatchingStatus(
- const SignedCertificateTimestampAndStatusList& sct_and_status_list,
- SCTVerifyStatus match_status) {
- SCTList result;
- for (const auto& sct_and_status : sct_and_status_list)
- if (sct_and_status.status == match_status)
- result.push_back(sct_and_status.sct);
-
- return result;
-}
-
-} // namespace ct
-
-} // namespace net
diff --git a/chromium/net/cert/ct_verify_result.h b/chromium/net/cert/ct_verify_result.h
deleted file mode 100644
index 742ec652435..00000000000
--- a/chromium/net/cert/ct_verify_result.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_CERT_CT_VERIFY_RESULT_H_
-#define NET_CERT_CT_VERIFY_RESULT_H_
-
-#include <vector>
-
-#include "net/base/net_export.h"
-#include "net/cert/signed_certificate_timestamp_and_status.h"
-
-namespace net {
-
-namespace ct {
-
-enum class CTPolicyCompliance;
-
-// Holds Signed Certificate Timestamps, depending on their verification
-// results, and information about CT policies that were applied on the
-// connection.
-struct NET_EXPORT CTVerifyResult {
- CTVerifyResult();
- CTVerifyResult(const CTVerifyResult& other);
- ~CTVerifyResult();
-
- // All SCTs and their statuses
- SignedCertificateTimestampAndStatusList scts;
-
- // The result of evaluating whether the connection complies with the
- // CT certificate policy.
- CTPolicyCompliance policy_compliance;
- // True if the connection was required to comply with the CT certificate
- // policy. This value is not meaningful if |policy_compliance| is
- // COMPLIANCE_DETAILS_NOT_AVAILABLE.
- bool policy_compliance_required;
-};
-
-// Returns a list of SCTs from |sct_and_status_list| whose status matches
-// |match_status|.
-SCTList NET_EXPORT SCTsMatchingStatus(
- const SignedCertificateTimestampAndStatusList& sct_and_status_list,
- SCTVerifyStatus match_status);
-
-} // namespace ct
-
-} // namespace net
-
-#endif // NET_CERT_CT_VERIFY_RESULT_H_
diff --git a/chromium/net/cert/internal/system_trust_store.cc b/chromium/net/cert/internal/system_trust_store.cc
index d2345316ab3..646ea2f321e 100644
--- a/chromium/net/cert/internal/system_trust_store.cc
+++ b/chromium/net/cert/internal/system_trust_store.cc
@@ -21,6 +21,8 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/no_destructor.h"
+#include "base/task/task_traits.h"
+#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "net/cert/internal/cert_errors.h"
#include "net/cert/internal/parsed_certificate.h"
@@ -176,8 +178,12 @@ class SystemTrustStoreMac : public BaseSystemTrustStore {
return GetGlobalTrustStoreMac()->IsKnownRoot(trust_anchor);
}
+ static void InitializeTrustCacheOnWorkerThread() {
+ GetGlobalTrustStoreMac()->InitializeTrustCache();
+ }
+
private:
- TrustStoreMac* GetGlobalTrustStoreMac() const {
+ static TrustStoreMac* GetGlobalTrustStoreMac() {
static base::NoDestructor<TrustStoreMac> static_trust_store_mac(
kSecPolicyAppleSSL);
return static_trust_store_mac.get();
@@ -188,6 +194,13 @@ std::unique_ptr<SystemTrustStore> CreateSslSystemTrustStore() {
return std::make_unique<SystemTrustStoreMac>();
}
+void InitializeTrustStoreMacCache() {
+ base::ThreadPool::PostTask(
+ FROM_HERE,
+ {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
+ base::BindOnce(&SystemTrustStoreMac::InitializeTrustCacheOnWorkerThread));
+}
+
#elif defined(OS_FUCHSIA)
namespace {
diff --git a/chromium/net/cert/internal/system_trust_store.h b/chromium/net/cert/internal/system_trust_store.h
index 498b23d4344..7bb1d4be508 100644
--- a/chromium/net/cert/internal/system_trust_store.h
+++ b/chromium/net/cert/internal/system_trust_store.h
@@ -8,6 +8,7 @@
#include <vector>
#include "base/memory/ref_counted.h"
+#include "build/build_config.h"
#include "net/base/net_export.h"
#include "net/cert/internal/parsed_certificate.h"
@@ -71,6 +72,11 @@ NET_EXPORT std::unique_ptr<SystemTrustStore> CreateSslSystemTrustStore();
// store integration is not supported.)
NET_EXPORT std::unique_ptr<SystemTrustStore> CreateEmptySystemTrustStore();
+#if defined(OS_MAC)
+// Initializes trust cache on a worker thread.
+NET_EXPORT void InitializeTrustStoreMacCache();
+#endif
+
} // namespace net
#endif // NET_CERT_INTERNAL_SYSTEM_TRUST_STORE_H_
diff --git a/chromium/net/cert/internal/trust_store_mac.cc b/chromium/net/cert/internal/trust_store_mac.cc
index 808d36d0765..f2fc268e62d 100644
--- a/chromium/net/cert/internal/trust_store_mac.cc
+++ b/chromium/net/cert/internal/trust_store_mac.cc
@@ -127,11 +127,8 @@ TrustStatus IsTrustDictionaryTrustedForPolicy(
}
// kSecPolicyOid is guaranteed to be present in the policy dictionary.
- //
- // TODO(mattm): remove the CFCastStrict below once Chromium builds against
- // the 10.11 SDK.
CFStringRef policy_oid = base::mac::GetValueFromDictionary<CFStringRef>(
- policy_dict, base::mac::CFCastStrict<CFStringRef>(kSecPolicyOid));
+ policy_dict, kSecPolicyOid);
if (!CFEqual(policy_oid, target_policy_oid))
return TrustStatus::UNSPECIFIED;
@@ -519,6 +516,12 @@ class TrustStoreMac::TrustCache {
return TrustStatus::UNSPECIFIED;
}
+ // Initializes the cache, if it isn't already initialized.
+ void InitializeTrustCache() {
+ base::AutoLock lock(cache_lock_);
+ MaybeInitializeCache();
+ }
+
private:
// (Re-)Initialize the cache if necessary. Must be called after acquiring
// |cache_lock_| and before accessing any of the |*_domain_cache_| members.
@@ -553,12 +556,15 @@ class TrustStoreMac::TrustCache {
DISALLOW_COPY_AND_ASSIGN(TrustCache);
};
-TrustStoreMac::TrustStoreMac(CFTypeRef policy_oid)
- : trust_cache_(std::make_unique<TrustCache>(
- base::mac::CFCastStrict<CFStringRef>(policy_oid))) {}
+TrustStoreMac::TrustStoreMac(CFStringRef policy_oid)
+ : trust_cache_(std::make_unique<TrustCache>(policy_oid)) {}
TrustStoreMac::~TrustStoreMac() = default;
+void TrustStoreMac::InitializeTrustCache() const {
+ trust_cache_->InitializeTrustCache();
+}
+
bool TrustStoreMac::IsKnownRoot(const ParsedCertificate* cert) const {
return trust_cache_->IsKnownRoot(cert);
}
diff --git a/chromium/net/cert/internal/trust_store_mac.h b/chromium/net/cert/internal/trust_store_mac.h
index 5455a3fb14f..c3f227d40a3 100644
--- a/chromium/net/cert/internal/trust_store_mac.h
+++ b/chromium/net/cert/internal/trust_store_mac.h
@@ -92,13 +92,12 @@ class NET_EXPORT TrustStoreMac : public TrustStore {
// Creates a TrustStoreMac which will find anchors that are trusted for
// |policy_oid|. For list of possible policy values, see:
// https://developer.apple.com/reference/security/1667150-certificate_key_and_trust_servic/1670151-standard_policies_for_specific_c?language=objc
- // TODO(mattm): policy oids are actually CFStrings, but the constants are
- // defined as CFTypeRef in older SDK versions. Change |policy_oid| type to
- // const CFStringRef when Chromium switches to building against the 10.11 SDK
- // (or newer).
- explicit TrustStoreMac(CFTypeRef policy_oid);
+ explicit TrustStoreMac(CFStringRef policy_oid);
~TrustStoreMac() override;
+ // Initializes the trust cache, if it isn't already initialized.
+ void InitializeTrustCache() const;
+
// Returns true if the given certificate is present in the system trust
// domain.
bool IsKnownRoot(const ParsedCertificate* cert) const;
diff --git a/chromium/net/cert/multi_threaded_cert_verifier.cc b/chromium/net/cert/multi_threaded_cert_verifier.cc
index b46dbf68d0f..842e16645c7 100644
--- a/chromium/net/cert/multi_threaded_cert_verifier.cc
+++ b/chromium/net/cert/multi_threaded_cert_verifier.cc
@@ -5,7 +5,7 @@
#include "net/cert/multi_threaded_cert_verifier.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/memory/weak_ptr.h"
#include "base/task/post_task.h"
diff --git a/chromium/net/cert/trial_comparison_cert_verifier_unittest.cc b/chromium/net/cert/trial_comparison_cert_verifier_unittest.cc
index ac646274a08..540b6390c2f 100644
--- a/chromium/net/cert/trial_comparison_cert_verifier_unittest.cc
+++ b/chromium/net/cert/trial_comparison_cert_verifier_unittest.cc
@@ -8,7 +8,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "build/build_config.h"
diff --git a/chromium/net/cert/x509_certificate.h b/chromium/net/cert/x509_certificate.h
index f8214cc4cf1..8d7ec012d7a 100644
--- a/chromium/net/cert/x509_certificate.h
+++ b/chromium/net/cert/x509_certificate.h
@@ -31,10 +31,12 @@ class X509Certificate;
typedef std::vector<scoped_refptr<X509Certificate> > CertificateList;
-// X509Certificate represents a X.509 certificate, which is comprised a
-// particular identity or end-entity certificate, such as an SSL server
-// identity or an SSL client certificate, and zero or more intermediate
-// certificates that may be used to build a path to a root certificate.
+// A X.509 certificate represents a particular identity or end-entity
+// certificate, such as an SSL server identity or an SSL client certificate. An
+// X509Certificate contains this leaf certificate accessible via cert_buffer().
+// An X509Certificate may also contain 0 or more intermediary X.509 certificates
+// that are used to build a path to a root certificate. These are accessed via
+// intermediate_buffers().
class NET_EXPORT X509Certificate
: public base::RefCountedThreadSafe<X509Certificate> {
public:
diff --git a/chromium/net/cert_net/DIR_METADATA b/chromium/net/cert_net/DIR_METADATA
new file mode 100644
index 00000000000..c97d1840b0a
--- /dev/null
+++ b/chromium/net/cert_net/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Certificate"
+} \ No newline at end of file
diff --git a/chromium/net/cert_net/OWNERS b/chromium/net/cert_net/OWNERS
index b7d227e6d1a..b05c25bf859 100644
--- a/chromium/net/cert_net/OWNERS
+++ b/chromium/net/cert_net/OWNERS
@@ -1,5 +1,2 @@
-eroman@chromium.org
mattm@chromium.org
rsleevi@chromium.org
-
-# COMPONENT: Internals>Network>Certificate
diff --git a/chromium/net/cert_net/cert_net_fetcher_url_request.cc b/chromium/net/cert_net/cert_net_fetcher_url_request.cc
index 426fd7733f9..331e0ab0ee3 100644
--- a/chromium/net/cert_net/cert_net_fetcher_url_request.cc
+++ b/chromium/net/cert_net/cert_net_fetcher_url_request.cc
@@ -522,10 +522,9 @@ void Job::StartURLRequest(URLRequestContext* context) {
// result to still be cached in the HTTP cache, and lets URLRequest DCHECK
// that all requests have non-empty IsolationInfos.
url::Origin origin = url::Origin::Create(request_params_->url);
- url_request_->set_isolation_info(
- IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing,
- origin /* top_frame_origin */,
- origin /* frame_origin */, SiteForCookies()));
+ url_request_->set_isolation_info(IsolationInfo::Create(
+ IsolationInfo::RequestType::kOther, origin /* top_frame_origin */,
+ origin /* frame_origin */, SiteForCookies()));
url_request_->Start();
diff --git a/chromium/net/cookies/DIR_METADATA b/chromium/net/cookies/DIR_METADATA
new file mode 100644
index 00000000000..1b6e5edfbf2
--- /dev/null
+++ b/chromium/net/cookies/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Cookies"
+} \ No newline at end of file
diff --git a/chromium/net/cookies/OWNERS b/chromium/net/cookies/OWNERS
index 9b5ffc36540..2ddd82195da 100644
--- a/chromium/net/cookies/OWNERS
+++ b/chromium/net/cookies/OWNERS
@@ -3,5 +3,3 @@ estark@chromium.org
mkwst@chromium.org
mmenke@chromium.org
morlovich@chromium.org
-
-# COMPONENT: Internals>Network>Cookies
diff --git a/chromium/net/cookies/canonical_cookie.cc b/chromium/net/cookies/canonical_cookie.cc
index 1c85b9d7daf..1db40c01ebb 100644
--- a/chromium/net/cookies/canonical_cookie.cc
+++ b/chromium/net/cookies/canonical_cookie.cc
@@ -50,6 +50,7 @@
#include "base/feature_list.h"
#include "base/format_macros.h"
#include "base/logging.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
@@ -256,13 +257,7 @@ void ApplySameSiteCookieWarningToStatus(
} // namespace
-// Keep defaults here in sync with content/public/common/cookie_manager.mojom.
-CanonicalCookie::CanonicalCookie()
- : secure_(false),
- httponly_(false),
- same_site_(CookieSameSite::NO_RESTRICTION),
- priority_(COOKIE_PRIORITY_MEDIUM),
- source_scheme_(CookieSourceScheme::kUnset) {}
+CanonicalCookie::CanonicalCookie() = default;
CanonicalCookie::CanonicalCookie(const CanonicalCookie& other) = default;
@@ -277,7 +272,9 @@ CanonicalCookie::CanonicalCookie(const std::string& name,
bool httponly,
CookieSameSite same_site,
CookiePriority priority,
- CookieSourceScheme scheme_secure)
+ bool same_party,
+ CookieSourceScheme scheme_secure,
+ int source_port)
: name_(name),
value_(value),
domain_(domain),
@@ -289,7 +286,10 @@ CanonicalCookie::CanonicalCookie(const std::string& name,
httponly_(httponly),
same_site_(same_site),
priority_(priority),
- source_scheme_(scheme_secure) {}
+ same_party_(same_party),
+ source_scheme_(scheme_secure) {
+ SetSourcePort(source_port);
+}
CanonicalCookie::~CanonicalCookie() = default;
@@ -408,22 +408,35 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::Create(
status->AddExclusionReason(CookieInclusionStatus::EXCLUDE_INVALID_PREFIX);
}
+ bool is_same_party_valid = IsCookieSamePartyValid(parsed_cookie);
+ if (!is_same_party_valid) {
+ status->AddExclusionReason(
+ CookieInclusionStatus::EXCLUDE_INVALID_SAMEPARTY);
+ }
+
+ // Collect metrics on whether usage of SameParty attribute is correct.
+ if (parsed_cookie.IsSameParty())
+ base::UmaHistogramBoolean("Cookie.IsSamePartyValid", is_same_party_valid);
+
// TODO(chlily): Log metrics.
if (!status->IsInclude())
return nullptr;
CookieSameSiteString samesite_string = CookieSameSiteString::kUnspecified;
CookieSameSite samesite = parsed_cookie.SameSite(&samesite_string);
- RecordCookieSameSiteAttributeValueHistogram(samesite_string);
+ RecordCookieSameSiteAttributeValueHistogram(samesite_string,
+ parsed_cookie.IsSameParty());
CookieSourceScheme source_scheme = url.SchemeIsCryptographic()
? CookieSourceScheme::kSecure
: CookieSourceScheme::kNonSecure;
+ // Get the port, this will get a default value if a port isn't provided.
+ int source_port = url.EffectiveIntPort();
std::unique_ptr<CanonicalCookie> cc(std::make_unique<CanonicalCookie>(
parsed_cookie.Name(), parsed_cookie.Value(), cookie_domain, cookie_path,
creation_time, cookie_expires, creation_time, parsed_cookie.IsSecure(),
parsed_cookie.IsHttpOnly(), samesite, parsed_cookie.Priority(),
- source_scheme));
+ parsed_cookie.IsSameParty(), source_scheme, source_port));
DCHECK(cc->IsCanonical());
@@ -445,7 +458,8 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::CreateSanitizedCookie(
bool secure,
bool http_only,
CookieSameSite same_site,
- CookiePriority priority) {
+ CookiePriority priority,
+ bool same_party) {
// Validate consistency of passed arguments.
if (ParsedCookie::ParseTokenString(name) != name ||
ParsedCookie::ParseValueString(value) != value ||
@@ -475,6 +489,9 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::CreateSanitizedCookie(
if (secure && source_scheme == CookieSourceScheme::kNonSecure)
return nullptr;
+ // Get the port, this will get a default value if a port isn't provided.
+ int source_port = url.EffectiveIntPort();
+
std::string cookie_path = CanonicalCookie::CanonPathWithString(url, path);
if (!path.empty() && cookie_path != path)
return nullptr;
@@ -484,6 +501,9 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::CreateSanitizedCookie(
return nullptr;
}
+ if (!IsCookieSamePartyValid(same_party, secure, same_site))
+ return nullptr;
+
if (!last_access_time.is_null() && creation_time.is_null())
return nullptr;
@@ -498,16 +518,51 @@ std::unique_ptr<CanonicalCookie> CanonicalCookie::CreateSanitizedCookie(
std::unique_ptr<CanonicalCookie> cc(std::make_unique<CanonicalCookie>(
name, value, cookie_domain, cookie_path, creation_time, expiration_time,
- last_access_time, secure, http_only, same_site, priority, source_scheme));
+ last_access_time, secure, http_only, same_site, priority, same_party,
+ source_scheme, source_port));
DCHECK(cc->IsCanonical());
return cc;
}
+// static
+std::unique_ptr<CanonicalCookie> CanonicalCookie::FromStorage(
+ const std::string& name,
+ const std::string& value,
+ const std::string& domain,
+ const std::string& path,
+ const base::Time& creation,
+ const base::Time& expiration,
+ const base::Time& last_access,
+ bool secure,
+ bool httponly,
+ CookieSameSite same_site,
+ CookiePriority priority,
+ bool same_party,
+ CookieSourceScheme source_scheme,
+ int source_port) {
+ std::unique_ptr<CanonicalCookie> cc(std::make_unique<CanonicalCookie>(
+ name, value, domain, path, creation, expiration, last_access, secure,
+ httponly, same_site, priority, same_party, source_scheme, source_port));
+ if (!cc->IsCanonical())
+ return nullptr;
+ return cc;
+}
+
std::string CanonicalCookie::DomainWithoutDot() const {
return cookie_util::CookieDomainAsHost(domain_);
}
+void CanonicalCookie::SetSourcePort(int port) {
+ if ((port >= 0 && port <= 65535) || port == url::PORT_UNSPECIFIED) {
+ // 0 would be really weird as it has a special meaning, but it's still
+ // technically a valid tcp/ip port so we're going to accept it here.
+ source_port_ = port;
+ } else {
+ source_port_ = url::PORT_INVALID;
+ }
+}
+
bool CanonicalCookie::IsEquivalentForSecureCookieMatching(
const CanonicalCookie& secure_cookie) const {
// Names must be the same
@@ -828,7 +883,7 @@ bool CanonicalCookie::IsCanonical() const {
break;
}
- return true;
+ return IsCookieSamePartyValid(same_party_, secure_, same_site_);
}
bool CanonicalCookie::IsEffectivelySameSiteNone(
@@ -959,6 +1014,23 @@ bool CanonicalCookie::IsRecentlyCreated(base::TimeDelta age_threshold) const {
return (base::Time::Now() - creation_date_) <= age_threshold;
}
+// static
+bool CanonicalCookie::IsCookieSamePartyValid(
+ const ParsedCookie& parsed_cookie) {
+ return IsCookieSamePartyValid(parsed_cookie.IsSameParty(),
+ parsed_cookie.IsSecure(),
+ parsed_cookie.SameSite());
+}
+
+// static
+bool CanonicalCookie::IsCookieSamePartyValid(bool is_same_party,
+ bool is_secure,
+ CookieSameSite same_site) {
+ if (!is_same_party)
+ return true;
+ return is_secure && (same_site != CookieSameSite::STRICT_MODE);
+}
+
CookieAndLineWithAccessResult::CookieAndLineWithAccessResult() = default;
CookieAndLineWithAccessResult::CookieAndLineWithAccessResult(
diff --git a/chromium/net/cookies/canonical_cookie.h b/chromium/net/cookies/canonical_cookie.h
index 4cb63368be1..5ab0c2c9efc 100644
--- a/chromium/net/cookies/canonical_cookie.h
+++ b/chromium/net/cookies/canonical_cookie.h
@@ -18,6 +18,7 @@
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_inclusion_status.h"
#include "net/cookies/cookie_options.h"
+#include "url/third_party/mozilla/url_parse.h"
class GURL;
@@ -47,19 +48,20 @@ class NET_EXPORT CanonicalCookie {
// themselves.
// NOTE: Prefer using CreateSanitizedCookie() over directly using this
// constructor.
- CanonicalCookie(
- const std::string& name,
- const std::string& value,
- const std::string& domain,
- const std::string& path,
- const base::Time& creation,
- const base::Time& expiration,
- const base::Time& last_access,
- bool secure,
- bool httponly,
- CookieSameSite same_site,
- CookiePriority priority,
- CookieSourceScheme scheme_secure = CookieSourceScheme::kUnset);
+ CanonicalCookie(const std::string& name,
+ const std::string& value,
+ const std::string& domain,
+ const std::string& path,
+ const base::Time& creation,
+ const base::Time& expiration,
+ const base::Time& last_access,
+ bool secure,
+ bool httponly,
+ CookieSameSite same_site,
+ CookiePriority priority,
+ bool same_party,
+ CookieSourceScheme scheme_secure = CookieSourceScheme::kUnset,
+ int source_port = url::PORT_UNSPECIFIED);
~CanonicalCookie();
@@ -104,7 +106,31 @@ class NET_EXPORT CanonicalCookie {
bool secure,
bool http_only,
CookieSameSite same_site,
- CookiePriority priority);
+ CookiePriority priority,
+ bool same_party);
+
+ // FromStorage is a factory method which is meant for creating a new
+ // CanonicalCookie using properties of a previously existing cookie
+ // that was already ingested into the cookie store.
+ // This should NOT be used to create a new CanonicalCookie that was not
+ // already in the store.
+ // Returns nullptr if the resulting cookie is not canonical,
+ // i.e. cc->IsCanonical() returns false.
+ static std::unique_ptr<CanonicalCookie> FromStorage(
+ const std::string& name,
+ const std::string& value,
+ const std::string& domain,
+ const std::string& path,
+ const base::Time& creation,
+ const base::Time& expiration,
+ const base::Time& last_access,
+ bool secure,
+ bool httponly,
+ CookieSameSite same_site,
+ CookiePriority priority,
+ bool same_party,
+ CookieSourceScheme source_scheme,
+ int source_port);
const std::string& Name() const { return name_; }
const std::string& Value() const { return value_; }
@@ -122,10 +148,15 @@ class NET_EXPORT CanonicalCookie {
bool IsHttpOnly() const { return httponly_; }
CookieSameSite SameSite() const { return same_site_; }
CookiePriority Priority() const { return priority_; }
+ bool IsSameParty() const { return same_party_; }
// Returns an enum indicating the source scheme that set this cookie. This is
// not part of the cookie spec but is being used to collect metrics for a
// potential change to the cookie spec.
CookieSourceScheme SourceScheme() const { return source_scheme_; }
+ // Returns the port of the origin that originally set this cookie (the
+ // source port). This is not part of the cookie spec but is being used to
+ // collect metrics for a potential change to the cookie spec.
+ int SourcePort() const { return source_port_; }
bool IsDomainCookie() const {
return !domain_.empty() && domain_[0] == '.'; }
bool IsHostCookie() const { return !IsDomainCookie(); }
@@ -197,6 +228,11 @@ class NET_EXPORT CanonicalCookie {
void SetSourceScheme(CookieSourceScheme source_scheme) {
source_scheme_ = source_scheme;
}
+
+ // Set the source port value. Performs a range check and sets the port to
+ // url::PORT_INVALID if value isn't in [0,65535] or url::PORT_UNSPECIFIED.
+ void SetSourcePort(int port);
+
void SetLastAccessDate(const base::Time& date) {
last_access_date_ = date;
}
@@ -347,6 +383,16 @@ class NET_EXPORT CanonicalCookie {
// Returns whether the cookie was created at most |age_threshold| ago.
bool IsRecentlyCreated(base::TimeDelta age_threshold) const;
+ // Returns true iff the cookie does not violate any rules associated with
+ // creating a cookie with the SameParty attribute. In particular, if a cookie
+ // has SameParty, then it must be Secure and must not be SameSite=Strict.
+ static bool IsCookieSamePartyValid(const ParsedCookie& parsed_cookie);
+ static bool IsCookieSamePartyValid(bool is_same_party,
+ bool is_secure,
+ CookieSameSite same_site);
+
+ // Keep defaults here in sync with
+ // services/network/public/interfaces/cookie_manager.mojom.
std::string name_;
std::string value_;
std::string domain_;
@@ -354,11 +400,17 @@ class NET_EXPORT CanonicalCookie {
base::Time creation_date_;
base::Time expiry_date_;
base::Time last_access_date_;
- bool secure_;
- bool httponly_;
- CookieSameSite same_site_;
- CookiePriority priority_;
- CookieSourceScheme source_scheme_;
+ bool secure_{false};
+ bool httponly_{false};
+ CookieSameSite same_site_{CookieSameSite::NO_RESTRICTION};
+ CookiePriority priority_{COOKIE_PRIORITY_MEDIUM};
+ bool same_party_{false};
+ CookieSourceScheme source_scheme_{CookieSourceScheme::kUnset};
+ // This can be [0,65535], PORT_UNSPECIFIED, or PORT_INVALID.
+ // PORT_UNSPECIFIED is used for cookies which already existed in the cookie
+ // store prior to this change and therefore their port is unknown.
+ // PORT_INVALID is an error for when an out of range port is provided.
+ int source_port_{url::PORT_UNSPECIFIED};
};
// Used to pass excluded cookie information when it's possible that the
diff --git a/chromium/net/cookies/canonical_cookie_fuzzer.cc b/chromium/net/cookies/canonical_cookie_fuzzer.cc
index 9aecd883fb4..68a4d08c134 100644
--- a/chromium/net/cookies/canonical_cookie_fuzzer.cc
+++ b/chromium/net/cookies/canonical_cookie_fuzzer.cc
@@ -56,8 +56,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
const std::unique_ptr<const CanonicalCookie> sanitized_cookie =
CanonicalCookie::CreateSanitizedCookie(
url, name, value, domain, path, creation, expiration, last_access,
- data_provider.ConsumeBool(), data_provider.ConsumeBool(), same_site,
- priority);
+ data_provider.ConsumeBool() /* secure */,
+ data_provider.ConsumeBool() /* httponly */, same_site, priority,
+ data_provider.ConsumeBool() /* same_party */);
if (sanitized_cookie) {
CHECK(sanitized_cookie->IsCanonical());
diff --git a/chromium/net/cookies/canonical_cookie_unittest.cc b/chromium/net/cookies/canonical_cookie_unittest.cc
index 04c1b6488f5..6da0dbb0ecd 100644
--- a/chromium/net/cookies/canonical_cookie_unittest.cc
+++ b/chromium/net/cookies/canonical_cookie_unittest.cc
@@ -13,6 +13,7 @@
#include "net/cookies/cookie_options.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+#include "url/third_party/mozilla/url_parse.h"
namespace net {
@@ -31,13 +32,12 @@ void MatchCookieLineToVector(
} // namespace
TEST(CanonicalCookieTest, Constructor) {
- GURL url("http://www.example.com/test");
base::Time current_time = base::Time::Now();
std::unique_ptr<CanonicalCookie> cookie1(std::make_unique<CanonicalCookie>(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT, CookieSourceScheme::kSecure));
+ COOKIE_PRIORITY_DEFAULT, false, CookieSourceScheme::kSecure, 443));
EXPECT_EQ("A", cookie1->Name());
EXPECT_EQ("2", cookie1->Value());
EXPECT_EQ("www.example.com", cookie1->Domain());
@@ -45,12 +45,15 @@ TEST(CanonicalCookieTest, Constructor) {
EXPECT_FALSE(cookie1->IsSecure());
EXPECT_FALSE(cookie1->IsHttpOnly());
EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cookie1->SameSite());
+ EXPECT_EQ(CookiePriority::COOKIE_PRIORITY_DEFAULT, cookie1->Priority());
+ EXPECT_FALSE(cookie1->IsSameParty());
EXPECT_EQ(cookie1->SourceScheme(), CookieSourceScheme::kSecure);
+ EXPECT_EQ(cookie1->SourcePort(), 443);
std::unique_ptr<CanonicalCookie> cookie2(std::make_unique<CanonicalCookie>(
"A", "2", ".www.example.com", "/", current_time, base::Time(),
base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT, CookieSourceScheme::kNonSecure));
+ COOKIE_PRIORITY_DEFAULT, true, CookieSourceScheme::kNonSecure, 65536));
EXPECT_EQ("A", cookie2->Name());
EXPECT_EQ("2", cookie2->Value());
EXPECT_EQ(".www.example.com", cookie2->Domain());
@@ -58,20 +61,27 @@ TEST(CanonicalCookieTest, Constructor) {
EXPECT_FALSE(cookie2->IsSecure());
EXPECT_FALSE(cookie2->IsHttpOnly());
EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cookie2->SameSite());
+ EXPECT_EQ(CookiePriority::COOKIE_PRIORITY_DEFAULT, cookie2->Priority());
+ EXPECT_TRUE(cookie2->IsSameParty());
EXPECT_EQ(cookie2->SourceScheme(), CookieSourceScheme::kNonSecure);
+ // Because the port can be set explicitly in the constructor its value can be
+ // independent of the other parameters. In this case, test that an invalid
+ // port value is interpreted as such.
+ EXPECT_EQ(cookie2->SourcePort(), url::PORT_INVALID);
- // Set Secure to true but don't specify is_source_scheme_secure
+ // Set Secure to true but don't specify source_scheme or port.
auto cookie3 = std::make_unique<CanonicalCookie>(
"A", "2", ".www.example.com", "/", current_time, base::Time(),
base::Time(), true /* secure */, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false);
EXPECT_TRUE(cookie3->IsSecure());
EXPECT_EQ(cookie3->SourceScheme(), CookieSourceScheme::kUnset);
+ EXPECT_EQ(cookie3->SourcePort(), url::PORT_UNSPECIFIED);
auto cookie4 = std::make_unique<CanonicalCookie>(
"A", "2", ".www.example.com", "/test", current_time, base::Time(),
base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false);
EXPECT_EQ("A", cookie4->Name());
EXPECT_EQ("2", cookie4->Value());
EXPECT_EQ(".www.example.com", cookie4->Domain());
@@ -79,6 +89,25 @@ TEST(CanonicalCookieTest, Constructor) {
EXPECT_FALSE(cookie4->IsSecure());
EXPECT_FALSE(cookie4->IsHttpOnly());
EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cookie4->SameSite());
+ EXPECT_FALSE(cookie4->IsSameParty());
+ EXPECT_EQ(cookie4->SourceScheme(), CookieSourceScheme::kUnset);
+ EXPECT_EQ(cookie4->SourcePort(), url::PORT_UNSPECIFIED);
+
+ // Test some port edge cases: unspecified.
+ auto cookie5 = std::make_unique<CanonicalCookie>(
+ "A", "2", ".www.example.com", "/", current_time, base::Time(),
+ base::Time(), true /* secure */, false, CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false, CookieSourceScheme::kUnset,
+ url::PORT_UNSPECIFIED);
+ EXPECT_EQ(cookie5->SourcePort(), url::PORT_UNSPECIFIED);
+
+ // Test some port edge cases: invalid.
+ auto cookie6 = std::make_unique<CanonicalCookie>(
+ "A", "2", ".www.example.com", "/", current_time, base::Time(),
+ base::Time(), true /* secure */, false, CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false, CookieSourceScheme::kUnset,
+ url::PORT_INVALID);
+ EXPECT_EQ(cookie6->SourcePort(), url::PORT_INVALID);
}
TEST(CanonicalCookie, CreationCornerCases) {
@@ -113,6 +142,7 @@ TEST(CanonicalCookieTest, Create) {
EXPECT_EQ("/test", cookie->Path());
EXPECT_FALSE(cookie->IsSecure());
EXPECT_EQ(cookie->SourceScheme(), CookieSourceScheme::kNonSecure);
+ EXPECT_EQ(cookie->SourcePort(), 80);
GURL url2("http://www.foo.com");
cookie = CanonicalCookie::Create(url2, "B=1", creation_time, server_time);
@@ -122,6 +152,7 @@ TEST(CanonicalCookieTest, Create) {
EXPECT_EQ("/", cookie->Path());
EXPECT_FALSE(cookie->IsSecure());
EXPECT_EQ(cookie->SourceScheme(), CookieSourceScheme::kNonSecure);
+ EXPECT_EQ(cookie->SourcePort(), 80);
// Test creating secure cookies. Secure scheme is not checked upon creation,
// so a URL of any scheme can create a Secure cookie.
@@ -174,6 +205,33 @@ TEST(CanonicalCookieTest, Create) {
cookie = CanonicalCookie::Create(url, "A=2", creation_time, server_time);
ASSERT_TRUE(cookie.get());
EXPECT_EQ(CookieSameSite::UNSPECIFIED, cookie->SameSite());
+
+ // Test creating cookies with different ports.
+ cookie = CanonicalCookie::Create(GURL("http://www.foo.com"), "B=1",
+ creation_time, server_time);
+ EXPECT_EQ(cookie->SourcePort(), 80);
+
+ cookie = CanonicalCookie::Create(GURL("http://www.foo.com:81"), "B=1",
+ creation_time, server_time);
+ EXPECT_EQ(cookie->SourcePort(), 81);
+
+ cookie = CanonicalCookie::Create(GURL("https://www.foo.com"), "B=1",
+ creation_time, server_time);
+ EXPECT_EQ(cookie->SourcePort(), 443);
+
+ cookie = CanonicalCookie::Create(GURL("https://www.foo.com:1234"), "B=1",
+ creation_time, server_time);
+ EXPECT_EQ(cookie->SourcePort(), 1234);
+
+ cookie = CanonicalCookie::Create(GURL("http://www.foo.com:443"), "B=1",
+ creation_time, server_time);
+ EXPECT_EQ(cookie->SourcePort(), 443);
+
+ // GURL's port parsing will handle any invalid ports, but let's still make
+ // sure we get the expected result anyway.
+ cookie = CanonicalCookie::Create(GURL("http://www.foo.com:70000"), "B=1",
+ creation_time, server_time);
+ EXPECT_EQ(cookie->SourcePort(), url::PORT_INVALID);
}
TEST(CanonicalCookieTest, CreateNonStandardSameSite) {
@@ -240,6 +298,53 @@ TEST(CanonicalCookieTest, CreateWithInvalidDomain) {
{CookieInclusionStatus::EXCLUDE_INVALID_DOMAIN}));
}
+TEST(CanonicalCookieTest, CreateSameParty) {
+ GURL url("http://www.example.com/test/foo.html");
+ GURL https_url("https://www.example.com/test/foo.html");
+ base::Time creation_time = base::Time::Now();
+ base::Optional<base::Time> server_time = base::nullopt;
+
+ CookieInclusionStatus status;
+ std::unique_ptr<CanonicalCookie> cookie = CanonicalCookie::Create(
+ url, "A=2; SameParty; Secure", creation_time, server_time, &status);
+ ASSERT_TRUE(cookie.get());
+ EXPECT_TRUE(status.IsInclude());
+ EXPECT_TRUE(cookie->IsSecure());
+ EXPECT_TRUE(cookie->IsSameParty());
+ EXPECT_EQ(CookieSameSite::UNSPECIFIED, cookie->SameSite());
+
+ cookie = CanonicalCookie::Create(url, "A=2; SameParty; SameSite=None; Secure",
+ creation_time, server_time, &status);
+ ASSERT_TRUE(cookie.get());
+ EXPECT_TRUE(status.IsInclude());
+ EXPECT_TRUE(cookie->IsSecure());
+ EXPECT_TRUE(cookie->IsSameParty());
+ EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cookie->SameSite());
+
+ cookie = CanonicalCookie::Create(url, "A=2; SameParty; SameSite=Lax; Secure",
+ creation_time, server_time, &status);
+ ASSERT_TRUE(cookie.get());
+ EXPECT_TRUE(status.IsInclude());
+ EXPECT_TRUE(cookie->IsSecure());
+ EXPECT_TRUE(cookie->IsSameParty());
+ EXPECT_EQ(CookieSameSite::LAX_MODE, cookie->SameSite());
+
+ // SameParty cookie with SameSite=Strict is invalid.
+ cookie =
+ CanonicalCookie::Create(url, "A=2; SameParty; SameSite=Strict; Secure",
+ creation_time, server_time, &status);
+ EXPECT_FALSE(cookie.get());
+ EXPECT_TRUE(status.HasExactlyExclusionReasonsForTesting(
+ {CookieInclusionStatus::EXCLUDE_INVALID_SAMEPARTY}));
+
+ // SameParty cookie without Secure is invalid.
+ cookie = CanonicalCookie::Create(url, "A=2; SameParty; SameSite=Lax",
+ creation_time, server_time, &status);
+ EXPECT_FALSE(cookie.get());
+ EXPECT_TRUE(status.HasExactlyExclusionReasonsForTesting(
+ {CookieInclusionStatus::EXCLUDE_INVALID_SAMEPARTY}));
+}
+
TEST(CanonicalCookieTest, EmptyExpiry) {
GURL url("http://www7.ipdl.inpit.go.jp/Tokujitu/tjkta.ipdl?N0000=108");
base::Time creation_time = base::Time::Now();
@@ -281,15 +386,16 @@ TEST(CanonicalCookieTest, IsEquivalent) {
std::string cookie_path = "/path";
base::Time creation_time = base::Time::Now();
base::Time expiration_time = creation_time + base::TimeDelta::FromDays(2);
- bool secure(false);
- bool httponly(false);
- CookieSameSite same_site(CookieSameSite::NO_RESTRICTION);
+ bool secure = false;
+ bool httponly = false;
+ CookieSameSite same_site = CookieSameSite::NO_RESTRICTION;
+ bool same_party = false;
// Test that a cookie is equivalent to itself.
std::unique_ptr<CanonicalCookie> cookie(std::make_unique<CanonicalCookie>(
cookie_name, cookie_value, cookie_domain, cookie_path, creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM));
+ COOKIE_PRIORITY_MEDIUM, same_party));
EXPECT_TRUE(cookie->IsEquivalent(*cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -298,7 +404,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
std::make_unique<CanonicalCookie>(
cookie_name, cookie_value, cookie_domain, cookie_path, creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM));
+ COOKIE_PRIORITY_MEDIUM, same_party));
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -307,7 +413,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, "2", cookie_domain, cookie_path, creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_HIGH);
+ COOKIE_PRIORITY_HIGH, same_party);
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_TRUE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -317,7 +423,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, "2", cookie_domain, cookie_path, other_creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, same_party);
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_TRUE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -325,7 +431,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_name, cookie_domain, cookie_path, creation_time,
expiration_time, base::Time(), true, httponly, same_site,
- COOKIE_PRIORITY_LOW);
+ COOKIE_PRIORITY_LOW, same_party);
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_TRUE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -333,7 +439,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_name, cookie_domain, cookie_path, creation_time,
expiration_time, base::Time(), secure, true, same_site,
- COOKIE_PRIORITY_LOW);
+ COOKIE_PRIORITY_LOW, same_party);
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_TRUE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -341,7 +447,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_name, cookie_domain, cookie_path, creation_time,
expiration_time, base::Time(), secure, httponly,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_LOW);
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_LOW, same_party);
EXPECT_TRUE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_TRUE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -350,7 +456,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
"B", cookie_value, cookie_domain, cookie_path, creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, same_party);
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
EXPECT_FALSE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_FALSE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -361,7 +467,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_value, "www.example.com", cookie_path, creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, same_party);
EXPECT_TRUE(cookie->IsDomainCookie());
EXPECT_FALSE(other_cookie->IsDomainCookie());
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
@@ -373,7 +479,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_value, ".example.com", cookie_path, creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, same_party);
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_TRUE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -386,7 +492,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_value, cookie_domain, "/test", creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, same_party);
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
EXPECT_FALSE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_FALSE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -394,7 +500,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_value, cookie_domain, cookie_path + "/subpath",
creation_time, expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, same_party);
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
// The path comparison is asymmetric
EXPECT_FALSE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
@@ -403,7 +509,7 @@ TEST(CanonicalCookieTest, IsEquivalent) {
other_cookie = std::make_unique<CanonicalCookie>(
cookie_name, cookie_value, cookie_domain, "/", creation_time,
expiration_time, base::Time(), secure, httponly, same_site,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, same_party);
EXPECT_FALSE(cookie->IsEquivalent(*other_cookie));
EXPECT_TRUE(cookie->IsEquivalentForSecureCookieMatching(*other_cookie));
EXPECT_FALSE(other_cookie->IsEquivalentForSecureCookieMatching(*cookie));
@@ -445,12 +551,12 @@ TEST(CanonicalCookieTest, IsEquivalentForSecureCookieMatching) {
auto cookie = std::make_unique<CanonicalCookie>(
test.cookie.name, "value1", test.cookie.domain, test.cookie.path,
base::Time(), base::Time(), base::Time(), false /* secure */, false,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_MEDIUM);
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_MEDIUM, false);
auto secure_cookie = std::make_unique<CanonicalCookie>(
test.secure_cookie.name, "value2", test.secure_cookie.domain,
test.secure_cookie.path, base::Time(), base::Time(), base::Time(),
true /* secure */, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_MEDIUM);
+ COOKIE_PRIORITY_MEDIUM, false);
EXPECT_EQ(test.equivalent,
cookie->IsEquivalentForSecureCookieMatching(*secure_cookie));
@@ -534,7 +640,7 @@ void VerifyEffectiveSameSiteTestCases(
CanonicalCookie cookie("A", "2", "example.test", "/", creation_time,
expiry_time, base::Time(), true /* secure */,
false /* httponly */, test_case.same_site,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false);
EXPECT_EQ(
test_case.effective_same_site,
cookie.GetEffectiveSameSiteForTesting(test_case.access_semantics));
@@ -1196,7 +1302,7 @@ TEST(CanonicalCookieTest, MultipleExclusionReasons) {
CanonicalCookie cookie1 = CanonicalCookie(
"name", "value", "other-domain.com", "/bar", creation_time, base::Time(),
base::Time(), true /* secure */, true /* httponly */,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false);
EXPECT_TRUE(cookie1.IncludeForRequestURL(url, options)
.status.HasExactlyExclusionReasonsForTesting(
{CookieInclusionStatus::EXCLUDE_HTTP_ONLY,
@@ -1390,42 +1496,42 @@ TEST(CanonicalCookieTest, IsCanonical) {
EXPECT_TRUE(CanonicalCookie("A", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Newline in name.
EXPECT_FALSE(CanonicalCookie("A\n", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Carriage return in name.
EXPECT_FALSE(CanonicalCookie("A\r", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Null character in name.
EXPECT_FALSE(CanonicalCookie(std::string("A\0Z", 3), "B", "x.y", "/path",
base::Time(), base::Time(), base::Time(), false,
false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Name begins with whitespace.
EXPECT_FALSE(CanonicalCookie(" A", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Name ends with whitespace.
EXPECT_FALSE(CanonicalCookie("A ", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Empty name. (Note this is against the spec but compatible with other
@@ -1433,70 +1539,70 @@ TEST(CanonicalCookieTest, IsCanonical) {
EXPECT_TRUE(CanonicalCookie("", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Space in name
EXPECT_TRUE(CanonicalCookie("A C", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Extra space suffixing name.
EXPECT_FALSE(CanonicalCookie("A ", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// '=' character in name.
EXPECT_FALSE(CanonicalCookie("A=", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Separator in name.
EXPECT_FALSE(CanonicalCookie("A;", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// '=' character in value.
EXPECT_TRUE(CanonicalCookie("A", "B=", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Separator in value.
EXPECT_FALSE(CanonicalCookie("A", "B;", "x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Separator in domain.
EXPECT_FALSE(CanonicalCookie("A", "B", ";x.y", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Garbage in domain.
EXPECT_FALSE(CanonicalCookie("A", "B", "@:&", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Space in domain.
EXPECT_FALSE(CanonicalCookie("A", "B", "x.y ", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Empty domain. (This is against cookie spec, but needed for Chrome's
@@ -1504,64 +1610,65 @@ TEST(CanonicalCookieTest, IsCanonical) {
EXPECT_TRUE(CanonicalCookie("A", "B", "", "/path", base::Time(), base::Time(),
base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Path does not start with a "/".
EXPECT_FALSE(CanonicalCookie("A", "B", "x.y", "path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Empty path.
EXPECT_FALSE(CanonicalCookie("A", "B", "x.y", "", base::Time(), base::Time(),
base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Simple IPv4 address as domain.
EXPECT_TRUE(CanonicalCookie("A", "B", "1.2.3.4", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// NOn-canonical IPv4 address as domain.
EXPECT_FALSE(CanonicalCookie("A", "B", "01.2.03.4", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Null IPv6 address as domain.
EXPECT_TRUE(CanonicalCookie("A", "B", "[::]", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Localhost IPv6 address as domain.
EXPECT_TRUE(CanonicalCookie("A", "B", "[::1]", "/path", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Fully speced IPv6 address as domain.
- EXPECT_FALSE(CanonicalCookie(
- "A", "B", "[2001:0DB8:AC10:FE01:0000:0000:0000:0000]",
- "/path", base::Time(), base::Time(), base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW)
- .IsCanonical());
+ EXPECT_FALSE(
+ CanonicalCookie("A", "B", "[2001:0DB8:AC10:FE01:0000:0000:0000:0000]",
+ "/path", base::Time(), base::Time(), base::Time(), false,
+ false, CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_LOW, false)
+ .IsCanonical());
// Zero abbreviated IPv6 address as domain. Not canonical because of leading
// zeros & uppercase hex letters.
EXPECT_FALSE(CanonicalCookie("A", "B", "[2001:0DB8:AC10:FE01::]", "/path",
base::Time(), base::Time(), base::Time(), false,
false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Zero prefixes removed IPv6 address as domain. Not canoncial because of
@@ -1569,70 +1676,101 @@ TEST(CanonicalCookieTest, IsCanonical) {
EXPECT_FALSE(CanonicalCookie("A", "B", "[2001:DB8:AC10:FE01::]", "/path",
base::Time(), base::Time(), base::Time(), false,
false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Lowercased hex IPv6 address as domain.
EXPECT_TRUE(CanonicalCookie("A", "B", "[2001:db8:ac10:fe01::]", "/path",
base::Time(), base::Time(), base::Time(), false,
false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Properly formatted host cookie.
EXPECT_TRUE(CanonicalCookie("__Host-A", "B", "x.y", "/", base::Time(),
base::Time(), base::Time(), true, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Insecure host cookie.
EXPECT_FALSE(CanonicalCookie("__Host-A", "B", "x.y", "/", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Host cookie with non-null path.
EXPECT_FALSE(CanonicalCookie("__Host-A", "B", "x.y", "/path", base::Time(),
base::Time(), base::Time(), true, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Host cookie with empty domain.
EXPECT_FALSE(CanonicalCookie("__Host-A", "B", "", "/", base::Time(),
base::Time(), base::Time(), true, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Host cookie with period prefixed domain.
EXPECT_FALSE(CanonicalCookie("__Host-A", "B", ".x.y", "/", base::Time(),
base::Time(), base::Time(), true, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Properly formatted secure cookie.
EXPECT_TRUE(CanonicalCookie("__Secure-A", "B", "x.y", "/", base::Time(),
base::Time(), base::Time(), true, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
.IsCanonical());
// Insecure secure cookie.
EXPECT_FALSE(CanonicalCookie("__Secure-A", "B", "x.y", "/", base::Time(),
base::Time(), base::Time(), false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_LOW)
+ COOKIE_PRIORITY_LOW, false)
+ .IsCanonical());
+
+ // SameParty attribute used correctly (with Secure and non-Strict SameSite).
+ EXPECT_TRUE(CanonicalCookie("A", "B", "x.y", "/", base::Time(), base::Time(),
+ base::Time(), true, false,
+ CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_LOW, true)
+ .IsCanonical());
+ EXPECT_TRUE(CanonicalCookie("A", "B", "x.y", "/", base::Time(), base::Time(),
+ base::Time(), true, false,
+ CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_LOW,
+ true)
+ .IsCanonical());
+ EXPECT_TRUE(CanonicalCookie("A", "B", "x.y", "/", base::Time(), base::Time(),
+ base::Time(), true, false,
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_LOW,
+ true)
+ .IsCanonical());
+
+ // SameParty without Secure is not canonical.
+ EXPECT_FALSE(CanonicalCookie("A", "B", "x.y", "/", base::Time(), base::Time(),
+ base::Time(), false, false,
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_LOW,
+ true)
+ .IsCanonical());
+
+ // SameParty with SameSite=Strict is not canonical.
+ EXPECT_FALSE(CanonicalCookie("A", "B", "x.y", "/", base::Time(), base::Time(),
+ base::Time(), true, false,
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_LOW,
+ true)
.IsCanonical());
}
TEST(CanonicalCookieTest, TestSetCreationDate) {
- CanonicalCookie cookie("A", "B", "x.y", "/path", base::Time(), base::Time(),
- base::Time(), false, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW);
+ CanonicalCookie cookie(
+ "A", "B", "x.y", "/path", base::Time(), base::Time(), base::Time(), false,
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW, false);
EXPECT_TRUE(cookie.CreationDate().is_null());
base::Time now(base::Time::Now());
@@ -1727,7 +1865,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_EQ("A", cc->Name());
EXPECT_EQ("B", cc->Value());
@@ -1740,6 +1878,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
EXPECT_FALSE(cc->IsHttpOnly());
EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cc->SameSite());
EXPECT_EQ(COOKIE_PRIORITY_MEDIUM, cc->Priority());
+ EXPECT_FALSE(cc->IsSameParty());
EXPECT_FALSE(cc->IsDomainCookie());
// Creation date
@@ -1747,7 +1886,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
two_hours_ago, base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_EQ(two_hours_ago, cc->CreationDate());
@@ -1756,7 +1895,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
two_hours_ago, base::Time(), one_hour_ago, false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_EQ(one_hour_ago, cc->LastAccessDate());
@@ -1765,7 +1904,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
base::Time(), one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_EQ(one_hour_from_now, cc->ExpiryDate());
@@ -1774,7 +1913,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), true /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_TRUE(cc->IsSecure());
@@ -1783,7 +1922,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
true /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_TRUE(cc->IsHttpOnly());
@@ -1791,7 +1930,8 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
cc = CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
- false /*httponly*/, CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT);
+ false /*httponly*/, CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_EQ(CookieSameSite::LAX_MODE, cc->SameSite());
@@ -1799,7 +1939,8 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
cc = CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
- false /*httponly*/, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW);
+ false /*httponly*/, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW,
+ false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_EQ(COOKIE_PRIORITY_LOW, cc->Priority());
@@ -1808,9 +1949,18 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Inputs) {
GURL("https://www.foo.com"), "A", "B", "www.foo.com", "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_TRUE(cc);
EXPECT_TRUE(cc->IsDomainCookie());
+
+ // SameParty
+ cc = CanonicalCookie::CreateSanitizedCookie(
+ GURL("https://www.foo.com"), "A", "B", std::string(), "/foo",
+ base::Time(), base::Time(), base::Time(), true /*secure*/,
+ false /*httponly*/, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW,
+ true /*same_party*/);
+ EXPECT_TRUE(cc);
+ EXPECT_TRUE(cc->IsSameParty());
}
// Make sure sanitization and blocking of cookies works correctly.
@@ -1825,94 +1975,97 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
GURL("http://www.foo.com/foo"), "A", "B", std::string(), "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/bar"), "C", "D", "www.foo.com", "/",
two_hours_ago, base::Time(), one_hour_ago, false /*secure*/,
true /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "E", "F", std::string(), std::string(),
base::Time(), base::Time(), base::Time(), true /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
// Test the file:// protocol.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("file:///"), "A", "B", std::string(), "/foo", one_hour_ago,
one_hour_from_now, base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/));
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("file:///home/user/foo.txt"), "A", "B", std::string(), "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("file:///home/user/foo.txt"), "A", "B", "home", "/foo", one_hour_ago,
one_hour_from_now, base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/));
// Test that malformed attributes fail to set the cookie.
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/foo"), " A", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/foo"), "A;", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/foo"), "A=", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/foo"), "A\x07", "B", std::string(), "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "A", " B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "A", "\x0fZ", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "A", "B", "www.foo.com ", "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/foo"), "A", "B", "foo.ozzzzzzle", "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/foo"), "A", "B", std::string(), "foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "A", "B", std::string(), "/foo ",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com/foo"), "A", "B", "%2Efoo.com", "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://domaintest.%E3%81%BF%E3%82%93%E3%81%AA"), "A", "B",
"domaintest.%E3%81%BF%E3%82%93%E3%81%AA", "/foo", base::Time(),
base::Time(), base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/));
std::unique_ptr<CanonicalCookie> cc;
@@ -1922,7 +2075,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
GURL("http://www.foo.com/foo"), "A", "B", "www.foo.com", "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
ASSERT_TRUE(cc);
EXPECT_TRUE(cc->IsDomainCookie());
EXPECT_EQ(".www.foo.com", cc->Domain());
@@ -1931,7 +2084,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
GURL("http://www.foo.com/foo"), "A", "B", ".www.foo.com", "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
ASSERT_TRUE(cc);
EXPECT_TRUE(cc->IsDomainCookie());
EXPECT_EQ(".www.foo.com", cc->Domain());
@@ -1940,7 +2093,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
GURL("http://www.foo.com/foo"), "A", "B", ".foo.com", "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
ASSERT_TRUE(cc);
EXPECT_TRUE(cc->IsDomainCookie());
EXPECT_EQ(".foo.com", cc->Domain());
@@ -1949,7 +2102,7 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
GURL("http://www.foo.com/foo"), "A", "B", ".www2.www.foo.com", "/foo",
one_hour_ago, one_hour_from_now, base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
EXPECT_FALSE(cc);
// Secure/URL Scheme mismatch.
@@ -1957,26 +2110,28 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
GURL("http://www.foo.com"), "A", "B", std::string(), "/foo ",
base::Time(), base::Time(), base::Time(), true /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/));
// Null creation date/non-null last access date conflict.
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "A", "B", std::string(), "/foo", base::Time(),
base::Time(), base::Time::Now(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/));
// Domain doesn't match URL
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "A", "B", "www.bar.com", "/", base::Time(),
base::Time(), base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/));
// Path with unusual characters escaped.
cc = CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "A", "B", std::string(), "/foo",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false /*same_party*/);
ASSERT_TRUE(cc);
EXPECT_EQ("/foo%7F", cc->Path());
@@ -1984,79 +2139,116 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://www.foo.com"), "", "", std::string(), "/", base::Time(),
base::Time(), base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/));
// A __Secure- cookie must be Secure.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Secure-A", "B", ".www.foo.com", "/",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Secure-A", "B", ".www.foo.com", "/",
two_hours_ago, one_hour_from_now, one_hour_ago, false, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
// A __Host- cookie must be Secure.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Host-A", "B", std::string(), "/",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Host-A", "B", std::string(), "/",
two_hours_ago, one_hour_from_now, one_hour_ago, false, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
// A __Host- cookie must have path "/".
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Host-A", "B", std::string(), "/",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Host-A", "B", std::string(), "/foo",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
// A __Host- cookie must not specify a domain.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Host-A", "B", std::string(), "/",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "__Host-A", "B", ".www.foo.com", "/",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
// Without __Host- prefix, this is a valid host cookie because it does not
// specify a domain.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "A", "B", std::string(), "/", two_hours_ago,
one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
// Without __Host- prefix, this is a valid domain (not host) cookie.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://www.foo.com"), "A", "B", ".www.foo.com", "/", two_hours_ago,
one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
// The __Host- prefix should not prevent otherwise-valid host cookies from
// being accepted.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://127.0.0.1"), "A", "B", std::string(), "/", two_hours_ago,
one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://127.0.0.1"), "__Host-A", "B", std::string(), "/",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
// Host cookies should not specify domain unless it is an IP address that
// matches the URL.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://127.0.0.1"), "A", "B", "127.0.0.1", "/", two_hours_ago,
one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("https://127.0.0.1"), "__Host-A", "B", "127.0.0.1", "/",
two_hours_ago, one_hour_from_now, one_hour_ago, true, false,
- CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ false));
+
+ // SameParty attribute requires Secure and forbids SameSite=Strict.
+ EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
+ GURL("https://www.foo.com"), "A", "B", ".www.foo.com", "/", two_hours_ago,
+ one_hour_from_now, one_hour_ago, true /*secure*/, false,
+ CookieSameSite::NO_RESTRICTION, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ true /*same_party*/));
+ EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
+ GURL("https://www.foo.com"), "A", "B", ".www.foo.com", "/", two_hours_ago,
+ one_hour_from_now, one_hour_ago, false /*secure*/, false,
+ CookieSameSite::LAX_MODE, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ true /*same_party*/));
+ EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
+ GURL("https://www.foo.com"), "A", "B", ".www.foo.com", "/", two_hours_ago,
+ one_hour_from_now, one_hour_ago, true /*secure*/, false,
+ CookieSameSite::STRICT_MODE, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ true /*same_party*/));
+ EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
+ GURL("https://www.foo.com"), "A", "B", ".www.foo.com", "/", two_hours_ago,
+ one_hour_from_now, one_hour_ago, false /*secure*/, false,
+ CookieSameSite::STRICT_MODE, CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ true /*same_party*/));
// Check that CreateSanitizedCookie can gracefully fail on inputs that would
// crash cookie_util::GetCookieDomainWithString due to failing
@@ -2066,30 +2258,30 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://..."), "A", "B", "...", "/", base::Time(), base::Time(),
base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://."), "A", "B", std::string(), "/", base::Time(),
base::Time(), base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
EXPECT_FALSE(CanonicalCookie::CreateSanitizedCookie(
GURL("http://.chromium.org"), "A", "B", ".chromium.org", "/",
base::Time(), base::Time(), base::Time(), false /*secure*/,
false /*httponly*/, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// Check that a file URL with an IPv6 host, and matching IPv6 domain, are
// valid.
EXPECT_TRUE(CanonicalCookie::CreateSanitizedCookie(
GURL("file://[A::]"), "A", "B", "[A::]", "", base::Time(), base::Time(),
base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
// On Windows, URLs beginning with two backslashes are considered file
// URLs. On other platforms, they are invalid.
auto double_backslash_ipv6_cookie = CanonicalCookie::CreateSanitizedCookie(
GURL("\\\\[A::]"), "A", "B", "[A::]", "", base::Time(), base::Time(),
base::Time(), false /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
#if defined(OS_WIN)
EXPECT_TRUE(double_backslash_ipv6_cookie);
EXPECT_TRUE(double_backslash_ipv6_cookie->IsCanonical());
@@ -2098,6 +2290,69 @@ TEST(CanonicalCookieTest, CreateSanitizedCookie_Logic) {
#endif
}
+TEST(CanonicalCookieTest, FromStorage) {
+ base::Time two_hours_ago = base::Time::Now() - base::TimeDelta::FromHours(2);
+ base::Time one_hour_ago = base::Time::Now() - base::TimeDelta::FromHours(1);
+ base::Time one_hour_from_now =
+ base::Time::Now() + base::TimeDelta::FromHours(1);
+
+ std::unique_ptr<CanonicalCookie> cc = CanonicalCookie::FromStorage(
+ "A", "B", "www.foo.com", "/bar", two_hours_ago, one_hour_from_now,
+ one_hour_ago, false /*secure*/, false /*httponly*/,
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/, CookieSourceScheme::kSecure, 87);
+ EXPECT_TRUE(cc);
+ EXPECT_EQ("A", cc->Name());
+ EXPECT_EQ("B", cc->Value());
+ EXPECT_EQ("www.foo.com", cc->Domain());
+ EXPECT_EQ("/bar", cc->Path());
+ EXPECT_EQ(two_hours_ago, cc->CreationDate());
+ EXPECT_EQ(one_hour_ago, cc->LastAccessDate());
+ EXPECT_EQ(one_hour_from_now, cc->ExpiryDate());
+ EXPECT_FALSE(cc->IsSecure());
+ EXPECT_FALSE(cc->IsHttpOnly());
+ EXPECT_EQ(CookieSameSite::NO_RESTRICTION, cc->SameSite());
+ EXPECT_EQ(COOKIE_PRIORITY_MEDIUM, cc->Priority());
+ EXPECT_EQ(CookieSourceScheme::kSecure, cc->SourceScheme());
+ EXPECT_FALSE(cc->IsDomainCookie());
+ EXPECT_EQ(cc->SourcePort(), 87);
+
+ // Should return nullptr when the cookie is not canonical.
+ // In this case the cookie is not canonical because its name attribute
+ // contains a newline character.
+ EXPECT_FALSE(CanonicalCookie::FromStorage(
+ "A\n", "B", "www.foo.com", "/bar", two_hours_ago, one_hour_from_now,
+ one_hour_ago, false /*secure*/, false /*httponly*/,
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/, CookieSourceScheme::kSecure, 80));
+
+ // If the port information gets corrupted out of the valid range
+ // FromStorage() should result in a PORT_INVALID.
+ std::unique_ptr<CanonicalCookie> cc2 = CanonicalCookie::FromStorage(
+ "A", "B", "www.foo.com", "/bar", two_hours_ago, one_hour_from_now,
+ one_hour_ago, false /*secure*/, false /*httponly*/,
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/, CookieSourceScheme::kSecure, 80000);
+
+ EXPECT_EQ(cc2->SourcePort(), url::PORT_INVALID);
+
+ // Test port edge cases: unspecified.
+ std::unique_ptr<CanonicalCookie> cc3 = CanonicalCookie::FromStorage(
+ "A", "B", "www.foo.com", "/bar", two_hours_ago, one_hour_from_now,
+ one_hour_ago, false /*secure*/, false /*httponly*/,
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/, CookieSourceScheme::kSecure, url::PORT_UNSPECIFIED);
+ EXPECT_EQ(cc3->SourcePort(), url::PORT_UNSPECIFIED);
+
+ // Test port edge cases: invalid.
+ std::unique_ptr<CanonicalCookie> cc4 = CanonicalCookie::FromStorage(
+ "A", "B", "www.foo.com", "/bar", two_hours_ago, one_hour_from_now,
+ one_hour_ago, false /*secure*/, false /*httponly*/,
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /*same_party*/, CookieSourceScheme::kSecure, url::PORT_INVALID);
+ EXPECT_EQ(cc4->SourcePort(), url::PORT_INVALID);
+}
+
TEST(CanonicalCookieTest, IsSetPermittedInContext) {
GURL url("http://www.example.com/test");
base::Time current_time = base::Time::Now();
@@ -2105,11 +2360,11 @@ TEST(CanonicalCookieTest, IsSetPermittedInContext) {
CanonicalCookie cookie_scriptable(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
CanonicalCookie cookie_httponly(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, true /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
CookieOptions context_script;
CookieOptions context_network;
@@ -2158,7 +2413,7 @@ TEST(CanonicalCookieTest, IsSetPermittedInContext) {
CanonicalCookie cookie_same_site_unrestricted(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
EXPECT_TRUE(cookie_same_site_unrestricted
.IsSetPermittedInContext(context_cross_site)
@@ -2224,7 +2479,7 @@ TEST(CanonicalCookieTest, IsSetPermittedInContext) {
CanonicalCookie cookie_same_site_lax(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT, false);
EXPECT_TRUE(cookie_same_site_lax.IsSetPermittedInContext(context_cross_site)
.status.HasExactlyExclusionReasonsForTesting(
@@ -2298,7 +2553,7 @@ TEST(CanonicalCookieTest, IsSetPermittedInContext) {
CanonicalCookie cookie_same_site_strict(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false);
// TODO(morlovich): Do compatibility testing on whether set of strict in lax
// context really should be accepted.
@@ -2400,7 +2655,7 @@ TEST(CanonicalCookieTest, IsSetPermittedInContext) {
CanonicalCookie cookie_same_site_unspecified(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT, false);
{
base::test::ScopedFeatureList feature_list;
@@ -2503,7 +2758,7 @@ TEST(CanonicalCookieTest, IsSetPermittedEffectiveSameSite) {
CanonicalCookie cookie_no_restriction(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
EXPECT_EQ(
cookie_no_restriction
@@ -2516,7 +2771,7 @@ TEST(CanonicalCookieTest, IsSetPermittedEffectiveSameSite) {
CanonicalCookie cookie_lax("A", "2", "www.example.com", "/test", current_time,
base::Time(), base::Time(), true /*secure*/,
false /*httponly*/, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false);
EXPECT_EQ(
cookie_lax
@@ -2529,7 +2784,7 @@ TEST(CanonicalCookieTest, IsSetPermittedEffectiveSameSite) {
CanonicalCookie cookie_strict(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false);
EXPECT_EQ(
cookie_strict
@@ -2543,11 +2798,11 @@ TEST(CanonicalCookieTest, IsSetPermittedEffectiveSameSite) {
CanonicalCookie cookie_old_unspecified(
"A", "2", "www.example.com", "/test", creation_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT, false);
CanonicalCookie cookie_unspecified(
"A", "2", "www.example.com", "/test", current_time, base::Time(),
base::Time(), true /*secure*/, false /*httponly*/,
- CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT, false);
EXPECT_EQ(
cookie_old_unspecified
diff --git a/chromium/net/cookies/cookie_constants.cc b/chromium/net/cookies/cookie_constants.cc
index bf8dd08c555..117fe0c90f5 100644
--- a/chromium/net/cookies/cookie_constants.cc
+++ b/chromium/net/cookies/cookie_constants.cc
@@ -4,6 +4,7 @@
#include "net/cookies/cookie_constants.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/string_util.h"
@@ -97,8 +98,200 @@ CookieSameSite StringToCookieSameSite(const std::string& same_site,
return samesite;
}
-void RecordCookieSameSiteAttributeValueHistogram(CookieSameSiteString value) {
+void RecordCookieSameSiteAttributeValueHistogram(CookieSameSiteString value,
+ bool is_cookie_same_party) {
UMA_HISTOGRAM_ENUMERATION("Cookie.SameSiteAttributeValue", value);
+ if (is_cookie_same_party) {
+ base::UmaHistogramEnumeration(
+ "Cookie.SamePartyCookieSameSiteAttributeValue", value);
+ }
+}
+
+CookiePort ReducePortRangeForCookieHistogram(const int port) {
+ switch (port) {
+ case 80:
+ return CookiePort::k80;
+ case 81:
+ return CookiePort::k81;
+ case 82:
+ return CookiePort::k82;
+ case 83:
+ return CookiePort::k83;
+ case 84:
+ return CookiePort::k84;
+ case 85:
+ return CookiePort::k85;
+ case 443:
+ return CookiePort::k443;
+ case 444:
+ return CookiePort::k444;
+ case 445:
+ return CookiePort::k445;
+ case 446:
+ return CookiePort::k446;
+ case 447:
+ return CookiePort::k447;
+ case 448:
+ return CookiePort::k448;
+ case 3000:
+ return CookiePort::k3000;
+ case 3001:
+ return CookiePort::k3001;
+ case 3002:
+ return CookiePort::k3002;
+ case 3003:
+ return CookiePort::k3003;
+ case 3004:
+ return CookiePort::k3004;
+ case 3005:
+ return CookiePort::k3005;
+ case 4200:
+ return CookiePort::k4200;
+ case 4201:
+ return CookiePort::k4201;
+ case 4202:
+ return CookiePort::k4202;
+ case 4203:
+ return CookiePort::k4203;
+ case 4204:
+ return CookiePort::k4204;
+ case 4205:
+ return CookiePort::k4205;
+ case 5000:
+ return CookiePort::k5000;
+ case 5001:
+ return CookiePort::k5001;
+ case 5002:
+ return CookiePort::k5002;
+ case 5003:
+ return CookiePort::k5003;
+ case 5004:
+ return CookiePort::k5004;
+ case 5005:
+ return CookiePort::k5005;
+ case 7000:
+ return CookiePort::k7000;
+ case 7001:
+ return CookiePort::k7001;
+ case 7002:
+ return CookiePort::k7002;
+ case 7003:
+ return CookiePort::k7003;
+ case 7004:
+ return CookiePort::k7004;
+ case 7005:
+ return CookiePort::k7005;
+ case 8000:
+ return CookiePort::k8000;
+ case 8001:
+ return CookiePort::k8001;
+ case 8002:
+ return CookiePort::k8002;
+ case 8003:
+ return CookiePort::k8003;
+ case 8004:
+ return CookiePort::k8004;
+ case 8005:
+ return CookiePort::k8005;
+ case 8080:
+ return CookiePort::k8080;
+ case 8081:
+ return CookiePort::k8081;
+ case 8082:
+ return CookiePort::k8082;
+ case 8083:
+ return CookiePort::k8083;
+ case 8084:
+ return CookiePort::k8084;
+ case 8085:
+ return CookiePort::k8085;
+ case 8090:
+ return CookiePort::k8090;
+ case 8091:
+ return CookiePort::k8091;
+ case 8092:
+ return CookiePort::k8092;
+ case 8093:
+ return CookiePort::k8093;
+ case 8094:
+ return CookiePort::k8094;
+ case 8095:
+ return CookiePort::k8095;
+ case 8100:
+ return CookiePort::k8100;
+ case 8101:
+ return CookiePort::k8101;
+ case 8102:
+ return CookiePort::k8102;
+ case 8103:
+ return CookiePort::k8103;
+ case 8104:
+ return CookiePort::k8104;
+ case 8105:
+ return CookiePort::k8105;
+ case 8200:
+ return CookiePort::k8200;
+ case 8201:
+ return CookiePort::k8201;
+ case 8202:
+ return CookiePort::k8202;
+ case 8203:
+ return CookiePort::k8203;
+ case 8204:
+ return CookiePort::k8204;
+ case 8205:
+ return CookiePort::k8205;
+ case 8443:
+ return CookiePort::k8443;
+ case 8444:
+ return CookiePort::k8444;
+ case 8445:
+ return CookiePort::k8445;
+ case 8446:
+ return CookiePort::k8446;
+ case 8447:
+ return CookiePort::k8447;
+ case 8448:
+ return CookiePort::k8448;
+ case 8888:
+ return CookiePort::k8888;
+ case 8889:
+ return CookiePort::k8889;
+ case 8890:
+ return CookiePort::k8890;
+ case 8891:
+ return CookiePort::k8891;
+ case 8892:
+ return CookiePort::k8892;
+ case 8893:
+ return CookiePort::k8893;
+ case 9000:
+ return CookiePort::k9000;
+ case 9001:
+ return CookiePort::k9001;
+ case 9002:
+ return CookiePort::k9002;
+ case 9003:
+ return CookiePort::k9003;
+ case 9004:
+ return CookiePort::k9004;
+ case 9005:
+ return CookiePort::k9005;
+ case 9090:
+ return CookiePort::k9090;
+ case 9091:
+ return CookiePort::k9091;
+ case 9092:
+ return CookiePort::k9092;
+ case 9093:
+ return CookiePort::k9093;
+ case 9094:
+ return CookiePort::k9094;
+ case 9095:
+ return CookiePort::k9095;
+ default:
+ return CookiePort::kOther;
+ }
}
} // namespace net
diff --git a/chromium/net/cookies/cookie_constants.h b/chromium/net/cookies/cookie_constants.h
index 8397a471a8b..8fb0df7e5ff 100644
--- a/chromium/net/cookies/cookie_constants.h
+++ b/chromium/net/cookies/cookie_constants.h
@@ -95,6 +95,125 @@ enum class CookieSourceScheme {
kMaxValue = kSecure // Keep as the last value.
};
+enum class CookiePort {
+ // DO NOT REORDER OR RENUMBER. These are used for histograms.
+
+ // Potentially interesting port values for cookies for use with histograms.
+
+ // Not a port explicitly listed below, including invalid ports (-1, 65536,
+ // etc).
+ kOther = 0,
+ // HTTP
+ k80 = 1,
+ k81 = 2,
+ k82 = 3,
+ k83 = 4,
+ k84 = 5,
+ k85 = 6,
+ // HTTPS
+ k443 = 7,
+ k444 = 8,
+ k445 = 9,
+ k446 = 10,
+ k447 = 11,
+ k448 = 12,
+ // JS Framework
+ k3000 = 13,
+ k3001 = 14,
+ k3002 = 15,
+ k3003 = 16,
+ k3004 = 17,
+ k3005 = 18,
+ // JS Framework
+ k4200 = 19,
+ k4201 = 20,
+ k4202 = 21,
+ k4203 = 22,
+ k4204 = 23,
+ k4205 = 24,
+ // JS Framework
+ k5000 = 25,
+ k5001 = 26,
+ k5002 = 27,
+ k5003 = 28,
+ k5004 = 29,
+ k5005 = 30,
+ // Common Dev Ports
+ k7000 = 31,
+ k7001 = 32,
+ k7002 = 33,
+ k7003 = 34,
+ k7004 = 35,
+ k7005 = 36,
+ // HTTP
+ k8000 = 37,
+ k8001 = 38,
+ k8002 = 39,
+ k8003 = 40,
+ k8004 = 41,
+ k8005 = 42,
+ // HTTP
+ k8080 = 43,
+ k8081 = 44,
+ k8082 = 45,
+ k8083 = 46,
+ k8084 = 47,
+ k8085 = 48,
+ // HTTP
+ k8090 = 49,
+ k8091 = 50,
+ k8092 = 51,
+ k8093 = 52,
+ k8094 = 53,
+ k8095 = 54,
+ // JS Framework
+ k8100 = 55,
+ k8101 = 56,
+ k8102 = 57,
+ k8103 = 58,
+ k8104 = 59,
+ k8105 = 60,
+ // JS Framework
+ k8200 = 61,
+ k8201 = 62,
+ k8202 = 63,
+ k8203 = 64,
+ k8204 = 65,
+ k8205 = 66,
+ // HTTP(S)
+ k8443 = 67,
+ k8444 = 68,
+ k8445 = 69,
+ k8446 = 70,
+ k8447 = 71,
+ k8448 = 72,
+ // HTTP
+ k8888 = 73,
+ k8889 = 74,
+ k8890 = 75,
+ k8891 = 76,
+ k8892 = 77,
+ k8893 = 78,
+ // Common Dev Ports
+ k9000 = 79,
+ k9001 = 80,
+ k9002 = 81,
+ k9003 = 82,
+ k9004 = 83,
+ k9005 = 84,
+ // HTTP
+ k9090 = 85,
+ k9091 = 86,
+ k9092 = 87,
+ k9093 = 88,
+ k9094 = 89,
+ k9095 = 90,
+
+ // Keep as last value.
+ kMaxValue = k9095
+
+};
+
// Returns the Set-Cookie header priority token corresponding to |priority|.
NET_EXPORT std::string CookiePriorityToString(CookiePriority priority);
@@ -116,7 +235,13 @@ StringToCookieSameSite(const std::string& same_site,
CookieSameSiteString* samesite_string = nullptr);
NET_EXPORT void RecordCookieSameSiteAttributeValueHistogram(
- CookieSameSiteString value);
+ CookieSameSiteString value,
+ bool is_cookie_same_party = false);
+
+// This function reduces the 65535 available TCP port values down to a <100
+// potentially interesting values that cookies could be set by or sent to. This
+// is because UMA cannot handle the full range.
+NET_EXPORT CookiePort ReducePortRangeForCookieHistogram(const int port);
} // namespace net
diff --git a/chromium/net/cookies/cookie_constants_unittest.cc b/chromium/net/cookies/cookie_constants_unittest.cc
index 8fab6e292c9..a66a3bbbe7b 100644
--- a/chromium/net/cookies/cookie_constants_unittest.cc
+++ b/chromium/net/cookies/cookie_constants_unittest.cc
@@ -62,4 +62,41 @@ TEST(CookieConstantsTest, TestCookieSameSite) {
}
}
+TEST(CookieConstantsTest, TestReducePortRangeForCookieHistogram) {
+ struct TestData {
+ int input_port;
+ CookiePort expected_enum;
+ };
+
+ const TestData kTestValues[] = {
+ {-1234 /* Invalid port. */, CookiePort::kOther},
+ {0 /* Invalid port. */, CookiePort::kOther},
+ {1 /* Valid but outside range. */, CookiePort::kOther},
+ {79 /* Valid but outside range. */, CookiePort::kOther},
+ {80, CookiePort::k80},
+ {445, CookiePort::k445},
+ {3001, CookiePort::k3001},
+ {4200, CookiePort::k4200},
+ {5002, CookiePort::k5002},
+ {7003, CookiePort::k7003},
+ {8001, CookiePort::k8001},
+ {8080, CookiePort::k8080},
+ {8086 /* Valid but outside range. */, CookiePort::kOther},
+ {8095, CookiePort::k8095},
+ {8100, CookiePort::k8100},
+ {8201, CookiePort::k8201},
+ {8445, CookiePort::k8445},
+ {8888, CookiePort::k8888},
+ {9004, CookiePort::k9004},
+ {9091, CookiePort::k9091},
+ {65535 /* Valid but outside range. */, CookiePort::kOther},
+ {655356 /* Invalid port. */, CookiePort::kOther},
+ };
+
+ for (const auto& value : kTestValues) {
+ EXPECT_EQ(value.expected_enum,
+ ReducePortRangeForCookieHistogram(value.input_port));
+ }
+}
+
} // namespace net
diff --git a/chromium/net/cookies/cookie_deletion_info_unittest.cc b/chromium/net/cookies/cookie_deletion_info_unittest.cc
index 39131b50175..ff629f91223 100644
--- a/chromium/net/cookies/cookie_deletion_info_unittest.cc
+++ b/chromium/net/cookies/cookie_deletion_info_unittest.cc
@@ -90,7 +90,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchSessionControl) {
/*secure=*/true,
/*httponly=*/false,
CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CanonicalCookie session_cookie(
"session-cookie", "session-value", "session-domain", "session-path",
@@ -99,7 +100,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchSessionControl) {
/*last_access=*/base::Time::Now(),
/*secure=*/true,
/*httponly=*/false, CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CookieDeletionInfo delete_info;
EXPECT_TRUE(delete_info.Matches(persistent_cookie));
@@ -125,7 +127,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchHost) {
/*secure=*/true,
/*httponly=*/false,
CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CanonicalCookie host_cookie("host-cookie", "host-cookie-value",
/*domain=*/"thehost.hosting.com", "/path",
@@ -135,7 +138,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchHost) {
/*secure=*/true,
/*httponly=*/false,
CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
EXPECT_TRUE(domain_cookie.IsDomainCookie());
EXPECT_TRUE(host_cookie.IsHostCookie());
@@ -165,7 +169,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchName) {
/*last_access=*/base::Time::Now(),
/*secure=*/true,
/*httponly=*/false, CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CanonicalCookie cookie2("cookie2-name", "cookie2-value",
/*domain=*/".example.com", "/path",
/*creation=*/base::Time::Now(),
@@ -173,7 +178,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchName) {
/*last_access=*/base::Time::Now(),
/*secure=*/true,
/*httponly=*/false, CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CookieDeletionInfo delete_info;
delete_info.name = "cookie1-name";
@@ -189,7 +195,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchValue) {
/*last_access=*/base::Time::Now(),
/*secure=*/true,
/*httponly=*/false, CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CanonicalCookie cookie2("cookie2-name", "cookie2-value",
/*domain=*/".example.com", "/path",
/*creation=*/base::Time::Now(),
@@ -197,7 +204,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchValue) {
/*last_access=*/base::Time::Now(),
/*secure=*/true,
/*httponly=*/false, CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CookieDeletionInfo delete_info;
delete_info.value_for_testing = "cookie2-value";
@@ -213,7 +221,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchUrl) {
/*last_access=*/base::Time::Now(),
/*secure=*/true,
/*httponly=*/false, CookieSameSite::NO_RESTRICTION,
- CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
CookieDeletionInfo delete_info;
delete_info.url = GURL("https://www.example.com/path");
@@ -242,7 +251,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoDomainMatchesDomain) {
/*secure=*/true,
/*httponly=*/false,
/*same_site=*/CookieSameSite::NO_RESTRICTION,
- /*priority=*/CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ /*priority=*/CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
return cookie;
};
@@ -278,7 +288,8 @@ TEST(CookieDeletionInfoTest, CookieDeletionInfoMatchesDomainList) {
/*secure=*/false,
/*httponly=*/false,
/*same_site=*/CookieSameSite::NO_RESTRICTION,
- /*priority=*/CookiePriority::COOKIE_PRIORITY_DEFAULT);
+ /*priority=*/CookiePriority::COOKIE_PRIORITY_DEFAULT,
+ /*sameparty=*/false);
return cookie;
};
diff --git a/chromium/net/cookies/cookie_inclusion_status.cc b/chromium/net/cookies/cookie_inclusion_status.cc
index 240b17cd1b0..468526f3142 100644
--- a/chromium/net/cookies/cookie_inclusion_status.cc
+++ b/chromium/net/cookies/cookie_inclusion_status.cc
@@ -226,6 +226,8 @@ std::string CookieInclusionStatus::GetDebugString() const {
base::StrAppend(&out, {"EXCLUDE_INVALID_DOMAIN, "});
if (HasExclusionReason(EXCLUDE_INVALID_PREFIX))
base::StrAppend(&out, {"EXCLUDE_INVALID_PREFIX, "});
+ if (HasExclusionReason(EXCLUDE_INVALID_SAMEPARTY))
+ base::StrAppend(&out, {"EXCLUDE_INVALID_SAMEPARTY, "});
// Add warning
if (!ShouldWarn()) {
diff --git a/chromium/net/cookies/cookie_inclusion_status.h b/chromium/net/cookies/cookie_inclusion_status.h
index 9e506b55501..4a875067ee6 100644
--- a/chromium/net/cookies/cookie_inclusion_status.h
+++ b/chromium/net/cookies/cookie_inclusion_status.h
@@ -27,29 +27,54 @@ class NET_EXPORT CookieInclusionStatus {
enum ExclusionReason {
EXCLUDE_UNKNOWN_ERROR = 0,
+ // Statuses applied when accessing a cookie (either sending or setting):
+
+ // Cookie was HttpOnly, but the attempted access was through a non-HTTP API.
EXCLUDE_HTTP_ONLY = 1,
+ // Cookie was Secure, but the URL was not allowed to access Secure cookies.
EXCLUDE_SECURE_ONLY = 2,
+ // The cookie's domain attribute did not match the domain of the URL
+ // attempting access.
EXCLUDE_DOMAIN_MISMATCH = 3,
+ // The cookie's path attribute did not match the path of the URL attempting
+ // access.
EXCLUDE_NOT_ON_PATH = 4,
+ // The cookie had SameSite=Strict, and the attempted access did not have an
+ // appropriate SameSiteCookieContext.
EXCLUDE_SAMESITE_STRICT = 5,
+ // The cookie had SameSite=Lax, and the attempted access did not have an
+ // appropriate SameSiteCookieContext.
EXCLUDE_SAMESITE_LAX = 6,
-
- // The following two are used for the SameSiteByDefaultCookies experiment,
- // where if the SameSite attribute is not specified, it will be treated as
- // SameSite=Lax by default.
+ // The cookie did not specify a SameSite attribute, and therefore was
+ // treated as if it were SameSite=Lax, and the attempted access did not have
+ // an appropriate SameSiteCookieContext.
EXCLUDE_SAMESITE_UNSPECIFIED_TREATED_AS_LAX = 7,
- // This is used if SameSite=None is specified, but the cookie is not
- // Secure.
+ // The cookie specified SameSite=None, but it was not Secure.
EXCLUDE_SAMESITE_NONE_INSECURE = 8,
+ // Caller did not allow access to the cookie.
EXCLUDE_USER_PREFERENCES = 9,
- // Statuses specific to setting cookies
+ // Statuses only applied when creating/setting cookies:
+
+ // Cookie was malformed and could not be stored.
EXCLUDE_FAILURE_TO_STORE = 10,
+ // Attempted to set a cookie from a scheme that does not support cookies.
EXCLUDE_NONCOOKIEABLE_SCHEME = 11,
+ // Cookie would have overwritten a Secure cookie, and was not allowed to do
+ // so. (See "Leave Secure Cookies Alone":
+ // https://tools.ietf.org/html/draft-west-leave-secure-cookies-alone-05 )
EXCLUDE_OVERWRITE_SECURE = 12,
+ // Cookie would have overwritten an HttpOnly cookie, and was not allowed to
+ // do so.
EXCLUDE_OVERWRITE_HTTP_ONLY = 13,
+ // Cookie was set with an invalid Domain attribute.
EXCLUDE_INVALID_DOMAIN = 14,
+ // Cookie was set with an invalid __Host- or __Secure- prefix.
EXCLUDE_INVALID_PREFIX = 15,
+ // Cookie was set with an invalid SameParty attribute in combination with
+ // other attributes. (SameParty is invalid if Secure is not present, or if
+ // SameSite=Strict is present.)
+ EXCLUDE_INVALID_SAMEPARTY = 16,
// This should be kept last.
NUM_EXCLUSION_REASONS
diff --git a/chromium/net/cookies/cookie_monster.cc b/chromium/net/cookies/cookie_monster.cc
index 140b61a81dc..77b0d86b38c 100644
--- a/chromium/net/cookies/cookie_monster.cc
+++ b/chromium/net/cookies/cookie_monster.cc
@@ -63,6 +63,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "base/trace_event/process_memory_dump.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
+#include "net/base/url_util.h"
#include "net/cookies/canonical_cookie.h"
#include "net/cookies/cookie_monster_change_dispatcher.h"
#include "net/cookies/cookie_monster_netlog_params.h"
@@ -71,6 +72,8 @@
#include "net/log/net_log.h"
#include "net/log/net_log_values.h"
#include "url/origin.h"
+#include "url/third_party/mozilla/url_parse.h"
+#include "url/url_canon.h"
using base::Time;
using base::TimeDelta;
@@ -299,16 +302,6 @@ size_t CountCookiesForPossibleDeletion(
return cookies_count;
}
-// Returns whether the CookieOptions has at least as same-site of a context as
-// |same_site_requirement|, and the options permit HttpOnly access.
-bool IsHttpSameSiteContextAtLeast(
- const CookieOptions& options,
- CookieOptions::SameSiteCookieContext::ContextType same_site_requirement) {
- return !options.exclude_httponly() &&
- options.same_site_cookie_context().GetContextForCookieInclusion() >=
- same_site_requirement;
-}
-
} // namespace
CookieMonster::CookieMonster(scoped_refptr<PersistentCookieStore> store,
@@ -570,7 +563,7 @@ void CookieMonster::AttachAccessSemanticsListForCookieList(
const CookieList& cookie_list) {
std::vector<CookieAccessSemantics> access_semantics_list;
for (const CanonicalCookie& cookie : cookie_list) {
- access_semantics_list.push_back(GetAccessSemanticsForCookieGet(cookie));
+ access_semantics_list.push_back(GetAccessSemanticsForCookie(cookie));
}
MaybeRunCookieCallback(std::move(callback), cookie_list,
access_semantics_list);
@@ -629,8 +622,7 @@ void CookieMonster::DeleteAllMatchingInfo(CookieDeletionInfo delete_info,
CanonicalCookie* cc = curit->second.get();
++it;
- if (delete_info.Matches(*cc, GetAccessSemanticsForCookie(
- *cc, false /* legacy_access_granted */))) {
+ if (delete_info.Matches(*cc, GetAccessSemanticsForCookie(*cc))) {
InternalDeleteCookie(curit, true, /*sync_to_store*/
DELETE_COOKIE_EXPLICIT);
++num_deleted;
@@ -971,7 +963,7 @@ void CookieMonster::FilterCookiesWithOptions(
// given |url|. HTTP only cookies are filtered depending on the passed
// cookie |options|.
CookieAccessResult access_result = (*it)->IncludeForRequestURL(
- url, options, GetAccessSemanticsForCookieGet(**it));
+ url, options, GetAccessSemanticsForCookie(**it));
if (!access_result.status.IsInclude()) {
if (options.return_excluded_cookies())
@@ -982,7 +974,32 @@ void CookieMonster::FilterCookiesWithOptions(
if (options.update_access_time())
InternalUpdateCookieAccessTime(*it, current_time);
- MaybeRecordCookieAccessWithOptions(**it, options, false);
+ int destination_port = url.EffectiveIntPort();
+
+ if (IsLocalhost(url)) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Cookie.Port.Read.Localhost",
+ ReducePortRangeForCookieHistogram(destination_port));
+ UMA_HISTOGRAM_ENUMERATION(
+ "Cookie.Port.ReadDiffersFromSet.Localhost",
+ IsCookieSentToSamePortThatSetIt(url, (*it)->SourcePort(),
+ (*it)->SourceScheme()));
+ } else {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Cookie.Port.Read.RemoteHost",
+ ReducePortRangeForCookieHistogram(destination_port));
+ UMA_HISTOGRAM_ENUMERATION(
+ "Cookie.Port.ReadDiffersFromSet.RemoteHost",
+ IsCookieSentToSamePortThatSetIt(url, (*it)->SourcePort(),
+ (*it)->SourceScheme()));
+ }
+
+ if ((*it)->IsDomainCookie()) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Cookie.Port.ReadDiffersFromSet.DomainSet",
+ IsCookieSentToSamePortThatSetIt(url, (*it)->SourcePort(),
+ (*it)->SourceScheme()));
+ }
included_cookies->push_back({**it, access_result});
}
@@ -1089,31 +1106,6 @@ void CookieMonster::MaybeDeleteEquivalentCookieAndUpdateStatus(
}
}
-// Find the creation time of an equivalent cookie with the same value
-// ("identical", well, modulo other attributes that don't get compared)
-// if any. This iterates through the matching range of the |cookies_| map an
-// extra time, but this is ok because it is only used if
-// RecentCreationTimeGrantsLegacyCookieSemantics is enabled.
-base::Time CookieMonster::EffectiveCreationTimeForMaybePreexistingCookie(
- const std::string& key,
- const CanonicalCookie& cookie) const {
- DCHECK(cookie_util::IsRecentCreationTimeGrantsLegacyCookieSemanticsEnabled());
- base::Time effective_creation_time = cookie.CreationDate();
- const auto range_its = cookies_.equal_range(key);
- for (auto cur_it = range_its.first; cur_it != range_its.second; ++cur_it) {
- CanonicalCookie* preexisting_maybe_identical_cookie = cur_it->second.get();
- if (cookie.IsEquivalent(*preexisting_maybe_identical_cookie)) {
- if (preexisting_maybe_identical_cookie->Value() == cookie.Value()) {
- effective_creation_time =
- preexisting_maybe_identical_cookie->CreationDate();
- }
- // There should only ever be at most one equivalent cookie in the store.
- break;
- }
- }
- return effective_creation_time;
-}
-
CookieMonster::CookieMap::iterator CookieMonster::InternalInsertCookie(
const std::string& key,
std::unique_ptr<CanonicalCookie> cc,
@@ -1187,14 +1179,8 @@ void CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc,
const std::string key(GetKey(cc->Domain()));
- cc->IsSetPermittedInContext(
- options,
- GetAccessSemanticsForCookieSet(
- *cc, options,
- cookie_util::IsRecentCreationTimeGrantsLegacyCookieSemanticsEnabled()
- ? EffectiveCreationTimeForMaybePreexistingCookie(key, *cc)
- : base::Time()),
- &access_result);
+ cc->IsSetPermittedInContext(options, GetAccessSemanticsForCookie(*cc),
+ &access_result);
base::Time creation_date = cc->CreationDate();
if (creation_date.is_null()) {
@@ -1236,8 +1222,13 @@ void CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc,
if (!already_expired) {
// See InitializeHistograms() for details.
if (cc->IsPersistent()) {
- histogram_expiration_duration_minutes_->Add(
- (cc->ExpiryDate() - creation_date).InMinutes());
+ if (cc->IsSecure()) {
+ histogram_expiration_duration_minutes_secure_->Add(
+ (cc->ExpiryDate() - creation_date).InMinutes());
+ } else {
+ histogram_expiration_duration_minutes_non_secure_->Add(
+ (cc->ExpiryDate() - creation_date).InMinutes());
+ }
}
// Histogram the type of scheme used on URLs that set cookies. This
@@ -1255,12 +1246,12 @@ void CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc,
: COOKIE_SOURCE_NONSECURE_COOKIE_NONCRYPTOGRAPHIC_SCHEME));
histogram_cookie_source_scheme_->Add(cookie_source_sample);
+ UMA_HISTOGRAM_BOOLEAN("Cookie.DomainSet", cc->IsDomainCookie());
+
if (!creation_date_to_inherit.is_null()) {
cc->SetCreationDate(creation_date_to_inherit);
}
- MaybeRecordCookieAccessWithOptions(*cc, options, true);
-
InternalInsertCookie(key, std::move(cc), true, access_result);
} else {
DVLOG(net::cookie_util::kVlogSetCookies)
@@ -1273,6 +1264,16 @@ void CookieMonster::SetCanonicalCookie(std::unique_ptr<CanonicalCookie> cc,
// that if a cookie was set, in the common case it will be used soon after,
// and we will purge the expired cookies in GetCookies().
GarbageCollect(creation_date, key);
+
+ if (IsLocalhost(source_url)) {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Cookie.Port.Set.Localhost",
+ ReducePortRangeForCookieHistogram(source_url.EffectiveIntPort()));
+ } else {
+ UMA_HISTOGRAM_ENUMERATION(
+ "Cookie.Port.Set.RemoteHost",
+ ReducePortRangeForCookieHistogram(source_url.EffectiveIntPort()));
+ }
}
// TODO(chlily): Log metrics.
@@ -1297,13 +1298,17 @@ void CookieMonster::SetAllCookies(CookieList list,
continue;
if (cookie.IsPersistent()) {
- histogram_expiration_duration_minutes_->Add(
- (cookie.ExpiryDate() - creation_time).InMinutes());
+ if (cookie.IsSecure()) {
+ histogram_expiration_duration_minutes_secure_->Add(
+ (cookie.ExpiryDate() - creation_time).InMinutes());
+ } else {
+ histogram_expiration_duration_minutes_non_secure_->Add(
+ (cookie.ExpiryDate() - creation_time).InMinutes());
+ }
}
CookieAccessResult access_result;
- access_result.access_semantics = GetAccessSemanticsForCookie(
- cookie, false /* legacy_semantics_granted */);
+ access_result.access_semantics = GetAccessSemanticsForCookie(cookie);
InternalInsertCookie(key, std::make_unique<CanonicalCookie>(cookie), true,
access_result);
GarbageCollect(creation_time, key);
@@ -1359,26 +1364,16 @@ void CookieMonster::InternalDeleteCookie(CookieMap::iterator it,
});
}
- // Skip this if the map is empty, to avoid unnecessarily constructing the
- // UniqueCookieKey.
- if (!last_http_same_site_accesses_.empty()) {
- DCHECK(cookie_util::
- IsRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsEnabled());
- last_http_same_site_accesses_.erase(it->second->UniqueKey());
- }
-
if ((cc->IsPersistent() || persist_session_cookies_) && store_.get() &&
sync_to_store) {
store_->DeleteCookie(*cc);
}
change_dispatcher_.DispatchChange(
- CookieChangeInfo(
- *cc,
- CookieAccessResult(CookieEffectiveSameSite::UNDEFINED,
- CookieInclusionStatus(),
- GetAccessSemanticsForCookie(
- *cc, false /* legacy_access_granted */)),
- mapping.cause),
+ CookieChangeInfo(*cc,
+ CookieAccessResult(CookieEffectiveSameSite::UNDEFINED,
+ CookieInclusionStatus(),
+ GetAccessSemanticsForCookie(*cc)),
+ mapping.cause),
mapping.notify);
// If this is the last cookie in |cookies_| with this key, decrement the
@@ -1728,95 +1723,12 @@ bool CookieMonster::HasCookieableScheme(const GURL& url) {
}
CookieAccessSemantics CookieMonster::GetAccessSemanticsForCookie(
- const CanonicalCookie& cookie,
- bool legacy_semantics_granted) const {
- if (legacy_semantics_granted)
- return CookieAccessSemantics::LEGACY;
+ const CanonicalCookie& cookie) const {
if (cookie_access_delegate())
return cookie_access_delegate()->GetAccessSemantics(cookie);
return CookieAccessSemantics::UNKNOWN;
}
-CookieAccessSemantics CookieMonster::GetAccessSemanticsForCookieGet(
- const CanonicalCookie& cookie) const {
- bool legacy_semantics_granted =
- cookie_util::DoesLastHttpSameSiteAccessGrantLegacySemantics(
- LastAccessFromHttpSameSiteContext(cookie)) ||
- cookie_util::DoesCreationTimeGrantLegacySemantics(cookie.CreationDate());
- return GetAccessSemanticsForCookie(cookie, legacy_semantics_granted);
-}
-
-CookieAccessSemantics CookieMonster::GetAccessSemanticsForCookieSet(
- const CanonicalCookie& cookie,
- const CookieOptions& options,
- base::Time effective_creation_time) const {
- // If the current cookie access is a set, directly treat the cookie as LEGACY
- // if the |options| qualify, because there may not be a time entry in
- // |last_http_same_site_accesses_| since it may be a new cookie without a
- // previous access. It will still only be added to the map as a qualifying
- // cookie access if the final inclusion status is include.
- bool legacy_semantics_granted =
- (cookie_util::
- IsRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsEnabled() &&
- IsHttpSameSiteContextAtLeast(
- options,
- CookieOptions::SameSiteCookieContext::ContextType::SAME_SITE_LAX));
-
- // If the current cookie access is not itself http-and-same-site, but the last
- // one that was, was recent enough, (and the corresponding feature is enabled)
- // grant legacy semantics.
- legacy_semantics_granted =
- legacy_semantics_granted ||
- cookie_util::DoesLastHttpSameSiteAccessGrantLegacySemantics(
- LastAccessFromHttpSameSiteContext(cookie));
-
- // If the cookie's creation time (or that of an identical preexisting cookie)
- // was recent enough (and the corresponding feature is enabled), grant legacy
- // semantics.
- legacy_semantics_granted = legacy_semantics_granted ||
- cookie_util::DoesCreationTimeGrantLegacySemantics(
- effective_creation_time);
-
- return GetAccessSemanticsForCookie(cookie, legacy_semantics_granted);
-}
-
-base::TimeTicks CookieMonster::LastAccessFromHttpSameSiteContext(
- const CanonicalCookie& cookie) const {
- // Return early to avoid unnecessarily constructing the UniqueCookieKey
- if (last_http_same_site_accesses_.empty()) {
- return base::TimeTicks();
- }
-
- const auto it = last_http_same_site_accesses_.find(cookie.UniqueKey());
- if (it != last_http_same_site_accesses_.end())
- return it->second;
- return base::TimeTicks();
-}
-
-void CookieMonster::MaybeRecordCookieAccessWithOptions(
- const CanonicalCookie& cookie,
- const CookieOptions& options,
- bool is_set) {
- // Don't populate |last_http_same_site_accesses_| if the relevant feature is
- // not enabled.
- if (!cookie_util::
- IsRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsEnabled()) {
- return;
- }
-
- // Don't update time for accesses that don't update access time. (E.g. the
- // time should not be updated when the cookie is accessed to populate the UI.)
- if (!options.update_access_time())
- return;
- CookieOptions::SameSiteCookieContext::ContextType same_site_requirement;
- same_site_requirement =
- is_set
- ? CookieOptions::SameSiteCookieContext::ContextType::SAME_SITE_LAX
- : CookieOptions::SameSiteCookieContext::ContextType::SAME_SITE_STRICT;
- if (IsHttpSameSiteContextAtLeast(options, same_site_requirement))
- last_http_same_site_accesses_[cookie.UniqueKey()] = base::TimeTicks::Now();
-}
-
// Test to see if stats should be recorded, and record them if so.
// The goal here is to get sampling for the average browser-hour of
// activity. We won't take samples when the web isn't being surfed,
@@ -1885,9 +1797,13 @@ void CookieMonster::InitializeHistograms() {
DCHECK(thread_checker_.CalledOnValidThread());
// From UMA_HISTOGRAM_CUSTOM_COUNTS
- histogram_expiration_duration_minutes_ = base::Histogram::FactoryGet(
- "Cookie.ExpirationDurationMinutes", 1, kMinutesInTenYears, 50,
+ histogram_expiration_duration_minutes_secure_ = base::Histogram::FactoryGet(
+ "Cookie.ExpirationDurationMinutesSecure", 1, kMinutesInTenYears, 50,
base::Histogram::kUmaTargetedHistogramFlag);
+ histogram_expiration_duration_minutes_non_secure_ =
+ base::Histogram::FactoryGet("Cookie.ExpirationDurationMinutesNonSecure",
+ 1, kMinutesInTenYears, 50,
+ base::Histogram::kUmaTargetedHistogramFlag);
histogram_count_ = base::Histogram::FactoryGet(
"Cookie.Count", 1, 4000, 50, base::Histogram::kUmaTargetedHistogramFlag);
@@ -1965,4 +1881,44 @@ void CookieMonster::DoCookieCallbackForHostOrDomain(
std::move(callback).Run();
}
+CookieMonster::CookieSentToSamePort
+CookieMonster::IsCookieSentToSamePortThatSetIt(
+ const GURL& destination,
+ int source_port,
+ CookieSourceScheme source_scheme) {
+ if (source_port == url::PORT_UNSPECIFIED)
+ return CookieSentToSamePort::kSourcePortUnspecified;
+
+ if (source_port == url::PORT_INVALID)
+ return CookieSentToSamePort::kInvalid;
+
+ int destination_port = destination.EffectiveIntPort();
+ if (source_port == destination_port)
+ return CookieSentToSamePort::kYes;
+
+ const std::string& destination_scheme = destination.scheme();
+ bool destination_port_is_default =
+ url::DefaultPortForScheme(destination_scheme.c_str(),
+ destination_scheme.length()) ==
+ destination_port;
+
+ // Since the source port has to be specified if we got to this point, that
+ // means this is a newer cookie that therefore has its scheme set as well.
+ DCHECK(source_scheme != CookieSourceScheme::kUnset);
+ std::string source_scheme_string =
+ source_scheme == CookieSourceScheme::kSecure
+ ? url::kHttpsScheme
+ : url::kHttpScheme; // wss/ws have the same default port values as
+ // https/http, so it's ok that we use these.
+
+ bool source_port_is_default =
+ url::DefaultPortForScheme(source_scheme_string.c_str(),
+ source_scheme_string.length()) == source_port;
+
+ if (destination_port_is_default && source_port_is_default)
+ return CookieSentToSamePort::kNoButDefault;
+
+ return CookieSentToSamePort::kNo;
+}
+
} // namespace net
diff --git a/chromium/net/cookies/cookie_monster.h b/chromium/net/cookies/cookie_monster.h
index 57ce9d640ac..1c798ba1c78 100644
--- a/chromium/net/cookies/cookie_monster.h
+++ b/chromium/net/cookies/cookie_monster.h
@@ -237,6 +237,11 @@ class NET_EXPORT CookieMonster : public CookieStore {
FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest,
CookieDeleteEquivalentHistogramTest);
+ // For CookieSentToSamePort enum.
+ FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest,
+ CookiePortReadDiffersFromSetHistogram);
+ FRIEND_TEST_ALL_PREFIXES(CookieMonsterTest, IsCookieSentToSamePortThatSetIt);
+
// Internal reasons for deletion, used to populate informative histograms
// and to provide a public cause for onCookieChange notifications.
//
@@ -310,6 +315,28 @@ class NET_EXPORT CookieMonster : public CookieStore {
COOKIE_SOURCE_LAST_ENTRY
};
+ // Enum for collecting metrics on how frequently a cookie is sent to the same
+ // port it was set by.
+ //
+ // kNoButDefault exists because we expect for cookies being sent between
+ // schemes to have a port mismatch and want to separate those out from other,
+ // more interesting, cases.
+ //
+ // Do not reorder or renumber. Used for metrics.
+ enum class CookieSentToSamePort {
+ kSourcePortUnspecified = 0, // Cookie's source port is unspecified, we
+ // can't know if this is the same port or not.
+ kInvalid = 1, // The source port was corrupted to be PORT_INVALID, we
+ // can't know if this is the same port or not.
+ kNo = 2, // Source port and destination port are different.
+ kNoButDefault =
+ 3, // Source and destination ports are different but they're
+ // the defaults for their scheme. This can mean that an http
+ // cookie was sent to a https origin or vice-versa.
+ kYes = 4, // They're the same.
+ kMaxValue = kYes
+ };
+
// Record statistics every kRecordStatisticsIntervalSeconds of uptime.
static const int kRecordStatisticsIntervalSeconds = 10 * 60;
@@ -438,14 +465,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
base::Time* creation_date_to_inherit,
CookieInclusionStatus* status);
- // This is only used if the RecentCreationTimeGrantsLegacyCookieSemantics
- // feature is enabled. It finds an equivalent cookie (based on name, domain,
- // path) with the same value, if there is any, and returns its creation time,
- // or the creation time of the |cookie| itself, if there is none.
- base::Time EffectiveCreationTimeForMaybePreexistingCookie(
- const std::string& key,
- const CanonicalCookie& cookie) const;
-
// Inserts |cc| into cookies_. Returns an iterator that points to the inserted
// cookie in cookies_. Guarantee: all iterators to cookies_ remain valid.
CookieMap::iterator InternalInsertCookie(
@@ -522,50 +541,12 @@ class NET_EXPORT CookieMonster : public CookieStore {
bool HasCookieableScheme(const GURL& url);
- // Get the cookie's access semantics (LEGACY or NONLEGACY), considering any
- // features granting legacy semantics for special conditions (if any are
- // active and meet the conditions for granting legacy access, pass true for
- // |legacy_semantics_granted|). If none are active, this then checks for a
+ // Get the cookie's access semantics (LEGACY or NONLEGACY), by checking for a
// value from the cookie access delegate, if it is non-null. Otherwise returns
// UNKNOWN.
CookieAccessSemantics GetAccessSemanticsForCookie(
- const CanonicalCookie& cookie,
- bool legacy_semantics_granted) const;
-
- // This is called for getting a cookie.
- CookieAccessSemantics GetAccessSemanticsForCookieGet(
- const CanonicalCookie& cookie) const;
-
- // This is called for setting a cookie with the options specified by
- // |options|. For setting a cookie, a same-site access is lax or better (since
- // CookieOptions for setting a cookie will never be strict).
- // |effective_creation_time| is the time that should be used for deciding
- // whether the RecentCreationTimeGrantsLegacyCookieSemantics feature should
- // grant legacy semantics. This may differ from the CreationDate() field of
- // the cookie, if there was a preexisting equivalent cookie (in which case it
- // is the creation time of that equivalent cookie).
- CookieAccessSemantics GetAccessSemanticsForCookieSet(
- const CanonicalCookie& cookie,
- const CookieOptions& options,
- base::Time effective_creation_time) const;
-
- // Looks up the last time a cookie matching the (name, domain, path) of
- // |cookie| was accessed in a same-site context permitting HttpOnly
- // cookie access. If there was none, this returns a null base::Time.
- // Returns null value if RecentHttpSameSiteAccessGrantsLegacyCookieSemantics
- // is not enabled.
- base::TimeTicks LastAccessFromHttpSameSiteContext(
const CanonicalCookie& cookie) const;
- // Updates |last_http_same_site_accesses_| with the current time if the
- // |options| are appropriate (same-site and permits HttpOnly access).
- // |is_set| is true if the access is setting the cookie, false otherwise (e.g.
- // if getting the cookie). Does nothing if
- // RecentHttpSameSiteAccessGrantsLegacyCookieSemantics is not enabled.
- void MaybeRecordCookieAccessWithOptions(const CanonicalCookie& cookie,
- const CookieOptions& options,
- bool is_set);
-
// Statistics support
// This function should be called repeatedly, and will record
@@ -594,9 +575,20 @@ class NET_EXPORT CookieMonster : public CookieStore {
void DoCookieCallbackForHostOrDomain(base::OnceClosure callback,
base::StringPiece host_or_domain);
+ // Checks to see if a cookie is being sent to the same port it was set by. For
+ // metrics.
+ //
+ // This is in CookieMonster because only CookieMonster uses it. It's otherwise
+ // a standalone utility function.
+ static CookieSentToSamePort IsCookieSentToSamePortThatSetIt(
+ const GURL& destination,
+ int source_port,
+ CookieSourceScheme source_scheme);
+
// Histogram variables; see CookieMonster::InitializeHistograms() in
// cookie_monster.cc for details.
- base::HistogramBase* histogram_expiration_duration_minutes_;
+ base::HistogramBase* histogram_expiration_duration_minutes_secure_;
+ base::HistogramBase* histogram_expiration_duration_minutes_non_secure_;
base::HistogramBase* histogram_count_;
base::HistogramBase* histogram_cookie_type_;
base::HistogramBase* histogram_cookie_source_scheme_;
@@ -662,17 +654,6 @@ class NET_EXPORT CookieMonster : public CookieStore {
// wanted. Thus this value is not initialized.
base::Time earliest_access_time_;
- // Records the last access to a cookie (either getting or setting) from a
- // context that is both same-site and permits HttpOnly access.
- // The access is considered same-site if it is at least laxly same-site for
- // set, or strictly same-site for get.
- // This information is used to determine if the feature
- // kRecentSameSiteAccessGrantsLegacyCookieSemantics should grant legacy
- // access semantics to a cookie for subsequent accesses.
- // This map is not used if that feature is not enabled.
- std::map<CanonicalCookie::UniqueCookieKey, base::TimeTicks>
- last_http_same_site_accesses_;
-
std::vector<std::string> cookieable_schemes_;
base::Time last_statistic_record_time_;
diff --git a/chromium/net/cookies/cookie_monster_netlog_params.cc b/chromium/net/cookies/cookie_monster_netlog_params.cc
index 89b38d4170d..fad5f472ee6 100644
--- a/chromium/net/cookies/cookie_monster_netlog_params.cc
+++ b/chromium/net/cookies/cookie_monster_netlog_params.cc
@@ -32,6 +32,7 @@ base::Value NetLogCookieMonsterCookieAdded(const CanonicalCookie* cookie,
dict.SetStringKey("same_site", CookieSameSiteToString(cookie->SameSite()));
dict.SetBoolKey("is_persistent", cookie->IsPersistent());
dict.SetBoolKey("sync_requested", sync_requested);
+ dict.SetBoolKey("same_party", cookie->IsSameParty());
return dict;
}
diff --git a/chromium/net/cookies/cookie_monster_store_test.cc b/chromium/net/cookies/cookie_monster_store_test.cc
index b50d1b074f1..f37b1a2cd8f 100644
--- a/chromium/net/cookies/cookie_monster_store_test.cc
+++ b/chromium/net/cookies/cookie_monster_store_test.cc
@@ -122,7 +122,7 @@ std::unique_ptr<CanonicalCookie> BuildCanonicalCookie(
return std::make_unique<CanonicalCookie>(
pc.Name(), pc.Value(), "." + url.host(), cookie_path, creation_time,
cookie_expires, base::Time(), pc.IsSecure(), pc.IsHttpOnly(),
- pc.SameSite(), pc.Priority());
+ pc.SameSite(), pc.Priority(), pc.IsSameParty());
}
void AddCookieToList(const GURL& url,
@@ -236,7 +236,7 @@ std::unique_ptr<CookieMonster> CreateMonsterFromStoreForGC(
std::unique_ptr<CanonicalCookie> cc(std::make_unique<CanonicalCookie>(
"a", "1", base::StringPrintf("h%05d.izzle", i), "/path", creation_time,
expiration_time, base::Time(), secure, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
cc->SetLastAccessDate(last_access_time);
store->AddCookie(*cc);
}
diff --git a/chromium/net/cookies/cookie_monster_unittest.cc b/chromium/net/cookies/cookie_monster_unittest.cc
index a4b72d59e64..01ee039244e 100644
--- a/chromium/net/cookies/cookie_monster_unittest.cc
+++ b/chromium/net/cookies/cookie_monster_unittest.cc
@@ -11,7 +11,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/containers/queue.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
@@ -26,7 +26,7 @@
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/stringprintf.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/test/scoped_feature_list.h"
@@ -51,6 +51,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+#include "url/third_party/mozilla/url_parse.h"
#include "url/url_constants.h"
namespace net {
@@ -59,11 +60,6 @@ using base::Time;
using base::TimeDelta;
using CookieDeletionInfo = net::CookieDeletionInfo;
using features::kCookiesWithoutSameSiteMustBeSecure;
-using features::kRecentCreationTimeGrantsLegacyCookieSemantics;
-using features::kRecentCreationTimeGrantsLegacyCookieSemanticsMilliseconds;
-using features::kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics;
-using features::
- kRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsMilliseconds;
using features::kSameSiteByDefaultCookies;
namespace {
@@ -214,71 +210,71 @@ class CookieMonsterTestBase : public CookieStoreTest<T> {
cookies.push_back(std::make_unique<CanonicalCookie>(
"dom_1", "A", ".harvard.edu", "/", base::Time(), base::Time(),
base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(std::make_unique<CanonicalCookie>(
"dom_2", "B", ".math.harvard.edu", "/", base::Time(), base::Time(),
base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(std::make_unique<CanonicalCookie>(
"dom_3", "C", ".bourbaki.math.harvard.edu", "/", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// Host cookies
cookies.push_back(std::make_unique<CanonicalCookie>(
"host_1", "A", url_top_level_domain_plus_1, "/", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(std::make_unique<CanonicalCookie>(
"host_2", "B", url_top_level_domain_plus_2, "/", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(std::make_unique<CanonicalCookie>(
"host_3", "C", url_top_level_domain_plus_3, "/", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// http_only cookie
cookies.push_back(std::make_unique<CanonicalCookie>(
"httpo_check", "A", url_top_level_domain_plus_2, "/", base::Time(),
base::Time(), base::Time(), false, true, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// same-site cookie
cookies.push_back(std::make_unique<CanonicalCookie>(
"firstp_check", "A", url_top_level_domain_plus_2, "/", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::STRICT_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// Secure cookies
cookies.push_back(std::make_unique<CanonicalCookie>(
"sec_dom", "A", ".math.harvard.edu", "/", base::Time(), base::Time(),
base::Time(), true, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(std::make_unique<CanonicalCookie>(
"sec_host", "B", url_top_level_domain_plus_2, "/", base::Time(),
base::Time(), base::Time(), true, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// Domain path cookies
cookies.push_back(std::make_unique<CanonicalCookie>(
"dom_path_1", "A", ".math.harvard.edu", "/dir1", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(std::make_unique<CanonicalCookie>(
"dom_path_2", "B", ".math.harvard.edu", "/dir1/dir2", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// Host path cookies
cookies.push_back(std::make_unique<CanonicalCookie>(
"host_path_1", "A", url_top_level_domain_plus_2, "/dir1", base::Time(),
base::Time(), base::Time(), false, false, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(std::make_unique<CanonicalCookie>(
"host_path_2", "B", url_top_level_domain_plus_2, "/dir1/dir2",
base::Time(), base::Time(), base::Time(), false, false,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT, false));
for (auto& cookie : cookies) {
GURL source_url = cookie_util::SimulatedCookieSource(
@@ -838,7 +834,7 @@ class CookieMonsterTestBase : public CookieStoreTest<T> {
creation_time, base::Time() /* expiration_time */,
creation_time /* last_access */, true /* secure */,
false /* http_only */, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */));
GURL source_url = cookie_util::SimulatedCookieSource(*cc, "https");
cm->SetCanonicalCookieAsync(std::move(cc), source_url,
CookieOptions::MakeAllInclusive(),
@@ -879,6 +875,7 @@ struct CookiesInputInfo {
bool http_only;
CookieSameSite same_site;
CookiePriority priority;
+ bool same_party;
};
} // namespace
@@ -1014,11 +1011,11 @@ TEST_F(DeferredCookieTaskTest, DeferredSetAllCookies) {
list.push_back(CanonicalCookie("A", "B", "." + http_www_foo_.domain(), "/",
base::Time::Now(), base::Time(), base::Time(),
false, true, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
list.push_back(CanonicalCookie("C", "D", "." + http_www_foo_.domain(), "/",
base::Time::Now(), base::Time(), base::Time(),
false, true, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
ResultSavingCookieCallback<CookieAccessResult> call1;
cookie_monster_->SetAllCookiesAsync(list, call1.MakeCallback());
@@ -1996,13 +1993,13 @@ TEST_F(CookieMonsterTest, BackingStoreCommunication) {
const CookiesInputInfo input_info[] = {
{GURL("https://a.b.foo.com"), "a", "1", "a.b.foo.com", "/path/to/cookie",
expires, true /* secure */, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT},
+ COOKIE_PRIORITY_DEFAULT, false},
{GURL("https://www.foo.com"), "b", "2", ".foo.com", "/path/from/cookie",
expires + TimeDelta::FromSeconds(10), true, true,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT},
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, true},
{GURL("https://foo.com"), "c", "3", "foo.com", "/another/path/to/cookie",
base::Time::Now() + base::TimeDelta::FromSeconds(100), false, false,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT}};
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false}};
const int INPUT_DELETE = 1;
// Create new cookies and flush them to the store.
@@ -2015,7 +2012,8 @@ TEST_F(CookieMonsterTest, BackingStoreCommunication) {
std::make_unique<CanonicalCookie>(
cookie.name, cookie.value, cookie.domain, cookie.path,
base::Time(), cookie.expiration_time, base::Time(), cookie.secure,
- cookie.http_only, cookie.same_site, cookie.priority),
+ cookie.http_only, cookie.same_site, cookie.priority,
+ cookie.same_party),
cookie.url, true /*modify_httponly*/));
}
@@ -2468,15 +2466,15 @@ TEST_F(CookieMonsterTest, SetAllCookies) {
list.push_back(CanonicalCookie(
"A", "B", "." + http_www_foo_.url().host(), "/", base::Time::Now(),
base::Time(), base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
list.push_back(CanonicalCookie(
"W", "X", "." + http_www_foo_.url().host(), "/bar", base::Time::Now(),
base::Time(), base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
list.push_back(CanonicalCookie(
"Y", "Z", "." + http_www_foo_.url().host(), "/", base::Time::Now(),
base::Time(), base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// SetAllCookies must not flush.
ASSERT_EQ(0, store->flush_count());
@@ -2551,7 +2549,7 @@ TEST_F(CookieMonsterTest, HistogramCheck) {
// since the histogram should have been initialized by the CM construction
// above.
base::HistogramBase* expired_histogram = base::Histogram::FactoryGet(
- "Cookie.ExpirationDurationMinutes", 1, 10 * 365 * 24 * 60, 50,
+ "Cookie.ExpirationDurationMinutesSecure", 1, 10 * 365 * 24 * 60, 50,
base::Histogram::kUmaTargetedHistogramFlag);
std::unique_ptr<base::HistogramSamples> samples1(
@@ -2559,7 +2557,7 @@ TEST_F(CookieMonsterTest, HistogramCheck) {
auto cookie = std::make_unique<CanonicalCookie>(
"a", "b", "a.url", "/", base::Time(),
base::Time::Now() + base::TimeDelta::FromMinutes(59), base::Time(), true,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
GURL source_url = cookie_util::SimulatedCookieSource(*cookie, "https");
ASSERT_TRUE(SetCanonicalCookie(cm.get(), std::move(cookie), source_url,
true /*modify_httponly*/));
@@ -2687,7 +2685,7 @@ TEST_F(CookieMonsterTest, ControlCharacterPurge) {
"\x05"
"boo",
"." + domain, path, now2, later, base::Time(), false, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
initial_cookies.push_back(std::move(cc));
AddCookieToList(url, "hello=world; path=" + path, now3, &initial_cookies);
@@ -4023,59 +4021,26 @@ class CookieMonsterLegacyCookieAccessTest : public CookieMonsterTest {
~CookieMonsterLegacyCookieAccessTest() override {}
- // The third parameter is nullopt if
- // kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics is not enabled.
- // Otherwise it gives the value of the corresponding parameter.
- // Similarly for the fourth parameter, which is for
- // kRecentCreationTimeGrantsLegacyCookieSemantics.
- void SetFeatures(
- bool is_same_site_by_default_cookies_enabled,
- bool is_cookies_without_samesite_must_be_secure_enabled,
- base::Optional<int>
- milliseconds_for_http_same_site_access_grants_legacy_semantics,
- base::Optional<int>
- milliseconds_for_creation_time_grants_legacy_semantics) {
+ void SetFeatures(bool is_same_site_by_default_cookies_enabled,
+ bool is_cookies_without_samesite_must_be_secure_enabled) {
feature_list_ = std::make_unique<base::test::ScopedFeatureList>();
- std::vector<base::test::ScopedFeatureList::FeatureAndParams> enabled;
+ std::vector<base::Feature> enabled;
std::vector<base::Feature> disabled;
if (is_same_site_by_default_cookies_enabled) {
- enabled.push_back({kSameSiteByDefaultCookies, {}});
+ enabled.push_back(kSameSiteByDefaultCookies);
} else {
disabled.push_back(kSameSiteByDefaultCookies);
}
if (is_cookies_without_samesite_must_be_secure_enabled) {
- enabled.push_back({kCookiesWithoutSameSiteMustBeSecure, {}});
+ enabled.push_back(kCookiesWithoutSameSiteMustBeSecure);
} else {
disabled.push_back(kCookiesWithoutSameSiteMustBeSecure);
}
- if (milliseconds_for_http_same_site_access_grants_legacy_semantics) {
- enabled.push_back(
- {kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics,
- {{kRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsMilliseconds
- .name,
- base::NumberToString(
- milliseconds_for_http_same_site_access_grants_legacy_semantics
- .value())}}});
- } else {
- disabled.push_back(kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics);
- }
-
- if (milliseconds_for_creation_time_grants_legacy_semantics) {
- enabled.push_back(
- {kRecentCreationTimeGrantsLegacyCookieSemantics,
- {{kRecentCreationTimeGrantsLegacyCookieSemanticsMilliseconds.name,
- base::NumberToString(
- milliseconds_for_creation_time_grants_legacy_semantics
- .value())}}});
- } else {
- disabled.push_back(kRecentCreationTimeGrantsLegacyCookieSemantics);
- }
-
- feature_list_->InitWithFeaturesAndParameters(enabled, disabled);
+ feature_list_->InitWithFeatures(enabled, disabled);
}
protected:
@@ -4091,7 +4056,7 @@ class CookieMonsterLegacyCookieAccessTest : public CookieMonsterTest {
};
TEST_F(CookieMonsterLegacyCookieAccessTest, SetLegacyNoSameSiteCookie) {
- SetFeatures(true, true, base::nullopt, base::nullopt);
+ SetFeatures(true, true);
// Check that setting unspecified-SameSite cookie from cross-site context
// fails if not set to Legacy semantics, but succeeds if set to legacy.
EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie=chocolate_chip",
@@ -4113,13 +4078,13 @@ TEST_F(CookieMonsterLegacyCookieAccessTest, SetLegacyNoSameSiteCookie) {
TEST_F(CookieMonsterLegacyCookieAccessTest, GetLegacyNoSameSiteCookie) {
// Set an unspecified-SameSite cookie with SameSite features turned off.
// Getting the cookie will succeed.
- SetFeatures(false, false, base::nullopt, base::nullopt);
+ SetFeatures(false, false);
ASSERT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie=chocolate_chip",
CookieOptions()));
EXPECT_EQ("cookie=chocolate_chip",
GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
// Turn on the features. Now getting the cookie fails.
- SetFeatures(true, true, base::nullopt, base::nullopt);
+ SetFeatures(true, true);
access_delegate_->SetExpectationForCookieDomain(
kDomain, CookieAccessSemantics::UNKNOWN);
EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
@@ -4135,7 +4100,7 @@ TEST_F(CookieMonsterLegacyCookieAccessTest, GetLegacyNoSameSiteCookie) {
TEST_F(CookieMonsterLegacyCookieAccessTest,
SetLegacySameSiteNoneInsecureCookie) {
- SetFeatures(true, true, base::nullopt, base::nullopt);
+ SetFeatures(true, true);
access_delegate_->SetExpectationForCookieDomain(
kDomain, CookieAccessSemantics::UNKNOWN);
EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpsUrl,
@@ -4160,14 +4125,14 @@ TEST_F(CookieMonsterLegacyCookieAccessTest,
GetLegacySameSiteNoneInsecureCookie) {
// Set an SameSite=None insecure cookie with SameSite features turned off.
// Getting the cookie will succeed.
- SetFeatures(false, false, base::nullopt, base::nullopt);
+ SetFeatures(false, false);
ASSERT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl,
"cookie=oatmeal_raisin; SameSite=None",
CookieOptions()));
EXPECT_EQ("cookie=oatmeal_raisin",
GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
// Turn on the features. Now getting the cookie fails.
- SetFeatures(true, true, base::nullopt, base::nullopt);
+ SetFeatures(true, true);
access_delegate_->SetExpectationForCookieDomain(
kDomain, CookieAccessSemantics::UNKNOWN);
EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
@@ -4183,7 +4148,7 @@ TEST_F(CookieMonsterLegacyCookieAccessTest,
TEST_F(CookieMonsterLegacyCookieAccessTest, NonlegacyCookie) {
// Nonlegacy cookie will have default as Lax.
- SetFeatures(false, false, base::nullopt, base::nullopt);
+ SetFeatures(false, false);
access_delegate_->SetExpectationForCookieDomain(
kDomain, CookieAccessSemantics::NONLEGACY);
EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie=chocolate_chip",
@@ -4198,164 +4163,311 @@ TEST_F(CookieMonsterLegacyCookieAccessTest, NonlegacyCookie) {
GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
}
-// Test the RecentHttpSameSiteAccessGrantsLegacyCookieSemantics feature.
-TEST_F(CookieMonsterLegacyCookieAccessTest, RecentHttpSameSiteAccess) {
- SetFeatures(true, true, 100, base::nullopt);
- // This feature overrides the CookieAccessDelegate setting.
- access_delegate_->SetExpectationForCookieDomain(
- kDomain, CookieAccessSemantics::NONLEGACY);
+TEST_F(CookieMonsterTest, IsCookieSentToSamePortThatSetIt) {
+ // Note: `IsCookieSentToSamePortThatSetIt()` only uses the source_scheme if
+ // the port is valid, specified, and doesn't match the url's port. So for test
+ // cases where the above aren't true the value of source_scheme is irreleant.
+
+ // Test unspecified.
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("https://foo.com"), url::PORT_UNSPECIFIED,
+ CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kSourcePortUnspecified);
+
+ // Test invalid.
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("https://foo.com"), url::PORT_INVALID,
+ CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kInvalid);
+
+ // Test same.
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("https://foo.com"), 443, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kYes);
+
+ ASSERT_EQ(
+ CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("https://foo.com:1234"), 1234, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kYes);
+
+ // Test different but default.
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("https://foo.com"), 80, CookieSourceScheme::kNonSecure),
+ CookieMonster::CookieSentToSamePort::kNoButDefault);
+
+ ASSERT_EQ(
+ CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("https://foo.com:443"), 80, CookieSourceScheme::kNonSecure),
+ CookieMonster::CookieSentToSamePort::kNoButDefault);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("wss://foo.com"), 80, CookieSourceScheme::kNonSecure),
+ CookieMonster::CookieSentToSamePort::kNoButDefault);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("http://foo.com"), 443, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kNoButDefault);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("ws://foo.com"), 443, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kNoButDefault);
+
+ // Test different.
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("http://foo.com:9000"), 85, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kNo);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("https://foo.com"), 80, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kNo);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("wss://foo.com"), 80, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kNo);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("http://foo.com"), 443, CookieSourceScheme::kNonSecure),
+ CookieMonster::CookieSentToSamePort::kNo);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("ws://foo.com"), 443, CookieSourceScheme::kNonSecure),
+ CookieMonster::CookieSentToSamePort::kNo);
+
+ ASSERT_EQ(CookieMonster::IsCookieSentToSamePortThatSetIt(
+ GURL("http://foo.com:444"), 443, CookieSourceScheme::kSecure),
+ CookieMonster::CookieSentToSamePort::kNo);
+}
- // Set a cookie from a qualifying (HTTP and same-site) context.
- CookieOptions http_lax_options;
- http_lax_options.set_include_httponly();
- http_lax_options.set_same_site_cookie_context(
- CookieOptions::SameSiteCookieContext(
- CookieOptions::SameSiteCookieContext::ContextType::SAME_SITE_LAX));
- // This one only works because it's treated as Legacy, otherwise it would be
- // rejected for being SameSite=None without secure.
- EXPECT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie=1;SameSite=None",
- http_lax_options));
- // Subsequently getting the cookie from a cross-site context also works
- // because we just accessed it in an eligible context.
- EXPECT_EQ("cookie=1",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // This one should work regardless.
- EXPECT_TRUE(
- CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie=2", http_lax_options));
- // Subsequently getting the cookie from a cross-site context works even though
- // it defaults to Lax, because we just accessed it in an eligible context.
- EXPECT_EQ("cookie=2",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // After some delay less than the recency threshold, we can still get the
- // cookie from a cross-site context because the last eligible access was
- // recent enough.
- task_environment_->FastForwardBy(TimeDelta::FromMilliseconds(90));
- EXPECT_EQ("cookie=2",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // After a further delay that passes the recency threshold, we can no longer
- // get the cookie from a cross-site context.
- // Notably, the last access didn't reset the timer because it wasn't a
- // same-site access.
- task_environment_->FastForwardBy(TimeDelta::FromMilliseconds(20));
- EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
+TEST_F(CookieMonsterTest, CookieDomainSetHistogram) {
+ base::HistogramTester histograms;
+ const char kHistogramName[] = "Cookie.DomainSet";
- // Deleting the cookie clears the last access time.
- DeleteAll(cm_.get());
+ scoped_refptr<MockPersistentCookieStore> store(new MockPersistentCookieStore);
+ std::unique_ptr<CookieMonster> cm(new CookieMonster(store.get(), &net_log_));
- // Set a cookie from a same-site but not Http context. This should work
- // because it's same-site, but does not activate the feature because it isn't
- // http.
- CookieOptions exclude_http_lax_options;
- exclude_http_lax_options.set_exclude_httponly();
- exclude_http_lax_options.set_same_site_cookie_context(
- CookieOptions::SameSiteCookieContext(
- CookieOptions::SameSiteCookieContext::ContextType::SAME_SITE_LAX));
- EXPECT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie=1",
- exclude_http_lax_options));
- // There is no recent eligible last access time, because we deleted the
- // cookie and subsequently re-set it from a non-eligible context.
- EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // Accessing it from a laxly same-site context works (because the cookie
- // defaults to lax).
- EXPECT_EQ("cookie=1",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, http_lax_options));
- // However that doesn't count as a recent http same-site access because it was
- // only laxly (not strictly) same-site, so getting the cookie from a
- // cross-site context does not currently work.
- EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // Attempting to set a cookie (unsuccessfully) from an eligible context does
- // not count.
- CookieOptions http_strict_options;
- http_strict_options.set_include_httponly();
- http_strict_options.set_same_site_cookie_context(
- CookieOptions::SameSiteCookieContext(
- CookieOptions::SameSiteCookieContext::ContextType::SAME_SITE_STRICT));
- EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie=2;Secure",
- http_strict_options));
- EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // Now get the cookie from an eligible, Http and strictly same-site context.
- EXPECT_EQ("cookie=1",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, http_strict_options));
- // Subsequently getting the cookie from a cross-site context also works
- // because we just accessed it in an eligible context.
- EXPECT_EQ("cookie=1",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // After some delay less than the recency threshold, we can still get the
- // cookie from a cross-site context because the last eligible access was
- // recent enough.
- task_environment_->FastForwardBy(TimeDelta::FromMilliseconds(90));
- EXPECT_EQ("cookie=1",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // After a further delay that passes the recency threshold, we can no longer
- // get the cookie from a cross-site context.
- // Notably, the last access didn't reset the timer because it wasn't a
- // same-site access.
- task_environment_->FastForwardBy(TimeDelta::FromMilliseconds(20));
- EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
+ histograms.ExpectTotalCount(kHistogramName, 0);
+
+ // Set a host only cookie (non-Domain).
+ EXPECT_TRUE(SetCookie(cm.get(), https_www_foo_.url(), "A=B"));
+ histograms.ExpectTotalCount(kHistogramName, 1);
+ histograms.ExpectBucketCount(kHistogramName, false, 1);
+
+ // Set a domain cookie.
+ EXPECT_TRUE(SetCookie(cm.get(), https_www_foo_.url(),
+ "A=B; Domain=" + https_www_foo_.host()));
+ histograms.ExpectTotalCount(kHistogramName, 2);
+ histograms.ExpectBucketCount(kHistogramName, true, 1);
+
+ // Invalid cookies don't count toward the histogram.
+ EXPECT_FALSE(
+ SetCookie(cm.get(), https_www_foo_.url(), "A=B; Domain=other.com"));
+ histograms.ExpectTotalCount(kHistogramName, 2);
+ histograms.ExpectBucketCount(kHistogramName, false, 1);
}
-// Test the RecentCreationTimeGrantsLegacyCookieSemantics feature.
-TEST_F(CookieMonsterLegacyCookieAccessTest, RecentCreationTime) {
- SetFeatures(true, true, base::nullopt, 100);
- // This feature overrides the CookieAccessDelegate setting.
- access_delegate_->SetExpectationForCookieDomain(
- kDomain, CookieAccessSemantics::NONLEGACY);
+TEST_F(CookieMonsterTest, CookiePortReadHistogram) {
+ base::HistogramTester histograms;
+ const char kHistogramName[] = "Cookie.Port.Read.RemoteHost";
+ const char kHistogramNameLocal[] = "Cookie.Port.Read.Localhost";
- // While the grace period is active, even if the delegate returns NONLEGACY
- // semantics, we are able to set unspecified-SameSite cookies from a
- // cross-site context, and we are allowed to set SameSite=None cookies without
- // Secure. We are also allowed to get such cookies.
- EXPECT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie1=chocolate_chip",
- CookieOptions()));
- EXPECT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl,
- "cookie2=oatmeal_raisin; SameSite=None",
- CookieOptions()));
- EXPECT_EQ("cookie1=chocolate_chip; cookie2=oatmeal_raisin",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
+ scoped_refptr<MockPersistentCookieStore> store(new MockPersistentCookieStore);
+ std::unique_ptr<CookieMonster> cm(new CookieMonster(store.get(), &net_log_));
- // After some time passes, but we are still under the time threshold,
- // the cookie is still accessible in a cross-site context.
- task_environment_->FastForwardBy(TimeDelta::FromMilliseconds(90));
- EXPECT_EQ("cookie1=chocolate_chip; cookie2=oatmeal_raisin",
- GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
- // After the grace period expires, these cookies are now blocked.
- task_environment_->FastForwardBy(TimeDelta::FromMilliseconds(20));
- EXPECT_EQ("", GetCookiesWithOptions(cm_.get(), kHttpUrl, CookieOptions()));
+ histograms.ExpectTotalCount(kHistogramName, 0);
- // Also, now that there is a preexisting cookie in the store that's older than
- // the grace period, the same cookie will not be granted legacy semantics
- // again because the creation date of the preexisting identical cookie is
- // inherited. (This disallows refreshing the grace period by repeatedly
- // setting an identical cookie.)
- EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie1=chocolate_chip",
- CookieOptions()));
- EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpUrl,
- "cookie2=oatmeal_raisin; SameSite=None",
- CookieOptions()));
- // However, an equivalent (but not identical) cookie can still be set with
- // legacy semantics, because now the creation date isn't inherited from the
- // preexisting cookie.
- // TODO(chlily): It might not actually make sense to allow this... This could
- // in effect allow repeatedly refreshing the grace period by setting a cookie
- // with a different value and then immediately setting it back to the original
- // value.
- EXPECT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie1=snickerdoodle",
- CookieOptions()));
- EXPECT_TRUE(CreateAndSetCookie(cm_.get(), kHttpUrl,
- "cookie2=gingerbread; SameSite=None",
- CookieOptions()));
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://www.foo.com"), "A=B"));
- // Test the behavior when the time threshold is 0 (the default value).
- SetFeatures(true, true, base::nullopt, 0);
- // No legacy behavior is used if there is no active, non-zero grace period.
- // In particular, if there is a zero grace period, we don't allow setting the
- // cookie even if it was created at the very instant it was attempted to be
- // set.
- EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpUrl, "cookie1=chocolate_chip",
- CookieOptions()));
- EXPECT_FALSE(CreateAndSetCookie(cm_.get(), kHttpUrl,
- "cookie2=oatmeal_raisin; SameSite=None",
- CookieOptions()));
+ // May as well check that it didn't change the histogram...
+ histograms.ExpectTotalCount(kHistogramName, 0);
+
+ // Now read it from some different ports. This requires some knowledge of how
+ // `ReducePortRangeForCookieHistogram` maps ports, but that's probably fine.
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.foo.com")), "A=B");
+ // https default is 443, so check that.
+ histograms.ExpectTotalCount(kHistogramName, 1);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(443), 1);
+
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.foo.com:82")), "A=B");
+ histograms.ExpectTotalCount(kHistogramName, 2);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(82), 1);
+
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.foo.com:8080")), "A=B");
+ histograms.ExpectTotalCount(kHistogramName, 3);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(8080), 1);
+
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.foo.com:1234")), "A=B");
+ histograms.ExpectTotalCount(kHistogramName, 4);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(1234), 1);
+
+ // Histogram should not increment if nothing is read.
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.other.com")), "");
+ histograms.ExpectTotalCount(kHistogramName, 4);
+
+ // Make sure the correct histogram is chosen for localhost.
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://localhost"), "local=host"));
+
+ histograms.ExpectTotalCount(kHistogramNameLocal, 0);
+
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://localhost:82")), "local=host");
+ histograms.ExpectTotalCount(kHistogramNameLocal, 1);
+ histograms.ExpectBucketCount(kHistogramNameLocal,
+ ReducePortRangeForCookieHistogram(82), 1);
+}
+
+TEST_F(CookieMonsterTest, CookiePortSetHistogram) {
+ base::HistogramTester histograms;
+ const char kHistogramName[] = "Cookie.Port.Set.RemoteHost";
+ const char kHistogramNameLocal[] = "Cookie.Port.Set.Localhost";
+
+ scoped_refptr<MockPersistentCookieStore> store(new MockPersistentCookieStore);
+ std::unique_ptr<CookieMonster> cm(new CookieMonster(store.get(), &net_log_));
+
+ histograms.ExpectTotalCount(kHistogramName, 0);
+
+ // Set some cookies. This requires some knowledge of how
+ // ReducePortRangeForCookieHistogram maps ports, but that's probably fine.
+
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://www.foo.com"), "A=B"));
+ histograms.ExpectTotalCount(kHistogramName, 1);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(443), 1);
+
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://www.foo.com:80"), "A=B"));
+ histograms.ExpectTotalCount(kHistogramName, 2);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(80), 1);
+
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://www.foo.com:9000"), "A=B"));
+ histograms.ExpectTotalCount(kHistogramName, 3);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(9000), 1);
+
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://www.foo.com:1234"), "A=B"));
+ histograms.ExpectTotalCount(kHistogramName, 4);
+ histograms.ExpectBucketCount(kHistogramName,
+ ReducePortRangeForCookieHistogram(1234), 1);
+
+ // Histogram should not increment for invalid cookie.
+ EXPECT_FALSE(SetCookie(cm.get(), GURL("https://www.foo.com"),
+ "A=B; Domain=malformedcookie.com"));
+ histograms.ExpectTotalCount(kHistogramName, 4);
+
+ // Nor should it increment for a read operation
+ EXPECT_NE(GetCookies(cm.get(), GURL("https://www.foo.com")), "");
+ histograms.ExpectTotalCount(kHistogramName, 4);
+
+ // Make sure the correct histogram is chosen for localhost.
+ histograms.ExpectTotalCount(kHistogramNameLocal, 0);
+
+ EXPECT_TRUE(
+ SetCookie(cm.get(), GURL("https://localhost:1234"), "local=host"));
+ histograms.ExpectTotalCount(kHistogramNameLocal, 1);
+ histograms.ExpectBucketCount(kHistogramNameLocal,
+ ReducePortRangeForCookieHistogram(1234), 1);
+}
+
+TEST_F(CookieMonsterTest, CookiePortReadDiffersFromSetHistogram) {
+ base::HistogramTester histograms;
+ const char kHistogramName[] = "Cookie.Port.ReadDiffersFromSet.RemoteHost";
+ const char kHistogramNameLocal[] = "Cookie.Port.ReadDiffersFromSet.Localhost";
+ const char kHistogramNameDomainSet[] =
+ "Cookie.Port.ReadDiffersFromSet.DomainSet";
+
+ scoped_refptr<MockPersistentCookieStore> store(new MockPersistentCookieStore);
+ std::unique_ptr<CookieMonster> cm(new CookieMonster(store.get(), &net_log_));
+
+ histograms.ExpectTotalCount(kHistogramName, 0);
+
+ // Set some cookies. One with a port, one without, and one with an invalid
+ // port.
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://www.foo.com/withport"),
+ "A=B; Path=/withport")); // Port 443
+
+ auto unspecified_cookie = CanonicalCookie::Create(
+ GURL("https://www.foo.com/withoutport"), "C=D; Path=/withoutport",
+ base::Time::Now(), base::nullopt);
+ // Force to be unspecified.
+ unspecified_cookie->SetSourcePort(url::PORT_UNSPECIFIED);
+ EXPECT_TRUE(SetCanonicalCookieReturnAccessResult(
+ cm.get(), std::move(unspecified_cookie),
+ GURL("https://www.foo.com/withoutport"),
+ false /*can_modify_httponly*/)
+ .status.IsInclude());
+
+ auto invalid_cookie = CanonicalCookie::Create(
+ GURL("https://www.foo.com/invalidport"), "E=F; Path=/invalidport",
+ base::Time::Now(), base::nullopt);
+ // Force to be invalid.
+ invalid_cookie->SetSourcePort(99999);
+ EXPECT_TRUE(SetCanonicalCookieReturnAccessResult(
+ cm.get(), std::move(invalid_cookie),
+ GURL("https://www.foo.com/invalidport"),
+ false /*can_modify_httponly*/)
+ .status.IsInclude());
+
+ // Try same port.
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.foo.com/withport")), "A=B");
+ histograms.ExpectTotalCount(kHistogramName, 1);
+ histograms.ExpectBucketCount(kHistogramName,
+ CookieMonster::CookieSentToSamePort::kYes, 1);
+
+ // Try different port.
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.foo.com:8080/withport")),
+ "A=B");
+ histograms.ExpectTotalCount(kHistogramName, 2);
+ histograms.ExpectBucketCount(kHistogramName,
+ CookieMonster::CookieSentToSamePort::kNo, 1);
+
+ // Try different port, but it's the default for a different scheme.
+ EXPECT_EQ(GetCookies(cm.get(), GURL("http://www.foo.com/withport")), "A=B");
+ histograms.ExpectTotalCount(kHistogramName, 3);
+ histograms.ExpectBucketCount(
+ kHistogramName, CookieMonster::CookieSentToSamePort::kNoButDefault, 1);
+
+ // Now try it with an unspecified port cookie.
+ EXPECT_EQ(GetCookies(cm.get(), GURL("http://www.foo.com/withoutport")),
+ "C=D");
+ histograms.ExpectTotalCount(kHistogramName, 4);
+ histograms.ExpectBucketCount(
+ kHistogramName,
+ CookieMonster::CookieSentToSamePort::kSourcePortUnspecified, 1);
+
+ // Finally try it with an invalid port cookie.
+ EXPECT_EQ(GetCookies(cm.get(), GURL("http://www.foo.com/invalidport")),
+ "E=F");
+ histograms.ExpectTotalCount(kHistogramName, 5);
+ histograms.ExpectBucketCount(
+ kHistogramName, CookieMonster::CookieSentToSamePort::kInvalid, 1);
+
+ // Make sure the correct histogram is chosen for localhost.
+ histograms.ExpectTotalCount(kHistogramNameLocal, 0);
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://localhost"), "local=host"));
+
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://localhost")), "local=host");
+ histograms.ExpectTotalCount(kHistogramNameLocal, 1);
+ histograms.ExpectBucketCount(kHistogramNameLocal,
+ CookieMonster::CookieSentToSamePort::kYes, 1);
+
+ // Make sure the Domain set version works.
+ EXPECT_TRUE(SetCookie(cm.get(), GURL("https://www.foo.com/withDomain"),
+ "W=D; Domain=foo.com; Path=/withDomain"));
+
+ histograms.ExpectTotalCount(kHistogramNameDomainSet, 0);
+
+ EXPECT_EQ(GetCookies(cm.get(), GURL("https://www.foo.com/withDomain")),
+ "W=D");
+ histograms.ExpectTotalCount(kHistogramNameDomainSet, 1);
+ histograms.ExpectBucketCount(kHistogramNameDomainSet,
+ CookieMonster::CookieSentToSamePort::kYes, 1);
+ // The RemoteHost histogram should also increase with this cookie. Domain
+ // cookies aren't special insofar as this metric is concerned.
+ histograms.ExpectTotalCount(kHistogramName, 6);
+ histograms.ExpectBucketCount(kHistogramName,
+ CookieMonster::CookieSentToSamePort::kYes, 2);
}
} // namespace net
diff --git a/chromium/net/cookies/cookie_options.cc b/chromium/net/cookies/cookie_options.cc
index 3ab86e67f0c..c05d0c00c23 100644
--- a/chromium/net/cookies/cookie_options.cc
+++ b/chromium/net/cookies/cookie_options.cc
@@ -51,12 +51,20 @@ CookieOptions::CookieOptions()
update_access_time_(true),
return_excluded_cookies_(false) {}
+CookieOptions::CookieOptions(const CookieOptions& other) = default;
+CookieOptions::CookieOptions(CookieOptions&& other) = default;
+CookieOptions::~CookieOptions() = default;
+
+CookieOptions& CookieOptions::operator=(const CookieOptions&) = default;
+CookieOptions& CookieOptions::operator=(CookieOptions&&) = default;
+
// static
CookieOptions CookieOptions::MakeAllInclusive() {
CookieOptions options;
options.set_include_httponly();
options.set_same_site_cookie_context(SameSiteCookieContext::MakeInclusive());
options.set_do_not_update_access_time();
+ options.set_full_party_context(std::set<net::SchemefulSite>());
return options;
}
diff --git a/chromium/net/cookies/cookie_options.h b/chromium/net/cookies/cookie_options.h
index abf074b6aab..821ac334199 100644
--- a/chromium/net/cookies/cookie_options.h
+++ b/chromium/net/cookies/cookie_options.h
@@ -7,8 +7,12 @@
#ifndef NET_COOKIES_COOKIE_OPTIONS_H_
#define NET_COOKIES_COOKIE_OPTIONS_H_
+#include <set>
+
+#include "base/optional.h"
#include "base/time/time.h"
#include "net/base/net_export.h"
+#include "net/base/schemeful_site.h"
#include "net/cookies/cookie_constants.h"
#include "url/gurl.h"
@@ -88,13 +92,21 @@ class NET_EXPORT CookieOptions {
// * Excludes SameSite cookies
// * Updates last-accessed time.
// * Does not report excluded cookies in APIs that can do so.
+ // * Excludes SameParty cookies.
//
// These settings can be altered by calling:
//
// * |set_{include,exclude}_httponly()|
// * |set_same_site_cookie_context()|
// * |set_do_not_update_access_time()|
+ // * |set_full_party_context()|
CookieOptions();
+ CookieOptions(const CookieOptions& other);
+ CookieOptions(CookieOptions&& other);
+ ~CookieOptions();
+
+ CookieOptions& operator=(const CookieOptions&);
+ CookieOptions& operator=(CookieOptions&&);
void set_exclude_httponly() { exclude_httponly_ = true; }
void set_include_httponly() { exclude_httponly_ = false; }
@@ -118,6 +130,15 @@ class NET_EXPORT CookieOptions {
void unset_return_excluded_cookies() { return_excluded_cookies_ = false; }
bool return_excluded_cookies() const { return return_excluded_cookies_; }
+ void set_full_party_context(
+ const base::Optional<std::set<net::SchemefulSite>>& full_party_context) {
+ full_party_context_ = full_party_context;
+ }
+ const base::Optional<std::set<net::SchemefulSite>>& full_party_context()
+ const {
+ return full_party_context_;
+ }
+
// Convenience method for where you need a CookieOptions that will
// work for getting/setting all types of cookies, including HttpOnly and
// SameSite cookies. Also specifies not to update the access time, because
@@ -130,7 +151,8 @@ class NET_EXPORT CookieOptions {
bool exclude_httponly_;
SameSiteCookieContext same_site_cookie_context_;
bool update_access_time_;
- bool return_excluded_cookies_;
+ bool return_excluded_cookies_ = false;
+ base::Optional<std::set<net::SchemefulSite>> full_party_context_;
};
} // namespace net
diff --git a/chromium/net/cookies/cookie_store_unittest.h b/chromium/net/cookies/cookie_store_unittest.h
index c2f495bedce..29a520956b6 100644
--- a/chromium/net/cookies/cookie_store_unittest.h
+++ b/chromium/net/cookies/cookie_store_unittest.h
@@ -423,7 +423,7 @@ TYPED_TEST_P(CookieStoreTest, FilterTest) {
std::unique_ptr<CanonicalCookie> cc(CanonicalCookie::CreateSanitizedCookie(
this->www_foo_foo_.url(), "A", "B", std::string(), "/foo", one_hour_ago,
one_hour_from_now, base::Time(), false, false,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false));
ASSERT_TRUE(cc);
EXPECT_TRUE(this->SetCanonicalCookie(
cs, std::move(cc), this->www_foo_foo_.url(), true /*modify_httponly*/));
@@ -433,7 +433,7 @@ TYPED_TEST_P(CookieStoreTest, FilterTest) {
cc = CanonicalCookie::CreateSanitizedCookie(
this->www_foo_bar_.url(), "C", "D", this->www_foo_bar_.domain(), "/bar",
two_hours_ago, base::Time(), one_hour_ago, false, true,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false);
ASSERT_TRUE(cc);
EXPECT_TRUE(this->SetCanonicalCookie(
cs, std::move(cc), this->www_foo_bar_.url(), true /*modify_httponly*/));
@@ -444,13 +444,13 @@ TYPED_TEST_P(CookieStoreTest, FilterTest) {
cc = CanonicalCookie::CreateSanitizedCookie(
this->http_www_foo_.url(), "E", "F", std::string(), std::string(),
base::Time(), base::Time(), base::Time(), true, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
ASSERT_FALSE(cc);
cc = CanonicalCookie::CreateSanitizedCookie(
this->https_www_foo_.url(), "E", "F", std::string(), std::string(),
base::Time(), base::Time(), base::Time(), true, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
ASSERT_TRUE(cc);
EXPECT_TRUE(this->SetCanonicalCookie(
cs, std::move(cc), this->https_www_foo_.url(), true /*modify_httponly*/));
@@ -550,14 +550,14 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
std::make_unique<CanonicalCookie>(
"A", "B", foo_foo_host, "/foo", one_hour_ago, one_hour_from_now,
base::Time(), false /* secure */, false /* httponly */,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT),
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT, false),
this->www_foo_foo_.url(), true));
EXPECT_TRUE(this->SetCanonicalCookie(
cs,
std::make_unique<CanonicalCookie>(
"C", "D", "." + foo_bar_domain, "/bar", two_hours_ago, base::Time(),
one_hour_ago, false, true, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false),
this->www_foo_bar_.url(), true));
// A secure source is required for setting secure cookies.
@@ -567,7 +567,7 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
std::make_unique<CanonicalCookie>(
"E", "F", http_foo_host, "/", base::Time(), base::Time(),
base::Time(), true, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false),
this->http_www_foo_.url(), true)
.status.HasExclusionReason(
CookieInclusionStatus::EXCLUDE_SECURE_ONLY));
@@ -592,19 +592,20 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
std::make_unique<CanonicalCookie>(
"E", "F", https_foo_host, "/", base::Time(), base::Time(),
base::Time(), true /* secure */, false /* httponly */,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT),
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false /* same_party */),
this->https_www_foo_.url(), true /* modify_http_only */));
- EXPECT_TRUE(
- this->SetCanonicalCookieReturnAccessResult(
- cs,
- std::make_unique<CanonicalCookie>(
- "E", "F", http_foo_host, "/", base::Time(), base::Time(),
- base::Time(), true /* secure */, false /* httponly */,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT),
- this->http_www_foo_.url(), true /* modify_http_only */)
- .status.HasExclusionReason(
- CookieInclusionStatus::EXCLUDE_SECURE_ONLY));
+ EXPECT_TRUE(this->SetCanonicalCookieReturnAccessResult(
+ cs,
+ std::make_unique<CanonicalCookie>(
+ "E", "F", http_foo_host, "/", base::Time(),
+ base::Time(), base::Time(), true /* secure */,
+ false /* httponly */, CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */),
+ this->http_www_foo_.url(), true /* modify_http_only */)
+ .status.HasExclusionReason(
+ CookieInclusionStatus::EXCLUDE_SECURE_ONLY));
if (TypeParam::supports_http_only) {
// Permission to modify http only cookies is required to set an
@@ -615,7 +616,7 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
"G", "H", http_foo_host, "/unique", base::Time(),
base::Time(), base::Time(), false /* secure */,
true /* httponly */, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */),
this->http_www_foo_.url(), false /* modify_http_only */)
.status.HasExclusionReason(
CookieInclusionStatus::EXCLUDE_HTTP_ONLY));
@@ -641,7 +642,8 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
std::make_unique<CanonicalCookie>(
"G", "H", http_foo_host, "/unique", base::Time(), base::Time(),
base::Time(), false /* secure */, true /* httponly */,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT),
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT,
+ false /* same_party */),
this->http_www_foo_.url(), true /* modify_http_only */));
EXPECT_TRUE(this->SetCanonicalCookieReturnAccessResult(
@@ -650,7 +652,7 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
"G", "H", http_foo_host, "/unique", base::Time(),
base::Time(), base::Time(), false /* secure */,
true /* httponly */, CookieSameSite::LAX_MODE,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */),
this->http_www_foo_.url(), false /* modify_http_only */)
.status.HasExclusionReason(
CookieInclusionStatus::EXCLUDE_HTTP_ONLY));
@@ -661,7 +663,8 @@ TYPED_TEST_P(CookieStoreTest, SetCanonicalCookieTest) {
std::make_unique<CanonicalCookie>(
"G", "H", http_foo_host, "/unique", base::Time(), base::Time(),
base::Time(), false /* secure */, true /* httponly */,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT),
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT,
+ false /* same_party */),
this->http_www_foo_.url(), true /* modify_http_only */));
}
@@ -739,28 +742,28 @@ TYPED_TEST_P(CookieStoreTest, SecureEnforcement) {
std::make_unique<CanonicalCookie>(
"A", "B", http_domain, "/", base::Time::Now(), base::Time(),
base::Time(), true, false, CookieSameSite::STRICT_MODE,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */),
http_url, true /*modify_httponly*/));
EXPECT_TRUE(this->SetCanonicalCookie(
cs,
std::make_unique<CanonicalCookie>(
"A", "B", http_domain, "/", base::Time::Now(), base::Time(),
base::Time(), true, false, CookieSameSite::STRICT_MODE,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */),
https_url, true /*modify_httponly*/));
EXPECT_TRUE(this->SetCanonicalCookie(
cs,
std::make_unique<CanonicalCookie>(
"A", "B", http_domain, "/", base::Time::Now(), base::Time(),
base::Time(), false, false, CookieSameSite::STRICT_MODE,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */),
https_url, true /*modify_httponly*/));
EXPECT_TRUE(this->SetCanonicalCookie(
cs,
std::make_unique<CanonicalCookie>(
"A", "B", http_domain, "/", base::Time::Now(), base::Time(),
base::Time(), false, false, CookieSameSite::STRICT_MODE,
- COOKIE_PRIORITY_DEFAULT),
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */),
http_url, true /*modify_httponly*/));
}
diff --git a/chromium/net/cookies/cookie_util.cc b/chromium/net/cookies/cookie_util.cc
index 86735d1d510..27d2486ba40 100644
--- a/chromium/net/cookies/cookie_util.cc
+++ b/chromium/net/cookies/cookie_util.cc
@@ -630,51 +630,6 @@ bool IsSchemefulSameSiteEnabled() {
return base::FeatureList::IsEnabled(features::kSchemefulSameSite);
}
-bool IsRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsEnabled() {
- return IsSameSiteByDefaultCookiesEnabled() &&
- base::FeatureList::IsEnabled(
- features::kRecentHttpSameSiteAccessGrantsLegacyCookieSemantics) &&
- features::
- kRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsMilliseconds
- .Get() > 0;
-}
-
-bool IsRecentCreationTimeGrantsLegacyCookieSemanticsEnabled() {
- return IsSameSiteByDefaultCookiesEnabled() &&
- base::FeatureList::IsEnabled(
- features::kRecentCreationTimeGrantsLegacyCookieSemantics) &&
- features::kRecentCreationTimeGrantsLegacyCookieSemanticsMilliseconds
- .Get() > 0;
-}
-
-bool DoesLastHttpSameSiteAccessGrantLegacySemantics(
- base::TimeTicks last_http_same_site_access) {
- if (last_http_same_site_access.is_null())
- return false;
- if (!IsRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsEnabled())
- return false;
-
- base::TimeDelta recency_threshold = base::TimeDelta::FromMilliseconds(
- features::kRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsMilliseconds
- .Get());
- DCHECK(!recency_threshold.is_zero());
- return (base::TimeTicks::Now() - last_http_same_site_access) <
- recency_threshold;
-}
-
-bool DoesCreationTimeGrantLegacySemantics(base::Time creation_date) {
- if (creation_date.is_null())
- return false;
- if (!IsRecentCreationTimeGrantsLegacyCookieSemanticsEnabled())
- return false;
-
- base::TimeDelta recency_threshold = base::TimeDelta::FromMilliseconds(
- features::kRecentCreationTimeGrantsLegacyCookieSemanticsMilliseconds
- .Get());
- DCHECK(!recency_threshold.is_zero());
- return (base::Time::Now() - creation_date) < recency_threshold;
-}
-
base::OnceCallback<void(CookieAccessResult)> AdaptCookieAccessResultToBool(
base::OnceCallback<void(bool)> callback) {
return base::BindOnce(
@@ -696,5 +651,20 @@ CookieList StripAccessResults(
return cookies;
}
+NET_EXPORT void RecordCookiePortOmniboxHistograms(const GURL& url) {
+ int port = url.EffectiveIntPort();
+
+ if (port == url::PORT_UNSPECIFIED)
+ return;
+
+ if (IsLocalhost(url)) {
+ UMA_HISTOGRAM_ENUMERATION("Cookie.Port.OmniboxURLNavigation.Localhost",
+ ReducePortRangeForCookieHistogram(port));
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Cookie.Port.OmniboxURLNavigation.RemoteHost",
+ ReducePortRangeForCookieHistogram(port));
+ }
+}
+
} // namespace cookie_util
} // namespace net
diff --git a/chromium/net/cookies/cookie_util.h b/chromium/net/cookies/cookie_util.h
index b2b7992d03b..89209de68f7 100644
--- a/chromium/net/cookies/cookie_util.h
+++ b/chromium/net/cookies/cookie_util.h
@@ -230,21 +230,6 @@ NET_EXPORT bool IsSameSiteCompatPair(const CanonicalCookie& c1,
NET_EXPORT bool IsSameSiteByDefaultCookiesEnabled();
NET_EXPORT bool IsCookiesWithoutSameSiteMustBeSecureEnabled();
NET_EXPORT bool IsSchemefulSameSiteEnabled();
-bool IsRecentHttpSameSiteAccessGrantsLegacyCookieSemanticsEnabled();
-bool IsRecentCreationTimeGrantsLegacyCookieSemanticsEnabled();
-
-// Determines whether the last same-site access to a cookie should grant legacy
-// access semantics to the current attempted cookies access, based on the state
-// of the feature kRecentSameSiteAccessGrantsLegacyCookieSemantics, the value of
-// the feature param, and the time since the last eligible same-site access.
-bool DoesLastHttpSameSiteAccessGrantLegacySemantics(
- base::TimeTicks last_http_same_site_access);
-
-// Determines whether the creation time of a cookie should grant legacy
-// access semantics to the current attempted cookies access, based on the state
-// of the feature kRecentCreationTimeGrantsLegacyCookieSemantics, the value of
-// the feature param, and the creation time of the cookie.
-bool DoesCreationTimeGrantLegacySemantics(base::Time creation_date);
// Takes a callback accepting a CookieAccessResult and returns a callback
// that accepts a bool, setting the bool to true if the CookieInclusionStatus
@@ -260,6 +245,9 @@ AdaptCookieAccessResultToBool(base::OnceCallback<void(bool)> callback);
NET_EXPORT CookieList
StripAccessResults(const CookieAccessResultList& cookie_access_result_list);
+// Records port related metrics from Omnibox navigations.
+NET_EXPORT void RecordCookiePortOmniboxHistograms(const GURL& url);
+
} // namespace cookie_util
} // namespace net
diff --git a/chromium/net/cookies/cookie_util_unittest.cc b/chromium/net/cookies/cookie_util_unittest.cc
index 8093a6f440e..a4a3f625423 100644
--- a/chromium/net/cookies/cookie_util_unittest.cc
+++ b/chromium/net/cookies/cookie_util_unittest.cc
@@ -7,7 +7,7 @@
#include "base/callback.h"
#include "base/strings/string_split.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "net/cookies/cookie_util.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chromium/net/cookies/parse_cookie_line_fuzzer.cc b/chromium/net/cookies/parse_cookie_line_fuzzer.cc
index 4ea774ab748..037662209c2 100644
--- a/chromium/net/cookies/parse_cookie_line_fuzzer.cc
+++ b/chromium/net/cookies/parse_cookie_line_fuzzer.cc
@@ -25,7 +25,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
// Call zero or one of ParsedCookie's mutator methods. Should not call
// anything other than SetName/SetValue when !IsValid().
- const uint8_t action = data_provider.ConsumeIntegralInRange(0, 10);
+ const uint8_t action = data_provider.ConsumeIntegralInRange(0, 11);
switch (action) {
case 1:
parsed_cookie.SetName(GetArbitraryString(&data_provider));
@@ -62,6 +62,9 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
case 10:
parsed_cookie.SetPriority(GetArbitraryString(&data_provider));
break;
+ case 11:
+ parsed_cookie.SetIsSameParty(data_provider.ConsumeBool());
+ break;
}
}
diff --git a/chromium/net/cookies/parsed_cookie.cc b/chromium/net/cookies/parsed_cookie.cc
index 6da21345f8b..a2626774945 100644
--- a/chromium/net/cookies/parsed_cookie.cc
+++ b/chromium/net/cookies/parsed_cookie.cc
@@ -60,6 +60,7 @@ const char kSecureTokenName[] = "secure";
const char kHttpOnlyTokenName[] = "httponly";
const char kSameSiteTokenName[] = "samesite";
const char kPriorityTokenName[] = "priority";
+const char kSamePartyTokenName[] = "sameparty";
const char kTerminator[] = "\n\r\0";
const int kTerminatorLen = sizeof(kTerminator) - 1;
@@ -129,15 +130,7 @@ bool IsControlCharacter(unsigned char c) {
namespace net {
-ParsedCookie::ParsedCookie(const std::string& cookie_line)
- : path_index_(0),
- domain_index_(0),
- expires_index_(0),
- maxage_index_(0),
- secure_index_(0),
- httponly_index_(0),
- same_site_index_(0),
- priority_index_(0) {
+ParsedCookie::ParsedCookie(const std::string& cookie_line) {
if (cookie_line.size() > kMaxCookieSize) {
DVLOG(1) << "Not parsing cookie, too large: " << cookie_line.size();
return;
@@ -232,6 +225,10 @@ bool ParsedCookie::SetPriority(const std::string& priority) {
return SetString(&priority_index_, kPriorityTokenName, priority);
}
+bool ParsedCookie::SetIsSameParty(bool is_same_party) {
+ return SetBool(&same_party_index_, kSamePartyTokenName, is_same_party);
+}
+
std::string ParsedCookie::ToCookieLine() const {
std::string out;
for (auto it = pairs_.begin(); it != pairs_.end(); ++it) {
@@ -242,7 +239,8 @@ std::string ParsedCookie::ToCookieLine() const {
// print it for the first pair(see crbug.com/977619). After the first pair,
// we need to consider whether the name component is a special token.
if (it == pairs_.begin() ||
- (it->first != kSecureTokenName && it->first != kHttpOnlyTokenName)) {
+ (it->first != kSecureTokenName && it->first != kHttpOnlyTokenName &&
+ it->first != kSamePartyTokenName)) {
out.append("=");
out.append(it->second);
}
@@ -464,6 +462,8 @@ void ParsedCookie::SetupAttributes() {
same_site_index_ = i;
} else if (pairs_[i].first == kPriorityTokenName) {
priority_index_ = i;
+ } else if (pairs_[i].first == kSamePartyTokenName) {
+ same_party_index_ = i;
} else {
/* some attribute we don't know or don't care about. */
}
@@ -529,9 +529,9 @@ void ParsedCookie::ClearAttributePair(size_t index) {
if (index == 0)
return;
- size_t* indexes[] = {&path_index_, &domain_index_, &expires_index_,
- &maxage_index_, &secure_index_, &httponly_index_,
- &same_site_index_, &priority_index_};
+ size_t* indexes[] = {&path_index_, &domain_index_, &expires_index_,
+ &maxage_index_, &secure_index_, &httponly_index_,
+ &same_site_index_, &priority_index_, &same_party_index_};
for (size_t* attribute_index : indexes) {
if (*attribute_index == index)
*attribute_index = 0;
diff --git a/chromium/net/cookies/parsed_cookie.h b/chromium/net/cookies/parsed_cookie.h
index 7917c681c86..f555814bc2f 100644
--- a/chromium/net/cookies/parsed_cookie.h
+++ b/chromium/net/cookies/parsed_cookie.h
@@ -53,6 +53,7 @@ class NET_EXPORT ParsedCookie {
CookieSameSite SameSite(
CookieSameSiteString* samesite_string = nullptr) const;
CookiePriority Priority() const;
+ bool IsSameParty() const { return same_party_index_ != 0; }
// Returns the number of attributes, for example, returning 2 for:
// "BLAH=hah; path=/; domain=.google.com"
@@ -76,6 +77,7 @@ class NET_EXPORT ParsedCookie {
bool SetIsHttpOnly(bool is_http_only);
bool SetSameSite(const std::string& same_site);
bool SetPriority(const std::string& priority);
+ bool SetIsSameParty(bool is_same_party);
// Returns the cookie description as it appears in a HTML response header.
std::string ToCookieLine() const;
@@ -139,17 +141,16 @@ class NET_EXPORT ParsedCookie {
PairList pairs_;
// These will default to 0, but that should never be valid since the
- // 0th index is the user supplied token/value, not an attribute.
- // We're really never going to have more than like 8 attributes, so we
- // could fit these into 3 bits each if we're worried about size...
- size_t path_index_;
- size_t domain_index_;
- size_t expires_index_;
- size_t maxage_index_;
- size_t secure_index_;
- size_t httponly_index_;
- size_t same_site_index_;
- size_t priority_index_;
+ // 0th index is the user supplied cookie name/value, not an attribute.
+ size_t path_index_ = 0;
+ size_t domain_index_ = 0;
+ size_t expires_index_ = 0;
+ size_t maxage_index_ = 0;
+ size_t secure_index_ = 0;
+ size_t httponly_index_ = 0;
+ size_t same_site_index_ = 0;
+ size_t priority_index_ = 0;
+ size_t same_party_index_ = 0;
DISALLOW_COPY_AND_ASSIGN(ParsedCookie);
};
diff --git a/chromium/net/cookies/parsed_cookie_unittest.cc b/chromium/net/cookies/parsed_cookie_unittest.cc
index 27ce53d1249..d4671514d23 100644
--- a/chromium/net/cookies/parsed_cookie_unittest.cc
+++ b/chromium/net/cookies/parsed_cookie_unittest.cc
@@ -11,11 +11,38 @@
namespace net {
TEST(ParsedCookieTest, TestBasic) {
- ParsedCookie pc("a=b");
- EXPECT_TRUE(pc.IsValid());
- EXPECT_FALSE(pc.IsSecure());
- EXPECT_EQ("a", pc.Name());
- EXPECT_EQ("b", pc.Value());
+ ParsedCookie pc1("a=b");
+ EXPECT_TRUE(pc1.IsValid());
+ EXPECT_FALSE(pc1.IsSecure());
+ EXPECT_FALSE(pc1.IsHttpOnly());
+ EXPECT_FALSE(pc1.IsSameParty());
+ EXPECT_EQ("a", pc1.Name());
+ EXPECT_EQ("b", pc1.Value());
+ EXPECT_FALSE(pc1.HasPath());
+ EXPECT_FALSE(pc1.HasDomain());
+ EXPECT_FALSE(pc1.HasExpires());
+ EXPECT_FALSE(pc1.HasMaxAge());
+ EXPECT_EQ(CookieSameSite::UNSPECIFIED, pc1.SameSite());
+ EXPECT_EQ(CookiePriority::COOKIE_PRIORITY_DEFAULT, pc1.Priority());
+
+ ParsedCookie pc2(
+ "c=d; secure; httponly; sameparty; path=/foo; domain=bar.test; "
+ "max-age=60; samesite=lax; priority=high");
+ EXPECT_TRUE(pc2.IsValid());
+ EXPECT_TRUE(pc2.IsSecure());
+ EXPECT_TRUE(pc2.IsHttpOnly());
+ EXPECT_TRUE(pc2.IsSameParty());
+ EXPECT_EQ("c", pc2.Name());
+ EXPECT_EQ("d", pc2.Value());
+ EXPECT_TRUE(pc2.HasPath());
+ EXPECT_EQ("/foo", pc2.Path());
+ EXPECT_TRUE(pc2.HasDomain());
+ EXPECT_EQ("bar.test", pc2.Domain());
+ EXPECT_FALSE(pc2.HasExpires());
+ EXPECT_TRUE(pc2.HasMaxAge());
+ EXPECT_EQ("60", pc2.MaxAge());
+ EXPECT_EQ(CookieSameSite::LAX_MODE, pc2.SameSite());
+ EXPECT_EQ(CookiePriority::COOKIE_PRIORITY_HIGH, pc2.Priority());
}
TEST(ParsedCookieTest, TestEmpty) {
@@ -48,7 +75,7 @@ TEST(ParsedCookieTest, TestSetEmptyNameValue) {
EXPECT_EQ("value", empty_name.Value());
EXPECT_FALSE(empty_name.SetValue(""));
EXPECT_EQ("value", empty_name.Value());
- EXPECT_TRUE(empty_value.IsValid());
+ EXPECT_TRUE(empty_name.IsValid());
}
TEST(ParsedCookieTest, TestQuoted) {
@@ -111,17 +138,18 @@ TEST(ParsedCookieTest, TestNameless) {
TEST(ParsedCookieTest, TestAttributeCase) {
ParsedCookie pc(
- "BLAHHH; Path=/; sECuRe; httpONLY; sAmESitE=StrIct; pRIoRitY=hIgH");
+ "BLAH; Path=/; sECuRe; httpONLY; sAmESitE=LaX; pRIoRitY=hIgH; samePaRtY");
EXPECT_TRUE(pc.IsValid());
EXPECT_TRUE(pc.IsSecure());
EXPECT_TRUE(pc.IsHttpOnly());
- EXPECT_EQ(CookieSameSite::STRICT_MODE, pc.SameSite());
+ EXPECT_TRUE(pc.IsSameParty());
+ EXPECT_EQ(CookieSameSite::LAX_MODE, pc.SameSite());
EXPECT_TRUE(pc.HasPath());
EXPECT_EQ("/", pc.Path());
EXPECT_EQ("", pc.Name());
- EXPECT_EQ("BLAHHH", pc.Value());
+ EXPECT_EQ("BLAH", pc.Value());
EXPECT_EQ(COOKIE_PRIORITY_HIGH, pc.Priority());
- EXPECT_EQ(5U, pc.NumberOfAttributes());
+ EXPECT_EQ(6U, pc.NumberOfAttributes());
}
TEST(ParsedCookieTest, TestDoubleQuotedNameless) {
@@ -367,10 +395,11 @@ TEST(ParsedCookieTest, SetAttributes) {
EXPECT_TRUE(pc.SetIsHttpOnly(true));
EXPECT_TRUE(pc.SetSameSite("LAX"));
EXPECT_TRUE(pc.SetPriority("HIGH"));
+ EXPECT_TRUE(pc.SetIsSameParty(true));
EXPECT_EQ(
"name=value; domain=domain.com; path=/; "
"expires=Sun, 18-Apr-2027 21:06:29 GMT; max-age=12345; secure; "
- "httponly; samesite=LAX; priority=HIGH",
+ "httponly; samesite=LAX; priority=HIGH; sameparty",
pc.ToCookieLine());
EXPECT_TRUE(pc.HasDomain());
EXPECT_TRUE(pc.HasPath());
@@ -380,22 +409,35 @@ TEST(ParsedCookieTest, SetAttributes) {
EXPECT_TRUE(pc.IsHttpOnly());
EXPECT_EQ(CookieSameSite::LAX_MODE, pc.SameSite());
EXPECT_EQ(COOKIE_PRIORITY_HIGH, pc.Priority());
+ EXPECT_TRUE(pc.IsSameParty());
- // Clear one attribute from the middle.
+ // Modify one attribute in the middle.
EXPECT_TRUE(pc.SetPath("/foo"));
EXPECT_TRUE(pc.HasDomain());
EXPECT_TRUE(pc.HasPath());
+ EXPECT_EQ("/foo", pc.Path());
EXPECT_TRUE(pc.HasExpires());
EXPECT_TRUE(pc.IsSecure());
EXPECT_TRUE(pc.IsHttpOnly());
+ EXPECT_TRUE(pc.IsSameParty());
EXPECT_EQ(
"name=value; domain=domain.com; path=/foo; "
"expires=Sun, 18-Apr-2027 21:06:29 GMT; max-age=12345; secure; "
- "httponly; samesite=LAX; priority=HIGH",
+ "httponly; samesite=LAX; priority=HIGH; sameparty",
pc.ToCookieLine());
// Set priority to medium.
EXPECT_TRUE(pc.SetPriority("medium"));
+ EXPECT_EQ(CookiePriority::COOKIE_PRIORITY_MEDIUM, pc.Priority());
+ EXPECT_EQ(
+ "name=value; domain=domain.com; path=/foo; "
+ "expires=Sun, 18-Apr-2027 21:06:29 GMT; max-age=12345; secure; "
+ "httponly; samesite=LAX; priority=medium; sameparty",
+ pc.ToCookieLine());
+
+ // Clear attribute from the end.
+ EXPECT_TRUE(pc.SetIsSameParty(false));
+ EXPECT_FALSE(pc.IsSameParty());
EXPECT_EQ(
"name=value; domain=domain.com; path=/foo; "
"expires=Sun, 18-Apr-2027 21:06:29 GMT; max-age=12345; secure; "
@@ -421,6 +463,7 @@ TEST(ParsedCookieTest, SetAttributes) {
EXPECT_FALSE(pc.IsHttpOnly());
EXPECT_EQ(CookieSameSite::UNSPECIFIED, pc.SameSite());
EXPECT_EQ("name2=value2", pc.ToCookieLine());
+ EXPECT_FALSE(pc.IsSameParty());
}
// Set the domain attribute twice in a cookie line. If the second attribute's
@@ -570,8 +613,8 @@ TEST(ParsedCookieTest, SettersInputValidation) {
}
TEST(ParsedCookieTest, ToCookieLineSpecialTokens) {
- // Special tokens "secure" and "httponly" should be treated as any other name
- // when they are in the first position.
+ // Special tokens "secure", "httponly", and "sameparty" should be treated as
+ // any other name when they are in the first position.
{
ParsedCookie pc("");
pc.SetName("secure");
@@ -594,6 +637,10 @@ TEST(ParsedCookieTest, ToCookieLineSpecialTokens) {
EXPECT_EQ(pc.ToCookieLine(), "httponly=foo");
}
{
+ ParsedCookie pc("sameparty=foo");
+ EXPECT_EQ(pc.ToCookieLine(), "sameparty=foo");
+ }
+ {
ParsedCookie pc("foo");
pc.SetName("secure");
EXPECT_EQ(pc.ToCookieLine(), "secure=foo");
@@ -622,9 +669,29 @@ TEST(ParsedCookieTest, ToCookieLineSpecialTokens) {
EXPECT_EQ(pc.ToCookieLine(), "name=foo; httponly");
}
{
+ ParsedCookie pc("name=foo; sameparty=baz");
+ EXPECT_EQ(pc.ToCookieLine(), "name=foo; sameparty");
+ }
+ {
ParsedCookie pc("name=foo; bar=secure");
EXPECT_EQ(pc.ToCookieLine(), "name=foo; bar=secure");
}
+ // Repeated instances of the special tokens are also fine.
+ {
+ ParsedCookie pc("name=foo; secure; secure=yesplease; secure; secure");
+ EXPECT_TRUE(pc.IsValid());
+ EXPECT_TRUE(pc.IsSecure());
+ EXPECT_FALSE(pc.IsHttpOnly());
+ EXPECT_FALSE(pc.IsSameParty());
+ }
+ {
+ ParsedCookie pc("sameparty; sameparty; secure; httponly; httponly; secure");
+ EXPECT_EQ("", pc.Name());
+ EXPECT_EQ("sameparty", pc.Value());
+ EXPECT_TRUE(pc.IsSecure());
+ EXPECT_TRUE(pc.IsSameParty());
+ EXPECT_TRUE(pc.IsHttpOnly());
+ }
}
TEST(ParsedCookieTest, SameSiteValues) {
diff --git a/chromium/net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict b/chromium/net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict
index 9793ef04faf..39286570185 100644
--- a/chromium/net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict
+++ b/chromium/net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict
@@ -6,7 +6,8 @@
# Some 16-bit big-endian values. Useful in a number of fields. Includes
# A, AAAA, and CNAME IDs, low values for record counts, and multiples of
-# lengths of A and AAAA data fields.
+# lengths of A and AAAA data fields. Also some resulting data sizes from
+# combining HTTPS service parameters below with domain names below.
"\x00\x00"
"\x00\x01"
"\x00\x02"
@@ -14,10 +15,26 @@
"\x00\x04"
"\x00\x05"
"\x00\x08"
+"\x00\x0B"
"\x00\x0C"
+"\x00\x0D"
+"\x00\x0E"
+"\x00\x0F"
"\x00\x10"
+"\x00\x11"
+"\x00\x12"
+"\x00\x13"
+"\x00\x14"
+"\x00\x15"
+"\x00\x16"
+"\x00\x17"
+"\x00\x19"
+"\x00\x1B"
"\x00\x1C"
+"\x00\x1D"
+"\x00\x1F"
"\x00\x20"
+"\x00\x21"
"\x00\x30"
# Some encoded domain names.
@@ -35,22 +52,25 @@
"\x81\x80\x00\x01\x00\x02\x00\x00\x00\x00"
"\x81\x80\x00\x01\x00\x10\x00\x00\x00\x00"
-# A, AAAA, and CNAME request suffixes - appear after domain name.
+# A, AAAA, CNAME, and HTTPS request suffixes - appear after domain name.
"\x00\x01\x00\x01"
"\x00\x1c\x00\x01"
"\x00\x05\x00\x01"
+"\x00\x41\x00\x01"
# ESNI (TLS 1.3 encrypted server name indication, experimental) draft 4
# request suffix
"\xff\x9f\x00\x01"
-# A, AAAA, and CNAME requests for foo and foo.com.
+# A, AAAA, CNAME, and HTTPS requests for foo and foo.com.
"\x03foo\x00\x00\x01\x00\x01"
"\x03foo\x00\x00\x1c\x00\x01"
"\x03foo\x00\x00\x05\x00\x01"
+"\x03foo\x00\x00\x41\x00\x01"
"\x03foo\x03com\x00\x00\x01\x00\x01"
"\x03foo\x03com\x00\x00\x1c\x00\x01"
"\x03foo\x03com\x00\x00\x05\x00\x01"
+"\x03foo\x03com\x00\x00\x41\x00\x01"
# ESNI draft 4 (see above) requests for foo and foo.com
"\x03foo\x00\xff\x9f\x00\x01"
@@ -74,6 +94,22 @@
"\x00\x05\x00\x01\x00\x00\x00\xFF\x00\x05\x03bar\x00"
"\x00\x05\x00\x01\x00\x00\x00\xFF\x00\x09\x03foo\x03com\x00"
+# HTTPS answer suffixes (without service params)
+"\x00\x41\x00\x01\x00\x00\x00\x10\x00\x07\x00\x00\x03foo\x00"
+"\x00\x41\x00\x01\x00\x00\x14\x00\x00\x03\x00\x00\x00"
+"\x00\x41\x00\x01\x00\x00\x00\x10\x00\x07\x00\x00\x03foo\x00"
+"\x00\x41\x00\x01\x00\x00\x14\x00\x00\x03\x00\x00\x00"
+
+# HTTPS service params
+"\x00\x00\x00\x0C\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06"
+"\x00\x01\x00\x08\x03foo\x03bar"
+"\x00\x02\x00\x00"
+"\x00\x03\x00\x02\x14\xC3"
+"\x00\x04\x00\x04\x08\x08\x08\x08"
+"\x00\x05\x00\x05hello"
+"\x00\x06\x00\x10\x20\x01\x48\x60\x48\x60\x00\x00\x00\x00\x00\x00\x00\x00\x88\x88"
+"\x00\x07\x00\x03foo"
+
# ESNI draft 4 (see above) answer suffix, first truncated
# (These are construted from dns_test_util's kWellFormedEsniKeys.)
"\xff\x9f\x00\x01\x00\x00\x00\xFF\xff\x03\x00\x01\x00\x33\xff\x00\x24\x00\x1d\x00\x20\xed\xed\xc8\x68\xc1\x71\xd6\x9e\xa9\xf0\xa2\xc9\xf5\xa9\xdc\xcf\xf9\xb8\xed\x15\x5c\xc4\x5a\xec\x6f\xb2\x86\x14\xb7\x71\x1b\x7c\x00\x02"
diff --git a/chromium/net/data/websocket/DIR_METADATA b/chromium/net/data/websocket/DIR_METADATA
new file mode 100644
index 00000000000..ba4c96c87f9
--- /dev/null
+++ b/chromium/net/data/websocket/DIR_METADATA
@@ -0,0 +1,12 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Blink>Network>WebSockets"
+}
+team_email: "blink-network-dev@chromium.org" \ No newline at end of file
diff --git a/chromium/net/data/websocket/OWNERS b/chromium/net/data/websocket/OWNERS
index d5f50691953..20ff3c47588 100644
--- a/chromium/net/data/websocket/OWNERS
+++ b/chromium/net/data/websocket/OWNERS
@@ -1,5 +1,2 @@
ricea@chromium.org
yhirano@chromium.org
-
-# TEAM: blink-network-dev@chromium.org
-# COMPONENT: Blink>Network>WebSockets
diff --git a/chromium/net/der/DIR_METADATA b/chromium/net/der/DIR_METADATA
new file mode 100644
index 00000000000..c97d1840b0a
--- /dev/null
+++ b/chromium/net/der/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Certificate"
+} \ No newline at end of file
diff --git a/chromium/net/der/OWNERS b/chromium/net/der/OWNERS
index 4a621d596e6..cc1ad688e5b 100644
--- a/chromium/net/der/OWNERS
+++ b/chromium/net/der/OWNERS
@@ -2,5 +2,3 @@ davidben@chromium.org
mattm@chromium.org
nharper@chromium.org
svaldez@chromium.org
-
-# COMPONENT: Internals>Network>Certificate
diff --git a/chromium/net/disk_cache/DIR_METADATA b/chromium/net/disk_cache/DIR_METADATA
new file mode 100644
index 00000000000..46a245f72e8
--- /dev/null
+++ b/chromium/net/disk_cache/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Cache"
+} \ No newline at end of file
diff --git a/chromium/net/disk_cache/OWNERS b/chromium/net/disk_cache/OWNERS
index 7e2c65ec292..1460afa09cc 100644
--- a/chromium/net/disk_cache/OWNERS
+++ b/chromium/net/disk_cache/OWNERS
@@ -1,4 +1,2 @@
jkarlin@chromium.org
morlovich@chromium.org
-
-# COMPONENT: Internals>Network>Cache
diff --git a/chromium/net/disk_cache/backend_unittest.cc b/chromium/net/disk_cache/backend_unittest.cc
index ff17771917f..b773b0ec81c 100644
--- a/chromium/net/disk_cache/backend_unittest.cc
+++ b/chromium/net/disk_cache/backend_unittest.cc
@@ -5,7 +5,7 @@
#include <stdint.h>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/memory/memory_pressure_listener.h"
@@ -4570,7 +4570,7 @@ TEST_F(DiskCacheBackendTest, SimpleCacheNegMaxSize) {
InitCache();
// We don't know what it will pick, but it's limited to what
// disk_cache::PreferredCacheSize would return, scaled by the size experiment,
- // which only goes as much as 2x. It definitely should not be MAX_UINT64.
+ // which only goes as much as 4x. It definitely should not be MAX_UINT64.
EXPECT_NE(simple_cache_impl_->index()->max_size(),
std::numeric_limits<uint64_t>::max());
@@ -4580,6 +4580,26 @@ TEST_F(DiskCacheBackendTest, SimpleCacheNegMaxSize) {
ASSERT_GE(max_default_size, 0);
EXPECT_LT(simple_cache_impl_->index()->max_size(),
static_cast<unsigned>(max_default_size));
+
+ uint64_t max_size_without_scaling = simple_cache_impl_->index()->max_size();
+
+ // Scale to 200%. The size should be twice of |max_size_without_scaling| but
+ // since that's capped on 20% of available size, checking for the size to be
+ // between max_size_without_scaling and max_size_without_scaling*2.
+ {
+ base::test::ScopedFeatureList scoped_feature_list;
+ std::map<std::string, std::string> field_trial_params;
+ field_trial_params["percent_relative_size"] = "200";
+ scoped_feature_list.InitAndEnableFeatureWithParameters(
+ disk_cache::kChangeDiskCacheSizeExperiment, field_trial_params);
+
+ InitCache();
+
+ uint64_t max_size_scaled = simple_cache_impl_->index()->max_size();
+
+ EXPECT_GE(max_size_scaled, max_size_without_scaling);
+ EXPECT_LE(max_size_scaled, 2 * max_size_without_scaling);
+ }
}
TEST_F(DiskCacheBackendTest, SimpleLastModified) {
diff --git a/chromium/net/disk_cache/blockfile/backend_impl.cc b/chromium/net/disk_cache/blockfile/backend_impl.cc
index b24eda204c7..dd83fda6452 100644
--- a/chromium/net/disk_cache/blockfile/backend_impl.cc
+++ b/chromium/net/disk_cache/blockfile/backend_impl.cc
@@ -8,7 +8,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
diff --git a/chromium/net/disk_cache/blockfile/in_flight_backend_io.cc b/chromium/net/disk_cache/blockfile/in_flight_backend_io.cc
index aa2bae8ba04..cc9bcf4457e 100644
--- a/chromium/net/disk_cache/blockfile/in_flight_backend_io.cc
+++ b/chromium/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/location.h"
diff --git a/chromium/net/disk_cache/cache_util.cc b/chromium/net/disk_cache/cache_util.cc
index 79b260da885..2a4c34d5670 100644
--- a/chromium/net/disk_cache/cache_util.cc
+++ b/chromium/net/disk_cache/cache_util.cc
@@ -10,6 +10,7 @@
#include "base/files/file_enumerator.h"
#include "base/files/file_util.h"
#include "base/location.h"
+#include "base/metrics/field_trial_params.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -85,6 +86,9 @@ namespace disk_cache {
const int kDefaultCacheSize = 80 * 1024 * 1024;
+const base::Feature kChangeDiskCacheSizeExperiment{
+ "ChangeDiskCacheSize", base::FEATURE_DISABLED_BY_DEFAULT};
+
void DeleteCache(const base::FilePath& path, bool remove_folder) {
if (remove_folder) {
if (!base::DeletePathRecursively(path))
@@ -152,11 +156,42 @@ bool DelayedCacheCleanup(const base::FilePath& full_path) {
// Returns the preferred maximum number of bytes for the cache given the
// number of available bytes.
int PreferredCacheSize(int64_t available, net::CacheType type) {
+ // Percent of cache size to use, relative to the default size. "100" means to
+ // use 100% of the default size.
+ int percent_relative_size = 100;
+
+ if (base::FeatureList::IsEnabled(
+ disk_cache::kChangeDiskCacheSizeExperiment) &&
+ type == net::DISK_CACHE) {
+ percent_relative_size = base::GetFieldTrialParamByFeatureAsInt(
+ disk_cache::kChangeDiskCacheSizeExperiment, "percent_relative_size",
+ 100 /* default value */);
+ }
+
+ // Cap scaling, as a safety check, to avoid overflow.
+ if (percent_relative_size > 400)
+ percent_relative_size = 400;
+ else if (percent_relative_size < 100)
+ percent_relative_size = 100;
+
+ int64_t scaled_default_disk_cache_size =
+ (static_cast<int64_t>(disk_cache::kDefaultCacheSize) *
+ percent_relative_size) /
+ 100;
+
if (available < 0)
- return kDefaultCacheSize;
+ return static_cast<int32_t>(scaled_default_disk_cache_size);
int64_t preferred_cache_size = PreferredCacheSizeInternal(available);
+ // If the preferred cache size is less than 20% of the available space, scale
+ // for the field trial, capping the scaled value at 20% of the available
+ // space.
+ if (preferred_cache_size < available / 5) {
+ preferred_cache_size = std::min(
+ (preferred_cache_size * percent_relative_size) / 100, available / 5);
+ }
+
// Limit cache size to somewhat less than kint32max to avoid potential
// integer overflows in cache backend implementations.
//
@@ -164,7 +199,7 @@ int PreferredCacheSize(int64_t available, net::CacheType type) {
// from the blockfile backend with the following explanation:
// "Let's not use more than the default size while we tune-up the performance
// of bigger caches. "
- int64_t size_limit = static_cast<int64_t>(kDefaultCacheSize) * 4;
+ int64_t size_limit = scaled_default_disk_cache_size * 4;
// Native code entries can be large, so we would like a larger cache.
// Make the size limit 50% larger in that case.
if (type == net::GENERATED_NATIVE_CODE_CACHE) {
diff --git a/chromium/net/disk_cache/cache_util.h b/chromium/net/disk_cache/cache_util.h
index 2cfea3eb438..6a84dcd26f4 100644
--- a/chromium/net/disk_cache/cache_util.h
+++ b/chromium/net/disk_cache/cache_util.h
@@ -17,6 +17,10 @@ class FilePath;
namespace disk_cache {
+// Experiment to increase the cache size to see the impact on various
+// performance metrics.
+NET_EXPORT_PRIVATE extern const base::Feature kChangeDiskCacheSizeExperiment;
+
// Moves the cache files from the given path to another location.
// Fails if the destination exists already, or if it doesn't have
// permission for the operation. This is basically a rename operation
diff --git a/chromium/net/disk_cache/cache_util_unittest.cc b/chromium/net/disk_cache/cache_util_unittest.cc
index fcc0d14da23..180f092623a 100644
--- a/chromium/net/disk_cache/cache_util_unittest.cc
+++ b/chromium/net/disk_cache/cache_util_unittest.cc
@@ -8,6 +8,7 @@
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
+#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "net/disk_cache/cache_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -101,38 +102,53 @@ TEST_F(CacheUtilTest, DeleteCacheFile) {
TEST_F(CacheUtilTest, PreferredCacheSize) {
const struct TestCase {
int64_t available;
- int expected;
+ int expected_without_trial;
+ int expected_with_200_trial;
+ int expected_with_250_trial;
+ int expected_with_300_trial;
} kTestCases[] = {
// Weird negative value for available --- return the "default"
- {-1000LL, 80 * 1024 * 1024},
- {-1LL, 80 * 1024 * 1024},
+ {-1000LL, 80 * 1024 * 1024, 160 * 1024 * 1024, 200 * 1024 * 1024,
+ 240 * 1024 * 1024},
+ {-1LL, 80 * 1024 * 1024, 160 * 1024 * 1024, 200 * 1024 * 1024,
+ 240 * 1024 * 1024},
// 0 produces 0.
- {0LL, 0},
+ {0LL, 0, 0, 0, 0},
// Cache is 80% of available space, when default cache size is larger than
// 80% of available space..
- {50 * 1024 * 1024LL, 40 * 1024 * 1024},
+ {50 * 1024 * 1024LL, 40 * 1024 * 1024, 40 * 1024 * 1024, 40 * 1024 * 1024,
+ 40 * 1024 * 1024},
// Cache is default size, when default size is 10% to 80% of available
// space.
- {100 * 1024 * 1024LL, 80 * 1024 * 1024},
- {200 * 1024 * 1024LL, 80 * 1024 * 1024},
+ {100 * 1024 * 1024LL, 80 * 1024 * 1024, 80 * 1024 * 1024,
+ 80 * 1024 * 1024, 80 * 1024 * 1024},
+ {200 * 1024 * 1024LL, 80 * 1024 * 1024, 80 * 1024 * 1024,
+ 80 * 1024 * 1024, 80 * 1024 * 1024},
// Cache is 10% of available space if 2.5 * default size is more than 10%
// of available space.
- {1000 * 1024 * 1024LL, 100 * 1024 * 1024},
- {2000 * 1024 * 1024LL, 200 * 1024 * 1024},
+ {1000 * 1024 * 1024LL, 100 * 1024 * 1024, 200 * 1024 * 1024,
+ 200 * 1024 * 1024, 200 * 1024 * 1024},
+ {2000 * 1024 * 1024LL, 200 * 1024 * 1024, 400 * 1024 * 1024,
+ 400 * 1024 * 1024, 400 * 1024 * 1024},
// Cache is 2.5 * kDefaultCacheSize if 2.5 * kDefaultCacheSize uses from
// 1% to 10% of available space.
- {10000 * 1024 * 1024LL, 200 * 1024 * 1024},
+ {10000 * 1024 * 1024LL, 200 * 1024 * 1024, 400 * 1024 * 1024,
+ 500 * 1024 * 1024, 600 * 1024 * 1024},
// Otherwise, cache is 1% of available space.
- {20000 * 1024 * 1024LL, 200 * 1024 * 1024},
+ {20000 * 1024 * 1024LL, 200 * 1024 * 1024, 400 * 1024 * 1024,
+ 500 * 1024 * 1024, 600 * 1024 * 1024},
// Until it runs into the cache size cap.
- {32000 * 1024 * 1024LL, 320 * 1024 * 1024},
- {50000 * 1024 * 1024LL, 320 * 1024 * 1024},
+ {32000 * 1024 * 1024LL, 320 * 1024 * 1024, 640 * 1024 * 1024,
+ 800 * 1024 * 1024, 960 * 1024 * 1024},
+ {50000 * 1024 * 1024LL, 320 * 1024 * 1024, 640 * 1024 * 1024,
+ 800 * 1024 * 1024, 960 * 1024 * 1024},
};
for (const auto& test_case : kTestCases) {
- EXPECT_EQ(test_case.expected, PreferredCacheSize(test_case.available))
+ EXPECT_EQ(test_case.expected_without_trial,
+ PreferredCacheSize(test_case.available))
<< test_case.available;
}
@@ -140,6 +156,61 @@ TEST_F(CacheUtilTest, PreferredCacheSize) {
EXPECT_EQ(((320 * 1024 * 1024) / 2) * 3,
PreferredCacheSize(50000 * 1024 * 1024LL,
net::GENERATED_NATIVE_CODE_CACHE));
+
+ for (int cache_size_exeriment : {100, 200, 250, 300}) {
+ base::test::ScopedFeatureList scoped_feature_list;
+ std::map<std::string, std::string> field_trial_params;
+ field_trial_params["percent_relative_size"] =
+ base::NumberToString(cache_size_exeriment);
+ scoped_feature_list.InitAndEnableFeatureWithParameters(
+ disk_cache::kChangeDiskCacheSizeExperiment, field_trial_params);
+
+ for (const auto& test_case : kTestCases) {
+ int expected = 0;
+ switch (cache_size_exeriment) {
+ case 100:
+ expected = test_case.expected_without_trial;
+ break;
+ case 200:
+ expected = test_case.expected_with_200_trial;
+ break;
+ case 250:
+ expected = test_case.expected_with_250_trial;
+ break;
+ case 300:
+ expected = test_case.expected_with_300_trial;
+ break;
+ }
+
+ EXPECT_EQ(expected, PreferredCacheSize(test_case.available));
+
+ // For caches other than disk cache, the size is not scaled.
+ EXPECT_EQ(test_case.expected_without_trial,
+ PreferredCacheSize(test_case.available,
+ net::GENERATED_BYTE_CODE_CACHE));
+ }
+
+ // Check that the cache size cap is 50% higher for native code caches but is
+ // not scaled for the experiment.
+ EXPECT_EQ(((320 * 1024 * 1024) / 2) * 3,
+ PreferredCacheSize(50000 * 1024 * 1024LL,
+ net::GENERATED_NATIVE_CODE_CACHE));
+ }
+
+ // Check no "percent_relative_size" matches default behavior.
+ {
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ disk_cache::kChangeDiskCacheSizeExperiment);
+ for (const auto& test_case : kTestCases) {
+ EXPECT_EQ(test_case.expected_without_trial,
+ PreferredCacheSize(test_case.available));
+ }
+ // Check that the cache size cap is 50% higher for native code caches.
+ EXPECT_EQ(((320 * 1024 * 1024) / 2) * 3,
+ PreferredCacheSize(50000 * 1024 * 1024LL,
+ net::GENERATED_NATIVE_CODE_CACHE));
+ }
}
} // namespace disk_cache
diff --git a/chromium/net/disk_cache/entry_unittest.cc b/chromium/net/disk_cache/entry_unittest.cc
index 6030b7920d9..e039bcd8ef7 100644
--- a/chromium/net/disk_cache/entry_unittest.cc
+++ b/chromium/net/disk_cache/entry_unittest.cc
@@ -5,7 +5,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/files/file.h"
#include "base/files/file_util.h"
#include "base/macros.h"
@@ -3719,9 +3719,9 @@ TEST_F(DiskCacheEntryTest, SimpleCacheDoomCreateOptimistic) {
base::MakeRefCounted<net::IOBuffer>(kSize);
CacheTestFillBuffer(buf_1->data(), kSize, false);
- EXPECT_EQ(kSize, WriteData(entry2, /* stream_index = */ 1, /* offset = */ 0,
+ EXPECT_EQ(kSize, WriteData(entry2, /* index = */ 1, /* offset = */ 0,
buf_1.get(), kSize, /* truncate = */ false));
- EXPECT_EQ(kSize, ReadData(entry2, /* stream_index = */ 1, /* offset = */ 0,
+ EXPECT_EQ(kSize, ReadData(entry2, /* index = */ 1, /* offset = */ 0,
buf_2.get(), kSize));
doom_callback.WaitForResult();
@@ -5288,24 +5288,24 @@ void DiskCacheEntryTest::TruncateBackwards() {
scoped_refptr<net::IOBuffer> read_buf =
base::MakeRefCounted<net::IOBuffer>(kBigSize);
- ASSERT_EQ(kSmallSize, WriteData(entry, /* stream_index = */ 0,
+ ASSERT_EQ(kSmallSize, WriteData(entry, /* index = */ 0,
/* offset = */ kBigSize, buffer.get(),
/* size = */ kSmallSize,
/* truncate = */ false));
memset(read_buf->data(), 0, kBigSize);
- ASSERT_EQ(kSmallSize, ReadData(entry, /* stream_index = */ 0,
+ ASSERT_EQ(kSmallSize, ReadData(entry, /* index = */ 0,
/* offset = */ kBigSize, read_buf.get(),
/* size = */ kSmallSize));
EXPECT_EQ(0, memcmp(read_buf->data(), buffer->data(), kSmallSize));
// A partly overlapping truncate before the previous write.
ASSERT_EQ(kBigSize,
- WriteData(entry, /* stream_index = */ 0,
+ WriteData(entry, /* index = */ 0,
/* offset = */ 3, buffer.get(), /* size = */ kBigSize,
/* truncate = */ true));
memset(read_buf->data(), 0, kBigSize);
ASSERT_EQ(kBigSize,
- ReadData(entry, /* stream_index = */ 0,
+ ReadData(entry, /* index = */ 0,
/* offset = */ 3, read_buf.get(), /* size = */ kBigSize));
EXPECT_EQ(0, memcmp(read_buf->data(), buffer->data(), kBigSize));
EXPECT_EQ(kBigSize + 3, entry->GetDataSize(0));
@@ -5345,15 +5345,15 @@ void DiskCacheEntryTest::ZeroWriteBackwards() {
// Offset here needs to be > blockfile's kMaxBlockSize to hit
// https://crbug.com/946538, as writes close to beginning are handled
// specially.
- EXPECT_EQ(0, WriteData(entry, /* stream_index = */ 0,
+ EXPECT_EQ(0, WriteData(entry, /* index = */ 0,
/* offset = */ 17000, buffer.get(),
/* size = */ 0, /* truncate = */ true));
- EXPECT_EQ(0, WriteData(entry, /* stream_index = */ 0,
+ EXPECT_EQ(0, WriteData(entry, /* index = */ 0,
/* offset = */ 0, buffer.get(),
/* size = */ 0, /* truncate = */ false));
- EXPECT_EQ(kSize, ReadData(entry, /* stream_index = */ 0,
+ EXPECT_EQ(kSize, ReadData(entry, /* index = */ 0,
/* offset = */ 0, buffer.get(),
/* size = */ kSize));
for (int i = 0; i < kSize; ++i) {
diff --git a/chromium/net/disk_cache/simple/DIR_METADATA b/chromium/net/disk_cache/simple/DIR_METADATA
new file mode 100644
index 00000000000..0303d46d676
--- /dev/null
+++ b/chromium/net/disk_cache/simple/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Cache>Simple"
+} \ No newline at end of file
diff --git a/chromium/net/disk_cache/simple/OWNERS b/chromium/net/disk_cache/simple/OWNERS
deleted file mode 100644
index 2deb5d4aeff..00000000000
--- a/chromium/net/disk_cache/simple/OWNERS
+++ /dev/null
@@ -1 +0,0 @@
-# COMPONENT: Internals>Network>Cache>Simple
diff --git a/chromium/net/disk_cache/simple/simple_entry_impl.cc b/chromium/net/disk_cache/simple/simple_entry_impl.cc
index 9cb637beec0..38581eff4a5 100644
--- a/chromium/net/disk_cache/simple/simple_entry_impl.cc
+++ b/chromium/net/disk_cache/simple/simple_entry_impl.cc
@@ -11,8 +11,8 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/location.h"
#include "base/notreached.h"
diff --git a/chromium/net/disk_cache/simple/simple_index.cc b/chromium/net/disk_cache/simple/simple_index.cc
index 7e65f1aad68..55abd97d0d2 100644
--- a/chromium/net/disk_cache/simple/simple_index.cc
+++ b/chromium/net/disk_cache/simple/simple_index.cc
@@ -10,7 +10,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/files/file_util.h"
#include "base/numerics/safe_conversions.h"
diff --git a/chromium/net/disk_cache/simple/simple_index_unittest.cc b/chromium/net/disk_cache/simple/simple_index_unittest.cc
index 2f70905c705..48733e78cc9 100644
--- a/chromium/net/disk_cache/simple/simple_index_unittest.cc
+++ b/chromium/net/disk_cache/simple/simple_index_unittest.cc
@@ -16,7 +16,6 @@
#include "base/strings/stringprintf.h"
#include "base/task_runner.h"
#include "base/test/mock_entropy_provider.h"
-#include "base/test/scoped_feature_list.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
#include "net/base/cache_type.h"
diff --git a/chromium/net/dns/BUILD.gn b/chromium/net/dns/BUILD.gn
index cf884bbc69e..bc54c81d1aa 100644
--- a/chromium/net/dns/BUILD.gn
+++ b/chromium/net/dns/BUILD.gn
@@ -5,12 +5,6 @@
import("//net/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
-# Reset sources_assignment_filter for the BUILD.gn file to prevent
-# regression during the migration of Chromium away from the feature.
-# See docs/no_sources_assignment_filter.md for more information.
-# TODO(crbug.com/1018739): remove this when migration is done.
-set_sources_assignment_filter([])
-
enable_built_in_dns = !is_ios
source_set("dns") {
@@ -71,6 +65,7 @@ source_set("dns") {
"host_resolver_mdns_task.h",
"host_resolver_proc.cc",
"host_resolver_proc.h",
+ "https_record_rdata.cc",
"httpssvc_metrics.cc",
"httpssvc_metrics.h",
"mapped_host_resolver.cc",
@@ -319,6 +314,7 @@ source_set("dns_client") {
"dns_client.h",
"dns_response.h",
"dns_transaction.h",
+ "https_record_rdata.h",
"record_parsed.h",
"record_rdata.h",
]
@@ -402,6 +398,7 @@ source_set("tests") {
"dns_util_unittest.cc",
"host_cache_unittest.cc",
"host_resolver_manager_unittest.cc",
+ "https_record_rdata_unittest.cc",
"httpssvc_metrics_unittest.cc",
"mapped_host_resolver_unittest.cc",
"record_parsed_unittest.cc",
@@ -517,6 +514,16 @@ fuzzer_test("net_dns_hosts_parse_fuzzer") {
dict = "//net/data/fuzzer_dictionaries/net_dns_hosts_parse_fuzzer.dict"
}
+fuzzer_test("net_dns_https_record_rdata_fuzzer") {
+ sources = [ "https_record_rdata_fuzzer.cc" ]
+ deps = [
+ "//base",
+ "//net",
+ "//net:net_fuzzer_test_support",
+ ]
+ dict = "//net/data/fuzzer_dictionaries/net_dns_record_fuzzer.dict"
+}
+
fuzzer_test("net_dns_integrity_record_fuzzer") {
sources = [ "integrity_record_fuzzer.cc" ]
deps = [
diff --git a/chromium/net/dns/DIR_METADATA b/chromium/net/dns/DIR_METADATA
new file mode 100644
index 00000000000..23af0ebe901
--- /dev/null
+++ b/chromium/net/dns/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>DNS"
+} \ No newline at end of file
diff --git a/chromium/net/dns/OWNERS b/chromium/net/dns/OWNERS
index d3da14c04a1..6dc6cd3e522 100644
--- a/chromium/net/dns/OWNERS
+++ b/chromium/net/dns/OWNERS
@@ -1,3 +1 @@
ericorth@chromium.org
-
-# COMPONENT: Internals>Network>DNS
diff --git a/chromium/net/dns/context_host_resolver_unittest.cc b/chromium/net/dns/context_host_resolver_unittest.cc
index e50efce5a08..36127689b64 100644
--- a/chromium/net/dns/context_host_resolver_unittest.cc
+++ b/chromium/net/dns/context_host_resolver_unittest.cc
@@ -96,7 +96,7 @@ TEST_F(ContextHostResolverTest, Resolve) {
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", kEndpoint.address())),
false /* delay */, &context);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -126,7 +126,7 @@ TEST_F(ContextHostResolverTest, DestroyRequest) {
// Set up delayed results for "example.com".
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", IPAddress(1, 2, 3, 4))),
true /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -222,14 +222,14 @@ TEST_F(ContextHostResolverTest, DestroyResolver) {
// Set up delayed results for "example.com" and "google.com".
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", IPAddress(2, 3, 4, 5))),
true /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
false /* delay */);
rules.emplace_back("google.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"google.com", kEndpoint.address())),
true /* delay */);
rules.emplace_back("google.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -278,7 +278,7 @@ TEST_F(ContextHostResolverTest, DestroyResolver) {
TEST_F(ContextHostResolverTest, DestroyResolver_CompletedRequests) {
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", kEndpoint.address())),
false /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -334,7 +334,7 @@ TEST_F(ContextHostResolverTest, DestroyResolver_DelayedStartRequest) {
// Set up delayed result for "example.com".
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", IPAddress(2, 3, 4, 5))),
true /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -384,7 +384,7 @@ TEST_F(ContextHostResolverTest, OnShutdown_PendingRequest) {
// Set up delayed result for "example.com".
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", IPAddress(2, 3, 4, 5))),
true /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -440,7 +440,7 @@ TEST_F(ContextHostResolverTest, OnShutdown_DohProbeRequest) {
TEST_F(ContextHostResolverTest, OnShutdown_CompletedRequests) {
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", kEndpoint.address())),
false /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -526,7 +526,7 @@ TEST_F(ContextHostResolverTest, OnShutdown_DelayedStartRequest) {
// Set up delayed result for "example.com".
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", IPAddress(2, 3, 4, 5))),
true /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -621,7 +621,7 @@ TEST_F(ContextHostResolverTest, ResolveFromCache) {
TEST_F(ContextHostResolverTest, ResultsAddedToCache) {
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", kEndpoint.address())),
false /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
@@ -670,7 +670,7 @@ TEST_F(ContextHostResolverTest, ResultsAddedToCacheWithNetworkIsolationKey) {
MockDnsClientRuleList rules;
rules.emplace_back("example.com", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(
+ MockDnsClientRule::Result(BuildTestDnsAddressResponse(
"example.com", kEndpoint.address())),
false /* delay */);
rules.emplace_back("example.com", dns_protocol::kTypeAAAA, false /* secure */,
diff --git a/chromium/net/dns/dns_config.cc b/chromium/net/dns/dns_config.cc
index 32658070676..45a26ede13e 100644
--- a/chromium/net/dns/dns_config.cc
+++ b/chromium/net/dns/dns_config.cc
@@ -10,8 +10,8 @@
namespace net {
-// Default values are taken from glibc resolv.h except timeout which is set to
-// |kDnsDefaultTimeoutMs|.
+// Default values are taken from glibc resolv.h except |fallback_period| which
+// is set to |kDnsDefaultFallbackPeriod|.
DnsConfig::DnsConfig() : DnsConfig(std::vector<IPEndPoint>()) {}
DnsConfig::DnsConfig(const DnsConfig& other) = default;
@@ -25,7 +25,7 @@ DnsConfig::DnsConfig(std::vector<IPEndPoint> nameservers)
unhandled_options(false),
append_to_multi_label_name(true),
ndots(1),
- timeout(kDnsDefaultTimeout),
+ fallback_period(kDnsDefaultFallbackPeriod),
attempts(2),
doh_attempts(1),
rotate(false),
@@ -57,7 +57,7 @@ bool DnsConfig::EqualsIgnoreHosts(const DnsConfig& d) const {
(dns_over_tls_hostname == d.dns_over_tls_hostname) &&
(search == d.search) && (unhandled_options == d.unhandled_options) &&
(append_to_multi_label_name == d.append_to_multi_label_name) &&
- (ndots == d.ndots) && (timeout == d.timeout) &&
+ (ndots == d.ndots) && (fallback_period == d.fallback_period) &&
(attempts == d.attempts) && (doh_attempts == d.doh_attempts) &&
(rotate == d.rotate) && (use_local_ipv6 == d.use_local_ipv6) &&
(dns_over_https_servers == d.dns_over_https_servers) &&
@@ -74,7 +74,7 @@ void DnsConfig::CopyIgnoreHosts(const DnsConfig& d) {
unhandled_options = d.unhandled_options;
append_to_multi_label_name = d.append_to_multi_label_name;
ndots = d.ndots;
- timeout = d.timeout;
+ fallback_period = d.fallback_period;
attempts = d.attempts;
doh_attempts = d.doh_attempts;
rotate = d.rotate;
@@ -103,7 +103,7 @@ base::Value DnsConfig::ToValue() const {
dict.SetBoolKey("unhandled_options", unhandled_options);
dict.SetBoolKey("append_to_multi_label_name", append_to_multi_label_name);
dict.SetIntKey("ndots", ndots);
- dict.SetDoubleKey("timeout", timeout.InSecondsF());
+ dict.SetDoubleKey("timeout", fallback_period.InSecondsF());
dict.SetIntKey("attempts", attempts);
dict.SetIntKey("doh_attempts", doh_attempts);
dict.SetBoolKey("rotate", rotate);
diff --git a/chromium/net/dns/dns_config.h b/chromium/net/dns/dns_config.h
index 96e8540d45f..1e41f771439 100644
--- a/chromium/net/dns/dns_config.h
+++ b/chromium/net/dns/dns_config.h
@@ -22,8 +22,8 @@ class Value;
namespace net {
-// Default to 1 second timeout (before exponential backoff).
-constexpr base::TimeDelta kDnsDefaultTimeout = base::TimeDelta::FromSeconds(1);
+constexpr base::TimeDelta kDnsDefaultFallbackPeriod =
+ base::TimeDelta::FromSeconds(1);
// DnsConfig stores configuration of the system resolver.
struct NET_EXPORT DnsConfig {
@@ -78,7 +78,10 @@ struct NET_EXPORT DnsConfig {
// Minimum number of dots before global resolution precedes |search|.
int ndots;
// Time between retransmissions, see res_state.retrans.
- base::TimeDelta timeout;
+ // Used by Chrome as the initial transaction attempt fallback period (before
+ // exponential backoff and dynamic period determination based on previous
+ // attempts.)
+ base::TimeDelta fallback_period;
// Maximum number of attempts, see res_state.retry.
int attempts;
// Maximum number of times a DoH server is attempted per attempted per DNS
diff --git a/chromium/net/dns/dns_config_service_posix.cc b/chromium/net/dns/dns_config_service_posix.cc
index 5a4aead0acf..4d4df80fe6c 100644
--- a/chromium/net/dns/dns_config_service_posix.cc
+++ b/chromium/net/dns/dns_config_service_posix.cc
@@ -189,8 +189,8 @@ ConfigParsePosixResult ReadDnsConfig(DnsConfig* dns_config) {
return error;
}
#endif // defined(OS_MAC)
- // Override timeout value to match default setting on Windows.
- dns_config->timeout = kDnsDefaultTimeout;
+ // Override |fallback_period| value to match default setting on Windows.
+ dns_config->fallback_period = kDnsDefaultFallbackPeriod;
return result;
#else // defined(OS_ANDROID)
dns_config->nameservers.clear();
@@ -537,7 +537,7 @@ ConfigParsePosixResult ConvertResStateToDnsConfig(const struct __res_state& res,
}
dns_config->ndots = res.ndots;
- dns_config->timeout = base::TimeDelta::FromSeconds(res.retrans);
+ dns_config->fallback_period = base::TimeDelta::FromSeconds(res.retrans);
dns_config->attempts = res.retry;
#if defined(RES_ROTATE)
dns_config->rotate = res.options & RES_ROTATE;
diff --git a/chromium/net/dns/dns_config_service_posix_unittest.cc b/chromium/net/dns/dns_config_service_posix_unittest.cc
index a98dffb783f..e8ce230ada5 100644
--- a/chromium/net/dns/dns_config_service_posix_unittest.cc
+++ b/chromium/net/dns/dns_config_service_posix_unittest.cc
@@ -118,7 +118,7 @@ void CloseResState(res_state res) {
void InitializeExpectedConfig(DnsConfig* config) {
config->ndots = 2;
- config->timeout = base::TimeDelta::FromSeconds(4);
+ config->fallback_period = base::TimeDelta::FromSeconds(4);
config->attempts = 7;
config->rotate = true;
config->append_to_multi_label_name = true;
diff --git a/chromium/net/dns/dns_query.cc b/chromium/net/dns/dns_query.cc
index 2e33f4f3543..c80f9d4a1f8 100644
--- a/chromium/net/dns/dns_query.cc
+++ b/chromium/net/dns/dns_query.cc
@@ -100,7 +100,10 @@ DnsQuery::DnsQuery(uint16_t id,
const OptRecordRdata* opt_rdata,
PaddingStrategy padding_strategy)
: qname_size_(qname.size()) {
- DCHECK(!DNSDomainToString(qname).empty());
+#if DCHECK_IS_ON()
+ base::Optional<std::string> dotted_name = DnsDomainToString(qname);
+ DCHECK(dotted_name && !dotted_name.value().empty());
+#endif // DCHECK_IS_ON()
size_t buffer_size = kHeaderSize + QuestionSize(qname_size_);
base::Optional<OptRecordRdata> merged_opt_rdata =
diff --git a/chromium/net/dns/dns_response.cc b/chromium/net/dns/dns_response.cc
index 860eebbc5e7..7d33499b079 100644
--- a/chromium/net/dns/dns_response.cc
+++ b/chromium/net/dns/dns_response.cc
@@ -260,7 +260,8 @@ DnsResponse::DnsResponse(
const std::vector<DnsResourceRecord>& authority_records,
const std::vector<DnsResourceRecord>& additional_records,
const base::Optional<DnsQuery>& query,
- uint8_t rcode) {
+ uint8_t rcode,
+ bool validate_answers_match_query) {
bool has_query = query.has_value();
dns_protocol::Header header;
header.id = id;
@@ -309,7 +310,8 @@ DnsResponse::DnsResponse(
}
// Start the Answer section.
for (const auto& answer : answers) {
- success &= WriteAnswer(&writer, answer, query);
+ success &=
+ WriteAnswer(&writer, answer, query, validate_answers_match_query);
DCHECK(success);
}
// Start the Authority section.
@@ -355,6 +357,9 @@ DnsResponse::DnsResponse(const void* data, size_t length, size_t answer_offset)
memcpy(io_buffer_->data(), data, length);
}
+DnsResponse::DnsResponse(DnsResponse&& other) = default;
+DnsResponse& DnsResponse::operator=(DnsResponse&& other) = default;
+
DnsResponse::~DnsResponse() = default;
bool DnsResponse::InitParse(size_t nbytes, const DnsQuery& query) {
@@ -443,6 +448,11 @@ unsigned DnsResponse::answer_count() const {
return base::NetToHost16(header()->ancount);
}
+unsigned DnsResponse::authority_count() const {
+ DCHECK(parser_.IsValid());
+ return base::NetToHost16(header()->nscount);
+}
+
unsigned DnsResponse::additional_answer_count() const {
DCHECK(parser_.IsValid());
return base::NetToHost16(header()->arcount);
@@ -468,7 +478,7 @@ uint16_t DnsResponse::qtype() const {
}
std::string DnsResponse::GetDottedName() const {
- return DNSDomainToString(qname());
+ return DnsDomainToString(qname()).value_or("");
}
DnsRecordParser DnsResponse::Parser() const {
@@ -482,8 +492,8 @@ const dns_protocol::Header* DnsResponse::header() const {
}
DnsResponse::Result DnsResponse::ParseToAddressList(
- AddressList* addr_list,
- base::TimeDelta* ttl) const {
+ AddressList* out_addr_list,
+ base::Optional<base::TimeDelta>* out_ttl) const {
DCHECK(IsValid());
// DnsTransaction already verified that |response| matches the issued query.
// We still need to determine if there is a valid chain of CNAMEs from the
@@ -502,7 +512,7 @@ DnsResponse::Result DnsResponse::ParseToAddressList(
? IPAddress::kIPv6AddressSize
: IPAddress::kIPv4AddressSize;
- uint32_t ttl_sec = std::numeric_limits<uint32_t>::max();
+ base::Optional<base::TimeDelta> ttl;
IPAddressList ip_addresses;
DnsRecordParser parser = Parser();
DnsResourceRecord record;
@@ -512,6 +522,7 @@ DnsResponse::Result DnsResponse::ParseToAddressList(
if (!parser.ReadRecord(&record))
return DNS_MALFORMED_RESPONSE;
+ base::TimeDelta record_ttl = base::TimeDelta::FromSeconds(record.ttl);
if (record.type == dns_protocol::kTypeCNAME) {
// Following the CNAME chain, only if no addresses seen.
if (!ip_addresses.empty())
@@ -524,7 +535,7 @@ DnsResponse::Result DnsResponse::ParseToAddressList(
parser.ReadName(record.rdata.begin(), &expected_name))
return DNS_MALFORMED_CNAME;
- ttl_sec = std::min(ttl_sec, record.ttl);
+ ttl = std::min(ttl.value_or(base::TimeDelta::Max()), record_ttl);
} else if (record.type == expected_type) {
if (record.rdata.size() != expected_size)
return DNS_SIZE_MISMATCH;
@@ -532,7 +543,7 @@ DnsResponse::Result DnsResponse::ParseToAddressList(
if (!base::EqualsCaseInsensitiveASCII(record.name, expected_name))
return DNS_NAME_MISMATCH;
- ttl_sec = std::min(ttl_sec, record.ttl);
+ ttl = std::min(ttl.value_or(base::TimeDelta::Max()), record_ttl);
ip_addresses.push_back(
IPAddress(reinterpret_cast<const uint8_t*>(record.rdata.data()),
record.rdata.length()));
@@ -542,18 +553,27 @@ DnsResponse::Result DnsResponse::ParseToAddressList(
// NXDOMAIN or NODATA cases respectively.
if (rcode() == dns_protocol::kRcodeNXDOMAIN ||
(ancount == 0 && rcode() == dns_protocol::kRcodeNOERROR)) {
+ bool soa_found = false;
unsigned nscount = base::NetToHost16(header()->nscount);
for (unsigned i = 0; i < nscount; ++i) {
- if (parser.ReadRecord(&record) && record.type == dns_protocol::kTypeSOA)
- ttl_sec = std::min(ttl_sec, record.ttl);
+ if (parser.ReadRecord(&record) && record.type == dns_protocol::kTypeSOA) {
+ soa_found = true;
+ base::TimeDelta record_ttl = base::TimeDelta::FromSeconds(record.ttl);
+ ttl = std::min(ttl.value_or(base::TimeDelta::Max()), record_ttl);
+ }
}
+
+ // Per RFC2308, section 5, never cache negative results unless an SOA
+ // record is found.
+ if (!soa_found)
+ ttl.reset();
}
// getcanonname in eglibc returns the first owner name of an A or AAAA RR.
// If the response passed all the checks so far, then |expected_name| is it.
- *addr_list = AddressList::CreateFromIPAddressList(ip_addresses,
- expected_name);
- *ttl = base::TimeDelta::FromSeconds(ttl_sec);
+ *out_addr_list =
+ AddressList::CreateFromIPAddressList(ip_addresses, expected_name);
+ *out_ttl = ttl;
return DNS_PARSE_OK;
}
@@ -597,10 +617,12 @@ bool DnsResponse::WriteRecord(base::BigEndianWriter* writer,
bool DnsResponse::WriteAnswer(base::BigEndianWriter* writer,
const DnsResourceRecord& answer,
- const base::Optional<DnsQuery>& query) {
+ const base::Optional<DnsQuery>& query,
+ bool validate_answer_matches_query) {
// Generally assumed to be a mistake if we write answers that don't match the
// query type, except CNAME answers which can always be added.
- if (query.has_value() && answer.type != query.value().qtype() &&
+ if (validate_answer_matches_query && query.has_value() &&
+ answer.type != query.value().qtype() &&
answer.type != dns_protocol::kTypeCNAME) {
VLOG(1) << "Mismatched answer resource record type and qtype.";
return false;
diff --git a/chromium/net/dns/dns_response.h b/chromium/net/dns/dns_response.h
index b7fa79aadc5..6bc51c9c676 100644
--- a/chromium/net/dns/dns_response.h
+++ b/chromium/net/dns/dns_response.h
@@ -139,7 +139,8 @@ class NET_EXPORT_PRIVATE DnsResponse {
const std::vector<DnsResourceRecord>& authority_records,
const std::vector<DnsResourceRecord>& additional_records,
const base::Optional<DnsQuery>& query,
- uint8_t rcode = dns_protocol::kRcodeNOERROR);
+ uint8_t rcode = dns_protocol::kRcodeNOERROR,
+ bool validate_answers_match_query = true);
// Constructs a response buffer of given length. Used for TCP transactions.
explicit DnsResponse(size_t length);
@@ -150,11 +151,16 @@ class NET_EXPORT_PRIVATE DnsResponse {
// Constructs a response from |data|. Used for testing purposes only!
DnsResponse(const void* data, size_t length, size_t answer_offset);
+ // Move-only.
+ DnsResponse(DnsResponse&& other);
+ DnsResponse& operator=(DnsResponse&& other);
+
~DnsResponse();
// Internal buffer accessor into which actual bytes of response will be
// read.
IOBuffer* io_buffer() { return io_buffer_.get(); }
+ const IOBuffer* io_buffer() const { return io_buffer_.get(); }
// Size of the internal buffer.
size_t io_buffer_size() const { return io_buffer_size_; }
@@ -186,6 +192,7 @@ class NET_EXPORT_PRIVATE DnsResponse {
uint8_t rcode() const;
unsigned answer_count() const;
+ unsigned authority_count() const;
unsigned additional_answer_count() const;
// Accessors to the question. The qname is unparsed.
@@ -202,7 +209,8 @@ class NET_EXPORT_PRIVATE DnsResponse {
// Extracts an AddressList from this response. Returns SUCCESS if succeeded.
// Otherwise returns a detailed error number.
- Result ParseToAddressList(AddressList* addr_list, base::TimeDelta* ttl) const;
+ Result ParseToAddressList(AddressList* out_addr_list,
+ base::Optional<base::TimeDelta>* out_ttl) const;
private:
bool WriteHeader(base::BigEndianWriter* writer,
@@ -212,7 +220,8 @@ class NET_EXPORT_PRIVATE DnsResponse {
const DnsResourceRecord& record);
bool WriteAnswer(base::BigEndianWriter* writer,
const DnsResourceRecord& answer,
- const base::Optional<DnsQuery>& query);
+ const base::Optional<DnsQuery>& query,
+ bool validate_answer_matches_query);
// Convenience for header access.
const dns_protocol::Header* header() const;
@@ -227,8 +236,6 @@ class NET_EXPORT_PRIVATE DnsResponse {
// It is never updated afterwards, so can be used in accessors.
DnsRecordParser parser_;
bool id_available_ = false;
-
- DISALLOW_COPY_AND_ASSIGN(DnsResponse);
};
} // namespace net
diff --git a/chromium/net/dns/dns_response_unittest.cc b/chromium/net/dns/dns_response_unittest.cc
index 17705d7f3b7..794358ae613 100644
--- a/chromium/net/dns/dns_response_unittest.cc
+++ b/chromium/net/dns/dns_response_unittest.cc
@@ -574,15 +574,44 @@ void VerifyAddressList(const std::vector<const char*>& ip_addresses,
}
}
+static const uint8_t kResponseNoDataWithSoa[] = {
+ // Header
+ 0x00, 0x00, 0x81, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ // Question (name: "query" type: A)
+ 0x05, 'q', 'u', 'e', 'r', 'y', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answers (empty)
+ // Authority records (single minimally faked SOA with TTL: 2 days)
+ 0xc0, 0x0c, 0x00, 0x06, 0x00, 0x01, 0x00, 0x02, 0xa3, 0x00, 0x00, 0x00};
+
+static const uint8_t kResponseNxdomainCnameWithSoa[] = {
+ // Header
+ 0x00, 0x00, 0x81, 0x83, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00,
+ // Question (name: "query" type: A)
+ 0x05, 'q', 'u', 'e', 'r', 'y', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answers (CNAME "query"->"canon" TTL: 48 minutes)
+ 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x07,
+ 0x05, 'c', 'a', 'n', 'o', 'n', 0x00,
+ // Authority records (single minimally faked SOA with TTL: 2 days)
+ 0xc0, 0x0c, 0x00, 0x06, 0x00, 0x01, 0x00, 0x02, 0xa3, 0x00, 0x00, 0x00};
+
+static const uint8_t kResponseNxdomainCnameWithoutSoa[] = {
+ // Header
+ 0x00, 0x00, 0x81, 0x83, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ // Question (name: "query" type: A)
+ 0x05, 'q', 'u', 'e', 'r', 'y', 0x00, 0x00, 0x01, 0x00, 0x01,
+ // Answers (CNAME "query"->"canon" TTL: 48 minutes)
+ 0xc0, 0x0c, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x07,
+ 0x05, 'c', 'a', 'n', 'o', 'n', 0x00};
+
TEST(DnsResponseTest, ParseToAddressList) {
const struct TestCase {
- size_t query_size;
+ size_t answers_offset;
const uint8_t* response_data;
size_t response_size;
const char* const* expected_addresses;
size_t num_expected_addresses;
const char* expected_cname;
- int expected_ttl_sec;
+ base::Optional<base::TimeDelta> expected_ttl;
} cases[] = {
{
kT0QuerySize,
@@ -591,7 +620,7 @@ TEST(DnsResponseTest, ParseToAddressList) {
kT0IpAddresses,
base::size(kT0IpAddresses),
kT0CanonName,
- kT0TTL,
+ kT0Ttl,
},
{
kT1QuerySize,
@@ -600,7 +629,7 @@ TEST(DnsResponseTest, ParseToAddressList) {
kT1IpAddresses,
base::size(kT1IpAddresses),
kT1CanonName,
- kT1TTL,
+ kT1Ttl,
},
{
kT2QuerySize,
@@ -609,7 +638,7 @@ TEST(DnsResponseTest, ParseToAddressList) {
kT2IpAddresses,
base::size(kT2IpAddresses),
kT2CanonName,
- kT2TTL,
+ kT2Ttl,
},
{
kT3QuerySize,
@@ -618,15 +647,42 @@ TEST(DnsResponseTest, ParseToAddressList) {
kT3IpAddresses,
base::size(kT3IpAddresses),
kT3CanonName,
- kT3TTL,
+ kT3Ttl,
+ },
+ {
+ 12 + 11,
+ kResponseNoDataWithSoa,
+ base::size(kResponseNoDataWithSoa),
+ {} /* expected_addresses */,
+ 0 /* num_expected_addresses */,
+ "query",
+ base::TimeDelta::FromDays(2),
+ },
+ {
+ 12 + 11,
+ kResponseNxdomainCnameWithSoa,
+ base::size(kResponseNxdomainCnameWithSoa),
+ {} /* expected_addresses */,
+ 0 /* num_expected_addresses */,
+ "canon",
+ base::TimeDelta::FromMinutes(48),
+ },
+ {
+ 12 + 11,
+ kResponseNxdomainCnameWithoutSoa,
+ base::size(kResponseNxdomainCnameWithoutSoa),
+ {} /* expected_addresses */,
+ 0 /* num_expected_addresses */,
+ "canon",
+ base::nullopt,
},
};
for (size_t i = 0; i < base::size(cases); ++i) {
const TestCase& t = cases[i];
- DnsResponse response(t.response_data, t.response_size, t.query_size);
+ DnsResponse response(t.response_data, t.response_size, t.answers_offset);
AddressList addr_list;
- base::TimeDelta ttl;
+ base::Optional<base::TimeDelta> ttl;
EXPECT_EQ(DnsResponse::DNS_PARSE_OK,
response.ParseToAddressList(&addr_list, &ttl));
std::vector<const char*> expected_addresses(
@@ -634,7 +690,7 @@ TEST(DnsResponseTest, ParseToAddressList) {
t.expected_addresses + t.num_expected_addresses);
VerifyAddressList(expected_addresses, addr_list);
EXPECT_EQ(t.expected_cname, addr_list.canonical_name());
- EXPECT_EQ(base::TimeDelta::FromSeconds(t.expected_ttl_sec), ttl);
+ EXPECT_EQ(t.expected_ttl, ttl);
}
}
@@ -751,7 +807,7 @@ TEST(DnsResponseTest, ParseToAddressListFail) {
DnsResponse response(t.data, t.size, kQuerySize);
AddressList addr_list;
- base::TimeDelta ttl;
+ base::Optional<base::TimeDelta> ttl;
EXPECT_EQ(t.expected_result,
response.ParseToAddressList(&addr_list, &ttl));
}
diff --git a/chromium/net/dns/dns_server_iterator.h b/chromium/net/dns/dns_server_iterator.h
index 97c42f73002..3a775edaace 100644
--- a/chromium/net/dns/dns_server_iterator.h
+++ b/chromium/net/dns/dns_server_iterator.h
@@ -5,6 +5,7 @@
#ifndef NET_DNS_DNS_SERVER_ITERATOR_H_
#define NET_DNS_DNS_SERVER_ITERATOR_H_
+#include <stddef.h>
#include <vector>
#include "net/base/net_export.h"
diff --git a/chromium/net/dns/dns_test_util.cc b/chromium/net/dns/dns_test_util.cc
index 6a39447c08f..80416dae327 100644
--- a/chromium/net/dns/dns_test_util.cc
+++ b/chromium/net/dns/dns_test_util.cc
@@ -4,13 +4,19 @@
#include "net/dns/dns_test_util.h"
+#include <string>
+#include <utility>
+#include <vector>
+
#include "base/big_endian.h"
#include "base/bind.h"
+#include "base/check.h"
#include "base/location.h"
#include "base/numerics/safe_conversions.h"
#include "base/single_thread_task_runner.h"
#include "base/sys_byteorder.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/time.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_address.h"
#include "net/base/net_errors.h"
@@ -38,8 +44,7 @@ const uint8_t kMalformedResponseHeader[] = {
// Create a response containing a valid question (as would normally be validated
// in DnsTransaction) but completely missing a header-declared answer.
-std::unique_ptr<DnsResponse> CreateMalformedResponse(std::string hostname,
- uint16_t type) {
+DnsResponse CreateMalformedResponse(std::string hostname, uint16_t type) {
std::string dns_name;
CHECK(DNSDomainFromDot(hostname, &dns_name));
DnsQuery query(0x14 /* id */, dns_name, type);
@@ -53,8 +58,8 @@ std::unique_ptr<DnsResponse> CreateMalformedResponse(std::string hostname,
memcpy(buffer->data() + sizeof(kMalformedResponseHeader),
query.question().data(), query.question().size());
- auto response = std::make_unique<DnsResponse>(buffer, buffer->size());
- CHECK(response->InitParseWithoutQuery(buffer->size()));
+ DnsResponse response(buffer, buffer->size());
+ CHECK(response.InitParseWithoutQuery(buffer->size()));
return response;
}
@@ -68,183 +73,163 @@ class MockAddressSorter : public AddressSorter {
}
};
-DnsResourceRecord BuildCannonnameRecord(std::string name,
- std::string cannonname) {
+} // namespace
+
+DnsResourceRecord BuildTestDnsRecord(std::string name,
+ uint16_t type,
+ std::string rdata,
+ base::TimeDelta ttl) {
DCHECK(!name.empty());
- DCHECK(!cannonname.empty());
DnsResourceRecord record;
record.name = std::move(name);
- record.type = dns_protocol::kTypeCNAME;
+ record.type = type;
record.klass = dns_protocol::kClassIN;
- record.ttl = base::TimeDelta::FromDays(1).InSeconds();
- CHECK(DNSDomainFromDot(cannonname, &record.owned_rdata));
- record.rdata = record.owned_rdata;
+ record.ttl = ttl.InSeconds();
+
+ if (!rdata.empty())
+ record.SetOwnedRdata(std::move(rdata));
return record;
}
-// Note: This is not a fully compliant SOA record, merely the bare amount needed
-// in DnsRecord::ParseToAddressList() processessing. This record will not pass
-// RecordParsed validation.
-DnsResourceRecord BuildSoaRecord(std::string name) {
+DnsResourceRecord BuildTestAddressRecord(std::string name,
+ const IPAddress& ip,
+ base::TimeDelta ttl) {
DCHECK(!name.empty());
+ DCHECK(ip.IsValid());
- DnsResourceRecord record;
- record.name = std::move(name);
- record.type = dns_protocol::kTypeSOA;
- record.klass = dns_protocol::kClassIN;
- record.ttl = base::TimeDelta::FromDays(1).InSeconds();
- record.SetOwnedRdata("fake_rdata");
-
- return record;
+ return BuildTestDnsRecord(
+ std::move(name),
+ ip.IsIPv4() ? dns_protocol::kTypeA : dns_protocol::kTypeAAAA,
+ net::IPAddressToPackedString(ip), ttl);
}
-DnsResourceRecord BuildTextRecord(std::string name,
- std::vector<std::string> text_strings) {
- DCHECK(!name.empty());
+DnsResourceRecord BuildTestTextRecord(std::string name,
+ std::vector<std::string> text_strings,
+ base::TimeDelta ttl) {
DCHECK(!text_strings.empty());
- DnsResourceRecord record;
- record.name = std::move(name);
- record.type = dns_protocol::kTypeTXT;
- record.klass = dns_protocol::kClassIN;
- record.ttl = base::TimeDelta::FromDays(1).InSeconds();
-
std::string rdata;
- for (std::string text_string : text_strings) {
+ for (const std::string& text_string : text_strings) {
DCHECK(!text_string.empty());
rdata += base::checked_cast<unsigned char>(text_string.size());
- rdata += std::move(text_string);
+ rdata += text_string;
}
- record.SetOwnedRdata(std::move(rdata));
- return record;
+ return BuildTestDnsRecord(std::move(name), dns_protocol::kTypeTXT,
+ std::move(rdata));
}
-DnsResourceRecord BuildPointerRecord(std::string name,
- std::string pointer_name) {
+DnsResourceRecord BuildTestHttpsAliasRecord(std::string name,
+ base::StringPiece alias_name,
+ base::TimeDelta ttl) {
DCHECK(!name.empty());
- DCHECK(!pointer_name.empty());
- DnsResourceRecord record;
- record.name = std::move(name);
- record.type = dns_protocol::kTypePTR;
- record.klass = dns_protocol::kClassIN;
- record.ttl = base::TimeDelta::FromDays(1).InSeconds();
- CHECK(DNSDomainFromDot(pointer_name, &record.owned_rdata));
- record.rdata = record.owned_rdata;
+ std::string rdata("\000\000", 2);
- return record;
+ std::string alias_domain;
+ CHECK(DNSDomainFromDot(alias_name, &alias_domain));
+ rdata.append(alias_domain);
+
+ return BuildTestDnsRecord(std::move(name), dns_protocol::kTypeHttps,
+ std::move(rdata), ttl);
}
-DnsResourceRecord BuildServiceRecord(std::string name,
- TestServiceRecord service) {
+DnsResourceRecord BuildTestHttpsServiceRecord(
+ std::string name,
+ uint16_t priority,
+ base::StringPiece service_name,
+ const std::map<uint16_t, std::string>& params,
+ base::TimeDelta ttl) {
DCHECK(!name.empty());
- DCHECK(!service.target.empty());
-
- DnsResourceRecord record;
- record.name = std::move(name);
- record.type = dns_protocol::kTypeSRV;
- record.klass = dns_protocol::kClassIN;
- record.ttl = base::TimeDelta::FromHours(5).InSeconds();
+ DCHECK_NE(priority, 0);
std::string rdata;
+
char num_buffer[2];
- base::WriteBigEndian(num_buffer, service.priority);
- rdata.append(num_buffer, 2);
- base::WriteBigEndian(num_buffer, service.weight);
- rdata.append(num_buffer, 2);
- base::WriteBigEndian(num_buffer, service.port);
+ base::WriteBigEndian(num_buffer, priority);
rdata.append(num_buffer, 2);
- std::string dns_name;
- CHECK(DNSDomainFromDot(service.target, &dns_name));
- rdata += dns_name;
-
- record.SetOwnedRdata(std::move(rdata));
-
- return record;
-}
-
+ std::string service_domain;
+ CHECK(DNSDomainFromDot(service_name, &service_domain));
+ rdata.append(service_domain);
-DnsResourceRecord BuildIntegrityRecord(
- std::string name,
- const std::vector<uint8_t>& serialized_rdata) {
- CHECK(!name.empty());
-
- DnsResourceRecord record;
- record.name = std::move(name);
- record.type = dns_protocol::kExperimentalTypeIntegrity;
- record.klass = dns_protocol::kClassIN;
- record.ttl = base::TimeDelta::FromDays(1).InSeconds();
+ for (auto& param : params) {
+ base::WriteBigEndian(num_buffer, param.first);
+ rdata.append(num_buffer, 2);
- std::string serialized_rdata_str(serialized_rdata.begin(),
- serialized_rdata.end());
- record.SetOwnedRdata(std::move(serialized_rdata_str));
+ base::WriteBigEndian(num_buffer,
+ base::checked_cast<uint16_t>(param.second.size()));
+ rdata.append(num_buffer, 2);
- CHECK_EQ(record.rdata.data(), record.owned_rdata.data());
+ rdata.append(param.second);
+ }
- return record;
+ return BuildTestDnsRecord(std::move(name), dns_protocol::kTypeHttps,
+ std::move(rdata), ttl);
}
-} // namespace
-
-DnsResourceRecord BuildTestAddressRecord(std::string name,
- const IPAddress& ip) {
+DnsResponse BuildTestDnsResponse(
+ std::string name,
+ uint16_t type,
+ const std::vector<DnsResourceRecord>& answers,
+ const std::vector<DnsResourceRecord>& authority,
+ const std::vector<DnsResourceRecord>& additional) {
DCHECK(!name.empty());
- DCHECK(ip.IsValid());
- DnsResourceRecord record;
- record.name = std::move(name);
- record.type = ip.IsIPv4() ? dns_protocol::kTypeA : dns_protocol::kTypeAAAA;
- record.klass = dns_protocol::kClassIN;
- record.ttl = base::TimeDelta::FromDays(1).InSeconds();
- record.SetOwnedRdata(net::IPAddressToPackedString(ip));
+ std::string dns_name;
+ CHECK(DNSDomainFromDot(name, &dns_name));
- return record;
+ base::Optional<DnsQuery> query(base::in_place, 0, std::move(dns_name), type);
+ return DnsResponse(0, true /* is_authoritative */, answers,
+ authority /* authority_records */,
+ additional /* additional_records */, query,
+ dns_protocol::kRcodeNOERROR /* rcode */,
+ false /* validate_answers_match_query */);
}
-
-std::unique_ptr<DnsResponse> BuildTestDnsResponse(std::string name,
- const IPAddress& ip) {
+DnsResponse BuildTestDnsAddressResponse(std::string name,
+ const IPAddress& ip,
+ std::string answer_name) {
DCHECK(ip.IsValid());
- std::vector<DnsResourceRecord> answers = {BuildTestAddressRecord(name, ip)};
- std::string dns_name;
- CHECK(DNSDomainFromDot(name, &dns_name));
- base::Optional<DnsQuery> query(
- base::in_place, 0, dns_name,
- ip.IsIPv4() ? dns_protocol::kTypeA : dns_protocol::kTypeAAAA);
- return std::make_unique<DnsResponse>(
- 0, false, std::move(answers),
- std::vector<DnsResourceRecord>() /* authority_records */,
- std::vector<DnsResourceRecord>() /* additional_records */, query);
+ if (answer_name.empty())
+ answer_name = name;
+
+ std::vector<DnsResourceRecord> answers = {
+ BuildTestAddressRecord(std::move(answer_name), ip)};
+
+ return BuildTestDnsResponse(
+ std::move(name),
+ ip.IsIPv4() ? dns_protocol::kTypeA : dns_protocol::kTypeAAAA, answers);
}
-std::unique_ptr<DnsResponse> BuildTestDnsResponseWithCname(
- std::string name,
- const IPAddress& ip,
- std::string cannonname) {
+DnsResponse BuildTestDnsAddressResponseWithCname(std::string name,
+ const IPAddress& ip,
+ std::string cannonname,
+ std::string answer_name) {
DCHECK(ip.IsValid());
DCHECK(!cannonname.empty());
+ if (answer_name.empty())
+ answer_name = name;
+
+ std::string cname_rdata;
+ CHECK(DNSDomainFromDot(cannonname, &cname_rdata));
+
std::vector<DnsResourceRecord> answers = {
- BuildCannonnameRecord(name, cannonname),
- BuildTestAddressRecord(cannonname, ip)};
- std::string dns_name;
- CHECK(DNSDomainFromDot(name, &dns_name));
- base::Optional<DnsQuery> query(
- base::in_place, 0, dns_name,
- ip.IsIPv4() ? dns_protocol::kTypeA : dns_protocol::kTypeAAAA);
- return std::make_unique<DnsResponse>(
- 0, false, std::move(answers),
- std::vector<DnsResourceRecord>() /* authority_records */,
- std::vector<DnsResourceRecord>() /* additional_records */, query);
+ BuildTestDnsRecord(std::move(answer_name), dns_protocol::kTypeCNAME,
+ std::move(cname_rdata)),
+ BuildTestAddressRecord(std::move(cannonname), ip)};
+
+ return BuildTestDnsResponse(
+ std::move(name),
+ ip.IsIPv4() ? dns_protocol::kTypeA : dns_protocol::kTypeAAAA, answers);
}
-std::unique_ptr<DnsResponse> BuildTestDnsTextResponse(
+DnsResponse BuildTestDnsTextResponse(
std::string name,
std::vector<std::vector<std::string>> text_records,
std::string answer_name) {
@@ -253,44 +238,31 @@ std::unique_ptr<DnsResponse> BuildTestDnsTextResponse(
std::vector<DnsResourceRecord> answers;
for (std::vector<std::string>& text_record : text_records) {
- answers.push_back(BuildTextRecord(answer_name, std::move(text_record)));
+ answers.push_back(BuildTestTextRecord(answer_name, std::move(text_record)));
}
- std::string dns_name;
- CHECK(DNSDomainFromDot(name, &dns_name));
- base::Optional<DnsQuery> query(base::in_place, 0, dns_name,
- dns_protocol::kTypeTXT);
-
- return std::make_unique<DnsResponse>(
- 0, false, std::move(answers),
- std::vector<DnsResourceRecord>() /* authority_records */,
- std::vector<DnsResourceRecord>() /* additional_records */, query);
+ return BuildTestDnsResponse(std::move(name), dns_protocol::kTypeTXT, answers);
}
-std::unique_ptr<DnsResponse> BuildTestDnsPointerResponse(
- std::string name,
- std::vector<std::string> pointer_names,
- std::string answer_name) {
+DnsResponse BuildTestDnsPointerResponse(std::string name,
+ std::vector<std::string> pointer_names,
+ std::string answer_name) {
if (answer_name.empty())
answer_name = name;
std::vector<DnsResourceRecord> answers;
for (std::string& pointer_name : pointer_names) {
- answers.push_back(BuildPointerRecord(answer_name, std::move(pointer_name)));
- }
+ std::string rdata;
+ CHECK(DNSDomainFromDot(pointer_name, &rdata));
- std::string dns_name;
- CHECK(DNSDomainFromDot(name, &dns_name));
- base::Optional<DnsQuery> query(base::in_place, 0, dns_name,
- dns_protocol::kTypePTR);
+ answers.push_back(BuildTestDnsRecord(answer_name, dns_protocol::kTypePTR,
+ std::move(rdata)));
+ }
- return std::make_unique<DnsResponse>(
- 0, false, std::move(answers),
- std::vector<DnsResourceRecord>() /* authority_records */,
- std::vector<DnsResourceRecord>() /* additional_records */, query);
+ return BuildTestDnsResponse(std::move(name), dns_protocol::kTypePTR, answers);
}
-std::unique_ptr<DnsResponse> BuildTestDnsServiceResponse(
+DnsResponse BuildTestDnsServiceResponse(
std::string name,
std::vector<TestServiceRecord> service_records,
std::string answer_name) {
@@ -299,43 +271,31 @@ std::unique_ptr<DnsResponse> BuildTestDnsServiceResponse(
std::vector<DnsResourceRecord> answers;
for (TestServiceRecord& service_record : service_records) {
- answers.push_back(
- BuildServiceRecord(answer_name, std::move(service_record)));
+ std::string rdata;
+ char num_buffer[2];
+ base::WriteBigEndian(num_buffer, service_record.priority);
+ rdata.append(num_buffer, 2);
+ base::WriteBigEndian(num_buffer, service_record.weight);
+ rdata.append(num_buffer, 2);
+ base::WriteBigEndian(num_buffer, service_record.port);
+ rdata.append(num_buffer, 2);
+ std::string dns_name;
+ CHECK(DNSDomainFromDot(service_record.target, &dns_name));
+ rdata += dns_name;
+
+ answers.push_back(BuildTestDnsRecord(answer_name, dns_protocol::kTypeSRV,
+ std::move(rdata),
+ base::TimeDelta::FromHours(5)));
}
- std::string dns_name;
- CHECK(DNSDomainFromDot(name, &dns_name));
- base::Optional<DnsQuery> query(base::in_place, 0, dns_name,
- dns_protocol::kTypeSRV);
-
- return std::make_unique<DnsResponse>(
- 0, false, std::move(answers),
- std::vector<DnsResourceRecord>() /* authority_records */,
- std::vector<DnsResourceRecord>() /* additional_records */, query);
-}
-
-std::unique_ptr<DnsResponse> BuildTestDnsIntegrityResponse(
- std::string hostname,
- const std::vector<uint8_t>& serialized_rdata) {
- CHECK(!hostname.empty());
-
- std::vector<DnsResourceRecord> answers{
- BuildIntegrityRecord(hostname, serialized_rdata)};
-
- std::string dns_name;
- CHECK(DNSDomainFromDot(hostname, &dns_name));
- base::Optional<DnsQuery> query(base::in_place, 0, dns_name,
- dns_protocol::kExperimentalTypeIntegrity);
-
- return std::make_unique<DnsResponse>(
- 0, false, std::move(answers),
- std::vector<DnsResourceRecord>() /* authority_records */,
- std::vector<DnsResourceRecord>() /* additional_records */, query);
+ return BuildTestDnsResponse(std::move(name), dns_protocol::kTypeSRV, answers);
}
-MockDnsClientRule::Result::Result(ResultType type) : type(type) {}
+MockDnsClientRule::Result::Result(ResultType type,
+ base::Optional<DnsResponse> response)
+ : type(type), response(std::move(response)) {}
-MockDnsClientRule::Result::Result(std::unique_ptr<DnsResponse> response)
+MockDnsClientRule::Result::Result(DnsResponse response)
: type(OK), response(std::move(response)) {}
MockDnsClientRule::Result::Result(Result&& result) = default;
@@ -372,6 +332,7 @@ class MockDnsTransactionFactory::MockTransaction
bool force_doh_server_available,
SecureDnsMode secure_dns_mode,
ResolveContext* resolve_context,
+ bool fast_timeout,
DnsTransactionFactory::CallbackType callback)
: result_(MockDnsClientRule::FAIL),
hostname_(hostname),
@@ -408,8 +369,9 @@ class MockDnsTransactionFactory::MockTransaction
case MockDnsClientRule::NODOMAIN:
case MockDnsClientRule::EMPTY:
DCHECK(!result->response); // Not expected to be provided.
- authority_records = {BuildSoaRecord(hostname_)};
- result_.response = std::make_unique<DnsResponse>(
+ authority_records = {BuildTestDnsRecord(
+ hostname_, dns_protocol::kTypeSOA, "fake rdata")};
+ result_.response = DnsResponse(
22 /* id */, false /* is_authoritative */,
std::vector<DnsResourceRecord>() /* answers */,
authority_records,
@@ -423,24 +385,12 @@ class MockDnsTransactionFactory::MockTransaction
case MockDnsClientRule::TIMEOUT:
DCHECK(!result->response); // Not expected to be provided.
break;
+ case MockDnsClientRule::SLOW:
+ if (!fast_timeout)
+ SetResponse(result);
+ break;
case MockDnsClientRule::OK:
- if (result->response) {
- // Copy response in case |rules| are destroyed before the
- // transaction completes.
- result_.response = std::make_unique<DnsResponse>(
- result->response->io_buffer(),
- result->response->io_buffer_size());
- CHECK(result_.response->InitParseWithoutQuery(
- result->response->io_buffer_size()));
- } else {
- // Generated response only available for address types.
- DCHECK(qtype_ == dns_protocol::kTypeA ||
- qtype_ == dns_protocol::kTypeAAAA);
- result_.response = BuildTestDnsResponse(
- hostname_, qtype_ == dns_protocol::kTypeA
- ? IPAddress::IPv4Localhost()
- : IPAddress::IPv6Localhost());
- }
+ SetResponse(result);
break;
case MockDnsClientRule::MALFORMED:
DCHECK(!result->response); // Not expected to be provided.
@@ -477,23 +427,58 @@ class MockDnsTransactionFactory::MockTransaction
bool delayed() const { return delayed_; }
private:
+ void SetResponse(const MockDnsClientRule::Result* result) {
+ if (result->response) {
+ // Copy response in case |result| is destroyed before the transaction
+ // completes.
+ auto buffer_copy =
+ base::MakeRefCounted<IOBuffer>(result->response->io_buffer_size());
+ memcpy(buffer_copy->data(), result->response->io_buffer()->data(),
+ result->response->io_buffer_size());
+ result_.response = DnsResponse(std::move(buffer_copy),
+ result->response->io_buffer_size());
+ CHECK(result_.response->InitParseWithoutQuery(
+ result->response->io_buffer_size()));
+ } else {
+ // Generated response only available for address types.
+ DCHECK(qtype_ == dns_protocol::kTypeA ||
+ qtype_ == dns_protocol::kTypeAAAA);
+ result_.response = BuildTestDnsAddressResponse(
+ hostname_, qtype_ == dns_protocol::kTypeA
+ ? IPAddress::IPv4Localhost()
+ : IPAddress::IPv6Localhost());
+ }
+ }
+
void Finish() {
switch (result_.type) {
case MockDnsClientRule::NODOMAIN:
case MockDnsClientRule::FAIL:
- std::move(callback_).Run(this, ERR_NAME_NOT_RESOLVED,
- result_.response.get(), base::nullopt);
+ std::move(callback_).Run(
+ this, ERR_NAME_NOT_RESOLVED,
+ result_.response ? &result_.response.value() : nullptr,
+ base::nullopt);
break;
case MockDnsClientRule::EMPTY:
case MockDnsClientRule::OK:
case MockDnsClientRule::MALFORMED:
- std::move(callback_).Run(this, OK, result_.response.get(),
- base::nullopt);
+ std::move(callback_).Run(
+ this, OK, result_.response ? &result_.response.value() : nullptr,
+ base::nullopt);
break;
case MockDnsClientRule::TIMEOUT:
std::move(callback_).Run(this, ERR_DNS_TIMED_OUT, nullptr,
base::nullopt);
break;
+ case MockDnsClientRule::SLOW:
+ if (result_.response) {
+ std::move(callback_).Run(
+ this, OK, result_.response ? &result_.response.value() : nullptr,
+ base::nullopt);
+ } else {
+ std::move(callback_).Run(this, ERR_DNS_TIMED_OUT, nullptr,
+ base::nullopt);
+ }
}
}
@@ -545,11 +530,12 @@ std::unique_ptr<DnsTransaction> MockDnsTransactionFactory::CreateTransaction(
const NetLogWithSource&,
bool secure,
SecureDnsMode secure_dns_mode,
- ResolveContext* resolve_context) {
+ ResolveContext* resolve_context,
+ bool fast_timeout) {
std::unique_ptr<MockTransaction> transaction =
std::make_unique<MockTransaction>(
rules_, hostname, qtype, secure, force_doh_server_available_,
- secure_dns_mode, resolve_context, std::move(callback));
+ secure_dns_mode, resolve_context, fast_timeout, std::move(callback));
if (transaction->delayed())
delayed_transactions_.push_back(transaction->AsWeakPtr());
return transaction;
diff --git a/chromium/net/dns/dns_test_util.h b/chromium/net/dns/dns_test_util.h
index 7d79a35f661..942fa84586d 100644
--- a/chromium/net/dns/dns_test_util.h
+++ b/chromium/net/dns/dns_test_util.h
@@ -16,6 +16,7 @@
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
#include "base/stl_util.h"
#include "base/time/time.h"
#include "net/dns/dns_client.h"
@@ -59,7 +60,7 @@ static const char* const kT0IpAddresses[] = {
"74.125.226.177", "74.125.226.178"
};
static const char kT0CanonName[] = "www.l.google.com";
-static const int kT0TTL = 0x000000e4;
+static const base::TimeDelta kT0Ttl = base::TimeDelta::FromSeconds(0x000000e4);
// +1 for the CNAME record.
static const unsigned kT0RecordCount = base::size(kT0IpAddresses) + 1;
@@ -89,7 +90,7 @@ static const char* const kT1IpAddresses[] = {
"64.233.169.121"
};
static const char kT1CanonName[] = "ghs.l.google.com";
-static const int kT1TTL = 0x0000010b;
+static const base::TimeDelta kT1Ttl = base::TimeDelta::FromSeconds(0x0000010b);
// +1 for the CNAME record.
static const unsigned kT1RecordCount = base::size(kT1IpAddresses) + 1;
@@ -118,7 +119,7 @@ static const char* const kT2IpAddresses[] = {
"129.10.116.81"
};
static const char kT2CanonName[] = "vulcan.ccs.neu.edu";
-static const int kT2TTL = 0x0000012c;
+static const base::TimeDelta kT2Ttl = base::TimeDelta::FromSeconds(0x0000012c);
// +1 for the CNAME record.
static const unsigned kT2RecordCount = base::size(kT2IpAddresses) + 1;
@@ -160,7 +161,7 @@ static const char* const kT3IpAddresses[] = {
"74.125.226.176", "74.125.226.177"
};
static const char kT3CanonName[] = "www.l.google.com";
-static const int kT3TTL = 0x00000015;
+static const base::TimeDelta kT3Ttl = base::TimeDelta::FromSeconds(0x00000015);
// +2 for the CNAME records, +1 for TXT record.
static const unsigned kT3RecordCount = base::size(kT3IpAddresses) + 3;
@@ -181,7 +182,7 @@ static const uint8_t kT4ResponseDatagram[] = {
0x00, 0x01, 0x2b, 0x00, 0x04, 0xac, 0xd9, 0x06, 0xc3};
static const char* const kT4IpAddresses[] = {"172.217.6.195"};
-static const int kT4TTL = 0x0000012b;
+static const base::TimeDelta kT4Ttl = base::TimeDelta::FromSeconds(0x0000012b);
static const unsigned kT4RecordCount = base::size(kT0IpAddresses);
class AddressSorter;
@@ -191,27 +192,61 @@ class IPAddress;
class ResolveContext;
class URLRequestContext;
-// Builds an address record for the given name and IP.
-DnsResourceRecord BuildTestAddressRecord(std::string name, const IPAddress& ip);
+DnsResourceRecord BuildTestDnsRecord(
+ std::string name,
+ uint16_t type,
+ std::string rdata,
+ base::TimeDelta ttl = base::TimeDelta::FromDays(1));
-// Builds a DNS response that includes address records.
-std::unique_ptr<DnsResponse> BuildTestDnsResponse(std::string name,
- const IPAddress& ip);
-std::unique_ptr<DnsResponse> BuildTestDnsResponseWithCname(
+DnsResourceRecord BuildTestAddressRecord(
std::string name,
const IPAddress& ip,
- std::string cannonname);
+ base::TimeDelta ttl = base::TimeDelta::FromDays(1));
+
+DnsResourceRecord BuildTestTextRecord(
+ std::string name,
+ std::vector<std::string> text_strings,
+ base::TimeDelta ttl = base::TimeDelta::FromDays(1));
+
+DnsResourceRecord BuildTestHttpsAliasRecord(
+ std::string name,
+ base::StringPiece alias_name,
+ base::TimeDelta ttl = base::TimeDelta::FromDays(1));
+
+// `params` is a mapping from service param keys to a string containing the
+// encoded bytes of a service param value (without the value length prefix which
+// this method will automatically add).
+DnsResourceRecord BuildTestHttpsServiceRecord(
+ std::string name,
+ uint16_t priority,
+ base::StringPiece service_name,
+ const std::map<uint16_t, std::string>& params,
+ base::TimeDelta ttl = base::TimeDelta::FromDays(1));
+
+DnsResponse BuildTestDnsResponse(
+ std::string name,
+ uint16_t type,
+ const std::vector<DnsResourceRecord>& answers,
+ const std::vector<DnsResourceRecord>& authority = {},
+ const std::vector<DnsResourceRecord>& additional = {});
+
+DnsResponse BuildTestDnsAddressResponse(std::string name,
+ const IPAddress& ip,
+ std::string answer_name = "");
+DnsResponse BuildTestDnsAddressResponseWithCname(std::string name,
+ const IPAddress& ip,
+ std::string cannonname,
+ std::string answer_name = "");
// If |answer_name| is empty, |name| will be used for all answer records, as is
// the normal behavior.
-std::unique_ptr<DnsResponse> BuildTestDnsTextResponse(
+DnsResponse BuildTestDnsTextResponse(
std::string name,
std::vector<std::vector<std::string>> text_records,
std::string answer_name = "");
-std::unique_ptr<DnsResponse> BuildTestDnsPointerResponse(
- std::string name,
- std::vector<std::string> pointer_names,
- std::string answer_name = "");
+DnsResponse BuildTestDnsPointerResponse(std::string name,
+ std::vector<std::string> pointer_names,
+ std::string answer_name = "");
struct TestServiceRecord {
uint16_t priority;
@@ -220,22 +255,28 @@ struct TestServiceRecord {
std::string target;
};
-std::unique_ptr<DnsResponse> BuildTestDnsServiceResponse(
+DnsResponse BuildTestDnsServiceResponse(
std::string name,
std::vector<TestServiceRecord> service_records,
std::string answer_name = "");
-std::unique_ptr<DnsResponse> BuildTestDnsIntegrityResponse(
- std::string hostname,
- const std::vector<uint8_t>& serialized_rdata);
-
struct MockDnsClientRule {
enum ResultType {
- NODOMAIN, // Fail asynchronously with ERR_NAME_NOT_RESOLVED and NXDOMAIN.
- FAIL, // Fail asynchronously with ERR_NAME_NOT_RESOLVED.
- TIMEOUT, // Fail asynchronously with ERR_DNS_TIMED_OUT.
- EMPTY, // Return an empty response.
- MALFORMED, // "Succeed" but with an unparsable response.
+ // Fail asynchronously with ERR_NAME_NOT_RESOLVED and NXDOMAIN.
+ NODOMAIN,
+ // Fail asynchronously with ERR_NAME_NOT_RESOLVED.
+ FAIL,
+ // Fail asynchronously with ERR_DNS_TIMED_OUT.
+ TIMEOUT,
+ // Simulates a slow transaction that will complete only with a lenient
+ // timeout. Fails asynchronously with ERR_DNS_TIMED_OUT only if the
+ // transaction was created with |fast_timeout|. Otherwise completes
+ // successfully as if the ResultType were |OK|.
+ SLOW,
+ // Return an empty response.
+ EMPTY,
+ // "Succeed" but with an unparsable response.
+ MALFORMED,
// Results in the response in |Result::response| or, if null, results in a
// localhost IP response.
@@ -243,15 +284,16 @@ struct MockDnsClientRule {
};
struct Result {
- explicit Result(ResultType type);
- explicit Result(std::unique_ptr<DnsResponse> response);
+ explicit Result(ResultType type,
+ base::Optional<DnsResponse> response = base::nullopt);
+ explicit Result(DnsResponse response);
Result(Result&& result);
~Result();
Result& operator=(Result&& result);
ResultType type;
- std::unique_ptr<DnsResponse> response;
+ base::Optional<DnsResponse> response;
};
// If |delay| is true, matching transactions will be delayed until triggered
@@ -288,7 +330,8 @@ class MockDnsTransactionFactory : public DnsTransactionFactory {
const NetLogWithSource&,
bool secure,
SecureDnsMode secure_dns_mode,
- ResolveContext* resolve_context) override;
+ ResolveContext* resolve_context,
+ bool fast_timeout) override;
std::unique_ptr<DnsProbeRunner> CreateDohProbeRunner(
ResolveContext* resolve_context) override;
diff --git a/chromium/net/dns/dns_transaction.cc b/chromium/net/dns/dns_transaction.cc
index cb3e48be554..c12f1c728de 100644
--- a/chromium/net/dns/dns_transaction.cc
+++ b/chromium/net/dns/dns_transaction.cc
@@ -4,6 +4,7 @@
#include "net/dns/dns_transaction.h"
+#include <algorithm>
#include <memory>
#include <set>
#include <string>
@@ -31,6 +32,7 @@
#include "base/strings/stringprintf.h"
#include "base/threading/thread_checker.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/timer/elapsed_timer.h"
#include "base/timer/timer.h"
#include "base/values.h"
#include "build/build_config.h"
@@ -130,8 +132,7 @@ base::Value NetLogStartParams(const std::string& hostname, uint16_t qtype) {
// matches. Logging is done in the socket and in the outer DnsTransaction.
class DnsAttempt {
public:
- explicit DnsAttempt(size_t server_index)
- : result_(ERR_FAILED), server_index_(server_index) {}
+ explicit DnsAttempt(size_t server_index) : server_index_(server_index) {}
virtual ~DnsAttempt() = default;
// Starts the attempt. Returns ERR_IO_PENDING if cannot complete synchronously
@@ -165,21 +166,10 @@ class DnsAttempt {
return dict;
}
- void set_result(int result) { result_ = result; }
-
// True if current attempt is pending (waiting for server response).
- bool is_pending() const { return result_ == ERR_IO_PENDING; }
-
- // True if attempt is completed (received server response).
- bool is_completed() const {
- return (result_ == OK) || (result_ == ERR_NAME_NOT_RESOLVED) ||
- (result_ == ERR_DNS_SERVER_REQUIRES_TCP);
- }
+ virtual bool IsPending() const = 0;
private:
- // Result of last operation.
- int result_;
-
const size_t server_index_;
DISALLOW_COPY_AND_ASSIGN(DnsAttempt);
@@ -223,6 +213,8 @@ class DnsUDPAttempt : public DnsAttempt {
return socket_->NetLog();
}
+ bool IsPending() const override { return next_state_ != STATE_NONE; }
+
private:
enum State {
STATE_SEND_QUERY,
@@ -257,13 +249,9 @@ class DnsUDPAttempt : public DnsAttempt {
}
} while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
- set_result(rv);
-
- if (rv == ERR_IO_PENDING)
- return rv;
-
- if (rv == OK)
+ if (rv != ERR_IO_PENDING)
DCHECK_EQ(STATE_NONE, next_state_);
+
return rv;
}
@@ -527,6 +515,8 @@ class DnsHTTPAttempt : public DnsAttempt, public URLRequest::Delegate {
}
}
+ bool IsPending() const override { return !callback_.is_null(); }
+
private:
void ResponseCompleted(int net_error) {
request_.reset();
@@ -620,7 +610,6 @@ class DnsTCPAttempt : public DnsAttempt {
int rv = socket_->Connect(
base::BindOnce(&DnsTCPAttempt::OnIOComplete, base::Unretained(this)));
if (rv == ERR_IO_PENDING) {
- set_result(rv);
return rv;
}
return DoLoop(rv);
@@ -637,6 +626,8 @@ class DnsTCPAttempt : public DnsAttempt {
return socket_->NetLog();
}
+ bool IsPending() const override { return next_state_ != STATE_NONE; }
+
private:
enum State {
STATE_CONNECT_COMPLETE,
@@ -683,9 +674,9 @@ class DnsTCPAttempt : public DnsAttempt {
}
} while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
- set_result(rv);
- if (rv == OK)
+ if (rv != ERR_IO_PENDING)
DCHECK_EQ(STATE_NONE, next_state_);
+
return rv;
}
@@ -985,7 +976,7 @@ class DnsOverHttpsProbeRunner : public DnsProbeRunner {
probe_stats->probe_attempts[attempt_number].get();
const DnsResponse* response = attempt->GetResponse();
AddressList addresses;
- base::TimeDelta ttl;
+ base::Optional<base::TimeDelta> ttl;
if (response &&
attempt->GetResponse()->ParseToAddressList(&addresses, &ttl) ==
DnsResponse::DNS_PARSE_OK &&
@@ -1030,9 +1021,9 @@ class DnsOverHttpsProbeRunner : public DnsProbeRunner {
// Implements DnsTransaction. Configuration is supplied by DnsSession.
// The suffix list is built according to the DnsConfig from the session.
-// The timeout for each DnsUDPAttempt is given by
-// ResolveContext::NextClassicTimeout. The first server to attempt on each query
-// is given by ResolveContext::NextFirstServerIndex, and the order is
+// The fallback period for each DnsUDPAttempt is given by
+// ResolveContext::NextClassicFallbackPeriod(). The first server to attempt on
+// each query is given by ResolveContext::NextFirstServerIndex, and the order is
// round-robin afterwards. Each server is attempted DnsConfig::attempts times.
class DnsTransactionImpl : public DnsTransaction,
public base::SupportsWeakPtr<DnsTransactionImpl> {
@@ -1045,7 +1036,8 @@ class DnsTransactionImpl : public DnsTransaction,
const OptRecordRdata* opt_rdata,
bool secure,
SecureDnsMode secure_dns_mode,
- ResolveContext* resolve_context)
+ ResolveContext* resolve_context,
+ bool fast_timeout)
: session_(session),
hostname_(hostname),
qtype_(qtype),
@@ -1053,6 +1045,7 @@ class DnsTransactionImpl : public DnsTransaction,
secure_(secure),
secure_dns_mode_(secure_dns_mode),
callback_(std::move(callback)),
+ fast_timeout_(fast_timeout),
net_log_(net_log),
qnames_initial_size_(0),
attempts_count_(0),
@@ -1088,6 +1081,7 @@ class DnsTransactionImpl : public DnsTransaction,
DCHECK(attempts_.empty());
net_log_.BeginEvent(NetLogEventType::DNS_TRANSACTION,
[&] { return NetLogStartParams(hostname_, qtype_); });
+ time_from_start_ = std::make_unique<base::ElapsedTimer>();
AttemptResult result(PrepareSearch(), nullptr);
if (result.rv == OK) {
qnames_initial_size_ = qnames_.size();
@@ -1210,6 +1204,8 @@ class DnsTransactionImpl : public DnsTransaction,
}
AttemptResult MakeAttempt() {
+ DCHECK(MoreAttemptsAllowed());
+
DnsConfig config = session_->config();
if (secure_) {
DCHECK_GT(config.dns_over_https_servers.size(), 0u);
@@ -1243,9 +1239,11 @@ class DnsTransactionImpl : public DnsTransaction,
}
if (result.rv == ERR_IO_PENDING) {
- base::TimeDelta timeout = resolve_context_->NextClassicTimeout(
- server_index, attempt_number, session_.get());
- timer_.Start(FROM_HERE, timeout, this, &DnsTransactionImpl::OnTimeout);
+ base::TimeDelta fallback_period =
+ resolve_context_->NextClassicFallbackPeriod(
+ server_index, attempt_number, session_.get());
+ timer_.Start(FROM_HERE, fallback_period, this,
+ &DnsTransactionImpl::OnFallbackPeriodExpired);
}
return result;
@@ -1303,9 +1301,10 @@ class DnsTransactionImpl : public DnsTransaction,
&DnsTransactionImpl::OnAttemptComplete, base::Unretained(this),
attempt_number, true /* record_rtt */, base::TimeTicks::Now()));
if (rv == ERR_IO_PENDING) {
- base::TimeDelta timeout =
- resolve_context_->NextDohTimeout(doh_server_index, session_.get());
- timer_.Start(FROM_HERE, timeout, this, &DnsTransactionImpl::OnTimeout);
+ base::TimeDelta fallback_period = resolve_context_->NextDohFallbackPeriod(
+ doh_server_index, session_.get());
+ timer_.Start(FROM_HERE, fallback_period, this,
+ &DnsTransactionImpl::OnFallbackPeriodExpired);
}
return AttemptResult(rv, attempts_.back().get());
}
@@ -1332,9 +1331,10 @@ class DnsTransactionImpl : public DnsTransaction,
RecordAttemptUma(DnsAttemptType::kTcpTruncationRetry);
if (result.rv == ERR_IO_PENDING) {
- // On TCP upgrade, use 2x the upgraded timeout.
- base::TimeDelta timeout = timer_.GetCurrentDelay() * 2;
- timer_.Start(FROM_HERE, timeout, this, &DnsTransactionImpl::OnTimeout);
+ // On TCP upgrade, use 2x the upgraded fallback period.
+ base::TimeDelta fallback_period = timer_.GetCurrentDelay() * 2;
+ timer_.Start(FROM_HERE, fallback_period, this,
+ &DnsTransactionImpl::OnFallbackPeriodExpired);
}
return result;
@@ -1368,9 +1368,11 @@ class DnsTransactionImpl : public DnsTransaction,
// Begins query for the current name. Makes the first attempt.
AttemptResult StartQuery() {
- std::string dotted_qname = DNSDomainToString(qnames_.front());
- net_log_.BeginEventWithStringParams(NetLogEventType::DNS_TRANSACTION_QUERY,
- "qname", dotted_qname);
+ base::Optional<std::string> dotted_qname =
+ DnsDomainToString(qnames_.front());
+ net_log_.BeginEventWithStringParams(
+ NetLogEventType::DNS_TRANSACTION_QUERY, "qname",
+ dotted_qname.value_or("???MALFORMED_NAME???"));
attempts_.clear();
had_tcp_retry_ = false;
@@ -1425,6 +1427,8 @@ class DnsTransactionImpl : public DnsTransaction,
// Resolves the result of a DnsAttempt until a terminal result is reached
// or it will complete asynchronously (ERR_IO_PENDING).
AttemptResult ProcessAttemptResult(AttemptResult result) {
+ DCHECK(!callback_.is_null());
+
while (result.rv != ERR_IO_PENDING) {
LogResponse(result.attempt);
@@ -1458,17 +1462,25 @@ class DnsTransactionImpl : public DnsTransaction,
break;
case ERR_CONNECTION_REFUSED:
case ERR_DNS_TIMED_OUT:
+ timer_.Stop();
+
if (result.attempt) {
+ DCHECK(result.attempt == attempts_.back().get());
resolve_context_->RecordServerFailure(
result.attempt->server_index(), secure_ /* is_doh_server */,
result.rv, session_.get());
}
if (MoreAttemptsAllowed()) {
result = MakeAttempt();
- } else {
- return result;
+ break;
}
- break;
+
+ if (!fast_timeout_ && AnyAttemptPending()) {
+ StartTimeoutTimer();
+ return AttemptResult(ERR_IO_PENDING, nullptr);
+ }
+
+ return result;
case ERR_DNS_SERVER_REQUIRES_TCP:
result = RetryUdpAttemptAsTcp(result.attempt);
break;
@@ -1481,33 +1493,48 @@ class DnsTransactionImpl : public DnsTransaction,
DCHECK(result.attempt);
// If attempt is not the most recent attempt, means this error is for
- // an attempt that already timed out and was treated as complete but
- // allowed to continue attempting in parallel with new attempts (see
- // the ERR_DNS_TIMED_OUT case above). As the failure was already
- // recorded at timeout time and is no longer being waited on, ignore
- // this failure.
- if (result.attempt != attempts_.back().get()) {
- return AttemptResult(ERR_IO_PENDING, nullptr);
+ // a previous attempt that already passed its fallback period and
+ // continued attempting in parallel with new attempts (see the
+ // ERR_DNS_TIMED_OUT case above). As the failure was already recorded
+ // at fallback time and is no longer being waited on, ignore this
+ // failure.
+ if (result.attempt == attempts_.back().get()) {
+ timer_.Stop();
+ resolve_context_->RecordServerFailure(
+ result.attempt->server_index(), secure_ /* is_doh_server */,
+ result.rv, session_.get());
+
+ if (MoreAttemptsAllowed()) {
+ result = MakeAttempt();
+ break;
+ }
+
+ if (fast_timeout_) {
+ return result;
+ }
+
+ // No more attempts can be made, but there may be other attempts
+ // still pending, so start the timeout timer.
+ StartTimeoutTimer();
}
- resolve_context_->RecordServerFailure(result.attempt->server_index(),
- secure_ /* is_doh_server */,
- result.rv, session_.get());
- if (!MoreAttemptsAllowed()) {
- return result;
+ // If any attempts are still pending, continue to wait for them.
+ if (AnyAttemptPending()) {
+ DCHECK(timer_.IsRunning());
+ return AttemptResult(ERR_IO_PENDING, nullptr);
}
- result = MakeAttempt();
- break;
+
+ return result;
}
}
return result;
}
- // Clears and cancels all non-completed attempts. If |leave_attempt| is not
- // null, it is not cleared even if complete.
+ // Clears and cancels all pending attempts. If |leave_attempt| is not
+ // null, that attempt is not cleared even if pending.
void ClearAttempts(const DnsAttempt* leave_attempt) {
for (auto it = attempts_.begin(); it != attempts_.end();) {
- if (!(*it)->is_completed() && it->get() != leave_attempt) {
+ if ((*it)->IsPending() && it->get() != leave_attempt) {
it = attempts_.erase(it);
} else {
++it;
@@ -1515,7 +1542,14 @@ class DnsTransactionImpl : public DnsTransaction,
}
}
- void OnTimeout() {
+ bool AnyAttemptPending() {
+ return std::any_of(attempts_.begin(), attempts_.end(),
+ [](std::unique_ptr<DnsAttempt>& attempt) {
+ return attempt->IsPending();
+ });
+ }
+
+ void OnFallbackPeriodExpired() {
if (callback_.is_null())
return;
DCHECK(!attempts_.empty());
@@ -1525,6 +1559,29 @@ class DnsTransactionImpl : public DnsTransaction,
DoCallback(result);
}
+ void StartTimeoutTimer() {
+ DCHECK(!fast_timeout_);
+ DCHECK(!timer_.IsRunning());
+ DCHECK(!callback_.is_null());
+
+ base::TimeDelta timeout;
+ if (secure_) {
+ timeout = resolve_context_->SecureTransactionTimeout(secure_dns_mode_,
+ session_.get());
+ } else {
+ timeout = resolve_context_->ClassicTransactionTimeout(session_.get());
+ }
+ timeout -= time_from_start_->Elapsed();
+
+ timer_.Start(FROM_HERE, timeout, this, &DnsTransactionImpl::OnTimeout);
+ }
+
+ void OnTimeout() {
+ if (callback_.is_null())
+ return;
+ DoCallback(AttemptResult(ERR_DNS_TIMED_OUT, nullptr));
+ }
+
scoped_refptr<DnsSession> session_;
std::string hostname_;
uint16_t qtype_;
@@ -1534,6 +1591,11 @@ class DnsTransactionImpl : public DnsTransaction,
// Cleared in DoCallback.
DnsTransactionFactory::CallbackType callback_;
+ // When true, transaction should time out immediately on expiration of the
+ // last attempt fallback period rather than waiting the overall transaction
+ // timeout period.
+ const bool fast_timeout_;
+
NetLogWithSource net_log_;
// Search list of fully-qualified DNS names to query next (in DNS format).
@@ -1552,6 +1614,7 @@ class DnsTransactionImpl : public DnsTransaction,
std::unique_ptr<DnsServerIterator> dns_server_iterator_;
base::OneShotTimer timer_;
+ std::unique_ptr<base::ElapsedTimer> time_from_start_;
// TODO(ericorth@chromium.org): Use base::UnownedPtr once available.
ResolveContext* resolve_context_;
@@ -1579,10 +1642,12 @@ class DnsTransactionFactoryImpl : public DnsTransactionFactory {
const NetLogWithSource& net_log,
bool secure,
SecureDnsMode secure_dns_mode,
- ResolveContext* resolve_context) override {
+ ResolveContext* resolve_context,
+ bool fast_timeout) override {
return std::make_unique<DnsTransactionImpl>(
session_.get(), hostname, qtype, std::move(callback), net_log,
- opt_rdata_.get(), secure, secure_dns_mode, resolve_context);
+ opt_rdata_.get(), secure, secure_dns_mode, resolve_context,
+ fast_timeout);
}
std::unique_ptr<DnsProbeRunner> CreateDohProbeRunner(
diff --git a/chromium/net/dns/dns_transaction.h b/chromium/net/dns/dns_transaction.h
index aa866b94c56..3444a37117e 100644
--- a/chromium/net/dns/dns_transaction.h
+++ b/chromium/net/dns/dns_transaction.h
@@ -103,6 +103,13 @@ class NET_EXPORT_PRIVATE DnsTransactionFactory {
//
// |secure| specifies whether DNS lookups should be performed using DNS-over-
// HTTPS (DoH) or using plaintext DNS.
+ //
+ // When |fast_timeout| is true, the transaction will timeout quickly after
+ // making its DNS attempts, without necessarily waiting long enough to allow
+ // slower-than-average requests to complete. Intended as an optimization for
+ // cases where the caller has reasonable fallback options to the transaction
+ // and it would be beneficial to move on to those options sooner on signals
+ // that the transaction is potentially slow or problematic.
virtual std::unique_ptr<DnsTransaction> CreateTransaction(
const std::string& hostname,
uint16_t qtype,
@@ -110,7 +117,8 @@ class NET_EXPORT_PRIVATE DnsTransactionFactory {
const NetLogWithSource& net_log,
bool secure,
SecureDnsMode secure_dns_mode,
- ResolveContext* resolve_context) WARN_UNUSED_RESULT = 0;
+ ResolveContext* resolve_context,
+ bool fast_timeout) WARN_UNUSED_RESULT = 0;
// Creates a runner to run the DoH probe sequence for all configured DoH
// resolvers.
diff --git a/chromium/net/dns/dns_transaction_unittest.cc b/chromium/net/dns/dns_transaction_unittest.cc
index 6154eb33ecb..79d8553077a 100644
--- a/chromium/net/dns/dns_transaction_unittest.cc
+++ b/chromium/net/dns/dns_transaction_unittest.cc
@@ -63,7 +63,7 @@ namespace net {
namespace {
-base::TimeDelta kTimeout = base::TimeDelta::FromSeconds(1);
+base::TimeDelta kFallbackPeriod = base::TimeDelta::FromSeconds(1);
const char kMockHostname[] = "mock.http";
@@ -240,7 +240,7 @@ class TestUDPClientSocket : public MockUDPClientSocket {
// Creates TestUDPClientSockets and keeps endpoints reported via OnConnect.
class TestSocketFactory : public MockClientSocketFactory {
public:
- TestSocketFactory() : fail_next_socket_(false) {}
+ TestSocketFactory() = default;
~TestSocketFactory() override = default;
std::unique_ptr<DatagramClientSocket> CreateDatagramClientSocket(
@@ -282,14 +282,12 @@ class TestSocketFactory : public MockClientSocketFactory {
};
std::vector<RemoteNameserver> remote_endpoints_;
- bool fail_next_socket_;
+ bool fail_next_socket_ = false;
bool diverse_source_ports_ = true;
private:
StaticSocketDataProvider empty_data_;
uint16_t next_source_port_ = 123;
-
- DISALLOW_COPY_AND_ASSIGN(TestSocketFactory);
};
int TestUDPClientSocket::Connect(const IPEndPoint& endpoint) {
@@ -301,34 +299,30 @@ int TestUDPClientSocket::Connect(const IPEndPoint& endpoint) {
class TransactionHelper {
public:
// If |expected_answer_count| < 0 then it is the expected net error.
- TransactionHelper(const char* hostname,
- uint16_t qtype,
- bool secure,
- int expected_answer_count,
- ResolveContext* context)
- : hostname_(hostname),
- qtype_(qtype),
- secure_(secure),
- response_(nullptr),
- expected_answer_count_(expected_answer_count),
- cancel_in_callback_(false),
- context_(context),
- completed_(false) {}
+ explicit TransactionHelper(int expected_answer_count)
+ : expected_answer_count_(expected_answer_count) {}
// Mark that the transaction shall be destroyed immediately upon callback.
void set_cancel_in_callback() { cancel_in_callback_ = true; }
- void StartTransaction(DnsTransactionFactory* factory) {
- EXPECT_EQ(NULL, transaction_.get());
- transaction_ = factory->CreateTransaction(
- hostname_, qtype_,
- base::BindOnce(&TransactionHelper::OnTransactionComplete,
- base::Unretained(this)),
- NetLogWithSource::Make(&net_log_, net::NetLogSourceType::NONE), secure_,
- factory->GetSecureDnsModeForTest(), context_);
- transaction_->SetRequestPriority(DEFAULT_PRIORITY);
- EXPECT_EQ(hostname_, transaction_->GetHostname());
- EXPECT_EQ(qtype_, transaction_->GetType());
+ void StartTransaction(DnsTransactionFactory* factory,
+ const char* hostname,
+ uint16_t qtype,
+ bool secure,
+ ResolveContext* context) {
+ std::unique_ptr<DnsTransaction> transaction = factory->CreateTransaction(
+ hostname, qtype, CompletionCallback(),
+ NetLogWithSource::Make(&net_log_, net::NetLogSourceType::NONE), secure,
+ factory->GetSecureDnsModeForTest(), context, true /* fast_timeout */);
+ transaction->SetRequestPriority(DEFAULT_PRIORITY);
+ EXPECT_EQ(qtype, transaction->GetType());
+ StartTransaction(std::move(transaction));
+ }
+
+ void StartTransaction(std::unique_ptr<DnsTransaction> transaction) {
+ EXPECT_FALSE(transaction_);
+ transaction_ = std::move(transaction);
+ qtype_ = transaction_->GetType();
transaction_->Start();
}
@@ -337,6 +331,11 @@ class TransactionHelper {
transaction_.reset(nullptr);
}
+ DnsTransactionFactory::CallbackType CompletionCallback() {
+ return base::BindOnce(&TransactionHelper::OnTransactionComplete,
+ base::Unretained(this));
+ }
+
void OnTransactionComplete(DnsTransaction* t,
int rv,
const DnsResponse* response,
@@ -347,8 +346,7 @@ class TransactionHelper {
completed_ = true;
response_ = response;
- if (transaction_complete_run_loop_)
- transaction_complete_run_loop_->QuitWhenIdle();
+ transaction_complete_run_loop_.Quit();
if (cancel_in_callback_) {
Cancel();
@@ -377,37 +375,25 @@ class TransactionHelper {
bool has_completed() const { return completed_; }
const DnsResponse* response() const { return response_; }
+ NetLog* net_log() { return &net_log_; }
- // Shorthands for commonly used commands.
-
- bool Run(DnsTransactionFactory* factory) {
- StartTransaction(factory);
- base::RunLoop().RunUntilIdle();
- return has_completed();
- }
-
- bool RunUntilDone(DnsTransactionFactory* factory) {
- DCHECK(!transaction_complete_run_loop_);
- transaction_complete_run_loop_ = std::make_unique<base::RunLoop>();
- StartTransaction(factory);
- transaction_complete_run_loop_->Run();
- transaction_complete_run_loop_.reset();
- return has_completed();
+ // Runs until the completion callback is called. Transaction must have already
+ // been started or this will never complete.
+ void RunUntilComplete() {
+ DCHECK(transaction_);
+ DCHECK(!transaction_complete_run_loop_.running());
+ transaction_complete_run_loop_.Run();
+ DCHECK(has_completed());
}
- NetLog* net_log() { return &net_log_; }
-
private:
- std::string hostname_;
- uint16_t qtype_;
- bool secure_;
+ uint16_t qtype_ = 0;
std::unique_ptr<DnsTransaction> transaction_;
- const DnsResponse* response_;
+ const DnsResponse* response_ = nullptr;
int expected_answer_count_;
- bool cancel_in_callback_;
- ResolveContext* context_;
- std::unique_ptr<base::RunLoop> transaction_complete_run_loop_;
- bool completed_;
+ bool cancel_in_callback_ = false;
+ base::RunLoop transaction_complete_run_loop_;
+ bool completed_ = false;
TestNetLog net_log_;
};
@@ -715,7 +701,7 @@ class DnsTransactionTestBase : public testing::Test {
}
// Add expected query of |dotted_name| and |qtype| and no response.
- void AddQueryAndTimeout(
+ void AddHangingQuery(
const char* dotted_name,
uint16_t qtype,
DnsQuery::PaddingStrategy padding_strategy =
@@ -880,8 +866,8 @@ class DnsTransactionTestBase : public testing::Test {
ConfigureNumServers(1);
// and no retransmissions,
config_.attempts = 1;
- // and an arbitrary timeout.
- config_.timeout = kTimeout;
+ // and an arbitrary fallback period.
+ config_.fallback_period = kFallbackPeriod;
request_context_ = std::make_unique<TestURLRequestContext>();
resolve_context_ = std::make_unique<ResolveContext>(
@@ -959,9 +945,10 @@ TEST_F(DnsTransactionTest, Lookup) {
kT0ResponseDatagram,
base::size(kT0ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, LookupWithEDNSOption) {
@@ -975,9 +962,10 @@ TEST_F(DnsTransactionTest, LookupWithEDNSOption) {
kT0ResponseDatagram, base::size(kT0ResponseDatagram),
&expected_opt_rdata);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, LookupWithMultipleEDNSOptions) {
@@ -998,9 +986,10 @@ TEST_F(DnsTransactionTest, LookupWithMultipleEDNSOptions) {
kT0ResponseDatagram, base::size(kT0ResponseDatagram),
&expected_opt_rdata);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
// Concurrent lookup tests assume that DnsTransaction::Start immediately
@@ -1013,12 +1002,12 @@ TEST_F(DnsTransactionTest, ConcurrentLookup) {
kT1ResponseDatagram,
base::size(kT1ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- helper0.StartTransaction(transaction_factory_.get());
- TransactionHelper helper1(kT1HostName, kT1Qtype, false /* secure */,
- kT1RecordCount, resolve_context_.get());
- helper1.StartTransaction(transaction_factory_.get());
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ TransactionHelper helper1(kT1RecordCount);
+ helper1.StartTransaction(transaction_factory_.get(), kT1HostName, kT1Qtype,
+ false /* secure */, resolve_context_.get());
base::RunLoop().RunUntilIdle();
@@ -1034,12 +1023,12 @@ TEST_F(DnsTransactionTest, CancelLookup) {
kT1ResponseDatagram,
base::size(kT1ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- helper0.StartTransaction(transaction_factory_.get());
- TransactionHelper helper1(kT1HostName, kT1Qtype, false /* secure */,
- kT1RecordCount, resolve_context_.get());
- helper1.StartTransaction(transaction_factory_.get());
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ TransactionHelper helper1(kT1RecordCount);
+ helper1.StartTransaction(transaction_factory_.get(), kT1HostName, kT1Qtype,
+ false /* secure */, resolve_context_.get());
helper0.Cancel();
@@ -1054,16 +1043,14 @@ TEST_F(DnsTransactionTest, DestroyFactory) {
kT0ResponseDatagram,
base::size(kT0ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- helper0.StartTransaction(transaction_factory_.get());
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
// Destroying the client does not affect running requests.
transaction_factory_.reset(nullptr);
- base::RunLoop().RunUntilIdle();
-
- EXPECT_TRUE(helper0.has_completed());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, CancelFromCallback) {
@@ -1071,10 +1058,12 @@ TEST_F(DnsTransactionTest, CancelFromCallback) {
kT0ResponseDatagram,
base::size(kT0ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
+ TransactionHelper helper0(kT0RecordCount);
helper0.set_cancel_in_callback();
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, MismatchedResponseSync) {
@@ -1095,9 +1084,10 @@ TEST_F(DnsTransactionTest, MismatchedResponseSync) {
SYNCHRONOUS);
AddSocketData(std::move(data1));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, MismatchedResponseAsync) {
@@ -1118,9 +1108,10 @@ TEST_F(DnsTransactionTest, MismatchedResponseAsync) {
ASYNC);
AddSocketData(std::move(data1));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, MismatchedResponseFail) {
@@ -1132,9 +1123,10 @@ TEST_F(DnsTransactionTest, MismatchedResponseFail) {
kT0ResponseDatagram,
base::size(kT0ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, MismatchedResponseNxdomain) {
@@ -1152,17 +1144,20 @@ TEST_F(DnsTransactionTest, MismatchedResponseNxdomain) {
AddSocketData(std::move(data));
AddSyncQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeNXDOMAIN);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, ServerFail) {
AddAsyncQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_DNS_SERVER_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_SERVER_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
+
ASSERT_NE(helper0.response(), nullptr);
EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL);
}
@@ -1170,34 +1165,46 @@ TEST_F(DnsTransactionTest, ServerFail) {
TEST_F(DnsTransactionTest, NoDomain) {
AddAsyncQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeNXDOMAIN);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
-TEST_F(DnsTransactionTestWithMockTime, Timeout) {
+TEST_F(DnsTransactionTestWithMockTime, Timeout_FastTimeout) {
config_.attempts = 3;
ConfigureFactory();
- AddQueryAndTimeout(kT0HostName, kT0Qtype);
- AddQueryAndTimeout(kT0HostName, kT0Qtype);
- AddQueryAndTimeout(kT0HostName, kT0Qtype);
+ AddHangingQuery(kT0HostName, kT0Qtype);
+ AddHangingQuery(kT0HostName, kT0Qtype);
+ AddHangingQuery(kT0HostName, kT0Qtype);
+
+ TransactionHelper helper0(ERR_DNS_TIMED_OUT);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper0.CompletionCallback(),
+ NetLogWithSource(), false /* secure */, SecureDnsMode::kOff,
+ resolve_context_.get(), true /* fast_timeout */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_DNS_TIMED_OUT, resolve_context_.get());
+ helper0.StartTransaction(std::move(transaction));
- // Finish when the third attempt times out.
- EXPECT_FALSE(helper0.Run(transaction_factory_.get()));
- FastForwardBy(resolve_context_->NextClassicTimeout(0, 0, session_.get()));
+ // Finish when the third attempt expires its fallback period.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(helper0.has_completed());
+ FastForwardBy(
+ resolve_context_->NextClassicFallbackPeriod(0, 0, session_.get()));
EXPECT_FALSE(helper0.has_completed());
- FastForwardBy(resolve_context_->NextClassicTimeout(0, 1, session_.get()));
+ FastForwardBy(
+ resolve_context_->NextClassicFallbackPeriod(0, 1, session_.get()));
EXPECT_FALSE(helper0.has_completed());
- FastForwardBy(resolve_context_->NextClassicTimeout(0, 2, session_.get()));
+ FastForwardBy(
+ resolve_context_->NextClassicFallbackPeriod(0, 2, session_.get()));
EXPECT_TRUE(helper0.has_completed());
}
TEST_F(DnsTransactionTestWithMockTime, ServerFallbackAndRotate) {
- // Test that we fallback on both server failure and timeout.
+ // Test that we fallback on both server failure and fallback period
+ // expiration.
config_.attempts = 2;
// The next request should start from the next server.
config_.rotate = true;
@@ -1205,9 +1212,9 @@ TEST_F(DnsTransactionTestWithMockTime, ServerFallbackAndRotate) {
ConfigureFactory();
// Responses for first request.
- AddQueryAndTimeout(kT0HostName, kT0Qtype);
+ AddHangingQuery(kT0HostName, kT0Qtype);
AddAsyncQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL);
- AddQueryAndTimeout(kT0HostName, kT0Qtype);
+ AddHangingQuery(kT0HostName, kT0Qtype);
AddAsyncQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL);
AddAsyncQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeNXDOMAIN);
// Responses for second request.
@@ -1215,15 +1222,19 @@ TEST_F(DnsTransactionTestWithMockTime, ServerFallbackAndRotate) {
AddAsyncQueryAndRcode(kT1HostName, kT1Qtype, dns_protocol::kRcodeSERVFAIL);
AddAsyncQueryAndRcode(kT1HostName, kT1Qtype, dns_protocol::kRcodeNXDOMAIN);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- TransactionHelper helper1(kT1HostName, kT1Qtype, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ TransactionHelper helper1(ERR_NAME_NOT_RESOLVED);
- EXPECT_FALSE(helper0.Run(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(helper0.has_completed());
FastForwardUntilNoTasksRemain();
EXPECT_TRUE(helper0.has_completed());
- EXPECT_TRUE(helper1.Run(transaction_factory_.get()));
+
+ helper1.StartTransaction(transaction_factory_.get(), kT1HostName, kT1Qtype,
+ false /* secure */, resolve_context_.get());
+ helper1.RunUntilComplete();
size_t kOrder[] = {
// The first transaction.
@@ -1259,10 +1270,12 @@ TEST_F(DnsTransactionTest, SuffixSearchAboveNdots) {
AddAsyncQueryAndRcode("x.y.z.c", dns_protocol::kTypeA,
dns_protocol::kRcodeNXDOMAIN);
- TransactionHelper helper0("x.y.z", dns_protocol::kTypeA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), "x.y.z",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
// Also check if suffix search causes server rotation.
size_t kOrder0[] = {0, 1, 0, 1};
@@ -1296,22 +1309,25 @@ TEST_F(DnsTransactionTest, SuffixSearchBelowNdots) {
AddAsyncQueryAndRcode("x", dns_protocol::kTypeAAAA,
dns_protocol::kRcodeNXDOMAIN);
- TransactionHelper helper0("x.y", dns_protocol::kTypeA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
-
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ helper0.StartTransaction(transaction_factory_.get(), "x.y",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
// A single-label name.
- TransactionHelper helper1("x", dns_protocol::kTypeA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
-
- EXPECT_TRUE(helper1.Run(transaction_factory_.get()));
+ TransactionHelper helper1(ERR_NAME_NOT_RESOLVED);
+ helper1.StartTransaction(transaction_factory_.get(), "x",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper1.RunUntilComplete();
// A fully-qualified name.
- TransactionHelper helper2("x.", dns_protocol::kTypeAAAA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
-
- EXPECT_TRUE(helper2.Run(transaction_factory_.get()));
+ TransactionHelper helper2(ERR_NAME_NOT_RESOLVED);
+ helper2.StartTransaction(transaction_factory_.get(), "x.",
+ dns_protocol::kTypeAAAA, false /* secure */,
+ resolve_context_.get());
+ helper2.RunUntilComplete();
}
TEST_F(DnsTransactionTest, EmptySuffixSearch) {
@@ -1320,18 +1336,18 @@ TEST_F(DnsTransactionTest, EmptySuffixSearch) {
dns_protocol::kRcodeNXDOMAIN);
// A fully-qualified name.
- TransactionHelper helper0("x.", dns_protocol::kTypeA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
-
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ helper0.StartTransaction(transaction_factory_.get(), "x.",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
// A single label name is not even attempted.
- TransactionHelper helper1("singlelabel", dns_protocol::kTypeA,
- false /* secure */, ERR_DNS_SEARCH_EMPTY,
- resolve_context_.get());
-
- helper1.Run(transaction_factory_.get());
- EXPECT_TRUE(helper1.has_completed());
+ TransactionHelper helper1(ERR_DNS_SEARCH_EMPTY);
+ helper1.StartTransaction(transaction_factory_.get(), "singlelabel",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper1.RunUntilComplete();
}
TEST_F(DnsTransactionTest, DontAppendToMultiLabelName) {
@@ -1355,17 +1371,23 @@ TEST_F(DnsTransactionTest, DontAppendToMultiLabelName) {
AddAsyncQueryAndRcode("x.c", dns_protocol::kTypeA,
dns_protocol::kRcodeNXDOMAIN);
- TransactionHelper helper0("x.y.z", dns_protocol::kTypeA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ helper0.StartTransaction(transaction_factory_.get(), "x.y.z",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
- TransactionHelper helper1("x.y", dns_protocol::kTypeA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- EXPECT_TRUE(helper1.Run(transaction_factory_.get()));
+ TransactionHelper helper1(ERR_NAME_NOT_RESOLVED);
+ helper1.StartTransaction(transaction_factory_.get(), "x.y",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper1.RunUntilComplete();
- TransactionHelper helper2("x", dns_protocol::kTypeA, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- EXPECT_TRUE(helper2.Run(transaction_factory_.get()));
+ TransactionHelper helper2(ERR_NAME_NOT_RESOLVED);
+ helper2.StartTransaction(transaction_factory_.get(), "x",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper2.RunUntilComplete();
}
const uint8_t kResponseNoData[] = {
@@ -1393,10 +1415,12 @@ TEST_F(DnsTransactionTest, SuffixSearchStop) {
AddAsyncQueryAndResponse(0 /* id */, "x.y.z.b", dns_protocol::kTypeA,
kResponseNoData, base::size(kResponseNoData));
- TransactionHelper helper0("x.y.z", dns_protocol::kTypeA, false /* secure */,
- 0 /* answers */, resolve_context_.get());
+ TransactionHelper helper0(0 /* answers */);
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), "x.y.z",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, SyncFirstQuery) {
@@ -1407,9 +1431,10 @@ TEST_F(DnsTransactionTest, SyncFirstQuery) {
AddSyncQueryAndResponse(0 /* id */, kT0HostName, kT0Qtype,
kT0ResponseDatagram, base::size(kT0ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, SyncFirstQueryWithSearch) {
@@ -1424,9 +1449,10 @@ TEST_F(DnsTransactionTest, SyncFirstQueryWithSearch) {
kT2ResponseDatagram,
base::size(kT2ResponseDatagram));
- TransactionHelper helper0("www", kT2Qtype, false /* secure */, kT2RecordCount,
- resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT2RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), "www", kT2Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, SyncSearchQuery) {
@@ -1439,9 +1465,10 @@ TEST_F(DnsTransactionTest, SyncSearchQuery) {
AddSyncQueryAndResponse(2 /* id */, kT2HostName, kT2Qtype,
kT2ResponseDatagram, base::size(kT2ResponseDatagram));
- TransactionHelper helper0("www", kT2Qtype, false /* secure */, kT2RecordCount,
- resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT2RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), "www", kT2Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, ConnectFailure) {
@@ -1453,11 +1480,13 @@ TEST_F(DnsTransactionTest, ConnectFailure) {
socket_factory_->AddSocketDataProvider(&data_provider);
transaction_ids_.push_back(0); // Needed to make a DnsUDPAttempt.
- TransactionHelper helper0("www.chromium.org", dns_protocol::kTypeA,
- false /* secure */, ERR_CONNECTION_REFUSED,
- resolve_context_.get());
+ TransactionHelper helper0(ERR_CONNECTION_REFUSED);
+
+ helper0.StartTransaction(transaction_factory_.get(), "www.chromium.org",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
EXPECT_FALSE(helper0.response());
EXPECT_FALSE(session_->udp_tracker()->low_entropy());
}
@@ -1471,11 +1500,13 @@ TEST_F(DnsTransactionTest, ConnectFailure_SocketLimitReached) {
socket_factory_->AddSocketDataProvider(&data_provider);
transaction_ids_.push_back(0); // Needed to make a DnsUDPAttempt.
- TransactionHelper helper0("www.chromium.org", dns_protocol::kTypeA,
- false /* secure */, ERR_CONNECTION_REFUSED,
- resolve_context_.get());
+ TransactionHelper helper0(ERR_CONNECTION_REFUSED);
+
+ helper0.StartTransaction(transaction_factory_.get(), "www.chromium.org",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
EXPECT_FALSE(helper0.response());
EXPECT_TRUE(session_->udp_tracker()->low_entropy());
}
@@ -1491,9 +1522,10 @@ TEST_F(DnsTransactionTest, ConnectFailureFollowedBySuccess) {
AddAsyncQueryAndResponse(0 /* id */, kT0HostName, kT0Qtype,
kT0ResponseDatagram,
base::size(kT0ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsGetLookup) {
@@ -1503,9 +1535,10 @@ TEST_F(DnsTransactionTest, HttpsGetLookup) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsGetFailure) {
@@ -1515,9 +1548,10 @@ TEST_F(DnsTransactionTest, HttpsGetFailure) {
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_SERVER_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_SERVER_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
ASSERT_NE(helper0.response(), nullptr);
EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL);
}
@@ -1530,9 +1564,10 @@ TEST_F(DnsTransactionTest, HttpsGetMalformed) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookup) {
@@ -1542,9 +1577,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookup) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostFailure) {
@@ -1554,9 +1590,10 @@ TEST_F(DnsTransactionTest, HttpsPostFailure) {
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_SERVER_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_SERVER_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
ASSERT_NE(helper0.response(), nullptr);
EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL);
}
@@ -1570,9 +1607,10 @@ TEST_F(DnsTransactionTest, HttpsPostMalformed) {
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupAsync) {
@@ -1582,9 +1620,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupAsync) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
std::unique_ptr<URLRequestJob> DohJobMakerCallbackFailLookup(
@@ -1602,11 +1641,11 @@ TEST_F(DnsTransactionTest, HttpsPostLookupFailDohServerLookup) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED,
- resolve_context_.get());
+ TransactionHelper helper0(ERR_DNS_SECURE_RESOLVER_HOSTNAME_RESOLUTION_FAILED);
SetDohJobMakerCallback(base::BindRepeating(DohJobMakerCallbackFailLookup));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
std::unique_ptr<URLRequestJob> DohJobMakerCallbackFailStart(
@@ -1624,10 +1663,11 @@ TEST_F(DnsTransactionTest, HttpsPostLookupFailStart) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_FAILED, resolve_context_.get());
+ TransactionHelper helper0(ERR_FAILED);
SetDohJobMakerCallback(base::BindRepeating(DohJobMakerCallbackFailStart));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
std::unique_ptr<URLRequestJob> DohJobMakerCallbackFailSync(
@@ -1645,10 +1685,11 @@ TEST_F(DnsTransactionTest, HttpsPostLookupFailSync) {
nullptr /* opt_rdata */, DnsQuery::PaddingStrategy::BLOCK_LENGTH_128));
data->AddResponseWithLength(std::make_unique<DnsResponse>(), SYNCHRONOUS, 0);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
SetDohJobMakerCallback(base::BindRepeating(DohJobMakerCallbackFailSync));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
std::unique_ptr<URLRequestJob> DohJobMakerCallbackFailAsync(
@@ -1666,10 +1707,11 @@ TEST_F(DnsTransactionTest, HttpsPostLookupFailAsync) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
SetDohJobMakerCallback(base::BindRepeating(DohJobMakerCallbackFailAsync));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookup2Sync) {
@@ -1681,9 +1723,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookup2Sync) {
data->AddResponseData(kT0ResponseDatagram + 20,
base::size(kT0ResponseDatagram) - 20, SYNCHRONOUS);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookup2Async) {
@@ -1695,9 +1738,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookup2Async) {
data->AddResponseData(kT0ResponseDatagram + 20,
base::size(kT0ResponseDatagram) - 20, ASYNC);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupAsyncWithAsyncZeroRead) {
@@ -1709,9 +1753,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupAsyncWithAsyncZeroRead) {
ASYNC);
data->AddResponseData(kT0ResponseDatagram, 0, ASYNC);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupSyncWithAsyncZeroRead) {
@@ -1723,9 +1768,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupSyncWithAsyncZeroRead) {
SYNCHRONOUS);
data->AddResponseData(kT0ResponseDatagram, 0, ASYNC);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupAsyncThenSync) {
@@ -1737,9 +1783,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupAsyncThenSync) {
data->AddResponseData(kT0ResponseDatagram + 20,
base::size(kT0ResponseDatagram) - 20, SYNCHRONOUS);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupAsyncThenSyncError) {
@@ -1750,9 +1797,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupAsyncThenSyncError) {
data->AddResponseData(kT0ResponseDatagram, 20, ASYNC);
data->AddReadError(ERR_FAILED, SYNCHRONOUS);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupAsyncThenAsyncError) {
@@ -1763,9 +1811,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupAsyncThenAsyncError) {
data->AddResponseData(kT0ResponseDatagram, 20, ASYNC);
data->AddReadError(ERR_FAILED, ASYNC);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupSyncThenAsyncError) {
@@ -1776,9 +1825,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupSyncThenAsyncError) {
data->AddResponseData(kT0ResponseDatagram, 20, SYNCHRONOUS);
data->AddReadError(ERR_FAILED, ASYNC);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsPostLookupSyncThenSyncError) {
@@ -1789,9 +1839,10 @@ TEST_F(DnsTransactionTest, HttpsPostLookupSyncThenSyncError) {
data->AddResponseData(kT0ResponseDatagram, 20, SYNCHRONOUS);
data->AddReadError(ERR_FAILED, SYNCHRONOUS);
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsNotAvailable) {
@@ -1800,9 +1851,10 @@ TEST_F(DnsTransactionTest, HttpsNotAvailable) {
ASSERT_FALSE(resolve_context_->GetDohServerAvailability(
0u /* doh_server_index */, session_.get()));
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_BLOCKED_BY_CLIENT, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_BLOCKED_BY_CLIENT);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, HttpsMarkHttpsBad) {
@@ -1838,11 +1890,14 @@ TEST_F(DnsTransactionTest, HttpsMarkHttpsBad) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- TransactionHelper helper1(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+
+ TransactionHelper helper0(kT0RecordCount);
+ TransactionHelper helper1(kT0RecordCount);
+
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
+
// UDP server 0 is our only UDP server, so it will be good. HTTPS
// servers 0 and 1 failed and will be marked bad. HTTPS server 2 succeeded
// so it will be good.
@@ -1866,7 +1921,9 @@ TEST_F(DnsTransactionTest, HttpsMarkHttpsBad) {
size_t kOrder0[] = {1, 2, 3};
CheckServerOrder(kOrder0, base::size(kOrder0));
- EXPECT_TRUE(helper1.RunUntilDone(transaction_factory_.get()));
+ helper1.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper1.RunUntilComplete();
// UDP server 0 is still our only UDP server, so it will be good by
// definition. HTTPS server 2 started out as good, so it was tried first and
// failed. HTTPS server 0 then had the oldest failure so it would be the next
@@ -1907,9 +1964,10 @@ TEST_F(DnsTransactionTest, HttpsPostFailThenHTTPFallback) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
size_t kOrder0[] = {1, 2};
CheckServerOrder(kOrder0, base::size(kOrder0));
}
@@ -1927,10 +1985,11 @@ TEST_F(DnsTransactionTest, HttpsPostFailTwice) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_FAILED, resolve_context_.get());
+ TransactionHelper helper0(ERR_FAILED);
SetDohJobMakerCallback(base::BindRepeating(DohJobMakerCallbackFailStart));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
size_t kOrder0[] = {1, 2};
CheckServerOrder(kOrder0, base::size(kOrder0));
}
@@ -1957,9 +2016,10 @@ TEST_F(DnsTransactionTest, HttpsNotAvailableThenHttpFallback) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
size_t kOrder0[] = {2};
CheckServerOrder(kOrder0, base::size(kOrder0));
{
@@ -1998,9 +2058,10 @@ TEST_F(DnsTransactionTest, HttpsFailureThenNotAvailable_Automatic) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_CONNECTION_REFUSED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_CONNECTION_REFUSED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
// Expect fallback not attempted because other servers not available in
// AUTOMATIC mode until they have recorded a success.
@@ -2057,9 +2118,10 @@ TEST_F(DnsTransactionTest, HttpsFailureThenNotAvailable_Secure) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_CONNECTION_REFUSED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_CONNECTION_REFUSED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
// Expect fallback to attempt all servers because SECURE mode does not require
// server availability.
@@ -2095,9 +2157,10 @@ TEST_F(DnsTransactionTest, MaxHttpsFailures_NonConsecutive) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper failure(kT0HostName, kT0Qtype, true /* secure */,
- ERR_CONNECTION_REFUSED, resolve_context_.get());
- EXPECT_TRUE(failure.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper failure(ERR_CONNECTION_REFUSED);
+ failure.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ failure.RunUntilComplete();
std::unique_ptr<DnsServerIterator> doh_itr =
resolve_context_->GetDohIterator(
@@ -2113,9 +2176,10 @@ TEST_F(DnsTransactionTest, MaxHttpsFailures_NonConsecutive) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper success(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(success.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper success(kT0RecordCount);
+ success.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ success.RunUntilComplete();
{
std::unique_ptr<DnsServerIterator> doh_itr =
resolve_context_->GetDohIterator(
@@ -2131,10 +2195,11 @@ TEST_F(DnsTransactionTest, MaxHttpsFailures_NonConsecutive) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper last_failure(kT0HostName, kT0Qtype, true /* secure */,
- ERR_CONNECTION_REFUSED,
- resolve_context_.get());
- EXPECT_TRUE(last_failure.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper last_failure(ERR_CONNECTION_REFUSED);
+ last_failure.StartTransaction(transaction_factory_.get(), kT0HostName,
+ kT0Qtype, true /* secure */,
+ resolve_context_.get());
+ last_failure.RunUntilComplete();
{
std::unique_ptr<DnsServerIterator> doh_itr =
resolve_context_->GetDohIterator(
@@ -2163,9 +2228,10 @@ TEST_F(DnsTransactionTest, MaxHttpsFailures_Consecutive) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper failure(kT0HostName, kT0Qtype, true /* secure */,
- ERR_CONNECTION_REFUSED, resolve_context_.get());
- EXPECT_TRUE(failure.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper failure(ERR_CONNECTION_REFUSED);
+ failure.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ failure.RunUntilComplete();
std::unique_ptr<DnsServerIterator> doh_itr =
resolve_context_->GetDohIterator(
session_->config(), SecureDnsMode::kAutomatic, session_.get());
@@ -2180,10 +2246,11 @@ TEST_F(DnsTransactionTest, MaxHttpsFailures_Consecutive) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper last_failure(kT0HostName, kT0Qtype, true /* secure */,
- ERR_CONNECTION_REFUSED,
- resolve_context_.get());
- EXPECT_TRUE(last_failure.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper last_failure(ERR_CONNECTION_REFUSED);
+ last_failure.StartTransaction(transaction_factory_.get(), kT0HostName,
+ kT0Qtype, true /* secure */,
+ resolve_context_.get());
+ last_failure.RunUntilComplete();
{
std::unique_ptr<DnsServerIterator> doh_itr =
resolve_context_->GetDohIterator(
@@ -2218,9 +2285,12 @@ TEST_F(DnsTransactionTest, SuccessfulTransactionStartedBeforeUnavailable) {
SequencedSocketData* sequenced_socket_data = data->GetProvider();
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper delayed_success(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_FALSE(delayed_success.Run(transaction_factory_.get()));
+ TransactionHelper delayed_success(kT0RecordCount);
+ delayed_success.StartTransaction(transaction_factory_.get(), kT0HostName,
+ kT0Qtype, true /* secure */,
+ resolve_context_.get());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(delayed_success.has_completed());
// Trigger DoH server unavailability with a bunch of failures.
for (size_t i = 0; i < ResolveContext::kAutomaticModeFailureLimit; i++) {
@@ -2229,9 +2299,10 @@ TEST_F(DnsTransactionTest, SuccessfulTransactionStartedBeforeUnavailable) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper failure(kT0HostName, kT0Qtype, true /* secure */,
- ERR_CONNECTION_REFUSED, resolve_context_.get());
- EXPECT_TRUE(failure.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper failure(ERR_CONNECTION_REFUSED);
+ failure.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ failure.RunUntilComplete();
}
EXPECT_FALSE(resolve_context_->GetDohServerAvailability(
0u /* doh_server_index */, session_.get()));
@@ -2239,8 +2310,7 @@ TEST_F(DnsTransactionTest, SuccessfulTransactionStartedBeforeUnavailable) {
// Resume first query.
ASSERT_FALSE(delayed_success.has_completed());
sequenced_socket_data->Resume();
- base::RunLoop().RunUntilIdle();
- EXPECT_TRUE(delayed_success.has_completed());
+ delayed_success.RunUntilComplete();
// Expect DoH server is available again.
EXPECT_TRUE(resolve_context_->GetDohServerAvailability(
@@ -2293,12 +2363,13 @@ TEST_F(DnsTransactionTest, HttpsPostTestNoCookies) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- TransactionHelper helper1(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
+ TransactionHelper helper0(kT0RecordCount);
+ TransactionHelper helper1(kT0RecordCount);
SetResponseModifierCallback(base::BindRepeating(MakeResponseWithCookie));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
CookieCallback callback;
request_context_->cookie_store()->GetCookieListWithOptionsAsync(
@@ -2319,7 +2390,9 @@ TEST_F(DnsTransactionTest, HttpsPostTestNoCookies) {
std::move(cookie), cookie_url, CookieOptions(),
base::BindOnce(&CookieCallback::SetCookieCallback,
base::Unretained(&callback)));
- EXPECT_TRUE(helper1.RunUntilDone(transaction_factory_.get()));
+ helper1.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper1.RunUntilComplete();
}
void MakeResponseWithoutLength(URLRequest* request, HttpResponseInfo* info) {
@@ -2333,10 +2406,11 @@ TEST_F(DnsTransactionTest, HttpsPostNoContentLength) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
+ TransactionHelper helper0(kT0RecordCount);
SetResponseModifierCallback(base::BindRepeating(MakeResponseWithoutLength));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
void MakeResponseWithBadRequestResponse(URLRequest* request,
@@ -2351,11 +2425,12 @@ TEST_F(DnsTransactionTest, HttpsPostWithBadRequestResponse) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
SetResponseModifierCallback(
base::BindRepeating(MakeResponseWithBadRequestResponse));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
void MakeResponseWrongType(URLRequest* request, HttpResponseInfo* info) {
@@ -2370,10 +2445,11 @@ TEST_F(DnsTransactionTest, HttpsPostWithWrongType) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
SetResponseModifierCallback(base::BindRepeating(MakeResponseWrongType));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
void MakeResponseRedirect(URLRequest* request, HttpResponseInfo* info) {
@@ -2396,10 +2472,11 @@ TEST_F(DnsTransactionTest, HttpsGetRedirect) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
+ TransactionHelper helper0(kT0RecordCount);
SetResponseModifierCallback(base::BindRepeating(MakeResponseRedirect));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
void MakeResponseNoType(URLRequest* request, HttpResponseInfo* info) {
@@ -2413,10 +2490,11 @@ TEST_F(DnsTransactionTest, HttpsPostWithNoType) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
SetResponseModifierCallback(base::BindRepeating(MakeResponseNoType));
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, CanLookupDohServerName) {
@@ -2427,9 +2505,11 @@ TEST_F(DnsTransactionTest, CanLookupDohServerName) {
nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0("mock", dns_protocol::kTypeA, true /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ helper0.StartTransaction(transaction_factory_.get(), "mock",
+ dns_protocol::kTypeA, true /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
}
class CountingObserver : public net::NetLog::ThreadSafeObserver {
@@ -2463,39 +2543,88 @@ TEST_F(DnsTransactionTest, HttpsPostLookupWithLog) {
Transport::HTTPS, nullptr /* opt_rdata */,
DnsQuery::PaddingStrategy::BLOCK_LENGTH_128,
false /* enqueue_transaction_id */);
- TransactionHelper helper0(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
+ TransactionHelper helper0(kT0RecordCount);
CountingObserver observer;
helper0.net_log()->AddObserver(&observer, NetLogCaptureMode::kEverything);
- EXPECT_TRUE(helper0.RunUntilDone(transaction_factory_.get()));
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ true /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
base::RunLoop().RunUntilIdle();
EXPECT_EQ(observer.count(), 5);
EXPECT_EQ(observer.dict_count(), 3);
}
-// Test for when a slow DoH response is delayed until after the initial timeout
-// and no more attempts are configured.
+// Test for when a slow DoH response is delayed until after the initial fallback
+// period (but succeeds before the full timeout period).
TEST_F(DnsTransactionTestWithMockTime, SlowHttpsResponse_SingleAttempt) {
config_.doh_attempts = 1;
ConfigureDohServers(false /* use_post */);
- AddQueryAndTimeout(kT0HostName, kT0Qtype,
- DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
- false /* enqueue_transaction_id */);
+ // Assume fallback period is less than timeout.
+ ASSERT_LT(resolve_context_->NextDohFallbackPeriod(0 /* doh_server_index */,
+ session_.get()),
+ resolve_context_->SecureTransactionTimeout(SecureDnsMode::kSecure,
+ session_.get()));
+
+ // Simulate a slow response by using an ERR_IO_PENDING read error to delay
+ // until SequencedSocketData::Resume() is called.
+ auto data = std::make_unique<DnsSocketData>(
+ 0 /* id */, kT0HostName, kT0Qtype, ASYNC, Transport::HTTPS,
+ nullptr /* opt_rdata */, DnsQuery::PaddingStrategy::BLOCK_LENGTH_128);
+ data->AddReadError(ERR_IO_PENDING, ASYNC);
+ data->AddResponseData(kT0ResponseDatagram, base::size(kT0ResponseDatagram),
+ ASYNC);
+ SequencedSocketData* sequenced_socket_data = data->GetProvider();
+ AddSocketData(std::move(data), false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(kT0RecordCount);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+
+ helper.StartTransaction(std::move(transaction));
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(helper.has_completed());
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
+ EXPECT_FALSE(helper.has_completed());
+
+ sequenced_socket_data->Resume();
+ helper.RunUntilComplete();
+}
+
+// Test for when a slow DoH response is delayed until after the initial fallback
+// period but fast timeout is enabled, resulting in timeout failure.
+TEST_F(DnsTransactionTestWithMockTime,
+ SlowHttpsResponse_SingleAttempt_FastTimeout) {
+ config_.doh_attempts = 1;
+ ConfigureDohServers(false /* use_post */);
- TransactionHelper helper(kT0HostName, kT0Qtype, true /* secure */,
- ERR_DNS_TIMED_OUT, resolve_context_.get());
- ASSERT_FALSE(helper.Run(transaction_factory_.get()));
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(ERR_DNS_TIMED_OUT);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), true /* fast_timeout */);
+ helper.StartTransaction(std::move(transaction));
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(helper.has_completed());
- // Only one attempt configured, so expect immediate failure after timeout
- // period.
- FastForwardBy(resolve_context_->NextDohTimeout(0 /* doh_server_index */,
- session_.get()));
+ // Only one attempt configured and fast timeout enabled, so expect immediate
+ // failure after fallback period.
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
EXPECT_TRUE(helper.has_completed());
}
-// Test for when a slow DoH response is delayed until after the initial timeout
-// but a retry is configured.
+// Test for when a slow DoH response is delayed until after the initial fallback
+// period but a retry is configured.
TEST_F(DnsTransactionTestWithMockTime, SlowHttpsResponse_TwoAttempts) {
config_.doh_attempts = 2;
ConfigureDohServers(false /* use_post */);
@@ -2511,36 +2640,367 @@ TEST_F(DnsTransactionTestWithMockTime, SlowHttpsResponse_TwoAttempts) {
SequencedSocketData* sequenced_socket_data = data->GetProvider();
AddSocketData(std::move(data), false /* enqueue_transaction_id */);
- TransactionHelper helper(kT0HostName, kT0Qtype, true /* secure */,
- kT0RecordCount, resolve_context_.get());
- ASSERT_FALSE(helper.Run(transaction_factory_.get()));
+ TransactionHelper helper(kT0RecordCount);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+
+ helper.StartTransaction(std::move(transaction));
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(helper.has_completed());
ASSERT_TRUE(sequenced_socket_data->IsPaused());
// Another attempt configured, so transaction should not fail after initial
- // timeout. Setup the second attempt to never receive a response.
- AddQueryAndTimeout(kT0HostName, kT0Qtype,
- DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
- false /* enqueue_transaction_id */);
- FastForwardBy(resolve_context_->NextDohTimeout(0 /* doh_server_index */,
- session_.get()));
+ // fallback period. Setup the second attempt to never receive a response.
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
EXPECT_FALSE(helper.has_completed());
// Expect first attempt to continue in parallel with retry, so expect the
// transaction to complete when the first query is allowed to resume.
sequenced_socket_data->Resume();
+ helper.RunUntilComplete();
+}
+
+// Test for when a slow DoH response is delayed until after the full timeout
+// period.
+TEST_F(DnsTransactionTestWithMockTime, HttpsTimeout) {
+ config_.doh_attempts = 1;
+ ConfigureDohServers(false /* use_post */);
+
+ // Assume fallback period is less than timeout.
+ ASSERT_LT(resolve_context_->NextDohFallbackPeriod(0 /* doh_server_index */,
+ session_.get()),
+ resolve_context_->SecureTransactionTimeout(SecureDnsMode::kSecure,
+ session_.get()));
+
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(ERR_DNS_TIMED_OUT);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+ helper.StartTransaction(std::move(transaction));
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(helper.has_completed());
+
+ // Stop a tiny bit short to ensure transaction doesn't finish early.
+ const base::TimeDelta kTimeHoldback = base::TimeDelta::FromMilliseconds(5);
+ base::TimeDelta timeout = resolve_context_->SecureTransactionTimeout(
+ SecureDnsMode::kSecure, session_.get());
+ ASSERT_LT(kTimeHoldback, timeout);
+ FastForwardBy(timeout - kTimeHoldback);
+ EXPECT_FALSE(helper.has_completed());
+
+ FastForwardBy(kTimeHoldback);
+ EXPECT_TRUE(helper.has_completed());
+}
+
+// Test for when two slow DoH responses are delayed until after the full timeout
+// period.
+TEST_F(DnsTransactionTestWithMockTime, HttpsTimeout2) {
+ config_.doh_attempts = 2;
+ ConfigureDohServers(false /* use_post */);
+
+ // Assume fallback period is less than timeout.
+ ASSERT_LT(resolve_context_->NextDohFallbackPeriod(0 /* doh_server_index */,
+ session_.get()),
+ resolve_context_->SecureTransactionTimeout(SecureDnsMode::kSecure,
+ session_.get()));
+
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(ERR_DNS_TIMED_OUT);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+ helper.StartTransaction(std::move(transaction));
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(helper.has_completed());
+
+ base::TimeDelta fallback_period = resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get());
+ FastForwardBy(fallback_period);
+ EXPECT_FALSE(helper.has_completed());
+
+ // Timeout is from start of transaction, so need to keep track of the
+ // remainder after other fast forwards.
+ base::TimeDelta timeout = resolve_context_->SecureTransactionTimeout(
+ SecureDnsMode::kSecure, session_.get());
+ base::TimeDelta timeout_remainder = timeout - fallback_period;
+
+ // Fallback period for second attempt.
+ fallback_period = resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get());
+ ASSERT_LT(fallback_period, timeout_remainder);
+ FastForwardBy(fallback_period);
+ EXPECT_FALSE(helper.has_completed());
+ timeout_remainder -= fallback_period;
+
+ // Stop a tiny bit short to ensure transaction doesn't finish early.
+ const base::TimeDelta kTimeHoldback = base::TimeDelta::FromMilliseconds(5);
+ ASSERT_LT(kTimeHoldback, timeout_remainder);
+ FastForwardBy(timeout_remainder - kTimeHoldback);
+ EXPECT_FALSE(helper.has_completed());
+
+ FastForwardBy(kTimeHoldback);
+ EXPECT_TRUE(helper.has_completed());
+}
+
+// Test for when attempt fallback periods go beyond the full timeout period.
+TEST_F(DnsTransactionTestWithMockTime, LongHttpsTimeouts) {
+ const int kNumAttempts = 20;
+ config_.doh_attempts = kNumAttempts;
+ ConfigureDohServers(false /* use_post */);
+
+ // Assume sum of fallback periods is greater than timeout.
+ ASSERT_GT(kNumAttempts * resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()),
+ resolve_context_->SecureTransactionTimeout(SecureDnsMode::kSecure,
+ session_.get()));
+
+ for (int i = 0; i < kNumAttempts; ++i) {
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+ }
+
+ TransactionHelper helper(ERR_DNS_TIMED_OUT);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+ helper.StartTransaction(std::move(transaction));
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(helper.has_completed());
+
+ for (int i = 0; i < kNumAttempts - 1; ++i) {
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
+ EXPECT_FALSE(helper.has_completed());
+ }
+
+ // Expect transaction to time out immediately after the last fallback period.
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
+ EXPECT_TRUE(helper.has_completed());
+}
+
+// Test for when the last of multiple HTTPS attempts fails (SERVFAIL) before
+// a previous attempt succeeds.
+TEST_F(DnsTransactionTestWithMockTime, LastHttpsAttemptFails) {
+ config_.doh_attempts = 2;
+ ConfigureDohServers(false /* use_post */);
+
+ // Simulate a slow response by using an ERR_IO_PENDING read error to delay
+ // until SequencedSocketData::Resume() is called.
+ auto data = std::make_unique<DnsSocketData>(
+ 0 /* id */, kT0HostName, kT0Qtype, ASYNC, Transport::HTTPS,
+ nullptr /* opt_rdata */, DnsQuery::PaddingStrategy::BLOCK_LENGTH_128);
+ data->AddReadError(ERR_IO_PENDING, ASYNC);
+ data->AddResponseData(kT0ResponseDatagram, base::size(kT0ResponseDatagram),
+ ASYNC);
+ SequencedSocketData* sequenced_socket_data = data->GetProvider();
+ AddSocketData(std::move(data), false /* enqueue_transaction_id */);
+
+ AddQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL,
+ SYNCHRONOUS, Transport::HTTPS,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(kT0RecordCount);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+ helper.StartTransaction(std::move(transaction));
+
+ // Wait for one timeout period to start (and fail) the second attempt.
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
+ EXPECT_FALSE(helper.has_completed());
+
+ // Complete the first attempt and expect immediate success.
+ sequenced_socket_data->Resume();
+ helper.RunUntilComplete();
+}
+
+// Test for when the last of multiple HTTPS attempts fails (SERVFAIL), and a
+// previous attempt never completes.
+TEST_F(DnsTransactionTestWithMockTime, LastHttpsAttemptFails_Timeout) {
+ config_.doh_attempts = 2;
+ ConfigureDohServers(false /* use_post */);
+
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+ AddQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL,
+ SYNCHRONOUS, Transport::HTTPS,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(ERR_DNS_TIMED_OUT);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+
+ helper.StartTransaction(std::move(transaction));
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(helper.has_completed());
+
+ // Second attempt fails immediately after first fallback period, but because
+ // fast timeout is disabled, the transaction will attempt to wait for the
+ // first attempt.
+ base::TimeDelta fallback_period = resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get());
+ FastForwardBy(fallback_period);
+ EXPECT_FALSE(helper.has_completed());
+
+ // Timeout is from start of transaction, so need to keep track of the
+ // remainder after other fast forwards.
+ base::TimeDelta timeout = resolve_context_->SecureTransactionTimeout(
+ SecureDnsMode::kSecure, session_.get());
+ base::TimeDelta timeout_remainder = timeout - fallback_period;
+
+ // Stop a tiny bit short to ensure transaction doesn't finish early.
+ const base::TimeDelta kTimeHoldback = base::TimeDelta::FromMilliseconds(5);
+ ASSERT_LT(kTimeHoldback, timeout_remainder);
+ FastForwardBy(timeout_remainder - kTimeHoldback);
+ EXPECT_FALSE(helper.has_completed());
+
+ FastForwardBy(kTimeHoldback);
+ EXPECT_TRUE(helper.has_completed());
+}
+
+// Test for when the last of multiple HTTPS attempts fails (SERVFAIL) before
+// a previous attempt can complete, but fast timeouts is enabled.
+TEST_F(DnsTransactionTestWithMockTime, LastHttpsAttemptFails_FastTimeout) {
+ config_.doh_attempts = 2;
+ ConfigureDohServers(false /* use_post */);
+
+ AddHangingQuery(kT0HostName, kT0Qtype,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+ AddQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL,
+ SYNCHRONOUS, Transport::HTTPS,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(ERR_DNS_SERVER_FAILED);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), true /* fast_timeout */);
+
+ helper.StartTransaction(std::move(transaction));
base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(helper.has_completed());
+
+ // With fast timeout enabled, expect the transaction to complete with failure
+ // immediately on failure of the last transaction.
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
EXPECT_TRUE(helper.has_completed());
}
+// Test for when the last of multiple HTTPS attempts fails (SERVFAIL) before
+// a previous attempt later fails as well.
+TEST_F(DnsTransactionTestWithMockTime, LastHttpsAttemptFailsFirst) {
+ config_.doh_attempts = 2;
+ ConfigureDohServers(false /* use_post */);
+
+ // Simulate a slow response by using an ERR_IO_PENDING read error to delay
+ // until SequencedSocketData::Resume() is called.
+ auto data = std::make_unique<DnsSocketData>(
+ 0 /* id */, kT0HostName, kT0Qtype, ASYNC, Transport::HTTPS,
+ nullptr /* opt_rdata */, DnsQuery::PaddingStrategy::BLOCK_LENGTH_128);
+ data->AddReadError(ERR_IO_PENDING, ASYNC);
+ data->AddRcode(dns_protocol::kRcodeSERVFAIL, ASYNC);
+ SequencedSocketData* sequenced_socket_data = data->GetProvider();
+ AddSocketData(std::move(data), false /* enqueue_transaction_id */);
+
+ AddQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL,
+ SYNCHRONOUS, Transport::HTTPS,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(ERR_DNS_SERVER_FAILED);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+ helper.StartTransaction(std::move(transaction));
+
+ // Wait for one timeout period to start (and fail) the second attempt.
+ FastForwardBy(resolve_context_->NextDohFallbackPeriod(
+ 0 /* doh_server_index */, session_.get()));
+ EXPECT_FALSE(helper.has_completed());
+
+ // Complete the first attempt and expect immediate completion.
+ sequenced_socket_data->Resume();
+ helper.RunUntilComplete();
+}
+
+// Test for when multiple HTTPS attempts fail (SERVFAIL) in order, making the
+// last started attempt also the last attempt to be pending.
+TEST_F(DnsTransactionTestWithMockTime, LastHttpsAttemptFailsLast) {
+ config_.doh_attempts = 2;
+ ConfigureDohServers(false /* use_post */);
+
+ AddQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL,
+ SYNCHRONOUS, Transport::HTTPS,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+ AddQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL,
+ SYNCHRONOUS, Transport::HTTPS,
+ DnsQuery::PaddingStrategy::BLOCK_LENGTH_128, 0 /* id */,
+ false /* enqueue_transaction_id */);
+
+ TransactionHelper helper(ERR_DNS_SERVER_FAILED);
+ std::unique_ptr<DnsTransaction> transaction =
+ transaction_factory_->CreateTransaction(
+ kT0HostName, kT0Qtype, helper.CompletionCallback(),
+ NetLogWithSource(), true /* secure */, SecureDnsMode::kSecure,
+ resolve_context_.get(), false /* fast_timeout */);
+ helper.StartTransaction(std::move(transaction));
+
+ // Expect both attempts will run quickly without waiting for fallbacks or
+ // transaction timeout.
+ helper.RunUntilComplete();
+}
+
TEST_F(DnsTransactionTest, TcpLookup_UdpRetry) {
AddAsyncQueryAndRcode(kT0HostName, kT0Qtype,
dns_protocol::kRcodeNOERROR | dns_protocol::kFlagTC);
AddQueryAndResponse(0 /* id */, kT0HostName, kT0Qtype, kT0ResponseDatagram,
base::size(kT0ResponseDatagram), ASYNC, Transport::TCP);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, TcpLookup_LowEntropy) {
@@ -2555,16 +3015,19 @@ TEST_F(DnsTransactionTest, TcpLookup_LowEntropy) {
base::size(kT0ResponseDatagram), ASYNC, Transport::TCP);
for (int i = 0; i <= DnsUdpTracker::kPortReuseThreshold; ++i) {
- TransactionHelper udp_helper(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- udp_helper.RunUntilDone(transaction_factory_.get());
+ TransactionHelper udp_helper(kT0RecordCount);
+ udp_helper.StartTransaction(transaction_factory_.get(), kT0HostName,
+ kT0Qtype, false /* secure */,
+ resolve_context_.get());
+ udp_helper.RunUntilComplete();
}
ASSERT_TRUE(session_->udp_tracker()->low_entropy());
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
EXPECT_TRUE(session_->udp_tracker()->low_entropy());
}
@@ -2574,9 +3037,10 @@ TEST_F(DnsTransactionTest, TCPFailure) {
AddQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeSERVFAIL, ASYNC,
Transport::TCP);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_DNS_SERVER_FAILED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_SERVER_FAILED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
ASSERT_NE(helper0.response(), nullptr);
EXPECT_EQ(helper0.response()->rcode(), dns_protocol::kRcodeSERVFAIL);
}
@@ -2597,9 +3061,10 @@ TEST_F(DnsTransactionTest, TCPMalformed) {
ASYNC, static_cast<uint16_t>(kT0QuerySize - 1));
AddSocketData(std::move(data));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_DNS_MALFORMED_RESPONSE, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_MALFORMED_RESPONSE);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTestWithMockTime, TcpTimeout_UdpRetry) {
@@ -2609,9 +3074,11 @@ TEST_F(DnsTransactionTestWithMockTime, TcpTimeout_UdpRetry) {
AddSocketData(std::make_unique<DnsSocketData>(
1 /* id */, kT0HostName, kT0Qtype, ASYNC, Transport::TCP));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_DNS_TIMED_OUT, resolve_context_.get());
- EXPECT_FALSE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_TIMED_OUT);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(helper0.has_completed());
FastForwardUntilNoTasksRemain();
EXPECT_TRUE(helper0.has_completed());
}
@@ -2629,16 +3096,20 @@ TEST_F(DnsTransactionTestWithMockTime, TcpTimeout_LowEntropy) {
1 /* id */, kT0HostName, kT0Qtype, ASYNC, Transport::TCP));
for (int i = 0; i <= DnsUdpTracker::kPortReuseThreshold; ++i) {
- TransactionHelper udp_helper(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- udp_helper.RunUntilDone(transaction_factory_.get());
+ TransactionHelper udp_helper(kT0RecordCount);
+ udp_helper.StartTransaction(transaction_factory_.get(), kT0HostName,
+ kT0Qtype, false /* secure */,
+ resolve_context_.get());
+ udp_helper.RunUntilComplete();
}
ASSERT_TRUE(session_->udp_tracker()->low_entropy());
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_DNS_TIMED_OUT, resolve_context_.get());
- EXPECT_FALSE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_DNS_TIMED_OUT);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(helper0.has_completed());
FastForwardUntilNoTasksRemain();
EXPECT_TRUE(helper0.has_completed());
}
@@ -2658,9 +3129,10 @@ TEST_F(DnsTransactionTest, TCPReadReturnsZeroAsync) {
data->AddReadError(0, ASYNC);
AddSocketData(std::move(data));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_CONNECTION_CLOSED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_CONNECTION_CLOSED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, TCPReadReturnsZeroSynchronous) {
@@ -2678,9 +3150,10 @@ TEST_F(DnsTransactionTest, TCPReadReturnsZeroSynchronous) {
data->AddReadError(0, SYNCHRONOUS);
AddSocketData(std::move(data));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_CONNECTION_CLOSED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_CONNECTION_CLOSED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, TCPConnectionClosedAsync) {
@@ -2691,9 +3164,10 @@ TEST_F(DnsTransactionTest, TCPConnectionClosedAsync) {
data->AddReadError(ERR_CONNECTION_CLOSED, ASYNC);
AddSocketData(std::move(data));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_CONNECTION_CLOSED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_CONNECTION_CLOSED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, TCPConnectionClosedSynchronous) {
@@ -2704,9 +3178,10 @@ TEST_F(DnsTransactionTest, TCPConnectionClosedSynchronous) {
data->AddReadError(ERR_CONNECTION_CLOSED, SYNCHRONOUS);
AddSocketData(std::move(data));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_CONNECTION_CLOSED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_CONNECTION_CLOSED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, MismatchedThenNxdomainThenTCP) {
@@ -2723,9 +3198,10 @@ TEST_F(DnsTransactionTest, MismatchedThenNxdomainThenTCP) {
// Second attempt gets NXDOMAIN, which happens before the TCP required.
AddSyncQueryAndRcode(kT0HostName, kT0Qtype, dns_protocol::kRcodeNXDOMAIN);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_NAME_NOT_RESOLVED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_NAME_NOT_RESOLVED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, MismatchedThenOkThenTCP) {
@@ -2744,9 +3220,10 @@ TEST_F(DnsTransactionTest, MismatchedThenOkThenTCP) {
AddSyncQueryAndResponse(0 /* id */, kT0HostName, kT0Qtype,
kT0ResponseDatagram, base::size(kT0ResponseDatagram));
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- kT0RecordCount, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(kT0RecordCount);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, MismatchedThenRefusedThenTCP) {
@@ -2786,22 +3263,26 @@ TEST_F(DnsTransactionTest, MismatchedThenRefusedThenTCP) {
AddQueryAndErrorResponse(0 /* id */, kT0HostName, kT0Qtype,
ERR_CONNECTION_REFUSED, SYNCHRONOUS, Transport::UDP);
- TransactionHelper helper0(kT0HostName, kT0Qtype, false /* secure */,
- ERR_CONNECTION_REFUSED, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_CONNECTION_REFUSED);
+ helper0.StartTransaction(transaction_factory_.get(), kT0HostName, kT0Qtype,
+ false /* secure */, resolve_context_.get());
+ helper0.RunUntilComplete();
}
TEST_F(DnsTransactionTest, InvalidQuery) {
ConfigureFactory();
- TransactionHelper helper0(".", dns_protocol::kTypeA, false /* secure */,
- ERR_INVALID_ARGUMENT, resolve_context_.get());
- EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
-
- TransactionHelper helper1("foo,bar.com", dns_protocol::kTypeA,
- false /* secure */, ERR_INVALID_ARGUMENT,
- resolve_context_.get());
- EXPECT_TRUE(helper1.Run(transaction_factory_.get()));
+ TransactionHelper helper0(ERR_INVALID_ARGUMENT);
+ helper0.StartTransaction(transaction_factory_.get(), ".",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper0.RunUntilComplete();
+
+ TransactionHelper helper1(ERR_INVALID_ARGUMENT);
+ helper1.StartTransaction(transaction_factory_.get(), "foo,bar.com",
+ dns_protocol::kTypeA, false /* secure */,
+ resolve_context_.get());
+ helper1.RunUntilComplete();
}
TEST_F(DnsTransactionTestWithMockTime, ProbeUntilSuccess) {
diff --git a/chromium/net/dns/dns_util.cc b/chromium/net/dns/dns_util.cc
index 2883a0765dd..d956b197948 100644
--- a/chromium/net/dns/dns_util.cc
+++ b/chromium/net/dns/dns_util.cc
@@ -8,12 +8,14 @@
#include <limits.h>
#include <cstring>
+#include <string>
#include <unordered_map>
#include <vector>
#include "base/big_endian.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
+#include "base/optional.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@@ -26,19 +28,6 @@
#include "net/third_party/uri_template/uri_template.h"
#include "url/url_canon.h"
-namespace {
-
-// RFC 1035, section 2.3.4: labels 63 octets or less.
-// Section 3.1: Each label is represented as a one octet length field followed
-// by that number of octets.
-const int kMaxLabelLength = 63;
-
-// RFC 1035, section 4.1.4: the first two bits of a 16-bit name pointer are
-// ones.
-const uint16_t kFlagNamePointer = 0xc000;
-
-} // namespace
-
#if defined(OS_POSIX)
#include <netinet/in.h>
#if !defined(OS_NACL)
@@ -62,7 +51,7 @@ bool DNSDomainFromDot(const base::StringPiece& dotted,
std::string* out) {
const char* buf = dotted.data();
size_t n = dotted.size();
- char label[kMaxLabelLength];
+ char label[dns_protocol::kMaxLabelLength];
size_t labellen = 0; /* <= sizeof label */
char name[dns_protocol::kMaxNameLength];
size_t namelen = 0; /* <= sizeof name */
@@ -160,25 +149,50 @@ bool IsValidHostLabelCharacter(char c, bool is_first_char) {
(c >= '0' && c <= '9') || (!is_first_char && c == '-') || c == '_';
}
-std::string DNSDomainToString(const base::StringPiece& domain) {
- std::string ret;
+base::Optional<std::string> DnsDomainToString(base::StringPiece dns_name,
+ bool require_complete) {
+ base::BigEndianReader reader(dns_name.data(), dns_name.length());
+ return DnsDomainToString(reader, require_complete);
+}
- for (unsigned i = 0; i < domain.size() && domain[i]; i += domain[i] + 1) {
-#if CHAR_MIN < 0
- if (domain[i] < 0)
- return std::string();
-#endif
- if (domain[i] > kMaxLabelLength)
- return std::string();
+base::Optional<std::string> DnsDomainToString(base::BigEndianReader& reader,
+ bool require_complete) {
+ std::string ret;
+ size_t octets_read = 0;
+ while (reader.remaining() > 0) {
+ // DNS name compression not allowed because it does not make sense without
+ // the context of a full DNS message.
+ if ((*reader.ptr() & dns_protocol::kLabelMask) ==
+ dns_protocol::kLabelPointer)
+ return base::nullopt;
+
+ base::StringPiece label;
+ if (!reader.ReadU8LengthPrefixed(&label))
+ return base::nullopt;
+ octets_read += label.size() + 1;
+
+ if (label.size() > dns_protocol::kMaxLabelLength)
+ return base::nullopt;
+ if (octets_read > dns_protocol::kMaxNameLength)
+ return base::nullopt;
+
+ if (label.size() == 0)
+ return ret;
+
+ if (!ret.empty())
+ ret.append(".");
+
+ ret.append(label.data(), label.size());
+ }
- if (i)
- ret += ".";
+ if (require_complete)
+ return base::nullopt;
- if (static_cast<unsigned>(domain[i]) + i + 1 > domain.size())
- return std::string();
+ // If terminating zero-length label was not included in the input, it still
+ // counts against the max name length.
+ if (octets_read + 1 > dns_protocol::kMaxNameLength)
+ return base::nullopt;
- ret.append(domain.data() + i + 1, domain[i]);
- }
return ret;
}
@@ -267,10 +281,10 @@ AddressListDeltaType FindAddressListDeltaType(const AddressList& a,
}
std::string CreateNamePointer(uint16_t offset) {
- DCHECK_LE(offset, 0x3fff);
- offset |= kFlagNamePointer;
+ DCHECK_EQ(offset & ~dns_protocol::kOffsetMask, 0);
char buf[2];
base::WriteBigEndian(buf, offset);
+ buf[0] |= dns_protocol::kLabelPointer;
return std::string(buf, sizeof(buf));
}
@@ -291,6 +305,8 @@ uint16_t DnsQueryTypeToQtype(DnsQueryType dns_query_type) {
return dns_protocol::kTypeSRV;
case DnsQueryType::INTEGRITY:
return dns_protocol::kExperimentalTypeIntegrity;
+ case DnsQueryType::HTTPS:
+ return dns_protocol::kTypeHttps;
}
}
diff --git a/chromium/net/dns/dns_util.h b/chromium/net/dns/dns_util.h
index 00b5ff5929b..b4ba304d714 100644
--- a/chromium/net/dns/dns_util.h
+++ b/chromium/net/dns/dns_util.h
@@ -8,6 +8,7 @@
#include <string>
#include <vector>
+#include "base/optional.h"
#include "base/strings/string_piece.h"
#include "base/time/time.h"
#include "net/base/address_family.h"
@@ -18,6 +19,10 @@
#include "net/dns/public/dns_query_type.h"
#include "net/dns/public/secure_dns_mode.h"
+namespace base {
+class BigEndianReader;
+} // namespace base
+
namespace net {
class AddressList;
@@ -63,9 +68,22 @@ NET_EXPORT_PRIVATE bool IsValidUnrestrictedDNSDomain(
// not be NET_EXPORT_PRIVATE.
NET_EXPORT_PRIVATE bool IsValidHostLabelCharacter(char c, bool is_first_char);
-// DNSDomainToString converts a domain in DNS format to a dotted string.
-// Excludes the dot at the end.
-NET_EXPORT std::string DNSDomainToString(const base::StringPiece& domain);
+// Converts a domain in DNS format to a dotted string. Excludes the dot at the
+// end. Returns nullopt on malformed input.
+//
+// If `require_complete` is true, input will be considered malformed if it does
+// not contain a terminating zero-length label. If false, assumes the standard
+// terminating zero-length label at the end if not included in the input.
+//
+// DNS name compression (see RFC 1035, section 4.1.4) is disallowed and
+// considered malformed. To handle a potentially compressed name, in a
+// DnsResponse object, use DnsRecordParser::ReadName().
+NET_EXPORT base::Optional<std::string> DnsDomainToString(
+ base::StringPiece dns_name,
+ bool require_complete = false);
+NET_EXPORT base::Optional<std::string> DnsDomainToString(
+ base::BigEndianReader& reader,
+ bool require_complete = false);
// Return the expanded template when no variables have corresponding values.
NET_EXPORT_PRIVATE std::string GetURLFromTemplateWithoutParameters(
diff --git a/chromium/net/dns/dns_util_unittest.cc b/chromium/net/dns/dns_util_unittest.cc
index 39a89880b4f..63f579cd567 100644
--- a/chromium/net/dns/dns_util_unittest.cc
+++ b/chromium/net/dns/dns_util_unittest.cc
@@ -4,6 +4,14 @@
#include "net/dns/dns_util.h"
+#include <limits.h>
+#include <stdint.h>
+
+#include <string>
+
+#include "base/big_endian.h"
+#include "base/numerics/safe_conversions.h"
+#include "base/optional.h"
#include "base/stl_util.h"
#include "net/dns/public/dns_protocol.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -11,6 +19,8 @@
namespace net {
+using testing::Eq;
+
class DNSUtilTest : public testing::Test {
};
@@ -79,19 +89,310 @@ TEST_F(DNSUtilTest, DNSDomainFromUnrestrictedDot) {
&out));
}
-TEST_F(DNSUtilTest, DNSDomainToString) {
- EXPECT_EQ("", DNSDomainToString(IncludeNUL("")));
- EXPECT_EQ("foo", DNSDomainToString(IncludeNUL("\003foo")));
- EXPECT_EQ("foo.bar", DNSDomainToString(IncludeNUL("\003foo\003bar")));
- EXPECT_EQ("foo.bar.uk",
- DNSDomainToString(IncludeNUL("\003foo\003bar\002uk")));
+TEST_F(DNSUtilTest, DnsDomainToStringShouldHandleSimpleNames) {
+ std::string dns_name = "\003foo";
+ EXPECT_THAT(DnsDomainToString(dns_name), testing::Optional(Eq("foo")));
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader), testing::Optional(Eq("foo")));
+
+ dns_name += "\003bar";
+ EXPECT_THAT(DnsDomainToString(dns_name), testing::Optional(Eq("foo.bar")));
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader1), testing::Optional(Eq("foo.bar")));
+
+ dns_name += "\002uk";
+ EXPECT_THAT(DnsDomainToString(dns_name), testing::Optional(Eq("foo.bar.uk")));
+ base::BigEndianReader reader2(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader2), testing::Optional(Eq("foo.bar.uk")));
+
+ dns_name += '\0';
+ EXPECT_THAT(DnsDomainToString(dns_name), testing::Optional(Eq("foo.bar.uk")));
+ base::BigEndianReader reader3(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader3), testing::Optional(Eq("foo.bar.uk")));
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldHandleEmpty) {
+ std::string dns_name;
+
+ EXPECT_THAT(DnsDomainToString(dns_name), testing::Optional(Eq("")));
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader), testing::Optional(Eq("")));
+
+ dns_name += '\0';
+
+ EXPECT_THAT(DnsDomainToString(dns_name), testing::Optional(Eq("")));
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader1), testing::Optional(Eq("")));
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectEmptyIncomplete) {
+ std::string dns_name;
+
+ EXPECT_THAT(DnsDomainToString(dns_name, false /* require_complete */),
+ testing::Optional(Eq("")));
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader, false /* require_complete */),
+ testing::Optional(Eq("")));
+
+ EXPECT_EQ(DnsDomainToString(dns_name, true /* require_complete */),
+ base::nullopt);
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader1, true /* require_complete */),
+ base::nullopt);
+}
+
+// Test `require_complete` functionality given an input with terminating zero-
+// length label.
+TEST_F(DNSUtilTest, DnsDomainToStringComplete) {
+ std::string dns_name("\003foo\004test");
+ dns_name += '\0';
+
+ EXPECT_THAT(DnsDomainToString(dns_name, false /* require_complete */),
+ testing::Optional(Eq("foo.test")));
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader, false /* require_complete */),
+ testing::Optional(Eq("foo.test")));
+
+ EXPECT_THAT(DnsDomainToString(dns_name, true /* require_complete */),
+ testing::Optional(Eq("foo.test")));
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader1, true /* require_complete */),
+ testing::Optional(Eq("foo.test")));
+}
+
+// Test `require_complete` functionality given an input without terminating
+// zero-length label.
+TEST_F(DNSUtilTest, DnsDomainToStringNotComplete) {
+ std::string dns_name("\003boo\004test");
+
+ EXPECT_THAT(DnsDomainToString(dns_name, false /* require_complete */),
+ testing::Optional(Eq("boo.test")));
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader, false /* require_complete */),
+ testing::Optional(Eq("boo.test")));
+
+ EXPECT_EQ(DnsDomainToString(dns_name, true /* require_complete */),
+ base::nullopt);
+ base::BigEndianReader reader2(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader2, true /* require_complete */),
+ base::nullopt);
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectEmptyWhenRequiringComplete) {
+ std::string dns_name;
+
+ EXPECT_THAT(DnsDomainToString(dns_name, false /* require_complete */),
+ testing::Optional(Eq("")));
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader, false /* require_complete */),
+ testing::Optional(Eq("")));
+
+ EXPECT_EQ(DnsDomainToString(dns_name, true /* require_complete */),
+ base::nullopt);
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader1, true /* require_complete */),
+ base::nullopt);
+
+ dns_name += '\0';
+
+ EXPECT_THAT(DnsDomainToString(dns_name, true /* require_complete */),
+ testing::Optional(Eq("")));
+ base::BigEndianReader reader2(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader2, true /* require_complete */),
+ testing::Optional(Eq("")));
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectCompression) {
+ std::string dns_name = CreateNamePointer(152);
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader), base::nullopt);
+
+ dns_name = "\005hello";
+ dns_name += CreateNamePointer(152);
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader1), base::nullopt);
+}
+
+// Test that extra input past the terminating zero-length label are ignored.
+TEST_F(DNSUtilTest, DnsDomainToStringShouldHandleExcessInput) {
+ std::string dns_name("\004cool\004name\004test");
+ dns_name += '\0';
+ dns_name += "blargh!";
+
+ EXPECT_THAT(DnsDomainToString(dns_name),
+ testing::Optional(Eq("cool.name.test")));
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader),
+ testing::Optional(Eq("cool.name.test")));
+
+ dns_name = "\002hi";
+ dns_name += '\0';
+ dns_name += "goodbye";
+
+ EXPECT_THAT(DnsDomainToString(dns_name), testing::Optional(Eq("hi")));
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_THAT(DnsDomainToString(reader1), testing::Optional(Eq("hi")));
+}
+
+// Test that input is malformed if it ends mid label.
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectTruncatedNames) {
+ std::string dns_name = "\07cheese";
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader), base::nullopt);
+
+ dns_name = "\006cheesy\05test";
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader1(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader1), base::nullopt);
+}
- // It should cope with a lack of root label.
- EXPECT_EQ("foo.bar", DNSDomainToString("\003foo\003bar"));
+TEST_F(DNSUtilTest, DnsDomainToStringShouldHandleLongSingleLabel) {
+ std::string dns_name(1, static_cast<char>(dns_protocol::kMaxLabelLength));
+ for (int i = 0; i < dns_protocol::kMaxLabelLength; ++i) {
+ dns_name += 'a';
+ }
+
+ EXPECT_NE(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_NE(DnsDomainToString(reader), base::nullopt);
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldHandleLongSecondLabel) {
+ std::string dns_name("\003foo");
+ dns_name += static_cast<char>(dns_protocol::kMaxLabelLength);
+ for (int i = 0; i < dns_protocol::kMaxLabelLength; ++i) {
+ dns_name += 'a';
+ }
+
+ EXPECT_NE(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_NE(DnsDomainToString(reader), base::nullopt);
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectTooLongSingleLabel) {
+ std::string dns_name(1, static_cast<char>(dns_protocol::kMaxLabelLength));
+ for (int i = 0; i < dns_protocol::kMaxLabelLength + 1; ++i) {
+ dns_name += 'a';
+ }
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader), base::nullopt);
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectTooLongSecondLabel) {
+ std::string dns_name("\003foo");
+ dns_name += static_cast<char>(dns_protocol::kMaxLabelLength);
+ for (int i = 0; i < dns_protocol::kMaxLabelLength + 1; ++i) {
+ dns_name += 'a';
+ }
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader), base::nullopt);
+}
+
+#if CHAR_MIN < 0
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectCharMinLabels) {
+ ASSERT_GT(static_cast<uint8_t>(CHAR_MIN), dns_protocol::kMaxLabelLength);
+
+ std::string dns_name;
+ dns_name += base::checked_cast<char>(CHAR_MIN);
+
+ // Wherever possible, make the name otherwise valid.
+ if (static_cast<uint8_t>(CHAR_MIN) < UINT8_MAX) {
+ for (uint8_t i = 0; i < static_cast<uint8_t>(CHAR_MIN); ++i) {
+ dns_name += 'a';
+ }
+ }
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader), base::nullopt);
+}
+#endif // if CHAR_MIN < 0
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldHandleLongName) {
+ std::string dns_name;
+ for (int i = 0; i < dns_protocol::kMaxNameLength - 1;
+ i += (dns_protocol::kMaxLabelLength + 1)) {
+ int label_size = std::min(dns_protocol::kMaxNameLength - 2 - i,
+ dns_protocol::kMaxLabelLength);
+ dns_name += static_cast<char>(label_size);
+ for (int j = 0; j < label_size; ++j) {
+ dns_name += 'a';
+ }
+ }
+ ASSERT_EQ(dns_name.size(),
+ static_cast<size_t>(dns_protocol::kMaxNameLength - 1));
+
+ EXPECT_NE(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_NE(DnsDomainToString(reader), base::nullopt);
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectTooLongName) {
+ std::string dns_name;
+ for (int i = 0; i < dns_protocol::kMaxNameLength;
+ i += (dns_protocol::kMaxLabelLength + 1)) {
+ int label_size = std::min(dns_protocol::kMaxNameLength - 1 - i,
+ dns_protocol::kMaxLabelLength);
+ dns_name += static_cast<char>(label_size);
+ for (int j = 0; j < label_size; ++j) {
+ dns_name += 'a';
+ }
+ }
+ ASSERT_EQ(dns_name.size(), static_cast<size_t>(dns_protocol::kMaxNameLength));
+
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader), base::nullopt);
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldHandleLongCompleteName) {
+ std::string dns_name;
+ for (int i = 0; i < dns_protocol::kMaxNameLength - 1;
+ i += (dns_protocol::kMaxLabelLength + 1)) {
+ int label_size = std::min(dns_protocol::kMaxNameLength - 2 - i,
+ dns_protocol::kMaxLabelLength);
+ dns_name += static_cast<char>(label_size);
+ for (int j = 0; j < label_size; ++j) {
+ dns_name += 'a';
+ }
+ }
+ dns_name += '\0';
+ ASSERT_EQ(dns_name.size(), static_cast<size_t>(dns_protocol::kMaxNameLength));
+
+ EXPECT_NE(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_NE(DnsDomainToString(reader), base::nullopt);
+}
+
+TEST_F(DNSUtilTest, DnsDomainToStringShouldRejectTooLongCompleteName) {
+ std::string dns_name;
+ for (int i = 0; i < dns_protocol::kMaxNameLength;
+ i += (dns_protocol::kMaxLabelLength + 1)) {
+ int label_size = std::min(dns_protocol::kMaxNameLength - 1 - i,
+ dns_protocol::kMaxLabelLength);
+ dns_name += static_cast<char>(label_size);
+ for (int j = 0; j < label_size; ++j) {
+ dns_name += 'a';
+ }
+ }
+ dns_name += '\0';
+ ASSERT_EQ(dns_name.size(),
+ static_cast<size_t>(dns_protocol::kMaxNameLength + 1));
- // Invalid inputs should return an empty string.
- EXPECT_EQ("", DNSDomainToString(IncludeNUL("\x80")));
- EXPECT_EQ("", DNSDomainToString("\x06"));
+ EXPECT_EQ(DnsDomainToString(dns_name), base::nullopt);
+ base::BigEndianReader reader(dns_name.c_str(), dns_name.size());
+ EXPECT_EQ(DnsDomainToString(reader), base::nullopt);
}
TEST_F(DNSUtilTest, IsValidDNSDomain) {
diff --git a/chromium/net/dns/fuzzed_host_resolver_util.cc b/chromium/net/dns/fuzzed_host_resolver_util.cc
index feaaa6f5bee..48e353dd98b 100644
--- a/chromium/net/dns/fuzzed_host_resolver_util.cc
+++ b/chromium/net/dns/fuzzed_host_resolver_util.cc
@@ -132,10 +132,10 @@ DnsConfig GetFuzzedDnsConfig(FuzzedDataProvider* data_provider) {
config.ndots = data_provider->ConsumeIntegralInRange(0, 3);
config.attempts = data_provider->ConsumeIntegralInRange(1, 3);
- // Timeouts don't really work for fuzzing. Even a timeout of 0 milliseconds
- // will be increased after the first timeout, resulting in inconsistent
- // behavior.
- config.timeout = base::TimeDelta::FromDays(10);
+ // Fallback periods don't really work for fuzzing. Even a period of 0
+ // milliseconds will be increased after the first expiration, resulting in
+ // inconsistent behavior.
+ config.fallback_period = base::TimeDelta::FromDays(10);
config.rotate = data_provider->ConsumeBool();
diff --git a/chromium/net/dns/host_cache.cc b/chromium/net/dns/host_cache.cc
index b2764de2d52..6084b40f63a 100644
--- a/chromium/net/dns/host_cache.cc
+++ b/chromium/net/dns/host_cache.cc
@@ -122,14 +122,14 @@ HostCache::Key::Key() = default;
HostCache::Key::Key(const Key& key) = default;
HostCache::Key::Key(Key&& key) = default;
-HostCache::Entry::Entry(int error, Source source, base::TimeDelta ttl)
- : error_(error), source_(source), ttl_(ttl) {
- DCHECK_GE(ttl_, base::TimeDelta());
- DCHECK_NE(OK, error_);
-}
-
-HostCache::Entry::Entry(int error, Source source)
- : error_(error), source_(source), ttl_(base::TimeDelta::FromSeconds(-1)) {
+HostCache::Entry::Entry(int error,
+ Source source,
+ base::Optional<base::TimeDelta> ttl)
+ : error_(error),
+ source_(source),
+ ttl_(ttl.value_or(base::TimeDelta::FromSeconds(-1))) {
+ // If |ttl| has a value, must not be negative.
+ DCHECK_GE(ttl.value_or(base::TimeDelta()), base::TimeDelta());
DCHECK_NE(OK, error_);
}
@@ -160,7 +160,7 @@ HostCache::Entry HostCache::Entry::MergeEntries(Entry front, Entry back) {
front.MergeAddressesFrom(back);
MergeLists(&front.text_records_, back.text_records());
MergeLists(&front.hostnames_, back.hostnames());
- MergeLists(&front.integrity_data_, back.integrity_data());
+ MergeLists(&front.experimental_results_, back.experimental_results());
// Use canonical name from |back| iff empty in |front|.
if (front.addresses() && front.addresses().value().canonical_name().empty() &&
@@ -234,31 +234,32 @@ HostCache::Entry::Entry(const HostCache::Entry& entry,
addresses_(entry.addresses()),
text_records_(entry.text_records()),
hostnames_(entry.hostnames()),
- integrity_data_(entry.integrity_data()),
+ experimental_results_(entry.experimental_results()),
source_(entry.source()),
ttl_(entry.ttl()),
expires_(now + ttl),
network_changes_(network_changes) {}
-HostCache::Entry::Entry(int error,
- const base::Optional<AddressList>& addresses,
- base::Optional<std::vector<std::string>>&& text_records,
- base::Optional<std::vector<HostPortPair>>&& hostnames,
- base::Optional<std::vector<bool>>&& integrity_data,
- Source source,
- base::TimeTicks expires,
- int network_changes)
+HostCache::Entry::Entry(
+ int error,
+ const base::Optional<AddressList>& addresses,
+ base::Optional<std::vector<std::string>>&& text_records,
+ base::Optional<std::vector<HostPortPair>>&& hostnames,
+ base::Optional<std::vector<bool>>&& experimental_results,
+ Source source,
+ base::TimeTicks expires,
+ int network_changes)
: error_(error),
addresses_(addresses),
text_records_(std::move(text_records)),
hostnames_(std::move(hostnames)),
- integrity_data_(std::move(integrity_data)),
+ experimental_results_(std::move(experimental_results)),
source_(source),
expires_(expires),
network_changes_(network_changes) {}
void HostCache::Entry::PrepareForCacheInsertion() {
- integrity_data_.reset();
+ experimental_results_.reset();
}
bool HostCache::Entry::IsStale(base::TimeTicks now, int network_changes) const {
@@ -782,8 +783,8 @@ bool HostCache::RestoreFromListValue(const base::ListValue& old_cache) {
}
}
- // We do not intend to serialize INTEGRITY records with the host cache.
- base::Optional<std::vector<bool>> integrity_data;
+ // We do not intend to serialize experimental results with the host cache.
+ base::Optional<std::vector<bool>> experimental_results;
// Assume an empty address list if we have an address type and no results.
if (IsAddressType(dns_query_type) && !address_list && !text_records &&
@@ -800,10 +801,11 @@ bool HostCache::RestoreFromListValue(const base::ListValue& old_cache) {
// replace the entry.
auto found = entries_.find(key);
if (found == entries_.end()) {
- AddEntry(key, Entry(error, address_list, std::move(text_records),
- std::move(hostname_records),
- std::move(integrity_data), Entry::SOURCE_UNKNOWN,
- expiration_time, network_changes_ - 1));
+ AddEntry(
+ key,
+ Entry(error, address_list, std::move(text_records),
+ std::move(hostname_records), std::move(experimental_results),
+ Entry::SOURCE_UNKNOWN, expiration_time, network_changes_ - 1));
restore_size_++;
}
}
diff --git a/chromium/net/dns/host_cache.h b/chromium/net/dns/host_cache.h
index 1554e231c44..51badc85ebe 100644
--- a/chromium/net/dns/host_cache.h
+++ b/chromium/net/dns/host_cache.h
@@ -127,8 +127,9 @@ class NET_EXPORT HostCache {
: Entry(error, std::forward<T>(results), source, base::nullopt) {}
// For errors with no |results|.
- Entry(int error, Source source, base::TimeDelta ttl);
- Entry(int error, Source source);
+ Entry(int error,
+ Source source,
+ base::Optional<base::TimeDelta> ttl = base::nullopt);
Entry(const Entry& entry);
Entry(Entry&& entry);
@@ -160,11 +161,12 @@ class NET_EXPORT HostCache {
void set_hostnames(base::Optional<std::vector<HostPortPair>> hostnames) {
hostnames_ = std::move(hostnames);
}
- const base::Optional<std::vector<bool>>& integrity_data() const {
- return integrity_data_;
+ const base::Optional<std::vector<bool>>& experimental_results() const {
+ return experimental_results_;
}
- void set_integrity_data(base::Optional<std::vector<bool>> integrity_data) {
- integrity_data_ = std::move(integrity_data);
+ void set_experimental_results(
+ base::Optional<std::vector<bool>> experimental_results) {
+ experimental_results_ = std::move(experimental_results);
}
Source source() const { return source_; }
@@ -207,7 +209,7 @@ class NET_EXPORT HostCache {
const base::Optional<AddressList>& addresses,
base::Optional<std::vector<std::string>>&& text_results,
base::Optional<std::vector<HostPortPair>>&& hostnames,
- base::Optional<std::vector<bool>>&& integrity_data,
+ base::Optional<std::vector<bool>>&& experimental_results,
Source source,
base::TimeTicks expires,
int network_changes);
@@ -221,8 +223,8 @@ class NET_EXPORT HostCache {
void SetResult(std::vector<HostPortPair> hostnames) {
hostnames_ = std::move(hostnames);
}
- void SetResult(std::vector<bool> integrity_data) {
- integrity_data_ = std::move(integrity_data);
+ void SetResult(std::vector<bool> experimental_results) {
+ experimental_results_ = std::move(experimental_results);
}
int total_hits() const { return total_hits_; }
@@ -248,7 +250,7 @@ class NET_EXPORT HostCache {
base::Optional<AddressList> addresses_;
base::Optional<std::vector<std::string>> text_records_;
base::Optional<std::vector<HostPortPair>> hostnames_;
- base::Optional<std::vector<bool>> integrity_data_;
+ base::Optional<std::vector<bool>> experimental_results_;
// Where results were obtained (e.g. DNS lookup, hosts file, etc).
Source source_ = SOURCE_UNKNOWN;
// TTL obtained from the nameserver. Negative if unknown.
diff --git a/chromium/net/dns/host_cache_unittest.cc b/chromium/net/dns/host_cache_unittest.cc
index bce815ca6d8..b478891d21a 100644
--- a/chromium/net/dns/host_cache_unittest.cc
+++ b/chromium/net/dns/host_cache_unittest.cc
@@ -8,8 +8,8 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/format_macros.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
diff --git a/chromium/net/dns/host_resolver.cc b/chromium/net/dns/host_resolver.cc
index d086b9a7de5..dec61ed0c58 100644
--- a/chromium/net/dns/host_resolver.cc
+++ b/chromium/net/dns/host_resolver.cc
@@ -77,7 +77,7 @@ class FailingRequestImpl : public HostResolver::ResolveHostRequest,
} // namespace
const base::Optional<std::vector<bool>>&
-HostResolver::ResolveHostRequest::GetIntegrityResultsForTesting() const {
+HostResolver::ResolveHostRequest::GetExperimentalResultsForTesting() const {
IMMEDIATE_CRASH();
}
diff --git a/chromium/net/dns/host_resolver.h b/chromium/net/dns/host_resolver.h
index fb4aa683401..422bcacde95 100644
--- a/chromium/net/dns/host_resolver.h
+++ b/chromium/net/dns/host_resolver.h
@@ -98,10 +98,11 @@ class NET_EXPORT HostResolver {
virtual const base::Optional<std::vector<HostPortPair>>&
GetHostnameResults() const = 0;
- // INTEGRITY results for an initial experiment related to HTTPSSVC. Each
- // boolean value indicates the intactness of an INTEGRITY record.
+ // Result of an experimental query. Meaning depends on the specific query
+ // type, but each boolean value generally refers to a valid or invalid
+ // record of the experimental type.
NET_EXPORT virtual const base::Optional<std::vector<bool>>&
- GetIntegrityResultsForTesting() const;
+ GetExperimentalResultsForTesting() const;
// Error info for the request.
//
diff --git a/chromium/net/dns/host_resolver_manager.cc b/chromium/net/dns/host_resolver_manager.cc
index 9a78419a81a..3f8016bef3f 100644
--- a/chromium/net/dns/host_resolver_manager.cc
+++ b/chromium/net/dns/host_resolver_manager.cc
@@ -27,7 +27,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
@@ -82,6 +81,7 @@
#include "net/dns/host_resolver_mdns_listener_impl.h"
#include "net/dns/host_resolver_mdns_task.h"
#include "net/dns/host_resolver_proc.h"
+#include "net/dns/https_record_rdata.h"
#include "net/dns/httpssvc_metrics.h"
#include "net/dns/mdns_client.h"
#include "net/dns/public/dns_protocol.h"
@@ -461,6 +461,36 @@ void NetLogHostCacheEntry(const NetLogWithSource& net_log,
net_log.AddEntry(type, phase, [&] { return results.NetLogParams(); });
}
+void SaveMetricsForAdditionalHttpsRecord(const RecordParsed& record,
+ bool is_unsolicited) {
+ const HttpsRecordRdata* rdata = record.rdata<HttpsRecordRdata>();
+
+ // These values are persisted to logs. Entries should not be renumbered and
+ // numeric values should never be reused.
+ enum class UnsolicitedHttpsRecordStatus {
+ kMalformed = 0,
+ kAlias = 1,
+ kService = 2,
+ kMaxValue = kService
+ } status;
+
+ if (!rdata || rdata->IsMalformed()) {
+ status = UnsolicitedHttpsRecordStatus::kMalformed;
+ } else if (rdata->IsAlias()) {
+ status = UnsolicitedHttpsRecordStatus::kAlias;
+ } else {
+ status = UnsolicitedHttpsRecordStatus::kService;
+ }
+
+ if (is_unsolicited) {
+ UMA_HISTOGRAM_ENUMERATION("Net.DNS.DnsTask.AdditionalHttps.Unsolicited",
+ status);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Net.DNS.DnsTask.AdditionalHttps.Requested",
+ status);
+ }
+}
+
} // namespace
//-----------------------------------------------------------------------------
@@ -576,12 +606,12 @@ class HostResolverManager::RequestImpl
return results_ ? results_.value().hostnames() : *nullopt_result;
}
- const base::Optional<std::vector<bool>>& GetIntegrityResultsForTesting()
+ const base::Optional<std::vector<bool>>& GetExperimentalResultsForTesting()
const override {
DCHECK(complete_);
static const base::NoDestructor<base::Optional<std::vector<bool>>>
nullopt_result;
- return results_ ? results_.value().integrity_data() : *nullopt_result;
+ return results_ ? results_.value().experimental_results() : *nullopt_result;
}
net::ResolveErrorInfo GetResolveErrorInfo() const override {
@@ -1093,7 +1123,8 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
SecureDnsMode secure_dns_mode,
Delegate* delegate,
const NetLogWithSource& job_net_log,
- const base::TickClock* tick_clock)
+ const base::TickClock* tick_clock,
+ bool fallback_available)
: client_(client),
hostname_(hostname),
resolve_context_(resolve_context),
@@ -1103,7 +1134,8 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
net_log_(job_net_log),
num_completed_transactions_(0),
tick_clock_(tick_clock),
- task_start_time_(tick_clock_->NowTicks()) {
+ task_start_time_(tick_clock_->NowTicks()),
+ fallback_available_(fallback_available) {
DCHECK(client_);
if (secure_)
DCHECK(client_->CanUseSecureDnsTransactions());
@@ -1122,15 +1154,15 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
const bool is_httpssvc_control_domain =
httpssvc_domain_cache_.IsControl(hostname);
if (base::FeatureList::IsEnabled(features::kDnsHttpssvc) &&
- features::kDnsHttpssvcUseIntegrity.Get() &&
(secure_ || features::kDnsHttpssvcEnableQueryOverInsecure.Get()) &&
(is_httpssvc_experiment_domain || is_httpssvc_control_domain)) {
- // We should not be configured to query HTTPSSVC *and* INTEGRITY.
- DCHECK(!features::kDnsHttpssvcUseHttpssvc.Get());
-
httpssvc_metrics_.emplace(
is_httpssvc_experiment_domain /* expect_intact */);
- transactions_needed_.push(DnsQueryType::INTEGRITY);
+
+ if (features::kDnsHttpssvcUseIntegrity.Get())
+ transactions_needed_.push(DnsQueryType::INTEGRITY);
+ if (features::kDnsHttpssvcUseHttpssvc.Get())
+ transactions_needed_.push(DnsQueryType::HTTPS);
}
}
num_needed_transactions_ = transactions_needed_.size();
@@ -1186,30 +1218,37 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
base::BindOnce(&DnsTask::OnTransactionComplete,
base::Unretained(this), tick_clock_->NowTicks(),
dns_query_type),
- net_log_, secure_, secure_dns_mode_, resolve_context_);
+ net_log_, secure_, secure_dns_mode_, resolve_context_,
+ fallback_available_ /* fast_timeout */);
trans->SetRequestPriority(delegate_->priority());
return trans;
}
- void OnExperimentalQueryTimeout(uint16_t qtype,
- base::Optional<std::string> doh_provider_id) {
- // The experimental query timer is only started when all other transactions
- // have completed.
- DCHECK(TaskIsCompleteOrOnlyQtypeTransactionsRemain(qtype));
+ void OnExperimentalQueryTimeout(base::Optional<std::string> doh_provider_id) {
+ for (std::unique_ptr<DnsTransaction>& transaction : transactions_started_) {
+ DCHECK(httpssvc_metrics_);
+ base::TimeDelta elapsed_time = tick_clock_->NowTicks() - task_start_time_;
+
+ switch (transaction->GetType()) {
+ case dns_protocol::kExperimentalTypeIntegrity:
+ httpssvc_metrics_->SaveForIntegrity(
+ doh_provider_id, HttpssvcDnsRcode::kTimedOut, {}, elapsed_time);
+ break;
+ case dns_protocol::kTypeHttps:
+ httpssvc_metrics_->SaveForHttps(
+ doh_provider_id, HttpssvcDnsRcode::kTimedOut, {}, elapsed_time);
+ break;
+ default:
+ // The experimental query timer is only started when all other
+ // transactions have completed.
+ NOTREACHED();
+ }
+ }
num_completed_transactions_ += transactions_started_.size();
DCHECK(num_completed_transactions_ == num_needed_transactions());
transactions_started_.clear();
- if (qtype == dns_protocol::kExperimentalTypeIntegrity) {
- DCHECK(httpssvc_metrics_);
-
- // Record that this INTEGRITY query timed out in the metrics.
- base::TimeDelta elapsed_time = tick_clock_->NowTicks() - task_start_time_;
- httpssvc_metrics_->SaveForIntegrity(
- doh_provider_id, HttpssvcDnsRcode::kTimedOut, {}, elapsed_time);
- }
-
ProcessResultsOnCompletion();
}
@@ -1251,8 +1290,9 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
if (net_error != OK && !(net_error == ERR_NAME_NOT_RESOLVED && response &&
response->IsValid())) {
- if (dns_query_type == DnsQueryType::INTEGRITY) {
- // Do not allow an INTEGRITY query to fail the whole DnsTask.
+ if (dns_query_type == DnsQueryType::INTEGRITY ||
+ dns_query_type == DnsQueryType::HTTPS) {
+ // Do not allow an experimental query to fail the whole DnsTask.
response = nullptr;
} else {
OnFailure(net_error, DnsResponse::DNS_PARSE_OK, base::nullopt);
@@ -1284,6 +1324,9 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
// Parse the INTEGRITY records, condensing them into a vector<bool>.
parse_result = ParseIntegrityDnsResponse(response, &results);
break;
+ case DnsQueryType::HTTPS:
+ parse_result = ParseHttpsDnsResponse(response, &results);
+ break;
}
DCHECK_LT(parse_result, DnsResponse::DNS_PARSE_RESULT_MAX);
@@ -1293,17 +1336,23 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
}
if (httpssvc_metrics_) {
- if (dns_query_type != DnsQueryType::INTEGRITY) {
- httpssvc_metrics_->SaveForNonIntegrity(doh_provider_id, elapsed_time,
- rcode_for_httpssvc);
- } else {
+ if (dns_query_type == DnsQueryType::INTEGRITY) {
const base::Optional<std::vector<bool>>& condensed =
- results.integrity_data();
+ results.experimental_results();
CHECK(condensed.has_value());
// INTEGRITY queries can time out the normal way (here), or when the
// experimental query timer runs out (OnExperimentalQueryTimeout).
httpssvc_metrics_->SaveForIntegrity(doh_provider_id, rcode_for_httpssvc,
*condensed, elapsed_time);
+ } else if (dns_query_type == DnsQueryType::HTTPS) {
+ const base::Optional<std::vector<bool>>& condensed =
+ results.experimental_results();
+ CHECK(condensed.has_value());
+ httpssvc_metrics_->SaveForHttps(doh_provider_id, rcode_for_httpssvc,
+ *condensed, elapsed_time);
+ } else {
+ httpssvc_metrics_->SaveForAddressQuery(doh_provider_id, elapsed_time,
+ rcode_for_httpssvc);
}
}
@@ -1326,6 +1375,8 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
std::move(results), std::move(saved_results_).value());
break;
case DnsQueryType::INTEGRITY:
+ case DnsQueryType::HTTPS:
+ // No particular importance to order.
results = HostCache::Entry::MergeEntries(
std::move(results), std::move(saved_results_).value());
break;
@@ -1389,7 +1440,7 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
HostCache::Entry* out_results) {
DCHECK(response);
AddressList addresses;
- base::TimeDelta ttl;
+ base::Optional<base::TimeDelta> ttl;
DnsResponse::Result parse_result =
response->ParseToAddressList(&addresses, &ttl);
@@ -1497,7 +1548,8 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
HostCache::Entry* out_results) {
base::Optional<base::TimeDelta> response_ttl;
const HostCache::Entry default_entry(
- OK, std::vector<bool>(), HostCache::Entry::SOURCE_DNS, response_ttl);
+ ERR_NAME_NOT_RESOLVED, std::vector<bool>(),
+ HostCache::Entry::SOURCE_DNS, response_ttl);
if (response == nullptr) {
*out_results = default_entry;
@@ -1523,8 +1575,52 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
condensed_results.push_back(rdata.IsIntact());
}
- *out_results = HostCache::Entry(OK, std::move(condensed_results),
- HostCache::Entry::SOURCE_DNS, response_ttl);
+ *out_results =
+ HostCache::Entry(ERR_NAME_NOT_RESOLVED, std::move(condensed_results),
+ HostCache::Entry::SOURCE_DNS, response_ttl);
+ DCHECK_EQ(parse_result, DnsResponse::DNS_PARSE_OK);
+ return parse_result;
+ }
+
+ DnsResponse::Result ParseHttpsDnsResponse(const DnsResponse* response,
+ HostCache::Entry* out_results) {
+ base::Optional<base::TimeDelta> response_ttl;
+ HostCache::Entry default_entry(ERR_NAME_NOT_RESOLVED, std::vector<bool>(),
+ HostCache::Entry::SOURCE_DNS, response_ttl);
+
+ // As HTTPS is currently only used for experimental queries, request
+ // failures are not treated as critical, and flow may reach here without a
+ // response.
+ //
+ // TODO(crbug.com/1138620): As HTTPS becomes less experimental, reevaluate
+ // request failures and consider making having a response required to call
+ // this method.
+ if (response == nullptr) {
+ *out_results = std::move(default_entry);
+ return DnsResponse::Result::DNS_PARSE_OK;
+ }
+
+ std::vector<std::unique_ptr<const RecordParsed>> records;
+ DnsResponse::Result parse_result = ParseAndFilterResponseRecords(
+ response, dns_protocol::kTypeHttps, &records, &response_ttl);
+
+ // If the response couldn't be parsed, assume no HTTPS records.
+ if (parse_result != DnsResponse::DNS_PARSE_OK) {
+ *out_results = std::move(default_entry);
+ return DnsResponse::Result::DNS_PARSE_OK;
+ }
+
+ // Condense results into a list of booleans. We do not cache the results,
+ // but this enables us to write some unit tests.
+ std::vector<bool> condensed_results;
+ for (const auto& record : records) {
+ const HttpsRecordRdata& rdata = *record->rdata<HttpsRecordRdata>();
+ condensed_results.push_back(!rdata.IsMalformed());
+ }
+
+ *out_results =
+ HostCache::Entry(ERR_NAME_NOT_RESOLVED, std::move(condensed_results),
+ HostCache::Entry::SOURCE_DNS, response_ttl);
DCHECK_EQ(parse_result, DnsResponse::DNS_PARSE_OK);
return parse_result;
}
@@ -1622,6 +1718,39 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
}
}
+ // For NXDOMAIN or NODATA (NOERROR with 0 answers), attempt to find a TTL
+ // via an SOA record.
+ if (response->rcode() == dns_protocol::kRcodeNXDOMAIN ||
+ (response->answer_count() == 0 &&
+ response->rcode() == dns_protocol::kRcodeNOERROR)) {
+ bool soa_found = false;
+ for (unsigned i = 0; i < response->authority_count(); ++i) {
+ DnsResourceRecord record;
+ if (parser.ReadRecord(&record) &&
+ record.type == dns_protocol::kTypeSOA) {
+ soa_found = true;
+ base::TimeDelta ttl = base::TimeDelta::FromSeconds(record.ttl);
+ *out_response_ttl =
+ std::min(out_response_ttl->value_or(base::TimeDelta::Max()), ttl);
+ }
+ }
+
+ // Per RFC2308, section 5, never cache negative results unless an SOA
+ // record is found.
+ if (!soa_found)
+ out_response_ttl->reset();
+ }
+
+ for (unsigned i = 0; i < response->additional_answer_count(); ++i) {
+ std::unique_ptr<const RecordParsed> record =
+ RecordParsed::CreateFrom(&parser, base::Time::Now());
+ if (record && record->klass() == dns_protocol::kClassIN &&
+ record->type() == dns_protocol::kTypeHttps) {
+ bool is_unsolicited = filter_dns_type != dns_protocol::kTypeHttps;
+ SaveMetricsForAdditionalHttpsRecord(*record, is_unsolicited);
+ }
+ }
+
return DnsResponse::DNS_PARSE_OK;
}
@@ -1655,30 +1784,15 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
DnsResponse::Result parse_result,
base::Optional<base::TimeDelta> ttl) {
if (httpssvc_metrics_)
- httpssvc_metrics_->SaveNonIntegrityFailure();
+ httpssvc_metrics_->SaveAddressQueryFailure();
DCHECK_NE(OK, net_error);
- HostCache::Entry results(net_error, HostCache::Entry::SOURCE_UNKNOWN);
+ HostCache::Entry results(net_error, HostCache::Entry::SOURCE_UNKNOWN, ttl);
net_log_.EndEvent(NetLogEventType::HOST_RESOLVER_IMPL_DNS_TASK, [&] {
return NetLogDnsTaskFailedParams(results, parse_result);
});
- // If we have a TTL from a previously completed transaction, use it.
- base::TimeDelta previous_transaction_ttl;
- if (saved_results_ && saved_results_.value().has_ttl() &&
- saved_results_.value().ttl() <
- base::TimeDelta::FromSeconds(
- std::numeric_limits<uint32_t>::max())) {
- previous_transaction_ttl = saved_results_.value().ttl();
- if (ttl)
- results.set_ttl(std::min(ttl.value(), previous_transaction_ttl));
- else
- results.set_ttl(previous_transaction_ttl);
- } else if (ttl) {
- results.set_ttl(ttl.value());
- }
-
delegate_->OnDnsTaskComplete(task_start_time_, results, secure_);
}
@@ -1692,7 +1806,8 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
// |qtype|. (In particular, this is the case if all transactions are
// complete.) Used for logging and starting the experimental query timer (see
// MaybeStartExperimentalQueryTimer).
- bool TaskIsCompleteOrOnlyQtypeTransactionsRemain(uint16_t qtype) const {
+ bool TaskIsCompleteOrOnlyQtypeTransactionsRemain(
+ std::initializer_list<uint16_t> qtypes) const {
// Since DoH runs all transactions concurrently and experimental types are
// only queried over DoH, this method only needs to check the transactions
// in transactions_started_ because transactions_needed_ is empty from the
@@ -1701,13 +1816,14 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
return std::all_of(
transactions_started_.begin(), transactions_started_.end(),
- [&](const std::unique_ptr<DnsTransaction>& p) {
- DCHECK(p);
- return p->GetType() == qtype;
+ [&](const std::unique_ptr<DnsTransaction>& transaction) {
+ DCHECK(transaction);
+ return std::any_of(qtypes.begin(), qtypes.end(), [&](uint16_t qtype) {
+ return transaction->GetType() == qtype;
+ });
});
}
-
void MaybeStartExperimentalQueryTimer(
base::Optional<std::string> doh_provider_id) {
DCHECK(!transactions_started_.empty());
@@ -1721,7 +1837,8 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
if (!experimental_query_cancellation_timer_.IsRunning() &&
TaskIsCompleteOrOnlyQtypeTransactionsRemain(
- dns_protocol::kExperimentalTypeIntegrity)) {
+ {dns_protocol::kExperimentalTypeIntegrity,
+ dns_protocol::kTypeHttps})) {
const base::TimeDelta kExtraTimeAbsolute =
features::dns_httpssvc_experiment::GetExtraTimeAbsolute();
const int kExtraTimePercent =
@@ -1731,14 +1848,16 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
tick_clock_->NowTicks() - task_start_time_;
base::TimeDelta relative_timeout =
total_time_for_other_transactions * kExtraTimePercent / 100;
+ // Use at least 1ms to ensure timeout doesn't occur immediately in tests.
+ relative_timeout =
+ std::max(relative_timeout, base::TimeDelta::FromMilliseconds(1));
base::TimeDelta timeout = std::min(kExtraTimeAbsolute, relative_timeout);
experimental_query_cancellation_timer_.Start(
FROM_HERE, timeout,
- base::BindOnce(
- &DnsTask::OnExperimentalQueryTimeout, base::Unretained(this),
- dns_protocol::kExperimentalTypeIntegrity, doh_provider_id));
+ base::BindOnce(&DnsTask::OnExperimentalQueryTimeout,
+ base::Unretained(this), doh_provider_id));
}
}
@@ -1775,6 +1894,11 @@ class HostResolverManager::DnsTask : public base::SupportsWeakPtr<DnsTask> {
// timeout parameters in net/base/features.h.
base::OneShotTimer experimental_query_cancellation_timer_;
+ // If true, there are still significant fallback options available if this
+ // task completes unsuccessfully. Used as a signal that underlying
+ // transactions should timeout more quickly.
+ bool fallback_available_;
+
DISALLOW_COPY_AND_ASSIGN(DnsTask);
};
@@ -2290,7 +2414,8 @@ class HostResolverManager::Job : public PrioritizedDispatcher::Job,
// running it, as a "started" job needs a task to be properly cleaned up.
dns_task_.reset(new DnsTask(resolver_->dns_client_.get(), hostname_,
query_type_, resolve_context_, secure,
- secure_dns_mode_, this, net_log_, tick_clock_));
+ secure_dns_mode_, this, net_log_, tick_clock_,
+ !tasks_.empty() /* fallback_available */));
dns_task_->StartNextTransaction();
// Schedule a second transaction, if needed. DoH queries can bypass the
// dispatcher and start all of their transactions immediately.
diff --git a/chromium/net/dns/host_resolver_manager_unittest.cc b/chromium/net/dns/host_resolver_manager_unittest.cc
index 0846ac9db6d..9ff16ec5479 100644
--- a/chromium/net/dns/host_resolver_manager_unittest.cc
+++ b/chromium/net/dns/host_resolver_manager_unittest.cc
@@ -13,7 +13,7 @@
#include "base/auto_reset.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -23,13 +23,14 @@
#include "base/sequenced_task_runner.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool/thread_pool_instance.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
@@ -2780,7 +2781,7 @@ TEST_F(HostResolverManagerTest, Mdns) {
CreateExpected("000a:0000:0000:0000:0001:0002:0003:0004", 80)));
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerTest, Mdns_AaaaOnly) {
@@ -2832,7 +2833,7 @@ TEST_F(HostResolverManagerTest, Mdns_Txt) {
EXPECT_THAT(response.request()->GetTextResults(),
testing::Optional(testing::ElementsAre("foo", "bar")));
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerTest, Mdns_Ptr) {
@@ -2857,7 +2858,7 @@ TEST_F(HostResolverManagerTest, Mdns_Ptr) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
EXPECT_THAT(
response.request()->GetHostnameResults(),
testing::Optional(testing::ElementsAre(HostPortPair("foo.com", 83))));
@@ -2885,7 +2886,7 @@ TEST_F(HostResolverManagerTest, Mdns_Srv) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
EXPECT_THAT(
response.request()->GetHostnameResults(),
testing::Optional(testing::ElementsAre(HostPortPair("foo.com", 8265))));
@@ -2913,7 +2914,7 @@ TEST_F(HostResolverManagerTest, Mdns_Srv_Unrestricted) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
EXPECT_THAT(
response.request()->GetHostnameResults(),
testing::Optional(testing::ElementsAre(HostPortPair("foo.com", 8265))));
@@ -2942,7 +2943,7 @@ TEST_F(HostResolverManagerTest, Mdns_Srv_Result_Unrestricted) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
EXPECT_THAT(response.request()->GetHostnameResults(),
testing::Optional(
testing::ElementsAre(HostPortPair("foo bar.local", 8265))));
@@ -3007,7 +3008,7 @@ TEST_F(HostResolverManagerTest, Mdns_NoResponse) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
test_task_runner->FastForwardUntilNoTasksRemain();
}
@@ -3051,7 +3052,7 @@ TEST_F(HostResolverManagerTest, Mdns_WrongType) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
test_task_runner->FastForwardUntilNoTasksRemain();
}
@@ -3818,7 +3819,7 @@ class HostResolverManagerDnsTest : public HostResolverManagerTest {
public:
explicit HostResolverManagerDnsTest(
base::test::TaskEnvironment::TimeSource time_source =
- base::test::TaskEnvironment::TimeSource::SYSTEM_TIME)
+ base::test::TaskEnvironment::TimeSource::MOCK_TIME)
: HostResolverManagerTest(time_source),
notifier_task_runner_(
base::MakeRefCounted<base::TestMockTimeTaskRunner>()),
@@ -3991,10 +3992,10 @@ class HostResolverManagerDnsTest : public HostResolverManagerTest {
uint16_t qtype,
const IPAddress& result_ip,
bool delay) {
- rules->emplace_back(
- prefix, qtype, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponse(prefix, result_ip)),
- delay);
+ rules->emplace_back(prefix, qtype, false /* secure */,
+ MockDnsClientRule::Result(
+ BuildTestDnsAddressResponse(prefix, result_ip)),
+ delay);
}
static void AddDnsRule(MockDnsClientRuleList* rules,
@@ -4003,10 +4004,11 @@ class HostResolverManagerDnsTest : public HostResolverManagerTest {
IPAddress result_ip,
std::string cannonname,
bool delay) {
- rules->emplace_back(prefix, qtype, false /* secure */,
- MockDnsClientRule::Result(BuildTestDnsResponseWithCname(
- prefix, result_ip, std::move(cannonname))),
- delay);
+ rules->emplace_back(
+ prefix, qtype, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsAddressResponseWithCname(
+ prefix, result_ip, std::move(cannonname))),
+ delay);
}
static void AddSecureDnsRule(MockDnsClientRuleList* rules,
@@ -5996,6 +5998,118 @@ TEST_F(HostResolverManagerDnsTest, SecureDnsMode_Secure_Local_CacheHit) {
testing::ElementsAre(kExpectedSecureIP));
}
+// Test for a resolve with a transaction that takes longer than usual to
+// complete. With the typical behavior of using fast timeouts, this is expected
+// to timeout and fallback to the system resolver.
+TEST_F(HostResolverManagerDnsTest, SlowResolve) {
+ // Add a successful fallback result.
+ proc_->AddRuleForAllFamilies("slow_succeed", "192.168.1.211");
+
+ MockDnsClientRuleList rules = CreateDefaultDnsRules();
+ AddDnsRule(&rules, "slow_fail", dns_protocol::kTypeA, MockDnsClientRule::SLOW,
+ false /* delay */);
+ AddDnsRule(&rules, "slow_fail", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ AddDnsRule(&rules, "slow_succeed", dns_protocol::kTypeA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ AddDnsRule(&rules, "slow_succeed", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ ResolveHostResponseHelper response0(resolver_->CreateRequest(
+ HostPortPair("ok", 80), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ ResolveHostResponseHelper response1(resolver_->CreateRequest(
+ HostPortPair("slow_fail", 80), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ ResolveHostResponseHelper response2(resolver_->CreateRequest(
+ HostPortPair("slow_succeed", 80), NetworkIsolationKey(),
+ NetLogWithSource(), base::nullopt, resolve_context_.get(),
+ resolve_context_->host_cache()));
+ proc_->SignalMultiple(3u);
+
+ EXPECT_THAT(response0.result_error(), IsOk());
+ EXPECT_THAT(response0.request()->GetAddressResults().value().endpoints(),
+ testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 80),
+ CreateExpected("::1", 80)));
+ EXPECT_THAT(response1.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_THAT(response2.result_error(), IsOk());
+ EXPECT_THAT(response2.request()->GetAddressResults().value().endpoints(),
+ testing::ElementsAre(CreateExpected("192.168.1.211", 80)));
+}
+
+// Test for a resolve with a secure transaction that takes longer than usual to
+// complete. In automatic mode, because fallback to insecure is available, the
+// secure transaction is expected to quickly timeout and fallback to insecure.
+TEST_F(HostResolverManagerDnsTest, SlowSecureResolve_AutomaticMode) {
+ set_allow_fallback_to_proctask(false);
+
+ MockDnsClientRuleList rules = CreateDefaultDnsRules();
+ AddSecureDnsRule(&rules, "slow_fail", dns_protocol::kTypeA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ AddSecureDnsRule(&rules, "slow_fail", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ AddSecureDnsRule(&rules, "slow_succeed", dns_protocol::kTypeA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ AddSecureDnsRule(&rules, "slow_succeed", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ AddDnsRule(&rules, "slow_succeed", dns_protocol::kTypeA,
+ IPAddress(111, 222, 112, 223), false /* delay */);
+ AddDnsRule(&rules, "slow_succeed", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::EMPTY, false /* delay */);
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kAutomatic;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response0(resolver_->CreateRequest(
+ HostPortPair("secure", 80), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ ResolveHostResponseHelper response1(resolver_->CreateRequest(
+ HostPortPair("slow_fail", 80), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ ResolveHostResponseHelper response2(resolver_->CreateRequest(
+ HostPortPair("slow_succeed", 80), NetworkIsolationKey(),
+ NetLogWithSource(), base::nullopt, resolve_context_.get(),
+ resolve_context_->host_cache()));
+
+ EXPECT_THAT(response0.result_error(), IsOk());
+ EXPECT_THAT(response0.request()->GetAddressResults().value().endpoints(),
+ testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 80),
+ CreateExpected("::1", 80)));
+ EXPECT_THAT(response1.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_THAT(response2.result_error(), IsOk());
+ EXPECT_THAT(response2.request()->GetAddressResults().value().endpoints(),
+ testing::ElementsAre(CreateExpected("111.222.112.223", 80)));
+}
+
+// Test for a resolve with a secure transaction that takes longer than usual to
+// complete. In secure mode, because no fallback is available, this is expected
+// to wait longer before timeout and complete successfully.
+TEST_F(HostResolverManagerDnsTest, SlowSecureResolve_SecureMode) {
+ MockDnsClientRuleList rules = CreateDefaultDnsRules();
+ AddSecureDnsRule(&rules, "slow", dns_protocol::kTypeA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ AddSecureDnsRule(&rules, "slow", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::SLOW, false /* delay */);
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response0(resolver_->CreateRequest(
+ HostPortPair("secure", 80), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ ResolveHostResponseHelper response1(resolver_->CreateRequest(
+ HostPortPair("slow", 80), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+
+ EXPECT_THAT(response0.result_error(), IsOk());
+ EXPECT_THAT(response1.result_error(), IsOk());
+}
+
// Test the case where only a single transaction slot is available.
TEST_F(HostResolverManagerDnsTest, SerialResolver) {
CreateSerialResolver();
@@ -6636,6 +6750,29 @@ TEST_F(HostResolverManagerDnsTest, CachedError_SecureMode) {
EXPECT_FALSE(!!cache_result);
}
+// Test that if one of A and AAAA completes successfully and the other fails,
+// the failure is not cached.
+TEST_F(HostResolverManagerDnsTest, TtlNotSharedBetweenQtypes) {
+ CreateResolver();
+ set_allow_fallback_to_proctask(false);
+ ChangeDnsConfig(CreateValidDnsConfig());
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair("4slow_4timeout", 80), NetworkIsolationKey(),
+ NetLogWithSource(), base::nullopt /* optional_parameters */,
+ resolve_context_.get(), resolve_context_->host_cache()));
+
+ // Ensure success completes before the timeout result.
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(response.complete());
+
+ dns_client_->CompleteDelayedTransactions();
+ EXPECT_THAT(response.result_error(), IsError(ERR_DNS_TIMED_OUT));
+
+ // Expect failure not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+}
+
TEST_F(HostResolverManagerDnsTest, NoCanonicalName) {
MockDnsClientRuleList rules;
AddDnsRule(&rules, "alias", dns_protocol::kTypeA, IPAddress::IPv4Localhost(),
@@ -6763,7 +6900,7 @@ TEST_F(HostResolverManagerDnsTest, SortsAndDeduplicatesAddresses) {
rules.emplace_back(
"duplicate", dns_protocol::kTypeA, false /* secure */,
- MockDnsClientRule::Result(std::make_unique<DnsResponse>(
+ MockDnsClientRule::Result(DnsResponse(
0, false, std::move(answers),
std::vector<DnsResourceRecord>() /* authority_records */,
std::vector<DnsResourceRecord>() /* additional_records */, query)),
@@ -6780,7 +6917,7 @@ TEST_F(HostResolverManagerDnsTest, SortsAndDeduplicatesAddresses) {
rules.emplace_back(
"duplicate", dns_protocol::kTypeAAAA, false /* secure */,
- MockDnsClientRule::Result(std::make_unique<DnsResponse>(
+ MockDnsClientRule::Result(DnsResponse(
0, false, std::move(answers),
std::vector<DnsResourceRecord>() /* authority_records */,
std::vector<DnsResourceRecord>() /* additional_records */, query)),
@@ -7043,8 +7180,8 @@ TEST_F(HostResolverManagerDnsTest, SetDnsConfigOverrides) {
overrides.append_to_multi_label_name = false;
const int ndots = 5;
overrides.ndots = ndots;
- const base::TimeDelta timeout = base::TimeDelta::FromSeconds(10);
- overrides.timeout = timeout;
+ const base::TimeDelta fallback_period = base::TimeDelta::FromSeconds(10);
+ overrides.fallback_period = fallback_period;
const int attempts = 20;
overrides.attempts = attempts;
const int doh_attempts = 19;
@@ -7074,7 +7211,7 @@ TEST_F(HostResolverManagerDnsTest, SetDnsConfigOverrides) {
EXPECT_EQ(search, overridden_config->search);
EXPECT_FALSE(overridden_config->append_to_multi_label_name);
EXPECT_EQ(ndots, overridden_config->ndots);
- EXPECT_EQ(timeout, overridden_config->timeout);
+ EXPECT_EQ(fallback_period, overridden_config->fallback_period);
EXPECT_EQ(attempts, overridden_config->attempts);
EXPECT_EQ(doh_attempts, overridden_config->doh_attempts);
EXPECT_TRUE(overridden_config->rotate);
@@ -7156,7 +7293,8 @@ TEST_F(HostResolverManagerDnsTest, SetDnsConfigOverrides_PartialOverride) {
EXPECT_EQ(original_config.hosts, overridden_config->hosts);
EXPECT_TRUE(overridden_config->append_to_multi_label_name);
EXPECT_EQ(original_config.ndots, overridden_config->ndots);
- EXPECT_EQ(original_config.timeout, overridden_config->timeout);
+ EXPECT_EQ(original_config.fallback_period,
+ overridden_config->fallback_period);
EXPECT_EQ(original_config.attempts, overridden_config->attempts);
EXPECT_TRUE(overridden_config->rotate);
EXPECT_FALSE(overridden_config->use_local_ipv6);
@@ -7770,6 +7908,8 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery) {
CreateResolver();
UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+
HostResolver::ResolveHostParameters parameters;
parameters.dns_query_type = DnsQueryType::TXT;
@@ -7779,7 +7919,7 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Order between separate DNS records is undefined, but each record should
// stay in order as that order may be meaningful.
@@ -7792,6 +7932,55 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery) {
foo_records.begin(), foo_records.end()));
EXPECT_NE(results.end(), std::search(results.begin(), results.end(),
bar_records.begin(), bar_records.end()));
+
+ // Expect result to be cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 1u);
+ parameters.source = HostResolverSource::LOCAL_ONLY;
+ ResolveHostResponseHelper cached_response(resolver_->CreateRequest(
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(cached_response.result_error(), IsOk());
+ ASSERT_THAT(cached_response.request()->GetTextResults(),
+ testing::Optional(testing::UnorderedElementsAre(
+ "foo1", "foo2", "foo3", "bar1", "bar2")));
+ results = cached_response.request()->GetTextResults().value();
+ EXPECT_NE(results.end(), std::search(results.begin(), results.end(),
+ foo_records.begin(), foo_records.end()));
+ EXPECT_NE(results.end(), std::search(results.begin(), results.end(),
+ bar_records.begin(), bar_records.end()));
+}
+
+// Test that TXT records can be extracted from a response that also contains
+// unrecognized record types.
+TEST_F(HostResolverManagerDnsTest, TxtQuery_MixedWithUnrecognizedType) {
+ std::vector<std::string> text_strings = {"foo"};
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(
+ "host", dns_protocol::kTypeTXT, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ "host", dns_protocol::kTypeTXT,
+ {BuildTestDnsRecord("host", 3u /* type */, "fake rdata 1"),
+ BuildTestTextRecord("host", std::move(text_strings)),
+ BuildTestDnsRecord("host", 3u /* type */, "fake rdata 2")})),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::TXT;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ EXPECT_THAT(response.request()->GetTextResults(),
+ testing::Optional(testing::ElementsAre("foo")));
}
TEST_F(HostResolverManagerDnsTest, TxtQuery_InvalidConfig) {
@@ -7822,6 +8011,8 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_NonexistentDomain) {
CreateResolver();
UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+
HostResolver::ResolveHostParameters parameters;
parameters.dns_query_type = DnsQueryType::TXT;
@@ -7832,7 +8023,19 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_NonexistentDomain) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result to be cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 1u);
+ parameters.source = HostResolverSource::LOCAL_ONLY;
+ ResolveHostResponseHelper cached_response(resolver_->CreateRequest(
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(cached_response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(cached_response.request()->GetAddressResults());
+ EXPECT_FALSE(cached_response.request()->GetTextResults());
+ EXPECT_FALSE(cached_response.request()->GetHostnameResults());
+ EXPECT_FALSE(cached_response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, TxtQuery_Failure) {
@@ -7859,7 +8062,10 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_Failure) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
}
TEST_F(HostResolverManagerDnsTest, TxtQuery_Timeout) {
@@ -7886,7 +8092,10 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_Timeout) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
}
TEST_F(HostResolverManagerDnsTest, TxtQuery_Empty) {
@@ -7903,6 +8112,8 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_Empty) {
CreateResolver();
UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+
HostResolver::ResolveHostParameters parameters;
parameters.dns_query_type = DnsQueryType::TXT;
@@ -7913,7 +8124,19 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_Empty) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result to be cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 1u);
+ parameters.source = HostResolverSource::LOCAL_ONLY;
+ ResolveHostResponseHelper cached_response(resolver_->CreateRequest(
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(cached_response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(cached_response.request()->GetAddressResults());
+ EXPECT_FALSE(cached_response.request()->GetTextResults());
+ EXPECT_FALSE(cached_response.request()->GetHostnameResults());
+ EXPECT_FALSE(cached_response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, TxtQuery_Malformed) {
@@ -7940,7 +8163,10 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_Malformed) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
}
TEST_F(HostResolverManagerDnsTest, TxtQuery_MismatchedName) {
@@ -7964,16 +8190,21 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_MismatchedName) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
}
TEST_F(HostResolverManagerDnsTest, TxtQuery_WrongType) {
// Respond to a TXT query with an A response.
MockDnsClientRuleList rules;
- rules.emplace_back("host", dns_protocol::kTypeTXT, false /* secure */,
- MockDnsClientRule::Result(
- BuildTestDnsResponse("host", IPAddress(1, 2, 3, 4))),
- false /* delay */);
+ rules.emplace_back(
+ "host", dns_protocol::kTypeTXT, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ "host", dns_protocol::kTypeTXT,
+ {BuildTestAddressRecord("host", IPAddress(1, 2, 3, 4))})),
+ false /* delay */);
CreateResolver();
UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
@@ -7983,13 +8214,16 @@ TEST_F(HostResolverManagerDnsTest, TxtQuery_WrongType) {
// Responses for the wrong type should be ignored.
ResolveHostResponseHelper response(resolver_->CreateRequest(
- HostPortPair("ok", 108), NetworkIsolationKey(), NetLogWithSource(),
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
parameters, resolve_context_.get(), resolve_context_->host_cache()));
EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
}
// Same as TxtQuery except we specify DNS HostResolverSource instead of relying
@@ -8012,6 +8246,8 @@ TEST_F(HostResolverManagerDnsTest, TxtDnsQuery) {
CreateResolver();
UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+
HostResolver::ResolveHostParameters parameters;
parameters.source = HostResolverSource::DNS;
parameters.dns_query_type = DnsQueryType::TXT;
@@ -8022,7 +8258,7 @@ TEST_F(HostResolverManagerDnsTest, TxtDnsQuery) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Order between separate DNS records is undefined, but each record should
// stay in order as that order may be meaningful.
@@ -8035,6 +8271,22 @@ TEST_F(HostResolverManagerDnsTest, TxtDnsQuery) {
foo_records.begin(), foo_records.end()));
EXPECT_NE(results.end(), std::search(results.begin(), results.end(),
bar_records.begin(), bar_records.end()));
+
+ // Expect result to be cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 1u);
+ ResolveHostResponseHelper cached_response(resolver_->CreateRequest(
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(cached_response.result_error(), IsOk());
+ EXPECT_TRUE(cached_response.request()->GetStaleInfo());
+ ASSERT_THAT(cached_response.request()->GetTextResults(),
+ testing::Optional(testing::UnorderedElementsAre(
+ "foo1", "foo2", "foo3", "bar1", "bar2")));
+ results = cached_response.request()->GetTextResults().value();
+ EXPECT_NE(results.end(), std::search(results.begin(), results.end(),
+ foo_records.begin(), foo_records.end()));
+ EXPECT_NE(results.end(), std::search(results.begin(), results.end(),
+ bar_records.begin(), bar_records.end()));
}
TEST_F(HostResolverManagerDnsTest, PtrQuery) {
@@ -8056,7 +8308,7 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Order between separate records is undefined.
EXPECT_THAT(response.request()->GetHostnameResults(),
@@ -8083,7 +8335,7 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_Ip) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Order between separate records is undefined.
EXPECT_THAT(response.request()->GetHostnameResults(),
@@ -8115,7 +8367,7 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_NonexistentDomain) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, PtrQuery_Failure) {
@@ -8142,7 +8394,7 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_Failure) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, PtrQuery_Timeout) {
@@ -8169,7 +8421,7 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_Timeout) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, PtrQuery_Empty) {
@@ -8196,7 +8448,7 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_Empty) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, PtrQuery_Malformed) {
@@ -8223,7 +8475,7 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_Malformed) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, PtrQuery_MismatchedName) {
@@ -8247,16 +8499,18 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_MismatchedName) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, PtrQuery_WrongType) {
// Respond to a TXT query with an A response.
MockDnsClientRuleList rules;
- rules.emplace_back("host", dns_protocol::kTypePTR, false /* secure */,
- MockDnsClientRule::Result(
- BuildTestDnsResponse("host", IPAddress(1, 2, 3, 4))),
- false /* delay */);
+ rules.emplace_back(
+ "host", dns_protocol::kTypePTR, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ "host", dns_protocol::kTypePTR,
+ {BuildTestAddressRecord("host", IPAddress(1, 2, 3, 4))})),
+ false /* delay */);
CreateResolver();
UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
@@ -8266,13 +8520,13 @@ TEST_F(HostResolverManagerDnsTest, PtrQuery_WrongType) {
// Responses for the wrong type should be ignored.
ResolveHostResponseHelper response(resolver_->CreateRequest(
- HostPortPair("ok", 108), NetworkIsolationKey(), NetLogWithSource(),
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
parameters, resolve_context_.get(), resolve_context_->host_cache()));
EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
// Same as PtrQuery except we specify DNS HostResolverSource instead of relying
@@ -8299,7 +8553,7 @@ TEST_F(HostResolverManagerDnsTest, PtrDnsQuery) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Order between separate records is undefined.
EXPECT_THAT(response.request()->GetHostnameResults(),
@@ -8330,7 +8584,7 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Expect ordered by priority, and random within a priority.
base::Optional<std::vector<HostPortPair>> results =
@@ -8375,7 +8629,7 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_ZeroWeight) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Expect ordered by priority, and random within a priority.
EXPECT_THAT(response.request()->GetHostnameResults(),
@@ -8407,7 +8661,7 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_NonexistentDomain) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, SrvQuery_Failure) {
@@ -8434,7 +8688,7 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_Failure) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, SrvQuery_Timeout) {
@@ -8461,7 +8715,7 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_Timeout) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, SrvQuery_Empty) {
@@ -8488,7 +8742,7 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_Empty) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, SrvQuery_Malformed) {
@@ -8515,7 +8769,7 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_Malformed) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, SrvQuery_MismatchedName) {
@@ -8539,16 +8793,18 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_MismatchedName) {
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
TEST_F(HostResolverManagerDnsTest, SrvQuery_WrongType) {
// Respond to a SRV query with an A response.
MockDnsClientRuleList rules;
- rules.emplace_back("host", dns_protocol::kTypeSRV, false /* secure */,
- MockDnsClientRule::Result(
- BuildTestDnsResponse("host", IPAddress(1, 2, 3, 4))),
- false /* delay */);
+ rules.emplace_back(
+ "host", dns_protocol::kTypeSRV, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ "host", dns_protocol::kTypeSRV,
+ {BuildTestAddressRecord("host", IPAddress(1, 2, 3, 4))})),
+ false /* delay */);
CreateResolver();
UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
@@ -8558,13 +8814,13 @@ TEST_F(HostResolverManagerDnsTest, SrvQuery_WrongType) {
// Responses for the wrong type should be ignored.
ResolveHostResponseHelper response(resolver_->CreateRequest(
- HostPortPair("ok", 108), NetworkIsolationKey(), NetLogWithSource(),
+ HostPortPair("host", 108), NetworkIsolationKey(), NetLogWithSource(),
parameters, resolve_context_.get(), resolve_context_->host_cache()));
EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
EXPECT_FALSE(response.request()->GetHostnameResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
}
// Same as SrvQuery except we specify DNS HostResolverSource instead of relying
@@ -8595,7 +8851,7 @@ TEST_F(HostResolverManagerDnsTest, SrvDnsQuery) {
EXPECT_THAT(response.result_error(), IsOk());
EXPECT_FALSE(response.request()->GetAddressResults());
EXPECT_FALSE(response.request()->GetTextResults());
- EXPECT_FALSE(response.request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
// Expect ordered by priority, and random within a priority.
base::Optional<std::vector<HostPortPair>> results =
@@ -8617,6 +8873,969 @@ TEST_F(HostResolverManagerDnsTest, SrvDnsQuery) {
HostPortPair("google.com", 5)));
}
+TEST_F(HostResolverManagerDnsTest, HttpsQuery) {
+ const std::string kName = "https.test";
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+// Test that HTTPS records can be extracted from a response that also contains
+// unrecognized record types.
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_MixedWithUnrecognizedType) {
+ const std::string kName = "https.test";
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestDnsRecord(kName, 3u /* type */, "fake rdata 1"),
+ BuildTestHttpsAliasRecord(kName, "alias.test"),
+ BuildTestDnsRecord(kName, 3u /* type */, "fake rdata 2")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_MultipleResults) {
+ const std::string kName = "https.test";
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test"),
+ BuildTestHttpsAliasRecord(kName, "another-alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_InvalidConfig) {
+ set_allow_fallback_to_proctask(false);
+ // Set empty DnsConfig.
+ InvalidateDnsConfig();
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair("https.test", 108), NetworkIsolationKey(),
+ NetLogWithSource(), parameters, resolve_context_.get(),
+ resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsError(ERR_DNS_CACHE_MISS));
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_NonexistentDomain) {
+ const std::string kName = "https.test";
+
+ // Setup fallback to confirm it is not used for non-address results.
+ set_allow_fallback_to_proctask(true);
+ proc_->AddRuleForAllFamilies(kName, "192.168.1.102");
+ proc_->SignalMultiple(1u);
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::NODOMAIN),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_Failure) {
+ const std::string kName = "https.test";
+
+ // Setup fallback to confirm it is not used for non-address results.
+ set_allow_fallback_to_proctask(true);
+ proc_->AddRuleForAllFamilies(kName, "192.168.1.102");
+ proc_->SignalMultiple(1u);
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::FAIL),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_Timeout) {
+ const std::string kName = "https.test";
+
+ // Setup fallback to confirm it is not used for non-address results.
+ set_allow_fallback_to_proctask(true);
+ proc_->AddRuleForAllFamilies(kName, "192.168.1.102");
+ proc_->SignalMultiple(1u);
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::TIMEOUT),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so expect errors to be ignored.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_Empty) {
+ const std::string kName = "https.test";
+
+ // Setup fallback to confirm it is not used for non-address results.
+ set_allow_fallback_to_proctask(true);
+ proc_->AddRuleForAllFamilies(kName, "192.168.1.102");
+ proc_->SignalMultiple(1u);
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_Malformed) {
+ const std::string kName = "https.test";
+
+ // Setup fallback to confirm it is not used for non-address results.
+ set_allow_fallback_to_proctask(true);
+ proc_->AddRuleForAllFamilies(kName, "192.168.1.102");
+ proc_->SignalMultiple(1u);
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::MALFORMED),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_MismatchedName) {
+ const std::string kName = "https.test";
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord("different.test", "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_AdditionalRecords) {
+ const std::string kName = "https.test";
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ std::vector<DnsResourceRecord> additional = {
+ BuildTestHttpsServiceRecord(kName, 3u, "service1.test", {}),
+ BuildTestHttpsServiceRecord(kName, 2u, "service2.test", {})};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records,
+ {} /* authority */, additional)),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsQuery_WrongType) {
+ const std::string kName = "https.test";
+
+ // Respond to an HTTPS query with an A response.
+ MockDnsClientRuleList rules;
+ rules.emplace_back(
+ kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps,
+ {BuildTestAddressRecord(kName, IPAddress(1, 2, 3, 4))})),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ // Responses for the wrong type should be ignored.
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+
+ // Expect result not cached.
+ EXPECT_EQ(resolve_context_->host_cache()->size(), 0u);
+}
+
+// Same as HttpsQuery except we specify DNS HostResolverSource instead of
+// relying on automatic determination. Expect same results since DNS should be
+// what we automatically determine, but some slightly different logic paths are
+// involved.
+TEST_F(HostResolverManagerDnsTest, HttpsDnsQuery) {
+ const std::string kName = "https.test";
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, false /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+
+ HostResolver::ResolveHostParameters parameters;
+ parameters.source = HostResolverSource::DNS;
+ parameters.dns_query_type = DnsQueryType::HTTPS;
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ parameters, resolve_context_.get(), resolve_context_->host_cache()));
+ // Experimental type, so does not affect overall result.
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_THAT(response.request()->GetExperimentalResultsForTesting(),
+ testing::Optional(testing::ElementsAre(true)));
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_MultipleResults) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test"),
+ BuildTestHttpsAliasRecord(kName, "another-alias.test"),
+ BuildTestDnsRecord(kName, dns_protocol::kTypeHttps,
+ "malformed rdata" /* rdata */)};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_THAT(
+ response.request()->GetExperimentalResultsForTesting(),
+ testing::Optional(testing::UnorderedElementsAre(true, true, false)));
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_AddressesOnly) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_THAT(response.request()->GetExperimentalResultsForTesting(),
+ testing::Optional(testing::IsEmpty()));
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_HttpsOnly) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_AddressError) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::FAIL),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::FAIL),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_HttpsError) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::FAIL),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_THAT(response.request()->GetExperimentalResultsForTesting(),
+ testing::Optional(testing::IsEmpty()));
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_NoData) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsError(ERR_NAME_NOT_RESOLVED));
+ EXPECT_FALSE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ // Results never saved when overall result not OK.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_HttpsLast) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ true /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(response.complete());
+
+ ASSERT_TRUE(
+ dns_client_->CompleteOneDelayedTransactionOfType(DnsQueryType::HTTPS));
+
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_THAT(response.request()->GetExperimentalResultsForTesting(),
+ testing::Optional(testing::ElementsAre(true)));
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_AddressesLast) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeHttps, records)),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ true /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ true /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+
+ base::RunLoop().RunUntilIdle();
+ ASSERT_FALSE(response.complete());
+
+ ASSERT_TRUE(
+ dns_client_->CompleteOneDelayedTransactionOfType(DnsQueryType::A));
+ ASSERT_TRUE(
+ dns_client_->CompleteOneDelayedTransactionOfType(DnsQueryType::AAAA));
+
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_THAT(response.request()->GetExperimentalResultsForTesting(),
+ testing::Optional(testing::ElementsAre(true)));
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_Insecure) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ // No expected HTTPS request in insecure mode.
+ rules.emplace_back(kName, dns_protocol::kTypeA, false /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, false /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kOff;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, HttpsInAddressQuery_ExperimentalTimeout) {
+ const char kName[] = "combined.test";
+ const base::TimeDelta kTimeout = base::TimeDelta::FromSeconds(2);
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc,
+ {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcExperimentDomains", kName},
+ {"DnsHttpssvcExtraTimeMs",
+ base::NumberToString(kTimeout.InMilliseconds())}});
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::FAIL),
+ true /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(response.complete());
+
+ FastForwardBy(kTimeout);
+ EXPECT_TRUE(response.complete());
+
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, MultipleExperimentalQueries) {
+ const char kName[] = "combined.test";
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc, {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcUseIntegrity", "true"},
+ {"DnsHttpssvcExperimentDomains", kName}});
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ false /* delay */);
+ rules.emplace_back(
+ kName, dns_protocol::kExperimentalTypeIntegrity, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY), false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_THAT(response.request()->GetExperimentalResultsForTesting(),
+ testing::Optional(testing::IsEmpty()));
+}
+
+TEST_F(HostResolverManagerDnsTest, MultipleExperimentalQueries_Timeout) {
+ const char kName[] = "combined.test";
+ const base::TimeDelta kTimeout = base::TimeDelta::FromSeconds(2);
+
+ base::test::ScopedFeatureList features;
+ features.InitAndEnableFeatureWithParameters(
+ features::kDnsHttpssvc,
+ {{"DnsHttpssvcUseHttpssvc", "true"},
+ {"DnsHttpssvcUseIntegrity", "true"},
+ {"DnsHttpssvcExperimentDomains", kName},
+ {"DnsHttpssvcExtraTimeMs",
+ base::NumberToString(kTimeout.InMilliseconds())}});
+
+ MockDnsClientRuleList rules;
+ rules.emplace_back(kName, dns_protocol::kTypeHttps, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY),
+ true /* delay */);
+ rules.emplace_back(
+ kName, dns_protocol::kExperimentalTypeIntegrity, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::EMPTY), true /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+
+ base::RunLoop().RunUntilIdle();
+ EXPECT_FALSE(response.complete());
+
+ FastForwardBy(kTimeout);
+ EXPECT_TRUE(response.complete());
+
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
+TEST_F(HostResolverManagerDnsTest, UnsolicitedHttps) {
+ const char kName[] = "unsolicited.test";
+
+ MockDnsClientRuleList rules;
+ std::vector<DnsResourceRecord> records = {
+ BuildTestAddressRecord(kName, IPAddress(1, 2, 3, 4))};
+ std::vector<DnsResourceRecord> additional = {
+ BuildTestHttpsAliasRecord(kName, "alias.test")};
+ rules.emplace_back(kName, dns_protocol::kTypeA, true /* secure */,
+ MockDnsClientRule::Result(BuildTestDnsResponse(
+ kName, dns_protocol::kTypeA, records,
+ {} /* authority */, additional)),
+ false /* delay */);
+ rules.emplace_back(kName, dns_protocol::kTypeAAAA, true /* secure */,
+ MockDnsClientRule::Result(MockDnsClientRule::OK),
+ false /* delay */);
+
+ CreateResolver();
+ UseMockDnsClient(CreateValidDnsConfig(), std::move(rules));
+ DnsConfigOverrides overrides;
+ overrides.secure_dns_mode = SecureDnsMode::kSecure;
+ resolver_->SetDnsConfigOverrides(overrides);
+
+ ResolveHostResponseHelper response(resolver_->CreateRequest(
+ HostPortPair(kName, 108), NetworkIsolationKey(), NetLogWithSource(),
+ base::nullopt, resolve_context_.get(), resolve_context_->host_cache()));
+ EXPECT_THAT(response.result_error(), IsOk());
+ EXPECT_TRUE(response.request()->GetAddressResults());
+ EXPECT_FALSE(response.request()->GetTextResults());
+ EXPECT_FALSE(response.request()->GetHostnameResults());
+ // Unsolicited records not included in results.
+ EXPECT_FALSE(response.request()->GetExperimentalResultsForTesting());
+}
+
class HostResolverManagerDnsTestIntegrity : public HostResolverManagerDnsTest {
public:
HostResolverManagerDnsTestIntegrity()
@@ -8683,12 +9902,18 @@ class HostResolverManagerDnsTestIntegrity : public HostResolverManagerDnsTest {
std::vector<uint8_t> integrity_rdata = options.integrity_mangled
? GetMangledIntegrityRdata()
: GetValidIntegrityRdata();
- rules.emplace_back(
- "host", dns_protocol::kExperimentalTypeIntegrity,
- options.secure_integrity,
- MockDnsClientRule::Result(BuildTestDnsIntegrityResponse(
- "host", std::move(integrity_rdata))),
- options.delay_integrity);
+ std::string integrity_rdata_str(integrity_rdata.begin(),
+ integrity_rdata.end());
+ std::vector<DnsResourceRecord> answers{
+ BuildTestDnsRecord("host", dns_protocol::kExperimentalTypeIntegrity,
+ std::move(integrity_rdata_str))};
+ DnsResponse response = BuildTestDnsResponse(
+ "host", dns_protocol::kExperimentalTypeIntegrity, answers);
+
+ rules.emplace_back("host", dns_protocol::kExperimentalTypeIntegrity,
+ options.secure_integrity,
+ MockDnsClientRule::Result(std::move(response)),
+ options.delay_integrity);
}
CreateResolver();
@@ -8719,7 +9944,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity, IntegrityQuery) {
EXPECT_THAT(response->result_error(), IsOk());
base::Optional<std::vector<bool>> results =
- response->request()->GetIntegrityResultsForTesting();
+ response->request()->GetExperimentalResultsForTesting();
EXPECT_TRUE(response->request()->GetAddressResults());
EXPECT_FALSE(response->request()->GetTextResults());
@@ -8736,11 +9961,11 @@ TEST_F(HostResolverManagerDnsTestIntegrity, IntegrityQueryMangled) {
EXPECT_THAT(response->result_error(), IsOk());
base::Optional<std::vector<bool>> results =
- response->request()->GetIntegrityResultsForTesting();
+ response->request()->GetExperimentalResultsForTesting();
EXPECT_TRUE(response->request()->GetAddressResults());
EXPECT_FALSE(response->request()->GetTextResults());
- EXPECT_THAT(response->request()->GetIntegrityResultsForTesting(),
+ EXPECT_THAT(response->request()->GetExperimentalResultsForTesting(),
Optional(UnorderedElementsAre(false)));
}
@@ -8756,7 +9981,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity, IntegrityQueryOnlyOverSecure) {
EXPECT_THAT(response->result_error(), IsOk());
base::Optional<std::vector<bool>> results =
- response->request()->GetIntegrityResultsForTesting();
+ response->request()->GetExperimentalResultsForTesting();
EXPECT_FALSE(results);
}
@@ -8802,10 +10027,73 @@ TEST_F(HostResolverManagerDnsTestIntegrity, IntegrityQueryCompletesLast) {
// If this expectation fails, the INTEGRITY query was probably timed out.
// Check the |kDnsHttpssvcExtraTimeMs| and |kDnsHttpssvcExtraTimePercent|
// feature params in relation to this test's FastForward steps.
- EXPECT_THAT(response->request()->GetIntegrityResultsForTesting(),
+ EXPECT_THAT(response->request()->GetExperimentalResultsForTesting(),
Optional(UnorderedElementsAre(true)));
}
+// Ensure that a successful INTEGRITY query cannot mask the appropriate
+// ERR_NAME_NOT_RESOLVED of A/AAAA responses with empty bodies.
+TEST_F(HostResolverManagerDnsTestIntegrity,
+ IntegrityQueryCannotMaskAddressNodata) {
+ net::MockDnsClientRuleList rules;
+ AddSecureDnsRule(&rules, "host", dns_protocol::kTypeA,
+ MockDnsClientRule::EMPTY, true /* delay */);
+ AddSecureDnsRule(&rules, "host", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::EMPTY, true /* delay */);
+
+ IntegrityAddRulesOptions rules_options;
+ rules_options.add_a = false;
+ rules_options.add_aaaa = false;
+ rules_options.add_integrity = true;
+ rules_options.delay_integrity = true;
+
+ AddRules(std::move(rules), rules_options);
+
+ std::unique_ptr<ResolveHostResponseHelper> response =
+ DoIntegrityQuery(true /* use_secure */);
+
+ ASSERT_TRUE(dns_client_->CompleteOneDelayedTransactionOfType(
+ DnsQueryType::INTEGRITY));
+ ASSERT_TRUE(
+ dns_client_->CompleteOneDelayedTransactionOfType(DnsQueryType::A));
+ ASSERT_TRUE(
+ dns_client_->CompleteOneDelayedTransactionOfType(DnsQueryType::AAAA));
+
+ ASSERT_EQ(response->result_error(), net::ERR_NAME_NOT_RESOLVED);
+}
+
+// Ensure that a successful INTEGRITY query cannot mask the appropriate
+// ERR_NAME_NOT_RESOLVED of A/AAAA queries that fail.
+TEST_F(HostResolverManagerDnsTestIntegrity,
+ IntegrityQueryCannotMaskAddressFail) {
+ net::MockDnsClientRuleList rules;
+ AddSecureDnsRule(&rules, "host", dns_protocol::kTypeA,
+ MockDnsClientRule::FAIL, true /* delay */);
+ AddSecureDnsRule(&rules, "host", dns_protocol::kTypeAAAA,
+ MockDnsClientRule::FAIL, true /* delay */);
+
+ IntegrityAddRulesOptions rules_options;
+ rules_options.add_a = false;
+ rules_options.add_aaaa = false;
+ rules_options.add_integrity = true;
+ rules_options.delay_integrity = true;
+
+ AddRules(std::move(rules), rules_options);
+
+ std::unique_ptr<ResolveHostResponseHelper> response =
+ DoIntegrityQuery(true /* use_secure */);
+
+ ASSERT_TRUE(dns_client_->CompleteOneDelayedTransactionOfType(
+ DnsQueryType::INTEGRITY));
+ ASSERT_TRUE(
+ dns_client_->CompleteOneDelayedTransactionOfType(DnsQueryType::A));
+ // After the A query fails, the pending AAAA query is cleared.
+ ASSERT_FALSE(
+ dns_client_->CompleteOneDelayedTransactionOfType(DnsQueryType::AAAA));
+
+ ASSERT_EQ(response->result_error(), net::ERR_NAME_NOT_RESOLVED);
+}
+
// For symmetry with |IntegrityQueryCompletesLast|, test the case where the
// INTEGRITY query completes first.
TEST_F(HostResolverManagerDnsTestIntegrity, IntegrityQueryCompletesFirst) {
@@ -8835,7 +10123,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity, IntegrityQueryCompletesFirst) {
FastForwardBy(kQuantum);
ASSERT_THAT(response->result_error(), IsOk());
- EXPECT_THAT(response->request()->GetIntegrityResultsForTesting(),
+ EXPECT_THAT(response->request()->GetExperimentalResultsForTesting(),
Optional(UnorderedElementsAre(true)));
ASSERT_TRUE(response->request()->GetAddressResults());
EXPECT_THAT(response->request()->GetAddressResults()->endpoints(),
@@ -8881,7 +10169,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity,
EXPECT_THAT(response->request()->GetAddressResults()->endpoints(),
testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 108),
CreateExpected("::1", 108)));
- EXPECT_THAT(response->request()->GetIntegrityResultsForTesting(),
+ EXPECT_THAT(response->request()->GetExperimentalResultsForTesting(),
Optional(IsEmpty()));
}
@@ -8920,7 +10208,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity,
FastForwardBy(kQuantum);
ASSERT_THAT(response->result_error(), IsOk());
- EXPECT_THAT(response->request()->GetIntegrityResultsForTesting(),
+ EXPECT_THAT(response->request()->GetExperimentalResultsForTesting(),
Optional(IsEmpty()));
ASSERT_TRUE(response->request()->GetAddressResults());
EXPECT_THAT(response->request()->GetAddressResults()->endpoints(),
@@ -8962,7 +10250,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity,
EXPECT_THAT(response->request()->GetAddressResults()->endpoints(),
testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 108),
CreateExpected("::1", 108)));
- EXPECT_THAT(response->request()->GetIntegrityResultsForTesting(),
+ EXPECT_THAT(response->request()->GetExperimentalResultsForTesting(),
Optional(UnorderedElementsAre(false)));
}
@@ -8996,7 +10284,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity,
FastForwardBy(kQuantum);
ASSERT_THAT(response->result_error(), IsOk());
- EXPECT_THAT(response->request()->GetIntegrityResultsForTesting(),
+ EXPECT_THAT(response->request()->GetExperimentalResultsForTesting(),
Optional(UnorderedElementsAre(false)));
ASSERT_TRUE(response->request()->GetAddressResults());
EXPECT_THAT(response->request()->GetAddressResults()->endpoints(),
@@ -9095,7 +10383,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity, RespectsAbsoluteTimeout) {
// Since we cancelled the transaction, we shouldn't have any INTEGRITY
// results.
- EXPECT_FALSE(response->request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response->request()->GetExperimentalResultsForTesting());
// Out of paranoia, pass some more time to ensure no crashes occur.
FastForwardBy(base::TimeDelta::FromMilliseconds(100));
@@ -9143,7 +10431,7 @@ TEST_F(HostResolverManagerDnsTestIntegrity, RespectsRelativeTimeout) {
// The task should have completed with a cancelled INTEGRITY query.
ASSERT_THAT(response->result_error(), IsOk());
- EXPECT_FALSE(response->request()->GetIntegrityResultsForTesting());
+ EXPECT_FALSE(response->request()->GetExperimentalResultsForTesting());
ASSERT_TRUE(response->request()->GetAddressResults());
EXPECT_THAT(response->request()->GetAddressResults()->endpoints(),
testing::UnorderedElementsAre(CreateExpected("127.0.0.1", 108),
diff --git a/chromium/net/dns/host_resolver_mdns_listener_impl.cc b/chromium/net/dns/host_resolver_mdns_listener_impl.cc
index 066cc635774..0287be7ddee 100644
--- a/chromium/net/dns/host_resolver_mdns_listener_impl.cc
+++ b/chromium/net/dns/host_resolver_mdns_listener_impl.cc
@@ -74,6 +74,7 @@ void HostResolverMdnsListenerImpl::OnRecordUpdate(
switch (query_type_) {
case DnsQueryType::UNSPECIFIED:
case DnsQueryType::INTEGRITY:
+ case DnsQueryType::HTTPS:
NOTREACHED();
break;
case DnsQueryType::A:
diff --git a/chromium/net/dns/host_resolver_mdns_task.cc b/chromium/net/dns/host_resolver_mdns_task.cc
index 745b847eede..687b957f574 100644
--- a/chromium/net/dns/host_resolver_mdns_task.cc
+++ b/chromium/net/dns/host_resolver_mdns_task.cc
@@ -198,6 +198,10 @@ HostCache::Entry HostResolverMdnsTask::ParseResult(
switch (query_type) {
case DnsQueryType::UNSPECIFIED:
// Should create two separate transactions with specified type.
+ case DnsQueryType::HTTPS:
+ // Not supported.
+ // TODO(ericorth@chromium.org): Consider support for HTTPS in mDNS if it
+ // is ever decided to support HTTPS via non-DoH.
case DnsQueryType::INTEGRITY:
// INTEGRITY queries are not expected to be useful in mDNS, so they're not
// supported.
diff --git a/chromium/net/dns/https_record_rdata.cc b/chromium/net/dns/https_record_rdata.cc
new file mode 100644
index 00000000000..94e3e1b0a3a
--- /dev/null
+++ b/chromium/net/dns/https_record_rdata.cc
@@ -0,0 +1,484 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/dns/https_record_rdata.h"
+
+#include <stdint.h>
+
+#include <algorithm>
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/big_endian.h"
+#include "base/check.h"
+#include "base/dcheck_is_on.h"
+#include "base/immediate_crash.h"
+#include "base/memory/ptr_util.h"
+#include "base/optional.h"
+#include "base/strings/string_piece.h"
+#include "net/base/ip_address.h"
+#include "net/dns/dns_util.h"
+#include "net/dns/public/dns_protocol.h"
+
+namespace net {
+
+namespace {
+
+bool ReadNextServiceParam(base::Optional<uint16_t> last_key,
+ base::BigEndianReader& reader,
+ uint16_t* out_param_key,
+ base::StringPiece* out_param_value) {
+ DCHECK(out_param_key);
+ DCHECK(out_param_value);
+
+ uint16_t key;
+ if (!reader.ReadU16(&key))
+ return false;
+ if (last_key.has_value() && last_key.value() >= key)
+ return false;
+
+ base::StringPiece value;
+ if (!reader.ReadU16LengthPrefixed(&value))
+ return false;
+
+ *out_param_key = key;
+ *out_param_value = value;
+ return true;
+}
+
+bool ParseMandatoryKeys(base::StringPiece param_value,
+ std::set<uint16_t>* out_parsed) {
+ DCHECK(out_parsed);
+
+ base::BigEndianReader reader(param_value.data(), param_value.size());
+
+ std::set<uint16_t> mandatory_keys;
+ // Do/while to require at least one key.
+ do {
+ uint16_t key;
+ if (!reader.ReadU16(&key))
+ return false;
+
+ // Mandatory key itself is disallowed from its list.
+ if (key == dns_protocol::kHttpsServiceParamKeyMandatory)
+ return false;
+ // Keys required to be listed in ascending order.
+ if (!mandatory_keys.empty() && key <= *mandatory_keys.rbegin())
+ return false;
+
+ CHECK(mandatory_keys.insert(key).second);
+ } while (reader.remaining() > 0);
+
+ *out_parsed = std::move(mandatory_keys);
+ return true;
+}
+
+bool ParseAlpnIds(base::StringPiece param_value,
+ std::vector<std::string>* out_parsed) {
+ DCHECK(out_parsed);
+
+ base::BigEndianReader reader(param_value.data(), param_value.size());
+
+ std::vector<std::string> alpn_ids;
+ // Do/while to require at least one ID.
+ do {
+ base::StringPiece alpn_id;
+ if (!reader.ReadU8LengthPrefixed(&alpn_id))
+ return false;
+ if (alpn_id.size() < 1)
+ return false;
+ DCHECK_LE(alpn_id.size(), 255u);
+
+ alpn_ids.emplace_back(alpn_id.data(), alpn_id.size());
+ } while (reader.remaining() > 0);
+
+ *out_parsed = std::move(alpn_ids);
+ return true;
+}
+
+template <size_t ADDRESS_SIZE>
+bool ParseIpAddresses(base::StringPiece param_value,
+ std::vector<IPAddress>* out_addresses) {
+ DCHECK(out_addresses);
+
+ base::BigEndianReader reader(param_value.data(), param_value.size());
+
+ std::vector<IPAddress> addresses;
+ uint8_t addr_bytes[ADDRESS_SIZE];
+ do {
+ if (!reader.ReadBytes(addr_bytes, ADDRESS_SIZE))
+ return false;
+ addresses.emplace_back(addr_bytes);
+ DCHECK(addresses.back().IsValid());
+ } while (reader.remaining() > 0);
+
+ *out_addresses = std::move(addresses);
+ return true;
+}
+
+} // namespace
+
+// static
+std::unique_ptr<HttpsRecordRdata> HttpsRecordRdata::Parse(
+ base::StringPiece data) {
+ if (!HasValidSize(data, kType))
+ return std::make_unique<MalformedHttpsRecordRdata>();
+
+ base::BigEndianReader reader(data.data(), data.size());
+ uint16_t priority;
+ CHECK(reader.ReadU16(&priority));
+
+ std::unique_ptr<HttpsRecordRdata> parsed;
+ if (priority == 0) {
+ parsed = AliasFormHttpsRecordRdata::Parse(data);
+ } else {
+ parsed = ServiceFormHttpsRecordRdata::Parse(data);
+ }
+
+ if (!parsed)
+ return std::make_unique<MalformedHttpsRecordRdata>();
+
+ return parsed;
+}
+
+HttpsRecordRdata::~HttpsRecordRdata() = default;
+
+bool HttpsRecordRdata::IsEqual(const RecordRdata* other) const {
+ DCHECK(other);
+
+ if (other->Type() != kType)
+ return false;
+
+ const HttpsRecordRdata* https = static_cast<const HttpsRecordRdata*>(other);
+ return IsEqual(https);
+}
+
+uint16_t HttpsRecordRdata::Type() const {
+ return kType;
+}
+
+AliasFormHttpsRecordRdata* HttpsRecordRdata::AsAliasForm() {
+ CHECK(IsAlias());
+ CHECK(!IsMalformed());
+ return static_cast<AliasFormHttpsRecordRdata*>(this);
+}
+
+const AliasFormHttpsRecordRdata* HttpsRecordRdata::AsAliasForm() const {
+ return const_cast<HttpsRecordRdata*>(this)->AsAliasForm();
+}
+
+ServiceFormHttpsRecordRdata* HttpsRecordRdata::AsServiceForm() {
+ CHECK(!IsAlias());
+ CHECK(!IsMalformed());
+ return static_cast<ServiceFormHttpsRecordRdata*>(this);
+}
+
+const ServiceFormHttpsRecordRdata* HttpsRecordRdata::AsServiceForm() const {
+ return const_cast<HttpsRecordRdata*>(this)->AsServiceForm();
+}
+
+bool HttpsRecordRdata::IsMalformed() const {
+ return false;
+}
+
+MalformedHttpsRecordRdata::MalformedHttpsRecordRdata() = default;
+
+bool MalformedHttpsRecordRdata::IsEqual(const HttpsRecordRdata* other) const {
+ DCHECK(other);
+ return other->IsMalformed();
+}
+
+bool MalformedHttpsRecordRdata::IsAlias() const {
+ return false;
+}
+
+bool MalformedHttpsRecordRdata::IsMalformed() const {
+ return true;
+}
+
+AliasFormHttpsRecordRdata::AliasFormHttpsRecordRdata(std::string alias_name)
+ : alias_name_(std::move(alias_name)) {}
+
+// static
+std::unique_ptr<AliasFormHttpsRecordRdata> AliasFormHttpsRecordRdata::Parse(
+ base::StringPiece data) {
+ base::BigEndianReader reader(data.data(), data.size());
+
+ uint16_t priority;
+ if (!reader.ReadU16(&priority))
+ return nullptr;
+ if (priority != 0)
+ return nullptr;
+
+ base::Optional<std::string> alias_name =
+ DnsDomainToString(reader, true /* require_complete */);
+ if (!alias_name.has_value())
+ return nullptr;
+
+ // Ignore any params.
+ base::Optional<uint16_t> last_param_key;
+ while (reader.remaining() > 0) {
+ uint16_t param_key;
+ base::StringPiece param_value;
+ if (!ReadNextServiceParam(last_param_key, reader, &param_key, &param_value))
+ return nullptr;
+ last_param_key = param_key;
+ }
+
+ return std::make_unique<AliasFormHttpsRecordRdata>(
+ std::move(alias_name).value());
+}
+
+bool AliasFormHttpsRecordRdata::IsEqual(const HttpsRecordRdata* other) const {
+ DCHECK(other);
+
+ if (!other->IsAlias())
+ return false;
+
+ const AliasFormHttpsRecordRdata* alias = other->AsAliasForm();
+ return alias_name_ == alias->alias_name_;
+}
+
+bool AliasFormHttpsRecordRdata::IsAlias() const {
+ return true;
+}
+
+// static
+constexpr uint16_t ServiceFormHttpsRecordRdata::kSupportedKeys[];
+
+ServiceFormHttpsRecordRdata::ServiceFormHttpsRecordRdata(
+ uint16_t priority,
+ std::string service_name,
+ std::set<uint16_t> mandatory_keys,
+ std::vector<std::string> alpn_ids,
+ bool default_alpn,
+ base::Optional<uint16_t> port,
+ std::vector<IPAddress> ipv4_hint,
+ std::string ech_config,
+ std::vector<IPAddress> ipv6_hint,
+ std::map<uint16_t, std::string> unparsed_params)
+ : priority_(priority),
+ service_name_(std::move(service_name)),
+ mandatory_keys_(std::move(mandatory_keys)),
+ alpn_ids_(std::move(alpn_ids)),
+ default_alpn_(default_alpn),
+ port_(port),
+ ipv4_hint_(std::move(ipv4_hint)),
+ ech_config_(std::move(ech_config)),
+ ipv6_hint_(std::move(ipv6_hint)),
+ unparsed_params_(std::move(unparsed_params)) {
+ DCHECK_NE(priority_, 0);
+ DCHECK(mandatory_keys_.find(dns_protocol::kHttpsServiceParamKeyMandatory) ==
+ mandatory_keys_.end());
+
+#if DCHECK_IS_ON()
+ for (const IPAddress& address : ipv4_hint_) {
+ DCHECK(address.IsIPv4());
+ }
+ for (const IPAddress& address : ipv6_hint_) {
+ DCHECK(address.IsIPv6());
+ }
+ for (const auto& unparsed_param : unparsed_params_) {
+ DCHECK(!IsSupportedKey(unparsed_param.first));
+ }
+#endif // DCHECK_IS_ON()
+}
+
+ServiceFormHttpsRecordRdata::~ServiceFormHttpsRecordRdata() = default;
+
+bool ServiceFormHttpsRecordRdata::IsEqual(const HttpsRecordRdata* other) const {
+ DCHECK(other);
+
+ if (other->IsAlias() || other->IsMalformed())
+ return false;
+
+ const ServiceFormHttpsRecordRdata* service = other->AsServiceForm();
+ return priority_ == service->priority_ &&
+ service_name_ == service->service_name_ &&
+ mandatory_keys_ == service->mandatory_keys_ &&
+ alpn_ids_ == service->alpn_ids_ &&
+ default_alpn_ == service->default_alpn_ && port_ == service->port_ &&
+ ipv4_hint_ == service->ipv4_hint_ &&
+ ech_config_ == service->ech_config_ &&
+ ipv6_hint_ == service->ipv6_hint_;
+}
+
+bool ServiceFormHttpsRecordRdata::IsAlias() const {
+ return false;
+}
+
+// static
+std::unique_ptr<ServiceFormHttpsRecordRdata> ServiceFormHttpsRecordRdata::Parse(
+ base::StringPiece data) {
+ base::BigEndianReader reader(data.data(), data.size());
+
+ uint16_t priority;
+ if (!reader.ReadU16(&priority))
+ return nullptr;
+ if (priority == 0)
+ return nullptr;
+
+ base::Optional<std::string> service_name =
+ DnsDomainToString(reader, true /* require_complete */);
+ if (!service_name.has_value())
+ return nullptr;
+
+ if (reader.remaining() == 0) {
+ return std::make_unique<ServiceFormHttpsRecordRdata>(
+ priority, std::move(service_name).value(),
+ std::set<uint16_t>() /* mandatory_keys */,
+ std::vector<std::string>() /* alpn_ids */, true /* default_alpn */,
+ base::nullopt /* port */, std::vector<IPAddress>() /* ipv4_hint */,
+ std::string() /* ech_config */,
+ std::vector<IPAddress>() /* ipv6_hint */,
+ std::map<uint16_t, std::string>() /* unparsed_params */);
+ }
+
+ uint16_t param_key = 0;
+ base::StringPiece param_value;
+ if (!ReadNextServiceParam(base::nullopt /* last_key */, reader, &param_key,
+ &param_value))
+ return nullptr;
+
+ // Assume keys less than Mandatory are not possible.
+ DCHECK_GE(param_key, dns_protocol::kHttpsServiceParamKeyMandatory);
+
+ std::set<uint16_t> mandatory_keys;
+ if (param_key == dns_protocol::kHttpsServiceParamKeyMandatory) {
+ DCHECK(IsSupportedKey(param_key));
+ if (!ParseMandatoryKeys(param_value, &mandatory_keys))
+ return nullptr;
+ if (reader.remaining() > 0 &&
+ !ReadNextServiceParam(param_key, reader, &param_key, &param_value)) {
+ return nullptr;
+ }
+ }
+
+ std::vector<std::string> alpn_ids;
+ if (param_key == dns_protocol::kHttpsServiceParamKeyAlpn) {
+ DCHECK(IsSupportedKey(param_key));
+ if (!ParseAlpnIds(param_value, &alpn_ids))
+ return nullptr;
+ if (reader.remaining() > 0 &&
+ !ReadNextServiceParam(param_key, reader, &param_key, &param_value)) {
+ return nullptr;
+ }
+ }
+
+ bool default_alpn = true;
+ if (param_key == dns_protocol::kHttpsServiceParamKeyNoDefaultAlpn) {
+ DCHECK(IsSupportedKey(param_key));
+ if (!param_value.empty())
+ return nullptr;
+ default_alpn = false;
+ if (reader.remaining() > 0 &&
+ !ReadNextServiceParam(param_key, reader, &param_key, &param_value)) {
+ return nullptr;
+ }
+ }
+
+ base::Optional<uint16_t> port;
+ if (param_key == dns_protocol::kHttpsServiceParamKeyPort) {
+ DCHECK(IsSupportedKey(param_key));
+ if (param_value.size() != 2)
+ return nullptr;
+ uint16_t port_val;
+ base::ReadBigEndian(param_value.data(), &port_val);
+ port = port_val;
+ if (reader.remaining() > 0 &&
+ !ReadNextServiceParam(param_key, reader, &param_key, &param_value)) {
+ return nullptr;
+ }
+ }
+
+ std::vector<IPAddress> ipv4_hint;
+ if (param_key == dns_protocol::kHttpsServiceParamKeyIpv4Hint) {
+ DCHECK(IsSupportedKey(param_key));
+ if (!ParseIpAddresses<IPAddress::kIPv4AddressSize>(param_value, &ipv4_hint))
+ return nullptr;
+ if (reader.remaining() > 0 &&
+ !ReadNextServiceParam(param_key, reader, &param_key, &param_value)) {
+ return nullptr;
+ }
+ }
+
+ std::string ech_config;
+ if (param_key == dns_protocol::kHttpsServiceParamKeyEchConfig) {
+ DCHECK(IsSupportedKey(param_key));
+ ech_config = std::string(param_value.data(), param_value.size());
+ if (reader.remaining() > 0 &&
+ !ReadNextServiceParam(param_key, reader, &param_key, &param_value)) {
+ return nullptr;
+ }
+ }
+
+ std::vector<IPAddress> ipv6_hint;
+ if (param_key == dns_protocol::kHttpsServiceParamKeyIpv6Hint) {
+ DCHECK(IsSupportedKey(param_key));
+ if (!ParseIpAddresses<IPAddress::kIPv6AddressSize>(param_value, &ipv6_hint))
+ return nullptr;
+ if (reader.remaining() > 0 &&
+ !ReadNextServiceParam(param_key, reader, &param_key, &param_value)) {
+ return nullptr;
+ }
+ }
+
+ // Note that if parsing has already reached the end of the rdata, `param_key`
+ // is still set for whatever param was read last.
+ std::map<uint16_t, std::string> unparsed_params;
+ if (param_key > dns_protocol::kHttpsServiceParamKeyIpv6Hint) {
+ for (;;) {
+ DCHECK(!IsSupportedKey(param_key));
+ CHECK(unparsed_params
+ .emplace(param_key, static_cast<std::string>(param_value))
+ .second);
+ if (reader.remaining() == 0)
+ break;
+ if (!ReadNextServiceParam(param_key, reader, &param_key, &param_value))
+ return nullptr;
+ }
+ }
+
+ return std::make_unique<ServiceFormHttpsRecordRdata>(
+ priority, std::move(service_name).value(), std::move(mandatory_keys),
+ std::move(alpn_ids), default_alpn, port, std::move(ipv4_hint),
+ std::move(ech_config), std::move(ipv6_hint), std::move(unparsed_params));
+}
+
+bool ServiceFormHttpsRecordRdata::IsCompatible() const {
+ std::set<uint16_t> supported_keys(std::begin(kSupportedKeys),
+ std::end(kSupportedKeys));
+
+ for (uint16_t mandatory_key : mandatory_keys_) {
+ DCHECK_NE(mandatory_key, dns_protocol::kHttpsServiceParamKeyMandatory);
+
+ if (supported_keys.find(mandatory_key) == supported_keys.end())
+ return false;
+ }
+
+#if DCHECK_IS_ON()
+ for (const auto& unparsed_param : unparsed_params_) {
+ DCHECK(mandatory_keys_.find(unparsed_param.first) == mandatory_keys_.end());
+ }
+#endif // DCHECK_IS_ON()
+
+ return true;
+}
+
+// static
+bool ServiceFormHttpsRecordRdata::IsSupportedKey(uint16_t key) {
+#if DCHECK_IS_ON()
+ return std::find(std::begin(kSupportedKeys), std::end(kSupportedKeys), key) !=
+ std::end(kSupportedKeys);
+#else
+ // Only intended for DCHECKs.
+ IMMEDIATE_CRASH();
+#endif // DCHECK_IS_ON()
+}
+
+} // namespace net
diff --git a/chromium/net/dns/https_record_rdata.h b/chromium/net/dns/https_record_rdata.h
new file mode 100644
index 00000000000..2b1123b49fb
--- /dev/null
+++ b/chromium/net/dns/https_record_rdata.h
@@ -0,0 +1,152 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_DNS_HTTPS_RECORD_RDATA_H_
+#define NET_DNS_HTTPS_RECORD_RDATA_H_
+
+#include <stdint.h>
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "base/optional.h"
+#include "base/strings/string_piece.h"
+#include "net/base/ip_address.h"
+#include "net/base/net_export.h"
+#include "net/dns/public/dns_protocol.h"
+#include "net/dns/record_rdata.h"
+
+namespace net {
+
+class AliasFormHttpsRecordRdata;
+class ServiceFormHttpsRecordRdata;
+
+class NET_EXPORT_PRIVATE HttpsRecordRdata : public RecordRdata {
+ public:
+ static const uint16_t kType = dns_protocol::kTypeHttps;
+
+ static std::unique_ptr<HttpsRecordRdata> Parse(base::StringPiece data);
+
+ HttpsRecordRdata(const HttpsRecordRdata& rdata) = delete;
+ HttpsRecordRdata& operator=(const HttpsRecordRdata& rdata) = delete;
+
+ ~HttpsRecordRdata() override;
+
+ bool IsEqual(const RecordRdata* other) const override;
+ virtual bool IsEqual(const HttpsRecordRdata* other) const = 0;
+ uint16_t Type() const override;
+
+ virtual bool IsAlias() const = 0;
+ AliasFormHttpsRecordRdata* AsAliasForm();
+ const AliasFormHttpsRecordRdata* AsAliasForm() const;
+ ServiceFormHttpsRecordRdata* AsServiceForm();
+ const ServiceFormHttpsRecordRdata* AsServiceForm() const;
+
+ // For experimental query metrics.
+ // TODO(crbug.com/1138620): Remove as HTTPS use becomes non-experimental.
+ virtual bool IsMalformed() const;
+
+ protected:
+ HttpsRecordRdata() = default;
+};
+
+// For experimental query metrics.
+// TODO(crbug.com/1138620): Remove as HTTPS use becomes non-experimental.
+class NET_EXPORT_PRIVATE MalformedHttpsRecordRdata : public HttpsRecordRdata {
+ public:
+ MalformedHttpsRecordRdata();
+
+ bool IsEqual(const HttpsRecordRdata* other) const override;
+ bool IsAlias() const override;
+ bool IsMalformed() const override;
+};
+
+class NET_EXPORT_PRIVATE AliasFormHttpsRecordRdata : public HttpsRecordRdata {
+ public:
+ explicit AliasFormHttpsRecordRdata(std::string alias_name);
+ static std::unique_ptr<AliasFormHttpsRecordRdata> Parse(
+ base::StringPiece data);
+
+ bool IsEqual(const HttpsRecordRdata* other) const override;
+ bool IsAlias() const override;
+
+ base::StringPiece alias_name() const { return alias_name_; }
+
+ private:
+ AliasFormHttpsRecordRdata() = default;
+
+ const std::string alias_name_;
+};
+
+class NET_EXPORT_PRIVATE ServiceFormHttpsRecordRdata : public HttpsRecordRdata {
+ public:
+ static constexpr uint16_t kSupportedKeys[] = {
+ dns_protocol::kHttpsServiceParamKeyMandatory,
+ dns_protocol::kHttpsServiceParamKeyAlpn,
+ dns_protocol::kHttpsServiceParamKeyNoDefaultAlpn,
+ dns_protocol::kHttpsServiceParamKeyPort,
+ dns_protocol::kHttpsServiceParamKeyIpv4Hint,
+ dns_protocol::kHttpsServiceParamKeyEchConfig,
+ dns_protocol::kHttpsServiceParamKeyIpv6Hint};
+
+ ServiceFormHttpsRecordRdata(uint16_t priority,
+ std::string service_name,
+ std::set<uint16_t> mandatory_keys,
+ std::vector<std::string> alpn_ids,
+ bool default_alpn,
+ base::Optional<uint16_t> port,
+ std::vector<IPAddress> ipv4_hint,
+ std::string ech_config,
+ std::vector<IPAddress> ipv6_hint,
+ std::map<uint16_t, std::string> unparsed_params);
+ static std::unique_ptr<ServiceFormHttpsRecordRdata> Parse(
+ base::StringPiece data);
+
+ ~ServiceFormHttpsRecordRdata() override;
+
+ bool IsEqual(const HttpsRecordRdata* other) const override;
+ bool IsAlias() const override;
+
+ uint16_t priority() const { return priority_; }
+ base::StringPiece service_name() const { return service_name_; }
+ const std::set<uint16_t>& mandatory_keys() const { return mandatory_keys_; }
+ const std::vector<std::string>& alpn_ids() const { return alpn_ids_; }
+ bool default_alpn() const { return default_alpn_; }
+ base::Optional<uint16_t> port() const { return port_; }
+ const std::vector<IPAddress>& ipv4_hint() const { return ipv4_hint_; }
+ base::StringPiece ech_config() const { return ech_config_; }
+ const std::vector<IPAddress>& ipv6_hint() const { return ipv6_hint_; }
+ const std::map<uint16_t, std::string>& unparsed_params() const {
+ return unparsed_params_;
+ }
+
+ // Returns whether or not this rdata parser is considered "compatible" with
+ // the parsed rdata. That is that all keys listed by mandatory_keys() (and all
+ // keys considered default mandatory for HTTPS records) are parsable by this
+ // parser.
+ bool IsCompatible() const;
+
+ private:
+ static bool IsSupportedKey(uint16_t key);
+
+ const uint16_t priority_;
+ const std::string service_name_;
+
+ // Supported service parameters.
+ const std::set<uint16_t> mandatory_keys_;
+ const std::vector<std::string> alpn_ids_;
+ const bool default_alpn_;
+ const base::Optional<uint16_t> port_;
+ const std::vector<IPAddress> ipv4_hint_;
+ const std::string ech_config_;
+ const std::vector<IPAddress> ipv6_hint_;
+
+ const std::map<uint16_t, std::string> unparsed_params_;
+};
+
+} // namespace net
+
+#endif // NET_DNS_HTTPS_RECORD_RDATA_H_
diff --git a/chromium/net/dns/https_record_rdata_fuzzer.cc b/chromium/net/dns/https_record_rdata_fuzzer.cc
new file mode 100644
index 00000000000..7e0b2b15b2b
--- /dev/null
+++ b/chromium/net/dns/https_record_rdata_fuzzer.cc
@@ -0,0 +1,88 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/dns/https_record_rdata.h"
+
+#include <fuzzer/FuzzedDataProvider.h>
+
+#include <stdint.h>
+
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+
+#include "base/check.h"
+#include "base/strings/string_piece.h"
+#include "net/base/ip_address.h"
+#include "net/dns/public/dns_protocol.h"
+
+namespace net {
+namespace {
+
+void ParseAndExercise(FuzzedDataProvider& data_provider) {
+ std::string data1 = data_provider.ConsumeRandomLengthString();
+ std::unique_ptr<HttpsRecordRdata> parsed = HttpsRecordRdata::Parse(data1);
+ std::unique_ptr<HttpsRecordRdata> parsed2 = HttpsRecordRdata::Parse(data1);
+ std::unique_ptr<HttpsRecordRdata> parsed3 =
+ HttpsRecordRdata::Parse(data_provider.ConsumeRemainingBytesAsString());
+
+ CHECK_EQ(!!parsed, !!parsed2);
+
+ if (!parsed)
+ return;
+
+ // `parsed` and `parsed2` parsed from the same data, so they should always be
+ // equal.
+ CHECK(parsed->IsEqual(parsed.get()));
+ CHECK(parsed->IsEqual(parsed2.get()));
+ CHECK(parsed2->IsEqual(parsed.get()));
+
+ // Attempt comparison with an rdata parsed from separate data. IsEqual() will
+ // probably return false most of the time, but easily could be true if the
+ // input data is similar enough.
+ if (parsed3)
+ CHECK_EQ(parsed->IsEqual(parsed3.get()), parsed3->IsEqual(parsed.get()));
+
+ CHECK_EQ(parsed->Type(), dns_protocol::kTypeHttps);
+ if (parsed->IsAlias()) {
+ CHECK(!parsed->IsMalformed());
+ AliasFormHttpsRecordRdata* alias = parsed->AsAliasForm();
+ alias->alias_name();
+ } else if (!parsed->IsMalformed()) {
+ ServiceFormHttpsRecordRdata* service = parsed->AsServiceForm();
+ CHECK_GT(service->priority(), 0);
+ service->service_name();
+ service->alpn_ids();
+ service->default_alpn();
+ service->port();
+ service->ech_config();
+ service->unparsed_params();
+ service->IsCompatible();
+
+ std::set<uint16_t> mandatory_keys = service->mandatory_keys();
+ CHECK(mandatory_keys.find(dns_protocol::kHttpsServiceParamKeyMandatory) ==
+ mandatory_keys.end());
+
+ std::vector<IPAddress> ipv4_hint = service->ipv4_hint();
+ for (const IPAddress& address : ipv4_hint) {
+ CHECK(address.IsIPv4());
+ }
+
+ std::vector<IPAddress> ipv6_hint = service->ipv6_hint();
+ for (const IPAddress& address : ipv6_hint) {
+ CHECK(address.IsIPv6());
+ }
+ }
+}
+
+} // namespace
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ FuzzedDataProvider data_provider(data, size);
+ ParseAndExercise(data_provider);
+ return 0;
+}
+
+} // namespace net
diff --git a/chromium/net/dns/https_record_rdata_unittest.cc b/chromium/net/dns/https_record_rdata_unittest.cc
new file mode 100644
index 00000000000..402935ed454
--- /dev/null
+++ b/chromium/net/dns/https_record_rdata_unittest.cc
@@ -0,0 +1,202 @@
+// Copyright 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/dns/https_record_rdata.h"
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "base/strings/string_piece.h"
+#include "net/base/ip_address.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+namespace {
+
+TEST(HttpsRecordRdataTest, ParsesAlias) {
+ const char kRdata[] =
+ // Priority: 0 for alias record
+ "\000\000"
+ // Alias name: chromium.org
+ "\010chromium\003org\000";
+
+ std::unique_ptr<HttpsRecordRdata> rdata =
+ HttpsRecordRdata::Parse(base::StringPiece(kRdata, sizeof(kRdata) - 1));
+ ASSERT_TRUE(rdata);
+ EXPECT_FALSE(rdata->IsMalformed());
+
+ AliasFormHttpsRecordRdata expected("chromium.org");
+ EXPECT_TRUE(rdata->IsEqual(&expected));
+
+ EXPECT_TRUE(rdata->IsAlias());
+ AliasFormHttpsRecordRdata* alias_rdata = rdata->AsAliasForm();
+ ASSERT_TRUE(alias_rdata);
+ EXPECT_EQ(alias_rdata->alias_name(), "chromium.org");
+}
+
+TEST(HttpsRecordRdataTest, ParseAliasWithEmptyName) {
+ const char kRdata[] =
+ // Priority: 0 for alias record
+ "\000\000"
+ // Alias name: ""
+ "\000";
+
+ std::unique_ptr<HttpsRecordRdata> rdata =
+ HttpsRecordRdata::Parse(base::StringPiece(kRdata, sizeof(kRdata) - 1));
+ ASSERT_TRUE(rdata);
+
+ AliasFormHttpsRecordRdata expected("");
+ EXPECT_TRUE(rdata->IsEqual(&expected));
+
+ EXPECT_TRUE(rdata->IsAlias());
+ AliasFormHttpsRecordRdata* alias_rdata = rdata->AsAliasForm();
+ ASSERT_TRUE(alias_rdata);
+ EXPECT_TRUE(alias_rdata->alias_name().empty());
+}
+
+TEST(HttpsRecordRdataTest, IgnoreAliasParams) {
+ const char kRdata[] =
+ // Priority: 0 for alias record
+ "\000\000"
+ // Alias name: chromium.org
+ "\010chromium\003org\000"
+ // no-default-alpn
+ "\000\002\000\000";
+
+ std::unique_ptr<HttpsRecordRdata> rdata =
+ HttpsRecordRdata::Parse(base::StringPiece(kRdata, sizeof(kRdata) - 1));
+ ASSERT_TRUE(rdata);
+
+ AliasFormHttpsRecordRdata expected("chromium.org");
+ EXPECT_TRUE(rdata->IsEqual(&expected));
+
+ EXPECT_TRUE(rdata->IsAlias());
+ AliasFormHttpsRecordRdata* alias_rdata = rdata->AsAliasForm();
+ ASSERT_TRUE(alias_rdata);
+ EXPECT_EQ(alias_rdata->alias_name(), "chromium.org");
+}
+
+TEST(HttpsRecordRdataTest, ParsesService) {
+ const char kRdata[] =
+ // Priority: 1
+ "\000\001"
+ // Service name: chromium.org
+ "\010chromium\003org\000"
+ // mandatory=alpn,no-default-alpn,port,ipv4hint,echconfig,ipv6hint
+ "\000\000\000\014\000\001\000\002\000\003\000\004\000\005\000\006"
+ // alpn=foo,bar
+ "\000\001\000\010\003foo\003bar"
+ // no-default-alpn
+ "\000\002\000\000"
+ // port=46
+ "\000\003\000\002\000\056"
+ // ipv4hint=8.8.8.8
+ "\000\004\000\004\010\010\010\010"
+ // echconfig=hello
+ "\000\005\000\005hello"
+ // ipv6hint=2001:4860:4860::8888
+ "\000\006\000\020\x20\x01\x48\x60\x48\x60\x00\x00\x00\x00\x00\x00\x00\x00"
+ "\x88\x88"
+ // Unknown key7=foo
+ "\000\007\000\003foo";
+
+ std::unique_ptr<HttpsRecordRdata> rdata =
+ HttpsRecordRdata::Parse(base::StringPiece(kRdata, sizeof(kRdata) - 1));
+ ASSERT_TRUE(rdata);
+ EXPECT_FALSE(rdata->IsMalformed());
+
+ IPAddress expected_ipv6;
+ ASSERT_TRUE(expected_ipv6.AssignFromIPLiteral("2001:4860:4860::8888"));
+ ServiceFormHttpsRecordRdata expected(
+ 1 /* priority */, "chromium.org", std::set<uint16_t>({1, 2, 3, 4, 5, 6}),
+ std::vector<std::string>({"foo", "bar"}) /* alpn_ids */,
+ false /* default_alpn */, base::Optional<uint16_t>(46) /* port */,
+ std::vector<IPAddress>({IPAddress(8, 8, 8, 8)}) /* ipv4_hint */,
+ "hello" /* ech_config */,
+ std::vector<IPAddress>({expected_ipv6}) /* ipv6_hint */,
+ std::map<uint16_t, std::string>({{7, "foo"}}) /* unparsed_params */);
+ EXPECT_TRUE(rdata->IsEqual(&expected));
+
+ EXPECT_FALSE(rdata->IsAlias());
+ ServiceFormHttpsRecordRdata* service_rdata = rdata->AsServiceForm();
+ ASSERT_TRUE(service_rdata);
+ EXPECT_EQ(service_rdata->priority(), 1);
+ EXPECT_EQ(service_rdata->service_name(), "chromium.org");
+ EXPECT_THAT(service_rdata->mandatory_keys(),
+ testing::ElementsAre(1, 2, 3, 4, 5, 6));
+ EXPECT_THAT(service_rdata->alpn_ids(), testing::ElementsAre("foo", "bar"));
+ EXPECT_FALSE(service_rdata->default_alpn());
+ EXPECT_THAT(service_rdata->port(), testing::Optional(46));
+ EXPECT_THAT(service_rdata->ipv4_hint(),
+ testing::ElementsAre(IPAddress(8, 8, 8, 8)));
+ EXPECT_EQ(service_rdata->ech_config(), "hello");
+ EXPECT_THAT(service_rdata->ipv6_hint(), testing::ElementsAre(expected_ipv6));
+ EXPECT_THAT(service_rdata->unparsed_params(),
+ testing::ElementsAre(testing::Pair(7, "foo")));
+ EXPECT_TRUE(service_rdata->IsCompatible());
+}
+
+TEST(HttpsRecordRdataTest, RejectCorruptRdata) {
+ const char kRdata[] =
+ // Priority: 5
+ "\000\005"
+ // Service name: chromium.org
+ "\010chromium\003org\000"
+ // Malformed alpn
+ "\000\001\000\005hi";
+
+ std::unique_ptr<HttpsRecordRdata> rdata =
+ HttpsRecordRdata::Parse(base::StringPiece(kRdata, sizeof(kRdata) - 1));
+ ASSERT_TRUE(rdata);
+
+ EXPECT_TRUE(rdata->IsMalformed());
+}
+
+TEST(HttpsRecordRdataTest, AliasIsEqualRejectsWrongType) {
+ AliasFormHttpsRecordRdata alias("alias.name.test");
+ ServiceFormHttpsRecordRdata service(
+ 1u /* priority */, "service.name.test", {} /* mandatory_keys */,
+ {} /* alpn_ids */, true /* default_alpn */, base::nullopt /* port */,
+ {} /* ipv4_hint */, "" /* ech_config */, {} /* ipv6_hint */,
+ {} /* unparsed_params */);
+ MalformedHttpsRecordRdata malformed;
+
+ EXPECT_TRUE(alias.IsEqual(&alias));
+ EXPECT_FALSE(alias.IsEqual(&service));
+ EXPECT_FALSE(alias.IsEqual(&malformed));
+}
+
+TEST(HttpsRecordRdataTest, ServiceIsEqualRejectsWrongType) {
+ AliasFormHttpsRecordRdata alias("alias.name.test");
+ ServiceFormHttpsRecordRdata service(
+ 1u /* priority */, "service.name.test", {} /* mandatory_keys */,
+ {} /* alpn_ids */, true /* default_alpn */, base::nullopt /* port */,
+ {} /* ipv4_hint */, "" /* ech_config */, {} /* ipv6_hint */,
+ {} /* unparsed_params */);
+ MalformedHttpsRecordRdata malformed;
+
+ EXPECT_FALSE(service.IsEqual(&alias));
+ EXPECT_TRUE(service.IsEqual(&service));
+ EXPECT_FALSE(service.IsEqual(&malformed));
+}
+
+TEST(HttpsRecordRdataTest, MalformedIsEqualRejectsWrongType) {
+ AliasFormHttpsRecordRdata alias("alias.name.test");
+ ServiceFormHttpsRecordRdata service(
+ 1u /* priority */, "service.name.test", {} /* mandatory_keys */,
+ {} /* alpn_ids */, true /* default_alpn */, base::nullopt /* port */,
+ {} /* ipv4_hint */, "" /* ech_config */, {} /* ipv6_hint */,
+ {} /* unparsed_params */);
+ MalformedHttpsRecordRdata malformed;
+
+ EXPECT_FALSE(malformed.IsEqual(&alias));
+ EXPECT_FALSE(malformed.IsEqual(&service));
+ EXPECT_TRUE(malformed.IsEqual(&malformed));
+}
+
+} // namespace
+} // namespace net
diff --git a/chromium/net/dns/httpssvc_metrics.cc b/chromium/net/dns/httpssvc_metrics.cc
index 58a033aa3b5..3e7abe447ba 100644
--- a/chromium/net/dns/httpssvc_metrics.cc
+++ b/chromium/net/dns/httpssvc_metrics.cc
@@ -8,6 +8,7 @@
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_functions.h"
+#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -71,22 +72,22 @@ HttpssvcMetrics::HttpssvcMetrics(bool expect_intact)
: expect_intact_(expect_intact) {}
HttpssvcMetrics::~HttpssvcMetrics() {
- RecordIntegrityMetrics();
+ RecordMetrics();
}
-void HttpssvcMetrics::SaveForNonIntegrity(
+void HttpssvcMetrics::SaveForAddressQuery(
base::Optional<std::string> new_doh_provider_id,
base::TimeDelta resolve_time,
enum HttpssvcDnsRcode rcode) {
set_doh_provider_id(new_doh_provider_id);
- non_integrity_resolve_times_.push_back(resolve_time);
+ address_resolve_times_.push_back(resolve_time);
if (rcode != HttpssvcDnsRcode::kNoError)
disqualified_ = true;
}
-void HttpssvcMetrics::SaveNonIntegrityFailure() {
+void HttpssvcMetrics::SaveAddressQueryFailure() {
disqualified_ = true;
}
@@ -102,9 +103,9 @@ void HttpssvcMetrics::SaveForIntegrity(
num_integrity_records_ = condensed_records.size();
- // We only record one "Integrity" sample per INTEGRITY query. In case
- // multiple matching records are in present in the response, we
- // combine their intactness values with logical AND.
+ // We only record one "Integrity" sample per INTEGRITY query. In case multiple
+ // matching records are present in the response, we combine their intactness
+ // values with logical AND.
const bool intact =
std::all_of(condensed_records.cbegin(), condensed_records.cend(),
[](bool b) { return b; });
@@ -116,6 +117,31 @@ void HttpssvcMetrics::SaveForIntegrity(
integrity_resolve_time_ = integrity_resolve_time;
}
+void HttpssvcMetrics::SaveForHttps(base::Optional<std::string> doh_provider_id,
+ enum HttpssvcDnsRcode rcode,
+ const std::vector<bool>& condensed_records,
+ base::TimeDelta https_resolve_time) {
+ DCHECK(!rcode_https_.has_value());
+ set_doh_provider_id(doh_provider_id);
+
+ rcode_https_ = rcode;
+
+ num_https_records_ = condensed_records.size();
+
+ // We only record one "parsable" sample per HTTPS query. In case multiple
+ // matching records are present in the response, we combine their parsable
+ // values with logical AND.
+ const bool parsable =
+ std::all_of(condensed_records.cbegin(), condensed_records.cend(),
+ [](bool b) { return b; });
+
+ DCHECK(!is_https_parsable_.has_value());
+ is_https_parsable_ = parsable;
+
+ DCHECK(!https_resolve_time_.has_value());
+ https_resolve_time_ = https_resolve_time;
+}
+
void HttpssvcMetrics::set_doh_provider_id(
base::Optional<std::string> new_doh_provider_id) {
// "Other" never gets updated.
@@ -133,33 +159,45 @@ void HttpssvcMetrics::set_doh_provider_id(
}
std::string HttpssvcMetrics::BuildMetricName(
+ RecordType type,
base::StringPiece leaf_name) const {
// Build shared pieces of the metric names.
+ base::StringPiece type_str;
+ switch (type) {
+ case RecordType::kIntegrity:
+ type_str = "RecordIntegrity";
+ break;
+ case RecordType::kHttps:
+ type_str = "RecordHttps";
+ break;
+ }
const base::StringPiece expectation =
expect_intact_ ? "ExpectIntact" : "ExpectNoerror";
const std::string provider_id = doh_provider_id_.value_or("Other");
// Example INTEGRITY metric name:
// Net.DNS.HTTPSSVC.RecordIntegrity.CleanBrowsingAdult.ExpectIntact.DnsRcode
- return base::JoinString({"Net.DNS.HTTPSSVC.RecordIntegrity",
- provider_id.c_str(), expectation, leaf_name},
+ return base::JoinString({"Net.DNS.HTTPSSVC", type_str, provider_id.c_str(),
+ expectation, leaf_name},
".");
}
-void HttpssvcMetrics::RecordIntegrityMetrics() {
+void HttpssvcMetrics::RecordMetrics() {
// The HTTPSSVC experiment and its feature param indicating INTEGRITY must
// both be enabled.
DCHECK(base::FeatureList::IsEnabled(features::kDnsHttpssvc));
- DCHECK(features::kDnsHttpssvcUseIntegrity.Get());
+ DCHECK(features::kDnsHttpssvcUseIntegrity.Get() ||
+ features::kDnsHttpssvcUseHttpssvc.Get());
DCHECK(!already_recorded_);
already_recorded_ = true;
- // We really have no metrics to record without |integrity_resolve_time_| and
- // |non_integrity_resolve_times_|. If this HttpssvcMetrics is in an
+ // We really have no metrics to record without an experimental query resolve
+ // time and `address_resolve_times_`. If this HttpssvcMetrics is in an
// inconsistent state, disqualify any metrics from being recorded.
- if (!integrity_resolve_time_.has_value() ||
- non_integrity_resolve_times_.empty()) {
+ if ((!integrity_resolve_time_.has_value() &&
+ !https_resolve_time_.has_value()) ||
+ address_resolve_times_.empty()) {
disqualified_ = true;
}
if (disqualified_)
@@ -167,91 +205,161 @@ void HttpssvcMetrics::RecordIntegrityMetrics() {
// Record the metrics that the "ExpectIntact" and "ExpectNoerror" branches
// have in common.
- RecordIntegrityCommonMetrics();
+ RecordCommonMetrics();
if (expect_intact_) {
// Record metrics that are unique to the "ExpectIntact" branch.
- RecordIntegrityExpectIntactMetrics();
+ RecordExpectIntactMetrics();
} else {
// Record metrics that are unique to the "ExpectNoerror" branch.
- RecordIntegrityExpectNoerrorMetrics();
+ RecordExpectNoerrorMetrics();
}
}
-void HttpssvcMetrics::RecordIntegrityCommonMetrics() {
- base::UmaHistogramMediumTimes(BuildMetricName("ResolveTimeIntegrityRecord"),
- *integrity_resolve_time_);
+void HttpssvcMetrics::RecordCommonMetrics() {
+ DCHECK(integrity_resolve_time_.has_value() ||
+ https_resolve_time_.has_value());
+ if (integrity_resolve_time_.has_value()) {
+ base::UmaHistogramMediumTimes(
+ BuildMetricName(RecordType::kIntegrity, "ResolveTimeIntegrityRecord"),
+ *integrity_resolve_time_);
+ }
+ if (https_resolve_time_.has_value()) {
+ base::UmaHistogramMediumTimes(
+ BuildMetricName(RecordType::kHttps, "ResolveTimeHttpsRecord"),
+ *https_resolve_time_);
+ }
- const std::string kMetricResolveTimeNonIntegrityRecord =
- BuildMetricName("ResolveTimeNonIntegrityRecord");
- for (base::TimeDelta resolve_time_other : non_integrity_resolve_times_) {
- base::UmaHistogramMediumTimes(kMetricResolveTimeNonIntegrityRecord,
+ DCHECK(!address_resolve_times_.empty());
+ // Not specific to INTEGRITY or HTTPS, but for the sake of picking one for the
+ // metric name and only recording the time once, always record the address
+ // resolve times under `kIntegrity`.
+ const std::string kMetricResolveTimeAddressRecord =
+ BuildMetricName(RecordType::kIntegrity, "ResolveTimeNonIntegrityRecord");
+ for (base::TimeDelta resolve_time_other : address_resolve_times_) {
+ base::UmaHistogramMediumTimes(kMetricResolveTimeAddressRecord,
resolve_time_other);
}
- // ResolveTimeRatio is the INTEGRITY resolve time divided by the slower of the
- // A or AAAA resolve times. Arbitrarily choosing precision at two decimal
- // places.
- std::vector<base::TimeDelta>::iterator slowest_non_integrity_resolve =
- std::max_element(non_integrity_resolve_times_.begin(),
- non_integrity_resolve_times_.end());
- DCHECK(slowest_non_integrity_resolve != non_integrity_resolve_times_.end());
+ // ResolveTimeRatio is the experimental query resolve time divided by the
+ // slower of the A or AAAA resolve times. Arbitrarily choosing precision at
+ // two decimal places.
+ std::vector<base::TimeDelta>::iterator slowest_address_resolve =
+ std::max_element(address_resolve_times_.begin(),
+ address_resolve_times_.end());
+ DCHECK(slowest_address_resolve != address_resolve_times_.end());
// It's possible to get here with a zero resolve time in tests. Avoid
// divide-by-zero below by returning early; this data point is invalid anyway.
- if (slowest_non_integrity_resolve->is_zero())
+ if (slowest_address_resolve->is_zero())
return;
- // Compute a percentage showing how much larger the INTEGRITY resolve time was
- // compared to the slowest A or AAAA query.
+ // Compute a percentage showing how much larger the experimental query resolve
+ // time was compared to the slowest A or AAAA query.
//
// Computation happens on TimeDelta objects, which use CheckedNumeric. This
// will crash if the system clock leaps forward several hundred millennia
// (numeric_limits<int64_t>::max() microseconds ~= 292,000 years).
- const int64_t resolve_time_percent = base::ClampFloor<int64_t>(
- *integrity_resolve_time_ / *slowest_non_integrity_resolve * 100);
-
- // Scale the value of |resolve_time_percent| by dividing by |kPercentScale|.
- // Sample values are bounded between 1 and 20. A recorded sample of 10 means
- // that the INTEGRITY resolve time took 100% of the slower A/AAAA resolve
- // time. A sample of 20 means that the INTEGRITY resolve time was 200%
- // relative to the A/AAAA resolve time, twice as long.
+ //
+ // Then scale the value of the percent by dividing by `kPercentScale`. Sample
+ // values are bounded between 1 and 20. A recorded sample of 10 means that the
+ // experimental query resolve time took 100% of the slower A/AAAA resolve
+ // time. A sample of 20 means that the experimental query resolve time was
+ // 200% relative to the A/AAAA resolve time, twice as long.
constexpr int64_t kMaxRatio = 20;
constexpr int64_t kPercentScale = 10;
- base::UmaHistogramExactLinear(BuildMetricName("ResolveTimeRatio"),
- resolve_time_percent / kPercentScale,
- kMaxRatio);
+ if (integrity_resolve_time_.has_value()) {
+ const int64_t resolve_time_percent = base::ClampFloor<int64_t>(
+ *integrity_resolve_time_ / *slowest_address_resolve * 100);
+ base::UmaHistogramExactLinear(
+ BuildMetricName(RecordType::kIntegrity, "ResolveTimeRatio"),
+ resolve_time_percent / kPercentScale, kMaxRatio);
+ }
+ if (https_resolve_time_.has_value()) {
+ const int64_t resolve_time_percent = base::ClampFloor<int64_t>(
+ *https_resolve_time_ / *slowest_address_resolve * 100);
+ base::UmaHistogramExactLinear(
+ BuildMetricName(RecordType::kHttps, "ResolveTimeRatio"),
+ resolve_time_percent / kPercentScale, kMaxRatio);
+ }
}
-void HttpssvcMetrics::RecordIntegrityExpectIntactMetrics() {
- // Without |rocde_integrity_|, we can't make progress on any of these metrics.
- DCHECK(rcode_integrity_.has_value());
+void HttpssvcMetrics::RecordExpectIntactMetrics() {
+ // Without an experimental query rcode, we can't make progress on any of these
+ // metrics.
+ DCHECK(rcode_integrity_.has_value() || rcode_https_.has_value());
// The ExpectIntact variant of the "DnsRcode" metric is only recorded when no
// records are received.
- if (num_integrity_records_ == 0) {
- base::UmaHistogramEnumeration(BuildMetricName("DnsRcode"),
- *rcode_integrity_);
+ if (num_integrity_records_ == 0 && rcode_integrity_.has_value()) {
+ base::UmaHistogramEnumeration(
+ BuildMetricName(RecordType::kIntegrity, "DnsRcode"), *rcode_integrity_);
}
+ if (num_https_records_ == 0 && rcode_https_.has_value()) {
+ base::UmaHistogramEnumeration(
+ BuildMetricName(RecordType::kHttps, "DnsRcode"), *rcode_https_);
+ }
+
if (num_integrity_records_ > 0) {
+ DCHECK(rcode_integrity_.has_value());
if (*rcode_integrity_ == HttpssvcDnsRcode::kNoError) {
- base::UmaHistogramBoolean(BuildMetricName("Integrity"),
- is_integrity_intact_.value_or(false));
- } else if (*rcode_integrity_ != HttpssvcDnsRcode::kNoError) {
+ base::UmaHistogramBoolean(
+ BuildMetricName(RecordType::kIntegrity, "Integrity"),
+ is_integrity_intact_.value_or(false));
+ } else {
// Record boolean indicating whether we received an INTEGRITY record and
// an error simultaneously.
- base::UmaHistogramBoolean(BuildMetricName("RecordWithError"), true);
+ base::UmaHistogramBoolean(
+ BuildMetricName(RecordType::kIntegrity, "RecordWithError"), true);
+ }
+ }
+ if (num_https_records_ > 0) {
+ DCHECK(rcode_https_.has_value());
+ if (*rcode_https_ == HttpssvcDnsRcode::kNoError) {
+ base::UmaHistogramBoolean(BuildMetricName(RecordType::kHttps, "Parsable"),
+ is_https_parsable_.value_or(false));
+ } else {
+ // Record boolean indicating whether we received an HTTPS record and
+ // an error simultaneously.
+ base::UmaHistogramBoolean(
+ BuildMetricName(RecordType::kHttps, "RecordWithError"), true);
}
}
}
-void HttpssvcMetrics::RecordIntegrityExpectNoerrorMetrics() {
+void HttpssvcMetrics::RecordExpectNoerrorMetrics() {
if (rcode_integrity_.has_value()) {
- base::UmaHistogramEnumeration(BuildMetricName("DnsRcode"),
- *rcode_integrity_);
+ base::UmaHistogramEnumeration(
+ BuildMetricName(RecordType::kIntegrity, "DnsRcode"), *rcode_integrity_);
}
+ if (rcode_https_.has_value()) {
+ base::UmaHistogramEnumeration(
+ BuildMetricName(RecordType::kHttps, "DnsRcode"), *rcode_https_);
+ }
+
+ // INTEGRITY only records a simple boolean when an unexpected record is
+ // received because it is extremely unlikely to be an actual INTEGRITY record.
if (num_integrity_records_ > 0) {
- base::UmaHistogramBoolean(BuildMetricName("RecordReceived"), true);
+ base::UmaHistogramBoolean(
+ BuildMetricName(RecordType::kIntegrity, "RecordReceived"), true);
+ }
+
+ // HTTPS records received for expect-noerror domains are actual in-the-wild
+ // records not specific to Chrome experiments. Record some extra metrics on
+ // seen records, but not broken out by DNS provider.
+ if (num_https_records_ > 0) {
+ if (*rcode_https_ == HttpssvcDnsRcode::kNoError) {
+ UMA_HISTOGRAM_BOOLEAN(
+ "Net.DNS.HTTPSSVC.RecordHttps.AnyProvider.ExpectNoerror.Parsable",
+ is_https_parsable_.value_or(false));
+ } else {
+ // Record boolean indicating whether we received an HTTPS record and
+ // an error simultaneously.
+ UMA_HISTOGRAM_BOOLEAN(
+ "Net.DNS.HTTPSSVC.RecordHttps.AnyProvider.ExpectNoerror."
+ "RecordWithError",
+ true);
+ }
}
}
diff --git a/chromium/net/dns/httpssvc_metrics.h b/chromium/net/dns/httpssvc_metrics.h
index 8594b7c54da..ae4e6d7b5bc 100644
--- a/chromium/net/dns/httpssvc_metrics.h
+++ b/chromium/net/dns/httpssvc_metrics.h
@@ -68,28 +68,35 @@ class NET_EXPORT_PRIVATE HttpssvcMetrics {
HttpssvcMetrics(HttpssvcMetrics&&) = delete;
// May be called many times.
- void SaveForNonIntegrity(base::Optional<std::string> doh_provider_id,
+ void SaveForAddressQuery(base::Optional<std::string> doh_provider_id,
base::TimeDelta resolve_time,
enum HttpssvcDnsRcode rcode);
// Save the fact that the non-integrity queries failed. Prevents metrics from
// being recorded.
- void SaveNonIntegrityFailure();
+ void SaveAddressQueryFailure();
// Must only be called once.
void SaveForIntegrity(base::Optional<std::string> doh_provider_id,
enum HttpssvcDnsRcode rcode,
const std::vector<bool>& condensed_records,
base::TimeDelta integrity_resolve_time);
+ void SaveForHttps(base::Optional<std::string> doh_provider_id,
+ enum HttpssvcDnsRcode rcode,
+ const std::vector<bool>& condensed_records,
+ base::TimeDelta https_resolve_time);
private:
- std::string BuildMetricName(base::StringPiece leaf_name) const;
+ enum class RecordType { kIntegrity, kHttps };
+
+ std::string BuildMetricName(RecordType type,
+ base::StringPiece leaf_name) const;
// Records all the aggregated metrics to UMA.
- void RecordIntegrityMetrics();
- void RecordIntegrityCommonMetrics();
- void RecordIntegrityExpectIntactMetrics();
- void RecordIntegrityExpectNoerrorMetrics();
+ void RecordMetrics();
+ void RecordCommonMetrics();
+ void RecordExpectIntactMetrics();
+ void RecordExpectNoerrorMetrics();
void set_doh_provider_id(base::Optional<std::string> doh_provider_id);
@@ -99,12 +106,16 @@ class NET_EXPORT_PRIVATE HttpssvcMetrics {
bool already_recorded_ = false;
base::Optional<std::string> doh_provider_id_;
base::Optional<enum HttpssvcDnsRcode> rcode_integrity_;
+ base::Optional<enum HttpssvcDnsRcode> rcode_https_;
size_t num_integrity_records_ = 0;
+ size_t num_https_records_ = 0;
base::Optional<bool> is_integrity_intact_;
- // We never make multiple INTEGRITY queries per DnsTask, so we only need
- // one TimeDelta for the INTEGRITY query.
+ base::Optional<bool> is_https_parsable_;
+ // We never make multiple INTEGRITY or HTTPS queries per DnsTask, so we only
+ // need one TimeDelta for each qtype.
base::Optional<base::TimeDelta> integrity_resolve_time_;
- std::vector<base::TimeDelta> non_integrity_resolve_times_;
+ base::Optional<base::TimeDelta> https_resolve_time_;
+ std::vector<base::TimeDelta> address_resolve_times_;
};
} // namespace net
diff --git a/chromium/net/dns/httpssvc_metrics_unittest.cc b/chromium/net/dns/httpssvc_metrics_unittest.cc
index 1ce51cf7608..6b629f3e5c2 100644
--- a/chromium/net/dns/httpssvc_metrics_unittest.cc
+++ b/chromium/net/dns/httpssvc_metrics_unittest.cc
@@ -164,23 +164,25 @@ INSTANTIATE_TEST_SUITE_P(
testing::Combine(
testing::Bool() /* DnsHttpssvc feature enabled? */,
testing::Bool() /* DnsHttpssvcUseIntegrity */,
- testing::Values(false) /* DnsHttpssvcUseHttpssvc */,
+ testing::Bool() /* DnsHttpssvcUseHttpssvc */,
testing::Values(false) /* DnsHttpssvcControlDomainWildcard */)));
// Base for testing the metrics collection code in |HttpssvcMetrics|.
-class HttpssvcMetricsTest
- : public ::testing::TestWithParam<MetricsTestParamTuple> {
+class HttpssvcMetricsTest : public ::testing::TestWithParam<bool> {
public:
void SetUp() override {
- HttpssvcFeatureTuple httpssvc_feature;
- std::tie(querying_experimental_, httpssvc_feature) = GetParam();
- config_ = HttpssvcFeatureConfig(httpssvc_feature, "", "");
+ querying_experimental_ = GetParam();
+ config_ = HttpssvcFeatureConfig(
+ {true /* enabled */, true /* use_integrity */, true /* use_httpssvc */,
+ false /* control_domain_wildcard */},
+ "", "");
config_.Apply(&scoped_feature_list_);
}
- std::string BuildMetricNamePrefix() const {
- return base::StrCat(
- {"Net.DNS.HTTPSSVC.RecordIntegrity.", doh_provider_, "."});
+ std::string BuildMetricNamePrefix(base::StringPiece record_type_str,
+ base::StringPiece expect_str) const {
+ return base::StrCat({"Net.DNS.HTTPSSVC.", record_type_str, ".",
+ doh_provider_, ".", expect_str, "."});
}
template <typename T>
@@ -199,23 +201,34 @@ class HttpssvcMetricsTest
ExpectSample<int64_t>(name, sample_ms);
}
- void VerifyMetricsForExpectIntact(
+ void VerifyAddressResolveTimeMetric(
+ base::Optional<base::TimeDelta> expect_intact_time = base::nullopt,
+ base::Optional<base::TimeDelta> expect_noerror_time = base::nullopt) {
+ const std::string kExpectIntact =
+ base::StrCat({BuildMetricNamePrefix("RecordIntegrity", "ExpectIntact"),
+ "ResolveTimeNonIntegrityRecord"});
+ const std::string kExpectNoerror =
+ base::StrCat({BuildMetricNamePrefix("RecordIntegrity", "ExpectNoerror"),
+ "ResolveTimeNonIntegrityRecord"});
+
+ ExpectSample(kExpectIntact, expect_intact_time);
+ ExpectSample(kExpectNoerror, expect_noerror_time);
+ }
+
+ void VerifyIntegrityMetricsForExpectIntact(
base::Optional<HttpssvcDnsRcode> rcode,
base::Optional<bool> integrity,
base::Optional<bool> record_with_error,
base::Optional<base::TimeDelta> resolve_time_integrity,
- base::Optional<base::TimeDelta> resolve_time_non_integrity,
base::Optional<int> resolve_time_ratio) const {
const std::string kPrefix =
- base::StrCat({BuildMetricNamePrefix(), "ExpectIntact."});
+ BuildMetricNamePrefix("RecordIntegrity", "ExpectIntact");
const std::string kMetricDnsRcode = base::StrCat({kPrefix, "DnsRcode"});
const std::string kMetricIntegrity = base::StrCat({kPrefix, "Integrity"});
const std::string kMetricRecordWithError =
base::StrCat({kPrefix, "RecordWithError"});
const std::string kMetricResolveTimeIntegrity =
base::StrCat({kPrefix, "ResolveTimeIntegrityRecord"});
- const std::string kMetricResolveTimeNonIntegrity =
- base::StrCat({kPrefix, "ResolveTimeNonIntegrityRecord"});
const std::string kMetricResolveTimeRatio =
base::StrCat({kPrefix, "ResolveTimeRatio"});
@@ -223,43 +236,89 @@ class HttpssvcMetricsTest
ExpectSample(kMetricIntegrity, integrity);
ExpectSample(kMetricRecordWithError, record_with_error);
ExpectSample(kMetricResolveTimeIntegrity, resolve_time_integrity);
- ExpectSample(kMetricResolveTimeNonIntegrity, resolve_time_non_integrity);
ExpectSample(kMetricResolveTimeRatio, resolve_time_ratio);
}
- void VerifyMetricsForExpectNoerror(
+ void VerifyHttpsMetricsForExpectIntact(
+ base::Optional<HttpssvcDnsRcode> rcode = base::nullopt,
+ base::Optional<bool> parsable = base::nullopt,
+ base::Optional<bool> record_with_error = base::nullopt,
+ base::Optional<base::TimeDelta> resolve_time_https = base::nullopt,
+ base::Optional<int> resolve_time_ratio = base::nullopt) const {
+ const std::string kPrefix =
+ BuildMetricNamePrefix("RecordHttps", "ExpectIntact");
+ const std::string kMetricDnsRcode = base::StrCat({kPrefix, "DnsRcode"});
+ const std::string kMetricParsable = base::StrCat({kPrefix, "Parsable"});
+ const std::string kMetricRecordWithError =
+ base::StrCat({kPrefix, "RecordWithError"});
+ const std::string kMetricResolveTimeHttps =
+ base::StrCat({kPrefix, "ResolveTimeHttpsRecord"});
+ const std::string kMetricResolveTimeRatio =
+ base::StrCat({kPrefix, "ResolveTimeRatio"});
+
+ ExpectSample(kMetricDnsRcode, rcode);
+ ExpectSample(kMetricParsable, parsable);
+ ExpectSample(kMetricRecordWithError, record_with_error);
+ ExpectSample(kMetricResolveTimeHttps, resolve_time_https);
+ ExpectSample(kMetricResolveTimeRatio, resolve_time_ratio);
+ }
+
+ void VerifyIntegrityMetricsForExpectNoerror(
base::Optional<HttpssvcDnsRcode> rcode,
base::Optional<int> record_received,
base::Optional<base::TimeDelta> resolve_time_integrity,
- base::Optional<base::TimeDelta> resolve_time_non_integrity,
base::Optional<int> resolve_time_ratio) const {
const std::string kPrefix =
- base::StrCat({BuildMetricNamePrefix(), "ExpectNoerror."});
+ BuildMetricNamePrefix("RecordIntegrity", "ExpectNoerror");
const std::string kMetricDnsRcode = base::StrCat({kPrefix, "DnsRcode"});
const std::string kMetricRecordReceived =
base::StrCat({kPrefix, "RecordReceived"});
const std::string kMetricResolveTimeIntegrity =
base::StrCat({kPrefix, "ResolveTimeIntegrityRecord"});
- const std::string kMetricResolveTimeNonIntegrity =
- base::StrCat({kPrefix, "ResolveTimeNonIntegrityRecord"});
const std::string kMetricResolveTimeRatio =
base::StrCat({kPrefix, "ResolveTimeRatio"});
ExpectSample(kMetricDnsRcode, rcode);
ExpectSample(kMetricRecordReceived, record_received);
ExpectSample(kMetricResolveTimeIntegrity, resolve_time_integrity);
- ExpectSample(kMetricResolveTimeNonIntegrity, resolve_time_non_integrity);
ExpectSample(kMetricResolveTimeRatio, resolve_time_ratio);
}
- void VerifyMetricsForExpectIntact() {
- VerifyMetricsForExpectIntact(base::nullopt, base::nullopt, base::nullopt,
- base::nullopt, base::nullopt, base::nullopt);
+ void VerifyHttpsMetricsForExpectNoerror(
+ base::Optional<HttpssvcDnsRcode> rcode = base::nullopt,
+ base::Optional<bool> parsable = base::nullopt,
+ base::Optional<bool> record_with_error = base::nullopt,
+ base::Optional<base::TimeDelta> resolve_time_https = base::nullopt,
+ base::Optional<int> resolve_time_ratio = base::nullopt) const {
+ const std::string kPrefix =
+ BuildMetricNamePrefix("RecordHttps", "ExpectNoerror");
+ const std::string kMetricDnsRcode = base::StrCat({kPrefix, "DnsRcode"});
+ const std::string kMetricParsable =
+ "Net.DNS.HTTPSSVC.RecordHttps.AnyProvider.ExpectNoerror.Parsable";
+ const std::string kMetricRecordWithError =
+ "Net.DNS.HTTPSSVC.RecordHttps.AnyProvider.ExpectNoerror."
+ "RecordWithError";
+ const std::string kMetricResolveTimeHttps =
+ base::StrCat({kPrefix, "ResolveTimeHttpsRecord"});
+ const std::string kMetricResolveTimeRatio =
+ base::StrCat({kPrefix, "ResolveTimeRatio"});
+
+ ExpectSample(kMetricDnsRcode, rcode);
+ ExpectSample(kMetricParsable, parsable);
+ ExpectSample(kMetricRecordWithError, record_with_error);
+ ExpectSample(kMetricResolveTimeHttps, resolve_time_https);
+ ExpectSample(kMetricResolveTimeRatio, resolve_time_ratio);
}
- void VerifyMetricsForExpectNoerror() {
- VerifyMetricsForExpectNoerror(base::nullopt, base::nullopt, base::nullopt,
- base::nullopt, base::nullopt);
+ void VerifyIntegrityMetricsForExpectIntact() {
+ VerifyIntegrityMetricsForExpectIntact(base::nullopt, base::nullopt,
+ base::nullopt, base::nullopt,
+ base::nullopt);
+ }
+
+ void VerifyIntegrityMetricsForExpectNoerror() {
+ VerifyIntegrityMetricsForExpectNoerror(base::nullopt, base::nullopt,
+ base::nullopt, base::nullopt);
}
const base::HistogramTester& histo() const { return histogram_; }
@@ -278,25 +337,14 @@ class HttpssvcMetricsTest
// This instantiation focuses on whether the correct metrics are recorded. The
// domain list parser is already tested against encoding quirks in
// |HttpssvcMetricsTestDomainParsing|, so we fix the quirks at false.
-INSTANTIATE_TEST_SUITE_P(
- HttpssvcMetricsTestSimple,
- HttpssvcMetricsTest,
- testing::Combine(
- // Whether we are querying an experimental domain.
- testing::Bool(),
- // HttpssvcFeatureTuple
- testing::Combine(
- testing::Values(true) /* DnsHttpssvc feature enabled? */,
- testing::Values(true) /* DnsHttpssvcUseIntegrity */,
- testing::Values(false) /* DnsHttpssvcUseHttpssvc */,
- testing::Values(false) /* DnsHttpssvcControlDomainWildcard */)));
+INSTANTIATE_TEST_SUITE_P(HttpssvcMetricsTestSimple,
+ HttpssvcMetricsTest,
+ // Whether we are querying an experimental domain.
+ testing::Bool());
TEST_P(HttpssvcDomainParsingTest, ParseFeatureParamIntegrityDomains) {
HttpssvcExperimentDomainCache domain_cache;
- // We are not testing this feature param yet.
- CHECK(!config().use_httpssvc);
-
const std::string kReservedDomain = "neither.example";
EXPECT_FALSE(domain_cache.IsExperimental(kReservedDomain));
EXPECT_EQ(domain_cache.IsControl(kReservedDomain),
@@ -318,7 +366,7 @@ TEST_P(HttpssvcDomainParsingTest, ParseFeatureParamIntegrityDomains) {
EXPECT_FALSE(domain_cache.IsExperimental(control_domain));
EXPECT_FALSE(domain_cache.IsControl(control_domain));
}
- } else if (config().use_integrity) {
+ } else if (config().use_integrity || config().use_httpssvc) {
for (const std::string& experiment_domain : expected_experiment_domains_) {
EXPECT_TRUE(domain_cache.IsExperimental(experiment_domain));
EXPECT_FALSE(domain_cache.IsControl(experiment_domain));
@@ -332,67 +380,145 @@ TEST_P(HttpssvcDomainParsingTest, ParseFeatureParamIntegrityDomains) {
}
// Only record metrics for a non-integrity query.
-TEST_P(HttpssvcMetricsTest, AddressAndIntegrityMissing) {
- if (!config().enabled || !config().use_integrity) {
- VerifyMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror();
- return;
- }
+TEST_P(HttpssvcMetricsTest, AddressAndExperimentalMissing) {
const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
- metrics->SaveForNonIntegrity(base::nullopt, kResolveTime,
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
HttpssvcDnsRcode::kNoError);
metrics.reset(); // Record the metrics to UMA.
- VerifyMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror();
+ VerifyAddressResolveTimeMetric();
+ VerifyIntegrityMetricsForExpectIntact();
+ VerifyHttpsMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectNoerror();
+ VerifyHttpsMetricsForExpectNoerror();
}
TEST_P(HttpssvcMetricsTest, AddressAndIntegrityIntact) {
- if (!config().enabled || !config().use_integrity) {
- VerifyMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror();
+ const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
+ const base::TimeDelta kResolveTimeIntegrity =
+ base::TimeDelta::FromMilliseconds(15);
+ base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
+ metrics->SaveForIntegrity(base::nullopt, HttpssvcDnsRcode::kNoError, {true},
+ kResolveTimeIntegrity);
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
+ HttpssvcDnsRcode::kNoError);
+ metrics.reset(); // Record the metrics to UMA.
+
+ VerifyHttpsMetricsForExpectIntact();
+ VerifyHttpsMetricsForExpectNoerror();
+
+ if (querying_experimental_) {
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyIntegrityMetricsForExpectIntact(
+ base::nullopt /* rcode */, {true} /* integrity */,
+ base::nullopt /* record_with_error */,
+ {kResolveTimeIntegrity} /* resolve_time_integrity */,
+ {15} /* resolve_time_ratio */);
+
+ VerifyIntegrityMetricsForExpectNoerror();
return;
}
+
+ VerifyIntegrityMetricsForExpectIntact();
+
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyIntegrityMetricsForExpectNoerror(
+ {HttpssvcDnsRcode::kNoError} /* rcode */, {1} /* record_received */,
+ {kResolveTimeIntegrity} /* resolve_time_integrity */,
+ {15} /* resolve_time_ratio */);
+}
+
+TEST_P(HttpssvcMetricsTest, AddressAndHttpsParsable) {
+ const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
+ const base::TimeDelta kResolveTimeHttps =
+ base::TimeDelta::FromMilliseconds(15);
+ base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
+ metrics->SaveForHttps(base::nullopt, HttpssvcDnsRcode::kNoError, {true},
+ kResolveTimeHttps);
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
+ HttpssvcDnsRcode::kNoError);
+ metrics.reset(); // Record the metrics to UMA.
+
+ VerifyIntegrityMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectNoerror();
+
+ if (querying_experimental_) {
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyHttpsMetricsForExpectIntact(
+ base::nullopt /* rcode */, {true} /* parsable */,
+ base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {15} /* resolve_time_ratio */);
+
+ VerifyHttpsMetricsForExpectNoerror();
+ return;
+ }
+
+ VerifyHttpsMetricsForExpectIntact();
+
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyHttpsMetricsForExpectNoerror(
+ {HttpssvcDnsRcode::kNoError} /* rcode */, {true} /* parsable */,
+ base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {15} /* resolve_time_ratio */);
+}
+
+TEST_P(HttpssvcMetricsTest, AddressAndIntegrityIntactAndHttpsParsable) {
const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
const base::TimeDelta kResolveTimeIntegrity =
base::TimeDelta::FromMilliseconds(15);
+ const base::TimeDelta kResolveTimeHttps =
+ base::TimeDelta::FromMilliseconds(20);
base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
metrics->SaveForIntegrity(base::nullopt, HttpssvcDnsRcode::kNoError, {true},
kResolveTimeIntegrity);
- metrics->SaveForNonIntegrity(base::nullopt, kResolveTime,
+ metrics->SaveForHttps(base::nullopt, HttpssvcDnsRcode::kNoError, {true},
+ kResolveTimeHttps);
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
HttpssvcDnsRcode::kNoError);
metrics.reset(); // Record the metrics to UMA.
if (querying_experimental_) {
- VerifyMetricsForExpectIntact(
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyIntegrityMetricsForExpectIntact(
base::nullopt /* rcode */, {true} /* integrity */,
base::nullopt /* record_with_error */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
{15} /* resolve_time_ratio */);
+ VerifyHttpsMetricsForExpectIntact(
+ base::nullopt /* rcode */, {true} /* parsable */,
+ base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {20} /* resolve_time_ratio */);
- VerifyMetricsForExpectNoerror();
+ VerifyIntegrityMetricsForExpectNoerror();
+ VerifyHttpsMetricsForExpectNoerror();
return;
}
- VerifyMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectIntact();
+ VerifyHttpsMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror(
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyIntegrityMetricsForExpectNoerror(
{HttpssvcDnsRcode::kNoError} /* rcode */, {1} /* record_received */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
{15} /* resolve_time_ratio */);
+ VerifyHttpsMetricsForExpectNoerror(
+ {HttpssvcDnsRcode::kNoError} /* rcode */, {true} /* parsable */,
+ base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {20} /* resolve_time_ratio */);
}
// This test simulates an INTEGRITY response that includes no INTEGRITY records,
// but does have an error value for the RCODE.
TEST_P(HttpssvcMetricsTest, AddressAndIntegrityMissingWithRcode) {
- if (!config().enabled || !config().use_integrity) {
- VerifyMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror();
- return;
- }
const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
const base::TimeDelta kResolveTimeIntegrity =
base::TimeDelta::FromMilliseconds(15);
@@ -400,41 +526,79 @@ TEST_P(HttpssvcMetricsTest, AddressAndIntegrityMissingWithRcode) {
base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
metrics->SaveForIntegrity(base::nullopt, HttpssvcDnsRcode::kNxDomain, {},
kResolveTimeIntegrity);
- metrics->SaveForNonIntegrity(base::nullopt, kResolveTime,
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
HttpssvcDnsRcode::kNoError);
metrics.reset(); // Record the metrics to UMA.
+ VerifyHttpsMetricsForExpectIntact();
+ VerifyHttpsMetricsForExpectNoerror();
+
if (querying_experimental_) {
- VerifyMetricsForExpectIntact(
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyIntegrityMetricsForExpectIntact(
{HttpssvcDnsRcode::kNxDomain} /* rcode */,
base::nullopt /* integrity */, base::nullopt /* record_with_error */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
{15} /* resolve_time_ratio */);
- VerifyMetricsForExpectNoerror();
+ VerifyIntegrityMetricsForExpectNoerror();
return;
}
- VerifyMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror(
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyIntegrityMetricsForExpectNoerror(
{HttpssvcDnsRcode::kNxDomain} /* rcode */,
base::nullopt /* record_received */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
{15} /* resolve_time_ratio */);
}
-// This test simulates an INTEGRITY response that includes an intact INTEGRITY
-// record, but also has an error RCODE.
-TEST_P(HttpssvcMetricsTest, AddressAndIntegrityIntactWithRcode) {
- if (!config().enabled || !config().use_integrity) {
- VerifyMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror();
+// This test simulates an HTTPS response that includes no HTTPS records,
+// but does have an error value for the RCODE.
+TEST_P(HttpssvcMetricsTest, AddressAndHttpsMissingWithRcode) {
+ const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
+ const base::TimeDelta kResolveTimeHttps =
+ base::TimeDelta::FromMilliseconds(15);
+
+ base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
+ metrics->SaveForHttps(base::nullopt, HttpssvcDnsRcode::kNxDomain, {},
+ kResolveTimeHttps);
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
+ HttpssvcDnsRcode::kNoError);
+ metrics.reset(); // Record the metrics to UMA.
+
+ VerifyIntegrityMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectNoerror();
+
+ if (querying_experimental_) {
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyHttpsMetricsForExpectIntact(
+ {HttpssvcDnsRcode::kNxDomain} /* rcode */, base::nullopt /* parsable */,
+ base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {15} /* resolve_time_ratio */);
+
+ VerifyHttpsMetricsForExpectNoerror();
return;
}
+ VerifyHttpsMetricsForExpectIntact();
+
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyHttpsMetricsForExpectNoerror(
+ {HttpssvcDnsRcode::kNxDomain} /* rcode */, base::nullopt /* parsable */,
+ base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {15} /* resolve_time_ratio */);
+}
+
+// This test simulates an INTEGRITY response that includes an intact INTEGRITY
+// record, but also has an error RCODE.
+TEST_P(HttpssvcMetricsTest, AddressAndIntegrityIntactWithRcode) {
const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
const base::TimeDelta kResolveTimeIntegrity =
base::TimeDelta::FromMilliseconds(15);
@@ -442,112 +606,240 @@ TEST_P(HttpssvcMetricsTest, AddressAndIntegrityIntactWithRcode) {
base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
metrics->SaveForIntegrity(base::nullopt, HttpssvcDnsRcode::kNxDomain, {true},
kResolveTimeIntegrity);
- metrics->SaveForNonIntegrity(base::nullopt, kResolveTime,
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
HttpssvcDnsRcode::kNoError);
metrics.reset(); // Record the metrics to UMA.
+ VerifyHttpsMetricsForExpectIntact();
+ VerifyHttpsMetricsForExpectNoerror();
+
if (querying_experimental_) {
- VerifyMetricsForExpectIntact(
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyIntegrityMetricsForExpectIntact(
// "DnsRcode" metric is omitted because we received an INTEGRITY record.
base::nullopt /* rcode */,
// "Integrity" metric is omitted because the RCODE is not NOERROR.
base::nullopt /* integrity */, {true} /* record_with_error */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
{15} /* resolve_time_ratio */);
- VerifyMetricsForExpectNoerror();
+ VerifyIntegrityMetricsForExpectNoerror();
return;
}
- VerifyMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror(
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyIntegrityMetricsForExpectNoerror(
{HttpssvcDnsRcode::kNxDomain} /* rcode */, {true} /* record_received */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
+ {15} /* resolve_time_ratio */);
+}
+
+// This test simulates an HTTPS response that includes a parsable HTTPS
+// record, but also has an error RCODE.
+TEST_P(HttpssvcMetricsTest, AddressAndHttpsParsableWithRcode) {
+ const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
+ const base::TimeDelta kResolveTimeHttps =
+ base::TimeDelta::FromMilliseconds(15);
+
+ base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
+ metrics->SaveForHttps(base::nullopt, HttpssvcDnsRcode::kNxDomain, {true},
+ kResolveTimeHttps);
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
+ HttpssvcDnsRcode::kNoError);
+ metrics.reset(); // Record the metrics to UMA.
+
+ VerifyIntegrityMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectNoerror();
+
+ if (querying_experimental_) {
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyHttpsMetricsForExpectIntact(
+ // "DnsRcode" metric is omitted because we received an HTTPS record.
+ base::nullopt /* rcode */,
+ // "parsable" metric is omitted because the RCODE is not NOERROR.
+ base::nullopt /* parsable */, {true} /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {15} /* resolve_time_ratio */);
+
+ VerifyHttpsMetricsForExpectNoerror();
+ return;
+ }
+
+ VerifyHttpsMetricsForExpectIntact();
+
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyHttpsMetricsForExpectNoerror(
+ {HttpssvcDnsRcode::kNxDomain} /* rcode */,
+ // "parsable" metric is omitted because the RCODE is not NOERROR.
+ base::nullopt /* parsable */, {true} /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
{15} /* resolve_time_ratio */);
}
// This test simulates an INTEGRITY response that includes a mangled INTEGRITY
// record *and* has an error RCODE.
TEST_P(HttpssvcMetricsTest, AddressAndIntegrityMangledWithRcode) {
- if (!config().enabled || !config().use_integrity) {
- VerifyMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror();
- return;
- }
const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
const base::TimeDelta kResolveTimeIntegrity =
base::TimeDelta::FromMilliseconds(15);
base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
metrics->SaveForIntegrity(base::nullopt, HttpssvcDnsRcode::kNxDomain, {false},
kResolveTimeIntegrity);
- metrics->SaveForNonIntegrity(base::nullopt, kResolveTime,
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
HttpssvcDnsRcode::kNoError);
metrics.reset(); // Record the metrics to UMA.
+ VerifyHttpsMetricsForExpectIntact();
+ VerifyHttpsMetricsForExpectNoerror();
+
if (querying_experimental_) {
- VerifyMetricsForExpectIntact(
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyIntegrityMetricsForExpectIntact(
// "DnsRcode" metric is omitted because we received an INTEGRITY record.
base::nullopt /* rcode */,
// "Integrity" metric is omitted because the RCODE is not NOERROR.
base::nullopt /* integrity */, {true} /* record_with_error */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
{15} /* resolve_time_ratio */);
- VerifyMetricsForExpectNoerror();
+ VerifyIntegrityMetricsForExpectNoerror();
return;
}
- VerifyMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror(
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyIntegrityMetricsForExpectNoerror(
{HttpssvcDnsRcode::kNxDomain} /* rcode */, {true} /* record_received */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
+ {15} /* resolve_time_ratio */);
+}
+
+// This test simulates an HTTPS response that includes a mangled HTTPS
+// record *and* has an error RCODE.
+TEST_P(HttpssvcMetricsTest, AddressAndHttpsMangledWithRcode) {
+ const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
+ const base::TimeDelta kResolveTimeHttps =
+ base::TimeDelta::FromMilliseconds(15);
+ base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
+ metrics->SaveForHttps(base::nullopt, HttpssvcDnsRcode::kNxDomain, {false},
+ kResolveTimeHttps);
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
+ HttpssvcDnsRcode::kNoError);
+ metrics.reset(); // Record the metrics to UMA.
+
+ VerifyIntegrityMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectNoerror();
+
+ if (querying_experimental_) {
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyHttpsMetricsForExpectIntact(
+ // "DnsRcode" metric is omitted because we received an HTTPS record.
+ base::nullopt /* rcode */,
+ // "parsable" metric is omitted because the RCODE is not NOERROR.
+ base::nullopt /* parsable */, {true} /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {15} /* resolve_time_ratio */);
+
+ VerifyHttpsMetricsForExpectNoerror();
+ return;
+ }
+
+ VerifyHttpsMetricsForExpectIntact();
+
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyHttpsMetricsForExpectNoerror(
+ {HttpssvcDnsRcode::kNxDomain} /* rcode */,
+ // "parsable" metric is omitted because the RCODE is not NOERROR.
+ base::nullopt /* parsable */, {true} /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
{15} /* resolve_time_ratio */);
}
// This test simulates successful address queries and an INTEGRITY query that
// timed out.
TEST_P(HttpssvcMetricsTest, AddressAndIntegrityTimedOut) {
- if (!config().enabled || !config().use_integrity) {
- VerifyMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror();
- return;
- }
const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
const base::TimeDelta kResolveTimeIntegrity =
base::TimeDelta::FromMilliseconds(15);
base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
metrics->SaveForIntegrity(base::nullopt, HttpssvcDnsRcode::kTimedOut, {},
kResolveTimeIntegrity);
- metrics->SaveForNonIntegrity(base::nullopt, kResolveTime,
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
HttpssvcDnsRcode::kNoError);
metrics.reset(); // Record the metrics to UMA.
+ VerifyHttpsMetricsForExpectIntact();
+ VerifyHttpsMetricsForExpectNoerror();
+
if (querying_experimental_) {
- VerifyMetricsForExpectIntact(
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyIntegrityMetricsForExpectIntact(
{HttpssvcDnsRcode::kTimedOut} /* rcode */,
// "Integrity" metric is omitted because the RCODE is not NOERROR.
base::nullopt /* integrity */, base::nullopt /* record_with_error */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
{15} /* resolve_time_ratio */);
- VerifyMetricsForExpectNoerror();
+ VerifyIntegrityMetricsForExpectNoerror();
return;
}
- VerifyMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectIntact();
- VerifyMetricsForExpectNoerror(
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyIntegrityMetricsForExpectNoerror(
{HttpssvcDnsRcode::kTimedOut} /* rcode */,
base::nullopt /* record_received */,
{kResolveTimeIntegrity} /* resolve_time_integrity */,
- {kResolveTime} /* resolve_time_non_integrity */,
+ {15} /* resolve_time_ratio */);
+}
+
+// This test simulates successful address queries and an HTTPS query that
+// timed out.
+TEST_P(HttpssvcMetricsTest, AddressAndHttpsTimedOut) {
+ const base::TimeDelta kResolveTime = base::TimeDelta::FromMilliseconds(10);
+ const base::TimeDelta kResolveTimeHttps =
+ base::TimeDelta::FromMilliseconds(15);
+ base::Optional<HttpssvcMetrics> metrics(querying_experimental_);
+ metrics->SaveForHttps(base::nullopt, HttpssvcDnsRcode::kTimedOut, {},
+ kResolveTimeHttps);
+ metrics->SaveForAddressQuery(base::nullopt, kResolveTime,
+ HttpssvcDnsRcode::kNoError);
+ metrics.reset(); // Record the metrics to UMA.
+
+ VerifyIntegrityMetricsForExpectIntact();
+ VerifyIntegrityMetricsForExpectNoerror();
+
+ if (querying_experimental_) {
+ VerifyAddressResolveTimeMetric({kResolveTime} /* expect_intact_time */);
+ VerifyHttpsMetricsForExpectIntact(
+ {HttpssvcDnsRcode::kTimedOut} /* rcode */,
+ // "parsable" metric is omitted because the RCODE is not NOERROR.
+ base::nullopt /* parsable */, base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
+ {15} /* resolve_time_ratio */);
+
+ VerifyIntegrityMetricsForExpectNoerror();
+ return;
+ }
+
+ VerifyHttpsMetricsForExpectIntact();
+
+ VerifyAddressResolveTimeMetric(base::nullopt /* expect_intact_time */,
+ {kResolveTime} /* expect_noerror_time */);
+ VerifyHttpsMetricsForExpectNoerror(
+ {HttpssvcDnsRcode::kTimedOut} /* rcode */,
+ // "parsable" metric is omitted because the RCODE is not NOERROR.
+ base::nullopt /* parsable */, base::nullopt /* record_with_error */,
+ {kResolveTimeHttps} /* resolve_time_https */,
{15} /* resolve_time_ratio */);
}
diff --git a/chromium/net/dns/public/dns_config_overrides.cc b/chromium/net/dns/public/dns_config_overrides.cc
index ae7c1f98062..68bff684bad 100644
--- a/chromium/net/dns/public/dns_config_overrides.cc
+++ b/chromium/net/dns/public/dns_config_overrides.cc
@@ -26,7 +26,7 @@ DnsConfigOverrides& DnsConfigOverrides::operator=(DnsConfigOverrides&& other) =
bool DnsConfigOverrides::operator==(const DnsConfigOverrides& other) const {
return nameservers == other.nameservers && search == other.search &&
append_to_multi_label_name == other.append_to_multi_label_name &&
- ndots == other.ndots && timeout == other.timeout &&
+ ndots == other.ndots && fallback_period == other.fallback_period &&
attempts == other.attempts && doh_attempts == other.doh_attempts &&
rotate == other.rotate && use_local_ipv6 == other.use_local_ipv6 &&
dns_over_https_servers == other.dns_over_https_servers &&
@@ -50,7 +50,7 @@ DnsConfigOverrides::CreateOverridingEverythingWithDefaults() {
overrides.search = defaults.search;
overrides.append_to_multi_label_name = defaults.append_to_multi_label_name;
overrides.ndots = defaults.ndots;
- overrides.timeout = defaults.timeout;
+ overrides.fallback_period = defaults.fallback_period;
overrides.attempts = defaults.attempts;
overrides.doh_attempts = defaults.doh_attempts;
overrides.rotate = defaults.rotate;
@@ -67,8 +67,8 @@ DnsConfigOverrides::CreateOverridingEverythingWithDefaults() {
bool DnsConfigOverrides::OverridesEverything() const {
return nameservers && search && append_to_multi_label_name && ndots &&
- timeout && attempts && doh_attempts && rotate && use_local_ipv6 &&
- dns_over_https_servers && secure_dns_mode &&
+ fallback_period && attempts && doh_attempts && rotate &&
+ use_local_ipv6 && dns_over_https_servers && secure_dns_mode &&
allow_dns_over_https_upgrade && disabled_upgrade_providers &&
clear_hosts;
}
@@ -87,8 +87,8 @@ DnsConfig DnsConfigOverrides::ApplyOverrides(const DnsConfig& config) const {
overridden.append_to_multi_label_name = append_to_multi_label_name.value();
if (ndots)
overridden.ndots = ndots.value();
- if (timeout)
- overridden.timeout = timeout.value();
+ if (fallback_period)
+ overridden.fallback_period = fallback_period.value();
if (attempts)
overridden.attempts = attempts.value();
if (doh_attempts)
diff --git a/chromium/net/dns/public/dns_config_overrides.h b/chromium/net/dns/public/dns_config_overrides.h
index fd7eb5cd8df..dcef613d0b9 100644
--- a/chromium/net/dns/public/dns_config_overrides.h
+++ b/chromium/net/dns/public/dns_config_overrides.h
@@ -51,7 +51,7 @@ struct NET_EXPORT DnsConfigOverrides {
base::Optional<std::vector<std::string>> search;
base::Optional<bool> append_to_multi_label_name;
base::Optional<int> ndots;
- base::Optional<base::TimeDelta> timeout;
+ base::Optional<base::TimeDelta> fallback_period;
base::Optional<int> attempts;
base::Optional<int> doh_attempts;
base::Optional<bool> rotate;
diff --git a/chromium/net/dns/public/dns_protocol.h b/chromium/net/dns/public/dns_protocol.h
index c77dbaa7cd4..4c7bb939eba 100644
--- a/chromium/net/dns/public/dns_protocol.h
+++ b/chromium/net/dns/public/dns_protocol.h
@@ -114,6 +114,11 @@ static const uint16_t kMDnsClassMask = 0x7FFF;
// to 255 octets or less.
static const int kMaxNameLength = 255;
+// RFC 1035, section 2.3.4: labels 63 octets or less.
+// Section 3.1: Each label is represented as a one octet length field followed
+// by that number of octets.
+const int kMaxLabelLength = 63;
+
// RFC 1035, section 4.2.1: Messages carried by UDP are restricted to 512
// bytes (not counting the IP nor UDP headers).
static const int kMaxUDPSize = 512;
@@ -149,6 +154,7 @@ static const uint16_t kTypeAAAA = 28;
static const uint16_t kTypeSRV = 33;
static const uint16_t kTypeOPT = 41;
static const uint16_t kTypeNSEC = 47;
+static const uint16_t kTypeHttps = 65;
static const uint16_t kTypeANY = 255;
// Experimental DNS record types pending IANA assignment.
@@ -181,6 +187,17 @@ static const uint16_t kFlagAA = 0x400; // Authoritative Answer - response flag.
static const uint16_t kFlagRD = 0x100; // Recursion Desired - query flag.
static const uint16_t kFlagTC = 0x200; // Truncated - server flag.
+// SVCB/HTTPS ServiceParamKey
+//
+// IANA registration pending. Values from draft-ietf-dnsop-svcb-https-02.
+static constexpr uint16_t kHttpsServiceParamKeyMandatory = 0;
+static constexpr uint16_t kHttpsServiceParamKeyAlpn = 1;
+static constexpr uint16_t kHttpsServiceParamKeyNoDefaultAlpn = 2;
+static constexpr uint16_t kHttpsServiceParamKeyPort = 3;
+static constexpr uint16_t kHttpsServiceParamKeyIpv4Hint = 4;
+static constexpr uint16_t kHttpsServiceParamKeyEchConfig = 5;
+static constexpr uint16_t kHttpsServiceParamKeyIpv6Hint = 6;
+
} // namespace dns_protocol
} // namespace net
diff --git a/chromium/net/dns/public/dns_query_type.h b/chromium/net/dns/public/dns_query_type.h
index ecc61ea597d..11aa0b69fdc 100644
--- a/chromium/net/dns/public/dns_query_type.h
+++ b/chromium/net/dns/public/dns_query_type.h
@@ -21,14 +21,14 @@ enum class DnsQueryType {
PTR,
SRV,
INTEGRITY,
- MAX = INTEGRITY
+ HTTPS,
+ MAX = HTTPS
};
const DnsQueryType kDnsQueryTypes[] = {
- DnsQueryType::UNSPECIFIED, DnsQueryType::A, DnsQueryType::AAAA,
- DnsQueryType::TXT, DnsQueryType::PTR, DnsQueryType::SRV,
- DnsQueryType::INTEGRITY,
-};
+ DnsQueryType::UNSPECIFIED, DnsQueryType::A, DnsQueryType::AAAA,
+ DnsQueryType::TXT, DnsQueryType::PTR, DnsQueryType::SRV,
+ DnsQueryType::INTEGRITY, DnsQueryType::HTTPS};
static_assert(base::size(kDnsQueryTypes) ==
static_cast<unsigned>(DnsQueryType::MAX) + 1,
diff --git a/chromium/net/dns/record_parsed.cc b/chromium/net/dns/record_parsed.cc
index 23c2f2eb4bc..e523e7ed347 100644
--- a/chromium/net/dns/record_parsed.cc
+++ b/chromium/net/dns/record_parsed.cc
@@ -8,6 +8,7 @@
#include "base/logging.h"
#include "net/dns/dns_response.h"
+#include "net/dns/https_record_rdata.h"
#include "net/dns/record_rdata.h"
namespace net {
@@ -37,6 +38,7 @@ std::unique_ptr<const RecordParsed> RecordParsed::CreateFrom(
if (!parser->ReadRecord(&record))
return std::unique_ptr<const RecordParsed>();
+ bool unrecognized_type = false;
switch (record.type) {
case ARecordRdata::kType:
rdata = ARecordRdata::Create(record.rdata, *parser);
@@ -65,12 +67,19 @@ std::unique_ptr<const RecordParsed> RecordParsed::CreateFrom(
case IntegrityRecordRdata::kType:
rdata = IntegrityRecordRdata::Create(record.rdata);
break;
+ case HttpsRecordRdata::kType:
+ rdata = HttpsRecordRdata::Parse(record.rdata);
+ break;
default:
DVLOG(1) << "Unknown RData type for received record: " << record.type;
- return std::unique_ptr<const RecordParsed>();
+ rdata = nullptr;
+ unrecognized_type = true;
+ break;
}
- if (!rdata.get())
+ // If a recognized type has a malformed rdata, consider the whole record
+ // malformed.
+ if (!rdata.get() && !unrecognized_type)
return std::unique_ptr<const RecordParsed>();
return std::unique_ptr<const RecordParsed>(
@@ -88,10 +97,9 @@ bool RecordParsed::IsEqual(const RecordParsed* other, bool is_mdns) const {
other_klass &= dns_protocol::kMDnsClassMask;
}
- return name_ == other->name_ &&
- klass == other_klass &&
- type_ == other->type_ &&
- rdata_->IsEqual(other->rdata_.get());
+ return name_ == other->name_ && klass == other_klass &&
+ type_ == other->type_ && !!rdata_ == !!other->rdata_ &&
+ (!rdata_ || rdata_->IsEqual(other->rdata_.get()));
}
} // namespace net
diff --git a/chromium/net/dns/record_parsed.h b/chromium/net/dns/record_parsed.h
index 27d771dc47a..b8aceb32774 100644
--- a/chromium/net/dns/record_parsed.h
+++ b/chromium/net/dns/record_parsed.h
@@ -39,9 +39,16 @@ class NET_EXPORT_PRIVATE RecordParsed {
template <class T> const T* rdata() const {
if (T::kType != type_)
return nullptr;
+
+ // Expect RData should always be parsed for recognized types.
+ DCHECK(rdata_);
+
return static_cast<const T*>(rdata_.get());
}
+ // Gets the rdata without casting to a known RData type.
+ const RecordRdata* rdata_for_testing() const { return rdata_.get(); }
+
// Check if two records have the same data. Ignores time_created and ttl.
// If |is_mdns| is true, ignore the top bit of the class
// (the cache flush bit).
diff --git a/chromium/net/dns/record_parsed_unittest.cc b/chromium/net/dns/record_parsed_unittest.cc
index c60f18c0e0f..5694500219d 100644
--- a/chromium/net/dns/record_parsed_unittest.cc
+++ b/chromium/net/dns/record_parsed_unittest.cc
@@ -4,6 +4,9 @@
#include "net/dns/record_parsed.h"
+#include <memory>
+
+#include "base/time/time.h"
#include "net/dns/dns_response.h"
#include "net/dns/dns_test_util.h"
#include "net/dns/public/dns_protocol.h"
@@ -65,4 +68,108 @@ TEST(RecordParsedTest, CacheFlushBitCompare) {
EXPECT_TRUE(record2->IsEqual(record1.get(), true));
}
-} //namespace net
+TEST(RecordParsedTest, ParseUnknownRdata) {
+ static const char kRecordData[] =
+ // NAME="foo.test"
+ "\003foo\004test\000"
+ // TYPE=MD (an obsolete type that will likely never be recognized by
+ // Chrome)
+ "\000\003"
+ // CLASS=IN
+ "\000\001"
+ // TTL=30 seconds
+ "\000\000\000\036"
+ // RDLENGTH=12 bytes
+ "\000\014"
+ // RDATA="garbage data"
+ "garbage data";
+ DnsRecordParser parser(kRecordData, sizeof(kRecordData) - 1, 0 /* offset */);
+
+ std::unique_ptr<const RecordParsed> record =
+ RecordParsed::CreateFrom(&parser, base::Time());
+
+ ASSERT_TRUE(record);
+ EXPECT_EQ(record->name(), "foo.test");
+ EXPECT_EQ(record->type(), 3u);
+ EXPECT_EQ(record->klass(), dns_protocol::kClassIN);
+ EXPECT_EQ(record->ttl(), 30u);
+ EXPECT_FALSE(record->rdata<ARecordRdata>());
+ EXPECT_FALSE(record->rdata_for_testing());
+}
+
+TEST(RecordParsedTest, EqualityHandlesUnknownRdata) {
+ static constexpr char kData[] =
+ // NAME="foo.test"
+ "\003foo\004test\000"
+ // TYPE=MD (an obsolete type that will likely never be recognized by
+ // Chrome)
+ "\000\003"
+ // CLASS=IN
+ "\000\001"
+ // TTL=30 seconds
+ "\000\000\000\036"
+ // RDLENGTH=12 bytes
+ "\000\014"
+ // RDATA="garbage data"
+ "garbage data"
+ // NAME="foo.test"
+ "\003foo\004test\000"
+ // TYPE=A
+ "\000\001"
+ // CLASS=IN
+ "\000\001"
+ // TTL=30 seconds
+ "\000\000\000\036"
+ // RDLENGTH=4 bytes
+ "\000\004"
+ // RDATA=8.8.8.8
+ "\010\010\010\010";
+ DnsRecordParser parser(kData, sizeof(kData) - 1, 0 /* offset */);
+
+ std::unique_ptr<const RecordParsed> unknown_record =
+ RecordParsed::CreateFrom(&parser, base::Time());
+ ASSERT_TRUE(unknown_record);
+ ASSERT_FALSE(unknown_record->rdata_for_testing());
+
+ std::unique_ptr<const RecordParsed> known_record =
+ RecordParsed::CreateFrom(&parser, base::Time());
+ ASSERT_TRUE(known_record);
+ ASSERT_TRUE(known_record->rdata_for_testing());
+
+ EXPECT_TRUE(
+ unknown_record->IsEqual(unknown_record.get(), false /* is_mdns */));
+ EXPECT_TRUE(
+ unknown_record->IsEqual(unknown_record.get(), true /* is_mdns */));
+ EXPECT_TRUE(known_record->IsEqual(known_record.get(), false /* is_mdns */));
+ EXPECT_TRUE(known_record->IsEqual(known_record.get(), true /* is_mdns */));
+ EXPECT_FALSE(
+ unknown_record->IsEqual(known_record.get(), false /* is_mdns */));
+ EXPECT_FALSE(unknown_record->IsEqual(known_record.get(), true /* is_mdns */));
+ EXPECT_FALSE(
+ known_record->IsEqual(unknown_record.get(), false /* is_mdns */));
+ EXPECT_FALSE(known_record->IsEqual(unknown_record.get(), true /* is_mdns */));
+}
+
+TEST(RecordParsedTest, RejectMalformedRdata) {
+ static const char kRecordData[] =
+ // NAME="foo.test"
+ "\003foo\004test\000"
+ // TYPE=PTR
+ "\000\014"
+ // CLASS=IN
+ "\000\001"
+ // TTL=31 seconds
+ "\000\000\000\037"
+ // RDLENGTH=1 byte
+ "\000\001"
+ // RDATA=truncated name
+ "\001";
+ DnsRecordParser parser(kRecordData, sizeof(kRecordData) - 1, 0 /* offset */);
+
+ std::unique_ptr<const RecordParsed> record =
+ RecordParsed::CreateFrom(&parser, base::Time());
+
+ EXPECT_FALSE(record);
+}
+
+} // namespace net
diff --git a/chromium/net/dns/record_rdata.cc b/chromium/net/dns/record_rdata.cc
index 08d89d4fc15..0b3e53cce40 100644
--- a/chromium/net/dns/record_rdata.cc
+++ b/chromium/net/dns/record_rdata.cc
@@ -25,6 +25,9 @@ static const size_t kSrvRecordMinimumSize = 6;
static constexpr size_t kIntegrityMinimumSize =
sizeof(uint16_t) + IntegrityRecordRdata::kDigestLen;
+// Minimal HTTPS rdata is 2 octets priority + 1 octet empty name.
+static constexpr size_t kHttpsRdataMinimumSize = 3;
+
bool RecordRdata::HasValidSize(const base::StringPiece& data, uint16_t type) {
switch (type) {
case dns_protocol::kTypeSRV:
@@ -35,6 +38,8 @@ bool RecordRdata::HasValidSize(const base::StringPiece& data, uint16_t type) {
return data.size() == IPAddress::kIPv6AddressSize;
case dns_protocol::kExperimentalTypeIntegrity:
return data.size() >= kIntegrityMinimumSize;
+ case dns_protocol::kTypeHttps:
+ return data.size() >= kHttpsRdataMinimumSize;
case dns_protocol::kTypeCNAME:
case dns_protocol::kTypePTR:
case dns_protocol::kTypeTXT:
@@ -43,8 +48,8 @@ bool RecordRdata::HasValidSize(const base::StringPiece& data, uint16_t type) {
case dns_protocol::kTypeSOA:
return true;
default:
- VLOG(1) << "Unsupported RDATA type.";
- return false;
+ VLOG(1) << "Unrecognized RDATA type.";
+ return true;
}
}
diff --git a/chromium/net/dns/record_rdata.h b/chromium/net/dns/record_rdata.h
index d652eb7e7ab..04836d814f1 100644
--- a/chromium/net/dns/record_rdata.h
+++ b/chromium/net/dns/record_rdata.h
@@ -32,8 +32,9 @@ class NET_EXPORT RecordRdata {
public:
virtual ~RecordRdata() {}
- // Return true if |data| represents RDATA in the wire format with a valid size
- // for the give |type|.
+ // Return true if `data` represents RDATA in the wire format with a valid size
+ // for the give `type`. Always returns true for unrecognized `type`s as the
+ // size is never known to be invalid.
static bool HasValidSize(const base::StringPiece& data, uint16_t type);
virtual bool IsEqual(const RecordRdata* other) const = 0;
diff --git a/chromium/net/dns/resolve_context.cc b/chromium/net/dns/resolve_context.cc
index 1a2b7fb2d22..a0623d1d1fa 100644
--- a/chromium/net/dns/resolve_context.cc
+++ b/chromium/net/dns/resolve_context.cc
@@ -19,6 +19,7 @@
#include "base/no_destructor.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/stringprintf.h"
+#include "net/base/features.h"
#include "net/base/network_change_notifier.h"
#include "net/dns/dns_server_iterator.h"
#include "net/dns/dns_session.h"
@@ -29,34 +30,37 @@ namespace net {
namespace {
-// Set min timeout, in case we are talking to a local DNS proxy.
-const base::TimeDelta kMinTimeout = base::TimeDelta::FromMilliseconds(10);
+// Min fallback period between queries, in case we are talking to a local DNS
+// proxy.
+const base::TimeDelta kMinFallbackPeriod =
+ base::TimeDelta::FromMilliseconds(10);
-// Default maximum timeout between queries, even with exponential backoff.
-// (Can be overridden by field trial.)
-const base::TimeDelta kDefaultMaxTimeout = base::TimeDelta::FromSeconds(5);
+// Default maximum fallback period between queries, even with exponential
+// backoff. (Can be overridden by field trial.)
+const base::TimeDelta kDefaultMaxFallbackPeriod =
+ base::TimeDelta::FromSeconds(5);
// Maximum RTT that will fit in the RTT histograms.
const base::TimeDelta kRttMax = base::TimeDelta::FromSeconds(30);
// Number of buckets in the histogram of observed RTTs.
const size_t kRttBucketCount = 350;
-// Target percentile in the RTT histogram used for retransmission timeout.
+// Target percentile in the RTT histogram used for fallback period.
const int kRttPercentile = 99;
// Number of samples to seed the histogram with.
const base::HistogramBase::Count kNumSeeds = 2;
-base::TimeDelta GetDefaultTimeout(const DnsConfig& config) {
+base::TimeDelta GetDefaultFallbackPeriod(const DnsConfig& config) {
NetworkChangeNotifier::ConnectionType type =
NetworkChangeNotifier::GetConnectionType();
return GetTimeDeltaForConnectionTypeFromFieldTrialOrDefault(
- "AsyncDnsInitialTimeoutMsByConnectionType", config.timeout, type);
+ "AsyncDnsInitialTimeoutMsByConnectionType", config.fallback_period, type);
}
-base::TimeDelta GetMaxTimeout() {
+base::TimeDelta GetMaxFallbackPeriod() {
NetworkChangeNotifier::ConnectionType type =
NetworkChangeNotifier::GetConnectionType();
return GetTimeDeltaForConnectionTypeFromFieldTrialOrDefault(
- "AsyncDnsMaxTimeoutMsByConnectionType", kDefaultMaxTimeout, type);
+ "AsyncDnsMaxTimeoutMsByConnectionType", kDefaultMaxFallbackPeriod, type);
}
class RttBuckets : public base::BucketRanges {
@@ -79,7 +83,7 @@ static std::unique_ptr<base::SampleVector> GetRttHistogram(
base::TimeDelta rtt_estimate) {
std::unique_ptr<base::SampleVector> histogram =
std::make_unique<base::SampleVector>(GetRttBuckets());
- // Seed histogram with 2 samples at |rtt_estimate| timeout.
+ // Seed histogram with 2 samples at |rtt_estimate|.
histogram->Accumulate(base::checked_cast<base::HistogramBase::Sample>(
rtt_estimate.InMilliseconds()),
kNumSeeds);
@@ -101,7 +105,7 @@ ResolveContext::ResolveContext(URLRequestContext* url_request_context,
: url_request_context_(url_request_context),
host_cache_(enable_caching ? HostCache::CreateDefaultCache() : nullptr),
isolation_info_(IsolationInfo::CreateTransient()) {
- max_timeout_ = GetMaxTimeout();
+ max_fallback_period_ = GetMaxFallbackPeriod();
}
ResolveContext::~ResolveContext() = default;
@@ -219,8 +223,10 @@ void ResolveContext::RecordRtt(size_t server_index,
ServerStats* stats = GetServerStats(server_index, is_doh_server);
- base::TimeDelta base_timeout = NextTimeoutHelper(stats, 0 /* num_backoffs */);
- RecordRttForUma(server_index, is_doh_server, rtt, rv, base_timeout, session);
+ base::TimeDelta base_fallback_period =
+ NextFallbackPeriodHelper(stats, 0 /* num_backoffs */);
+ RecordRttForUma(server_index, is_doh_server, rtt, rv, base_fallback_period,
+ session);
// RTT values shouldn't be less than 0, but it shouldn't cause a crash if
// they are anyway, so clip to 0. See https://crbug.com/753568.
@@ -233,27 +239,61 @@ void ResolveContext::RecordRtt(size_t server_index,
1);
}
-base::TimeDelta ResolveContext::NextClassicTimeout(size_t classic_server_index,
- int attempt,
- const DnsSession* session) {
+base::TimeDelta ResolveContext::NextClassicFallbackPeriod(
+ size_t classic_server_index,
+ int attempt,
+ const DnsSession* session) {
if (!IsCurrentSession(session))
- return std::min(GetDefaultTimeout(session->config()), max_timeout_);
+ return std::min(GetDefaultFallbackPeriod(session->config()),
+ max_fallback_period_);
- return NextTimeoutHelper(
+ return NextFallbackPeriodHelper(
GetServerStats(classic_server_index, false /* is _doh_server */),
attempt / current_session_->config().nameservers.size());
}
-base::TimeDelta ResolveContext::NextDohTimeout(size_t doh_server_index,
- const DnsSession* session) {
+base::TimeDelta ResolveContext::NextDohFallbackPeriod(
+ size_t doh_server_index,
+ const DnsSession* session) {
if (!IsCurrentSession(session))
- return std::min(GetDefaultTimeout(session->config()), max_timeout_);
+ return std::min(GetDefaultFallbackPeriod(session->config()),
+ max_fallback_period_);
- return NextTimeoutHelper(
+ return NextFallbackPeriodHelper(
GetServerStats(doh_server_index, true /* is _doh_server */),
0 /* num_backoffs */);
}
+base::TimeDelta ResolveContext::ClassicTransactionTimeout(
+ const DnsSession* session) {
+ if (!IsCurrentSession(session))
+ return features::kDnsMinTransactionTimeout.Get();
+
+ // Should not need to call if there are no classic servers configured.
+ DCHECK(!classic_server_stats_.empty());
+
+ return TransactionTimeoutHelper(classic_server_stats_.cbegin(),
+ classic_server_stats_.cend());
+}
+
+base::TimeDelta ResolveContext::SecureTransactionTimeout(
+ SecureDnsMode secure_dns_mode,
+ const DnsSession* session) {
+ // Currently only implemented for Secure mode as other modes are assumed to
+ // always use aggressive timeouts. If that ever changes, need to implement
+ // only accounting for available DoH servers when not Secure mode.
+ DCHECK_EQ(secure_dns_mode, SecureDnsMode::kSecure);
+
+ if (!IsCurrentSession(session))
+ return features::kDnsMinTransactionTimeout.Get();
+
+ // Should not need to call if there are no DoH servers configured.
+ DCHECK(!doh_server_stats_.empty());
+
+ return TransactionTimeoutHelper(doh_server_stats_.cbegin(),
+ doh_server_stats_.cend());
+}
+
void ResolveContext::RegisterDohStatusObserver(DohStatusObserver* observer) {
DCHECK(observer);
doh_status_observers_.AddObserver(observer);
@@ -280,8 +320,8 @@ void ResolveContext::InvalidateCachesAndPerSessionData(
current_session_.reset();
classic_server_stats_.clear();
doh_server_stats_.clear();
- initial_timeout_ = base::TimeDelta();
- max_timeout_ = GetMaxTimeout();
+ initial_fallback_period_ = base::TimeDelta();
+ max_fallback_period_ = GetMaxFallbackPeriod();
if (!new_session) {
NotifyDohStatusObserversOfSessionChanged();
@@ -290,14 +330,16 @@ void ResolveContext::InvalidateCachesAndPerSessionData(
current_session_ = new_session->GetWeakPtr();
- initial_timeout_ = GetDefaultTimeout(current_session_->config());
+ initial_fallback_period_ =
+ GetDefaultFallbackPeriod(current_session_->config());
for (size_t i = 0; i < new_session->config().nameservers.size(); ++i) {
- classic_server_stats_.emplace_back(GetRttHistogram(initial_timeout_));
+ classic_server_stats_.emplace_back(
+ GetRttHistogram(initial_fallback_period_));
}
for (size_t i = 0; i < new_session->config().dns_over_https_servers.size();
++i) {
- doh_server_stats_.emplace_back(GetRttHistogram(initial_timeout_));
+ doh_server_stats_.emplace_back(GetRttHistogram(initial_fallback_period_));
}
CHECK_EQ(new_session->config().nameservers.size(),
@@ -353,11 +395,13 @@ ResolveContext::ServerStats* ResolveContext::GetServerStats(
}
}
-base::TimeDelta ResolveContext::NextTimeoutHelper(ServerStats* server_stats,
- int num_backoffs) {
- // Respect initial timeout (from config or field trial) if it exceeds max.
- if (initial_timeout_ > max_timeout_)
- return initial_timeout_;
+base::TimeDelta ResolveContext::NextFallbackPeriodHelper(
+ const ServerStats* server_stats,
+ int num_backoffs) {
+ // Respect initial fallback period (from config or field trial) if it exceeds
+ // max.
+ if (initial_fallback_period_ > max_fallback_period_)
+ return initial_fallback_period_;
static_assert(std::numeric_limits<base::HistogramBase::Count>::is_signed,
"histogram base count assumed to be signed");
@@ -373,19 +417,46 @@ base::TimeDelta ResolveContext::NextTimeoutHelper(ServerStats* server_stats,
++index;
}
- base::TimeDelta timeout =
+ base::TimeDelta fallback_period =
base::TimeDelta::FromMilliseconds(GetRttBuckets()->range(index));
- timeout = std::max(timeout, kMinTimeout);
+ fallback_period = std::max(fallback_period, kMinFallbackPeriod);
+
+ return std::min(fallback_period * (1 << num_backoffs), max_fallback_period_);
+}
+
+template <typename Iterator>
+base::TimeDelta ResolveContext::TransactionTimeoutHelper(
+ Iterator server_stats_begin,
+ Iterator server_stats_end) {
+ DCHECK_GE(features::kDnsMinTransactionTimeout.Get(), base::TimeDelta());
+ DCHECK_GE(features::kDnsTransactionTimeoutMultiplier.Get(), 0.0);
+
+ // Expect at least one configured server.
+ DCHECK(server_stats_begin != server_stats_end);
+
+ base::TimeDelta shortest_fallback_period = base::TimeDelta::Max();
+ for (Iterator server_stats = server_stats_begin;
+ server_stats != server_stats_end; ++server_stats) {
+ shortest_fallback_period = std::min(
+ shortest_fallback_period,
+ NextFallbackPeriodHelper(&*server_stats, 0 /* num_backoffs */));
+ }
+
+ DCHECK_GE(shortest_fallback_period, base::TimeDelta());
+ base::TimeDelta ratio_based_timeout =
+ shortest_fallback_period *
+ features::kDnsTransactionTimeoutMultiplier.Get();
- return std::min(timeout * (1 << num_backoffs), max_timeout_);
+ return std::max(features::kDnsMinTransactionTimeout.Get(),
+ ratio_based_timeout);
}
void ResolveContext::RecordRttForUma(size_t server_index,
bool is_doh_server,
base::TimeDelta rtt,
int rv,
- base::TimeDelta base_timeout,
+ base::TimeDelta base_fallback_period,
const DnsSession* session) {
DCHECK(IsCurrentSession(session));
@@ -403,15 +474,17 @@ void ResolveContext::RecordRttForUma(size_t server_index,
DCHECK(is_doh_server);
// Only for SecureValidated requests, record the ratio between successful
- // RTT and the base timeout for the server. Note that RTT could be much
- // longer than the timeout as previous attempts are often allowed to
- // continue in parallel with new attempts made by the transaction. Scale
- // the ratio up by 10 for sub-integer granularity.
- // TODO(crbug.com/1105138): Remove after determining good timeout logic.
- int timeout_ratio = base::ClampFloor(rtt / base_timeout * 10);
+ // RTT and the base fallback period for the server. Note that RTT could be
+ // much longer than the fallback period as previous attempts are often
+ // allowed to continue in parallel with new attempts made by the
+ // transaction. Scale the ratio up by 10 for sub-integer granularity.
+ // TODO(crbug.com/1105138): Remove after determining good fallback period
+ // logic.
+ int fallback_period_ratio =
+ base::ClampFloor(rtt / base_fallback_period * 10);
UMA_HISTOGRAM_COUNTS_1000(
"Net.DNS.DnsTransaction.SecureValidated.SuccessTimeoutRatio",
- timeout_ratio);
+ fallback_period_ratio);
}
} else {
base::UmaHistogramMediumTimes(
diff --git a/chromium/net/dns/resolve_context.h b/chromium/net/dns/resolve_context.h
index 1a96eff11cf..fc43188340e 100644
--- a/chromium/net/dns/resolve_context.h
+++ b/chromium/net/dns/resolve_context.h
@@ -90,12 +90,13 @@ class NET_EXPORT_PRIVATE ResolveContext : public base::CheckedObserver {
// session.
size_t NumAvailableDohServers(const DnsSession* session) const;
- // Record that server failed to respond (due to SRV_FAIL or timeout). If
- // |is_doh_server| and the number of failures has surpassed a threshold,
- // sets the DoH probe state to unavailable. Noop if |session| is not the
- // current session. Should only be called with with server failure |rv|s,
- // not eg OK, ERR_NAME_NOT_RESOLVED (which at the transaction level is
- // expected to be nxdomain), or ERR_IO_PENDING.
+ // Record failure to get a response from the server (e.g. SERVFAIL, connection
+ // failures, or that the server failed to respond before the fallback period
+ // elapsed. If |is_doh_server| and the number of failures has surpassed a
+ // threshold, sets the DoH probe state to unavailable. Noop if |session| is
+ // not the current session. Should only be called with with server failure
+ // |rv|s, not e.g. OK, ERR_NAME_NOT_RESOLVED (which at the transaction level
+ // is expected to be nxdomain), or ERR_IO_PENDING.
void RecordServerFailure(size_t server_index,
bool is_doh_server,
int rv,
@@ -115,15 +116,33 @@ class NET_EXPORT_PRIVATE ResolveContext : public base::CheckedObserver {
int rv,
const DnsSession* session);
- // Return the timeout for the next query. |attempt| counts from 0 and is used
- // for exponential backoff.
- base::TimeDelta NextClassicTimeout(size_t classic_server_index,
- int attempt,
- const DnsSession* session);
-
- // Return the timeout for the next DoH query.
- base::TimeDelta NextDohTimeout(size_t doh_server_index,
- const DnsSession* session);
+ // Return the period the next query should run before fallback to next
+ // attempt. (Not actually a "timeout" because queries are not typically
+ // cancelled as additional attempts are made.) |attempt| counts from 0 and is
+ // used for exponential backoff.
+ base::TimeDelta NextClassicFallbackPeriod(size_t classic_server_index,
+ int attempt,
+ const DnsSession* session);
+
+ // Return the period the next DoH query should run before fallback to next
+ // attempt.
+ base::TimeDelta NextDohFallbackPeriod(size_t doh_server_index,
+ const DnsSession* session);
+
+ // Return a timeout for an insecure transaction (from Transaction::Start()).
+ // Expected that the transaction will skip waiting for this timeout if it is
+ // using fast timeouts, and also expected that transactions will always wait
+ // for all attempts to run for at least their fallback period before dying
+ // with timeout.
+ base::TimeDelta ClassicTransactionTimeout(const DnsSession* session);
+
+ // Return a timeout for a secure transaction (from Transaction::Start()).
+ // Expected that the transaction will skip waiting for this timeout if it is
+ // using fast timeouts, and also expected that transactions will always wait
+ // for all attempts to run for at least their fallback period before dying
+ // with timeout.
+ base::TimeDelta SecureTransactionTimeout(SecureDnsMode secure_dns_mode,
+ const DnsSession* session);
void RegisterDohStatusObserver(DohStatusObserver* observer);
void UnregisterDohStatusObserver(const DohStatusObserver* observer);
@@ -175,7 +194,7 @@ class NET_EXPORT_PRIVATE ResolveContext : public base::CheckedObserver {
// current connection.
bool current_connection_success = false;
- // Last time when server returned failure or timeout.
+ // Last time when server returned failure or exceeded fallback period.
base::TimeTicks last_failure;
// Last time when server returned success.
base::TimeTicks last_success;
@@ -195,15 +214,20 @@ class NET_EXPORT_PRIVATE ResolveContext : public base::CheckedObserver {
// ServerStats found.
ServerStats* GetServerStats(size_t server_index, bool is_doh_server);
- // Return the timeout for the next query.
- base::TimeDelta NextTimeoutHelper(ServerStats* server_stats, int attempt);
+ // Return the fallback period for the next query.
+ base::TimeDelta NextFallbackPeriodHelper(const ServerStats* server_stats,
+ int attempt);
+
+ template <typename Iterator>
+ base::TimeDelta TransactionTimeoutHelper(Iterator server_stats_begin,
+ Iterator server_stats_end);
// Record the time to perform a query.
void RecordRttForUma(size_t server_index,
bool is_doh_server,
base::TimeDelta rtt,
int rv,
- base::TimeDelta base_timeout,
+ base::TimeDelta base_fallback_period,
const DnsSession* session);
std::string GetQueryTypeForUma(size_t server_index,
bool is_doh_server,
@@ -221,8 +245,8 @@ class NET_EXPORT_PRIVATE ResolveContext : public base::CheckedObserver {
std::unique_ptr<HostCache> host_cache_;
- // Current maximum server timeout. Updated on connection change.
- base::TimeDelta max_timeout_;
+ // Current maximum server fallback period. Updated on connection change.
+ base::TimeDelta max_fallback_period_;
base::ObserverList<DohStatusObserver,
true /* check_empty */,
@@ -241,7 +265,7 @@ class NET_EXPORT_PRIVATE ResolveContext : public base::CheckedObserver {
base::WeakPtr<const DnsSession> current_session_;
// Current index into |config_.nameservers| to begin resolution with.
int classic_server_index_ = 0;
- base::TimeDelta initial_timeout_;
+ base::TimeDelta initial_fallback_period_;
// Track runtime statistics of each classic (insecure) DNS server.
std::vector<ServerStats> classic_server_stats_;
// Track runtime statistics of each DoH server.
diff --git a/chromium/net/dns/resolve_context_unittest.cc b/chromium/net/dns/resolve_context_unittest.cc
index c246b342d13..7f6a6ebcf2a 100644
--- a/chromium/net/dns/resolve_context_unittest.cc
+++ b/chromium/net/dns/resolve_context_unittest.cc
@@ -15,6 +15,7 @@
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "net/base/address_list.h"
+#include "net/base/features.h"
#include "net/base/ip_address.h"
#include "net/base/ip_endpoint.h"
#include "net/base/mock_network_change_notifier.h"
@@ -867,8 +868,9 @@ TEST_F(ResolveContextTest, TwoDohFailures) {
EXPECT_EQ(doh_itr->GetNextAttemptIndex(), 2u);
}
-// Expect default calculated timeout to be within 10ms of |DnsConfig::timeout|.
-TEST_F(ResolveContextTest, Timeout_Default) {
+// Expect default calculated fallback period to be within 10ms of
+// |DnsConfig::fallback_period|.
+TEST_F(ResolveContextTest, FallbackPeriod_Default) {
ResolveContext context(nullptr /* url_request_context */,
false /* enable_caching */);
DnsConfig config =
@@ -878,58 +880,63 @@ TEST_F(ResolveContextTest, Timeout_Default) {
false /* network_change */);
base::TimeDelta delta =
- context.NextClassicTimeout(0 /* server_index */, 0 /* attempt */,
- session.get()) -
- config.timeout;
+ context.NextClassicFallbackPeriod(0 /* server_index */, 0 /* attempt */,
+ session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
- delta = context.NextDohTimeout(0 /* doh_server_index */, session.get()) -
- config.timeout;
+ delta =
+ context.NextDohFallbackPeriod(0 /* doh_server_index */, session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
}
-// Expect short calculated timeout to be within 10ms of |DnsConfig::timeout|.
-TEST_F(ResolveContextTest, Timeout_ShortConfigured) {
+// Expect short calculated fallback period to be within 10ms of
+// |DnsConfig::fallback_period|.
+TEST_F(ResolveContextTest, FallbackPeriod_ShortConfigured) {
ResolveContext context(nullptr /* url_request_context */,
false /* enable_caching */);
DnsConfig config =
CreateDnsConfig(2 /* num_servers */, 2 /* num_doh_servers */);
- config.timeout = base::TimeDelta::FromMilliseconds(15);
+ config.fallback_period = base::TimeDelta::FromMilliseconds(15);
scoped_refptr<DnsSession> session = CreateDnsSession(config);
context.InvalidateCachesAndPerSessionData(session.get(),
false /* network_change */);
base::TimeDelta delta =
- context.NextClassicTimeout(0 /* server_index */, 0 /* attempt */,
- session.get()) -
- config.timeout;
+ context.NextClassicFallbackPeriod(0 /* server_index */, 0 /* attempt */,
+ session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
- delta = context.NextDohTimeout(0 /* doh_server_index */, session.get()) -
- config.timeout;
+ delta =
+ context.NextDohFallbackPeriod(0 /* doh_server_index */, session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
}
-// Expect long calculated timeout to be equal to |DnsConfig::timeout|.
-// (Default max timeout is 5 seconds, so NextTimeout should return exactly
-// the config timeout.)
-TEST_F(ResolveContextTest, Timeout_LongConfigured) {
+// Expect long calculated fallback period to be equal to
+// |DnsConfig::fallback_period|. (Default max fallback period is 5 seconds, so
+// NextClassicFallbackPeriod() should return exactly the config fallback
+// period.)
+TEST_F(ResolveContextTest, FallbackPeriod_LongConfigured) {
ResolveContext context(nullptr /* url_request_context */,
false /* enable_caching */);
DnsConfig config =
CreateDnsConfig(2 /* num_servers */, 2 /* num_doh_servers */);
- config.timeout = base::TimeDelta::FromSeconds(15);
+ config.fallback_period = base::TimeDelta::FromSeconds(15);
scoped_refptr<DnsSession> session = CreateDnsSession(config);
context.InvalidateCachesAndPerSessionData(session.get(),
false /* network_change */);
- EXPECT_EQ(context.NextClassicTimeout(0 /* server_index */, 0 /* attempt */,
- session.get()),
- config.timeout);
- EXPECT_EQ(context.NextDohTimeout(0 /* doh_server_index */, session.get()),
- config.timeout);
+ EXPECT_EQ(context.NextClassicFallbackPeriod(0 /* server_index */,
+ 0 /* attempt */, session.get()),
+ config.fallback_period);
+ EXPECT_EQ(
+ context.NextDohFallbackPeriod(0 /* doh_server_index */, session.get()),
+ config.fallback_period);
}
-// Expect timeouts to increase on recording long round-trip times.
-TEST_F(ResolveContextTest, Timeout_LongRtt) {
+// Expect fallback periods to increase on recording long round-trip times.
+TEST_F(ResolveContextTest, FallbackPeriod_LongRtt) {
ResolveContext context(nullptr /* url_request_context */,
false /* enable_caching */);
DnsConfig config =
@@ -945,28 +952,31 @@ TEST_F(ResolveContextTest, Timeout_LongRtt) {
base::TimeDelta::FromMinutes(10), OK, session.get());
}
- // Expect servers with high recorded RTT to have increased timeouts (>10ms).
+ // Expect servers with high recorded RTT to have increased fallback periods
+ // (>10ms).
base::TimeDelta delta =
- context.NextClassicTimeout(0u /* server_index */, 0 /* attempt */,
- session.get()) -
- config.timeout;
+ context.NextClassicFallbackPeriod(0u /* server_index */, 0 /* attempt */,
+ session.get()) -
+ config.fallback_period;
EXPECT_GT(delta, base::TimeDelta::FromMilliseconds(10));
- delta = context.NextDohTimeout(1u, session.get()) - config.timeout;
+ delta =
+ context.NextDohFallbackPeriod(1u, session.get()) - config.fallback_period;
EXPECT_GT(delta, base::TimeDelta::FromMilliseconds(10));
// Servers without recorded RTT expected to remain the same (<=10ms).
- delta = context.NextClassicTimeout(1u /* server_index */, 0 /* attempt */,
- session.get()) -
- config.timeout;
+ delta = context.NextClassicFallbackPeriod(1u /* server_index */,
+ 0 /* attempt */, session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
- delta = context.NextDohTimeout(0u /* doh_server_index */, session.get()) -
- config.timeout;
+ delta =
+ context.NextDohFallbackPeriod(0u /* doh_server_index */, session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
}
-// Expect recording round-trip times to have no affect on timeout without a
-// current session.
-TEST_F(ResolveContextTest, Timeout_NoSession) {
+// Expect recording round-trip times to have no affect on fallback period
+// without a current session.
+TEST_F(ResolveContextTest, FallbackPeriod_NoSession) {
ResolveContext context(nullptr /* url_request_context */,
false /* enable_caching */);
DnsConfig config =
@@ -981,18 +991,19 @@ TEST_F(ResolveContextTest, Timeout_NoSession) {
}
base::TimeDelta delta =
- context.NextClassicTimeout(0u /* server_index */, 0 /* attempt */,
- session.get()) -
- config.timeout;
+ context.NextClassicFallbackPeriod(0u /* server_index */, 0 /* attempt */,
+ session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
- delta = context.NextDohTimeout(1u /* doh_server_index */, session.get()) -
- config.timeout;
+ delta =
+ context.NextDohFallbackPeriod(1u /* doh_server_index */, session.get()) -
+ config.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
}
-// Expect recording round-trip times to have no affect on timeout without a
-// current session.
-TEST_F(ResolveContextTest, Timeout_DifferentSession) {
+// Expect recording round-trip times to have no affect on fallback periods
+// without a current session.
+TEST_F(ResolveContextTest, FallbackPeriod_DifferentSession) {
DnsConfig config1 =
CreateDnsConfig(1 /* num_servers */, 3 /* num_doh_servers */);
scoped_refptr<DnsSession> session1 = CreateDnsSession(config1);
@@ -1006,7 +1017,7 @@ TEST_F(ResolveContextTest, Timeout_DifferentSession) {
context.InvalidateCachesAndPerSessionData(session2.get(),
true /* network_change */);
- // Record RTT's to increase timeouts for current session.
+ // Record RTT's to increase fallback periods for current session.
for (int i = 0; i < 50; ++i) {
context.RecordRtt(0u /* server_index */, false /* is_doh_server */,
base::TimeDelta::FromMinutes(10), OK, session2.get());
@@ -1014,27 +1025,225 @@ TEST_F(ResolveContextTest, Timeout_DifferentSession) {
base::TimeDelta::FromMinutes(10), OK, session2.get());
}
- // Expect normal short timeouts for other session.
+ // Expect normal short fallback periods for other session.
base::TimeDelta delta =
- context.NextClassicTimeout(0u /* server_index */, 0 /* attempt */,
- session1.get()) -
- config1.timeout;
+ context.NextClassicFallbackPeriod(0u /* server_index */, 0 /* attempt */,
+ session1.get()) -
+ config1.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
- delta = context.NextDohTimeout(0u /* doh_server_index */, session1.get()) -
- config1.timeout;
+ delta =
+ context.NextDohFallbackPeriod(0u /* doh_server_index */, session1.get()) -
+ config1.fallback_period;
EXPECT_LE(delta, base::TimeDelta::FromMilliseconds(10));
// Recording RTT's for other session should have no effect on current session
- // timeouts.
- base::TimeDelta timeout = context.NextClassicTimeout(
+ // fallback periods.
+ base::TimeDelta fallback_period = context.NextClassicFallbackPeriod(
0u /* server_index */, 0 /* attempt */, session2.get());
for (int i = 0; i < 50; ++i) {
context.RecordRtt(0u /* server_index */, false /* is_doh_server */,
base::TimeDelta::FromMilliseconds(1), OK, session1.get());
}
- EXPECT_EQ(timeout,
- context.NextClassicTimeout(0u /* server_index */, 0 /* attempt */,
- session2.get()));
+ EXPECT_EQ(fallback_period,
+ context.NextClassicFallbackPeriod(0u /* server_index */,
+ 0 /* attempt */, session2.get()));
+}
+
+// Expect minimum timeout will be used when fallback period is small.
+TEST_F(ResolveContextTest, SecureTransactionTimeout_SmallFallbackPeriod) {
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ DnsConfig config =
+ CreateDnsConfig(0 /* num_servers */, 1 /* num_doh_servers */);
+ config.fallback_period = base::TimeDelta();
+ scoped_refptr<DnsSession> session = CreateDnsSession(config);
+ context.InvalidateCachesAndPerSessionData(session.get(),
+ false /* network_change */);
+
+ EXPECT_EQ(
+ context.SecureTransactionTimeout(SecureDnsMode::kSecure, session.get()),
+ features::kDnsMinTransactionTimeout.Get());
+}
+
+// Expect multiplier on fallback period to be used when larger than minimum
+// timeout.
+TEST_F(ResolveContextTest, SecureTransactionTimeout_LongFallbackPeriod) {
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ const base::TimeDelta kFallbackPeriod = base::TimeDelta::FromMinutes(5);
+ DnsConfig config =
+ CreateDnsConfig(0 /* num_servers */, 1 /* num_doh_servers */);
+ config.fallback_period = kFallbackPeriod;
+ scoped_refptr<DnsSession> session = CreateDnsSession(config);
+ context.InvalidateCachesAndPerSessionData(session.get(),
+ false /* network_change */);
+
+ base::TimeDelta expected =
+ kFallbackPeriod * features::kDnsTransactionTimeoutMultiplier.Get();
+ ASSERT_GT(expected, features::kDnsMinTransactionTimeout.Get());
+
+ EXPECT_EQ(
+ context.SecureTransactionTimeout(SecureDnsMode::kSecure, session.get()),
+ expected);
+}
+
+TEST_F(ResolveContextTest, SecureTransactionTimeout_LongRtt) {
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ DnsConfig config =
+ CreateDnsConfig(0 /* num_servers */, 2 /* num_doh_servers */);
+ config.fallback_period = base::TimeDelta();
+ scoped_refptr<DnsSession> session = CreateDnsSession(config);
+ context.InvalidateCachesAndPerSessionData(session.get(),
+ false /* network_change */);
+
+ // Record long RTTs for only 1 server.
+ for (int i = 0; i < 50; ++i) {
+ context.RecordRtt(1u /* server_index */, true /* is_doh_server */,
+ base::TimeDelta::FromMinutes(10), OK, session.get());
+ }
+
+ // No expected change from recording RTT to single server because lowest
+ // fallback period is used.
+ EXPECT_EQ(
+ context.SecureTransactionTimeout(SecureDnsMode::kSecure, session.get()),
+ features::kDnsMinTransactionTimeout.Get());
+
+ // Record long RTTs for remaining server.
+ for (int i = 0; i < 50; ++i) {
+ context.RecordRtt(0u /* server_index */, true /* is_doh_server */,
+ base::TimeDelta::FromMinutes(10), OK, session.get());
+ }
+
+ // Expect longer timeouts.
+ EXPECT_GT(
+ context.SecureTransactionTimeout(SecureDnsMode::kSecure, session.get()),
+ features::kDnsMinTransactionTimeout.Get());
+}
+
+TEST_F(ResolveContextTest, SecureTransactionTimeout_DifferentSession) {
+ const base::TimeDelta kFallbackPeriod = base::TimeDelta::FromMinutes(5);
+ DnsConfig config1 =
+ CreateDnsConfig(0 /* num_servers */, 1 /* num_doh_servers */);
+ config1.fallback_period = kFallbackPeriod;
+ scoped_refptr<DnsSession> session1 = CreateDnsSession(config1);
+
+ DnsConfig config2 =
+ CreateDnsConfig(2 /* num_servers */, 2 /* num_doh_servers */);
+ scoped_refptr<DnsSession> session2 = CreateDnsSession(config2);
+
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ context.InvalidateCachesAndPerSessionData(session1.get(),
+ true /* network_change */);
+
+ // Confirm that if session data were used, the timeout would be higher than
+ // the min.
+ base::TimeDelta multiplier_expected =
+ kFallbackPeriod * features::kDnsTransactionTimeoutMultiplier.Get();
+ ASSERT_GT(multiplier_expected, features::kDnsMinTransactionTimeout.Get());
+
+ // Expect timeout always minimum with wrong session.
+ EXPECT_EQ(
+ context.SecureTransactionTimeout(SecureDnsMode::kSecure, session2.get()),
+ features::kDnsMinTransactionTimeout.Get());
+}
+
+// Expect minimum timeout will be used when fallback period is small.
+TEST_F(ResolveContextTest, ClassicTransactionTimeout_SmallFallbackPeriod) {
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ DnsConfig config =
+ CreateDnsConfig(1 /* num_servers */, 0 /* num_doh_servers */);
+ config.fallback_period = base::TimeDelta();
+ scoped_refptr<DnsSession> session = CreateDnsSession(config);
+ context.InvalidateCachesAndPerSessionData(session.get(),
+ false /* network_change */);
+
+ EXPECT_EQ(context.ClassicTransactionTimeout(session.get()),
+ features::kDnsMinTransactionTimeout.Get());
+}
+
+// Expect multiplier on fallback period to be used when larger than minimum
+// timeout.
+TEST_F(ResolveContextTest, ClassicTransactionTimeout_LongFallbackPeriod) {
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ const base::TimeDelta kFallbackPeriod = base::TimeDelta::FromMinutes(5);
+ DnsConfig config =
+ CreateDnsConfig(1 /* num_servers */, 0 /* num_doh_servers */);
+ config.fallback_period = kFallbackPeriod;
+ scoped_refptr<DnsSession> session = CreateDnsSession(config);
+ context.InvalidateCachesAndPerSessionData(session.get(),
+ false /* network_change */);
+
+ base::TimeDelta expected =
+ kFallbackPeriod * features::kDnsTransactionTimeoutMultiplier.Get();
+ ASSERT_GT(expected, features::kDnsMinTransactionTimeout.Get());
+
+ EXPECT_EQ(context.ClassicTransactionTimeout(session.get()), expected);
+}
+
+TEST_F(ResolveContextTest, ClassicTransactionTimeout_LongRtt) {
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ DnsConfig config =
+ CreateDnsConfig(2 /* num_servers */, 0 /* num_doh_servers */);
+ config.fallback_period = base::TimeDelta();
+ scoped_refptr<DnsSession> session = CreateDnsSession(config);
+ context.InvalidateCachesAndPerSessionData(session.get(),
+ false /* network_change */);
+
+ // Record long RTTs for only 1 server.
+ for (int i = 0; i < 50; ++i) {
+ context.RecordRtt(1u /* server_index */, false /* is_doh_server */,
+ base::TimeDelta::FromMinutes(10), OK, session.get());
+ }
+
+ // No expected change from recording RTT to single server because lowest
+ // fallback period is used.
+ EXPECT_EQ(context.ClassicTransactionTimeout(session.get()),
+ features::kDnsMinTransactionTimeout.Get());
+
+ // Record long RTTs for remaining server.
+ for (int i = 0; i < 50; ++i) {
+ context.RecordRtt(0u /* server_index */, false /* is_doh_server */,
+ base::TimeDelta::FromMinutes(10), OK, session.get());
+ }
+
+ // Expect longer timeouts.
+ EXPECT_GT(context.ClassicTransactionTimeout(session.get()),
+ features::kDnsMinTransactionTimeout.Get());
+}
+
+TEST_F(ResolveContextTest, ClassicTransactionTimeout_DifferentSession) {
+ const base::TimeDelta kFallbackPeriod = base::TimeDelta::FromMinutes(5);
+ DnsConfig config1 =
+ CreateDnsConfig(1 /* num_servers */, 0 /* num_doh_servers */);
+ config1.fallback_period = kFallbackPeriod;
+ scoped_refptr<DnsSession> session1 = CreateDnsSession(config1);
+
+ DnsConfig config2 =
+ CreateDnsConfig(2 /* num_servers */, 2 /* num_doh_servers */);
+ scoped_refptr<DnsSession> session2 = CreateDnsSession(config2);
+
+ ResolveContext context(nullptr /* url_request_context */,
+ false /* enable_caching */);
+ context.InvalidateCachesAndPerSessionData(session1.get(),
+ true /* network_change */);
+
+ // Confirm that if session data were used, the timeout would be higher than
+ // the min. If timeout defaults are ever changed to break this assertion, then
+ // the expected wrong-session timeout could be the same as an actual
+ // from-session timeout, making this test seem to pass even if the behavior
+ // under test were broken.
+ base::TimeDelta multiplier_expected =
+ kFallbackPeriod * features::kDnsTransactionTimeoutMultiplier.Get();
+ ASSERT_GT(multiplier_expected, features::kDnsMinTransactionTimeout.Get());
+
+ // Expect timeout always minimum with wrong session.
+ EXPECT_EQ(context.ClassicTransactionTimeout(session2.get()),
+ features::kDnsMinTransactionTimeout.Get());
}
// Ensures that reported negative RTT values don't cause a crash. Regression
diff --git a/chromium/net/docs/proxy.md b/chromium/net/docs/proxy.md
index 0f844f07fc0..c7fff9a2234 100644
--- a/chromium/net/docs/proxy.md
+++ b/chromium/net/docs/proxy.md
@@ -469,7 +469,7 @@ implicitly](#Implicit-bypass-rules).
*Subtracts* the [implicit proxy bypass rules](#Implicit-bypass-rules)
(localhost and link local addresses). This is generally only needed for test
-setupe. Beware of the security implications to proxying localhost.
+setups. Beware of the security implications to proxying localhost.
Whereas regular bypass rules instruct the browser about URLs that should *not*
use the proxy, this rule has the opposite effect and tells the browser to
diff --git a/chromium/net/extras/sqlite/sqlite_persistent_cookie_store.cc b/chromium/net/extras/sqlite/sqlite_persistent_cookie_store.cc
index 474db6ecaa0..8217869e61e 100644
--- a/chromium/net/extras/sqlite/sqlite_persistent_cookie_store.cc
+++ b/chromium/net/extras/sqlite/sqlite_persistent_cookie_store.cc
@@ -19,6 +19,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/optional.h"
#include "base/sequenced_task_runner.h"
@@ -41,6 +42,7 @@
#include "sql/statement.h"
#include "sql/transaction.h"
#include "url/gurl.h"
+#include "url/third_party/mozilla/url_parse.h"
using base::Time;
@@ -104,6 +106,10 @@ const int kLoadDelayMilliseconds = 0;
const int kLoadDelayMilliseconds = 0;
#endif
+// Port number to use for cookies whose source port is unknown at the time of
+// database migration to V13. The value -1 comes from url::PORT_UNSPECIFIED.
+const int kDefaultUnknownPort = -1;
+
// A little helper to help us log (on client thread) if the background runner
// gets stuck.
class TimeoutTracker : public base::RefCountedThreadSafe<TimeoutTracker> {
@@ -148,6 +154,7 @@ namespace {
// Version number of the database.
//
+// Version 13 - 2020/10/28 - https://crrev.com/c/2505468
// Version 12 - 2019/11/20 - https://crrev.com/c/1898301
// Version 11 - 2019/04/17 - https://crrev.com/c/1570416
// Version 10 - 2018/02/13 - https://crrev.com/c/906675
@@ -160,6 +167,12 @@ namespace {
// Version 5 - 2011/12/05 - https://codereview.chromium.org/8533013
// Version 4 - 2009/09/01 - https://codereview.chromium.org/183021
//
+// Version 13 adds two new fields: "source_port" (the port number of the source
+// origin, and "same_party" (boolean indicating whether the cookie had a
+// SameParty attribute). In migrating, source_port defaults to -1
+// (url::PORT_UNSPECIFIED) for old entries for which the source port is unknown,
+// and same_party defaults to false.
+//
// Version 12 adds a column for "source_scheme" to store whether the
// cookie was set from a URL with a cryptographic scheme.
//
@@ -211,8 +224,8 @@ namespace {
// Version 3 updated the database to include the last access time, so we can
// expire them in decreasing order of use when we've reached the maximum
// number of cookies.
-const int kCurrentVersionNumber = 12;
-const int kCompatibleVersionNumber = 12;
+const int kCurrentVersionNumber = 13;
+const int kCompatibleVersionNumber = 13;
} // namespace
@@ -608,7 +621,7 @@ bool CreateV11Schema(sql::Database* db) {
// Initializes the cookies table, returning true on success.
// The table cannot exist when calling this function.
-bool CreateV12Schema(sql::Database* db) {
+bool CreateV13Schema(sql::Database* db) {
DCHECK(!db->DoesTableExist("cookies"));
std::string stmt(base::StringPrintf(
@@ -628,10 +641,12 @@ bool CreateV12Schema(sql::Database* db) {
"encrypted_value BLOB DEFAULT '',"
"samesite INTEGER NOT NULL DEFAULT %d,"
"source_scheme INTEGER NOT NULL DEFAULT %d,"
+ "source_port INTEGER NOT NULL DEFAULT %d,"
+ "is_same_party INTEGER NOT NULL DEFAULT 0,"
"UNIQUE (host_key, name, path))",
CookiePriorityToDBCookiePriority(COOKIE_PRIORITY_DEFAULT),
CookieSameSiteToDBCookieSameSite(CookieSameSite::UNSPECIFIED),
- static_cast<int>(CookieSourceScheme::kUnset)));
+ static_cast<int>(CookieSourceScheme::kUnset), kDefaultUnknownPort));
if (!db->Execute(stmt.c_str()))
return false;
@@ -791,7 +806,7 @@ bool SQLitePersistentCookieStore::Backend::CreateDatabaseSchema() {
if (db()->DoesTableExist("cookies"))
return true;
- return CreateV12Schema(db());
+ return CreateV13Schema(db());
}
bool SQLitePersistentCookieStore::Backend::DoInitializeDatabase() {
@@ -871,14 +886,15 @@ bool SQLitePersistentCookieStore::Backend::LoadCookiesForDomains(
"SELECT creation_utc, host_key, name, value, encrypted_value, path, "
"expires_utc, is_secure, is_httponly, samesite, "
"last_access_utc, has_expires, is_persistent, priority, "
- "source_scheme "
+ "source_scheme, source_port, is_same_party "
"FROM cookies WHERE host_key = ?"));
} else {
smt.Assign(db()->GetCachedStatement(
SQL_FROM_HERE,
"SELECT creation_utc, host_key, name, value, encrypted_value, path, "
"expires_utc, is_secure, is_httponly, samesite, last_access_utc, "
- "has_expires, is_persistent, priority, source_scheme "
+ "has_expires, is_persistent, priority, source_scheme, source_port, "
+ "is_same_party "
"FROM cookies WHERE host_key = ? AND is_persistent = 1"));
}
del_smt.Assign(db()->GetCachedStatement(
@@ -944,7 +960,8 @@ bool SQLitePersistentCookieStore::Backend::MakeCookiesFromSQLStatement(
} else {
value = smt.ColumnString(3);
}
- std::unique_ptr<CanonicalCookie> cc(std::make_unique<CanonicalCookie>(
+ // Returns nullptr if the resulting cookie is not canonical.
+ std::unique_ptr<net::CanonicalCookie> cc = CanonicalCookie::FromStorage(
smt.ColumnString(2), // name
value, // value
smt.ColumnString(1), // domain
@@ -958,10 +975,12 @@ bool SQLitePersistentCookieStore::Backend::MakeCookiesFromSQLStatement(
static_cast<DBCookieSameSite>(smt.ColumnInt(9))), // samesite
DBCookiePriorityToCookiePriority(
static_cast<DBCookiePriority>(smt.ColumnInt(13))), // priority
- DBToCookieSourceScheme(smt.ColumnInt(14)))); // source_scheme
- DLOG_IF(WARNING, cc->CreationDate() > Time::Now())
- << L"CreationDate too recent";
- if (cc->IsCanonical()) {
+ smt.ColumnBool(16), // is_same_party
+ DBToCookieSourceScheme(smt.ColumnInt(14)), // source_scheme
+ smt.ColumnInt(15)); // source_port
+ if (cc) {
+ DLOG_IF(WARNING, cc->CreationDate() > Time::Now())
+ << L"CreationDate too recent";
cookies->push_back(std::move(cc));
} else {
RecordCookieLoadProblem(COOKIE_LOAD_PROBLEM_NON_CANONICAL);
@@ -1018,12 +1037,11 @@ SQLitePersistentCookieStore::Backend::DoMigrateDatabaseSchema() {
meta_table()->SetCompatibleVersionNumber(
std::min(cur_version, kCompatibleVersionNumber));
transaction.Commit();
- UMA_HISTOGRAM_TIMES("Cookie.TimeDatabaseMigrationToV10",
- base::TimeTicks::Now() - start_time);
+ base::UmaHistogramTimes("Cookie.TimeDatabaseMigrationToV10",
+ base::TimeTicks::Now() - start_time);
}
if (cur_version == 10) {
- SCOPED_UMA_HISTOGRAM_TIMER("Cookie.TimeDatabaseMigrationToV11");
sql::Transaction transaction(db());
if (!transaction.Begin())
return base::nullopt;
@@ -1085,6 +1103,41 @@ SQLitePersistentCookieStore::Backend::DoMigrateDatabaseSchema() {
transaction.Commit();
}
+ if (cur_version == 12) {
+ const char kMigrationSuccessHistogram[] =
+ "Cookie.TimeDatabaseMigrationToV13Success";
+ const char kMigrationFailureHistogram[] =
+ "Cookie.TimeDatabaseMigrationToV13Failure";
+ const base::TimeTicks start_time = base::TimeTicks::Now();
+
+ sql::Transaction transaction(db());
+ if (!transaction.Begin()) {
+ base::UmaHistogramTimes(kMigrationFailureHistogram,
+ base::TimeTicks::Now() - start_time);
+ return base::nullopt;
+ }
+
+ std::string update_stmt(
+ base::StringPrintf("ALTER TABLE cookies ADD COLUMN source_port "
+ "INTEGER NOT NULL DEFAULT %d;"
+ "ALTER TABLE cookies ADD COLUMN is_same_party "
+ "INTEGER NOT NULL DEFAULT 0;",
+ kDefaultUnknownPort));
+ if (!db()->Execute(update_stmt.c_str())) {
+ base::UmaHistogramTimes(kMigrationFailureHistogram,
+ base::TimeTicks::Now() - start_time);
+ return base::nullopt;
+ }
+
+ ++cur_version;
+ meta_table()->SetVersionNumber(cur_version);
+ meta_table()->SetCompatibleVersionNumber(
+ std::min(cur_version, kCompatibleVersionNumber));
+ transaction.Commit();
+ base::UmaHistogramTimes(kMigrationSuccessHistogram,
+ base::TimeTicks::Now() - start_time);
+ }
+
// Put future migration cases here.
return base::make_optional(cur_version);
@@ -1188,8 +1241,8 @@ void SQLitePersistentCookieStore::Backend::DoCommit() {
"INSERT INTO cookies (creation_utc, host_key, name, value, "
"encrypted_value, path, expires_utc, is_secure, is_httponly, "
"samesite, last_access_utc, has_expires, is_persistent, priority,"
- "source_scheme) "
- "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"));
+ "source_scheme, source_port, is_same_party) "
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"));
if (!add_smt.is_valid())
return;
@@ -1238,16 +1291,18 @@ void SQLitePersistentCookieStore::Backend::DoCommit() {
}
add_smt.BindString(5, po->cc().Path());
add_smt.BindInt64(6, po->cc().ExpiryDate().ToInternalValue());
- add_smt.BindInt(7, po->cc().IsSecure());
- add_smt.BindInt(8, po->cc().IsHttpOnly());
+ add_smt.BindBool(7, po->cc().IsSecure());
+ add_smt.BindBool(8, po->cc().IsHttpOnly());
add_smt.BindInt(
9, CookieSameSiteToDBCookieSameSite(po->cc().SameSite()));
add_smt.BindInt64(10, po->cc().LastAccessDate().ToInternalValue());
- add_smt.BindInt(11, po->cc().IsPersistent());
- add_smt.BindInt(12, po->cc().IsPersistent());
+ add_smt.BindBool(11, po->cc().IsPersistent());
+ add_smt.BindBool(12, po->cc().IsPersistent());
add_smt.BindInt(
13, CookiePriorityToDBCookiePriority(po->cc().Priority()));
add_smt.BindInt(14, static_cast<int>(po->cc().SourceScheme()));
+ add_smt.BindInt(15, po->cc().SourcePort());
+ add_smt.BindBool(16, po->cc().IsSameParty());
if (!add_smt.Run()) {
DLOG(WARNING) << "Could not add a cookie to the DB.";
RecordCookieCommitProblem(COOKIE_COMMIT_PROBLEM_ADD);
diff --git a/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_perftest.cc b/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_perftest.cc
index 443a8010857..47dce8a51ef 100644
--- a/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_perftest.cc
+++ b/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_perftest.cc
@@ -90,7 +90,7 @@ class SQLitePersistentCookieStorePerfTest : public testing::Test {
return CanonicalCookie(base::StringPrintf("Cookie_%d", cookie_num), "1",
domain_name, "/", t, t, t, false, false,
CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT);
+ COOKIE_PRIORITY_DEFAULT, false);
}
void SetUp() override {
diff --git a/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc b/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
index 914188560b7..405821aabd3 100644
--- a/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
+++ b/chromium/net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc
@@ -22,7 +22,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
@@ -44,6 +44,7 @@
#include "sql/transaction.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
+#include "url/third_party/mozilla/url_parse.h"
namespace net {
@@ -180,7 +181,7 @@ class SQLitePersistentCookieStoreTest : public TestWithTaskEnvironment {
const base::Time& creation) {
store_->AddCookie(CanonicalCookie(
name, value, domain, path, creation, creation, base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
}
void AddCookieWithExpiration(const std::string& name,
@@ -191,7 +192,7 @@ class SQLitePersistentCookieStoreTest : public TestWithTaskEnvironment {
const base::Time& expiration) {
store_->AddCookie(CanonicalCookie(
name, value, domain, path, creation, expiration, base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
}
std::string ReadRawDBContents() {
@@ -527,10 +528,10 @@ TEST_F(SQLitePersistentCookieStoreTest, TestLoadOldSessionCookies) {
InitializeStore(false, true);
// Add a session cookie.
- store_->AddCookie(
- CanonicalCookie("C", "D", "sessioncookie.com", "/", base::Time::Now(),
- base::Time(), base::Time(), false, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ store_->AddCookie(CanonicalCookie(
+ "C", "D", "sessioncookie.com", "/", base::Time::Now(), base::Time(),
+ base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false));
// Force the store to write its data to the disk.
DestroyStore();
@@ -554,10 +555,10 @@ TEST_F(SQLitePersistentCookieStoreTest, TestDontLoadOldSessionCookies) {
InitializeStore(false, true);
// Add a session cookie.
- store_->AddCookie(
- CanonicalCookie("C", "D", "sessioncookie.com", "/", base::Time::Now(),
- base::Time(), base::Time(), false, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ store_->AddCookie(CanonicalCookie(
+ "C", "D", "sessioncookie.com", "/", base::Time::Now(), base::Time(),
+ base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false));
// Force the store to write its data to the disk.
DestroyStore();
@@ -660,13 +661,13 @@ TEST_F(SQLitePersistentCookieStoreTest, PersistIsPersistent) {
store_->AddCookie(CanonicalCookie(
kSessionName, "val", "sessioncookie.com", "/", base::Time::Now(),
base::Time(), base::Time(), false, false, CookieSameSite::NO_RESTRICTION,
- COOKIE_PRIORITY_DEFAULT));
+ COOKIE_PRIORITY_DEFAULT, false));
// Add a persistent cookie.
store_->AddCookie(CanonicalCookie(
kPersistentName, "val", "sessioncookie.com", "/",
base::Time::Now() - base::TimeDelta::FromDays(1),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
// Force the store to write its data to the disk.
DestroyStore();
@@ -707,21 +708,21 @@ TEST_F(SQLitePersistentCookieStoreTest, PriorityIsPersistent) {
kLowName, kCookieValue, kDomain, kCookiePath,
base::Time::Now() - base::TimeDelta::FromMinutes(1),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW));
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_LOW, false));
// Add a medium-priority persistent cookie.
store_->AddCookie(CanonicalCookie(
kMediumName, kCookieValue, kDomain, kCookiePath,
base::Time::Now() - base::TimeDelta::FromMinutes(2),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_MEDIUM));
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_MEDIUM, false));
// Add a high-priority peristent cookie.
store_->AddCookie(CanonicalCookie(
kHighName, kCookieValue, kDomain, kCookiePath,
base::Time::Now() - base::TimeDelta::FromMinutes(3),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_HIGH));
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_HIGH, false));
// Force the store to write its data to the disk.
DestroyStore();
@@ -768,21 +769,21 @@ TEST_F(SQLitePersistentCookieStoreTest, SameSiteIsPersistent) {
kNoneName, kCookieValue, kDomain, kCookiePath,
base::Time::Now() - base::TimeDelta::FromMinutes(1),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
// Add a lax-samesite persistent cookie.
store_->AddCookie(CanonicalCookie(
kLaxName, kCookieValue, kDomain, kCookiePath,
base::Time::Now() - base::TimeDelta::FromMinutes(2),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT));
+ false, CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT, false));
// Add a strict-samesite persistent cookie.
store_->AddCookie(CanonicalCookie(
kStrictName, kCookieValue, kDomain, kCookiePath,
base::Time::Now() - base::TimeDelta::FromMinutes(3),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT));
+ false, CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false));
// Force the store to write its data to the disk.
DestroyStore();
@@ -824,7 +825,7 @@ TEST_F(SQLitePersistentCookieStoreTest, SameSiteExtendedTreatedAsUnspecified) {
kExtendedName, kCookieValue, kDomain, kCookiePath,
base::Time::Now() - base::TimeDelta::FromMinutes(1),
base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(), false,
- false, CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT));
+ false, CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false));
// Force the store to write its data to the disk.
DestroyStore();
@@ -850,6 +851,105 @@ TEST_F(SQLitePersistentCookieStoreTest, SameSiteExtendedTreatedAsUnspecified) {
EXPECT_EQ(CookieSameSite::UNSPECIFIED, cookies[0]->SameSite());
}
+TEST_F(SQLitePersistentCookieStoreTest, SamePartyIsPersistent) {
+ const char kDomain[] = "sessioncookie.com";
+ const char kNonSamePartyCookieName[] = "no_party";
+ const char kSamePartyCookieName[] = "party";
+ const char kCookieValue[] = "value";
+ const char kCookiePath[] = "/";
+
+ InitializeStore(false, true);
+
+ // Add a non-SameParty persistent cookie.
+ store_->AddCookie(CanonicalCookie(
+ kNonSamePartyCookieName, kCookieValue, kDomain, kCookiePath,
+ base::Time::Now() - base::TimeDelta::FromMinutes(1),
+ base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(),
+ /*secure=*/true, false, CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT,
+ /*same_party=*/false));
+
+ // Add a SameParty persistent cookie.
+ store_->AddCookie(CanonicalCookie(
+ kSamePartyCookieName, kCookieValue, kDomain, kCookiePath,
+ base::Time::Now() - base::TimeDelta::FromMinutes(1),
+ base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(),
+ /*secure=*/true, false, CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT,
+ /*same_party=*/true));
+
+ // Force the store to write its data to the disk.
+ DestroyStore();
+
+ // Create a store that loads session cookie and test that the SameParty
+ // attribute values are restored.
+ CanonicalCookieVector cookies;
+ CreateAndLoad(false, true, &cookies);
+ ASSERT_EQ(2U, cookies.size());
+
+ // Put the cookies into a map, by name, for comparison below.
+ std::map<std::string, CanonicalCookie*> cookie_map;
+ for (const auto& cookie : cookies)
+ cookie_map[cookie->Name()] = cookie.get();
+
+ // Validate that each cookie has the correct SameParty.
+ ASSERT_EQ(1u, cookie_map.count(kNonSamePartyCookieName));
+ EXPECT_FALSE(cookie_map[kNonSamePartyCookieName]->IsSameParty());
+
+ ASSERT_EQ(1u, cookie_map.count(kSamePartyCookieName));
+ EXPECT_TRUE(cookie_map[kSamePartyCookieName]->IsSameParty());
+}
+
+TEST_F(SQLitePersistentCookieStoreTest, SourcePortIsPersistent) {
+ const char kDomain[] = "sessioncookie.com";
+ const char kCookieValue[] = "value";
+ const char kCookiePath[] = "/";
+
+ struct CookieTestValues {
+ std::string name;
+ int port;
+ };
+
+ const std::vector<CookieTestValues> kTestCookies = {
+ {"1", 80},
+ {"2", 443},
+ {"3", 1234},
+ {"4", url::PORT_UNSPECIFIED},
+ {"5", url::PORT_INVALID}};
+
+ InitializeStore(false, true);
+
+ for (const auto& input : kTestCookies) {
+ // Add some persistent cookies.
+ store_->AddCookie(CanonicalCookie(
+ input.name, kCookieValue, kDomain, kCookiePath,
+ base::Time::Now() - base::TimeDelta::FromMinutes(1),
+ base::Time::Now() + base::TimeDelta::FromDays(1), base::Time(),
+ /*secure=*/true, false, CookieSameSite::LAX_MODE,
+ COOKIE_PRIORITY_DEFAULT,
+ /*same_party=*/false,
+ CookieSourceScheme::kUnset /* Doesn't matter for this test. */,
+ input.port));
+ }
+
+ // Force the store to write its data to the disk.
+ DestroyStore();
+
+ // Create a store that loads session cookie and test that the source_port
+ // attribute values are restored.
+ CanonicalCookieVector cookies;
+ CreateAndLoad(false, true, &cookies);
+ ASSERT_EQ(kTestCookies.size(), cookies.size());
+
+ // Put the cookies into a map, by name, for comparison below.
+ std::map<std::string, CanonicalCookie*> cookie_map;
+ for (const auto& cookie : cookies)
+ cookie_map[cookie->Name()] = cookie.get();
+
+ for (const auto& expected : kTestCookies) {
+ ASSERT_EQ(1u, cookie_map.count(expected.name));
+ ASSERT_EQ(expected.port, cookie_map[expected.name]->SourcePort());
+ }
+}
+
TEST_F(SQLitePersistentCookieStoreTest, UpdateToEncryption) {
CanonicalCookieVector cookies;
@@ -1019,29 +1119,35 @@ bool AddV9CookiesToDB(sql::Database* db) {
static base::Time cookie_time(base::Time::Now());
std::vector<CanonicalCookie> cookies;
- cookies.push_back(CanonicalCookie(
- "A", "B", "example.com", "/", cookie_time, cookie_time, cookie_time,
- false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ cookies.push_back(CanonicalCookie("A", "B", "example.com", "/", cookie_time,
+ cookie_time, cookie_time, false, false,
+ CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false));
cookie_time += base::TimeDelta::FromMicroseconds(1);
- cookies.push_back(CanonicalCookie(
- "C", "B", "example.com", "/", cookie_time, cookie_time, cookie_time,
- false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ cookies.push_back(CanonicalCookie("C", "B", "example.com", "/", cookie_time,
+ cookie_time, cookie_time, false, false,
+ CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false));
cookie_time += base::TimeDelta::FromMicroseconds(1);
- cookies.push_back(CanonicalCookie(
- "A", "B", "example2.com", "/", cookie_time, cookie_time, cookie_time,
- false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ cookies.push_back(CanonicalCookie("A", "B", "example2.com", "/", cookie_time,
+ cookie_time, cookie_time, false, false,
+ CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false));
cookie_time += base::TimeDelta::FromMicroseconds(1);
- cookies.push_back(CanonicalCookie(
- "C", "B", "example2.com", "/", cookie_time, cookie_time, cookie_time,
- false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ cookies.push_back(CanonicalCookie("C", "B", "example2.com", "/", cookie_time,
+ cookie_time, cookie_time, false, false,
+ CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false));
cookie_time += base::TimeDelta::FromMicroseconds(1);
cookies.push_back(CanonicalCookie(
"A", "B", "example.com", "/path", cookie_time, cookie_time, cookie_time,
- false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false));
cookie_time += base::TimeDelta::FromMicroseconds(1);
cookies.push_back(CanonicalCookie(
"C", "B", "example.com", "/path", cookie_time, cookie_time, cookie_time,
- false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT,
+ false));
cookie_time += base::TimeDelta::FromMicroseconds(1);
return AddV9CookiesToDBImpl(db, cookies);
}
@@ -1165,7 +1271,7 @@ TEST_F(SQLitePersistentCookieStoreTest, UpgradeToSchemaVersion10Corrupted) {
base::Time old_time2 = base::Time::Now() - base::TimeDelta::FromMinutes(91);
CanonicalCookie old_cookie1(
"A", "old_value", "example.com", "/", old_time, old_time, old_time, false,
- false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false);
AddV9CookiesToDBImpl(&connection, {old_cookie1});
// Add the same set of cookies twice to create duplicates.
@@ -1173,9 +1279,10 @@ TEST_F(SQLitePersistentCookieStoreTest, UpgradeToSchemaVersion10Corrupted) {
ASSERT_TRUE(AddV9CookiesToDB(&connection));
// Add some others as well.
- CanonicalCookie old_cookie2(
- "A", "old_value", "example.com", "/path", old_time2, old_time2, old_time2,
- false, false, CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT);
+ CanonicalCookie old_cookie2("A", "old_value", "example.com", "/path",
+ old_time2, old_time2, old_time2, false, false,
+ CookieSameSite::NO_RESTRICTION,
+ COOKIE_PRIORITY_DEFAULT, false);
AddV9CookiesToDBImpl(&connection, {old_cookie2});
connection.Close();
@@ -1493,22 +1600,22 @@ bool AddV10CookiesToDB(sql::Database* db) {
std::vector<CanonicalCookie> cookies;
cookies.push_back(CanonicalCookie(
"A", "B", "example.com", "/", time, time, time, false, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(CanonicalCookie(
"C", "B", "example.com", "/", time, time, time, false, false,
- CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::NO_RESTRICTION, COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(CanonicalCookie(
"A", "B", "example2.com", "/", time, time, time, false, false,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(CanonicalCookie(
"C", "B", "example2.com", "/", time, time, time, false, false,
- CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::LAX_MODE, COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(CanonicalCookie(
"A", "B", "example.com", "/path", time, time, time, false, false,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false));
cookies.push_back(CanonicalCookie(
"C", "B", "example.com", "/path", time, time, time, false, false,
- CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT));
+ CookieSameSite::STRICT_MODE, COOKIE_PRIORITY_DEFAULT, false));
return AddV10CookiesToDBImpl(db, cookies);
}
@@ -1659,46 +1766,76 @@ bool CreateV11Schema(sql::Database* db) {
return true;
}
-bool AddV11CookiesToDBImpl(sql::Database* db,
- const std::vector<CanonicalCookie>& cookies);
+bool CreateV12Schema(sql::Database* db) {
+ sql::MetaTable meta_table;
+ if (!meta_table.Init(db, /* version = */ 12,
+ /* earliest compatible version = */ 12)) {
+ return false;
+ }
-// Add a selection of cookies to the DB.
-bool AddV11CookiesToDB(sql::Database* db) {
+ // Version 12 schema
+ std::string stmt(
+ "CREATE TABLE cookies("
+ "creation_utc INTEGER NOT NULL,"
+ "host_key TEXT NOT NULL,"
+ "name TEXT NOT NULL,"
+ "value TEXT NOT NULL,"
+ "path TEXT NOT NULL,"
+ "expires_utc INTEGER NOT NULL,"
+ "is_secure INTEGER NOT NULL,"
+ "is_httponly INTEGER NOT NULL,"
+ "last_access_utc INTEGER NOT NULL,"
+ "has_expires INTEGER NOT NULL DEFAULT 1,"
+ "is_persistent INTEGER NOT NULL DEFAULT 1,"
+ "priority INTEGER NOT NULL DEFAULT 1," // COOKIE_PRIORITY_DEFAULT
+ "encrypted_value BLOB DEFAULT '',"
+ "samesite INTEGER NOT NULL DEFAULT -1," // UNSPECIFIED
+ "source_scheme INTEGER NOT NULL DEFAULT 0," // CookieSourceScheme::kUnset
+ "UNIQUE (host_key, name, path))");
+ if (!db->Execute(stmt.c_str()))
+ return false;
+
+ return true;
+}
+
+std::vector<CanonicalCookie> CookiesForMigrationTest() {
static base::Time now = base::Time::Now();
std::vector<CanonicalCookie> cookies;
// Note: These are all constructed with the default value of
// is_source_scheme_secure, which is false, but that doesn't matter because
// v11 doesn't store that info.
- cookies.push_back(CanonicalCookie("A", "B", "example.com", "/", now, now, now,
- true /* secure */, false /* httponly */,
- CookieSameSite::UNSPECIFIED,
- COOKIE_PRIORITY_DEFAULT));
- cookies.push_back(CanonicalCookie("C", "B", "example.com", "/", now, now, now,
- true /* secure */, false /* httponly */,
- CookieSameSite::UNSPECIFIED,
- COOKIE_PRIORITY_DEFAULT));
- cookies.push_back(
- CanonicalCookie("A", "B", "example2.com", "/", now, now, now,
- true /* secure */, false /* httponly */,
- CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT));
- cookies.push_back(
- CanonicalCookie("C", "B", "example2.com", "/", now, now, now,
- false /* secure */, false /* httponly */,
- CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT));
- cookies.push_back(
- CanonicalCookie("A", "B", "example.com", "/path", now, now, now,
- false /* secure */, false /* httponly */,
- CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT));
- cookies.push_back(
- CanonicalCookie("C", "B", "example.com", "/path", now, now, now,
- false /* secure */, false /* httponly */,
- CookieSameSite::UNSPECIFIED, COOKIE_PRIORITY_DEFAULT));
- return AddV11CookiesToDBImpl(db, cookies);
+ // Some of these are constructed with SameParty set to true, to test that in
+ // the DB migration, the is_same_party values are all defaulted to false.
+ cookies.push_back(CanonicalCookie(
+ "A", "B", "example.com", "/", now, now, now, true /* secure */,
+ false /* httponly */, CookieSameSite::UNSPECIFIED,
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */));
+ cookies.push_back(CanonicalCookie(
+ "C", "B", "example.com", "/", now, now, now, true /* secure */,
+ false /* httponly */, CookieSameSite::UNSPECIFIED,
+ COOKIE_PRIORITY_DEFAULT, true /* same_party */));
+ cookies.push_back(CanonicalCookie(
+ "A", "B", "example2.com", "/", now, now, now, true /* secure */,
+ false /* httponly */, CookieSameSite::UNSPECIFIED,
+ COOKIE_PRIORITY_DEFAULT, true /* same_party */));
+ cookies.push_back(CanonicalCookie(
+ "C", "B", "example2.com", "/", now, now, now, false /* secure */,
+ false /* httponly */, CookieSameSite::UNSPECIFIED,
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */));
+ cookies.push_back(CanonicalCookie(
+ "A", "B", "example.com", "/path", now, now, now, false /* secure */,
+ false /* httponly */, CookieSameSite::UNSPECIFIED,
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */));
+ cookies.push_back(CanonicalCookie(
+ "C", "B", "example.com", "/path", now, now, now, false /* secure */,
+ false /* httponly */, CookieSameSite::UNSPECIFIED,
+ COOKIE_PRIORITY_DEFAULT, false /* same_party */));
+ return cookies;
}
-bool AddV11CookiesToDBImpl(sql::Database* db,
- const std::vector<CanonicalCookie>& cookies) {
+bool AddV11CookiesToDB(sql::Database* db) {
+ std::vector<CanonicalCookie> cookies = CookiesForMigrationTest();
sql::Statement add_smt(db->GetCachedStatement(
SQL_FROM_HERE,
"INSERT INTO cookies (creation_utc, host_key, name, value, "
@@ -1745,8 +1882,56 @@ bool AddV11CookiesToDBImpl(sql::Database* db,
return true;
}
+bool AddV12CookiesToDB(sql::Database* db) {
+ std::vector<CanonicalCookie> cookies = CookiesForMigrationTest();
+ sql::Statement add_smt(db->GetCachedStatement(
+ SQL_FROM_HERE,
+ "INSERT INTO cookies (creation_utc, host_key, name, value, "
+ "encrypted_value, path, expires_utc, is_secure, is_httponly, "
+ "samesite, last_access_utc, has_expires, is_persistent, priority, "
+ "source_scheme)"
+ "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"));
+ if (!add_smt.is_valid())
+ return false;
+ sql::Transaction transaction(db);
+ transaction.Begin();
+ for (const CanonicalCookie& cookie : cookies) {
+ add_smt.Reset(true);
+ add_smt.BindInt64(
+ 0, cookie.CreationDate().ToDeltaSinceWindowsEpoch().InMicroseconds());
+ add_smt.BindString(1, cookie.Domain());
+ add_smt.BindString(2, cookie.Name());
+ add_smt.BindString(3, cookie.Value());
+ add_smt.BindBlob(4, "", 0); // encrypted_value
+ add_smt.BindString(5, cookie.Path());
+ add_smt.BindInt64(
+ 6, cookie.ExpiryDate().ToDeltaSinceWindowsEpoch().InMicroseconds());
+ add_smt.BindInt(7, cookie.IsSecure());
+ add_smt.BindInt(8, cookie.IsHttpOnly());
+ // Note that this, Priority(), and SourceScheme() below nominally rely on
+ // the enums in sqlite_persistent_cookie_store.cc having the same values as
+ // the ones in ../../cookies/cookie_constants.h. But nothing in this test
+ // relies on that equivalence, so it's not worth the hassle to guarantee
+ // that.
+ add_smt.BindInt(9, static_cast<int>(cookie.SameSite()));
+ add_smt.BindInt64(
+ 10,
+ cookie.LastAccessDate().ToDeltaSinceWindowsEpoch().InMicroseconds());
+ add_smt.BindInt(11, cookie.IsPersistent());
+ add_smt.BindInt(12, cookie.IsPersistent());
+ add_smt.BindInt(13, static_cast<int>(cookie.Priority()));
+ add_smt.BindInt(14, static_cast<int>(cookie.SourceScheme()));
+ if (!add_smt.Run())
+ return false;
+ }
+ if (!transaction.Commit())
+ return false;
+
+ return true;
+}
+
// Confirm the cookie list passed in has the above cookies in it.
-void ConfirmV11CookiesFromDB(
+void ConfirmCookiesAfterMigrationTest(
std::vector<std::unique_ptr<CanonicalCookie>> read_in_cookies) {
std::sort(read_in_cookies.begin(), read_in_cookies.end(), &CompareCookies);
int i = 0;
@@ -1756,6 +1941,7 @@ void ConfirmV11CookiesFromDB(
EXPECT_EQ("/", read_in_cookies[i]->Path());
EXPECT_TRUE(read_in_cookies[i]->IsSecure());
EXPECT_EQ(CookieSourceScheme::kUnset, read_in_cookies[i]->SourceScheme());
+ EXPECT_FALSE(read_in_cookies[i]->IsSameParty());
i++;
EXPECT_EQ("A", read_in_cookies[i]->Name());
@@ -1764,6 +1950,7 @@ void ConfirmV11CookiesFromDB(
EXPECT_EQ("/path", read_in_cookies[i]->Path());
EXPECT_FALSE(read_in_cookies[i]->IsSecure());
EXPECT_EQ(CookieSourceScheme::kUnset, read_in_cookies[i]->SourceScheme());
+ EXPECT_FALSE(read_in_cookies[i]->IsSameParty());
i++;
EXPECT_EQ("A", read_in_cookies[i]->Name());
@@ -1772,6 +1959,7 @@ void ConfirmV11CookiesFromDB(
EXPECT_EQ("/", read_in_cookies[i]->Path());
EXPECT_TRUE(read_in_cookies[i]->IsSecure());
EXPECT_EQ(CookieSourceScheme::kUnset, read_in_cookies[i]->SourceScheme());
+ EXPECT_FALSE(read_in_cookies[i]->IsSameParty());
i++;
EXPECT_EQ("C", read_in_cookies[i]->Name());
@@ -1780,6 +1968,7 @@ void ConfirmV11CookiesFromDB(
EXPECT_EQ("/", read_in_cookies[i]->Path());
EXPECT_TRUE(read_in_cookies[i]->IsSecure());
EXPECT_EQ(CookieSourceScheme::kUnset, read_in_cookies[i]->SourceScheme());
+ EXPECT_FALSE(read_in_cookies[i]->IsSameParty());
i++;
EXPECT_EQ("C", read_in_cookies[i]->Name());
@@ -1788,6 +1977,7 @@ void ConfirmV11CookiesFromDB(
EXPECT_EQ("/path", read_in_cookies[i]->Path());
EXPECT_FALSE(read_in_cookies[i]->IsSecure());
EXPECT_EQ(CookieSourceScheme::kUnset, read_in_cookies[i]->SourceScheme());
+ EXPECT_FALSE(read_in_cookies[i]->IsSameParty());
i++;
EXPECT_EQ("C", read_in_cookies[i]->Name());
@@ -1796,6 +1986,7 @@ void ConfirmV11CookiesFromDB(
EXPECT_EQ("/", read_in_cookies[i]->Path());
EXPECT_FALSE(read_in_cookies[i]->IsSecure());
EXPECT_EQ(CookieSourceScheme::kUnset, read_in_cookies[i]->SourceScheme());
+ EXPECT_FALSE(read_in_cookies[i]->IsSameParty());
}
// Confirm that source_scheme gets added and is set to "Unset".
@@ -1809,7 +2000,20 @@ TEST_F(SQLitePersistentCookieStoreTest, UpgradeToSchemaVersion12) {
std::vector<std::unique_ptr<CanonicalCookie>> read_in_cookies;
CreateAndLoad(false, false, &read_in_cookies);
- ConfirmV11CookiesFromDB(std::move(read_in_cookies));
+ ConfirmCookiesAfterMigrationTest(std::move(read_in_cookies));
+}
+
+TEST_F(SQLitePersistentCookieStoreTest, UpgradeToSchemaVersion13) {
+ // Open db
+ sql::Database connection;
+ ASSERT_TRUE(connection.Open(temp_dir_.GetPath().Append(kCookieFilename)));
+ ASSERT_TRUE(CreateV12Schema(&connection));
+ ASSERT_TRUE(AddV12CookiesToDB(&connection));
+ connection.Close();
+
+ std::vector<std::unique_ptr<CanonicalCookie>> read_in_cookies;
+ CreateAndLoad(false, false, &read_in_cookies);
+ ConfirmCookiesAfterMigrationTest(std::move(read_in_cookies));
}
} // namespace net
diff --git a/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store.cc b/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store.cc
index c4fbb1e586d..5edd5166c3f 100644
--- a/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store.cc
+++ b/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store.cc
@@ -12,13 +12,18 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
+#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
+#include "base/json/json_reader.h"
+#include "base/json/json_string_value_serializer.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequenced_task_runner.h"
#include "base/task/task_traits.h"
#include "base/thread_annotations.h"
+#include "net/base/features.h"
+#include "net/base/network_isolation_key.h"
#include "net/extras/sqlite/sqlite_persistent_store_backend_base.h"
#include "net/reporting/reporting_endpoint.h"
#include "sql/database.h"
@@ -34,8 +39,13 @@ namespace {
//
// Version 1 adds tables for NEL policies, Reporting endpoints, and Reporting
// endpoint groups.
-const int kCurrentVersionNumber = 1;
-const int kCompatibleVersionNumber = 1;
+//
+// Version 2 - 2020/10 - https://crrev.com/c/2485253
+//
+// Version 2 adds NetworkIsolationKey fields to all entries. When migrating,
+// existing entries get an empty NetworkIsolationKey value.
+const int kCurrentVersionNumber = 2;
+const int kCompatibleVersionNumber = 2;
// Enums for histograms:
// These values are persisted to logs. Entries should not be renumbered and
@@ -76,6 +86,45 @@ base::TaskPriority GetReportingAndNelStoreBackgroundSequencePriority() {
return base::TaskPriority::USER_BLOCKING;
}
+// Converts a NetworkIsolationKey to a string for serializing to disk. Returns
+// false on failure, which happens for transient keys that should not be
+// serialized to disk.
+bool WARN_UNUSED_RESULT
+NetworkIsolationKeyToString(const NetworkIsolationKey& network_isolation_key,
+ std::string* out_string) {
+ base::Value value;
+ if (!network_isolation_key.ToValue(&value))
+ return false;
+ return JSONStringValueSerializer(out_string).Serialize(value);
+}
+
+// Attempts to convert a string returned by NetworkIsolationKeyToString() to
+// a NetworkIsolationKey. Returns false on failure.
+bool WARN_UNUSED_RESULT
+NetworkIsolationKeyFromString(const std::string& string,
+ NetworkIsolationKey* out_network_isolation_key) {
+ base::Optional<base::Value> value = base::JSONReader::Read(string);
+ if (!value)
+ return false;
+
+ if (!NetworkIsolationKey::FromValue(*value, out_network_isolation_key))
+ return false;
+
+ // If NetworkIsolationKeys are disabled for reporting and NEL, but the
+ // NetworkIsolationKey is non-empty, ignore the entry. The entry will
+ // still be in the on-disk database, in case NIKs are re-enabled, it just
+ // won't be loaded into memory. The entry could still be loaded with an empty
+ // NetworkIsolationKey, but that would require logic to resolve conflicts.
+ if (!out_network_isolation_key->IsEmpty() &&
+ !base::FeatureList::IsEnabled(
+ features::kPartitionNelAndReportingByNetworkIsolationKey)) {
+ *out_network_isolation_key = NetworkIsolationKey();
+ return false;
+ }
+
+ return true;
+}
+
class SQLitePersistentReportingAndNelStore::Backend
: public SQLitePersistentStoreBackendBase {
public:
@@ -115,6 +164,8 @@ class SQLitePersistentReportingAndNelStore::Backend
private:
~Backend() override {
DCHECK(nel_policy_pending_ops_.empty());
+ DCHECK(reporting_endpoint_pending_ops_.empty());
+ DCHECK(reporting_endpoint_group_pending_ops_.empty());
DCHECK_EQ(0u, num_pending_);
}
@@ -124,6 +175,14 @@ class SQLitePersistentReportingAndNelStore::Backend
template <typename DataType>
class PendingOperation;
+ // Types of PendingOperation. Here to avoid templatizing the enum.
+ enum class PendingOperationType {
+ ADD,
+ UPDATE_ACCESS_TIME,
+ UPDATE_DETAILS,
+ DELETE
+ };
+
// List of pending operations for a particular entry in the database.
template <typename DataType>
using PendingOperationsVector =
@@ -237,8 +296,8 @@ class SQLitePersistentReportingAndNelStore::Backend
size_t num_pending_ GUARDED_BY(lock_);
// Queue of pending operations pertaining to NEL policies, keyed on origin.
- QueueType<url::Origin, NelPolicyInfo> nel_policy_pending_ops_
- GUARDED_BY(lock_);
+ QueueType<NetworkErrorLoggingService::NelPolicyKey, NelPolicyInfo>
+ nel_policy_pending_ops_ GUARDED_BY(lock_);
// Queue of pending operations pertaining to Reporting endpoints, keyed on
// origin, group name, and url.
QueueType<ReportingEndpointKey, ReportingEndpointInfo>
@@ -258,33 +317,35 @@ class SQLitePersistentReportingAndNelStore::Backend
namespace {
-bool CreateV1NelPoliciesSchema(sql::Database* db) {
+bool CreateV2NelPoliciesSchema(sql::Database* db) {
DCHECK(!db->DoesTableExist("nel_policies"));
std::string stmt =
"CREATE TABLE nel_policies ("
+ " nik TEXT NOT NULL,"
" origin_scheme TEXT NOT NULL,"
" origin_host TEXT NOT NULL,"
" origin_port INTEGER NOT NULL,"
" received_ip_address TEXT NOT NULL,"
- " report_to TEXT NOT NULL,"
+ " group_name TEXT NOT NULL,"
" expires_us_since_epoch INTEGER NOT NULL,"
" success_fraction REAL NOT NULL,"
" failure_fraction REAL NOT NULL,"
" is_include_subdomains INTEGER NOT NULL,"
" last_access_us_since_epoch INTEGER NOT NULL,"
- // Each origin specifies at most one NEL policy.
- " UNIQUE (origin_scheme, origin_host, origin_port)"
+ // Each (origin, nik) specifies at most one NEL policy.
+ " UNIQUE (origin_scheme, origin_host, origin_port, nik)"
")";
return db->Execute(stmt.c_str());
}
-bool CreateV1ReportingEndpointsSchema(sql::Database* db) {
+bool CreateV2ReportingEndpointsSchema(sql::Database* db) {
DCHECK(!db->DoesTableExist("reporting_endpoints"));
std::string stmt =
"CREATE TABLE reporting_endpoints ("
+ " nik TEXT NOT NULL,"
" origin_scheme TEXT NOT NULL,"
" origin_host TEXT NOT NULL,"
" origin_port INTEGER NOT NULL,"
@@ -292,18 +353,19 @@ bool CreateV1ReportingEndpointsSchema(sql::Database* db) {
" url TEXT NOT NULL,"
" priority INTEGER NOT NULL,"
" weight INTEGER NOT NULL,"
- // Each (origin, group, url) tuple specifies at most one endpoint.
- " UNIQUE (origin_scheme, origin_host, origin_port, group_name, url)"
+ // Each (origin, group, url, nik) tuple specifies at most one endpoint.
+ " UNIQUE (origin_scheme, origin_host, origin_port, group_name, url, nik)"
")";
return db->Execute(stmt.c_str());
}
-bool CreateV1ReportingEndpointGroupsSchema(sql::Database* db) {
+bool CreateV2ReportingEndpointGroupsSchema(sql::Database* db) {
DCHECK(!db->DoesTableExist("reporting_endpoint_groups"));
std::string stmt =
"CREATE TABLE reporting_endpoint_groups ("
+ " nik TEXT NOT NULL,"
" origin_scheme TEXT NOT NULL,"
" origin_host TEXT NOT NULL,"
" origin_port INTEGER NOT NULL,"
@@ -311,8 +373,8 @@ bool CreateV1ReportingEndpointGroupsSchema(sql::Database* db) {
" is_include_subdomains INTEGER NOT NULL,"
" expires_us_since_epoch INTEGER NOT NULL,"
" last_access_us_since_epoch INTEGER NOT NULL,"
- // Each (origin, group) tuple specifies at most one endpoint group.
- " UNIQUE (origin_scheme, origin_host, origin_port, group_name)"
+ // Each (origin, group, nik) tuple specifies at most one endpoint group.
+ " UNIQUE (origin_scheme, origin_host, origin_port, group_name, nik)"
")";
return db->Execute(stmt.c_str());
@@ -323,16 +385,14 @@ bool CreateV1ReportingEndpointGroupsSchema(sql::Database* db) {
template <typename DataType>
class SQLitePersistentReportingAndNelStore::Backend::PendingOperation {
public:
- enum class Type { ADD, UPDATE_ACCESS_TIME, UPDATE_DETAILS, DELETE };
-
- PendingOperation(Type type, DataType data)
+ PendingOperation(PendingOperationType type, DataType data)
: type_(type), data_(std::move(data)) {}
- Type type() const { return type_; }
+ PendingOperationType type() const { return type_; }
const DataType& data() const { return data_; }
private:
- const Type type_;
+ const PendingOperationType type_;
const DataType data_;
};
@@ -340,11 +400,13 @@ class SQLitePersistentReportingAndNelStore::Backend::PendingOperation {
// form suitable for adding to the database.
// TODO(chlily): Add NIK.
struct SQLitePersistentReportingAndNelStore::Backend::NelPolicyInfo {
- explicit NelPolicyInfo(
- const NetworkErrorLoggingService::NelPolicy& nel_policy)
- : origin_scheme(nel_policy.origin.scheme()),
- origin_host(nel_policy.origin.host()),
- origin_port(nel_policy.origin.port()),
+ // This should only be invoked through CreatePendingOperation().
+ NelPolicyInfo(const NetworkErrorLoggingService::NelPolicy& nel_policy,
+ std::string network_isolation_key_string)
+ : network_isolation_key_string(std::move(network_isolation_key_string)),
+ origin_scheme(nel_policy.key.origin.scheme()),
+ origin_host(nel_policy.key.origin.host()),
+ origin_port(nel_policy.key.origin.port()),
received_ip_address(nel_policy.received_ip_address.ToString()),
report_to(nel_policy.report_to),
expires_us_since_epoch(
@@ -355,10 +417,32 @@ struct SQLitePersistentReportingAndNelStore::Backend::NelPolicyInfo {
last_access_us_since_epoch(
nel_policy.last_used.ToDeltaSinceWindowsEpoch().InMicroseconds()) {}
+ // Creates the specified operation for the given policy. Returns nullptr for
+ // endpoints with transient NetworkIsolationKeys.
+ static std::unique_ptr<PendingOperation<NelPolicyInfo>>
+ CreatePendingOperation(
+ PendingOperationType type,
+ const NetworkErrorLoggingService::NelPolicy& nel_policy) {
+ std::string network_isolation_key_string;
+ if (!NetworkIsolationKeyToString(nel_policy.key.network_isolation_key,
+ &network_isolation_key_string)) {
+ return nullptr;
+ }
+
+ return std::make_unique<PendingOperation<NelPolicyInfo>>(
+ type,
+ NelPolicyInfo(nel_policy, std::move(network_isolation_key_string)));
+ }
+
+ // NetworkIsolationKey associated with the request that received the policy,
+ // converted to a string via NetworkIsolationKeyToString().
+ std::string network_isolation_key_string;
+
// Origin the policy was received from.
std::string origin_scheme;
std::string origin_host;
int origin_port = 0;
+
// IP address of the server that the policy was received from.
std::string received_ip_address;
// The Reporting group which the policy specifies.
@@ -377,10 +461,12 @@ struct SQLitePersistentReportingAndNelStore::Backend::NelPolicyInfo {
// Makes a copy of the relevant information about a ReportingEndpoint, stored in
// a form suitable for adding to the database.
-// TODO(chlily): Add NIK.
struct SQLitePersistentReportingAndNelStore::Backend::ReportingEndpointInfo {
- explicit ReportingEndpointInfo(const ReportingEndpoint& endpoint)
- : origin_scheme(endpoint.group_key.origin.scheme()),
+ // This should only be invoked through CreatePendingOperation().
+ ReportingEndpointInfo(const ReportingEndpoint& endpoint,
+ std::string network_isolation_key_string)
+ : network_isolation_key_string(std::move(network_isolation_key_string)),
+ origin_scheme(endpoint.group_key.origin.scheme()),
origin_host(endpoint.group_key.origin.host()),
origin_port(endpoint.group_key.origin.port()),
group_name(endpoint.group_key.group_name),
@@ -388,10 +474,31 @@ struct SQLitePersistentReportingAndNelStore::Backend::ReportingEndpointInfo {
priority(endpoint.info.priority),
weight(endpoint.info.weight) {}
+ // Creates the specified operation for the given endpoint. Returns nullptr for
+ // endpoints with transient NetworkIsolationKeys.
+ static std::unique_ptr<PendingOperation<ReportingEndpointInfo>>
+ CreatePendingOperation(PendingOperationType type,
+ const ReportingEndpoint& endpoint) {
+ std::string network_isolation_key_string;
+ if (!NetworkIsolationKeyToString(endpoint.group_key.network_isolation_key,
+ &network_isolation_key_string)) {
+ return nullptr;
+ }
+
+ return std::make_unique<PendingOperation<ReportingEndpointInfo>>(
+ type, ReportingEndpointInfo(endpoint,
+ std::move(network_isolation_key_string)));
+ }
+
+ // NetworkIsolationKey associated with the endpoint, converted to a string via
+ // NetworkIsolationKeyToString().
+ std::string network_isolation_key_string;
+
// Origin the endpoint was received from.
std::string origin_scheme;
std::string origin_host;
int origin_port = 0;
+
// Name of the group the endpoint belongs to.
std::string group_name;
// URL of the endpoint.
@@ -402,11 +509,12 @@ struct SQLitePersistentReportingAndNelStore::Backend::ReportingEndpointInfo {
int weight = ReportingEndpoint::EndpointInfo::kDefaultWeight;
};
-// TODO(chlily): Add NIK.
struct SQLitePersistentReportingAndNelStore::Backend::
ReportingEndpointGroupInfo {
- explicit ReportingEndpointGroupInfo(const CachedReportingEndpointGroup& group)
- : origin_scheme(group.group_key.origin.scheme()),
+ ReportingEndpointGroupInfo(const CachedReportingEndpointGroup& group,
+ std::string network_isolation_key_string)
+ : network_isolation_key_string(std::move(network_isolation_key_string)),
+ origin_scheme(group.group_key.origin.scheme()),
origin_host(group.group_key.origin.host()),
origin_port(group.group_key.origin.port()),
group_name(group.group_key.group_name),
@@ -417,10 +525,31 @@ struct SQLitePersistentReportingAndNelStore::Backend::
last_access_us_since_epoch(
group.last_used.ToDeltaSinceWindowsEpoch().InMicroseconds()) {}
+ // Creates the specified operation for the given endpoint reporting group.
+ // Returns nullptr for groups with transient NetworkIsolationKeys.
+ static std::unique_ptr<PendingOperation<ReportingEndpointGroupInfo>>
+ CreatePendingOperation(PendingOperationType type,
+ const CachedReportingEndpointGroup& group) {
+ std::string network_isolation_key_string;
+ if (!NetworkIsolationKeyToString(group.group_key.network_isolation_key,
+ &network_isolation_key_string)) {
+ return nullptr;
+ }
+
+ return std::make_unique<PendingOperation<ReportingEndpointGroupInfo>>(
+ type, ReportingEndpointGroupInfo(
+ group, std::move(network_isolation_key_string)));
+ }
+
+ // NetworkIsolationKey associated with the endpoint group, converted to a
+ // string via NetworkIsolationKeyToString().
+ std::string network_isolation_key_string;
+
// Origin the endpoint group was received from.
std::string origin_scheme;
std::string origin_host;
int origin_port = 0;
+
// Name of the group.
std::string group_name;
// Whether the group applies to subdomains of the origin.
@@ -441,24 +570,29 @@ void SQLitePersistentReportingAndNelStore::Backend::LoadNelPolicies(
void SQLitePersistentReportingAndNelStore::Backend::AddNelPolicy(
const NetworkErrorLoggingService::NelPolicy& policy) {
- auto po = std::make_unique<PendingOperation<NelPolicyInfo>>(
- PendingOperation<NelPolicyInfo>::Type::ADD, NelPolicyInfo(policy));
- BatchOperation(policy.origin, std::move(po), &nel_policy_pending_ops_);
+ auto po =
+ NelPolicyInfo::CreatePendingOperation(PendingOperationType::ADD, policy);
+ if (!po)
+ return;
+ BatchOperation(policy.key, std::move(po), &nel_policy_pending_ops_);
}
void SQLitePersistentReportingAndNelStore::Backend::UpdateNelPolicyAccessTime(
const NetworkErrorLoggingService::NelPolicy& policy) {
- auto po = std::make_unique<PendingOperation<NelPolicyInfo>>(
- PendingOperation<NelPolicyInfo>::Type::UPDATE_ACCESS_TIME,
- NelPolicyInfo(policy));
- BatchOperation(policy.origin, std::move(po), &nel_policy_pending_ops_);
+ auto po = NelPolicyInfo::CreatePendingOperation(
+ PendingOperationType::UPDATE_ACCESS_TIME, policy);
+ if (!po)
+ return;
+ BatchOperation(policy.key, std::move(po), &nel_policy_pending_ops_);
}
void SQLitePersistentReportingAndNelStore::Backend::DeleteNelPolicy(
const NetworkErrorLoggingService::NelPolicy& policy) {
- auto po = std::make_unique<PendingOperation<NelPolicyInfo>>(
- PendingOperation<NelPolicyInfo>::Type::DELETE, NelPolicyInfo(policy));
- BatchOperation(policy.origin, std::move(po), &nel_policy_pending_ops_);
+ auto po = NelPolicyInfo::CreatePendingOperation(PendingOperationType::DELETE,
+ policy);
+ if (!po)
+ return;
+ BatchOperation(policy.key, std::move(po), &nel_policy_pending_ops_);
}
void SQLitePersistentReportingAndNelStore::Backend::LoadReportingClients(
@@ -471,9 +605,10 @@ void SQLitePersistentReportingAndNelStore::Backend::LoadReportingClients(
void SQLitePersistentReportingAndNelStore::Backend::AddReportingEndpoint(
const ReportingEndpoint& endpoint) {
- auto po = std::make_unique<PendingOperation<ReportingEndpointInfo>>(
- PendingOperation<ReportingEndpointInfo>::Type::ADD,
- ReportingEndpointInfo(endpoint));
+ auto po = ReportingEndpointInfo::CreatePendingOperation(
+ PendingOperationType::ADD, endpoint);
+ if (!po)
+ return;
ReportingEndpointKey key =
std::make_pair(endpoint.group_key, endpoint.info.url);
BatchOperation(std::move(key), std::move(po),
@@ -482,9 +617,10 @@ void SQLitePersistentReportingAndNelStore::Backend::AddReportingEndpoint(
void SQLitePersistentReportingAndNelStore::Backend::AddReportingEndpointGroup(
const CachedReportingEndpointGroup& group) {
- auto po = std::make_unique<PendingOperation<ReportingEndpointGroupInfo>>(
- PendingOperation<ReportingEndpointGroupInfo>::Type::ADD,
- ReportingEndpointGroupInfo(group));
+ auto po = ReportingEndpointGroupInfo::CreatePendingOperation(
+ PendingOperationType::ADD, group);
+ if (!po)
+ return;
BatchOperation(group.group_key, std::move(po),
&reporting_endpoint_group_pending_ops_);
}
@@ -492,18 +628,20 @@ void SQLitePersistentReportingAndNelStore::Backend::AddReportingEndpointGroup(
void SQLitePersistentReportingAndNelStore::Backend::
UpdateReportingEndpointGroupAccessTime(
const CachedReportingEndpointGroup& group) {
- auto po = std::make_unique<PendingOperation<ReportingEndpointGroupInfo>>(
- PendingOperation<ReportingEndpointGroupInfo>::Type::UPDATE_ACCESS_TIME,
- ReportingEndpointGroupInfo(group));
+ auto po = ReportingEndpointGroupInfo::CreatePendingOperation(
+ PendingOperationType::UPDATE_ACCESS_TIME, group);
+ if (!po)
+ return;
BatchOperation(group.group_key, std::move(po),
&reporting_endpoint_group_pending_ops_);
}
void SQLitePersistentReportingAndNelStore::Backend::
UpdateReportingEndpointDetails(const ReportingEndpoint& endpoint) {
- auto po = std::make_unique<PendingOperation<ReportingEndpointInfo>>(
- PendingOperation<ReportingEndpointInfo>::Type::UPDATE_DETAILS,
- ReportingEndpointInfo(endpoint));
+ auto po = ReportingEndpointInfo::CreatePendingOperation(
+ PendingOperationType::UPDATE_DETAILS, endpoint);
+ if (!po)
+ return;
ReportingEndpointKey key =
std::make_pair(endpoint.group_key, endpoint.info.url);
BatchOperation(std::move(key), std::move(po),
@@ -513,18 +651,20 @@ void SQLitePersistentReportingAndNelStore::Backend::
void SQLitePersistentReportingAndNelStore::Backend::
UpdateReportingEndpointGroupDetails(
const CachedReportingEndpointGroup& group) {
- auto po = std::make_unique<PendingOperation<ReportingEndpointGroupInfo>>(
- PendingOperation<ReportingEndpointGroupInfo>::Type::UPDATE_DETAILS,
- ReportingEndpointGroupInfo(group));
+ auto po = ReportingEndpointGroupInfo::CreatePendingOperation(
+ PendingOperationType::UPDATE_DETAILS, group);
+ if (!po)
+ return;
BatchOperation(group.group_key, std::move(po),
&reporting_endpoint_group_pending_ops_);
}
void SQLitePersistentReportingAndNelStore::Backend::DeleteReportingEndpoint(
const ReportingEndpoint& endpoint) {
- auto po = std::make_unique<PendingOperation<ReportingEndpointInfo>>(
- PendingOperation<ReportingEndpointInfo>::Type::DELETE,
- ReportingEndpointInfo(endpoint));
+ auto po = ReportingEndpointInfo::CreatePendingOperation(
+ PendingOperationType::DELETE, endpoint);
+ if (!po)
+ return;
ReportingEndpointKey key =
std::make_pair(endpoint.group_key, endpoint.info.url);
BatchOperation(std::move(key), std::move(po),
@@ -533,9 +673,10 @@ void SQLitePersistentReportingAndNelStore::Backend::DeleteReportingEndpoint(
void SQLitePersistentReportingAndNelStore::Backend::
DeleteReportingEndpointGroup(const CachedReportingEndpointGroup& group) {
- auto po = std::make_unique<PendingOperation<ReportingEndpointGroupInfo>>(
- PendingOperation<ReportingEndpointGroupInfo>::Type::DELETE,
- ReportingEndpointGroupInfo(group));
+ auto po = ReportingEndpointGroupInfo::CreatePendingOperation(
+ PendingOperationType::DELETE, group);
+ if (!po)
+ return;
BatchOperation(group.group_key, std::move(po),
&reporting_endpoint_group_pending_ops_);
}
@@ -560,17 +701,17 @@ size_t SQLitePersistentReportingAndNelStore::Backend::GetQueueLengthForTesting()
bool SQLitePersistentReportingAndNelStore::Backend::CreateDatabaseSchema() {
if (!db()->DoesTableExist("nel_policies") &&
- !CreateV1NelPoliciesSchema(db())) {
+ !CreateV2NelPoliciesSchema(db())) {
return false;
}
if (!db()->DoesTableExist("reporting_endpoints") &&
- !CreateV1ReportingEndpointsSchema(db())) {
+ !CreateV2ReportingEndpointsSchema(db())) {
return false;
}
if (!db()->DoesTableExist("reporting_endpoint_groups") &&
- !CreateV1ReportingEndpointGroupsSchema(db())) {
+ !CreateV2ReportingEndpointGroupsSchema(db())) {
return false;
}
@@ -583,13 +724,104 @@ base::Optional<int>
SQLitePersistentReportingAndNelStore::Backend::DoMigrateDatabaseSchema() {
int cur_version = meta_table()->GetVersionNumber();
+ // Migrate from version 1 to version 2.
+ //
+ // For migration purposes, the NetworkIsolationKey field of the stored
+ // policies will be populated with an empty list, which corresponds to an
+ // empty NIK. This matches the behavior when NIKs are disabled. This will
+ // result in effectively clearing all policies once NIKs are enabled, at
+ // which point the the migration code should just be switched to deleting
+ // the old tables instead.
+ if (cur_version == 1) {
+ sql::Transaction transaction(db());
+ if (!transaction.Begin())
+ return base::nullopt;
+
+ // Migrate NEL policies table.
+ if (!db()->Execute("DROP TABLE IF EXISTS nel_policies_old; "
+ "ALTER TABLE nel_policies RENAME TO nel_policies_old")) {
+ return base::nullopt;
+ }
+ if (!CreateV2NelPoliciesSchema(db()))
+ return base::nullopt;
+ // clang-format off
+ // The "report_to" field is renamed to "group_name" for consistency with
+ // the other tables.
+ std::string nel_policies_migrate_stmt =
+ "INSERT INTO nel_policies (nik, origin_scheme, origin_host, "
+ " origin_port, group_name, received_ip_address, expires_us_since_epoch, "
+ " success_fraction, failure_fraction, is_include_subdomains, "
+ " last_access_us_since_epoch) "
+ "SELECT '[]', origin_scheme, origin_host, origin_port, "
+ " report_to, received_ip_address, expires_us_since_epoch, "
+ " success_fraction, failure_fraction, is_include_subdomains, "
+ " last_access_us_since_epoch "
+ "FROM nel_policies_old" ;
+ // clang-format on
+ if (!db()->Execute(nel_policies_migrate_stmt.c_str()))
+ return base::nullopt;
+ if (!db()->Execute("DROP TABLE nel_policies_old"))
+ return base::nullopt;
+
+ // Migrate Reporting endpoints table.
+ if (!db()->Execute("DROP TABLE IF EXISTS reporting_endpoints_old; "
+ "ALTER TABLE reporting_endpoints RENAME TO "
+ "reporting_endpoints_old")) {
+ return base::nullopt;
+ }
+ if (!CreateV2ReportingEndpointsSchema(db()))
+ return base::nullopt;
+ // clang-format off
+ std::string reporting_endpoints_migrate_stmt =
+ "INSERT INTO reporting_endpoints (nik, origin_scheme, origin_host, "
+ " origin_port, group_name, url, priority, weight) "
+ "SELECT '[]', origin_scheme, origin_host, origin_port, group_name, "
+ " url, priority, weight "
+ "FROM reporting_endpoints_old" ;
+ // clang-format on
+ if (!db()->Execute(reporting_endpoints_migrate_stmt.c_str()))
+ return base::nullopt;
+ if (!db()->Execute("DROP TABLE reporting_endpoints_old"))
+ return base::nullopt;
+
+ // Migrate Reporting endpoint groups table.
+ if (!db()->Execute("DROP TABLE IF EXISTS reporting_endpoint_groups_old; "
+ "ALTER TABLE reporting_endpoint_groups RENAME TO "
+ "reporting_endpoint_groups_old")) {
+ return base::nullopt;
+ }
+ if (!CreateV2ReportingEndpointGroupsSchema(db()))
+ return base::nullopt;
+ // clang-format off
+ std::string reporting_endpoint_groups_migrate_stmt =
+ "INSERT INTO reporting_endpoint_groups (nik, origin_scheme, "
+ " origin_host, origin_port, group_name, is_include_subdomains, "
+ " expires_us_since_epoch, last_access_us_since_epoch) "
+ "SELECT '[]', origin_scheme, origin_host, origin_port, "
+ " group_name, is_include_subdomains, expires_us_since_epoch, "
+ " last_access_us_since_epoch "
+ "FROM reporting_endpoint_groups_old" ;
+ // clang-format on
+ if (!db()->Execute(reporting_endpoint_groups_migrate_stmt.c_str()))
+ return base::nullopt;
+ if (!db()->Execute("DROP TABLE reporting_endpoint_groups_old"))
+ return base::nullopt;
+
+ ++cur_version;
+ meta_table()->SetVersionNumber(cur_version);
+ meta_table()->SetCompatibleVersionNumber(
+ std::min(cur_version, kCompatibleVersionNumber));
+ transaction.Commit();
+ }
+
// Future database upgrade statements go here.
return base::make_optional(cur_version);
}
void SQLitePersistentReportingAndNelStore::Backend::DoCommit() {
- QueueType<url::Origin, NelPolicyInfo> nel_policy_ops;
+ QueueType<NetworkErrorLoggingService::NelPolicyKey, NelPolicyInfo>
+ nel_policy_ops;
QueueType<ReportingEndpointKey, ReportingEndpointInfo> reporting_endpoint_ops;
QueueType<ReportingEndpointGroupKey, ReportingEndpointGroupInfo>
reporting_endpoint_group_ops;
@@ -662,55 +894,58 @@ bool SQLitePersistentReportingAndNelStore::Backend::CommitNelPolicyOperation(
sql::Statement add_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
- "INSERT INTO nel_policies (origin_scheme, origin_host, origin_port, "
- "received_ip_address, report_to, expires_us_since_epoch, "
+ "INSERT INTO nel_policies (nik, origin_scheme, origin_host, origin_port, "
+ "received_ip_address, group_name, expires_us_since_epoch, "
"success_fraction, failure_fraction, is_include_subdomains, "
- "last_access_us_since_epoch) VALUES (?,?,?,?,?,?,?,?,?,?)"));
+ "last_access_us_since_epoch) VALUES (?,?,?,?,?,?,?,?,?,?,?)"));
if (!add_smt.is_valid())
return false;
sql::Statement update_access_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
"UPDATE nel_policies SET last_access_us_since_epoch=? WHERE "
- "origin_scheme=? AND origin_host=? AND origin_port=?"));
+ "nik=? AND origin_scheme=? AND origin_host=? AND origin_port=?"));
if (!update_access_smt.is_valid())
return false;
sql::Statement del_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
"DELETE FROM nel_policies WHERE "
- "origin_scheme=? AND origin_host=? AND origin_port=?"));
+ "nik=? AND origin_scheme=? AND origin_host=? AND origin_port=?"));
if (!del_smt.is_valid())
return false;
const NelPolicyInfo& nel_policy_info = op->data();
switch (op->type()) {
- case PendingOperation<NelPolicyInfo>::Type::ADD:
+ case PendingOperationType::ADD:
add_smt.Reset(true);
- add_smt.BindString(0, nel_policy_info.origin_scheme);
- add_smt.BindString(1, nel_policy_info.origin_host);
- add_smt.BindInt(2, nel_policy_info.origin_port);
- add_smt.BindString(3, nel_policy_info.received_ip_address);
- add_smt.BindString(4, nel_policy_info.report_to);
- add_smt.BindInt64(5, nel_policy_info.expires_us_since_epoch);
- add_smt.BindDouble(6, nel_policy_info.success_fraction);
- add_smt.BindDouble(7, nel_policy_info.failure_fraction);
- add_smt.BindBool(8, nel_policy_info.is_include_subdomains);
- add_smt.BindInt64(9, nel_policy_info.last_access_us_since_epoch);
+ add_smt.BindString(0, nel_policy_info.network_isolation_key_string);
+ add_smt.BindString(1, nel_policy_info.origin_scheme);
+ add_smt.BindString(2, nel_policy_info.origin_host);
+ add_smt.BindInt(3, nel_policy_info.origin_port);
+ add_smt.BindString(4, nel_policy_info.received_ip_address);
+ add_smt.BindString(5, nel_policy_info.report_to);
+ add_smt.BindInt64(6, nel_policy_info.expires_us_since_epoch);
+ add_smt.BindDouble(7, nel_policy_info.success_fraction);
+ add_smt.BindDouble(8, nel_policy_info.failure_fraction);
+ add_smt.BindBool(9, nel_policy_info.is_include_subdomains);
+ add_smt.BindInt64(10, nel_policy_info.last_access_us_since_epoch);
if (!add_smt.Run()) {
DLOG(WARNING) << "Could not add a NEL policy to the DB.";
return false;
}
break;
- case PendingOperation<NelPolicyInfo>::Type::UPDATE_ACCESS_TIME:
+ case PendingOperationType::UPDATE_ACCESS_TIME:
update_access_smt.Reset(true);
update_access_smt.BindInt64(0,
nel_policy_info.last_access_us_since_epoch);
- update_access_smt.BindString(1, nel_policy_info.origin_scheme);
- update_access_smt.BindString(2, nel_policy_info.origin_host);
- update_access_smt.BindInt(3, nel_policy_info.origin_port);
+ update_access_smt.BindString(
+ 1, nel_policy_info.network_isolation_key_string);
+ update_access_smt.BindString(2, nel_policy_info.origin_scheme);
+ update_access_smt.BindString(3, nel_policy_info.origin_host);
+ update_access_smt.BindInt(4, nel_policy_info.origin_port);
if (!update_access_smt.Run()) {
DLOG(WARNING)
<< "Could not update NEL policy last access time in the DB.";
@@ -718,11 +953,12 @@ bool SQLitePersistentReportingAndNelStore::Backend::CommitNelPolicyOperation(
}
break;
- case PendingOperation<NelPolicyInfo>::Type::DELETE:
+ case PendingOperationType::DELETE:
del_smt.Reset(true);
- del_smt.BindString(0, nel_policy_info.origin_scheme);
- del_smt.BindString(1, nel_policy_info.origin_host);
- del_smt.BindInt(2, nel_policy_info.origin_port);
+ del_smt.BindString(0, nel_policy_info.network_isolation_key_string);
+ del_smt.BindString(1, nel_policy_info.origin_scheme);
+ del_smt.BindString(2, nel_policy_info.origin_host);
+ del_smt.BindInt(3, nel_policy_info.origin_port);
if (!del_smt.Run()) {
DLOG(WARNING) << "Could not delete a NEL policy from the DB.";
return false;
@@ -747,16 +983,16 @@ bool SQLitePersistentReportingAndNelStore::Backend::
sql::Statement add_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
- "INSERT INTO reporting_endpoints (origin_scheme, origin_host, "
+ "INSERT INTO reporting_endpoints (nik, origin_scheme, origin_host, "
"origin_port, group_name, url, priority, weight) "
- "VALUES (?,?,?,?,?,?,?)"));
+ "VALUES (?,?,?,?,?,?,?,?)"));
if (!add_smt.is_valid())
return false;
sql::Statement update_details_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
"UPDATE reporting_endpoints SET priority=?, weight=? WHERE "
- "origin_scheme=? AND origin_host=? AND origin_port=? "
+ "nik=? AND origin_scheme=? AND origin_host=? AND origin_port=? "
"AND group_name=? AND url=?"));
if (!update_details_smt.is_valid())
return false;
@@ -764,7 +1000,7 @@ bool SQLitePersistentReportingAndNelStore::Backend::
sql::Statement del_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
"DELETE FROM reporting_endpoints WHERE "
- "origin_scheme=? AND origin_host=? AND origin_port=? "
+ "nik=? AND origin_scheme=? AND origin_host=? AND origin_port=? "
"AND group_name=? AND url=?"));
if (!del_smt.is_valid())
return false;
@@ -772,30 +1008,34 @@ bool SQLitePersistentReportingAndNelStore::Backend::
const ReportingEndpointInfo& reporting_endpoint_info = op->data();
switch (op->type()) {
- case PendingOperation<ReportingEndpointInfo>::Type::ADD:
+ case PendingOperationType::ADD:
add_smt.Reset(true);
- add_smt.BindString(0, reporting_endpoint_info.origin_scheme);
- add_smt.BindString(1, reporting_endpoint_info.origin_host);
- add_smt.BindInt(2, reporting_endpoint_info.origin_port);
- add_smt.BindString(3, reporting_endpoint_info.group_name);
- add_smt.BindString(4, reporting_endpoint_info.url);
- add_smt.BindInt(5, reporting_endpoint_info.priority);
- add_smt.BindInt(6, reporting_endpoint_info.weight);
+ add_smt.BindString(0,
+ reporting_endpoint_info.network_isolation_key_string);
+ add_smt.BindString(1, reporting_endpoint_info.origin_scheme);
+ add_smt.BindString(2, reporting_endpoint_info.origin_host);
+ add_smt.BindInt(3, reporting_endpoint_info.origin_port);
+ add_smt.BindString(4, reporting_endpoint_info.group_name);
+ add_smt.BindString(5, reporting_endpoint_info.url);
+ add_smt.BindInt(6, reporting_endpoint_info.priority);
+ add_smt.BindInt(7, reporting_endpoint_info.weight);
if (!add_smt.Run()) {
DLOG(WARNING) << "Could not add a Reporting endpoint to the DB.";
return false;
}
break;
- case PendingOperation<ReportingEndpointInfo>::Type::UPDATE_DETAILS:
+ case PendingOperationType::UPDATE_DETAILS:
update_details_smt.Reset(true);
update_details_smt.BindInt(0, reporting_endpoint_info.priority);
update_details_smt.BindInt(1, reporting_endpoint_info.weight);
- update_details_smt.BindString(2, reporting_endpoint_info.origin_scheme);
- update_details_smt.BindString(3, reporting_endpoint_info.origin_host);
- update_details_smt.BindInt(4, reporting_endpoint_info.origin_port);
- update_details_smt.BindString(5, reporting_endpoint_info.group_name);
- update_details_smt.BindString(6, reporting_endpoint_info.url);
+ update_details_smt.BindString(
+ 2, reporting_endpoint_info.network_isolation_key_string);
+ update_details_smt.BindString(3, reporting_endpoint_info.origin_scheme);
+ update_details_smt.BindString(4, reporting_endpoint_info.origin_host);
+ update_details_smt.BindInt(5, reporting_endpoint_info.origin_port);
+ update_details_smt.BindString(6, reporting_endpoint_info.group_name);
+ update_details_smt.BindString(7, reporting_endpoint_info.url);
if (!update_details_smt.Run()) {
DLOG(WARNING)
<< "Could not update Reporting endpoint details in the DB.";
@@ -803,13 +1043,15 @@ bool SQLitePersistentReportingAndNelStore::Backend::
}
break;
- case PendingOperation<ReportingEndpointInfo>::Type::DELETE:
+ case PendingOperationType::DELETE:
del_smt.Reset(true);
- del_smt.BindString(0, reporting_endpoint_info.origin_scheme);
- del_smt.BindString(1, reporting_endpoint_info.origin_host);
- del_smt.BindInt(2, reporting_endpoint_info.origin_port);
- del_smt.BindString(3, reporting_endpoint_info.group_name);
- del_smt.BindString(4, reporting_endpoint_info.url);
+ del_smt.BindString(0,
+ reporting_endpoint_info.network_isolation_key_string);
+ del_smt.BindString(1, reporting_endpoint_info.origin_scheme);
+ del_smt.BindString(2, reporting_endpoint_info.origin_host);
+ del_smt.BindInt(3, reporting_endpoint_info.origin_port);
+ del_smt.BindString(4, reporting_endpoint_info.group_name);
+ del_smt.BindString(5, reporting_endpoint_info.url);
if (!del_smt.Run()) {
DLOG(WARNING) << "Could not delete a Reporting endpoint from the DB.";
return false;
@@ -833,16 +1075,17 @@ bool SQLitePersistentReportingAndNelStore::Backend::
sql::Statement add_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
- "INSERT INTO reporting_endpoint_groups (origin_scheme, origin_host, "
+ "INSERT INTO reporting_endpoint_groups (nik, origin_scheme, origin_host, "
"origin_port, group_name, is_include_subdomains, expires_us_since_epoch, "
- "last_access_us_since_epoch) VALUES (?,?,?,?,?,?,?)"));
+ "last_access_us_since_epoch) VALUES (?,?,?,?,?,?,?,?)"));
if (!add_smt.is_valid())
return false;
sql::Statement update_access_smt(db()->GetCachedStatement(
SQL_FROM_HERE,
"UPDATE reporting_endpoint_groups SET last_access_us_since_epoch=? WHERE "
- "origin_scheme=? AND origin_host=? AND origin_port=? AND group_name=?"));
+ "nik=? AND origin_scheme=? AND origin_host=? AND origin_port=? AND "
+ "group_name=?"));
if (!update_access_smt.is_valid())
return false;
@@ -850,47 +1093,53 @@ bool SQLitePersistentReportingAndNelStore::Backend::
SQL_FROM_HERE,
"UPDATE reporting_endpoint_groups SET is_include_subdomains=?, "
"expires_us_since_epoch=?, last_access_us_since_epoch=? WHERE "
- "origin_scheme=? AND origin_host=? AND origin_port=? AND group_name=?"));
+ "nik=? AND origin_scheme=? AND origin_host=? AND origin_port=? AND "
+ "group_name=?"));
if (!update_details_smt.is_valid())
return false;
- sql::Statement del_smt(db()->GetCachedStatement(
- SQL_FROM_HERE,
- "DELETE FROM reporting_endpoint_groups WHERE "
- "origin_scheme=? AND origin_host=? AND origin_port=? AND group_name=?"));
+ sql::Statement del_smt(
+ db()->GetCachedStatement(SQL_FROM_HERE,
+ "DELETE FROM reporting_endpoint_groups WHERE "
+ "nik=? AND origin_scheme=? AND origin_host=? "
+ "AND origin_port=? AND group_name=?"));
if (!del_smt.is_valid())
return false;
const ReportingEndpointGroupInfo& reporting_endpoint_group_info = op->data();
switch (op->type()) {
- case PendingOperation<ReportingEndpointGroupInfo>::Type::ADD:
+ case PendingOperationType::ADD:
add_smt.Reset(true);
- add_smt.BindString(0, reporting_endpoint_group_info.origin_scheme);
- add_smt.BindString(1, reporting_endpoint_group_info.origin_host);
- add_smt.BindInt(2, reporting_endpoint_group_info.origin_port);
- add_smt.BindString(3, reporting_endpoint_group_info.group_name);
- add_smt.BindBool(4, reporting_endpoint_group_info.is_include_subdomains);
- add_smt.BindInt64(5,
+ add_smt.BindString(
+ 0, reporting_endpoint_group_info.network_isolation_key_string);
+ add_smt.BindString(1, reporting_endpoint_group_info.origin_scheme);
+ add_smt.BindString(2, reporting_endpoint_group_info.origin_host);
+ add_smt.BindInt(3, reporting_endpoint_group_info.origin_port);
+ add_smt.BindString(4, reporting_endpoint_group_info.group_name);
+ add_smt.BindBool(5, reporting_endpoint_group_info.is_include_subdomains);
+ add_smt.BindInt64(6,
reporting_endpoint_group_info.expires_us_since_epoch);
add_smt.BindInt64(
- 6, reporting_endpoint_group_info.last_access_us_since_epoch);
+ 7, reporting_endpoint_group_info.last_access_us_since_epoch);
if (!add_smt.Run()) {
DLOG(WARNING) << "Could not add a Reporting endpoint group to the DB.";
return false;
}
break;
- case PendingOperation<ReportingEndpointGroupInfo>::Type::UPDATE_ACCESS_TIME:
+ case PendingOperationType::UPDATE_ACCESS_TIME:
update_access_smt.Reset(true);
update_access_smt.BindInt64(
0, reporting_endpoint_group_info.last_access_us_since_epoch);
- update_access_smt.BindString(1,
- reporting_endpoint_group_info.origin_scheme);
+ update_access_smt.BindString(
+ 1, reporting_endpoint_group_info.network_isolation_key_string);
update_access_smt.BindString(2,
+ reporting_endpoint_group_info.origin_scheme);
+ update_access_smt.BindString(3,
reporting_endpoint_group_info.origin_host);
- update_access_smt.BindInt(3, reporting_endpoint_group_info.origin_port);
- update_access_smt.BindString(4, reporting_endpoint_group_info.group_name);
+ update_access_smt.BindInt(4, reporting_endpoint_group_info.origin_port);
+ update_access_smt.BindString(5, reporting_endpoint_group_info.group_name);
if (!update_access_smt.Run()) {
DLOG(WARNING)
<< "Could not update Reporting endpoint group last access "
@@ -899,7 +1148,7 @@ bool SQLitePersistentReportingAndNelStore::Backend::
}
break;
- case PendingOperation<ReportingEndpointGroupInfo>::Type::UPDATE_DETAILS:
+ case PendingOperationType::UPDATE_DETAILS:
update_details_smt.Reset(true);
update_details_smt.BindBool(
0, reporting_endpoint_group_info.is_include_subdomains);
@@ -908,11 +1157,13 @@ bool SQLitePersistentReportingAndNelStore::Backend::
update_details_smt.BindInt64(
2, reporting_endpoint_group_info.last_access_us_since_epoch);
update_details_smt.BindString(
- 3, reporting_endpoint_group_info.origin_scheme);
- update_details_smt.BindString(4,
+ 3, reporting_endpoint_group_info.network_isolation_key_string);
+ update_details_smt.BindString(
+ 4, reporting_endpoint_group_info.origin_scheme);
+ update_details_smt.BindString(5,
reporting_endpoint_group_info.origin_host);
- update_details_smt.BindInt(5, reporting_endpoint_group_info.origin_port);
- update_details_smt.BindString(6,
+ update_details_smt.BindInt(6, reporting_endpoint_group_info.origin_port);
+ update_details_smt.BindString(7,
reporting_endpoint_group_info.group_name);
if (!update_details_smt.Run()) {
DLOG(WARNING)
@@ -921,12 +1172,14 @@ bool SQLitePersistentReportingAndNelStore::Backend::
}
break;
- case PendingOperation<ReportingEndpointGroupInfo>::Type::DELETE:
+ case PendingOperationType::DELETE:
del_smt.Reset(true);
- del_smt.BindString(0, reporting_endpoint_group_info.origin_scheme);
- del_smt.BindString(1, reporting_endpoint_group_info.origin_host);
- del_smt.BindInt(2, reporting_endpoint_group_info.origin_port);
- del_smt.BindString(3, reporting_endpoint_group_info.group_name);
+ del_smt.BindString(
+ 0, reporting_endpoint_group_info.network_isolation_key_string);
+ del_smt.BindString(1, reporting_endpoint_group_info.origin_scheme);
+ del_smt.BindString(2, reporting_endpoint_group_info.origin_host);
+ del_smt.BindInt(3, reporting_endpoint_group_info.origin_port);
+ del_smt.BindString(4, reporting_endpoint_group_info.group_name);
if (!del_smt.Run()) {
DLOG(WARNING)
<< "Could not delete a Reporting endpoint group from the DB.";
@@ -975,35 +1228,35 @@ void SQLitePersistentReportingAndNelStore::Backend::MaybeCoalesceOperations(
DCHECK(!ops_for_key->empty());
switch (new_op->type()) {
- case PendingOperation<DataType>::Type::DELETE:
+ case PendingOperationType::DELETE:
// A delete makes all previous operations irrelevant.
ops_for_key->clear();
break;
- case PendingOperation<DataType>::Type::UPDATE_ACCESS_TIME:
+ case PendingOperationType::UPDATE_ACCESS_TIME:
if (ops_for_key->back()->type() ==
- PendingOperation<DataType>::Type::UPDATE_ACCESS_TIME) {
+ PendingOperationType::UPDATE_ACCESS_TIME) {
// Updating the access time twice in a row is equivalent to just the
// latter update.
ops_for_key->pop_back();
}
break;
- case PendingOperation<DataType>::Type::UPDATE_DETAILS:
+ case PendingOperationType::UPDATE_DETAILS:
while (!ops_for_key->empty() &&
// Updating the details twice in a row is equivalent to just the
// latter update.
(ops_for_key->back()->type() ==
- PendingOperation<DataType>::Type::UPDATE_DETAILS ||
+ PendingOperationType::UPDATE_DETAILS ||
// UPDATE_DETAILS also updates the access time, so either type of
// update operation can be discarded.
ops_for_key->back()->type() ==
- PendingOperation<DataType>::Type::UPDATE_ACCESS_TIME)) {
+ PendingOperationType::UPDATE_ACCESS_TIME)) {
ops_for_key->pop_back();
}
break;
- case PendingOperation<DataType>::Type::ADD:
+ case PendingOperationType::ADD:
// Nothing special is done for an add operation. If it is overwriting an
// existing entry, it will be preceded by at most one delete.
DCHECK_LE(ops_for_key->size(), 1u);
@@ -1050,9 +1303,10 @@ void SQLitePersistentReportingAndNelStore::Backend::
}
sql::Statement smt(db()->GetUniqueStatement(
- "SELECT origin_scheme, origin_host, origin_port, received_ip_address, "
- "report_to, expires_us_since_epoch, success_fraction, failure_fraction, "
- "is_include_subdomains, last_access_us_since_epoch FROM nel_policies"));
+ "SELECT nik, origin_scheme, origin_host, origin_port, "
+ "received_ip_address, group_name, expires_us_since_epoch, "
+ "success_fraction, failure_fraction, is_include_subdomains, "
+ "last_access_us_since_epoch FROM nel_policies"));
if (!smt.is_valid()) {
Reset();
PostClientTask(
@@ -1064,22 +1318,28 @@ void SQLitePersistentReportingAndNelStore::Backend::
}
while (smt.Step()) {
- // Reconstitute a NEL policy from the fields stored in the database.
+ // Attempt to reconstitute a NEL policy from the fields stored in the
+ // database.
+ NetworkIsolationKey network_isolation_key;
+ if (!NetworkIsolationKeyFromString(smt.ColumnString(0),
+ &network_isolation_key))
+ continue;
NetworkErrorLoggingService::NelPolicy policy;
- policy.origin = url::Origin::CreateFromNormalizedTuple(
- /* origin_scheme = */ smt.ColumnString(0),
- /* origin_host = */ smt.ColumnString(1),
- /* origin_port = */ smt.ColumnInt(2));
- if (!policy.received_ip_address.AssignFromIPLiteral(smt.ColumnString(3)))
+ policy.key = NetworkErrorLoggingService::NelPolicyKey(
+ network_isolation_key, url::Origin::CreateFromNormalizedTuple(
+ /* origin_scheme = */ smt.ColumnString(1),
+ /* origin_host = */ smt.ColumnString(2),
+ /* origin_port = */ smt.ColumnInt(3)));
+ if (!policy.received_ip_address.AssignFromIPLiteral(smt.ColumnString(4)))
policy.received_ip_address = IPAddress();
- policy.report_to = smt.ColumnString(4);
+ policy.report_to = smt.ColumnString(5);
policy.expires = base::Time::FromDeltaSinceWindowsEpoch(
- base::TimeDelta::FromMicroseconds(smt.ColumnInt64(5)));
- policy.success_fraction = smt.ColumnDouble(6);
- policy.failure_fraction = smt.ColumnDouble(7);
- policy.include_subdomains = smt.ColumnBool(8);
+ base::TimeDelta::FromMicroseconds(smt.ColumnInt64(6)));
+ policy.success_fraction = smt.ColumnDouble(7);
+ policy.failure_fraction = smt.ColumnDouble(8);
+ policy.include_subdomains = smt.ColumnBool(9);
policy.last_used = base::Time::FromDeltaSinceWindowsEpoch(
- base::TimeDelta::FromMicroseconds(smt.ColumnInt64(9)));
+ base::TimeDelta::FromMicroseconds(smt.ColumnInt64(10)));
loaded_policies.push_back(std::move(policy));
}
@@ -1125,10 +1385,10 @@ void SQLitePersistentReportingAndNelStore::Backend::
}
sql::Statement endpoints_smt(db()->GetUniqueStatement(
- "SELECT origin_scheme, origin_host, origin_port, group_name, "
+ "SELECT nik, origin_scheme, origin_host, origin_port, group_name, "
"url, priority, weight FROM reporting_endpoints"));
sql::Statement endpoint_groups_smt(db()->GetUniqueStatement(
- "SELECT origin_scheme, origin_host, origin_port, group_name, "
+ "SELECT nik, origin_scheme, origin_host, origin_port, group_name, "
"is_include_subdomains, expires_us_since_epoch, "
"last_access_us_since_epoch FROM reporting_endpoint_groups"));
if (!endpoints_smt.is_valid() || !endpoint_groups_smt.is_valid()) {
@@ -1143,42 +1403,51 @@ void SQLitePersistentReportingAndNelStore::Backend::
}
while (endpoints_smt.Step()) {
- // Reconstitute a ReportingEndpoint from the fields stored in the database.
+ // Attempt to reconstitute a ReportingEndpoint from the fields stored in the
+ // database.
+ NetworkIsolationKey network_isolation_key;
+ if (!NetworkIsolationKeyFromString(endpoints_smt.ColumnString(0),
+ &network_isolation_key))
+ continue;
ReportingEndpointGroupKey group_key(
- /* network_isolation_key = */ NetworkIsolationKey::Todo(),
+ network_isolation_key,
/* origin = */
url::Origin::CreateFromNormalizedTuple(
- /* origin_scheme = */ endpoints_smt.ColumnString(0),
- /* origin_host = */ endpoints_smt.ColumnString(1),
- /* origin_port = */ endpoints_smt.ColumnInt(2)),
- /* group_name = */ endpoints_smt.ColumnString(3));
+ /* origin_scheme = */ endpoints_smt.ColumnString(1),
+ /* origin_host = */ endpoints_smt.ColumnString(2),
+ /* origin_port = */ endpoints_smt.ColumnInt(3)),
+ /* group_name = */ endpoints_smt.ColumnString(4));
ReportingEndpoint::EndpointInfo endpoint_info;
- endpoint_info.url = GURL(endpoints_smt.ColumnString(4));
- endpoint_info.priority = endpoints_smt.ColumnInt(5);
- endpoint_info.weight = endpoints_smt.ColumnInt(6);
+ endpoint_info.url = GURL(endpoints_smt.ColumnString(5));
+ endpoint_info.priority = endpoints_smt.ColumnInt(6);
+ endpoint_info.weight = endpoints_smt.ColumnInt(7);
loaded_endpoints.emplace_back(std::move(group_key),
std::move(endpoint_info));
}
while (endpoint_groups_smt.Step()) {
- // Reconstitute a CachedReportingEndpointGroup from the fields stored in the
- // database.
+ // Attempt to reconstitute a CachedReportingEndpointGroup from the fields
+ // stored in the database.
+ NetworkIsolationKey network_isolation_key;
+ if (!NetworkIsolationKeyFromString(endpoint_groups_smt.ColumnString(0),
+ &network_isolation_key))
+ continue;
ReportingEndpointGroupKey group_key(
- /* network_isolation_key = */ NetworkIsolationKey::Todo(),
+ network_isolation_key,
/* origin = */
url::Origin::CreateFromNormalizedTuple(
- /* origin_scheme = */ endpoint_groups_smt.ColumnString(0),
- /* origin_host = */ endpoint_groups_smt.ColumnString(1),
- /* origin_port = */ endpoint_groups_smt.ColumnInt(2)),
- /* group_name = */ endpoint_groups_smt.ColumnString(3));
- OriginSubdomains include_subdomains = endpoint_groups_smt.ColumnBool(4)
+ /* origin_scheme = */ endpoint_groups_smt.ColumnString(1),
+ /* origin_host = */ endpoint_groups_smt.ColumnString(2),
+ /* origin_port = */ endpoint_groups_smt.ColumnInt(3)),
+ /* group_name = */ endpoint_groups_smt.ColumnString(4));
+ OriginSubdomains include_subdomains = endpoint_groups_smt.ColumnBool(5)
? OriginSubdomains::INCLUDE
: OriginSubdomains::EXCLUDE;
base::Time expires = base::Time::FromDeltaSinceWindowsEpoch(
- base::TimeDelta::FromMicroseconds(endpoint_groups_smt.ColumnInt64(5)));
- base::Time last_used = base::Time::FromDeltaSinceWindowsEpoch(
base::TimeDelta::FromMicroseconds(endpoint_groups_smt.ColumnInt64(6)));
+ base::Time last_used = base::Time::FromDeltaSinceWindowsEpoch(
+ base::TimeDelta::FromMicroseconds(endpoint_groups_smt.ColumnInt64(7)));
loaded_endpoint_groups.emplace_back(std::move(group_key),
include_subdomains, expires, last_used);
diff --git a/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store_unittest.cc b/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store_unittest.cc
index aed51b9a5d7..73245eef71e 100644
--- a/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store_unittest.cc
+++ b/chromium/net/extras/sqlite/sqlite_persistent_reporting_and_nel_store_unittest.cc
@@ -15,11 +15,14 @@
#include "base/synchronization/waitable_event.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "net/base/features.h"
+#include "net/base/network_isolation_key.h"
#include "net/network_error_logging/network_error_logging_service.h"
#include "net/reporting/reporting_test_util.h"
#include "net/test/test_with_task_environment.h"
@@ -85,7 +88,10 @@ const std::vector<TestCase> kCoalescingTestcasesForUpdateDetails = {
class SQLitePersistentReportingAndNelStoreTest
: public TestWithTaskEnvironment {
public:
- SQLitePersistentReportingAndNelStoreTest() {}
+ SQLitePersistentReportingAndNelStoreTest() {
+ feature_list_.InitAndEnableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+ }
void CreateStore() {
store_ = std::make_unique<SQLitePersistentReportingAndNelStore>(
@@ -177,10 +183,13 @@ class SQLitePersistentReportingAndNelStoreTest
void TearDown() override { DestroyStore(); }
- NetworkErrorLoggingService::NelPolicy MakeNelPolicy(url::Origin origin,
- base::Time last_used) {
+ NetworkErrorLoggingService::NelPolicy MakeNelPolicy(
+ const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
+ base::Time last_used) {
NetworkErrorLoggingService::NelPolicy policy;
- policy.origin = origin;
+ policy.key =
+ NetworkErrorLoggingService::NelPolicyKey(network_isolation_key, origin);
policy.received_ip_address = IPAddress::IPv4Localhost();
policy.report_to = "group";
policy.expires = kExpires;
@@ -192,9 +201,10 @@ class SQLitePersistentReportingAndNelStoreTest
}
ReportingEndpoint MakeReportingEndpoint(
- url::Origin origin,
- std::string group_name,
- GURL url,
+ const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
+ const std::string& group_name,
+ const GURL& url,
int priority = ReportingEndpoint::EndpointInfo::kDefaultPriority,
int weight = ReportingEndpoint::EndpointInfo::kDefaultWeight) {
ReportingEndpoint::EndpointInfo info;
@@ -202,23 +212,36 @@ class SQLitePersistentReportingAndNelStoreTest
info.priority = priority;
info.weight = weight;
ReportingEndpoint endpoint(
- ReportingEndpointGroupKey(NetworkIsolationKey(), origin, group_name),
+ ReportingEndpointGroupKey(network_isolation_key, origin, group_name),
std::move(info));
return endpoint;
}
CachedReportingEndpointGroup MakeReportingEndpointGroup(
- url::Origin origin,
- std::string group_name,
+ const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
+ const std::string& group_name,
base::Time last_used,
OriginSubdomains include_subdomains = OriginSubdomains::DEFAULT,
base::Time expires = kExpires) {
return CachedReportingEndpointGroup(
- ReportingEndpointGroupKey(NetworkIsolationKey(), origin, group_name),
+ ReportingEndpointGroupKey(network_isolation_key, origin, group_name),
include_subdomains, expires, last_used);
}
protected:
+ base::test::ScopedFeatureList feature_list_;
+
+ // Use origins distinct from those used in origin fields of keys, to avoid any
+ // risk of tests passing due to comparing origins that are the same but come
+ // from different sources.
+ const NetworkIsolationKey kNik1_ = NetworkIsolationKey(
+ url::Origin::Create(GURL("https://top-frame-origin-nik1.test")),
+ url::Origin::Create(GURL("https://frame-origin-nik1.test")));
+ const NetworkIsolationKey kNik2_ = NetworkIsolationKey(
+ url::Origin::Create(GURL("https://top-frame-origin-nik2.test")),
+ url::Origin::Create(GURL("https://frame-origin-nik2.test")));
+
base::ScopedTempDir temp_dir_;
std::unique_ptr<SQLitePersistentReportingAndNelStore> store_;
const scoped_refptr<base::SequencedTaskRunner> client_task_runner_ =
@@ -242,8 +265,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, TestInvalidMetaTableRecovery) {
CreateStore();
InitializeStore();
base::Time now = base::Time::Now();
- NetworkErrorLoggingService::NelPolicy policy1 =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.foo.test")), now);
+ NetworkErrorLoggingService::NelPolicy policy1 = MakeNelPolicy(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), now);
store_->AddNelPolicy(policy1);
// Close and reopen the database.
@@ -254,7 +277,7 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, TestInvalidMetaTableRecovery) {
std::vector<NetworkErrorLoggingService::NelPolicy> policies;
LoadNelPolicies(&policies);
ASSERT_EQ(1u, policies.size());
- EXPECT_EQ(policy1.origin, policies[0].origin);
+ EXPECT_EQ(policy1.key, policies[0].key);
EXPECT_EQ(policy1.received_ip_address, policies[0].received_ip_address);
EXPECT_EQ(policy1.report_to, policies[0].report_to);
EXPECT_TRUE(WithinOneMicrosecond(policy1.expires, policies[0].expires));
@@ -286,15 +309,15 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, TestInvalidMetaTableRecovery) {
hist_tester.ExpectUniqueSample("ReportingAndNEL.CorruptMetaTable", 1, 1);
// Verify that, after, recovery, the database persists properly.
- NetworkErrorLoggingService::NelPolicy policy2 =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.bar.test")), now);
+ NetworkErrorLoggingService::NelPolicy policy2 = MakeNelPolicy(
+ kNik2_, url::Origin::Create(GURL("https://www.bar.test")), now);
store_->AddNelPolicy(policy2);
DestroyStore();
CreateStore();
LoadNelPolicies(&policies);
ASSERT_EQ(1u, policies.size());
- EXPECT_EQ(policy2.origin, policies[0].origin);
+ EXPECT_EQ(policy2.key, policies[0].key);
EXPECT_EQ(policy2.received_ip_address, policies[0].received_ip_address);
EXPECT_EQ(policy2.report_to, policies[0].report_to);
EXPECT_TRUE(WithinOneMicrosecond(policy2.expires, policies[0].expires));
@@ -308,8 +331,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, PersistNelPolicy) {
CreateStore();
InitializeStore();
base::Time now = base::Time::Now();
- NetworkErrorLoggingService::NelPolicy policy =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.foo.test")), now);
+ NetworkErrorLoggingService::NelPolicy policy = MakeNelPolicy(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), now);
store_->AddNelPolicy(policy);
// Close and reopen the database.
@@ -320,7 +343,7 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, PersistNelPolicy) {
std::vector<NetworkErrorLoggingService::NelPolicy> policies;
LoadNelPolicies(&policies);
ASSERT_EQ(1u, policies.size());
- EXPECT_EQ(policy.origin, policies[0].origin);
+ EXPECT_EQ(policy.key, policies[0].key);
EXPECT_EQ(policy.received_ip_address, policies[0].received_ip_address);
EXPECT_EQ(policy.report_to, policies[0].report_to);
EXPECT_TRUE(WithinOneMicrosecond(policy.expires, policies[0].expires));
@@ -349,8 +372,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, UpdateNelPolicyAccessTime) {
CreateStore();
InitializeStore();
base::Time now = base::Time::Now();
- NetworkErrorLoggingService::NelPolicy policy =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.foo.test")), now);
+ NetworkErrorLoggingService::NelPolicy policy = MakeNelPolicy(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), now);
store_->AddNelPolicy(policy);
policy.last_used = now + base::TimeDelta::FromDays(1);
@@ -364,7 +387,7 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, UpdateNelPolicyAccessTime) {
std::vector<NetworkErrorLoggingService::NelPolicy> policies;
LoadNelPolicies(&policies);
ASSERT_EQ(1u, policies.size());
- EXPECT_EQ(policy.origin, policies[0].origin);
+ EXPECT_EQ(policy.key, policies[0].key);
EXPECT_TRUE(WithinOneMicrosecond(policy.last_used, policies[0].last_used));
}
@@ -372,10 +395,10 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, DeleteNelPolicy) {
CreateStore();
InitializeStore();
base::Time now = base::Time::Now();
- NetworkErrorLoggingService::NelPolicy policy1 =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.foo.test")), now);
- NetworkErrorLoggingService::NelPolicy policy2 =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.bar.test")), now);
+ NetworkErrorLoggingService::NelPolicy policy1 = MakeNelPolicy(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), now);
+ NetworkErrorLoggingService::NelPolicy policy2 = MakeNelPolicy(
+ kNik2_, url::Origin::Create(GURL("https://www.bar.test")), now);
store_->AddNelPolicy(policy1);
store_->AddNelPolicy(policy2);
@@ -389,7 +412,7 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, DeleteNelPolicy) {
std::vector<NetworkErrorLoggingService::NelPolicy> policies;
LoadNelPolicies(&policies);
ASSERT_EQ(1u, policies.size());
- EXPECT_EQ(policy2.origin, policies[0].origin);
+ EXPECT_EQ(policy2.key, policies[0].key);
// Delete after having closed and reopened.
store_->DeleteNelPolicy(policy2);
@@ -404,20 +427,40 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, DeleteNelPolicy) {
TEST_F(SQLitePersistentReportingAndNelStoreTest,
NelPolicyUniquenessConstraint) {
- const url::Origin kOrigin = url::Origin::Create(GURL("https://www.foo.test"));
+ const url::Origin kOrigin1 =
+ url::Origin::Create(GURL("https://www.bar.test"));
+ const url::Origin kOrigin2 =
+ url::Origin::Create(GURL("https://www.foo.test"));
CreateStore();
InitializeStore();
base::Time now = base::Time::Now();
- NetworkErrorLoggingService::NelPolicy policy1 = MakeNelPolicy(kOrigin, now);
- // Different NEL policy (different last_used) with the same origin.
- NetworkErrorLoggingService::NelPolicy policy2 =
- MakeNelPolicy(kOrigin, now + base::TimeDelta::FromDays(1));
+ base::Time later = now + base::TimeDelta::FromDays(1);
+ // Add 3 entries, 2 identical except for NIK, 2 identical except for origin.
+ // Entries should not conflict with each other. These are added in lexical
+ // order.
+ NetworkErrorLoggingService::NelPolicy policy1 =
+ MakeNelPolicy(kNik1_, kOrigin1, now);
+ NetworkErrorLoggingService::NelPolicy policy2 =
+ MakeNelPolicy(kNik1_, kOrigin2, now);
+ NetworkErrorLoggingService::NelPolicy policy3 =
+ MakeNelPolicy(kNik2_, kOrigin1, now);
store_->AddNelPolicy(policy1);
- // Adding a policy with the same origin should trigger a warning and fail to
- // execute.
store_->AddNelPolicy(policy2);
+ store_->AddNelPolicy(policy3);
+
+ // Add policies that are identical except for expiration time. These should
+ // trigger a warning an fail to execute.
+ NetworkErrorLoggingService::NelPolicy policy4 =
+ MakeNelPolicy(kNik1_, kOrigin1, later);
+ NetworkErrorLoggingService::NelPolicy policy5 =
+ MakeNelPolicy(kNik1_, kOrigin2, later);
+ NetworkErrorLoggingService::NelPolicy policy6 =
+ MakeNelPolicy(kNik2_, kOrigin1, later);
+ store_->AddNelPolicy(policy4);
+ store_->AddNelPolicy(policy5);
+ store_->AddNelPolicy(policy6);
// Close and reopen the database.
DestroyStore();
@@ -425,15 +468,25 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
std::vector<NetworkErrorLoggingService::NelPolicy> policies;
LoadNelPolicies(&policies);
- // Only the first policy we added should be in the store.
- ASSERT_EQ(1u, policies.size());
- EXPECT_EQ(policy1.origin, policies[0].origin);
+
+ // Only the first 3 policies should be in the store.
+
+ ASSERT_EQ(3u, policies.size());
+
+ EXPECT_EQ(policy1.key, policies[0].key);
EXPECT_TRUE(WithinOneMicrosecond(policy1.last_used, policies[0].last_used));
+
+ EXPECT_EQ(policy2.key, policies[1].key);
+ EXPECT_TRUE(WithinOneMicrosecond(policy2.last_used, policies[1].last_used));
+
+ EXPECT_EQ(policy3.key, policies[2].key);
+ EXPECT_TRUE(WithinOneMicrosecond(policy3.last_used, policies[2].last_used));
}
TEST_F(SQLitePersistentReportingAndNelStoreTest, CoalesceNelPolicyOperations) {
- NetworkErrorLoggingService::NelPolicy policy = MakeNelPolicy(
- url::Origin::Create(GURL("https://www.foo.test")), base::Time::Now());
+ NetworkErrorLoggingService::NelPolicy policy =
+ MakeNelPolicy(kNik1_, url::Origin::Create(GURL("https://www.foo.test")),
+ base::Time::Now());
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
@@ -489,10 +542,14 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
InitializeStore();
base::Time now = base::Time::Now();
- NetworkErrorLoggingService::NelPolicy policy1 =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.foo.test")), now);
- NetworkErrorLoggingService::NelPolicy policy2 =
- MakeNelPolicy(url::Origin::Create(GURL("https://www.bar.test")), now);
+ NetworkErrorLoggingService::NelPolicy policy1 = MakeNelPolicy(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), now);
+ // Only has different host.
+ NetworkErrorLoggingService::NelPolicy policy2 = MakeNelPolicy(
+ kNik1_, url::Origin::Create(GURL("https://www.bar.test")), now);
+ // Only has different NetworkIsolationKey.
+ NetworkErrorLoggingService::NelPolicy policy3 = MakeNelPolicy(
+ kNik2_, url::Origin::Create(GURL("https://www.foo.test")), now);
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
@@ -504,13 +561,106 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
base::Unretained(this), &event));
- // Delete on |policy2| should not cancel addition of unrelated |policy1|.
+ // Delete on |policy2| and |policy3| should not cancel addition of unrelated
+ // |policy1|.
store_->AddNelPolicy(policy1);
store_->DeleteNelPolicy(policy2);
- EXPECT_EQ(2u, store_->GetQueueLengthForTesting());
+ store_->DeleteNelPolicy(policy3);
+ EXPECT_EQ(3u, store_->GetQueueLengthForTesting());
+
+ event.Signal();
+ RunUntilIdle();
+}
+
+TEST_F(SQLitePersistentReportingAndNelStoreTest,
+ DontPersistNelPoliciesWithTransientNetworkIsolationKeys) {
+ CreateStore();
+ InitializeStore();
+
+ base::Time now = base::Time::Now();
+ NetworkErrorLoggingService::NelPolicy policy =
+ MakeNelPolicy(NetworkIsolationKey::CreateTransient(),
+ url::Origin::Create(GURL("https://www.foo.test")), now);
+
+ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
+ base::WaitableEvent::InitialState::NOT_SIGNALED);
+
+ // Wedge the background thread to make sure it doesn't start consuming the
+ // queue.
+ background_task_runner_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
+ base::Unretained(this), &event));
+
+ store_->AddNelPolicy(policy);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+ store_->UpdateNelPolicyAccessTime(policy);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+ store_->DeleteNelPolicy(policy);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+
+ event.Signal();
+ RunUntilIdle();
+
+ // Close and reopen the database.
+ DestroyStore();
+ CreateStore();
+
+ std::vector<NetworkErrorLoggingService::NelPolicy> policies;
+ LoadNelPolicies(&policies);
+ EXPECT_EQ(0u, policies.size());
+}
+
+TEST_F(SQLitePersistentReportingAndNelStoreTest,
+ NelPoliciesRestoredWithNetworkIsolationKeysDisabled) {
+ CreateStore();
+ InitializeStore();
+
+ base::Time now = base::Time::Now();
+ // Policy with non-empty NetworkIsolationKey.
+ NetworkErrorLoggingService::NelPolicy policy = MakeNelPolicy(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), now);
+
+ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
+ base::WaitableEvent::InitialState::NOT_SIGNALED);
+
+ // Wedge the background thread to make sure it doesn't start consuming the
+ // queue.
+ background_task_runner_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
+ base::Unretained(this), &event));
+
+ store_->AddNelPolicy(policy);
+ EXPECT_EQ(1u, store_->GetQueueLengthForTesting());
event.Signal();
RunUntilIdle();
+
+ // Close the database, disable kPartitionNelAndReportingByNetworkIsolationKey,
+ // and re-open it.
+ DestroyStore();
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+ CreateStore();
+ std::vector<NetworkErrorLoggingService::NelPolicy> policies;
+ LoadNelPolicies(&policies);
+
+ // No entries should be restored.
+ ASSERT_EQ(0u, policies.size());
+
+ // Now reload the store with kPartitionNelAndReportingByNetworkIsolationKey
+ // enabled again.
+ DestroyStore();
+ feature_list.Reset();
+ CreateStore();
+ LoadNelPolicies(&policies);
+
+ // The entry is back!
+ ASSERT_EQ(1u, policies.size());
+ EXPECT_EQ(policy.key, policies[0].key);
+ EXPECT_TRUE(WithinOneMicrosecond(policy.expires, policies[0].expires));
}
// These tests test that a SQLitePersistentReportingAndNelStore
@@ -545,10 +695,12 @@ class SQLitePersistNelTest : public SQLitePersistentReportingAndNelStoreTest {
}
NetworkErrorLoggingService::RequestDetails MakeRequestDetails(
- GURL url,
+ const NetworkIsolationKey& network_isolation_key,
+ const GURL& url,
Error error_type) {
NetworkErrorLoggingService::RequestDetails details;
+ details.network_isolation_key = network_isolation_key;
details.uri = url;
details.referrer = GURL("https://referrer.com/");
details.user_agent = "Mozilla/1.0";
@@ -571,18 +723,18 @@ class SQLitePersistNelTest : public SQLitePersistentReportingAndNelStoreTest {
TEST_F(SQLitePersistNelTest, AddAndRetrieveNelPolicy) {
const GURL kUrl("https://www.foo.test");
const url::Origin kOrigin = url::Origin::Create(kUrl);
+ const NetworkErrorLoggingService::NelPolicyKey kKey(kNik1_, kOrigin);
- service_->OnHeader(kOrigin, kServerIP, kHeader);
+ service_->OnHeader(kNik1_, kOrigin, kServerIP, kHeader);
RunUntilIdle();
- EXPECT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin));
+ EXPECT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey));
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik1_, kUrl, ERR_INVALID_RESPONSE));
RunUntilIdle();
- EXPECT_EQ(1u, service_->GetPolicyOriginsForTesting().count(
- url::Origin::Create(kUrl)));
+ EXPECT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey));
EXPECT_THAT(reporting_service_->reports(),
testing::ElementsAre(ReportUrlIs(kUrl)));
@@ -591,32 +743,34 @@ TEST_F(SQLitePersistNelTest, AddAndRetrieveNelPolicy) {
TEST_F(SQLitePersistNelTest, AddAndDeleteNelPolicy) {
const GURL kUrl("https://www.foo.test");
const url::Origin kOrigin = url::Origin::Create(kUrl);
+ const NetworkErrorLoggingService::NelPolicyKey kKey(kNik1_, kOrigin);
- service_->OnHeader(kOrigin, kServerIP, kHeader);
+ service_->OnHeader(kNik1_, kOrigin, kServerIP, kHeader);
RunUntilIdle();
- EXPECT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin));
+ EXPECT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey));
SimulateRestart();
// Deletes the stored policy.
- service_->OnHeader(kOrigin, kServerIP, kHeaderMaxAge0);
+ service_->OnHeader(kNik1_, kOrigin, kServerIP, kHeaderMaxAge0);
RunUntilIdle();
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey));
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik1_, kUrl, ERR_INVALID_RESPONSE));
RunUntilIdle();
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey));
EXPECT_EQ(0u, reporting_service_->reports().size());
}
TEST_F(SQLitePersistNelTest, ExpirationTimeIsPersisted) {
const GURL kUrl("https://www.foo.test");
const url::Origin kOrigin = url::Origin::Create(kUrl);
+ const NetworkIsolationKey kNik;
- service_->OnHeader(kOrigin, kServerIP, kHeader);
+ service_->OnHeader(kNik, kOrigin, kServerIP, kHeader);
RunUntilIdle();
// Makes the policy we just added expired.
@@ -624,17 +778,17 @@ TEST_F(SQLitePersistNelTest, ExpirationTimeIsPersisted) {
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik, kUrl, ERR_INVALID_RESPONSE));
RunUntilIdle();
EXPECT_EQ(0u, reporting_service_->reports().size());
// Add the policy again so that it is not expired.
- service_->OnHeader(kOrigin, kServerIP, kHeader);
+ service_->OnHeader(kNik, kOrigin, kServerIP, kHeader);
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik, kUrl, ERR_INVALID_RESPONSE));
RunUntilIdle();
EXPECT_THAT(reporting_service_->reports(),
@@ -645,14 +799,14 @@ TEST_F(SQLitePersistNelTest, OnRequestUpdatesAccessTime) {
const GURL kUrl("https://www.foo.test");
const url::Origin kOrigin = url::Origin::Create(kUrl);
- service_->OnHeader(kOrigin, kServerIP, kHeader);
+ service_->OnHeader(kNik1_, kOrigin, kServerIP, kHeader);
RunUntilIdle();
SimulateRestart();
// Update the access time by sending a request.
clock_.Advance(base::TimeDelta::FromSeconds(100));
- service_->OnRequest(MakeRequestDetails(kUrl, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik1_, kUrl, ERR_INVALID_RESPONSE));
RunUntilIdle();
EXPECT_THAT(reporting_service_->reports(),
@@ -661,11 +815,12 @@ TEST_F(SQLitePersistNelTest, OnRequestUpdatesAccessTime) {
SimulateRestart();
// Check that the policy's access time has been updated.
base::Time now = clock_.Now();
- NetworkErrorLoggingService::NelPolicy policy = MakeNelPolicy(kOrigin, now);
+ NetworkErrorLoggingService::NelPolicy policy =
+ MakeNelPolicy(kNik1_, kOrigin, now);
std::vector<NetworkErrorLoggingService::NelPolicy> policies;
LoadNelPolicies(&policies);
ASSERT_EQ(1u, policies.size());
- EXPECT_EQ(policy.origin, policies[0].origin);
+ EXPECT_EQ(policy.key, policies[0].key);
EXPECT_TRUE(WithinOneMicrosecond(policy.last_used, policies[0].last_used));
}
@@ -674,18 +829,20 @@ TEST_F(SQLitePersistNelTest, RemoveSomeBrowsingData) {
const url::Origin kOrigin1 = url::Origin::Create(kUrl1);
const url::Origin kOrigin2 =
url::Origin::Create(GURL("https://www.bar.test"));
+ const NetworkErrorLoggingService::NelPolicyKey kKey1(kNik1_, kOrigin1);
+ const NetworkErrorLoggingService::NelPolicyKey kKey2(kNik2_, kOrigin2);
- service_->OnHeader(kOrigin1, kServerIP, kHeader);
- service_->OnHeader(kOrigin2, kServerIP, kHeader);
+ service_->OnHeader(kNik1_, kOrigin1, kServerIP, kHeader);
+ service_->OnHeader(kNik2_, kOrigin2, kServerIP, kHeader);
RunUntilIdle();
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl1, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik1_, kUrl1, ERR_INVALID_RESPONSE));
RunUntilIdle();
- ASSERT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin1));
- ASSERT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin2));
+ ASSERT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey1));
+ ASSERT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey2));
EXPECT_THAT(reporting_service_->reports(),
testing::ElementsAre(ReportUrlIs(kUrl1)));
@@ -698,15 +855,15 @@ TEST_F(SQLitePersistNelTest, RemoveSomeBrowsingData) {
kOrigin1.host()));
RunUntilIdle();
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin1));
- EXPECT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin2));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey1));
+ EXPECT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey2));
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl1, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik1_, kUrl1, ERR_INVALID_RESPONSE));
RunUntilIdle();
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin1));
- EXPECT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin2));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey1));
+ EXPECT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey2));
EXPECT_EQ(0u, reporting_service_->reports().size());
}
@@ -715,19 +872,21 @@ TEST_F(SQLitePersistNelTest, RemoveAllBrowsingData) {
const url::Origin kOrigin1 = url::Origin::Create(kUrl1);
const GURL kUrl2("https://www.bar.test");
const url::Origin kOrigin2 = url::Origin::Create(kUrl2);
+ const NetworkErrorLoggingService::NelPolicyKey kKey1(kNik1_, kOrigin1);
+ const NetworkErrorLoggingService::NelPolicyKey kKey2(kNik2_, kOrigin2);
- service_->OnHeader(kOrigin1, kServerIP, kHeader);
- service_->OnHeader(kOrigin2, kServerIP, kHeader);
+ service_->OnHeader(kNik1_, kOrigin1, kServerIP, kHeader);
+ service_->OnHeader(kNik2_, kOrigin2, kServerIP, kHeader);
RunUntilIdle();
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl1, ERR_INVALID_RESPONSE));
- service_->OnRequest(MakeRequestDetails(kUrl2, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik1_, kUrl1, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik2_, kUrl2, ERR_INVALID_RESPONSE));
RunUntilIdle();
- ASSERT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin1));
- ASSERT_EQ(1u, service_->GetPolicyOriginsForTesting().count(kOrigin2));
+ ASSERT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey1));
+ ASSERT_EQ(1u, service_->GetPolicyKeysForTesting().count(kKey2));
EXPECT_THAT(reporting_service_->reports(),
testing::ElementsAre(ReportUrlIs(kUrl1), ReportUrlIs(kUrl2)));
@@ -736,29 +895,31 @@ TEST_F(SQLitePersistNelTest, RemoveAllBrowsingData) {
service_->RemoveAllBrowsingData();
RunUntilIdle();
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin1));
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin2));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey1));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey2));
SimulateRestart();
- service_->OnRequest(MakeRequestDetails(kUrl1, ERR_INVALID_RESPONSE));
- service_->OnRequest(MakeRequestDetails(kUrl2, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik1_, kUrl1, ERR_INVALID_RESPONSE));
+ service_->OnRequest(MakeRequestDetails(kNik2_, kUrl2, ERR_INVALID_RESPONSE));
RunUntilIdle();
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin1));
- EXPECT_EQ(0u, service_->GetPolicyOriginsForTesting().count(kOrigin2));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey1));
+ EXPECT_EQ(0u, service_->GetPolicyKeysForTesting().count(kKey2));
EXPECT_EQ(0u, reporting_service_->reports().size());
}
TEST_F(SQLitePersistentReportingAndNelStoreTest, PersistReportingClients) {
const url::Origin kOrigin = url::Origin::Create(GURL("https://www.foo.test"));
+ url::Origin foo;
CreateStore();
InitializeStore();
base::Time now = base::Time::Now();
ReportingEndpoint endpoint = MakeReportingEndpoint(
- kOrigin, kGroupName1, GURL("https://endpoint.test/1"));
+ kNik1_, kOrigin, kGroupName1, GURL("https://endpoint.test/1"));
CachedReportingEndpointGroup group =
- MakeReportingEndpointGroup(kOrigin, kGroupName1, now);
+ MakeReportingEndpointGroup(kNik1_, kOrigin, kGroupName1, now);
+ foo = *(kNik1_.GetTopFrameSite());
store_->AddReportingEndpoint(endpoint);
store_->AddReportingEndpointGroup(group);
@@ -772,12 +933,16 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, PersistReportingClients) {
std::vector<CachedReportingEndpointGroup> groups;
LoadReportingClients(&endpoints, &groups);
ASSERT_EQ(1u, endpoints.size());
+ EXPECT_EQ(endpoint.group_key.network_isolation_key,
+ endpoints[0].group_key.network_isolation_key);
EXPECT_EQ(endpoint.group_key.origin, endpoints[0].group_key.origin);
EXPECT_EQ(endpoint.group_key.group_name, endpoints[0].group_key.group_name);
EXPECT_EQ(endpoint.info.url, endpoints[0].info.url);
EXPECT_EQ(endpoint.info.priority, endpoints[0].info.priority);
EXPECT_EQ(endpoint.info.weight, endpoints[0].info.weight);
ASSERT_EQ(1u, groups.size());
+ EXPECT_EQ(group.group_key.network_isolation_key,
+ groups[0].group_key.network_isolation_key);
EXPECT_EQ(group.group_key.origin, groups[0].group_key.origin);
EXPECT_EQ(group.group_key.group_name, groups[0].group_key.group_name);
EXPECT_EQ(group.include_subdomains, groups[0].include_subdomains);
@@ -791,7 +956,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
InitializeStore();
base::Time now = base::Time::Now();
CachedReportingEndpointGroup group = MakeReportingEndpointGroup(
- url::Origin::Create(GURL("https://www.foo.test")), kGroupName1, now);
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ now);
store_->AddReportingEndpointGroup(group);
@@ -806,6 +972,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
std::vector<CachedReportingEndpointGroup> groups;
LoadReportingClients(&endpoints, &groups);
ASSERT_EQ(1u, groups.size());
+ EXPECT_EQ(group.group_key.network_isolation_key,
+ groups[0].group_key.network_isolation_key);
EXPECT_EQ(group.group_key.origin, groups[0].group_key.origin);
EXPECT_EQ(group.group_key.group_name, groups[0].group_key.group_name);
EXPECT_TRUE(WithinOneMicrosecond(group.last_used, groups[0].last_used));
@@ -815,9 +983,9 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
UpdateReportingEndpointDetails) {
CreateStore();
InitializeStore();
- ReportingEndpoint endpoint =
- MakeReportingEndpoint(url::Origin::Create(GURL("https://www.foo.test")),
- kGroupName1, GURL("https://endpoint.test/1"));
+ ReportingEndpoint endpoint = MakeReportingEndpoint(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ GURL("https://endpoint.test/1"));
store_->AddReportingEndpoint(endpoint);
@@ -833,6 +1001,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
std::vector<CachedReportingEndpointGroup> groups;
LoadReportingClients(&endpoints, &groups);
ASSERT_EQ(1u, endpoints.size());
+ EXPECT_EQ(endpoint.group_key.network_isolation_key,
+ endpoints[0].group_key.network_isolation_key);
EXPECT_EQ(endpoint.group_key.origin, endpoints[0].group_key.origin);
EXPECT_EQ(endpoint.group_key.group_name, endpoints[0].group_key.group_name);
EXPECT_EQ(endpoint.info.url, endpoints[0].info.url);
@@ -846,8 +1016,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
InitializeStore();
base::Time now = base::Time::Now();
CachedReportingEndpointGroup group = MakeReportingEndpointGroup(
- url::Origin::Create(GURL("https://www.foo.test")), kGroupName1, now,
- OriginSubdomains::EXCLUDE, kExpires);
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ now, OriginSubdomains::EXCLUDE, kExpires);
store_->AddReportingEndpointGroup(group);
@@ -864,6 +1034,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
std::vector<CachedReportingEndpointGroup> groups;
LoadReportingClients(&endpoints, &groups);
ASSERT_EQ(1u, groups.size());
+ EXPECT_EQ(group.group_key.network_isolation_key,
+ groups[0].group_key.network_isolation_key);
EXPECT_EQ(group.group_key.origin, groups[0].group_key.origin);
EXPECT_EQ(group.group_key.group_name, groups[0].group_key.group_name);
EXPECT_EQ(group.include_subdomains, groups[0].include_subdomains);
@@ -874,12 +1046,12 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
TEST_F(SQLitePersistentReportingAndNelStoreTest, DeleteReportingEndpoint) {
CreateStore();
InitializeStore();
- ReportingEndpoint endpoint1 =
- MakeReportingEndpoint(url::Origin::Create(GURL("https://www.foo.test")),
- kGroupName1, GURL("https://endpoint.test/1"));
- ReportingEndpoint endpoint2 =
- MakeReportingEndpoint(url::Origin::Create(GURL("https://www.bar.test")),
- kGroupName2, GURL("https://endpoint.test/2"));
+ ReportingEndpoint endpoint1 = MakeReportingEndpoint(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ GURL("https://endpoint.test/1"));
+ ReportingEndpoint endpoint2 = MakeReportingEndpoint(
+ kNik2_, url::Origin::Create(GURL("https://www.bar.test")), kGroupName2,
+ GURL("https://endpoint.test/2"));
store_->AddReportingEndpoint(endpoint1);
store_->AddReportingEndpoint(endpoint2);
@@ -910,9 +1082,11 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, DeleteReportingEndpointGroup) {
InitializeStore();
base::Time now = base::Time::Now();
CachedReportingEndpointGroup group1 = MakeReportingEndpointGroup(
- url::Origin::Create(GURL("https://www.foo.test")), kGroupName1, now);
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ now);
CachedReportingEndpointGroup group2 = MakeReportingEndpointGroup(
- url::Origin::Create(GURL("https://www.bar.test")), kGroupName2, now);
+ kNik2_, url::Origin::Create(GURL("https://www.bar.test")), kGroupName2,
+ now);
store_->AddReportingEndpointGroup(group1);
store_->AddReportingEndpointGroup(group2);
@@ -940,20 +1114,45 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest, DeleteReportingEndpointGroup) {
TEST_F(SQLitePersistentReportingAndNelStoreTest,
ReportingEndpointUniquenessConstraint) {
- const url::Origin kOrigin = url::Origin::Create(GURL("https://www.foo.test"));
+ const url::Origin kOrigin1 =
+ url::Origin::Create(GURL("https://www.bar.test"));
+ const url::Origin kOrigin2 =
+ url::Origin::Create(GURL("https://www.foo.test"));
const GURL kEndpoint("https://endpoint.test/1");
CreateStore();
InitializeStore();
- ReportingEndpoint endpoint1 = MakeReportingEndpoint(
- kOrigin, kGroupName1, kEndpoint, 1 /* priority */, 1 /* weight */);
- ReportingEndpoint endpoint2 = MakeReportingEndpoint(
- kOrigin, kGroupName1, kEndpoint, 2 /* priority */, 2 /* weight */);
+ // Add 3 entries, 2 identical except for NIK, 2 identical except for origin.
+ // Entries should not conflict with each other. These are added in lexical
+ // order.
+ ReportingEndpoint endpoint1 =
+ MakeReportingEndpoint(kNik1_, kOrigin1, kGroupName1, kEndpoint,
+ 1 /* priority */, 1 /* weight */);
+ ReportingEndpoint endpoint2 =
+ MakeReportingEndpoint(kNik1_, kOrigin2, kGroupName1, kEndpoint,
+ 2 /* priority */, 2 /* weight */);
+ ReportingEndpoint endpoint3 =
+ MakeReportingEndpoint(kNik2_, kOrigin2, kGroupName1, kEndpoint,
+ 3 /* priority */, 3 /* weight */);
store_->AddReportingEndpoint(endpoint1);
- // Adding an endpoint with the same origin, group name, and url should trigger
- // a warning and fail to execute.
store_->AddReportingEndpoint(endpoint2);
+ store_->AddReportingEndpoint(endpoint3);
+
+ // Add entries that are identical except for expiration time. These should
+ // trigger a warning an fail to execute.
+ ReportingEndpoint endpoint4 =
+ MakeReportingEndpoint(kNik1_, kOrigin1, kGroupName1, kEndpoint,
+ 4 /* priority */, 4 /* weight */);
+ ReportingEndpoint endpoint5 =
+ MakeReportingEndpoint(kNik1_, kOrigin2, kGroupName1, kEndpoint,
+ 5 /* priority */, 5 /* weight */);
+ ReportingEndpoint endpoint6 =
+ MakeReportingEndpoint(kNik2_, kOrigin2, kGroupName1, kEndpoint,
+ 6 /* priority */, 6 /* weight */);
+ store_->AddReportingEndpoint(endpoint4);
+ store_->AddReportingEndpoint(endpoint5);
+ store_->AddReportingEndpoint(endpoint6);
DestroyStore();
CreateStore();
@@ -961,33 +1160,64 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
std::vector<ReportingEndpoint> endpoints;
std::vector<CachedReportingEndpointGroup> groups;
LoadReportingClients(&endpoints, &groups);
- // Only the first endpoint we added should be in the store.
- ASSERT_EQ(1u, endpoints.size());
- EXPECT_EQ(endpoint1.group_key.origin, endpoints[0].group_key.origin);
- EXPECT_EQ(endpoint1.group_key.group_name, endpoints[0].group_key.group_name);
+
+ // Only the first 3 endpoints should be in the store.
+
+ ASSERT_EQ(3u, endpoints.size());
+
+ EXPECT_EQ(endpoint1.group_key, endpoints[0].group_key);
EXPECT_EQ(endpoint1.info.url, endpoints[0].info.url);
EXPECT_EQ(endpoint1.info.priority, endpoints[0].info.priority);
EXPECT_EQ(endpoint1.info.weight, endpoints[0].info.weight);
+
+ EXPECT_EQ(endpoint2.group_key, endpoints[1].group_key);
+ EXPECT_EQ(endpoint2.info.url, endpoints[1].info.url);
+ EXPECT_EQ(endpoint2.info.priority, endpoints[1].info.priority);
+ EXPECT_EQ(endpoint2.info.weight, endpoints[1].info.weight);
+
+ EXPECT_EQ(endpoint3.group_key, endpoints[2].group_key);
+ EXPECT_EQ(endpoint3.info.url, endpoints[2].info.url);
+ EXPECT_EQ(endpoint3.info.priority, endpoints[2].info.priority);
+ EXPECT_EQ(endpoint3.info.weight, endpoints[2].info.weight);
}
TEST_F(SQLitePersistentReportingAndNelStoreTest,
ReportingEndpointGroupUniquenessConstraint) {
- const url::Origin kOrigin = url::Origin::Create(GURL("https://www.foo.test"));
+ const url::Origin kOrigin1 =
+ url::Origin::Create(GURL("https://www.bar.test"));
+ const url::Origin kOrigin2 =
+ url::Origin::Create(GURL("https://www.foo.test"));
CreateStore();
InitializeStore();
+
base::Time now = base::Time::Now();
+ base::Time later = now + base::TimeDelta::FromDays(7);
+
+ // Add 3 entries, 2 identical except for NIK, 2 identical except for origin.
+ // Entries should not conflict with each other. These are added in lexical
+ // order.
CachedReportingEndpointGroup group1 =
- MakeReportingEndpointGroup(kOrigin, kGroupName1, now);
- base::Time time2 = now + base::TimeDelta::FromDays(7);
+ MakeReportingEndpointGroup(kNik1_, kOrigin1, kGroupName1, now);
CachedReportingEndpointGroup group2 =
- MakeReportingEndpointGroup(kOrigin, kGroupName1, time2);
- LOG(INFO) << "foo";
-
+ MakeReportingEndpointGroup(kNik1_, kOrigin2, kGroupName1, now);
+ CachedReportingEndpointGroup group3 =
+ MakeReportingEndpointGroup(kNik2_, kOrigin1, kGroupName1, now);
store_->AddReportingEndpointGroup(group1);
- // Adding an endpoint group with the same origin and group name should trigger
- // a warning and fail to execute.
store_->AddReportingEndpointGroup(group2);
+ store_->AddReportingEndpointGroup(group3);
+
+ // Add entries that are identical except for expiration time. These should
+ // trigger a warning an fail to execute.
+ CachedReportingEndpointGroup group4 =
+ MakeReportingEndpointGroup(kNik1_, kOrigin1, kGroupName1, later);
+ CachedReportingEndpointGroup group5 =
+ MakeReportingEndpointGroup(kNik1_, kOrigin2, kGroupName1, later);
+ CachedReportingEndpointGroup group6 =
+ MakeReportingEndpointGroup(kNik2_, kOrigin1, kGroupName1, later);
+ store_->AddReportingEndpointGroup(group4);
+ store_->AddReportingEndpointGroup(group5);
+ store_->AddReportingEndpointGroup(group6);
DestroyStore();
CreateStore();
@@ -995,20 +1225,32 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
std::vector<ReportingEndpoint> endpoints;
std::vector<CachedReportingEndpointGroup> groups;
LoadReportingClients(&endpoints, &groups);
- // Only the first group we added should be in the store.
- ASSERT_EQ(1u, groups.size());
- EXPECT_EQ(group1.group_key.origin, groups[0].group_key.origin);
- EXPECT_EQ(group1.group_key.group_name, groups[0].group_key.group_name);
+
+ // Only the first 3 endpoints should be in the store.
+
+ ASSERT_EQ(3u, groups.size());
+
+ EXPECT_EQ(group1.group_key, groups[0].group_key);
EXPECT_EQ(group1.include_subdomains, groups[0].include_subdomains);
EXPECT_TRUE(WithinOneMicrosecond(group1.expires, groups[0].expires));
EXPECT_TRUE(WithinOneMicrosecond(group1.last_used, groups[0].last_used));
+
+ EXPECT_EQ(group2.group_key, groups[1].group_key);
+ EXPECT_EQ(group2.include_subdomains, groups[1].include_subdomains);
+ EXPECT_TRUE(WithinOneMicrosecond(group2.expires, groups[1].expires));
+ EXPECT_TRUE(WithinOneMicrosecond(group2.last_used, groups[1].last_used));
+
+ EXPECT_EQ(group3.group_key, groups[2].group_key);
+ EXPECT_EQ(group3.include_subdomains, groups[2].include_subdomains);
+ EXPECT_TRUE(WithinOneMicrosecond(group3.expires, groups[2].expires));
+ EXPECT_TRUE(WithinOneMicrosecond(group3.last_used, groups[2].last_used));
}
TEST_F(SQLitePersistentReportingAndNelStoreTest,
CoalesceReportingEndpointOperations) {
- ReportingEndpoint endpoint =
- MakeReportingEndpoint(url::Origin::Create(GURL("https://www.foo.test")),
- kGroupName1, GURL("https://endpoint.test/1"));
+ ReportingEndpoint endpoint = MakeReportingEndpoint(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ GURL("https://endpoint.test/1"));
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
@@ -1064,12 +1306,17 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
CreateStore();
InitializeStore();
- ReportingEndpoint endpoint1 =
- MakeReportingEndpoint(url::Origin::Create(GURL("https://www.foo.test")),
- kGroupName1, GURL("https://endpoint.test/1"));
- ReportingEndpoint endpoint2 =
- MakeReportingEndpoint(url::Origin::Create(GURL("https://www.bar.test")),
- kGroupName2, GURL("https://endpoint.test/2"));
+ ReportingEndpoint endpoint1 = MakeReportingEndpoint(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ GURL("https://endpoint.test/1"));
+ // Only has different host.
+ ReportingEndpoint endpoint2 = MakeReportingEndpoint(
+ kNik1_, url::Origin::Create(GURL("https://www.bar.test")), kGroupName1,
+ GURL("https://endpoint.test/2"));
+ // Only has different NetworkIsolationKey.
+ ReportingEndpoint endpoint3 = MakeReportingEndpoint(
+ kNik2_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ GURL("https://endpoint.test/3"));
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
@@ -1081,10 +1328,12 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
base::Unretained(this), &event));
- // Delete on |endpoint2| should not cancel addition of unrelated |endpoint1|.
+ // Delete on |endpoint2| and |endpoint3| should not cancel addition of
+ // unrelated |endpoint1|.
store_->AddReportingEndpoint(endpoint1);
store_->DeleteReportingEndpoint(endpoint2);
- EXPECT_EQ(2u, store_->GetQueueLengthForTesting());
+ store_->DeleteReportingEndpoint(endpoint3);
+ EXPECT_EQ(3u, store_->GetQueueLengthForTesting());
event.Signal();
RunUntilIdle();
@@ -1094,7 +1343,8 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
CoalesceReportingEndpointGroupOperations) {
base::Time now = base::Time::Now();
CachedReportingEndpointGroup group = MakeReportingEndpointGroup(
- url::Origin::Create(GURL("https://www.foo.test")), kGroupName1, now);
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ now);
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
@@ -1194,9 +1444,16 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
base::Time now = base::Time::Now();
CachedReportingEndpointGroup group1 = MakeReportingEndpointGroup(
- url::Origin::Create(GURL("https://www.foo.test")), kGroupName1, now);
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ now);
+ // Only has different host.
CachedReportingEndpointGroup group2 = MakeReportingEndpointGroup(
- url::Origin::Create(GURL("https://www.bar.test")), kGroupName2, now);
+ kNik1_, url::Origin::Create(GURL("https://www.bar.test")), kGroupName1,
+ now);
+ // Only has different NetworkIsolationKey.
+ CachedReportingEndpointGroup group3 = MakeReportingEndpointGroup(
+ kNik2_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ now);
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED);
@@ -1208,13 +1465,211 @@ TEST_F(SQLitePersistentReportingAndNelStoreTest,
base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
base::Unretained(this), &event));
- // Delete on |group2| should not cancel addition of unrelated |group2|.
+ // Delete on |group2| and |group3| should not cancel addition of unrelated
+ // |group1|.
store_->AddReportingEndpointGroup(group1);
store_->DeleteReportingEndpointGroup(group2);
- EXPECT_EQ(2u, store_->GetQueueLengthForTesting());
+ store_->DeleteReportingEndpointGroup(group3);
+ EXPECT_EQ(3u, store_->GetQueueLengthForTesting());
event.Signal();
RunUntilIdle();
}
+TEST_F(SQLitePersistentReportingAndNelStoreTest,
+ DontPersistReportingEndpointsWithTransientNetworkIsolationKeys) {
+ CreateStore();
+ InitializeStore();
+
+ ReportingEndpoint endpoint =
+ MakeReportingEndpoint(NetworkIsolationKey::CreateTransient(),
+ url::Origin::Create(GURL("https://www.foo.test")),
+ kGroupName1, GURL("https://endpoint.test/1"));
+
+ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
+ base::WaitableEvent::InitialState::NOT_SIGNALED);
+
+ // Wedge the background thread to make sure it doesn't start consuming the
+ // queue.
+ background_task_runner_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
+ base::Unretained(this), &event));
+
+ store_->AddReportingEndpoint(endpoint);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+ store_->UpdateReportingEndpointDetails(endpoint);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+ store_->DeleteReportingEndpoint(endpoint);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+
+ event.Signal();
+ RunUntilIdle();
+
+ // Close and reopen the database.
+ DestroyStore();
+ CreateStore();
+
+ std::vector<ReportingEndpoint> endpoints;
+ std::vector<CachedReportingEndpointGroup> groups;
+ LoadReportingClients(&endpoints, &groups);
+ ASSERT_EQ(0u, endpoints.size());
+}
+
+TEST_F(SQLitePersistentReportingAndNelStoreTest,
+ DontPersistReportingEndpointGroupsWithTransientNetworkIsolationKeys) {
+ CreateStore();
+ InitializeStore();
+
+ base::Time now = base::Time::Now();
+ CachedReportingEndpointGroup group = MakeReportingEndpointGroup(
+ NetworkIsolationKey::CreateTransient(),
+ url::Origin::Create(GURL("https://www.foo.test")), kGroupName1, now);
+
+ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
+ base::WaitableEvent::InitialState::NOT_SIGNALED);
+
+ // Wedge the background thread to make sure it doesn't start consuming the
+ // queue.
+ background_task_runner_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
+ base::Unretained(this), &event));
+
+ store_->AddReportingEndpointGroup(group);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+ store_->UpdateReportingEndpointGroupAccessTime(group);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+ store_->UpdateReportingEndpointGroupDetails(group);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+ store_->DeleteReportingEndpointGroup(group);
+ EXPECT_EQ(0u, store_->GetQueueLengthForTesting());
+
+ event.Signal();
+ RunUntilIdle();
+
+ // Close and reopen the database.
+ DestroyStore();
+ CreateStore();
+
+ std::vector<ReportingEndpoint> endpoints;
+ std::vector<CachedReportingEndpointGroup> groups;
+ LoadReportingClients(&endpoints, &groups);
+ ASSERT_EQ(0u, groups.size());
+}
+
+TEST_F(SQLitePersistentReportingAndNelStoreTest,
+ ReportingEndpointsRestoredWithNetworkIsolationKeysDisabled) {
+ CreateStore();
+ InitializeStore();
+
+ // Endpoint with non-empty NetworkIsolationKey.
+ ReportingEndpoint endpoint = MakeReportingEndpoint(
+ kNik1_, url::Origin::Create(GURL("https://www.foo.test")), kGroupName1,
+ GURL("https://endpoint.test/"));
+
+ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
+ base::WaitableEvent::InitialState::NOT_SIGNALED);
+
+ // Wedge the background thread to make sure it doesn't start consuming the
+ // queue.
+ background_task_runner_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
+ base::Unretained(this), &event));
+
+ store_->AddReportingEndpoint(endpoint);
+ EXPECT_EQ(1u, store_->GetQueueLengthForTesting());
+
+ event.Signal();
+ RunUntilIdle();
+
+ // Close the database, disable kPartitionNelAndReportingByNetworkIsolationKey,
+ // and re-open it.
+ DestroyStore();
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+ CreateStore();
+
+ std::vector<ReportingEndpoint> endpoints;
+ std::vector<CachedReportingEndpointGroup> groups;
+ LoadReportingClients(&endpoints, &groups);
+ // No entries should be restored.
+ ASSERT_EQ(0u, endpoints.size());
+
+ // Now reload the store with kPartitionNelAndReportingByNetworkIsolationKey
+ // enabled again.
+ DestroyStore();
+ feature_list.Reset();
+ CreateStore();
+ LoadReportingClients(&endpoints, &groups);
+
+ // The entry is back!
+ ASSERT_EQ(1u, endpoints.size());
+ EXPECT_EQ(endpoint.group_key, endpoints[0].group_key);
+ EXPECT_EQ(endpoint.info.url, endpoints[0].info.url);
+ EXPECT_EQ(endpoint.info.priority, endpoints[0].info.priority);
+ EXPECT_EQ(endpoint.info.weight, endpoints[0].info.weight);
+}
+
+TEST_F(SQLitePersistentReportingAndNelStoreTest,
+ ReportingEndpointGroupsRestoredWithNetworkIsolationKeysDisabled) {
+ CreateStore();
+ InitializeStore();
+
+ const url::Origin kOrigin = url::Origin::Create(GURL("https://www.foo.test"));
+
+ CreateStore();
+ InitializeStore();
+ base::Time now = base::Time::Now();
+ // Group with non-empty NetworkIsolationKey.
+ CachedReportingEndpointGroup group =
+ MakeReportingEndpointGroup(kNik1_, kOrigin, kGroupName1, now);
+
+ base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
+ base::WaitableEvent::InitialState::NOT_SIGNALED);
+
+ // Wedge the background thread to make sure it doesn't start consuming the
+ // queue.
+ background_task_runner_->PostTask(
+ FROM_HERE,
+ base::BindOnce(&SQLitePersistentReportingAndNelStoreTest::WaitOnEvent,
+ base::Unretained(this), &event));
+
+ store_->AddReportingEndpointGroup(group);
+ EXPECT_EQ(1u, store_->GetQueueLengthForTesting());
+
+ event.Signal();
+ RunUntilIdle();
+
+ // Close the database, disable kPartitionNelAndReportingByNetworkIsolationKey,
+ // and re-open it.
+ DestroyStore();
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+ CreateStore();
+
+ std::vector<ReportingEndpoint> endpoints;
+ std::vector<CachedReportingEndpointGroup> groups;
+ // No entries should be restored.
+ LoadReportingClients(&endpoints, &groups);
+ EXPECT_TRUE(groups.empty());
+
+ // Now reload the store with kPartitionNelAndReportingByNetworkIsolationKey
+ // enabled again.
+ DestroyStore();
+ feature_list.Reset();
+ CreateStore();
+ LoadReportingClients(&endpoints, &groups);
+
+ // The entry is back!
+ ASSERT_EQ(1u, groups.size());
+ EXPECT_EQ(group.group_key, groups[0].group_key);
+ EXPECT_EQ(group.include_subdomains, groups[0].include_subdomains);
+ EXPECT_TRUE(WithinOneMicrosecond(group.expires, groups[0].expires));
+ EXPECT_TRUE(WithinOneMicrosecond(group.last_used, groups[0].last_used));
+}
+
} // namespace net
diff --git a/chromium/net/filter/DIR_METADATA b/chromium/net/filter/DIR_METADATA
new file mode 100644
index 00000000000..4b1c1c3b9a1
--- /dev/null
+++ b/chromium/net/filter/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Filters"
+} \ No newline at end of file
diff --git a/chromium/net/filter/OWNERS b/chromium/net/filter/OWNERS
deleted file mode 100644
index 89b786cd34a..00000000000
--- a/chromium/net/filter/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-file://net/OWNERS
-
-# COMPONENT: Internals>Network>Filters
diff --git a/chromium/net/ftp/DIR_METADATA b/chromium/net/ftp/DIR_METADATA
new file mode 100644
index 00000000000..2ee9fe7637b
--- /dev/null
+++ b/chromium/net/ftp/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>FTP"
+} \ No newline at end of file
diff --git a/chromium/net/ftp/OWNERS b/chromium/net/ftp/OWNERS
index 71184cb6469..53e68eb7787 100644
--- a/chromium/net/ftp/OWNERS
+++ b/chromium/net/ftp/OWNERS
@@ -1,4 +1 @@
-eroman@chromium.org
mmenke@chromium.org
-
-# COMPONENT: Internals>Network>FTP
diff --git a/chromium/net/ftp/ftp_network_transaction.cc b/chromium/net/ftp/ftp_network_transaction.cc
index db039ef4503..23da0522f7d 100644
--- a/chromium/net/ftp/ftp_network_transaction.cc
+++ b/chromium/net/ftp/ftp_network_transaction.cc
@@ -7,7 +7,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/strings/string_number_conversions.h"
diff --git a/chromium/net/ftp/ftp_util.cc b/chromium/net/ftp/ftp_util.cc
index b70981c6c21..dca1c7fd8fa 100644
--- a/chromium/net/ftp/ftp_util.cc
+++ b/chromium/net/ftp/ftp_util.cc
@@ -355,7 +355,7 @@ bool FtpUtil::WindowsDateListingToTime(const base::string16& date,
// static
base::string16 FtpUtil::GetStringPartAfterColumns(const base::string16& text,
int columns) {
- base::i18n::UTF16CharIterator iter(&text);
+ base::i18n::UTF16CharIterator iter(text);
for (int i = 0; i < columns; i++) {
// Skip the leading whitespace.
diff --git a/chromium/net/http/bidirectional_stream.cc b/chromium/net/http/bidirectional_stream.cc
index fc7ca5518ff..eb318f090ba 100644
--- a/chromium/net/http/bidirectional_stream.cc
+++ b/chromium/net/http/bidirectional_stream.cc
@@ -37,24 +37,25 @@ namespace net {
namespace {
-base::Value NetLogHeadersParams(const spdy::SpdyHeaderBlock* headers,
+base::Value NetLogHeadersParams(const spdy::Http2HeaderBlock* headers,
NetLogCaptureMode capture_mode) {
- base::DictionaryValue dict;
- dict.SetKey("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode));
- return std::move(dict);
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetKey("headers",
+ ElideHttp2HeaderBlockForNetLog(*headers, capture_mode));
+ return dict;
}
base::Value NetLogParams(const GURL& url,
const std::string& method,
const HttpRequestHeaders* headers,
NetLogCaptureMode capture_mode) {
- base::DictionaryValue dict;
- dict.SetString("url", url.possibly_invalid_spec());
- dict.SetString("method", method);
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetStringKey("url", url.possibly_invalid_spec());
+ dict.SetStringKey("method", method);
std::string empty;
base::Value headers_param(headers->NetLogParams(empty, capture_mode));
dict.SetKey("headers", std::move(headers_param));
- return std::move(dict);
+ return dict;
}
} // namespace
@@ -237,7 +238,7 @@ void BidirectionalStream::OnStreamReady(bool request_headers_sent) {
}
void BidirectionalStream::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) {
+ const spdy::Http2HeaderBlock& response_headers) {
HttpResponseInfo response_info;
if (!SpdyHeadersToHttpResponse(response_headers, &response_info)) {
DLOG(WARNING) << "Invalid headers";
@@ -310,7 +311,7 @@ void BidirectionalStream::OnDataSent() {
}
void BidirectionalStream::OnTrailersReceived(
- const spdy::SpdyHeaderBlock& trailers) {
+ const spdy::Http2HeaderBlock& trailers) {
if (net_log_.IsCapturing()) {
net_log_.AddEvent(NetLogEventType::BIDIRECTIONAL_STREAM_RECV_TRAILERS,
[&](NetLogCaptureMode capture_mode) {
diff --git a/chromium/net/http/bidirectional_stream.h b/chromium/net/http/bidirectional_stream.h
index e92da4ea164..6fcf3888e18 100644
--- a/chromium/net/http/bidirectional_stream.h
+++ b/chromium/net/http/bidirectional_stream.h
@@ -21,15 +21,12 @@
#include "net/http/http_stream_factory.h"
#include "net/http/http_stream_request.h"
#include "net/log/net_log_with_source.h"
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace base {
class OneShotTimer;
} // namespace base
-namespace spdy {
-class SpdyHeaderBlock;
-} // namespace spdy
-
namespace net {
class HttpAuthController;
@@ -70,7 +67,7 @@ class NET_EXPORT BidirectionalStream : public BidirectionalStreamImpl::Delegate,
// call BidirectionalStream::SendData to send data,
// or call BidirectionalStream::Cancel to cancel the stream.
virtual void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) = 0;
+ const spdy::Http2HeaderBlock& response_headers) = 0;
// Called when a pending read is completed asynchronously.
// |bytes_read| specifies how much data is read.
@@ -90,7 +87,7 @@ class NET_EXPORT BidirectionalStream : public BidirectionalStreamImpl::Delegate,
// are received, which can happen before a read completes.
// The delegate is able to continue reading if there is no pending read and
// EOF has not been received, or to send data if there is no pending send.
- virtual void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) = 0;
+ virtual void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) = 0;
// Called when an error occurred. Do not call into the stream after this
// point. No other delegate functions will be called after this.
@@ -188,10 +185,10 @@ class NET_EXPORT BidirectionalStream : public BidirectionalStreamImpl::Delegate,
// BidirectionalStreamImpl::Delegate implementation:
void OnStreamReady(bool request_headers_sent) override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override;
+ const spdy::Http2HeaderBlock& response_headers) override;
void OnDataRead(int bytes_read) override;
void OnDataSent() override;
- void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) override;
+ void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override;
void OnFailed(int error) override;
// HttpStreamRequest::Delegate implementation:
diff --git a/chromium/net/http/bidirectional_stream_impl.h b/chromium/net/http/bidirectional_stream_impl.h
index 2a3306fc690..afa7f64da31 100644
--- a/chromium/net/http/bidirectional_stream_impl.h
+++ b/chromium/net/http/bidirectional_stream_impl.h
@@ -15,16 +15,13 @@
#include "net/base/load_timing_info.h"
#include "net/base/net_export.h"
#include "net/socket/next_proto.h"
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
namespace base {
class OneShotTimer;
} // namespace base
-namespace spdy {
-class SpdyHeaderBlock;
-} // namespace spdy
-
namespace net {
class IOBuffer;
@@ -60,7 +57,7 @@ class NET_EXPORT_PRIVATE BidirectionalStreamImpl {
// reading, call BidirectionalStreamImpl::SendData to send data,
// or call BidirectionalStreamImpl::Cancel to cancel the stream.
virtual void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) = 0;
+ const spdy::Http2HeaderBlock& response_headers) = 0;
// Called when read is completed asynchronously. |bytes_read| specifies how
// much data is available.
@@ -80,7 +77,7 @@ class NET_EXPORT_PRIVATE BidirectionalStreamImpl {
// are received, which can happen before a read completes.
// The delegate is able to continue reading if there is no pending read and
// EOF has not been received, or to send data if there is no pending send.
- virtual void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) = 0;
+ virtual void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) = 0;
// Called when an error occurred. Do not call into the stream after this
// point. No other delegate functions will be called after this.
diff --git a/chromium/net/http/bidirectional_stream_unittest.cc b/chromium/net/http/bidirectional_stream_unittest.cc
index 70e734b168d..2f1470c3adf 100644
--- a/chromium/net/http/bidirectional_stream_unittest.cc
+++ b/chromium/net/http/bidirectional_stream_unittest.cc
@@ -127,7 +127,7 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
}
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override {
+ const spdy::Http2HeaderBlock& response_headers) override {
CHECK(!not_expect_callback_);
response_headers_ = response_headers.Clone();
@@ -152,7 +152,7 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
++on_data_sent_count_;
}
- void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) override {
+ void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override {
CHECK(!not_expect_callback_);
trailers_ = trailers.Clone();
@@ -263,10 +263,10 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
// Const getters for internal states.
const std::string& data_received() const { return data_received_; }
int error() const { return error_; }
- const spdy::SpdyHeaderBlock& response_headers() const {
+ const spdy::Http2HeaderBlock& response_headers() const {
return response_headers_;
}
- const spdy::SpdyHeaderBlock& trailers() const { return trailers_; }
+ const spdy::Http2HeaderBlock& trailers() const { return trailers_; }
int on_data_read_count() const { return on_data_read_count_; }
int on_data_sent_count() const { return on_data_sent_count_; }
@@ -291,8 +291,8 @@ class TestDelegateBase : public BidirectionalStream::Delegate {
std::unique_ptr<base::OneShotTimer> timer_;
std::string data_received_;
std::unique_ptr<base::RunLoop> loop_;
- spdy::SpdyHeaderBlock response_headers_;
- spdy::SpdyHeaderBlock trailers_;
+ spdy::Http2HeaderBlock response_headers_;
+ spdy::Http2HeaderBlock trailers_;
NextProto next_proto_;
int64_t received_bytes_;
int64_t sent_bytes_;
@@ -326,7 +326,7 @@ class DeleteStreamDelegate : public TestDelegateBase {
~DeleteStreamDelegate() override = default;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override {
+ const spdy::Http2HeaderBlock& response_headers) override {
TestDelegateBase::OnHeadersReceived(response_headers);
if (phase_ == ON_HEADERS_RECEIVED) {
DeleteStream();
@@ -348,7 +348,7 @@ class DeleteStreamDelegate : public TestDelegateBase {
}
}
- void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) override {
+ void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override {
if (phase_ == ON_HEADERS_RECEIVED || phase_ == ON_DATA_READ) {
NOTREACHED();
return;
@@ -653,7 +653,7 @@ TEST_F(BidirectionalStreamTest, ClientAuthRequestIgnored) {
ASSERT_FALSE(client_cert);
ASSERT_FALSE(client_private_key);
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ(1, delegate->on_data_read_count());
EXPECT_EQ(0, delegate->on_data_sent_count());
@@ -733,7 +733,7 @@ TEST_F(BidirectionalStreamTest, TestReadDataAfterClose) {
rv = delegate->ReadData();
EXPECT_THAT(rv, IsOk()); // EOF.
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ("header-value", response_headers.find("header-name")->second);
EXPECT_EQ(1, delegate->on_data_read_count());
@@ -760,7 +760,7 @@ TEST_F(BidirectionalStreamTest, TestNetLogContainEntries) {
spdy::SpdySerializedFrame response_body_frame2(
spdy_util_.ConstructSpdyDataFrame(1, false));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
spdy::SpdySerializedFrame response_trailers(
spdy_util_.ConstructSpdyResponseHeaders(1, std::move(trailers), true));
@@ -1199,7 +1199,7 @@ TEST_F(BidirectionalStreamTest, TestBuffering) {
EXPECT_EQ(kUploadDataSize * 3,
static_cast<int>(delegate->data_received().size()));
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ("header-value", response_headers.find("header-name")->second);
EXPECT_EQ(0, delegate->on_data_sent_count());
@@ -1222,7 +1222,7 @@ TEST_F(BidirectionalStreamTest, TestBufferingWithTrailers) {
spdy::SpdySerializedFrame body_frame(
spdy_util_.ConstructSpdyDataFrame(1, false));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
spdy::SpdySerializedFrame response_trailers(
spdy_util_.ConstructSpdyResponseHeaders(1, std::move(trailers), true));
@@ -1272,7 +1272,7 @@ TEST_F(BidirectionalStreamTest, TestBufferingWithTrailers) {
EXPECT_EQ(1, delegate->on_data_read_count());
EXPECT_EQ(kUploadDataSize * 3,
static_cast<int>(delegate->data_received().size()));
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ("header-value", response_headers.find("header-name")->second);
EXPECT_EQ("bar", delegate->trailers().find("foo")->second);
@@ -1511,7 +1511,7 @@ TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnHeadersReceived) {
delegate->Start(std::move(request_info), http_session_.get());
// Makes sure delegate does not get called.
base::RunLoop().RunUntilIdle();
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ("header-value", response_headers.find("header-name")->second);
EXPECT_EQ(0u, delegate->data_received().size());
@@ -1566,7 +1566,7 @@ TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnDataRead) {
delegate->Start(std::move(request_info), http_session_.get());
// Makes sure delegate does not get called.
base::RunLoop().RunUntilIdle();
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ("header-value", response_headers.find("header-name")->second);
EXPECT_EQ(kUploadDataSize * 1,
@@ -1598,7 +1598,7 @@ TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnTrailersReceived) {
spdy::SpdySerializedFrame response_body_frame(
spdy_util_.ConstructSpdyDataFrame(1, false));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
spdy::SpdySerializedFrame response_trailers(
spdy_util_.ConstructSpdyResponseHeaders(1, std::move(trailers), true));
@@ -1626,7 +1626,7 @@ TEST_F(BidirectionalStreamTest, DeleteStreamDuringOnTrailersReceived) {
delegate->Start(std::move(request_info), http_session_.get());
// Makes sure delegate does not get called.
base::RunLoop().RunUntilIdle();
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ("header-value", response_headers.find("header-name")->second);
EXPECT_EQ("bar", delegate->trailers().find("foo")->second);
@@ -1731,7 +1731,7 @@ TEST_F(BidirectionalStreamTest, TestHonorAlternativeServiceHeader) {
delegate->SetRunUntilCompletion(true);
delegate->Start(std::move(request_info), http_session_.get());
- const spdy::SpdyHeaderBlock& response_headers = delegate->response_headers();
+ const spdy::Http2HeaderBlock& response_headers = delegate->response_headers();
EXPECT_EQ("200", response_headers.find(":status")->second);
EXPECT_EQ(alt_svc_header_value, response_headers.find("alt-svc")->second);
EXPECT_EQ(0, delegate->on_data_sent_count());
diff --git a/chromium/net/http/http_auth_controller.cc b/chromium/net/http/http_auth_controller.cc
index fc335665bc1..85ca36eaf41 100644
--- a/chromium/net/http/http_auth_controller.cc
+++ b/chromium/net/http/http_auth_controller.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
diff --git a/chromium/net/http/http_auth_controller.h b/chromium/net/http/http_auth_controller.h
index 3a47c430589..318527af6e5 100644
--- a/chromium/net/http/http_auth_controller.h
+++ b/chromium/net/http/http_auth_controller.h
@@ -49,14 +49,14 @@ class NET_EXPORT_PRIVATE HttpAuthController
//
// * |target| is either PROXY or SERVER and determines the authentication
// headers to use ("WWW-Authenticate"/"Authorization" vs.
- // "Proxy-Authenticate","Proxy-Authorization") and how ambient
+ // "Proxy-Authenticate"/"Proxy-Authorization") and how ambient
// credentials are used.
//
// * |auth_url| specifies the target URL. The origin of the URL identifies the
// target host. The path (hierarchical part defined in RFC 3986 section
// 3.3) of the URL is used by HTTP basic authentication to determine
// cached credentials can be used to preemptively send an authorization
- // header. See RFC 7627 section 2.2 (Reusing Credentials) for details.
+ // header. See RFC 7617 section 2.2 (Reusing Credentials) for details.
// If |target| is PROXY, then |auth_url| should have no hierarchical
// part since that is meaningless.
//
@@ -71,8 +71,8 @@ class NET_EXPORT_PRIVATE HttpAuthController
// authentication is stateful across requests. So the |http_auth_cache|
// is also used to maintain state for this authentication scheme.
//
- // * |http_auth_handler_factory| is used to contruct instances of
- // HttpAuthHandler subclass to handle scheme specific authentication
+ // * |http_auth_handler_factory| is used to construct instances of
+ // HttpAuthHandler subclasses to handle scheme-specific authentication
// logic. The |http_auth_handler_factory| is also responsible for
// determining whether the authentication stack should use a specific
// authentication scheme or not.
@@ -158,7 +158,7 @@ class NET_EXPORT_PRIVATE HttpAuthController
// cache entry's data and returns true.
bool SelectPreemptiveAuth(const NetLogWithSource& caller_net_log);
- // Invalidates the current handler. If |action| is
+ // Invalidates the current handler. If |action| is
// INVALIDATE_HANDLER_AND_CACHED_CREDENTIALS, then also invalidate
// the cached credentials used by the handler.
void InvalidateCurrentHandler(InvalidateHandlerAction action);
@@ -167,7 +167,7 @@ class NET_EXPORT_PRIVATE HttpAuthController
// The identity that was rejected is |identity_|.
void InvalidateRejectedAuthFromCache();
- // Allows reusing last used identity source. If the authentication handshake
+ // Allows reusing last used identity source. If the authentication handshake
// breaks down halfway, then the controller needs to restart it from the
// beginning and resue the same identity.
void PrepareIdentityForReuse();
@@ -191,17 +191,17 @@ class NET_EXPORT_PRIVATE HttpAuthController
// Indicates if this handler is for Proxy auth or Server auth.
HttpAuth::Target target_;
- // Holds the {scheme, host, path, port} for the authentication target.
+ // Holds the {scheme, host, port, path} for the authentication target.
const GURL auth_url_;
// Holds the {scheme, host, port} for the authentication target.
const GURL auth_origin_;
// The absolute path of the resource needing authentication.
- // For proxy authentication the path is empty.
+ // For proxy authentication, the path is empty.
const std::string auth_path_;
- // NetworkIsolationKey assocaied with the request.
+ // NetworkIsolationKey associated with the request.
const NetworkIsolationKey network_isolation_key_;
// |handler_| encapsulates the logic for the particular auth-scheme.
@@ -209,9 +209,9 @@ class NET_EXPORT_PRIVATE HttpAuthController
// associated auth handler.
std::unique_ptr<HttpAuthHandler> handler_;
- // |identity_| holds the credentials that should be used by
- // the handler_ to generate challenge responses. This identity can come from
- // a number of places (url, cache, prompt).
+ // |identity_| holds the credentials that should be used by the handler_ to
+ // generate challenge responses. This identity can come from a number of
+ // places (url, cache, prompt).
HttpAuth::Identity identity_;
// |auth_token_| contains the opaque string to pass to the proxy or
@@ -231,7 +231,7 @@ class NET_EXPORT_PRIVATE HttpAuthController
bool default_credentials_used_;
// These two are owned by the HttpNetworkSession/IOThread, which own the
- // objects which reference |this|. Therefore, these raw pointers are valid
+ // objects which reference |this|. Therefore, these raw pointers are valid
// for the lifetime of this object.
HttpAuthCache* const http_auth_cache_;
HttpAuthHandlerFactory* const http_auth_handler_factory_;
diff --git a/chromium/net/http/http_auth_handler.cc b/chromium/net/http/http_auth_handler.cc
index 4d2164e47df..f24d222c691 100644
--- a/chromium/net/http/http_auth_handler.cc
+++ b/chromium/net/http/http_auth_handler.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "net/base/net_errors.h"
#include "net/http/http_auth_challenge_tokenizer.h"
diff --git a/chromium/net/http/http_auth_handler_basic.cc b/chromium/net/http/http_auth_handler_basic.cc
index 4692c02b248..61fb629cbb3 100644
--- a/chromium/net/http/http_auth_handler_basic.cc
+++ b/chromium/net/http/http_auth_handler_basic.cc
@@ -14,6 +14,7 @@
#include "net/dns/host_resolver.h"
#include "net/http/http_auth.h"
#include "net/http/http_auth_challenge_tokenizer.h"
+#include "net/http/http_auth_preferences.h"
#include "net/http/http_auth_scheme.h"
namespace net {
@@ -84,7 +85,9 @@ int HttpAuthHandlerBasic::GenerateAuthTokenImpl(
CompletionOnceCallback callback,
std::string* auth_token) {
DCHECK(credentials);
- // TODO(eroman): is this the right encoding of username/password?
+ // Firefox, Safari and Chromium all use UTF-8 encoding; IE uses iso-8859-1.
+ // RFC7617 does not specify a default encoding, but UTF-8 is the only allowed
+ // value for the optional charset parameter on the challenge.
std::string base64_username_password;
base::Base64Encode(base::UTF16ToUTF8(credentials->username()) + ":" +
base::UTF16ToUTF8(credentials->password()),
@@ -120,6 +123,11 @@ int HttpAuthHandlerBasic::Factory::CreateAuthHandler(
const NetLogWithSource& net_log,
HostResolver* host_resolver,
std::unique_ptr<HttpAuthHandler>* handler) {
+ if (http_auth_preferences() &&
+ !http_auth_preferences()->basic_over_http_enabled() &&
+ origin.SchemeIs(url::kHttpScheme)) {
+ return ERR_UNSUPPORTED_AUTH_SCHEME;
+ }
// TODO(cbentzel): Move towards model of parsing in the factory
// method and only constructing when valid.
std::unique_ptr<HttpAuthHandler> tmp_handler(new HttpAuthHandlerBasic());
diff --git a/chromium/net/http/http_auth_handler_basic_unittest.cc b/chromium/net/http/http_auth_handler_basic_unittest.cc
index 9754d230684..8e391d1514b 100644
--- a/chromium/net/http/http_auth_handler_basic_unittest.cc
+++ b/chromium/net/http/http_auth_handler_basic_unittest.cc
@@ -15,6 +15,7 @@
#include "net/base/test_completion_callback.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_auth_challenge_tokenizer.h"
+#include "net/http/http_auth_preferences.h"
#include "net/http/http_request_info.h"
#include "net/log/net_log_with_source.h"
#include "net/ssl/ssl_info.h"
@@ -22,6 +23,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+using net::test::IsError;
using net::test::IsOk;
namespace net {
@@ -215,4 +217,34 @@ TEST(HttpAuthHandlerBasicTest, InitFromChallenge) {
}
}
+// Test that when Basic is configured to forbid HTTP, attempting to create a
+// Basic auth handler for a HTTP context is rejected.
+TEST(HttpAuthHandlerBasicTest, BasicAuthRequiresHTTPS) {
+ GURL nonsecure_origin("http://www.example.com");
+ HttpAuthHandlerBasic::Factory factory;
+ HttpAuthPreferences http_auth_preferences;
+ http_auth_preferences.set_basic_over_http_enabled(false);
+ factory.set_http_auth_preferences(&http_auth_preferences);
+
+ std::string challenge = "Basic realm=\"Atlantis\"";
+ SSLInfo null_ssl_info;
+ auto host_resolver = std::make_unique<MockHostResolver>();
+ std::unique_ptr<HttpAuthHandler> basic;
+
+ // Ensure that HTTP is disallowed.
+ EXPECT_THAT(factory.CreateAuthHandlerFromString(
+ challenge, HttpAuth::AUTH_SERVER, null_ssl_info,
+ NetworkIsolationKey(), nonsecure_origin, NetLogWithSource(),
+ host_resolver.get(), &basic),
+ IsError(ERR_UNSUPPORTED_AUTH_SCHEME));
+
+ // Ensure that HTTPS is allowed.
+ GURL secure_origin("https://www.example.com");
+ EXPECT_THAT(factory.CreateAuthHandlerFromString(
+ challenge, HttpAuth::AUTH_SERVER, null_ssl_info,
+ NetworkIsolationKey(), secure_origin, NetLogWithSource(),
+ host_resolver.get(), &basic),
+ IsOk());
+}
+
} // namespace net
diff --git a/chromium/net/http/http_auth_handler_factory_unittest.cc b/chromium/net/http/http_auth_handler_factory_unittest.cc
index 6e8b6a40fba..e4182163ddd 100644
--- a/chromium/net/http/http_auth_handler_factory_unittest.cc
+++ b/chromium/net/http/http_auth_handler_factory_unittest.cc
@@ -212,6 +212,60 @@ TEST(HttpAuthHandlerFactoryTest, DefaultFactory) {
}
}
+TEST(HttpAuthHandlerFactoryTest, BasicFactoryRespectsHTTPEnabledPref) {
+ std::unique_ptr<HostResolver> host_resolver(new MockHostResolver());
+ std::unique_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_factory(
+ HttpAuthHandlerFactory::CreateDefault());
+
+ // Set the Preference that blocks Basic Auth over HTTP on all of the
+ // factories. It shouldn't impact any behavior except for the Basic factory.
+ MockAllowHttpAuthPreferences http_auth_preferences;
+ http_auth_preferences.set_basic_over_http_enabled(false);
+ http_auth_handler_factory->SetHttpAuthPreferences(kBasicAuthScheme,
+ &http_auth_preferences);
+ http_auth_handler_factory->SetHttpAuthPreferences(kDigestAuthScheme,
+ &http_auth_preferences);
+ http_auth_handler_factory->SetHttpAuthPreferences(kNtlmAuthScheme,
+ &http_auth_preferences);
+ http_auth_handler_factory->SetHttpAuthPreferences(kNegotiateAuthScheme,
+ &http_auth_preferences);
+
+ GURL nonsecure_origin("http://www.example.com");
+ GURL secure_origin("https://www.example.com");
+ SSLInfo null_ssl_info;
+
+ const HttpAuth::Target kTargets[] = {HttpAuth::AUTH_SERVER,
+ HttpAuth::AUTH_PROXY};
+ struct TestCase {
+ int expected_net_error;
+ const GURL origin;
+ const char* challenge;
+ } const kTestCases[] = {
+ // Challenges that result in success results.
+ {OK, secure_origin, "Basic realm=\"FooBar\""},
+ {OK, secure_origin, "Digest realm=\"FooBar\", nonce=\"xyz\""},
+ {OK, nonsecure_origin, "Digest realm=\"FooBar\", nonce=\"xyz\""},
+ {OK, secure_origin, "Ntlm"},
+ {OK, nonsecure_origin, "Ntlm"},
+#if BUILDFLAG(USE_KERBEROS) && !defined(OS_ANDROID)
+ {OK, secure_origin, "Negotiate"},
+ {OK, nonsecure_origin, "Negotiate"},
+#endif
+ // Challenges that result in error results.
+ {ERR_UNSUPPORTED_AUTH_SCHEME, nonsecure_origin, "Basic realm=\"FooBar\""},
+ };
+
+ for (const auto target : kTargets) {
+ for (const TestCase& test_case : kTestCases) {
+ std::unique_ptr<HttpAuthHandler> handler;
+ int rv = http_auth_handler_factory->CreateAuthHandlerFromString(
+ test_case.challenge, target, null_ssl_info, NetworkIsolationKey(),
+ test_case.origin, NetLogWithSource(), host_resolver.get(), &handler);
+ EXPECT_THAT(rv, IsError(test_case.expected_net_error));
+ }
+ }
+}
+
TEST(HttpAuthHandlerFactoryTest, LogCreateAuthHandlerResults) {
std::unique_ptr<HostResolver> host_resolver(new MockHostResolver());
std::unique_ptr<HttpAuthHandlerRegistryFactory> http_auth_handler_factory(
diff --git a/chromium/net/http/http_auth_handler_negotiate.cc b/chromium/net/http/http_auth_handler_negotiate.cc
index 281e62f6185..c68cbef391e 100644
--- a/chromium/net/http/http_auth_handler_negotiate.cc
+++ b/chromium/net/http/http_auth_handler_negotiate.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -36,14 +36,13 @@ namespace {
base::Value NetLogParameterChannelBindings(
const std::string& channel_binding_token,
NetLogCaptureMode capture_mode) {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
if (!NetLogCaptureIncludesSocketBytes(capture_mode))
- return std::move(dict);
+ return dict;
- dict.Clear();
- dict.SetString("token", base::HexEncode(channel_binding_token.data(),
- channel_binding_token.size()));
- return std::move(dict);
+ dict.SetStringKey("token", base::HexEncode(channel_binding_token.data(),
+ channel_binding_token.size()));
+ return dict;
}
// Uses |negotiate_auth_system_factory| to create the auth system, otherwise
diff --git a/chromium/net/http/http_auth_preferences.h b/chromium/net/http/http_auth_preferences.h
index f59c36aa8a2..f25b15e8fcd 100644
--- a/chromium/net/http/http_auth_preferences.h
+++ b/chromium/net/http/http_auth_preferences.h
@@ -63,6 +63,14 @@ class NET_EXPORT HttpAuthPreferences {
negotiate_enable_port_ = negotiate_enable_port;
}
+ // Return |true| if the browser should allow attempts to use HTTP Basic auth
+ // on non-secure HTTP connections.
+ bool basic_over_http_enabled() const { return basic_over_http_enabled_; }
+
+ void set_basic_over_http_enabled(bool allow_http) {
+ basic_over_http_enabled_ = allow_http;
+ }
+
#if defined(OS_POSIX) || defined(OS_FUCHSIA)
void set_ntlm_v2_enabled(bool ntlm_v2_enabled) {
ntlm_v2_enabled_ = ntlm_v2_enabled;
@@ -92,6 +100,7 @@ class NET_EXPORT HttpAuthPreferences {
bool delegate_by_kdc_policy_ = false;
bool negotiate_disable_cname_lookup_ = false;
bool negotiate_enable_port_ = false;
+ bool basic_over_http_enabled_ = true;
DefaultCredentials allow_default_credentials_ = ALLOW_DEFAULT_CREDENTIALS;
diff --git a/chromium/net/http/http_cache.cc b/chromium/net/http/http_cache.cc
index 3a1346d0539..8f28470953a 100644
--- a/chromium/net/http/http_cache.cc
+++ b/chromium/net/http/http_cache.cc
@@ -8,9 +8,10 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
+#include "base/feature_list.h"
#include "base/files/file_util.h"
#include "base/format_macros.h"
#include "base/location.h"
@@ -56,8 +57,18 @@
namespace net {
+namespace {
+// True if any HTTP cache has been initialized.
+bool g_init_cache = false;
+
+// True if split cache is enabled by default. Must be set before any HTTP cache
+// has been initialized.
+bool g_enable_split_cache = false;
+} // namespace
+
const char HttpCache::kDoubleKeyPrefix[] = "_dk_";
const char HttpCache::kDoubleKeySeparator[] = " ";
+const char HttpCache::kSubframeDocumentResourcePrefix[] = "s_";
HttpCache::DefaultBackend::DefaultBackend(CacheType type,
BackendType backend_type,
@@ -245,7 +256,9 @@ HttpCache::HttpCache(HttpNetworkSession* session,
bool is_main_cache)
: HttpCache(std::make_unique<HttpNetworkLayer>(session),
std::move(backend_factory),
- is_main_cache) {}
+ is_main_cache) {
+ g_init_cache = true;
+}
HttpCache::HttpCache(std::unique_ptr<HttpTransactionFactory> network_layer,
std::unique_ptr<BackendFactory> backend_factory,
@@ -259,6 +272,7 @@ HttpCache::HttpCache(std::unique_ptr<HttpTransactionFactory> network_layer,
mode_(NORMAL),
network_layer_(std::move(network_layer)),
clock_(base::DefaultClock::GetInstance()) {
+ g_init_cache = true;
HttpNetworkSession* session = network_layer_->GetSession();
// Session may be NULL in unittests.
// TODO(mmenke): Seems like tests could be changed to provide a session,
@@ -360,7 +374,8 @@ void HttpCache::CloseIdleConnections(const char* net_log_reason_utf8) {
void HttpCache::OnExternalCacheHit(
const GURL& url,
const std::string& http_method,
- const NetworkIsolationKey& network_isolation_key) {
+ const NetworkIsolationKey& network_isolation_key,
+ bool is_subframe_document_resource) {
if (!disk_cache_.get() || mode_ == DISABLE)
return;
@@ -368,6 +383,8 @@ void HttpCache::OnExternalCacheHit(
request_info.url = url;
request_info.method = http_method;
request_info.network_isolation_key = network_isolation_key;
+ request_info.is_subframe_document_resource = is_subframe_document_resource;
+
std::string key = GenerateCacheKey(&request_info);
disk_cache_->OnExternalCacheHit(key);
}
@@ -455,6 +472,29 @@ std::string HttpCache::GenerateCacheKeyForTest(const HttpRequestInfo* request) {
return GenerateCacheKey(request);
}
+// static
+void HttpCache::SplitCacheFeatureEnableByDefault() {
+ CHECK(!g_enable_split_cache && !g_init_cache);
+ if (!base::FeatureList::GetInstance()->IsFeatureOverridden(
+ "SplitCacheByNetworkIsolationKey")) {
+ g_enable_split_cache = true;
+ }
+}
+
+// static
+bool HttpCache::IsSplitCacheEnabled() {
+ return base::FeatureList::IsEnabled(
+ features::kSplitCacheByNetworkIsolationKey) ||
+ g_enable_split_cache;
+}
+
+// static
+void HttpCache::ClearGlobalsForTesting() {
+ // Reset these so that unit tests can work.
+ g_init_cache = false;
+ g_enable_split_cache = false;
+}
+
//-----------------------------------------------------------------------------
net::Error HttpCache::CreateAndSetWorkItem(ActiveEntry** entry,
@@ -532,16 +572,18 @@ int HttpCache::GetBackendForTransaction(Transaction* transaction) {
std::string HttpCache::GenerateCacheKey(const HttpRequestInfo* request) {
std::string isolation_key;
- if (base::FeatureList::IsEnabled(
- features::kSplitCacheByNetworkIsolationKey)) {
+ if (IsSplitCacheEnabled()) {
// Prepend the key with |kDoubleKeyPrefix| = "_dk_" to mark it as
// double-keyed (and makes it an invalid url so that it doesn't get
// confused with a single-keyed entry). Separate the origin and url
// with invalid whitespace character |kDoubleKeySeparator|.
DCHECK(request->network_isolation_key.IsFullyPopulated());
- isolation_key = base::StrCat({kDoubleKeyPrefix,
- request->network_isolation_key.ToString(),
- kDoubleKeySeparator});
+ std::string subframe_document_resource_prefix =
+ request->is_subframe_document_resource ? kSubframeDocumentResourcePrefix
+ : "";
+ isolation_key = base::StrCat(
+ {kDoubleKeyPrefix, subframe_document_resource_prefix,
+ request->network_isolation_key.ToString(), kDoubleKeySeparator});
}
// Strip out the reference, username, and password sections of the URL and
@@ -622,7 +664,8 @@ int HttpCache::AsyncDoomEntry(const std::string& key,
}
void HttpCache::DoomMainEntryForUrl(const GURL& url,
- const NetworkIsolationKey& isolation_key) {
+ const NetworkIsolationKey& isolation_key,
+ bool is_subframe_document_resource) {
if (!disk_cache_)
return;
@@ -630,6 +673,7 @@ void HttpCache::DoomMainEntryForUrl(const GURL& url,
temp_info.url = url;
temp_info.method = "GET";
temp_info.network_isolation_key = isolation_key;
+ temp_info.is_subframe_document_resource = is_subframe_document_resource;
std::string key = GenerateCacheKey(&temp_info);
// Defer to DoomEntry if there is an active entry, otherwise call
@@ -1455,6 +1499,8 @@ void HttpCache::OnBackendCreated(int result, PendingOp* pending_op) {
backend_factory_.reset(); // Reclaim memory.
if (result == OK) {
disk_cache_ = std::move(pending_op->backend);
+ UMA_HISTOGRAM_MEMORY_KB("HttpCache.MaxFileSizeOnInit",
+ disk_cache_->MaxFileSize() / 1024);
}
}
diff --git a/chromium/net/http/http_cache.h b/chromium/net/http/http_cache.h
index 9351e11aaff..1b2da60f460 100644
--- a/chromium/net/http/http_cache.h
+++ b/chromium/net/http/http_cache.h
@@ -225,7 +225,8 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
// referred to by |url| and |http_method| and |network_isolation_key|.
void OnExternalCacheHit(const GURL& url,
const std::string& http_method,
- const NetworkIsolationKey& network_isolation_key);
+ const NetworkIsolationKey& network_isolation_key,
+ bool is_subframe_document_resource);
// Causes all transactions created after this point to simulate lock timeout
// and effectively bypass the cache lock whenever there is lock contention.
@@ -272,6 +273,18 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
// Function to generate cache key for testing.
static std::string GenerateCacheKeyForTest(const HttpRequestInfo* request);
+ // Enable split cache feature if not already overridden in the feature list.
+ // Should only be invoked during process initialization before the HTTP
+ // cache is initialized.
+ static void SplitCacheFeatureEnableByDefault();
+
+ // Returns true if split cache is enabled either by default or by other means
+ // like command line or field trials.
+ static bool IsSplitCacheEnabled();
+
+ // Resets g_init_cache and g_enable_split_cache for tests.
+ static void ClearGlobalsForTesting();
+
private:
// Types --------------------------------------------------------------------
@@ -440,7 +453,8 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
// Dooms the entry associated with a GET for a given url and network
// isolation key.
void DoomMainEntryForUrl(const GURL& url,
- const NetworkIsolationKey& isolation_key);
+ const NetworkIsolationKey& isolation_key,
+ bool is_subframe_document_resource);
// Closes a previously doomed entry.
void FinalizeDoomedEntry(ActiveEntry* entry);
@@ -638,6 +652,7 @@ class NET_EXPORT HttpCache : public HttpTransactionFactory {
// Used when generating and accessing keys if cache is split.
static const char kDoubleKeyPrefix[];
static const char kDoubleKeySeparator[];
+ static const char kSubframeDocumentResourcePrefix[];
// Variables ----------------------------------------------------------------
diff --git a/chromium/net/http/http_cache_lookup_manager.cc b/chromium/net/http/http_cache_lookup_manager.cc
index 1e71a417ef9..b3774cdebfc 100644
--- a/chromium/net/http/http_cache_lookup_manager.cc
+++ b/chromium/net/http/http_cache_lookup_manager.cc
@@ -17,10 +17,10 @@ namespace net {
base::Value NetLogPushLookupTransactionParams(
const NetLogSource& net_log,
const ServerPushDelegate::ServerPushHelper* push_helper) {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
net_log.AddToEventParameters(&dict);
- dict.SetString("push_url", push_helper->GetURL().possibly_invalid_spec());
- return std::move(dict);
+ dict.SetStringKey("push_url", push_helper->GetURL().possibly_invalid_spec());
+ return dict;
}
HttpCacheLookupManager::LookupTransaction::LookupTransaction(
diff --git a/chromium/net/http/http_cache_transaction.cc b/chromium/net/http/http_cache_transaction.cc
index 663677c5865..3ee8cba9c78 100644
--- a/chromium/net/http/http_cache_transaction.cc
+++ b/chromium/net/http/http_cache_transaction.cc
@@ -16,7 +16,7 @@
#include "base/auto_reset.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/location.h"
@@ -485,6 +485,11 @@ const HttpResponseInfo* HttpCache::Transaction::GetResponseInfo() const {
}
LoadState HttpCache::Transaction::GetLoadState() const {
+ // If there's no pending callback, the ball is not in the
+ // HttpCache::Transaction's court, whatever else may be going on.
+ if (!callback_)
+ return LOAD_STATE_IDLE;
+
LoadState state = GetWriterLoadState();
if (state != LOAD_STATE_WAITING_FOR_CACHE)
return state;
@@ -1831,10 +1836,10 @@ int HttpCache::Transaction::DoSuccessfulSendRequest() {
// invalidate in the cache.
if (!(effective_load_flags_ & LOAD_DISABLE_CACHE) && method_ == "POST" &&
NonErrorResponse(new_response_->headers->response_code()) &&
- (!base::FeatureList::IsEnabled(
- net::features::kSplitCacheByNetworkIsolationKey) ||
+ (!HttpCache::IsSplitCacheEnabled() ||
request_->network_isolation_key.IsFullyPopulated())) {
- cache_->DoomMainEntryForUrl(request_->url, request_->network_isolation_key);
+ cache_->DoomMainEntryForUrl(request_->url, request_->network_isolation_key,
+ request_->is_subframe_document_resource);
}
RecordNoStoreHeaderHistogram(request_->load_flags, new_response_);
@@ -2441,8 +2446,7 @@ bool HttpCache::Transaction::ShouldPassThrough() {
// again. Also, if the request does not have a top frame origin, bypass the
// cache otherwise resources from different pages could share a cached entry
// in such cases.
- else if (base::FeatureList::IsEnabled(
- features::kSplitCacheByNetworkIsolationKey) &&
+ else if (HttpCache::IsSplitCacheEnabled() &&
request_->network_isolation_key.IsTransient()) {
cacheable = false;
} else if (method_ == "GET" || method_ == "HEAD") {
@@ -3439,12 +3443,10 @@ void HttpCache::Transaction::RecordHistograms() {
// Given that cache_entry_status_ is not ENTRY_UNDEFINED, the request must
// have started and so request_ should exist.
DCHECK(request_);
- if (!request_->network_isolation_key.IsEmpty()) {
- const url::Origin& top_frame_origin =
- request_->network_isolation_key.GetTopFrameOrigin().value();
+ if (request_->possibly_top_frame_origin) {
url::Origin request_origin = url::Origin::Create(request_->url);
-
- is_third_party = !top_frame_origin.IsSameOriginWith(request_origin);
+ is_third_party =
+ !request_origin.IsSameOriginWith(*request_->possibly_top_frame_origin);
}
std::string mime_type;
diff --git a/chromium/net/http/http_cache_unittest.cc b/chromium/net/http/http_cache_unittest.cc
index bbe4f6ff2b0..2d207f9e352 100644
--- a/chromium/net/http/http_cache_unittest.cc
+++ b/chromium/net/http/http_cache_unittest.cc
@@ -12,7 +12,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/files/scoped_temp_dir.h"
#include "base/format_macros.h"
#include "base/macros.h"
@@ -2458,7 +2458,7 @@ TEST_F(HttpCacheTest, RangeGET_ParallelValidationDifferentRanges) {
std::string data_read(buffer->data(), kBufferSize);
first_read = data_read;
- EXPECT_EQ(LOAD_STATE_READING_RESPONSE, c->trans->GetLoadState());
+ EXPECT_EQ(LOAD_STATE_IDLE, c->trans->GetLoadState());
}
// 2nd transaction requests ranges 30-39.
@@ -2611,7 +2611,7 @@ TEST_F(HttpCacheTest, RangeGET_ParallelValidationCacheLockTimeout) {
std::string data_read(buffer->data(), kBufferSize);
first_read = data_read;
- EXPECT_EQ(LOAD_STATE_READING_RESPONSE, c->trans->GetLoadState());
+ EXPECT_EQ(LOAD_STATE_IDLE, c->trans->GetLoadState());
}
// Cache lock timeout will lead to dooming the entry since the transaction may
@@ -2706,7 +2706,7 @@ TEST_F(HttpCacheTest, RangeGET_ParallelValidationCouldntConditionalize) {
std::string data_read(buffer->data(), kBufferSize);
first_read = data_read;
- EXPECT_EQ(LOAD_STATE_READING_RESPONSE, c->trans->GetLoadState());
+ EXPECT_EQ(LOAD_STATE_IDLE, c->trans->GetLoadState());
}
// 2nd transaction requests a range.
@@ -2794,7 +2794,7 @@ TEST_F(HttpCacheTest, RangeGET_ParallelValidationCouldConditionalize) {
std::string data_read(buffer->data(), kBufferSize);
first_read = data_read;
- EXPECT_EQ(LOAD_STATE_READING_RESPONSE, c->trans->GetLoadState());
+ EXPECT_EQ(LOAD_STATE_IDLE, c->trans->GetLoadState());
}
// 2nd transaction requests a range.
@@ -2870,7 +2870,7 @@ TEST_F(HttpCacheTest, RangeGET_ParallelValidationOverlappingRanges) {
std::string data_read(buffer->data(), kBufferSize);
first_read = data_read;
- EXPECT_EQ(LOAD_STATE_READING_RESPONSE, c->trans->GetLoadState());
+ EXPECT_EQ(LOAD_STATE_IDLE, c->trans->GetLoadState());
}
// 2nd transaction requests ranges 30-49.
@@ -2973,7 +2973,7 @@ TEST_F(HttpCacheTest, RangeGET_ParallelValidationRestartDoneHeaders) {
std::string data_read(buffer->data(), kBufferSize);
first_read = data_read;
- EXPECT_EQ(LOAD_STATE_READING_RESPONSE, c->trans->GetLoadState());
+ EXPECT_EQ(LOAD_STATE_IDLE, c->trans->GetLoadState());
}
// 2nd transaction requests ranges 30-59.
@@ -10567,6 +10567,7 @@ TEST_F(HttpCacheTest, HttpCacheProfileThirdPartyCSS) {
// Requesting with the same top-frame origin should not count as third-party
// but should still be recorded as CSS
trans_info.network_isolation_key = NetworkIsolationKey(origin_a, origin_a);
+ trans_info.possibly_top_frame_origin = origin_a;
RunTransactionTestWithRequest(cache.http_cache(), transaction, trans_info,
&response);
@@ -10578,6 +10579,7 @@ TEST_F(HttpCacheTest, HttpCacheProfileThirdPartyCSS) {
// Requesting with a different top-frame origin should count as third-party
// and recorded as CSS
trans_info.network_isolation_key = NetworkIsolationKey(origin_b, origin_b);
+ trans_info.possibly_top_frame_origin = origin_b;
RunTransactionTestWithRequest(cache.http_cache(), transaction, trans_info,
&response);
@@ -10602,6 +10604,7 @@ TEST_F(HttpCacheTest, HttpCacheProfileThirdPartyJavaScript) {
// Requesting with the same top-frame origin should not count as third-party
// but should still be recorded as JavaScript
trans_info.network_isolation_key = NetworkIsolationKey(origin_a, origin_a);
+ trans_info.possibly_top_frame_origin = origin_a;
RunTransactionTestWithRequest(cache.http_cache(), transaction, trans_info,
&response);
@@ -10613,6 +10616,7 @@ TEST_F(HttpCacheTest, HttpCacheProfileThirdPartyJavaScript) {
// Requesting with a different top-frame origin should count as third-party
// and recorded as JavaScript
trans_info.network_isolation_key = NetworkIsolationKey(origin_b, origin_b);
+ trans_info.possibly_top_frame_origin = origin_b;
RunTransactionTestWithRequest(cache.http_cache(), transaction, trans_info,
&response);
@@ -10637,6 +10641,7 @@ TEST_F(HttpCacheTest, HttpCacheProfileThirdPartyFont) {
// Requesting with the same top-frame origin should not count as third-party
// but should still be recorded as a font
trans_info.network_isolation_key = NetworkIsolationKey(origin_a, origin_a);
+ trans_info.possibly_top_frame_origin = origin_a;
RunTransactionTestWithRequest(cache.http_cache(), transaction, trans_info,
&response);
@@ -10648,6 +10653,7 @@ TEST_F(HttpCacheTest, HttpCacheProfileThirdPartyFont) {
// Requesting with a different top-frame origin should count as third-party
// and recorded as a font
trans_info.network_isolation_key = NetworkIsolationKey(origin_b, origin_b);
+ trans_info.possibly_top_frame_origin = origin_b;
RunTransactionTestWithRequest(cache.http_cache(), transaction, trans_info,
&response);
@@ -10703,6 +10709,19 @@ TEST_F(HttpCacheTest, SplitCache) {
trans_info, &response);
EXPECT_TRUE(response.was_cached);
+ // If the same resource with the same NIK is for a subframe document resource,
+ // it should not be a cache hit.
+ MockHttpRequest subframe_document_trans_info = trans_info;
+ subframe_document_trans_info.is_subframe_document_resource = true;
+ RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
+ subframe_document_trans_info, &response);
+ EXPECT_FALSE(response.was_cached);
+
+ // Same request again should be a cache hit.
+ RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
+ subframe_document_trans_info, &response);
+ EXPECT_TRUE(response.was_cached);
+
// Now request with b.com as the top frame origin. It shouldn't be cached.
trans_info.network_isolation_key = NetworkIsolationKey(origin_b, origin_b);
RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
@@ -10752,6 +10771,47 @@ TEST_F(HttpCacheTest, SplitCache) {
EXPECT_FALSE(response.was_cached);
}
+TEST_F(HttpCacheTest, SplitCacheEnabledByDefault) {
+ HttpCache::ClearGlobalsForTesting();
+ HttpCache::SplitCacheFeatureEnableByDefault();
+ EXPECT_TRUE(HttpCache::IsSplitCacheEnabled());
+
+ MockHttpCache cache;
+ HttpResponseInfo response;
+
+ url::Origin origin_a = url::Origin::Create(GURL("http://a.com"));
+ url::Origin origin_b = url::Origin::Create(GURL("http://b.com"));
+ MockHttpRequest trans_info = MockHttpRequest(kSimpleGET_Transaction);
+ net::NetworkIsolationKey key_a(origin_a, origin_a);
+ trans_info.network_isolation_key = key_a;
+ RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
+ trans_info, &response);
+ EXPECT_FALSE(response.was_cached);
+
+ // Subsequent requests with the same NIK and different NIK will be a cache hit
+ // and miss respectively.
+ RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
+ trans_info, &response);
+ EXPECT_TRUE(response.was_cached);
+
+ net::NetworkIsolationKey key_b(origin_b, origin_b);
+ trans_info.network_isolation_key = key_b;
+ RunTransactionTestWithRequest(cache.http_cache(), kSimpleGET_Transaction,
+ trans_info, &response);
+ EXPECT_FALSE(response.was_cached);
+}
+
+TEST_F(HttpCacheTest, SplitCacheEnabledByDefaultButOverridden) {
+ HttpCache::ClearGlobalsForTesting();
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ net::features::kSplitCacheByNetworkIsolationKey);
+
+ // Enabling it here should have no effect as it is already overridden.
+ HttpCache::SplitCacheFeatureEnableByDefault();
+ EXPECT_FALSE(HttpCache::IsSplitCacheEnabled());
+}
+
TEST_F(HttpCacheTest, SplitCacheUsesRegistrableDomain) {
base::test::ScopedFeatureList feature_list;
feature_list.InitAndEnableFeature(
diff --git a/chromium/net/http/http_cache_writers.cc b/chromium/net/http/http_cache_writers.cc
index 5d8e78d22dd..9459509d5d8 100644
--- a/chromium/net/http/http_cache_writers.cc
+++ b/chromium/net/http/http_cache_writers.cc
@@ -9,7 +9,7 @@
#include "base/auto_reset.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/base/net_errors.h"
diff --git a/chromium/net/http/http_network_session.cc b/chromium/net/http/http_network_session.cc
index 07020ccd4f6..6dd71b080ef 100644
--- a/chromium/net/http/http_network_session.cc
+++ b/chromium/net/http/http_network_session.cc
@@ -258,76 +258,77 @@ std::unique_ptr<base::Value> HttpNetworkSession::SpdySessionPoolInfoToValue()
return spdy_session_pool_.SpdySessionPoolInfoToValue();
}
-std::unique_ptr<base::Value> HttpNetworkSession::QuicInfoToValue() const {
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
- dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue());
- dict->SetBoolean("quic_enabled", IsQuicEnabled());
+base::Value HttpNetworkSession::QuicInfoToValue() const {
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetKey("sessions",
+ base::Value::FromUniquePtrValue(
+ quic_stream_factory_.QuicStreamFactoryInfoToValue()));
+ dict.SetBoolKey("quic_enabled", IsQuicEnabled());
const QuicParams* quic_params = context_.quic_context->params();
- auto connection_options(std::make_unique<base::ListValue>());
+ base::Value connection_options(base::Value::Type::LIST);
for (const auto& option : quic_params->connection_options)
- connection_options->AppendString(quic::QuicTagToString(option));
- dict->Set("connection_options", std::move(connection_options));
+ connection_options.Append(quic::QuicTagToString(option));
+ dict.SetKey("connection_options", std::move(connection_options));
- auto supported_versions(std::make_unique<base::ListValue>());
+ base::Value supported_versions(base::Value::Type::LIST);
for (const auto& version : quic_params->supported_versions)
- supported_versions->AppendString(ParsedQuicVersionToString(version));
- dict->Set("supported_versions", std::move(supported_versions));
+ supported_versions.Append(ParsedQuicVersionToString(version));
+ dict.SetKey("supported_versions", std::move(supported_versions));
- auto origins_to_force_quic_on(std::make_unique<base::ListValue>());
+ base::Value origins_to_force_quic_on(base::Value::Type::LIST);
for (const auto& origin : quic_params->origins_to_force_quic_on)
- origins_to_force_quic_on->AppendString(origin.ToString());
- dict->Set("origins_to_force_quic_on", std::move(origins_to_force_quic_on));
-
- dict->SetInteger("max_packet_length", quic_params->max_packet_length);
- dict->SetInteger("max_server_configs_stored_in_properties",
- quic_params->max_server_configs_stored_in_properties);
- dict->SetInteger("idle_connection_timeout_seconds",
- quic_params->idle_connection_timeout.InSeconds());
- dict->SetInteger("reduced_ping_timeout_seconds",
- quic_params->reduced_ping_timeout.InSeconds());
- dict->SetBoolean("retry_without_alt_svc_on_quic_errors",
- quic_params->retry_without_alt_svc_on_quic_errors);
- dict->SetBoolean("disable_bidirectional_streams",
- quic_params->disable_bidirectional_streams);
- dict->SetBoolean("close_sessions_on_ip_change",
- quic_params->close_sessions_on_ip_change);
- dict->SetBoolean("goaway_sessions_on_ip_change",
- quic_params->goaway_sessions_on_ip_change);
- dict->SetBoolean("migrate_sessions_on_network_change_v2",
- quic_params->migrate_sessions_on_network_change_v2);
- dict->SetBoolean("migrate_sessions_early_v2",
- quic_params->migrate_sessions_early_v2);
- dict->SetInteger(
- "retransmittable_on_wire_timeout_milliseconds",
- quic_params->retransmittable_on_wire_timeout.InMilliseconds());
- dict->SetBoolean("retry_on_alternate_network_before_handshake",
- quic_params->retry_on_alternate_network_before_handshake);
- dict->SetBoolean("migrate_idle_sessions", quic_params->migrate_idle_sessions);
- dict->SetInteger("idle_session_migration_period_seconds",
- quic_params->idle_session_migration_period.InSeconds());
- dict->SetInteger("max_time_on_non_default_network_seconds",
- quic_params->max_time_on_non_default_network.InSeconds());
- dict->SetInteger(
+ origins_to_force_quic_on.Append(origin.ToString());
+ dict.SetKey("origins_to_force_quic_on", std::move(origins_to_force_quic_on));
+
+ dict.SetIntKey("max_packet_length", quic_params->max_packet_length);
+ dict.SetIntKey("max_server_configs_stored_in_properties",
+ quic_params->max_server_configs_stored_in_properties);
+ dict.SetIntKey("idle_connection_timeout_seconds",
+ quic_params->idle_connection_timeout.InSeconds());
+ dict.SetIntKey("reduced_ping_timeout_seconds",
+ quic_params->reduced_ping_timeout.InSeconds());
+ dict.SetBoolKey("retry_without_alt_svc_on_quic_errors",
+ quic_params->retry_without_alt_svc_on_quic_errors);
+ dict.SetBoolKey("disable_bidirectional_streams",
+ quic_params->disable_bidirectional_streams);
+ dict.SetBoolKey("close_sessions_on_ip_change",
+ quic_params->close_sessions_on_ip_change);
+ dict.SetBoolKey("goaway_sessions_on_ip_change",
+ quic_params->goaway_sessions_on_ip_change);
+ dict.SetBoolKey("migrate_sessions_on_network_change_v2",
+ quic_params->migrate_sessions_on_network_change_v2);
+ dict.SetBoolKey("migrate_sessions_early_v2",
+ quic_params->migrate_sessions_early_v2);
+ dict.SetIntKey("retransmittable_on_wire_timeout_milliseconds",
+ quic_params->retransmittable_on_wire_timeout.InMilliseconds());
+ dict.SetBoolKey("retry_on_alternate_network_before_handshake",
+ quic_params->retry_on_alternate_network_before_handshake);
+ dict.SetBoolKey("migrate_idle_sessions", quic_params->migrate_idle_sessions);
+ dict.SetIntKey("idle_session_migration_period_seconds",
+ quic_params->idle_session_migration_period.InSeconds());
+ dict.SetIntKey("max_time_on_non_default_network_seconds",
+ quic_params->max_time_on_non_default_network.InSeconds());
+ dict.SetIntKey(
"max_num_migrations_to_non_default_network_on_write_error",
quic_params->max_migrations_to_non_default_network_on_write_error);
- dict->SetInteger(
+ dict.SetIntKey(
"max_num_migrations_to_non_default_network_on_path_degrading",
quic_params->max_migrations_to_non_default_network_on_path_degrading);
- dict->SetBoolean("allow_server_migration",
- quic_params->allow_server_migration);
- dict->SetBoolean("race_stale_dns_on_connection",
- quic_params->race_stale_dns_on_connection);
- dict->SetBoolean("go_away_on_path_degrading",
- quic_params->go_away_on_path_degrading);
- dict->SetBoolean("estimate_initial_rtt", quic_params->estimate_initial_rtt);
- dict->SetBoolean("server_push_cancellation",
- params_.enable_server_push_cancellation);
- dict->SetInteger("initial_rtt_for_handshake_milliseconds",
- quic_params->initial_rtt_for_handshake.InMilliseconds());
-
- return std::move(dict);
+ dict.SetBoolKey("allow_server_migration",
+ quic_params->allow_server_migration);
+ dict.SetBoolKey("race_stale_dns_on_connection",
+ quic_params->race_stale_dns_on_connection);
+ dict.SetBoolKey("go_away_on_path_degrading",
+ quic_params->go_away_on_path_degrading);
+ dict.SetBoolKey("estimate_initial_rtt", quic_params->estimate_initial_rtt);
+ dict.SetBoolKey("server_push_cancellation",
+ params_.enable_server_push_cancellation);
+ dict.SetIntKey("initial_rtt_for_handshake_milliseconds",
+ quic_params->initial_rtt_for_handshake.InMilliseconds());
+
+ return dict;
}
void HttpNetworkSession::CloseAllConnections(int net_error,
@@ -343,7 +344,7 @@ void HttpNetworkSession::CloseAllConnections(int net_error,
void HttpNetworkSession::CloseIdleConnections(const char* net_log_reason_utf8) {
normal_socket_pool_manager_->CloseIdleSockets(net_log_reason_utf8);
websocket_socket_pool_manager_->CloseIdleSockets(net_log_reason_utf8);
- spdy_session_pool_.CloseCurrentIdleSessions();
+ spdy_session_pool_.CloseCurrentIdleSessions(net_log_reason_utf8);
}
void HttpNetworkSession::SetServerPushDelegate(
diff --git a/chromium/net/http/http_network_session.h b/chromium/net/http/http_network_session.h
index c823c73c779..a57b4893759 100644
--- a/chromium/net/http/http_network_session.h
+++ b/chromium/net/http/http_network_session.h
@@ -248,7 +248,7 @@ class NET_EXPORT HttpNetworkSession {
// Creates a Value summary of the state of the QUIC sessions and
// configuration.
- std::unique_ptr<base::Value> QuicInfoToValue() const;
+ base::Value QuicInfoToValue() const;
void CloseAllConnections(int net_error, const char* net_log_reason_utf8);
void CloseIdleConnections(const char* net_log_reason_utf8);
diff --git a/chromium/net/http/http_network_transaction.cc b/chromium/net/http/http_network_transaction.cc
index 44104427ace..6563da54e95 100644
--- a/chromium/net/http/http_network_transaction.cc
+++ b/chromium/net/http/http_network_transaction.cc
@@ -10,7 +10,7 @@
#include "base/base64url.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/metrics/field_trial.h"
@@ -192,7 +192,9 @@ int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info,
proxy_ssl_config_.disable_cert_verification_network_fetches = true;
}
- if (HttpUtil::IsMethodSafe(request_info->method)) {
+ if (request_->idempotency == IDEMPOTENT ||
+ (request_->idempotency == DEFAULT_IDEMPOTENCY &&
+ HttpUtil::IsMethodSafe(request_info->method))) {
can_send_early_data_ = true;
}
@@ -1329,8 +1331,8 @@ void HttpNetworkTransaction::ProcessReportToHeader() {
if (!response_.headers->GetNormalizedHeader("Report-To", &value))
return;
- ReportingService* service = session_->reporting_service();
- if (!service)
+ ReportingService* reporting_service = session_->reporting_service();
+ if (!reporting_service)
return;
// Only accept Report-To headers on HTTPS connections that have no
@@ -1340,7 +1342,8 @@ void HttpNetworkTransaction::ProcessReportToHeader() {
if (IsCertStatusError(response_.ssl_info.cert_status))
return;
- service->ProcessHeader(url_.GetOrigin(), value);
+ reporting_service->ProcessHeader(url_.GetOrigin(), network_isolation_key_,
+ value);
}
void HttpNetworkTransaction::ProcessNetworkErrorLoggingHeader() {
@@ -1350,9 +1353,9 @@ void HttpNetworkTransaction::ProcessNetworkErrorLoggingHeader() {
return;
}
- NetworkErrorLoggingService* service =
+ NetworkErrorLoggingService* network_error_logging_service =
session_->network_error_logging_service();
- if (!service)
+ if (!network_error_logging_service)
return;
// Don't accept NEL headers received via a proxy, because the IP address of
@@ -1370,8 +1373,9 @@ void HttpNetworkTransaction::ProcessNetworkErrorLoggingHeader() {
if (remote_endpoint_.address().empty())
return;
- service->OnHeader(url::Origin::Create(url_), remote_endpoint_.address(),
- value);
+ network_error_logging_service->OnHeader(network_isolation_key_,
+ url::Origin::Create(url_),
+ remote_endpoint_.address(), value);
}
void HttpNetworkTransaction::GenerateNetworkErrorLoggingReportIfError(int rv) {
@@ -1410,6 +1414,7 @@ void HttpNetworkTransaction::GenerateNetworkErrorLoggingReport(int rv) {
NetworkErrorLoggingService::RequestDetails details;
+ details.network_isolation_key = network_isolation_key_;
details.uri = url_;
if (!request_referrer_.empty())
details.referrer = GURL(request_referrer_);
diff --git a/chromium/net/http/http_network_transaction_unittest.cc b/chromium/net/http/http_network_transaction_unittest.cc
index f8fcca106f7..8b56db06267 100644
--- a/chromium/net/http/http_network_transaction_unittest.cc
+++ b/chromium/net/http/http_network_transaction_unittest.cc
@@ -579,6 +579,10 @@ class HttpNetworkTransactionTest : public PlatformTest,
const CommonConnectJobParams dummy_connect_job_params_;
+ const net::NetworkIsolationKey kNetworkIsolationKey =
+ NetworkIsolationKey(url::Origin::Create(GURL("https://foo.test/")),
+ url::Origin::Create(GURL("https://bar.test/")));
+
// These clocks are defined here, even though they're only used in the
// Reporting tests below, since they need to be destroyed after
// |session_deps_|.
@@ -1649,7 +1653,7 @@ void HttpNetworkTransactionTest::Check100ResponseTiming(bool use_spdy) {
spdy::SpdySerializedFrame spdy_req(
spdy_util_.ConstructSpdyGet(request.url.spec().c_str(), 1, LOWEST));
- spdy::SpdyHeaderBlock spdy_resp1_headers;
+ spdy::Http2HeaderBlock spdy_resp1_headers;
spdy_resp1_headers[spdy::kHttp2StatusHeader] = "100";
spdy::SpdySerializedFrame spdy_resp1(
spdy_util_.ConstructSpdyReply(1, spdy_resp1_headers.Clone()));
@@ -1917,7 +1921,7 @@ void HttpNetworkTransactionTest::PreconnectErrorResendRequestTest(
// SPDY versions of the request and response.
- spdy::SpdyHeaderBlock spdy_post_header_block;
+ spdy::Http2HeaderBlock spdy_post_header_block;
spdy_post_header_block[spdy::kHttp2MethodHeader] = "POST";
spdy_util.AddUrlToHeaderBlock(request.url.spec(), &spdy_post_header_block);
spdy::SpdySerializedFrame spdy_request(
@@ -6285,7 +6289,6 @@ TEST_F(HttpNetworkTransactionTest, HttpProxyLoadTimingWithPacTwoRequests) {
// Make sure that NetworkIsolationKeys are passed down to the proxy layer.
TEST_F(HttpNetworkTransactionTest, ProxyResolvedWithNetworkIsolationKey) {
const url::Origin kOrigin = url::Origin::Create(GURL("https://foo.test/"));
- const net::NetworkIsolationKey kNetworkIsolationKey(kOrigin, kOrigin);
ProxyConfig proxy_config;
proxy_config.set_auto_detect(true);
@@ -7121,7 +7124,7 @@ TEST_F(HttpNetworkTransactionTest,
spdy_util_.ConstructSpdyWindowUpdate(1, wrapped_get_resp1.size()));
// CONNECT to mail.example.org:443 via SPDY.
- spdy::SpdyHeaderBlock connect2_block;
+ spdy::Http2HeaderBlock connect2_block;
connect2_block[spdy::kHttp2MethodHeader] = "CONNECT";
connect2_block[spdy::kHttp2AuthorityHeader] = "mail.example.org:443";
spdy::SpdySerializedFrame connect2(spdy_util_.ConstructSpdyHeaders(
@@ -7365,7 +7368,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyLoadTimingTwoHttpRequests) {
net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS);
// http://www.example.org/
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/"));
spdy::SpdySerializedFrame get1(
spdy_util_.ConstructSpdyHeaders(1, std::move(headers), LOWEST, true));
@@ -7376,7 +7379,7 @@ TEST_F(HttpNetworkTransactionTest, HttpsProxySpdyLoadTimingTwoHttpRequests) {
spdy_util_.UpdateWithStreamDestruction(1);
// http://mail.example.org/
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructGetHeaderBlockForProxy("http://mail.example.org/"));
spdy::SpdySerializedFrame get2(
spdy_util_.ConstructSpdyHeaders(3, std::move(headers2), LOWEST, true));
@@ -8563,12 +8566,12 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2) {
net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS);
// First request without credentials.
- spdy::SpdyHeaderBlock request_headers0(
+ spdy::Http2HeaderBlock request_headers0(
spdy_util_.ConstructGetHeaderBlock(kUrl));
spdy::SpdySerializedFrame request0(spdy_util_.ConstructSpdyHeaders(
1, std::move(request_headers0), LOWEST, true));
- spdy::SpdyHeaderBlock response_headers0;
+ spdy::Http2HeaderBlock response_headers0;
response_headers0[spdy::kHttp2StatusHeader] = "401";
response_headers0["www-authenticate"] = "NTLM";
spdy::SpdySerializedFrame resp(spdy_util_.ConstructSpdyResponseHeaders(
@@ -8720,7 +8723,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2WithWebsockets) {
// Initial request establishes an H2 connection, which will then be reused for
// WebSockets. This is needed since WebSockets will reuse H2 connections, but
// it won't create a new one.
- spdy::SpdyHeaderBlock initial_request_headers(
+ spdy::Http2HeaderBlock initial_request_headers(
spdy_util_.ConstructGetHeaderBlock(kInitialUrl.spec()));
spdy::SpdySerializedFrame initial_request(spdy_util_.ConstructSpdyHeaders(
1, std::move(initial_request_headers), DEFAULT_PRIORITY, true));
@@ -8738,7 +8741,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2WithWebsockets) {
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
// First WebSocket request, which has no credentials.
- spdy::SpdyHeaderBlock websocket_request_headers;
+ spdy::Http2HeaderBlock websocket_request_headers;
websocket_request_headers[spdy::kHttp2MethodHeader] = "CONNECT";
websocket_request_headers[spdy::kHttp2AuthorityHeader] = "server";
websocket_request_headers[spdy::kHttp2SchemeHeader] = "https";
@@ -8752,7 +8755,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2WithWebsockets) {
3, std::move(websocket_request_headers), MEDIUM, false));
// Auth challenge to WebSocket request.
- spdy::SpdyHeaderBlock auth_challenge_headers;
+ spdy::Http2HeaderBlock auth_challenge_headers;
auth_challenge_headers[spdy::kHttp2StatusHeader] = "401";
auth_challenge_headers["www-authenticate"] = "NTLM";
spdy::SpdySerializedFrame websocket_auth_challenge(
@@ -17127,7 +17130,7 @@ TEST_F(HttpNetworkTransactionTest, RetryWithoutConnectionPooling) {
spdy::SpdySerializedFrame resp1(
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
spdy::SpdySerializedFrame body1(spdy_util_.ConstructSpdyDataFrame(1, true));
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[spdy::kHttp2StatusHeader] = "421";
spdy::SpdySerializedFrame resp2(
spdy_util_.ConstructSpdyReply(3, std::move(response_headers)));
@@ -17252,7 +17255,7 @@ TEST_F(HttpNetworkTransactionTest, ReturnHTTP421OnRetry) {
spdy::SpdySerializedFrame resp1(
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
spdy::SpdySerializedFrame body1(spdy_util_.ConstructSpdyDataFrame(1, true));
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[spdy::kHttp2StatusHeader] = "421";
spdy::SpdySerializedFrame resp2(
spdy_util_.ConstructSpdyReply(3, response_headers.Clone()));
@@ -17799,7 +17802,7 @@ TEST_F(HttpNetworkTransactionTest, DoNotUseSpdySessionForHttpOverTunnel) {
spdy_util_.ConstructWrappedSpdyFrame(req1, 1));
// SPDY GET for HTTP URL (through the proxy, but not the tunnel).
- spdy::SpdyHeaderBlock req2_block;
+ spdy::Http2HeaderBlock req2_block;
req2_block[spdy::kHttp2MethodHeader] = "GET";
req2_block[spdy::kHttp2AuthorityHeader] = "www.example.org:8080";
req2_block[spdy::kHttp2SchemeHeader] = "http";
@@ -17919,7 +17922,7 @@ TEST_F(HttpNetworkTransactionTest, DoNotUseSpdySessionIfCertDoesNotMatch) {
SpdyTestUtil spdy_util_secure;
// SPDY GET for HTTP URL (through SPDY proxy)
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlockForProxy("http://www.example.org/"));
spdy::SpdySerializedFrame req1(
spdy_util_.ConstructSpdyHeaders(1, std::move(headers), LOWEST, true));
@@ -19692,6 +19695,11 @@ TEST_F(HttpNetworkTransactionTest, NoSupportedProxies) {
#if BUILDFLAG(ENABLE_REPORTING)
class HttpNetworkTransactionReportingTest : public HttpNetworkTransactionTest {
protected:
+ HttpNetworkTransactionReportingTest() {
+ feature_list_.InitAndEnableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+ }
+
void SetUp() override {
HttpNetworkTransactionTest::SetUp();
auto test_reporting_context = std::make_unique<TestReportingContext>(
@@ -19717,6 +19725,7 @@ class HttpNetworkTransactionReportingTest : public HttpNetworkTransactionTest {
request.url = GURL(url_);
request.traffic_annotation =
net::MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS);
+ request.network_isolation_key = kNetworkIsolationKey;
MockWrite data_writes[] = {
MockWrite("GET / HTTP/1.1\r\n"
@@ -19756,6 +19765,7 @@ class HttpNetworkTransactionReportingTest : public HttpNetworkTransactionTest {
std::string url_ = "https://www.example.org/";
private:
+ base::test::ScopedFeatureList feature_list_;
TestReportingContext* test_reporting_context_;
};
@@ -19778,7 +19788,7 @@ TEST_F(HttpNetworkTransactionReportingTest, ProcessReportToHeaderHttps) {
const ReportingEndpoint endpoint =
reporting_context()->cache()->GetEndpointForTesting(
ReportingEndpointGroupKey(
- NetworkIsolationKey(),
+ kNetworkIsolationKey,
url::Origin::Create(GURL("https://www.example.org/")), "nel"),
GURL("https://www.example.org/upload/"));
EXPECT_TRUE(endpoint);
@@ -19819,6 +19829,7 @@ class HttpNetworkTransactionNetworkErrorLoggingTest
request_.method = "GET";
request_.url = GURL(url_);
+ request_.network_isolation_key = kNetworkIsolationKey;
request_.extra_headers = extra_headers_;
request_.reporting_upload_depth = reporting_upload_depth_;
request_.traffic_annotation =
@@ -19884,6 +19895,7 @@ class HttpNetworkTransactionNetworkErrorLoggingTest
const NetworkErrorLoggingService::RequestDetails& error =
network_error_logging_service()->errors()[index];
EXPECT_EQ(url_, error.uri);
+ EXPECT_EQ(kNetworkIsolationKey, error.network_isolation_key);
EXPECT_EQ(kReferrer, error.referrer);
EXPECT_EQ(kUserAgent, error.user_agent);
EXPECT_EQ(server_ip, error.server_ip);
@@ -19988,6 +20000,7 @@ TEST_F(HttpNetworkTransactionNetworkErrorLoggingTest, ProcessNelHeaderHttps) {
RequestPolicy();
ASSERT_EQ(1u, network_error_logging_service()->headers().size());
const auto& header = network_error_logging_service()->headers()[0];
+ EXPECT_EQ(kNetworkIsolationKey, header.network_isolation_key);
EXPECT_EQ(url::Origin::Create(GURL("https://www.example.org/")),
header.origin);
EXPECT_EQ(IPAddress::IPv4Localhost(), header.received_ip_address);
@@ -20557,7 +20570,7 @@ TEST_F(HttpNetworkTransactionNetworkErrorLoggingTest,
spdy::SpdySerializedFrame resp1(
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
spdy::SpdySerializedFrame body1(spdy_util_.ConstructSpdyDataFrame(1, true));
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[spdy::kHttp2StatusHeader] = "421";
spdy::SpdySerializedFrame resp2(
spdy_util_.ConstructSpdyReply(3, std::move(response_headers)));
diff --git a/chromium/net/http/http_proxy_client_socket.cc b/chromium/net/http/http_proxy_client_socket.cc
index 4ee4331a626..be5115ba481 100644
--- a/chromium/net/http/http_proxy_client_socket.cc
+++ b/chromium/net/http/http_proxy_client_socket.cc
@@ -7,7 +7,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/strings/string_util.h"
#include "base/values.h"
diff --git a/chromium/net/http/http_request_headers.cc b/chromium/net/http/http_request_headers.cc
index 81e8ca2dac4..84ea9acff02 100644
--- a/chromium/net/http/http_request_headers.cc
+++ b/chromium/net/http/http_request_headers.cc
@@ -197,17 +197,17 @@ std::string HttpRequestHeaders::ToString() const {
base::Value HttpRequestHeaders::NetLogParams(
const std::string& request_line,
NetLogCaptureMode capture_mode) const {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
dict.SetKey("line", NetLogStringValue(request_line));
- auto headers = std::make_unique<base::ListValue>();
- for (auto it = headers_.begin(); it != headers_.end(); ++it) {
+ base::Value headers(base::Value::Type::LIST);
+ for (const auto& header : headers_) {
std::string log_value =
- ElideHeaderValueForNetLog(capture_mode, it->key, it->value);
- headers->Append(
- NetLogStringValue(base::StrCat({it->key, ": ", log_value})));
+ ElideHeaderValueForNetLog(capture_mode, header.key, header.value);
+ headers.Append(
+ NetLogStringValue(base::StrCat({header.key, ": ", log_value})));
}
- dict.Set("headers", std::move(headers));
- return std::move(dict);
+ dict.SetKey("headers", std::move(headers));
+ return dict;
}
HttpRequestHeaders::HeaderVector::iterator HttpRequestHeaders::FindHeader(
diff --git a/chromium/net/http/http_request_info.cc b/chromium/net/http/http_request_info.cc
index 1410e3b1a7a..23445980a16 100644
--- a/chromium/net/http/http_request_info.cc
+++ b/chromium/net/http/http_request_info.cc
@@ -7,11 +7,13 @@
namespace net {
HttpRequestInfo::HttpRequestInfo()
- : upload_data_stream(nullptr),
+ : is_subframe_document_resource(false),
+ upload_data_stream(nullptr),
load_flags(0),
privacy_mode(PRIVACY_MODE_DISABLED),
disable_secure_dns(false),
- reporting_upload_depth(0) {}
+ reporting_upload_depth(0),
+ idempotency(net::DEFAULT_IDEMPOTENCY) {}
HttpRequestInfo::HttpRequestInfo(const HttpRequestInfo& other) = default;
diff --git a/chromium/net/http/http_request_info.h b/chromium/net/http/http_request_info.h
index 3c57bc6fe34..3837cf4da13 100644
--- a/chromium/net/http/http_request_info.h
+++ b/chromium/net/http/http_request_info.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/optional.h"
+#include "net/base/idempotency.h"
#include "net/base/net_export.h"
#include "net/base/network_isolation_key.h"
#include "net/base/privacy_mode.h"
@@ -15,6 +16,7 @@
#include "net/socket/socket_tag.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "url/gurl.h"
+#include "url/origin.h"
namespace net {
@@ -35,6 +37,9 @@ struct NET_EXPORT HttpRequestInfo {
// shared network resources like the cache.
NetworkIsolationKey network_isolation_key;
+ // True if it is a subframe's document resource.
+ bool is_subframe_document_resource;
+
// Any extra request headers (including User-Agent).
HttpRequestHeaders extra_headers;
@@ -64,6 +69,23 @@ struct NET_EXPORT HttpRequestInfo {
// If the request is a Reporting upload, the depth is the max of the depth
// of the requests reported within it plus 1.
int reporting_upload_depth;
+
+ // This may the top frame origin associated with a request, or it may be the
+ // top frame site. Or it may be nullptr. Only used for histograms.
+ //
+ // TODO(https://crbug.com/1136054): Investigate migrating the one consumer of
+ // this to NetworkIsolationKey::TopFrameSite(). That gives more consistent
+ /// behavior, and may still provide useful metrics.
+ base::Optional<url::Origin> possibly_top_frame_origin;
+
+ // Idempotency of the request, which determines that if it is safe to enable
+ // 0-RTT for the request. By default, 0-RTT is only enabled for safe
+ // HTTP methods, i.e., GET, HEAD, OPTIONS, and TRACE. For other methods,
+ // enabling 0-RTT may cause security issues since a network observer can
+ // replay the request. If the request has any side effects, those effects can
+ // happen multiple times. It is only safe to enable the 0-RTT if it is known
+ // that the request is idempotent.
+ net::Idempotency idempotency;
};
} // namespace net
diff --git a/chromium/net/http/http_response_headers.cc b/chromium/net/http/http_response_headers.cc
index 4c1429239bb..8daf5867805 100644
--- a/chromium/net/http/http_response_headers.cc
+++ b/chromium/net/http/http_response_headers.cc
@@ -1333,8 +1333,8 @@ bool HttpResponseHeaders::GetContentRangeFor206(
base::Value HttpResponseHeaders::NetLogParams(
NetLogCaptureMode capture_mode) const {
- base::DictionaryValue dict;
- base::ListValue headers;
+ base::Value dict(base::Value::Type::DICTIONARY);
+ base::Value headers(base::Value::Type::LIST);
headers.Append(NetLogStringValue(GetStatusLine()));
size_t iterator = 0;
std::string name;
@@ -1345,7 +1345,7 @@ base::Value HttpResponseHeaders::NetLogParams(
headers.Append(NetLogStringValue(base::StrCat({name, ": ", log_value})));
}
dict.SetKey("headers", std::move(headers));
- return std::move(dict);
+ return dict;
}
bool HttpResponseHeaders::IsChunkEncoded() const {
diff --git a/chromium/net/http/http_response_info.cc b/chromium/net/http/http_response_info.cc
index 65daba72b04..711667b8847 100644
--- a/chromium/net/http/http_response_info.cc
+++ b/chromium/net/http/http_response_info.cc
@@ -8,7 +8,6 @@
#include "base/numerics/safe_conversions.h"
#include "base/pickle.h"
#include "base/time/time.h"
-#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/cert/sct_status_flags.h"
#include "net/cert/signed_certificate_timestamp.h"
diff --git a/chromium/net/http/http_response_info.h b/chromium/net/http/http_response_info.h
index e47c31f1512..a056f4d3ae7 100644
--- a/chromium/net/http/http_response_info.h
+++ b/chromium/net/http/http_response_info.h
@@ -24,7 +24,6 @@ class Pickle;
namespace net {
class HttpResponseHeaders;
-class IOBufferWithSize;
class SSLCertRequestInfo;
class NET_EXPORT HttpResponseInfo {
@@ -242,9 +241,6 @@ class NET_EXPORT HttpResponseInfo {
// The "Vary" header data for this response.
HttpVaryData vary_data;
- // Any metadata associated with this resource's cached data.
- scoped_refptr<IOBufferWithSize> metadata;
-
static std::string ConnectionInfoToString(ConnectionInfo connection_info);
};
diff --git a/chromium/net/http/http_server_properties.cc b/chromium/net/http/http_server_properties.cc
index 38728fdc070..7f67a27dbd0 100644
--- a/chromium/net/http/http_server_properties.cc
+++ b/chromium/net/http/http_server_properties.cc
@@ -375,16 +375,14 @@ void HttpServerProperties::OnDefaultNetworkChanged() {
MaybeQueueWriteProperties();
}
-std::unique_ptr<base::Value>
-HttpServerProperties::GetAlternativeServiceInfoAsValue() const {
+base::Value HttpServerProperties::GetAlternativeServiceInfoAsValue() const {
const base::Time now = clock_->Now();
const base::TimeTicks now_ticks = tick_clock_->NowTicks();
- std::unique_ptr<base::ListValue> dict_list(new base::ListValue);
+ base::Value dict_list(base::Value::Type::LIST);
for (const auto& server_info : server_info_map_) {
if (!server_info.second.alternative_services.has_value())
continue;
- std::unique_ptr<base::ListValue> alternative_service_list(
- new base::ListValue);
+ base::Value alternative_service_list(base::Value::Type::LIST);
const ServerInfoMapKey& key = server_info.first;
for (const AlternativeServiceInfo& alternative_service_info :
server_info.second.alternative_services.value()) {
@@ -415,19 +413,18 @@ HttpServerProperties::GetAlternativeServiceInfoAsValue() const {
")";
alternative_service_string.append(broken_info_string);
}
- alternative_service_list->AppendString(alternative_service_string);
+ alternative_service_list.Append(std::move(alternative_service_string));
}
- if (alternative_service_list->empty())
+ if (alternative_service_list.GetList().empty())
continue;
- std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
- dict->SetString("server", key.server.Serialize());
- dict->SetString("network_isolation_key",
- key.network_isolation_key.ToDebugString());
- dict->Set("alternative_service", std::unique_ptr<base::Value>(
- std::move(alternative_service_list)));
- dict_list->Append(std::move(dict));
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetStringKey("server", key.server.Serialize());
+ dict.SetStringKey("network_isolation_key",
+ key.network_isolation_key.ToDebugString());
+ dict.SetKey("alternative_service", std::move(alternative_service_list));
+ dict_list.Append(std::move(dict));
}
- return std::move(dict_list);
+ return dict_list;
}
bool HttpServerProperties::WasLastLocalAddressWhenQuicWorked(
diff --git a/chromium/net/http/http_server_properties.h b/chromium/net/http/http_server_properties.h
index 6c71351701b..bab8f5967ad 100644
--- a/chromium/net/http/http_server_properties.h
+++ b/chromium/net/http/http_server_properties.h
@@ -111,12 +111,12 @@ class NET_EXPORT HttpServerProperties
// Returns the branch of the preferences system for the server properties.
// Returns nullptr if the pref system has no data for the server properties.
- virtual const base::DictionaryValue* GetServerProperties() const = 0;
+ virtual const base::Value* GetServerProperties() const = 0;
// Sets the server properties to the given value. If |callback| is
// non-empty, flushes data to persistent storage and invokes |callback|
// asynchronously when complete.
- virtual void SetServerProperties(const base::DictionaryValue& value,
+ virtual void SetServerProperties(const base::Value& value,
base::OnceClosure callback) = 0;
// Starts listening for prefs to be loaded. If prefs are already loaded,
@@ -362,7 +362,7 @@ class NET_EXPORT HttpServerProperties
// Returns all alternative service mappings as human readable strings.
// Empty alternative service hostnames will be printed as such.
- std::unique_ptr<base::Value> GetAlternativeServiceInfoAsValue() const;
+ base::Value GetAlternativeServiceInfoAsValue() const;
// Tracks the last local address when QUIC was known to work. The address
// cannot be set to an empty address - use
diff --git a/chromium/net/http/http_server_properties_manager.cc b/chromium/net/http/http_server_properties_manager.cc
index 00fb6ee099b..41632986436 100644
--- a/chromium/net/http/http_server_properties_manager.cc
+++ b/chromium/net/http/http_server_properties_manager.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
+#include "base/optional.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/tick_clock.h"
@@ -105,20 +106,22 @@ AlternativeServiceInfoVector GetAlternativeServiceToPersist(
void AddAlternativeServiceFieldsToDictionaryValue(
const AlternativeService& alternative_service,
- base::DictionaryValue* dict) {
- dict->SetInteger(kPortKey, alternative_service.port);
+ base::Value* dict) {
+ DCHECK(dict->is_dict());
+ dict->SetIntKey(kPortKey, alternative_service.port);
if (!alternative_service.host.empty()) {
- dict->SetString(kHostKey, alternative_service.host);
+ dict->SetStringKey(kHostKey, alternative_service.host);
}
- dict->SetString(kProtocolKey,
- NextProtoToString(alternative_service.protocol));
+ dict->SetStringKey(kProtocolKey,
+ NextProtoToString(alternative_service.protocol));
}
// Fails in the case of NetworkIsolationKeys that can't be persisted to disk,
// like unique origins.
bool TryAddBrokenAlternativeServiceFieldsToDictionaryValue(
const BrokenAlternativeService& broken_alt_service,
- base::DictionaryValue* dict) {
+ base::Value* dict) {
+ DCHECK(dict->is_dict());
base::Value network_isolation_key_value;
if (!broken_alt_service.network_isolation_key.ToValue(
&network_isolation_key_value)) {
@@ -226,24 +229,23 @@ void HttpServerPropertiesManager::ReadPrefs(
net_log_.EndEvent(NetLogEventType::HTTP_SERVER_PROPERTIES_INITIALIZATION);
- const base::DictionaryValue* http_server_properties_dict =
+ const base::Value* http_server_properties_dict =
pref_delegate_->GetServerProperties();
// If there are no preferences set, do nothing.
- if (!http_server_properties_dict)
+ if (!http_server_properties_dict || !http_server_properties_dict->is_dict())
return;
net_log_.AddEvent(NetLogEventType::HTTP_SERVER_PROPERTIES_UPDATE_CACHE,
[&] { return http_server_properties_dict->Clone(); });
- int version_number = kMissingVersion;
- if (!http_server_properties_dict->GetIntegerWithoutPathExpansion(
- kVersionKey, &version_number) ||
- version_number != kVersionNumber) {
+ base::Optional<int> maybe_version_number =
+ http_server_properties_dict->FindIntKey(kVersionKey);
+ if (!maybe_version_number.has_value() ||
+ *maybe_version_number != kVersionNumber) {
DVLOG(1) << "Missing or unsupported. Clearing all properties. "
- << version_number;
+ << maybe_version_number.value_or(kMissingVersion);
return;
}
- const base::ListValue* servers_list = nullptr;
// For Version 5, data is stored in the following format.
// |servers| are saved in MRU order. |servers| are in the format flattened
// representation of (scheme/host/port) where port might be ignored if is
@@ -257,8 +259,9 @@ void HttpServerPropertiesManager::ReadPrefs(
// ...
// ], ...
// },
- if (!http_server_properties_dict->GetListWithoutPathExpansion(
- kServersKey, &servers_list)) {
+ const base::Value* servers_list =
+ http_server_properties_dict->FindListKey(kServersKey);
+ if (!servers_list) {
DVLOG(1) << "Malformed http_server_properties for servers list.";
return;
}
@@ -277,15 +280,14 @@ void HttpServerPropertiesManager::ReadPrefs(
// Iterate servers list in reverse MRU order so that entries are inserted
// into |spdy_servers_map|, |alternative_service_map|, and
// |server_network_stats_map| from oldest to newest.
- const base::DictionaryValue* server_dict = nullptr;
- for (auto it = servers_list->end(); it != servers_list->begin();) {
+ for (auto it = servers_list->GetList().end();
+ it != servers_list->GetList().begin();) {
--it;
- if (!it->GetAsDictionary(&server_dict)) {
+ if (!it->is_dict()) {
DVLOG(1) << "Malformed http_server_properties for servers dictionary.";
continue;
}
- AddServerData(*server_dict, server_info_map->get(),
- use_network_isolation_key);
+ AddServerData(*it, server_info_map->get(), use_network_isolation_key);
}
AddToQuicServerInfoMap(*http_server_properties_dict,
@@ -294,9 +296,9 @@ void HttpServerPropertiesManager::ReadPrefs(
// Read list containing broken and recently-broken alternative services, if
// it exists.
- const base::ListValue* broken_alt_svc_list;
- if (http_server_properties_dict->GetListWithoutPathExpansion(
- kBrokenAlternativeServicesKey, &broken_alt_svc_list)) {
+ const base::Value* broken_alt_svc_list =
+ http_server_properties_dict->FindListKey(kBrokenAlternativeServicesKey);
+ if (broken_alt_svc_list) {
*broken_alternative_service_list =
std::make_unique<BrokenAlternativeServiceList>();
*recently_broken_alternative_services =
@@ -304,16 +306,15 @@ void HttpServerPropertiesManager::ReadPrefs(
kMaxRecentlyBrokenAlternativeServiceEntries);
// Iterate list in reverse-MRU order
- for (auto it = broken_alt_svc_list->end();
- it != broken_alt_svc_list->begin();) {
+ for (auto it = broken_alt_svc_list->GetList().end();
+ it != broken_alt_svc_list->GetList().begin();) {
--it;
- const base::DictionaryValue* entry_dict;
- if (!it->GetAsDictionary(&entry_dict)) {
+ if (!it->is_dict()) {
DVLOG(1) << "Malformed broken alterantive service entry.";
continue;
}
AddToBrokenAlternativeServices(
- *entry_dict, use_network_isolation_key,
+ *it, use_network_isolation_key,
broken_alternative_service_list->get(),
recently_broken_alternative_services->get());
}
@@ -339,7 +340,7 @@ void HttpServerPropertiesManager::ReadPrefs(
}
void HttpServerPropertiesManager::AddToBrokenAlternativeServices(
- const base::DictionaryValue& broken_alt_svc_entry_dict,
+ const base::Value& broken_alt_svc_entry_dict,
bool use_network_isolation_key,
BrokenAlternativeServiceList* broken_alternative_service_list,
RecentlyBrokenAlternativeServices* recently_broken_alternative_services) {
@@ -362,33 +363,33 @@ void HttpServerPropertiesManager::AddToBrokenAlternativeServices(
// Read broken-count and add an entry for |alt_service| into
// |recently_broken_alternative_services|.
- if (broken_alt_svc_entry_dict.HasKey(kBrokenCountKey)) {
- int broken_count;
- if (!broken_alt_svc_entry_dict.GetIntegerWithoutPathExpansion(
- kBrokenCountKey, &broken_count)) {
+ if (broken_alt_svc_entry_dict.FindKey(kBrokenCountKey)) {
+ base::Optional<int> broken_count =
+ broken_alt_svc_entry_dict.FindIntKey(kBrokenCountKey);
+ if (!broken_count.has_value()) {
DVLOG(1) << "Recently broken alternative service has malformed "
<< "broken-count.";
return;
}
- if (broken_count < 0) {
+ if (broken_count.value() < 0) {
DVLOG(1) << "Broken alternative service has negative broken-count.";
return;
}
recently_broken_alternative_services->Put(
BrokenAlternativeService(alt_service, network_isolation_key,
use_network_isolation_key),
- broken_count);
+ broken_count.value());
contains_broken_count_or_broken_until = true;
}
// Read broken-until and add an entry for |alt_service| in
// |broken_alternative_service_list|.
- if (broken_alt_svc_entry_dict.HasKey(kBrokenUntilKey)) {
- std::string expiration_string;
+ if (broken_alt_svc_entry_dict.FindKey(kBrokenUntilKey)) {
+ const std::string* expiration_string =
+ broken_alt_svc_entry_dict.FindStringKey(kBrokenUntilKey);
int64_t expiration_int64;
- if (!broken_alt_svc_entry_dict.GetStringWithoutPathExpansion(
- kBrokenUntilKey, &expiration_string) ||
- !base::StringToInt64(expiration_string, &expiration_int64)) {
+ if (!expiration_string ||
+ !base::StringToInt64(*expiration_string, &expiration_int64)) {
DVLOG(1) << "Broken alternative service has malformed broken-until "
<< "string.";
return;
@@ -413,7 +414,7 @@ void HttpServerPropertiesManager::AddToBrokenAlternativeServices(
}
void HttpServerPropertiesManager::AddServerData(
- const base::DictionaryValue& server_dict,
+ const base::Value& server_dict,
HttpServerProperties::ServerInfoMap* server_info_map,
bool use_network_isolation_key) {
// Get server's scheme/host/pair.
@@ -449,18 +450,18 @@ void HttpServerPropertiesManager::AddServerData(
}
bool HttpServerPropertiesManager::ParseAlternativeServiceDict(
- const base::DictionaryValue& dict,
+ const base::Value& dict,
bool host_optional,
const std::string& parsing_under,
AlternativeService* alternative_service) {
// Protocol is mandatory.
- std::string protocol_str;
- if (!dict.GetStringWithoutPathExpansion(kProtocolKey, &protocol_str)) {
+ const std::string* protocol_str = dict.FindStringKey(kProtocolKey);
+ if (!protocol_str) {
DVLOG(1) << "Malformed alternative service protocol string under: "
<< parsing_under;
return false;
}
- NextProto protocol = NextProtoFromString(protocol_str);
+ NextProto protocol = NextProtoFromString(*protocol_str);
if (!IsAlternateProtocolValid(protocol)) {
DVLOG(1) << "Invalid alternative service protocol string \"" << protocol_str
<< "\" under: " << parsing_under;
@@ -470,12 +471,15 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceDict(
// If host is optional, it defaults to "".
std::string host = "";
- if (dict.HasKey(kHostKey)) {
- if (!dict.GetStringWithoutPathExpansion(kHostKey, &host)) {
+ const std::string* hostp = nullptr;
+ if (dict.FindKey(kHostKey)) {
+ hostp = dict.FindStringKey(kHostKey);
+ if (!hostp) {
DVLOG(1) << "Malformed alternative service host string under: "
<< parsing_under;
return false;
}
+ host = *hostp;
} else if (!host_optional) {
DVLOG(1) << "alternative service missing host string under: "
<< parsing_under;
@@ -484,18 +488,18 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceDict(
alternative_service->host = host;
// Port is mandatory.
- int port = 0;
- if (!dict.GetInteger(kPortKey, &port) || !IsPortValid(port)) {
+ base::Optional<int> maybe_port = dict.FindIntKey(kPortKey);
+ if (!maybe_port.has_value() || !IsPortValid(maybe_port.value())) {
DVLOG(1) << "Malformed alternative service port under: " << parsing_under;
return false;
}
- alternative_service->port = static_cast<uint32_t>(port);
+ alternative_service->port = static_cast<uint32_t>(maybe_port.value());
return true;
}
bool HttpServerPropertiesManager::ParseAlternativeServiceInfoDictOfServer(
- const base::DictionaryValue& dict,
+ const base::Value& dict,
const std::string& server_str,
AlternativeServiceInfo* alternative_service_info) {
AlternativeService alternative_service;
@@ -506,15 +510,14 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceInfoDictOfServer(
alternative_service_info->set_alternative_service(alternative_service);
// Expiration is optional, defaults to one day.
- if (!dict.HasKey(kExpirationKey)) {
+ if (!dict.FindKey(kExpirationKey)) {
alternative_service_info->set_expiration(base::Time::Now() +
base::TimeDelta::FromDays(1));
} else {
- std::string expiration_string;
- if (dict.GetStringWithoutPathExpansion(kExpirationKey,
- &expiration_string)) {
+ const std::string* expiration_string = dict.FindStringKey(kExpirationKey);
+ if (expiration_string) {
int64_t expiration_int64 = 0;
- if (!base::StringToInt64(expiration_string, &expiration_int64)) {
+ if (!base::StringToInt64(*expiration_string, &expiration_int64)) {
DVLOG(1) << "Malformed alternative service expiration for server: "
<< server_str;
return false;
@@ -530,16 +533,15 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceInfoDictOfServer(
// Advertised versions list is optional.
// It is only used for versions that use the legacy Google AltSvc format.
- if (dict.HasKey(kAdvertisedVersionsKey)) {
- const base::ListValue* versions_list = nullptr;
- if (!dict.GetListWithoutPathExpansion(kAdvertisedVersionsKey,
- &versions_list)) {
+ if (dict.FindKey(kAdvertisedVersionsKey)) {
+ const base::Value* versions_list = dict.FindListKey(kAdvertisedVersionsKey);
+ if (!versions_list) {
DVLOG(1) << "Malformed alternative service advertised versions list for "
<< "server: " << server_str;
return false;
}
quic::ParsedQuicVersionVector advertised_versions;
- for (const auto& value : *versions_list) {
+ for (const auto& value : versions_list->GetList()) {
int version;
if (!value.GetAsInteger(&version)) {
DVLOG(1) << "Malformed alternative service version for server: "
@@ -564,12 +566,12 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceInfoDictOfServer(
bool HttpServerPropertiesManager::ParseAlternativeServiceInfo(
const url::SchemeHostPort& server,
- const base::DictionaryValue& server_pref_dict,
+ const base::Value& server_pref_dict,
HttpServerProperties::ServerInfo* server_info) {
DCHECK(!server_info->alternative_services.has_value());
- const base::ListValue* alternative_service_list;
- if (!server_pref_dict.GetListWithoutPathExpansion(
- kAlternativeServiceKey, &alternative_service_list)) {
+ const base::Value* alternative_service_list =
+ server_pref_dict.FindListKey(kAlternativeServiceKey);
+ if (!alternative_service_list) {
return true;
}
if (server.scheme() != "https") {
@@ -577,13 +579,12 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceInfo(
}
AlternativeServiceInfoVector alternative_service_info_vector;
- for (const auto& alternative_service_list_item : *alternative_service_list) {
- const base::DictionaryValue* alternative_service_dict;
- if (!alternative_service_list_item.GetAsDictionary(
- &alternative_service_dict))
+ for (const auto& alternative_service_list_item :
+ alternative_service_list->GetList()) {
+ if (!alternative_service_list_item.is_dict())
return false;
AlternativeServiceInfo alternative_service_info;
- if (!ParseAlternativeServiceInfoDictOfServer(*alternative_service_dict,
+ if (!ParseAlternativeServiceInfoDictOfServer(alternative_service_list_item,
server.Serialize(),
&alternative_service_info)) {
return false;
@@ -602,56 +603,55 @@ bool HttpServerPropertiesManager::ParseAlternativeServiceInfo(
}
void HttpServerPropertiesManager::ReadLastLocalAddressWhenQuicWorked(
- const base::DictionaryValue& http_server_properties_dict,
+ const base::Value& http_server_properties_dict,
IPAddress* last_local_address_when_quic_worked) {
- const base::DictionaryValue* supports_quic_dict = nullptr;
- if (!http_server_properties_dict.GetDictionaryWithoutPathExpansion(
- kSupportsQuicKey, &supports_quic_dict)) {
+ const base::Value* supports_quic_dict =
+ http_server_properties_dict.FindDictKey(kSupportsQuicKey);
+ if (!supports_quic_dict) {
return;
}
- bool used_quic = false;
- if (!supports_quic_dict->GetBooleanWithoutPathExpansion(kUsedQuicKey,
- &used_quic)) {
+ const base::Value* used_quic = supports_quic_dict->FindKey(kUsedQuicKey);
+ if (!used_quic || !used_quic->is_bool()) {
DVLOG(1) << "Malformed SupportsQuic";
return;
}
- if (!used_quic)
+ if (!used_quic->GetBool())
return;
- std::string address;
- if (!supports_quic_dict->GetStringWithoutPathExpansion(kAddressKey,
- &address) ||
- !last_local_address_when_quic_worked->AssignFromIPLiteral(address)) {
+ const std::string* address = supports_quic_dict->FindStringKey(kAddressKey);
+ if (!address ||
+ !last_local_address_when_quic_worked->AssignFromIPLiteral(*address)) {
DVLOG(1) << "Malformed SupportsQuic";
}
}
void HttpServerPropertiesManager::ParseNetworkStats(
const url::SchemeHostPort& server,
- const base::DictionaryValue& server_pref_dict,
+ const base::Value& server_pref_dict,
HttpServerProperties::ServerInfo* server_info) {
DCHECK(!server_info->server_network_stats.has_value());
- const base::DictionaryValue* server_network_stats_dict = nullptr;
- if (!server_pref_dict.GetDictionaryWithoutPathExpansion(
- kNetworkStatsKey, &server_network_stats_dict)) {
+ const base::Value* server_network_stats_dict =
+ server_pref_dict.FindDictKey(kNetworkStatsKey);
+ if (!server_network_stats_dict) {
return;
}
- int srtt;
- if (!server_network_stats_dict->GetIntegerWithoutPathExpansion(kSrttKey,
- &srtt)) {
+ base::Optional<int> maybe_srtt =
+ server_network_stats_dict->FindIntKey(kSrttKey);
+ if (!maybe_srtt.has_value()) {
DVLOG(1) << "Malformed ServerNetworkStats for server: "
<< server.Serialize();
return;
}
ServerNetworkStats server_network_stats;
- server_network_stats.srtt = base::TimeDelta::FromMicroseconds(srtt);
+ server_network_stats.srtt =
+ base::TimeDelta::FromMicroseconds(maybe_srtt.value());
// TODO(rtenneti): When QUIC starts using bandwidth_estimate, then persist
// bandwidth_estimate.
server_info->server_network_stats = server_network_stats;
}
void HttpServerPropertiesManager::AddToQuicServerInfoMap(
- const base::DictionaryValue& http_server_properties_dict,
+ const base::Value& http_server_properties_dict,
bool use_network_isolation_key,
HttpServerProperties::QuicServerInfoMap* quic_server_info_map) {
const base::Value* quic_server_info_list =
@@ -719,9 +719,9 @@ void HttpServerPropertiesManager::WriteToPrefs(
std::set<std::pair<std::string, NetworkIsolationKey>>
persisted_canonical_suffix_set;
const base::Time now = base::Time::Now();
- base::DictionaryValue http_server_properties_dict;
+ base::Value http_server_properties_dict(base::Value::Type::DICTIONARY);
- // Convert |server_info_map| to a DictionaryValue and add it to
+ // Convert |server_info_map| to a dictionary Value and add it to
// |http_server_properties_dict|.
base::Value servers_list(base::Value::Type::LIST);
for (auto map_it = server_info_map.rbegin(); map_it != server_info_map.rend();
@@ -735,7 +735,7 @@ void HttpServerPropertiesManager::WriteToPrefs(
if (!key.network_isolation_key.ToValue(&network_isolation_key_value))
continue;
- base::DictionaryValue server_dict;
+ base::Value server_dict(base::Value::Type::DICTIONARY);
bool supports_spdy = server_info.supports_spdy.value_or(false);
if (supports_spdy)
@@ -765,7 +765,7 @@ void HttpServerPropertiesManager::WriteToPrefs(
}
http_server_properties_dict.SetKey(kServersKey, std::move(servers_list));
- http_server_properties_dict.SetInteger(kVersionKey, kVersionNumber);
+ http_server_properties_dict.SetIntKey(kVersionKey, kVersionNumber);
SaveLastLocalAddressWhenQuicWorkedToPrefs(last_local_address_when_quic_worked,
&http_server_properties_dict);
@@ -786,71 +786,68 @@ void HttpServerPropertiesManager::WriteToPrefs(
void HttpServerPropertiesManager::SaveAlternativeServiceToServerPrefs(
const AlternativeServiceInfoVector& alternative_service_info_vector,
- base::DictionaryValue* server_pref_dict) {
+ base::Value* server_pref_dict) {
if (alternative_service_info_vector.empty()) {
return;
}
- std::unique_ptr<base::ListValue> alternative_service_list(
- new base::ListValue);
+ base::Value alternative_service_list(base::Value::Type::LIST);
for (const AlternativeServiceInfo& alternative_service_info :
alternative_service_info_vector) {
const AlternativeService& alternative_service =
alternative_service_info.alternative_service();
DCHECK(IsAlternateProtocolValid(alternative_service.protocol));
- std::unique_ptr<base::DictionaryValue> alternative_service_dict(
- new base::DictionaryValue);
- AddAlternativeServiceFieldsToDictionaryValue(
- alternative_service, alternative_service_dict.get());
+ base::Value alternative_service_dict(base::Value::Type::DICTIONARY);
+ AddAlternativeServiceFieldsToDictionaryValue(alternative_service,
+ &alternative_service_dict);
// JSON cannot store int64_t, so expiration is converted to a string.
- alternative_service_dict->SetString(
+ alternative_service_dict.SetStringKey(
kExpirationKey,
base::NumberToString(
alternative_service_info.expiration().ToInternalValue()));
- std::unique_ptr<base::ListValue> advertised_versions_list =
- std::make_unique<base::ListValue>();
+ base::Value advertised_versions_list(base::Value::Type::LIST);
for (const auto& version : alternative_service_info.advertised_versions()) {
- advertised_versions_list->AppendInteger(version.transport_version);
+ advertised_versions_list.Append(version.transport_version);
}
- alternative_service_dict->SetList(kAdvertisedVersionsKey,
- std::move(advertised_versions_list));
- alternative_service_list->Append(std::move(alternative_service_dict));
+ alternative_service_dict.SetKey(kAdvertisedVersionsKey,
+ std::move(advertised_versions_list));
+ alternative_service_list.Append(std::move(alternative_service_dict));
}
- if (alternative_service_list->GetSize() == 0)
+ if (alternative_service_list.GetList().size() == 0)
return;
- server_pref_dict->SetWithoutPathExpansion(
- kAlternativeServiceKey, std::move(alternative_service_list));
+ server_pref_dict->SetKey(kAlternativeServiceKey,
+ std::move(alternative_service_list));
}
void HttpServerPropertiesManager::SaveLastLocalAddressWhenQuicWorkedToPrefs(
const IPAddress& last_local_address_when_quic_worked,
- base::DictionaryValue* http_server_properties_dict) {
+ base::Value* http_server_properties_dict) {
if (!last_local_address_when_quic_worked.IsValid())
return;
- auto supports_quic_dict = std::make_unique<base::DictionaryValue>();
- supports_quic_dict->SetBoolean(kUsedQuicKey, true);
- supports_quic_dict->SetString(kAddressKey,
- last_local_address_when_quic_worked.ToString());
- http_server_properties_dict->SetWithoutPathExpansion(
- kSupportsQuicKey, std::move(supports_quic_dict));
+ base::Value supports_quic_dict(base::Value::Type::DICTIONARY);
+ supports_quic_dict.SetBoolKey(kUsedQuicKey, true);
+ supports_quic_dict.SetStringKey(
+ kAddressKey, last_local_address_when_quic_worked.ToString());
+ http_server_properties_dict->SetKey(kSupportsQuicKey,
+ std::move(supports_quic_dict));
}
void HttpServerPropertiesManager::SaveNetworkStatsToServerPrefs(
const ServerNetworkStats& server_network_stats,
- base::DictionaryValue* server_pref_dict) {
- auto server_network_stats_dict = std::make_unique<base::DictionaryValue>();
+ base::Value* server_pref_dict) {
+ base::Value server_network_stats_dict(base::Value::Type::DICTIONARY);
// Becasue JSON doesn't support int64_t, persist int64_t as a string.
- server_network_stats_dict->SetInteger(
+ server_network_stats_dict.SetIntKey(
kSrttKey, static_cast<int>(server_network_stats.srtt.InMicroseconds()));
// TODO(rtenneti): When QUIC starts using bandwidth_estimate, then persist
// bandwidth_estimate.
- server_pref_dict->SetWithoutPathExpansion(
- kNetworkStatsKey, std::move(server_network_stats_dict));
+ server_pref_dict->SetKey(kNetworkStatsKey,
+ std::move(server_network_stats_dict));
}
void HttpServerPropertiesManager::SaveQuicServerInfoMapToServerPrefs(
const HttpServerProperties::QuicServerInfoMap& quic_server_info_map,
- base::DictionaryValue* http_server_properties_dict) {
+ base::Value* http_server_properties_dict) {
if (quic_server_info_map.empty())
return;
base::Value quic_servers_list(base::Value::Type::LIST);
@@ -881,7 +878,7 @@ void HttpServerPropertiesManager::SaveBrokenAlternativeServicesToPrefs(
size_t max_broken_alternative_services,
const RecentlyBrokenAlternativeServices&
recently_broken_alternative_services,
- base::DictionaryValue* http_server_properties_dict) {
+ base::Value* http_server_properties_dict) {
if (broken_alternative_service_list.empty() &&
recently_broken_alternative_services.empty()) {
return;
@@ -889,8 +886,7 @@ void HttpServerPropertiesManager::SaveBrokenAlternativeServicesToPrefs(
// JSON list will be in MRU order according to
// |recently_broken_alternative_services|.
- std::unique_ptr<base::ListValue> json_list =
- std::make_unique<base::ListValue>();
+ base::Value json_list(base::Value::Type::LIST);
// Maps recently-broken alternative services to the index where it's stored
// in |json_list|.
@@ -902,14 +898,14 @@ void HttpServerPropertiesManager::SaveBrokenAlternativeServicesToPrefs(
const BrokenAlternativeService& broken_alt_service = it->first;
int broken_count = it->second;
- base::DictionaryValue entry_dict;
+ base::Value entry_dict(base::Value::Type::DICTIONARY);
if (!TryAddBrokenAlternativeServiceFieldsToDictionaryValue(
broken_alt_service, &entry_dict)) {
continue;
}
entry_dict.SetKey(kBrokenCountKey, base::Value(broken_count));
- json_list_index_map[broken_alt_service] = json_list->GetList().size();
- json_list->Append(std::move(entry_dict));
+ json_list_index_map[broken_alt_service] = json_list.GetList().size();
+ json_list.Append(std::move(entry_dict));
}
}
@@ -932,32 +928,31 @@ void HttpServerPropertiesManager::SaveBrokenAlternativeServicesToPrefs(
auto index_map_it = json_list_index_map.find(broken_alt_service);
if (index_map_it != json_list_index_map.end()) {
size_t json_list_index = index_map_it->second;
- base::DictionaryValue* entry_dict = nullptr;
- bool result = json_list->GetDictionary(json_list_index, &entry_dict);
- DCHECK(result);
- DCHECK(!entry_dict->HasKey(kBrokenUntilKey));
- entry_dict->SetKey(kBrokenUntilKey,
- base::Value(base::NumberToString(expiration_int64)));
+ base::Value& entry_dict = json_list.GetList()[json_list_index];
+ DCHECK(entry_dict.is_dict());
+ DCHECK(!entry_dict.FindKey(kBrokenUntilKey));
+ entry_dict.SetKey(kBrokenUntilKey,
+ base::Value(base::NumberToString(expiration_int64)));
} else {
- base::DictionaryValue entry_dict;
+ base::Value entry_dict(base::Value::Type::DICTIONARY);
if (!TryAddBrokenAlternativeServiceFieldsToDictionaryValue(
broken_alt_service, &entry_dict)) {
continue;
}
entry_dict.SetKey(kBrokenUntilKey,
base::Value(base::NumberToString(expiration_int64)));
- json_list->Append(std::move(entry_dict));
+ json_list.Append(std::move(entry_dict));
}
}
}
// This can happen if all the entries are for NetworkIsolationKeys for opaque
// origins, which isn't exactly common, but can theoretically happen.
- if (json_list->empty())
+ if (json_list.GetList().empty())
return;
- http_server_properties_dict->SetWithoutPathExpansion(
- kBrokenAlternativeServicesKey, std::move(json_list));
+ http_server_properties_dict->SetKey(kBrokenAlternativeServicesKey,
+ std::move(json_list));
}
void HttpServerPropertiesManager::OnHttpServerPropertiesLoaded() {
diff --git a/chromium/net/http/http_server_properties_manager.h b/chromium/net/http/http_server_properties_manager.h
index d80595179f3..c62b37140d7 100644
--- a/chromium/net/http/http_server_properties_manager.h
+++ b/chromium/net/http/http_server_properties_manager.h
@@ -21,7 +21,6 @@
#include "net/log/net_log_with_source.h"
namespace base {
-class DictionaryValue;
class TickClock;
}
@@ -127,7 +126,7 @@ class NET_EXPORT_PRIVATE HttpServerPropertiesManager {
FRIEND_TEST_ALL_PREFIXES(HttpServerPropertiesManagerTest,
DoNotLoadExpiredAlternativeService);
- void AddServerData(const base::DictionaryValue& server_dict,
+ void AddServerData(const base::Value& server_dict,
HttpServerProperties::ServerInfoMap* server_info_map,
bool use_network_isolation_key);
@@ -141,13 +140,13 @@ class NET_EXPORT_PRIVATE HttpServerPropertiesManager {
// |alternative_service| is the output of parsing |dict|.
// Return value is true if parsing is successful.
static bool ParseAlternativeServiceDict(
- const base::DictionaryValue& dict,
+ const base::Value& dict,
bool host_optional,
const std::string& parsing_under,
AlternativeService* alternative_service);
static bool ParseAlternativeServiceInfoDictOfServer(
- const base::DictionaryValue& dict,
+ const base::Value& dict,
const std::string& server_str,
AlternativeServiceInfo* alternative_service_info);
@@ -156,43 +155,43 @@ class NET_EXPORT_PRIVATE HttpServerPropertiesManager {
// not considered corruption).
static bool ParseAlternativeServiceInfo(
const url::SchemeHostPort& server,
- const base::DictionaryValue& server_dict,
+ const base::Value& server_dict,
HttpServerProperties::ServerInfo* server_info);
void ReadLastLocalAddressWhenQuicWorked(
- const base::DictionaryValue& server_dict,
+ const base::Value& server_dict,
IPAddress* last_local_address_when_quic_worked);
void ParseNetworkStats(const url::SchemeHostPort& server,
- const base::DictionaryValue& server_dict,
+ const base::Value& server_dict,
HttpServerProperties::ServerInfo* server_info);
void AddToQuicServerInfoMap(
- const base::DictionaryValue& server_dict,
+ const base::Value& server_dict,
bool use_network_isolation_key,
HttpServerProperties::QuicServerInfoMap* quic_server_info_map);
void AddToBrokenAlternativeServices(
- const base::DictionaryValue& broken_alt_svc_entry_dict,
+ const base::Value& broken_alt_svc_entry_dict,
bool use_network_isolation_key,
BrokenAlternativeServiceList* broken_alternative_service_list,
RecentlyBrokenAlternativeServices* recently_broken_alternative_services);
void SaveAlternativeServiceToServerPrefs(
const AlternativeServiceInfoVector& alternative_service_info_vector,
- base::DictionaryValue* server_pref_dict);
+ base::Value* server_pref_dict);
void SaveLastLocalAddressWhenQuicWorkedToPrefs(
const IPAddress& last_local_address_when_quic_worked,
- base::DictionaryValue* http_server_properties_dict);
+ base::Value* http_server_properties_dict);
void SaveNetworkStatsToServerPrefs(
const ServerNetworkStats& server_network_stats,
- base::DictionaryValue* server_pref_dict);
+ base::Value* server_pref_dict);
void SaveQuicServerInfoMapToServerPrefs(
const HttpServerProperties::QuicServerInfoMap& quic_server_info_map,
- base::DictionaryValue* http_server_properties_dict);
+ base::Value* http_server_properties_dict);
void SaveBrokenAlternativeServicesToPrefs(
const BrokenAlternativeServiceList& broken_alternative_service_list,
size_t max_broken_alternative_services,
const RecentlyBrokenAlternativeServices&
recently_broken_alternative_services,
- base::DictionaryValue* http_server_properties_dict);
+ base::Value* http_server_properties_dict);
void OnHttpServerPropertiesLoaded();
diff --git a/chromium/net/http/http_server_properties_manager_unittest.cc b/chromium/net/http/http_server_properties_manager_unittest.cc
index f7849bad841..39c91d0d84c 100644
--- a/chromium/net/http/http_server_properties_manager_unittest.cc
+++ b/chromium/net/http/http_server_properties_manager_unittest.cc
@@ -16,7 +16,7 @@
#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_tick_clock.h"
@@ -86,13 +86,11 @@ class MockPrefDelegate : public net::HttpServerProperties::PrefDelegate {
~MockPrefDelegate() override = default;
// HttpServerProperties::PrefDelegate implementation.
- const base::DictionaryValue* GetServerProperties() const override {
- return &prefs_;
- }
+ const base::Value* GetServerProperties() const override { return &prefs_; }
- void SetServerProperties(const base::DictionaryValue& value,
+ void SetServerProperties(const base::Value& value,
base::OnceClosure callback) override {
- prefs_.Clear();
+ prefs_.DictClear();
prefs_.MergeDictionary(&value);
++num_pref_updates_;
if (!prefs_changed_callback_.is_null())
@@ -107,9 +105,9 @@ class MockPrefDelegate : public net::HttpServerProperties::PrefDelegate {
prefs_changed_callback_ = std::move(callback);
}
- void InitializePrefs(const base::DictionaryValue& value) {
+ void InitializePrefs(const base::Value& value) {
ASSERT_FALSE(prefs_changed_callback_.is_null());
- prefs_.Clear();
+ prefs_.DictClear();
prefs_.MergeDictionary(&value);
std::move(prefs_changed_callback_).Run();
}
@@ -133,7 +131,7 @@ class MockPrefDelegate : public net::HttpServerProperties::PrefDelegate {
}
private:
- base::DictionaryValue prefs_;
+ base::Value prefs_ = base::Value(base::Value::Type::DICTIONARY);
base::OnceClosure prefs_changed_callback_;
base::OnceClosure extra_prefs_changed_callback_;
int num_pref_updates_ = 0;
@@ -182,8 +180,7 @@ base::Value ServerInfoMapToValue(
// ServerInfoMap.
std::unique_ptr<HttpServerProperties::ServerInfoMap> ValueToServerInfoMap(
const base::Value& value) {
- const base::DictionaryValue* dictionary_value;
- if (!value.GetAsDictionary(&dictionary_value))
+ if (!value.is_dict())
return nullptr;
std::unique_ptr<MockPrefDelegate> pref_delegate =
@@ -213,7 +210,7 @@ std::unique_ptr<HttpServerProperties::ServerInfoMap> ValueToServerInfoMap(
10 /* max_server_configs_stored_in_properties */, nullptr /* net_log */,
base::DefaultTickClock::GetInstance());
- unowned_pref_delegate->InitializePrefs(*dictionary_value);
+ unowned_pref_delegate->InitializePrefs(value);
EXPECT_TRUE(callback_invoked);
return out;
}
@@ -248,7 +245,7 @@ class HttpServerPropertiesManagerTest : public testing::Test,
// |expect_pref_update| should be true if a pref update is expected to be
// queued in response to the load.
void InitializePrefs(
- const base::DictionaryValue& dict = base::DictionaryValue(),
+ const base::Value& dict = base::Value(base::Value::Type::DICTIONARY),
bool expect_pref_update = false) {
EXPECT_FALSE(http_server_props_->IsInitialized());
pref_delegate_->InitializePrefs(dict);
@@ -283,9 +280,9 @@ class HttpServerPropertiesManagerTest : public testing::Test,
}
// Returns a dictionary with only the version field populated.
- static base::DictionaryValue DictWithVersion() {
- base::DictionaryValue http_server_properties_dict;
- http_server_properties_dict.SetInteger("version", 5);
+ static base::Value DictWithVersion() {
+ base::Value http_server_properties_dict(base::Value::Type::DICTIONARY);
+ http_server_properties_dict.SetIntKey("version", 5);
return http_server_properties_dict;
}
@@ -299,45 +296,43 @@ class HttpServerPropertiesManagerTest : public testing::Test,
};
TEST_F(HttpServerPropertiesManagerTest, BadCachedHostPortPair) {
- auto server_pref_dict = std::make_unique<base::DictionaryValue>();
+ base::Value server_pref_dict(base::Value::Type::DICTIONARY);
// Set supports_spdy for www.google.com:65536.
- server_pref_dict->SetBoolean("supports_spdy", true);
+ server_pref_dict.SetBoolKey("supports_spdy", true);
// Set up alternative_service for www.google.com:65536.
- auto alternative_service_dict = std::make_unique<base::DictionaryValue>();
- alternative_service_dict->SetString("protocol_str", "h2");
- alternative_service_dict->SetInteger("port", 80);
- auto alternative_service_list = std::make_unique<base::ListValue>();
- alternative_service_list->Append(std::move(alternative_service_dict));
- server_pref_dict->SetWithoutPathExpansion(
- "alternative_service", std::move(alternative_service_list));
+ base::Value alternative_service_dict(base::Value::Type::DICTIONARY);
+ alternative_service_dict.SetStringKey("protocol_str", "h2");
+ alternative_service_dict.SetIntKey("port", 80);
+ base::Value alternative_service_list(base::Value::Type::LIST);
+ alternative_service_list.Append(std::move(alternative_service_dict));
+ server_pref_dict.SetKey("alternative_service",
+ std::move(alternative_service_list));
// Set up ServerNetworkStats for www.google.com:65536.
- auto stats = std::make_unique<base::DictionaryValue>();
- stats->SetInteger("srtt", 10);
- server_pref_dict->SetWithoutPathExpansion("network_stats", std::move(stats));
+ base::Value stats(base::Value::Type::DICTIONARY);
+ stats.SetIntKey("srtt", 10);
+ server_pref_dict.SetKey("network_stats", std::move(stats));
// Set the server preference for www.google.com:65536.
- auto servers_dict = std::make_unique<base::DictionaryValue>();
- servers_dict->SetWithoutPathExpansion("www.google.com:65536",
- std::move(server_pref_dict));
- auto servers_list = std::make_unique<base::ListValue>();
- servers_list->Append(std::move(servers_dict));
- base::DictionaryValue http_server_properties_dict = DictWithVersion();
- http_server_properties_dict.SetWithoutPathExpansion(
- "servers", std::move(servers_list));
+ base::Value servers_dict(base::Value::Type::DICTIONARY);
+ servers_dict.SetKey("www.google.com:65536", std::move(server_pref_dict));
+ base::Value servers_list(base::Value::Type::LIST);
+ servers_list.Append(std::move(servers_dict));
+ base::Value http_server_properties_dict = DictWithVersion();
+ http_server_properties_dict.SetKey("servers", std::move(servers_list));
// Set quic_server_info for www.google.com:65536.
- auto quic_servers_dict = std::make_unique<base::DictionaryValue>();
- auto quic_server_pref_dict1 = std::make_unique<base::DictionaryValue>();
- quic_server_pref_dict1->SetKey("server_info",
- base::Value("quic_server_info1"));
- quic_servers_dict->SetWithoutPathExpansion("http://mail.google.com:65536",
- std::move(quic_server_pref_dict1));
+ base::Value quic_servers_dict(base::Value::Type::DICTIONARY);
+ base::Value quic_server_pref_dict1(base::Value::Type::DICTIONARY);
+ quic_server_pref_dict1.SetKey("server_info",
+ base::Value("quic_server_info1"));
+ quic_servers_dict.SetKey("http://mail.google.com:65536",
+ std::move(quic_server_pref_dict1));
- http_server_properties_dict.SetWithoutPathExpansion(
- "quic_servers", std::move(quic_servers_dict));
+ http_server_properties_dict.SetKey("quic_servers",
+ std::move(quic_servers_dict));
// Set up the pref.
InitializePrefs(http_server_properties_dict);
@@ -358,37 +353,35 @@ TEST_F(HttpServerPropertiesManagerTest, BadCachedHostPortPair) {
}
TEST_F(HttpServerPropertiesManagerTest, BadCachedAltProtocolPort) {
- auto server_pref_dict = std::make_unique<base::DictionaryValue>();
+ base::Value server_pref_dict(base::Value::Type::DICTIONARY);
// Set supports_spdy for www.google.com:80.
- server_pref_dict->SetBoolean("supports_spdy", true);
+ server_pref_dict.SetBoolKey("supports_spdy", true);
// Set up alternative_service for www.google.com:80.
- auto alternative_service_dict = std::make_unique<base::DictionaryValue>();
- alternative_service_dict->SetString("protocol_str", "h2");
- alternative_service_dict->SetInteger("port", 65536);
- auto alternative_service_list = std::make_unique<base::ListValue>();
- alternative_service_list->Append(std::move(alternative_service_dict));
- server_pref_dict->SetWithoutPathExpansion(
- "alternative_service", std::move(alternative_service_list));
+ base::Value alternative_service_dict(base::Value::Type::DICTIONARY);
+ alternative_service_dict.SetStringKey("protocol_str", "h2");
+ alternative_service_dict.SetIntKey("port", 65536);
+ base::Value alternative_service_list(base::Value::Type::LIST);
+ alternative_service_list.Append(std::move(alternative_service_dict));
+ server_pref_dict.SetKey("alternative_service",
+ std::move(alternative_service_list));
// Set the server preference for www.google.com:80.
- auto servers_dict = std::make_unique<base::DictionaryValue>();
- servers_dict->SetWithoutPathExpansion("www.google.com:80",
- std::move(server_pref_dict));
- auto servers_list = std::make_unique<base::ListValue>();
- servers_list->Append(std::move(servers_dict));
- base::DictionaryValue http_server_properties_dict = DictWithVersion();
- http_server_properties_dict.SetWithoutPathExpansion(
- "servers", std::move(servers_list));
-
- // Set up the pref.
- InitializePrefs(http_server_properties_dict);
-
- // Verify alternative service is not set.
- EXPECT_FALSE(
- HasAlternativeService(url::SchemeHostPort("http", "www.google.com", 80),
- NetworkIsolationKey()));
+ base::Value servers_dict(base::Value::Type::DICTIONARY);
+ servers_dict.SetKey("www.google.com:80", std::move(server_pref_dict));
+ base::Value servers_list(base::Value::Type::LIST);
+ servers_list.Append(std::move(servers_dict));
+ base::Value http_server_properties_dict = DictWithVersion();
+ http_server_properties_dict.SetKey("servers", std::move(servers_list));
+
+ // Set up the pref.
+ InitializePrefs(http_server_properties_dict);
+
+ // Verify alternative service is not set.
+ EXPECT_FALSE(
+ HasAlternativeService(url::SchemeHostPort("http", "www.google.com", 80),
+ NetworkIsolationKey()));
}
TEST_F(HttpServerPropertiesManagerTest, SupportsSpdy) {
@@ -627,7 +620,8 @@ TEST_F(HttpServerPropertiesManagerTest, LateLoadAlternativeServiceInfo) {
alternative_service_info_vector[0].alternative_service());
// Initializing prefs does not result in a task to write the prefs.
- InitializePrefs(base::DictionaryValue(), true /* expect_pref_update */);
+ InitializePrefs(base::Value(base::Value::Type::DICTIONARY),
+ true /* expect_pref_update */);
alternative_service_info_vector =
http_server_props_->GetAlternativeServiceInfos(spdy_server_mail,
NetworkIsolationKey());
@@ -1038,8 +1032,7 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) {
// https://crbug.com/444956: Add 200 alternative_service servers followed by
// supports_quic and verify we have read supports_quic from prefs.
TEST_F(HttpServerPropertiesManagerTest, BadLastLocalAddressWhenQuicWorked) {
- std::unique_ptr<base::ListValue> servers_list =
- std::make_unique<base::ListValue>();
+ base::Value servers_list(base::Value::Type::LIST);
for (int i = 1; i <= 200; ++i) {
// Set up alternative_service for www.google.com:i.
@@ -1054,25 +1047,23 @@ TEST_F(HttpServerPropertiesManagerTest, BadLastLocalAddressWhenQuicWorked) {
server_dict.SetStringKey("server",
StringPrintf("https://www.google.com:%d", i));
server_dict.SetKey("isolation", base::Value(base::Value::Type::LIST));
- servers_list->Append(std::move(server_dict));
+ servers_list.Append(std::move(server_dict));
}
// Set the server preference for http://mail.google.com server.
base::Value server_dict2(base::Value::Type::DICTIONARY);
server_dict2.SetStringKey("server", "https://mail.google.com");
server_dict2.SetKey("isolation", base::Value(base::Value::Type::LIST));
- servers_list->Append(std::move(server_dict2));
+ servers_list.Append(std::move(server_dict2));
- base::DictionaryValue http_server_properties_dict = DictWithVersion();
- http_server_properties_dict.SetWithoutPathExpansion("servers",
- std::move(servers_list));
+ base::Value http_server_properties_dict = DictWithVersion();
+ http_server_properties_dict.SetKey("servers", std::move(servers_list));
// Set up SupportsQuic for 127.0.0.1
- auto supports_quic = std::make_unique<base::DictionaryValue>();
- supports_quic->SetBoolean("used_quic", true);
- supports_quic->SetString("address", "127.0.0.1");
- http_server_properties_dict.SetWithoutPathExpansion("supports_quic",
- std::move(supports_quic));
+ base::Value supports_quic(base::Value::Type::DICTIONARY);
+ supports_quic.SetBoolKey("used_quic", true);
+ supports_quic.SetStringKey("address", "127.0.0.1");
+ http_server_properties_dict.SetKey("supports_quic", std::move(supports_quic));
// Set up the pref.
InitializePrefs(http_server_properties_dict);
@@ -1183,24 +1174,20 @@ TEST_F(HttpServerPropertiesManagerTest, UpdatePrefsWithCache) {
// A copy of |pref_delegate_|'s server dict will be created, and the broken
// alternative service's "broken_until" field is removed and verified
// separately. The rest of the server dict copy is verified afterwards.
- base::Value server_value_copy =
- pref_delegate_->GetServerProperties()->Clone();
+ base::Value server_dict = pref_delegate_->GetServerProperties()->Clone();
+ ASSERT_TRUE(server_dict.is_dict());
// Extract and remove the "broken_until" string for "www.google.com:1234".
- base::DictionaryValue* server_dict;
- ASSERT_TRUE(server_value_copy.GetAsDictionary(&server_dict));
- base::ListValue* broken_alt_svc_list;
- ASSERT_TRUE(server_dict->GetList("broken_alternative_services",
- &broken_alt_svc_list));
- ASSERT_EQ(2u, broken_alt_svc_list->GetSize());
- base::DictionaryValue* broken_alt_svcs_list_entry;
- ASSERT_TRUE(
- broken_alt_svc_list->GetDictionary(0, &broken_alt_svcs_list_entry));
- ASSERT_TRUE(broken_alt_svcs_list_entry->HasKey("broken_until"));
- std::string expiration_string;
- ASSERT_TRUE(broken_alt_svcs_list_entry->GetStringWithoutPathExpansion(
- "broken_until", &expiration_string));
- broken_alt_svcs_list_entry->RemoveKey("broken_until");
+ base::Value* broken_alt_svc_list =
+ server_dict.FindListKey("broken_alternative_services");
+ ASSERT_TRUE(broken_alt_svc_list);
+ ASSERT_EQ(2u, broken_alt_svc_list->GetList().size());
+ base::Value& broken_alt_svcs_list_entry = broken_alt_svc_list->GetList()[0];
+ const std::string* broken_until_str =
+ broken_alt_svcs_list_entry.FindStringKey("broken_until");
+ ASSERT_TRUE(broken_until_str);
+ const std::string expiration_string = *broken_until_str;
+ broken_alt_svcs_list_entry.RemoveKey("broken_until");
// Expiration time of "www.google.com:1234" should be 5 minutes minus the
// update-prefs-delay from when the prefs were written.
@@ -1246,22 +1233,21 @@ TEST_F(HttpServerPropertiesManagerTest, UpdatePrefsWithCache) {
"\"version\":5}";
std::string preferences_json;
- EXPECT_TRUE(base::JSONWriter::Write(server_value_copy, &preferences_json));
+ EXPECT_TRUE(base::JSONWriter::Write(server_dict, &preferences_json));
EXPECT_EQ(expected_json, preferences_json);
}
TEST_F(HttpServerPropertiesManagerTest, ParseAlternativeServiceInfo) {
InitializePrefs();
- std::unique_ptr<base::Value> server_value = base::JSONReader::ReadDeprecated(
+ std::unique_ptr<base::Value> server_dict = base::JSONReader::ReadDeprecated(
"{\"alternative_service\":[{\"port\":443,\"protocol_str\":\"h2\"},"
"{\"port\":123,\"protocol_str\":\"quic\","
"\"expiration\":\"9223372036854775807\"},{\"host\":\"example.org\","
"\"port\":1234,\"protocol_str\":\"h2\","
"\"expiration\":\"13758804000000000\"}]}");
- ASSERT_TRUE(server_value);
- base::DictionaryValue* server_dict;
- ASSERT_TRUE(server_value->GetAsDictionary(&server_dict));
+ ASSERT_TRUE(server_dict);
+ ASSERT_TRUE(server_dict->is_dict());
const url::SchemeHostPort server("https", "example.com", 443);
HttpServerProperties::ServerInfo server_info;
@@ -1311,12 +1297,11 @@ TEST_F(HttpServerPropertiesManagerTest, ParseAlternativeServiceInfo) {
TEST_F(HttpServerPropertiesManagerTest, DoNotLoadAltSvcForInsecureOrigins) {
InitializePrefs();
- std::unique_ptr<base::Value> server_value = base::JSONReader::ReadDeprecated(
+ std::unique_ptr<base::Value> server_dict = base::JSONReader::ReadDeprecated(
"{\"alternative_service\":[{\"port\":443,\"protocol_str\":\"h2\","
"\"expiration\":\"9223372036854775807\"}]}");
- ASSERT_TRUE(server_value);
- base::DictionaryValue* server_dict;
- ASSERT_TRUE(server_value->GetAsDictionary(&server_dict));
+ ASSERT_TRUE(server_dict);
+ ASSERT_TRUE(server_dict->is_dict());
const url::SchemeHostPort server("http", "example.com", 80);
HttpServerProperties::ServerInfo server_info;
@@ -1371,68 +1356,70 @@ TEST_F(HttpServerPropertiesManagerTest, DoNotPersistExpiredAlternativeService) {
EXPECT_EQ(1U, GetPendingMainThreadTaskCount());
EXPECT_EQ(1, pref_delegate_->GetAndClearNumPrefUpdates());
- const base::DictionaryValue* pref_dict =
- pref_delegate_->GetServerProperties();
+ const base::Value* pref_dict = pref_delegate_->GetServerProperties();
- const base::ListValue* servers_list = nullptr;
- ASSERT_TRUE(pref_dict->GetListWithoutPathExpansion("servers", &servers_list));
- auto it = servers_list->begin();
- const base::DictionaryValue* server_pref_dict;
- ASSERT_TRUE(it->GetAsDictionary(&server_pref_dict));
+ const base::Value* servers_list = pref_dict->FindListKey("servers");
+ ASSERT_TRUE(servers_list);
+ auto it = servers_list->GetList().begin();
+ const base::Value& server_pref_dict = *it;
+ ASSERT_TRUE(server_pref_dict.is_dict());
- const std::string* server_str = server_pref_dict->FindStringKey("server");
+ const std::string* server_str = server_pref_dict.FindStringKey("server");
ASSERT_TRUE(server_str);
EXPECT_EQ("https://www.example.com", *server_str);
const base::Value* network_isolation_key_value =
- server_pref_dict->FindKey("isolation");
+ server_pref_dict.FindKey("isolation");
ASSERT_TRUE(network_isolation_key_value);
ASSERT_EQ(base::Value::Type::LIST, network_isolation_key_value->type());
EXPECT_TRUE(network_isolation_key_value->GetList().empty());
- const base::ListValue* altsvc_list;
- ASSERT_TRUE(server_pref_dict->GetList("alternative_service", &altsvc_list));
+ const base::Value* altsvc_list =
+ server_pref_dict.FindListKey("alternative_service");
+ ASSERT_TRUE(altsvc_list);
- ASSERT_EQ(2u, altsvc_list->GetSize());
+ ASSERT_EQ(2u, altsvc_list->GetList().size());
- const base::DictionaryValue* altsvc_entry;
- std::string hostname;
+ const base::Value& altsvc_entry = altsvc_list->GetList()[0];
+ ASSERT_TRUE(altsvc_entry.is_dict());
+ const std::string* hostname = altsvc_entry.FindStringKey("host");
- ASSERT_TRUE(altsvc_list->GetDictionary(0, &altsvc_entry));
- ASSERT_TRUE(altsvc_entry->GetString("host", &hostname));
- EXPECT_EQ("broken.example.com", hostname);
+ ASSERT_TRUE(hostname);
+ EXPECT_EQ("broken.example.com", *hostname);
- ASSERT_TRUE(altsvc_list->GetDictionary(1, &altsvc_entry));
- ASSERT_TRUE(altsvc_entry->GetString("host", &hostname));
- EXPECT_EQ("valid.example.com", hostname);
+ const base::Value& altsvc_entry2 = altsvc_list->GetList()[1];
+ ASSERT_TRUE(altsvc_entry.is_dict());
+ hostname = altsvc_entry2.FindStringKey("host");
+ ASSERT_TRUE(hostname);
+ EXPECT_EQ("valid.example.com", *hostname);
}
// Test that expired alternative service entries on disk are ignored.
TEST_F(HttpServerPropertiesManagerTest, DoNotLoadExpiredAlternativeService) {
InitializePrefs();
- auto alternative_service_list = std::make_unique<base::ListValue>();
- auto expired_dict = std::make_unique<base::DictionaryValue>();
- expired_dict->SetString("protocol_str", "h2");
- expired_dict->SetString("host", "expired.example.com");
- expired_dict->SetInteger("port", 443);
+ base::Value alternative_service_list(base::Value::Type::LIST);
+ base::Value expired_dict(base::Value::Type::DICTIONARY);
+ expired_dict.SetStringKey("protocol_str", "h2");
+ expired_dict.SetStringKey("host", "expired.example.com");
+ expired_dict.SetIntKey("port", 443);
base::Time time_one_day_ago =
base::Time::Now() - base::TimeDelta::FromDays(1);
- expired_dict->SetString(
+ expired_dict.SetStringKey(
"expiration", base::NumberToString(time_one_day_ago.ToInternalValue()));
- alternative_service_list->Append(std::move(expired_dict));
+ alternative_service_list.Append(std::move(expired_dict));
- auto valid_dict = std::make_unique<base::DictionaryValue>();
- valid_dict->SetString("protocol_str", "h2");
- valid_dict->SetString("host", "valid.example.com");
- valid_dict->SetInteger("port", 443);
- valid_dict->SetString(
+ base::Value valid_dict(base::Value::Type::DICTIONARY);
+ valid_dict.SetStringKey("protocol_str", "h2");
+ valid_dict.SetStringKey("host", "valid.example.com");
+ valid_dict.SetIntKey("port", 443);
+ valid_dict.SetStringKey(
"expiration", base::NumberToString(one_day_from_now_.ToInternalValue()));
- alternative_service_list->Append(std::move(valid_dict));
+ alternative_service_list.Append(std::move(valid_dict));
- base::DictionaryValue server_pref_dict;
- server_pref_dict.SetWithoutPathExpansion("alternative_service",
- std::move(alternative_service_list));
+ base::Value server_pref_dict(base::Value::Type::DICTIONARY);
+ server_pref_dict.SetKey("alternative_service",
+ std::move(alternative_service_list));
const url::SchemeHostPort server("https", "example.com", 443);
HttpServerProperties::ServerInfo server_info;
@@ -1558,7 +1545,7 @@ TEST_F(HttpServerPropertiesManagerTest, PersistAdvertisedVersionsToPref) {
TEST_F(HttpServerPropertiesManagerTest, ReadAdvertisedVersionsFromPref) {
InitializePrefs();
- std::unique_ptr<base::Value> server_value = base::JSONReader::ReadDeprecated(
+ std::unique_ptr<base::Value> server_dict = base::JSONReader::ReadDeprecated(
"{\"alternative_service\":["
"{\"port\":443,\"protocol_str\":\"quic\"},"
"{\"port\":123,\"protocol_str\":\"quic\","
@@ -1566,9 +1553,8 @@ TEST_F(HttpServerPropertiesManagerTest, ReadAdvertisedVersionsFromPref) {
// Add 33 which we know is not supported, as regression test for
// https://crbug.com/1061509
"\"advertised_versions\":[33,46,43]}]}");
- ASSERT_TRUE(server_value);
- base::DictionaryValue* server_dict;
- ASSERT_TRUE(server_value->GetAsDictionary(&server_dict));
+ ASSERT_TRUE(server_dict);
+ ASSERT_TRUE(server_dict->is_dict());
const url::SchemeHostPort server("https", "example.com", 443);
HttpServerProperties::ServerInfo server_info;
@@ -1764,7 +1750,7 @@ TEST_F(HttpServerPropertiesManagerTest, UpdateCacheWithPrefs) {
std::string expiration_str =
base::NumberToString(static_cast<int64_t>(one_day_from_now_.ToTimeT()));
- std::unique_ptr<base::Value> server_value = base::JSONReader::ReadDeprecated(
+ std::unique_ptr<base::Value> server_dict = base::JSONReader::ReadDeprecated(
"{"
"\"broken_alternative_services\":["
"{\"broken_until\":\"" +
@@ -1808,9 +1794,8 @@ TEST_F(HttpServerPropertiesManagerTest, UpdateCacheWithPrefs) {
"{\"address\":\"127.0.0.1\",\"used_quic\":true},"
"\"version\":5"
"}");
- ASSERT_TRUE(server_value);
- base::DictionaryValue* server_dict;
- ASSERT_TRUE(server_value->GetAsDictionary(&server_dict));
+ ASSERT_TRUE(server_dict);
+ ASSERT_TRUE(server_dict->is_dict());
// Don't use the test fixture's InitializePrefs() method, since there are
// pending tasks. Initializing prefs should queue a pref update task, since
@@ -2028,7 +2013,8 @@ TEST_F(HttpServerPropertiesManagerTest, ForceHTTP11) {
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
// Set kServer1 to support H2, but require HTTP/1.1. Set kServer2 to only
// require HTTP/1.1.
@@ -2047,7 +2033,7 @@ TEST_F(HttpServerPropertiesManagerTest, ForceHTTP11) {
// Wait until the data's been written to prefs, and then tear down the
// HttpServerProperties.
FastForwardBy(HttpServerProperties::GetUpdatePrefsDelayForTesting());
- std::unique_ptr<base::DictionaryValue> saved_value =
+ std::unique_ptr<base::Value> saved_value =
unowned_pref_delegate->GetServerProperties()->CreateDeepCopy();
properties.reset();
@@ -2215,7 +2201,8 @@ TEST_F(HttpServerPropertiesManagerTest, NetworkIsolationKeyIntegration) {
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
// Set a values using kNetworkIsolationKey.
properties->SetSupportsSpdy(kServer, kNetworkIsolationKey, true);
@@ -2235,7 +2222,7 @@ TEST_F(HttpServerPropertiesManagerTest, NetworkIsolationKeyIntegration) {
// Wait until the data's been written to prefs, and then tear down the
// HttpServerProperties.
FastForwardBy(HttpServerProperties::GetUpdatePrefsDelayForTesting());
- std::unique_ptr<base::DictionaryValue> saved_value =
+ std::unique_ptr<base::Value> saved_value =
unowned_pref_delegate->GetServerProperties()->CreateDeepCopy();
properties.reset();
@@ -2308,7 +2295,8 @@ TEST_F(HttpServerPropertiesManagerTest,
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
// Set alternative services for kServer1 using kNetworkIsolationKey1. That
// information should be retrieved when fetching information for any server
@@ -2386,7 +2374,7 @@ TEST_F(HttpServerPropertiesManagerTest,
// Wait until the data's been written to prefs, and then tear down the
// HttpServerProperties.
FastForwardBy(HttpServerProperties::GetUpdatePrefsDelayForTesting());
- std::unique_ptr<base::DictionaryValue> saved_value =
+ std::unique_ptr<base::Value> saved_value =
unowned_pref_delegate->GetServerProperties()->CreateDeepCopy();
properties.reset();
@@ -2445,7 +2433,7 @@ TEST_F(HttpServerPropertiesManagerTest,
SCOPED_TRACE(static_cast<int>(save_network_isolation_key_mode));
// Save prefs using |save_network_isolation_key_mode|.
- std::unique_ptr<base::DictionaryValue> saved_value;
+ std::unique_ptr<base::Value> saved_value;
{
// Configure the the feature.
std::unique_ptr<base::test::ScopedFeatureList> feature_list =
@@ -2465,7 +2453,8 @@ TEST_F(HttpServerPropertiesManagerTest,
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
// Set kAlternativeService1 as broken in the context of
// kNetworkIsolationKey1, and kAlternativeService2 as broken in the
@@ -2661,7 +2650,8 @@ TEST_F(HttpServerPropertiesManagerTest,
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
properties->MarkAlternativeServiceBroken(kAlternativeService,
kNetworkIsolationKey);
@@ -2703,7 +2693,7 @@ TEST_F(HttpServerPropertiesManagerTest,
SCOPED_TRACE(static_cast<int>(save_network_isolation_key_mode));
// Save prefs using |save_network_isolation_key_mode|.
- std::unique_ptr<base::DictionaryValue> saved_value;
+ std::unique_ptr<base::Value> saved_value;
{
// Configure the the feature.
std::unique_ptr<base::test::ScopedFeatureList> feature_list =
@@ -2723,7 +2713,8 @@ TEST_F(HttpServerPropertiesManagerTest,
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
// Set kServer1 to kQuicServerInfo1 in the context of
// kNetworkIsolationKey1, Set kServer2 to kQuicServerInfo2 in the context
@@ -2888,7 +2879,8 @@ TEST_F(HttpServerPropertiesManagerTest,
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
// Set kQuicServerInfo1 for kServer1 using kNetworkIsolationKey1. That
// information should be retrieved when fetching information for any server
@@ -2936,7 +2928,7 @@ TEST_F(HttpServerPropertiesManagerTest,
// Wait until the data's been written to prefs, and then tear down the
// HttpServerProperties.
FastForwardBy(HttpServerProperties::GetUpdatePrefsDelayForTesting());
- std::unique_ptr<base::DictionaryValue> saved_value =
+ std::unique_ptr<base::Value> saved_value =
unowned_pref_delegate->GetServerProperties()->CreateDeepCopy();
properties.reset();
@@ -2990,7 +2982,8 @@ TEST_F(HttpServerPropertiesManagerTest,
std::make_unique<HttpServerProperties>(std::move(pref_delegate),
/*net_log=*/nullptr,
GetMockTickClock());
- unowned_pref_delegate->InitializePrefs(base::DictionaryValue());
+ unowned_pref_delegate->InitializePrefs(
+ base::Value(base::Value::Type::DICTIONARY));
properties->SetQuicServerInfo(kServer, kNetworkIsolationKey,
"QuicServerInfo");
diff --git a/chromium/net/http/http_server_properties_unittest.cc b/chromium/net/http/http_server_properties_unittest.cc
index f6d9c55593f..b7f690116ce 100644
--- a/chromium/net/http/http_server_properties_unittest.cc
+++ b/chromium/net/http/http_server_properties_unittest.cc
@@ -25,10 +25,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
-namespace base {
-class ListValue;
-}
-
namespace net {
const base::TimeDelta BROKEN_ALT_SVC_EXPIRE_DELAYS[10] = {
@@ -2343,10 +2339,10 @@ TEST_F(AlternateProtocolServerPropertiesTest,
"}"
"]";
- std::unique_ptr<base::Value> alternative_service_info_value =
+ base::Value alternative_service_info_value =
impl_.GetAlternativeServiceInfoAsValue();
std::string alternative_service_info_json;
- base::JSONWriter::Write(*alternative_service_info_value,
+ base::JSONWriter::Write(alternative_service_info_value,
&alternative_service_info_json);
EXPECT_EQ(expected_json, alternative_service_info_json);
}
diff --git a/chromium/net/http/http_stream_factory_job.cc b/chromium/net/http/http_stream_factory_job.cc
index 7f610456e00..981ee3fea70 100644
--- a/chromium/net/http/http_stream_factory_job.cc
+++ b/chromium/net/http/http_stream_factory_job.cc
@@ -8,7 +8,7 @@
#include <string>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/location.h"
@@ -73,24 +73,24 @@ base::Value NetLogHttpStreamJobParams(const NetLogSource& source,
bool expect_spdy,
bool using_quic,
RequestPriority priority) {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
if (source.IsValid())
source.AddToEventParameters(&dict);
- dict.SetString("original_url", original_url.GetOrigin().spec());
- dict.SetString("url", url.GetOrigin().spec());
- dict.SetBoolean("expect_spdy", expect_spdy);
- dict.SetBoolean("using_quic", using_quic);
- dict.SetString("priority", RequestPriorityToString(priority));
- return std::move(dict);
+ dict.SetStringKey("original_url", original_url.GetOrigin().spec());
+ dict.SetStringKey("url", url.GetOrigin().spec());
+ dict.SetBoolKey("expect_spdy", expect_spdy);
+ dict.SetBoolKey("using_quic", using_quic);
+ dict.SetStringKey("priority", RequestPriorityToString(priority));
+ return dict;
}
// Returns parameters associated with the Proto (with NPN negotiation) of a HTTP
// stream.
base::Value NetLogHttpStreamProtoParams(NextProto negotiated_protocol) {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
- dict.SetString("proto", NextProtoToString(negotiated_protocol));
- return std::move(dict);
+ dict.SetStringKey("proto", NextProtoToString(negotiated_protocol));
+ return dict;
}
HttpStreamFactory::Job::Job(Delegate* delegate,
diff --git a/chromium/net/http/http_stream_factory_job_controller.cc b/chromium/net/http/http_stream_factory_job_controller.cc
index df598474acc..d787629ba01 100644
--- a/chromium/net/http/http_stream_factory_job_controller.cc
+++ b/chromium/net/http/http_stream_factory_job_controller.cc
@@ -36,12 +36,12 @@ namespace {
// Returns parameters associated with the proxy resolution.
base::Value NetLogHttpStreamJobProxyServerResolved(
const ProxyServer& proxy_server) {
- base::DictionaryValue dict;
+ base::Value dict(base::Value::Type::DICTIONARY);
- dict.SetString("proxy_server", proxy_server.is_valid()
- ? proxy_server.ToPacString()
- : std::string());
- return std::move(dict);
+ dict.SetStringKey("proxy_server", proxy_server.is_valid()
+ ? proxy_server.ToPacString()
+ : std::string());
+ return dict;
}
} // namespace
@@ -51,18 +51,18 @@ base::Value NetLogHttpStreamJobProxyServerResolved(
const int kMaxDelayTimeForMainJobSecs = 3;
base::Value NetLogJobControllerParams(const GURL& url, bool is_preconnect) {
- base::DictionaryValue dict;
- dict.SetString("url", url.possibly_invalid_spec());
- dict.SetBoolean("is_preconnect", is_preconnect);
- return std::move(dict);
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetStringKey("url", url.possibly_invalid_spec());
+ dict.SetBoolKey("is_preconnect", is_preconnect);
+ return dict;
}
base::Value NetLogAltSvcParams(const AlternativeServiceInfo* alt_svc_info,
bool is_broken) {
- base::DictionaryValue dict;
- dict.SetString("alt_svc", alt_svc_info->ToString());
- dict.SetBoolean("is_broken", is_broken);
- return std::move(dict);
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetStringKey("alt_svc", alt_svc_info->ToString());
+ dict.SetBoolKey("is_broken", is_broken);
+ return dict;
}
HttpStreamFactory::JobController::JobController(
diff --git a/chromium/net/http/http_stream_factory_job_controller_unittest.cc b/chromium/net/http/http_stream_factory_job_controller_unittest.cc
index f005f3c1df4..00ca59da770 100644
--- a/chromium/net/http/http_stream_factory_job_controller_unittest.cc
+++ b/chromium/net/http/http_stream_factory_job_controller_unittest.cc
@@ -19,6 +19,7 @@
#include "base/test/task_environment.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/threading/platform_thread.h"
+#include "base/values.h"
#include "net/base/completion_once_callback.h"
#include "net/base/features.h"
#include "net/base/host_port_pair.h"
@@ -108,10 +109,8 @@ class MockPrefDelegate : public HttpServerProperties::PrefDelegate {
~MockPrefDelegate() override = default;
// HttpServerProperties::PrefDelegate implementation:
- const base::DictionaryValue* GetServerProperties() const override {
- return nullptr;
- }
- void SetServerProperties(const base::DictionaryValue& value,
+ const base::Value* GetServerProperties() const override { return nullptr; }
+ void SetServerProperties(const base::Value& value,
base::OnceClosure callback) override {}
void WaitForPrefLoad(base::OnceClosure pref_loaded_callback) override {}
diff --git a/chromium/net/http/http_stream_factory_unittest.cc b/chromium/net/http/http_stream_factory_unittest.cc
index c6f6e0f51c8..925374ab9a1 100644
--- a/chromium/net/http/http_stream_factory_unittest.cc
+++ b/chromium/net/http/http_stream_factory_unittest.cc
@@ -98,7 +98,6 @@ using net::test::IsOk;
namespace base {
class Value;
-class DictionaryValue;
} // namespace base
namespace net {
@@ -912,25 +911,25 @@ class TestBidirectionalDelegate : public BidirectionalStreamImpl::Delegate {
public:
void WaitUntilDone() { loop_.Run(); }
- const spdy::SpdyHeaderBlock& response_headers() const {
+ const spdy::Http2HeaderBlock& response_headers() const {
return response_headers_;
}
private:
void OnStreamReady(bool request_headers_sent) override {}
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override {
+ const spdy::Http2HeaderBlock& response_headers) override {
response_headers_ = response_headers.Clone();
loop_.Quit();
}
void OnDataRead(int bytes_read) override { NOTREACHED(); }
void OnDataSent() override { NOTREACHED(); }
- void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) override {
+ void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override {
NOTREACHED();
}
void OnFailed(int error) override { NOTREACHED(); }
base::RunLoop loop_;
- spdy::SpdyHeaderBlock response_headers_;
+ spdy::Http2HeaderBlock response_headers_;
};
// Helper class to encapsulate MockReads and MockWrites for QUIC.
@@ -1041,10 +1040,9 @@ int GetSocketPoolGroupCount(ClientSocketPool* pool) {
int GetSpdySessionCount(HttpNetworkSession* session) {
std::unique_ptr<base::Value> value(
session->spdy_session_pool()->SpdySessionPoolInfoToValue());
- base::ListValue* session_list;
- if (!value || !value->GetAsList(&session_list))
+ if (!value || !value->is_list())
return -1;
- return session_list->GetSize();
+ return value->GetList().size();
}
// Return count of sockets handed out by a given socket pool.
@@ -1057,12 +1055,11 @@ int GetHandedOutSocketCount(ClientSocketPool* pool) {
#if defined(OS_ANDROID)
// Return count of distinct QUIC sessions.
int GetQuicSessionCount(HttpNetworkSession* session) {
- std::unique_ptr<base::DictionaryValue> dict(
- base::DictionaryValue::From(session->QuicInfoToValue()));
- base::ListValue* session_list;
- if (!dict->GetList("sessions", &session_list))
+ base::Value dict(session->QuicInfoToValue());
+ base::Value* session_list = dict.FindListKey("sessions");
+ if (!session_list)
return -1;
- return session_list->GetSize();
+ return session_list->GetList().size();
}
#endif
@@ -2111,9 +2108,7 @@ TEST_P(HttpStreamFactoryBidirectionalQuicTest,
// TODO(https://crbug.com/1059250): Implement PRIORITY_UPDATE in
// BidirectionalStreamQuicImpl.
spdy::SpdyPriority priority =
- version().UsesHttp3()
- ? 1
- : ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
+ ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
size_t spdy_headers_frame_length;
int packet_num = 1;
if (VersionUsesHttp3(version().transport_version)) {
@@ -2248,9 +2243,7 @@ TEST_P(HttpStreamFactoryBidirectionalQuicTest,
// TODO(https://crbug.com/1059250): Implement PRIORITY_UPDATE in
// BidirectionalStreamQuicImpl.
spdy::SpdyPriority priority =
- version().UsesHttp3()
- ? 1
- : ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
+ ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
size_t spdy_headers_frame_length;
int packet_num = 1;
if (VersionUsesHttp3(version().transport_version)) {
diff --git a/chromium/net/http/http_stream_parser.cc b/chromium/net/http/http_stream_parser.cc
index 81b874031c0..9d7ac8fef14 100644
--- a/chromium/net/http/http_stream_parser.cc
+++ b/chromium/net/http/http_stream_parser.cc
@@ -71,11 +71,11 @@ bool HeadersContainMultipleCopiesOfField(const HttpResponseHeaders& headers,
base::Value NetLogSendRequestBodyParams(uint64_t length,
bool is_chunked,
bool did_merge) {
- base::DictionaryValue dict;
- dict.SetInteger("length", static_cast<int>(length));
- dict.SetBoolean("is_chunked", is_chunked);
- dict.SetBoolean("did_merge", did_merge);
- return std::move(dict);
+ base::Value dict(base::Value::Type::DICTIONARY);
+ dict.SetIntKey("length", static_cast<int>(length));
+ dict.SetBoolKey("is_chunked", is_chunked);
+ dict.SetBoolKey("did_merge", did_merge);
+ return dict;
}
void NetLogSendRequestBody(const NetLogWithSource& net_log,
diff --git a/chromium/net/http/partial_data.cc b/chromium/net/http/partial_data.cc
index 70239edc096..79f71ab662b 100644
--- a/chromium/net/http/partial_data.cc
+++ b/chromium/net/http/partial_data.cc
@@ -8,7 +8,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
diff --git a/chromium/net/http/transport_security_persister.cc b/chromium/net/http/transport_security_persister.cc
index 137c09f5ff1..e1d2bfcddb6 100644
--- a/chromium/net/http/transport_security_persister.cc
+++ b/chromium/net/http/transport_security_persister.cc
@@ -16,6 +16,7 @@
#include "base/json/json_writer.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
+#include "base/optional.h"
#include "base/sequenced_task_runner.h"
#include "base/task_runner_util.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -198,7 +199,7 @@ base::Value SerializeExpectCTData(TransportSecurityState* state) {
const TransportSecurityState::ExpectCTState& expect_ct_state =
expect_ct_iterator.domain_state();
- base::DictionaryValue ct_entry;
+ base::Value ct_entry(base::Value::Type::DICTIONARY);
base::Value network_isolation_key_value;
// Don't serialize entries with transient NetworkIsolationKeys.
@@ -300,36 +301,32 @@ void DeserializeExpectCTData(const base::Value& ct_list,
//
// TODO(mmenke): Remove once the obsolete format is no longer supported.
bool DeserializeObsoleteExpectCTState(
- const base::DictionaryValue* parsed,
+ const base::Value* parsed,
TransportSecurityState::ExpectCTState* state) {
- const base::DictionaryValue* expect_ct_subdictionary;
- if (!parsed->GetDictionary(kExpectCTSubdictionary,
- &expect_ct_subdictionary)) {
+ const base::Value* expect_ct_subdictionary =
+ parsed->FindDictKey(kExpectCTSubdictionary);
+ if (!expect_ct_subdictionary) {
// Expect-CT data is not required, so this item is not malformed.
return true;
}
- double observed;
- bool has_observed =
- expect_ct_subdictionary->GetDouble(kExpectCTObserved, &observed);
- double expiry;
- bool has_expiry =
- expect_ct_subdictionary->GetDouble(kExpectCTExpiry, &expiry);
- bool enforce;
- bool has_enforce =
- expect_ct_subdictionary->GetBoolean(kExpectCTEnforce, &enforce);
- std::string report_uri_str;
- bool has_report_uri =
- expect_ct_subdictionary->GetString(kExpectCTReportUri, &report_uri_str);
+ base::Optional<double> observed =
+ expect_ct_subdictionary->FindDoubleKey(kExpectCTObserved);
+ base::Optional<double> expiry =
+ expect_ct_subdictionary->FindDoubleKey(kExpectCTExpiry);
+ base::Optional<bool> enforce =
+ expect_ct_subdictionary->FindBoolKey(kExpectCTEnforce);
+ const std::string* report_uri_str =
+ expect_ct_subdictionary->FindStringKey(kExpectCTReportUri);
// If an Expect-CT subdictionary is present, it must have the required keys.
- if (!has_observed || !has_expiry || !has_enforce)
+ if (!observed.has_value() || !expiry.has_value() || !enforce.has_value())
return false;
- state->last_observed = base::Time::FromDoubleT(observed);
- state->expiry = base::Time::FromDoubleT(expiry);
- state->enforce = enforce;
- if (has_report_uri) {
- GURL report_uri(report_uri_str);
+ state->last_observed = base::Time::FromDoubleT(*observed);
+ state->expiry = base::Time::FromDoubleT(*expiry);
+ state->enforce = *enforce;
+ if (report_uri_str) {
+ GURL report_uri(*report_uri_str);
if (report_uri.is_valid())
state->report_uri = report_uri;
}
@@ -457,24 +454,19 @@ bool TransportSecurityPersister::Deserialize(const std::string& serialized,
}
bool TransportSecurityPersister::DeserializeObsoleteData(
- const base::Value& value,
+ const base::Value& dict_value,
bool* dirty,
TransportSecurityState* state) {
const base::Time current_time(base::Time::Now());
bool dirtied = false;
- const base::DictionaryValue* dict_value = nullptr;
- int rv = value.GetAsDictionary(&dict_value);
- // The one caller ensures |value| is of Value::Type::DICTIONARY already,
- // though it doesn't extract a DictionaryValue*, since that is the deprecated
- // way to use dictionaries.
- DCHECK(rv);
-
- for (base::DictionaryValue::Iterator i(*dict_value);
- !i.IsAtEnd(); i.Advance()) {
- const base::DictionaryValue* parsed = nullptr;
- if (!i.value().GetAsDictionary(&parsed)) {
- LOG(WARNING) << "Could not parse entry " << i.key() << "; skipping entry";
+ // The one caller ensures |dict_value| is of Value::Type::DICTIONARY already.
+ DCHECK(dict_value.is_dict());
+
+ for (const auto& i : dict_value.DictItems()) {
+ const base::Value& parsed = i.second;
+ if (!parsed.is_dict()) {
+ LOG(WARNING) << "Could not parse entry " << i.first << "; skipping entry";
continue;
}
@@ -483,45 +475,48 @@ bool TransportSecurityPersister::DeserializeObsoleteData(
// kIncludeSubdomains is a legacy synonym for kStsIncludeSubdomains. Parse
// at least one of these properties, preferably the new one.
- bool include_subdomains = false;
- bool parsed_include_subdomains = parsed->GetBoolean(kIncludeSubdomains,
- &include_subdomains);
- sts_state.include_subdomains = include_subdomains;
- if (parsed->GetBoolean(kStsIncludeSubdomains, &include_subdomains)) {
- sts_state.include_subdomains = include_subdomains;
+ bool parsed_include_subdomains = false;
+ base::Optional<bool> include_subdomains =
+ parsed.FindBoolKey(kIncludeSubdomains);
+ if (include_subdomains.has_value()) {
+ sts_state.include_subdomains = include_subdomains.value();
+ parsed_include_subdomains = true;
+ }
+ include_subdomains = parsed.FindBoolKey(kStsIncludeSubdomains);
+ if (include_subdomains.has_value()) {
+ sts_state.include_subdomains = include_subdomains.value();
parsed_include_subdomains = true;
}
- std::string mode_string;
- double expiry = 0;
- if (!parsed_include_subdomains ||
- !parsed->GetString(kMode, &mode_string) ||
- !parsed->GetDouble(kExpiry, &expiry)) {
- LOG(WARNING) << "Could not parse some elements of entry " << i.key()
+ const std::string* mode_string = parsed.FindStringKey(kMode);
+ base::Optional<double> expiry = parsed.FindDoubleKey(kExpiry); // 0;
+ if (!parsed_include_subdomains || !mode_string || !expiry.has_value()) {
+ LOG(WARNING) << "Could not parse some elements of entry " << i.first
<< "; skipping entry";
continue;
}
- if (mode_string == kForceHTTPS || mode_string == kStrict) {
+ if (*mode_string == kForceHTTPS || *mode_string == kStrict) {
sts_state.upgrade_mode =
TransportSecurityState::STSState::MODE_FORCE_HTTPS;
- } else if (mode_string == kDefault || mode_string == kPinningOnly) {
+ } else if (*mode_string == kDefault || *mode_string == kPinningOnly) {
sts_state.upgrade_mode = TransportSecurityState::STSState::MODE_DEFAULT;
} else {
LOG(WARNING) << "Unknown TransportSecurityState mode string "
- << mode_string << " found for entry " << i.key()
+ << mode_string << " found for entry " << i.first
<< "; skipping entry";
continue;
}
- sts_state.expiry = base::Time::FromDoubleT(expiry);
+ sts_state.expiry = base::Time::FromDoubleT(expiry.value());
- double sts_observed;
- if (parsed->GetDouble(kStsObserved, &sts_observed)) {
- sts_state.last_observed = base::Time::FromDoubleT(sts_observed);
- } else if (parsed->GetDouble(kCreated, &sts_observed)) {
+ base::Optional<double> sts_observed = parsed.FindDoubleKey(kStsObserved);
+ if (sts_observed.has_value()) {
+ sts_state.last_observed = base::Time::FromDoubleT(sts_observed.value());
+ } else if (parsed.FindDoubleKey(kCreated)) {
// kCreated is a legacy synonym for both kStsObserved.
- sts_state.last_observed = base::Time::FromDoubleT(sts_observed);
+ sts_observed = parsed.FindDoubleKey(kCreated);
+ sts_state.last_observed = base::Time::FromDoubleT(sts_observed.value());
} else {
// We're migrating an old entry with no observation date. Make sure we
// write the new date back in a reasonable time frame.
@@ -529,7 +524,7 @@ bool TransportSecurityPersister::DeserializeObsoleteData(
sts_state.last_observed = base::Time::Now();
}
- if (!DeserializeObsoleteExpectCTState(parsed, &expect_ct_state)) {
+ if (!DeserializeObsoleteExpectCTState(&parsed, &expect_ct_state)) {
continue;
}
@@ -546,7 +541,7 @@ bool TransportSecurityPersister::DeserializeObsoleteData(
continue;
}
- std::string hashed = ExternalStringToHashedDomain(i.key());
+ std::string hashed = ExternalStringToHashedDomain(i.first);
if (hashed.empty()) {
dirtied = true;
continue;
diff --git a/chromium/net/http/transport_security_state.cc b/chromium/net/http/transport_security_state.cc
index 48eda884e48..b8e84314faa 100644
--- a/chromium/net/http/transport_security_state.cc
+++ b/chromium/net/http/transport_security_state.cc
@@ -21,6 +21,7 @@
#include "base/metrics/field_trial_params.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
+#include "base/optional.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -90,21 +91,20 @@ void RecordUMAForHPKPReportFailure(const GURL& report_uri,
base::UmaHistogramSparse("Net.PublicKeyPinReportSendingFailure2", -net_error);
}
-std::unique_ptr<base::ListValue> GetPEMEncodedChainAsList(
- const net::X509Certificate* cert_chain) {
+base::Value GetPEMEncodedChainAsList(const net::X509Certificate* cert_chain) {
if (!cert_chain)
- return std::make_unique<base::ListValue>();
+ return base::Value(base::Value::Type::LIST);
- std::unique_ptr<base::ListValue> result(new base::ListValue());
+ base::Value result(base::Value::Type::LIST);
std::vector<std::string> pem_encoded_chain;
cert_chain->GetPEMEncodedChain(&pem_encoded_chain);
for (const std::string& cert : pem_encoded_chain)
- result->Append(std::make_unique<base::Value>(cert));
+ result.Append(cert);
return result;
}
-bool HashReportForCache(const base::DictionaryValue& report,
+bool HashReportForCache(const base::Value& report,
const GURL& report_uri,
std::string* cache_key) {
char hashed[crypto::kSHA256Length];
@@ -128,23 +128,23 @@ bool GetHPKPReport(const HostPortPair& host_port_pair,
if (pkp_state.report_uri.is_empty())
return false;
- base::DictionaryValue report;
+ base::Value report(base::Value::Type::DICTIONARY);
base::Time now = base::Time::Now();
- report.SetString("hostname", host_port_pair.host());
- report.SetInteger("port", host_port_pair.port());
- report.SetBoolean("include-subdomains", pkp_state.include_subdomains);
- report.SetString("noted-hostname", pkp_state.domain);
+ report.SetStringKey("hostname", host_port_pair.host());
+ report.SetIntKey("port", host_port_pair.port());
+ report.SetBoolKey("include-subdomains", pkp_state.include_subdomains);
+ report.SetStringKey("noted-hostname", pkp_state.domain);
- std::unique_ptr<base::ListValue> served_certificate_chain_list =
+ auto served_certificate_chain_list =
GetPEMEncodedChainAsList(served_certificate_chain);
- std::unique_ptr<base::ListValue> validated_certificate_chain_list =
+ auto validated_certificate_chain_list =
GetPEMEncodedChainAsList(validated_certificate_chain);
- report.Set("served-certificate-chain",
- std::move(served_certificate_chain_list));
- report.Set("validated-certificate-chain",
- std::move(validated_certificate_chain_list));
+ report.SetKey("served-certificate-chain",
+ std::move(served_certificate_chain_list));
+ report.SetKey("validated-certificate-chain",
+ std::move(validated_certificate_chain_list));
- std::unique_ptr<base::ListValue> known_pin_list(new base::ListValue());
+ base::Value known_pin_list(base::Value::Type::LIST);
for (const auto& hash_value : pkp_state.spki_hashes) {
std::string known_pin;
@@ -165,11 +165,10 @@ bool GetHPKPReport(const HostPortPair& host_port_pair,
&base64_value);
known_pin += "\"" + base64_value + "\"";
- known_pin_list->Append(
- std::unique_ptr<base::Value>(new base::Value(known_pin)));
+ known_pin_list.Append(known_pin);
}
- report.Set("known-pins", std::move(known_pin_list));
+ report.SetKey("known-pins", std::move(known_pin_list));
// For the sent reports cache, do not include the effective expiration
// date. The expiration date will likely change every time the user
@@ -180,9 +179,9 @@ bool GetHPKPReport(const HostPortPair& host_port_pair,
return false;
}
- report.SetString("date-time", base::TimeToISO8601(now));
- report.SetString("effective-expiration-date",
- base::TimeToISO8601(pkp_state.expiry));
+ report.SetStringKey("date-time", base::TimeToISO8601(now));
+ report.SetStringKey("effective-expiration-date",
+ base::TimeToISO8601(pkp_state.expiry));
if (!base::JSONWriter::Write(report, serialized_report)) {
LOG(ERROR) << "Failed to serialize HPKP violation report.";
return false;
@@ -455,6 +454,7 @@ TransportSecurityState::PKPStatus TransportSecurityState::CheckPublicKeyPins(
const X509Certificate* served_certificate_chain,
const X509Certificate* validated_certificate_chain,
const PublicKeyPinReportStatus report_status,
+ const NetworkIsolationKey& network_isolation_key,
std::string* pinning_failure_log) {
// Perform pin validation only if the server actually has public key pins.
if (!HasPublicKeyPins(host_port_pair.host())) {
@@ -464,7 +464,7 @@ TransportSecurityState::PKPStatus TransportSecurityState::CheckPublicKeyPins(
PKPStatus pin_validity = CheckPublicKeyPinsImpl(
host_port_pair, is_issued_by_known_root, public_key_hashes,
served_certificate_chain, validated_certificate_chain, report_status,
- pinning_failure_log);
+ network_isolation_key, pinning_failure_log);
// Don't track statistics when a local trust anchor would override the pinning
// anyway.
@@ -746,6 +746,7 @@ TransportSecurityState::CheckPinsAndMaybeSendReport(
const X509Certificate* served_certificate_chain,
const X509Certificate* validated_certificate_chain,
const TransportSecurityState::PublicKeyPinReportStatus report_status,
+ const net::NetworkIsolationKey& network_isolation_key,
std::string* failure_log) {
if (pkp_state.CheckPublicKeyPins(hashes, failure_log))
return PKPStatus::OK;
@@ -787,7 +788,8 @@ TransportSecurityState::CheckPinsAndMaybeSendReport(
base::TimeDelta::FromMinutes(kTimeToRememberReportsMins));
report_sender_->Send(pkp_state.report_uri, "application/json; charset=utf-8",
- serialized_report, base::OnceCallback<void()>(),
+ serialized_report, network_isolation_key,
+ base::OnceCallback<void()>(),
base::BindOnce(RecordUMAForHPKPReportFailure));
return PKPStatus::VIOLATED;
}
@@ -1115,6 +1117,7 @@ TransportSecurityState::CheckPublicKeyPinsImpl(
const X509Certificate* served_certificate_chain,
const X509Certificate* validated_certificate_chain,
const PublicKeyPinReportStatus report_status,
+ const NetworkIsolationKey& network_isolation_key,
std::string* failure_log) {
PKPState pkp_state;
bool found_state = GetPKPState(host_port_pair.host(), &pkp_state);
@@ -1125,7 +1128,7 @@ TransportSecurityState::CheckPublicKeyPinsImpl(
return CheckPinsAndMaybeSendReport(
host_port_pair, is_issued_by_known_root, pkp_state, hashes,
served_certificate_chain, validated_certificate_chain, report_status,
- failure_log);
+ network_isolation_key, failure_log);
}
bool TransportSecurityState::GetStaticDomainState(const std::string& host,
@@ -1221,8 +1224,13 @@ bool TransportSecurityState::GetDynamicSTSState(const std::string& host,
// An entry matches if it is either an exact match, or if it is a prefix
// match and the includeSubDomains directive was included.
if (i == 0 || j->second.include_subdomains) {
+ base::Optional<std::string> dotted_name =
+ DnsDomainToString(host_sub_chunk);
+ if (!dotted_name)
+ return false;
+
*result = j->second;
- result->domain = DNSDomainToString(host_sub_chunk);
+ result->domain = std::move(dotted_name).value();
return true;
}
}
@@ -1262,8 +1270,13 @@ bool TransportSecurityState::GetDynamicPKPState(const std::string& host,
// implement HPKP, so this logic is only used via AddHPKP(), reachable from
// Cronet.
if (i == 0 || j->second.include_subdomains) {
+ base::Optional<std::string> dotted_name =
+ DnsDomainToString(host_sub_chunk);
+ if (!dotted_name)
+ return false;
+
*result = j->second;
- result->domain = DNSDomainToString(host_sub_chunk);
+ result->domain = std::move(dotted_name).value();
return true;
}
diff --git a/chromium/net/http/transport_security_state.h b/chromium/net/http/transport_security_state.h
index da59832ea0f..ed34c78855b 100644
--- a/chromium/net/http/transport_security_state.h
+++ b/chromium/net/http/transport_security_state.h
@@ -303,6 +303,7 @@ class NET_EXPORT TransportSecurityState {
virtual void Send(const GURL& report_uri,
base::StringPiece content_type,
base::StringPiece report,
+ const NetworkIsolationKey& network_isolation_key,
base::OnceCallback<void()> success_callback,
base::OnceCallback<void(const GURL&,
int /* net_error */,
@@ -385,6 +386,7 @@ class NET_EXPORT TransportSecurityState {
const X509Certificate* served_certificate_chain,
const X509Certificate* validated_certificate_chain,
const PublicKeyPinReportStatus report_status,
+ const NetworkIsolationKey& network_isolation_key,
std::string* failure_log);
bool HasPublicKeyPins(const std::string& host);
@@ -606,6 +608,7 @@ class NET_EXPORT TransportSecurityState {
const X509Certificate* served_certificate_chain,
const X509Certificate* validated_certificate_chain,
const PublicKeyPinReportStatus report_status,
+ const NetworkIsolationKey& network_isolation_key,
std::string* failure_log);
// If a Delegate is present, notify it that the internal state has
@@ -648,6 +651,7 @@ class NET_EXPORT TransportSecurityState {
const X509Certificate* served_certificate_chain,
const X509Certificate* validated_certificate_chain,
const TransportSecurityState::PublicKeyPinReportStatus report_status,
+ const net::NetworkIsolationKey& network_isolation_key,
std::string* failure_log);
// Returns true and updates |*expect_ct_result| iff there is a static
diff --git a/chromium/net/http/transport_security_state_static.json b/chromium/net/http/transport_security_state_static.json
index 933d251ece7..fcabd02c17e 100644
--- a/chromium/net/http/transport_security_state_static.json
+++ b/chromium/net/http/transport_security_state_static.json
@@ -75,7 +75,6 @@
"GlobalSignRootCA_R2"
],
"bad_static_spki_hashes": [
- "GlobalSignRootCA",
"GlobalSignExtendedValidationCA",
"GlobalSignExtendedValidationCA_G2",
"GlobalSignExtendedValidationCA_SHA256_G2"
@@ -1694,7 +1693,6 @@
{ "name": "neftaly.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nu3.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nu3.fi", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ovenapp.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ruudkoot.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "seomobo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "seowarp.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -1933,7 +1931,6 @@
{ "name": "perfectionis.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "phryanjr.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "polymathematician.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "sanatfilan.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sysdb.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tallshoe.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "thetomharling.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -1951,7 +1948,6 @@
{ "name": "bentertain.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bit.voyage", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bzv-fr.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "codepoints.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "codepx.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cyprus-company-service.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "darkpony.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -2487,7 +2483,6 @@
{ "name": "ckliemann.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "console.support", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "crute.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "cycleluxembourg.lu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dash-board.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dekasan.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "doridian.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -3102,7 +3097,6 @@
{ "name": "hardh.at", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "haveeruexaminer.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "helloacm.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "hurricanelabs.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hyper-text.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "idndx.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "im-c-shop.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -3545,7 +3539,6 @@
{ "name": "mb-is.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mobile.eti.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mosstier.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "motd.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "namorico.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nekomimi.pl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "numericacu.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -3813,7 +3806,6 @@
{ "name": "roomhub.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "rsajeey.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "rubi-ka.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ryansmithphotography.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schnell-gold.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "selectel.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "silver-heart.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -4172,7 +4164,6 @@
{ "name": "unpr.dk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "utdsgda.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "valordolarblue.com.ar", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "verizonguidelines.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vieclam24h.vn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vm0.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vnvisa.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -4392,7 +4383,6 @@
{ "name": "papayapythons.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "parkingplus.co.il", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "partirkyoto.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "partyvan.moe", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "peissen.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "peterdavehello.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "phunehehe.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -5175,7 +5165,6 @@
{ "name": "sdcardrecovery.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "seiko-dojo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "selent.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "sendya.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "shukatsu-note.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "singul4rity.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "speedtest-russia.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -5766,7 +5755,6 @@
{ "name": "hiisukun.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hiphopconvention.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hittipps.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "hmsseahawk.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hodne.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hondart.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "honoo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -6555,7 +6543,6 @@
{ "name": "gussi.is", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "h-jo.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "haktec.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "happycoder.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "happytiger.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "happyukgo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hardertimes.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -6848,7 +6835,6 @@
{ "name": "stefanweiser.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stefany.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stigharder.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "stn.me.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stnl.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "strobeltobias.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "studlan.no", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -7042,7 +7028,6 @@
{ "name": "intranetsec.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "inzdr.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "isogen5.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "istdieweltschonuntergegangen.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "itsadog.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "itsecurityassurance.pw", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jcaicedo.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -7133,7 +7118,6 @@
{ "name": "tcdw.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tenyx.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tescoirelandpayslips.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "thelapine.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "themostexpensiveworkofart.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "thinkcoding.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "thomasnet.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -7298,7 +7282,6 @@
{ "name": "bip.gov.sa", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "birkman.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bismarck.moe", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "bit8.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bitshaker.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bittersweetcandybowl.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "blinkenlight.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -7470,7 +7453,6 @@
{ "name": "karmaplatform.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "katekligys.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kefaloniatoday.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "kenners.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kernl.us", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kerrfrequencycombs.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kgxtech.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -7491,7 +7473,6 @@
{ "name": "liquidcomm.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "loadingdeck.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "locomotive.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "lovemomiji.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lpak.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lynkos.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "m.nu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -7521,7 +7502,6 @@
{ "name": "myclientsplus.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "myconan.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mysmelly.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "nagelfam.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "namacindia.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "natuurbehangnederland.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "navstevnik.sk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -8113,7 +8093,6 @@
{ "name": "bashc.at", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "basicsolutionsus.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "baumstark.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "bazdell.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bblovess.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bcbsmagentprofile.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "bcmlu.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -8262,7 +8241,6 @@
{ "name": "chabaudparfum.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "chaos-inc.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "charityclear.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "charmyadesara.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "chartpen.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "chateau-belvoir.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "chatme.im", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -8800,7 +8778,6 @@
{ "name": "herbertmouwen.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hermes-net.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "herr-webdesign.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "herrenfahrt.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hibilog.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hicl.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hiddendepth.ie", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -8929,7 +8906,6 @@
{ "name": "jdh8.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jennifersauer.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jensrex.dk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "jeremye77.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jeroendeneef.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jesters-court.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jetwhiz.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -9050,7 +9026,6 @@
{ "name": "le-hosting.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "leadingsalons.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "leandre.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "learnflakes.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "learnfrenchfluently.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "learningorder.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "legarage.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -9315,7 +9290,6 @@
{ "name": "no17sifangjie.cc", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nodespin.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "noedidacticos.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "noez.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nolatepayments.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nomesbiblicos.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "noobunbox.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -9520,7 +9494,6 @@
{ "name": "pyol.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pysays.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "qcdesignschool.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "qceventplanning.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "qcmakeupacademy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "qcstudentcenter.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "qcstyleacademy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -10147,7 +10120,6 @@
{ "name": "wth.in", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "wubocong.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "wvg.myds.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "www3.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "x3led.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "x509.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "xa1.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -10556,7 +10528,6 @@
{ "name": "fuwafuwa.moe", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gamecard-shop.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fusedrops.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "gemini.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gaelleetarnaud.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "galenskap.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "geeklair.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -11068,7 +11039,6 @@
{ "name": "spititout.it", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sponsortobias.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "spyprofit.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "stamkassa.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sslsurvey.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ssmato.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "spotifyripper.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -11085,7 +11055,6 @@
{ "name": "sunsetwx.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stutelage.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stigroom.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "studiozelden.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "svatba-frantovi.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tails.com.ar", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sv-turm-hohenlimburg.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -11607,7 +11576,6 @@
{ "name": "kjarni.cc", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kkovacs.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kkzxak47.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ko-sys.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "koluke.co", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "koluke.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kontaxis.network", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -11770,7 +11738,6 @@
{ "name": "pypi-mirrors.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pypi-status.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pzme.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "qedcon.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "qivonline.pt", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "r-core.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "r-core.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -11785,7 +11752,6 @@
{ "name": "rentbrowser.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "reuter-shop.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "reuter.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "richardb.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "rickweijers.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "right2.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "rkkhok.hu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -11868,7 +11834,6 @@
{ "name": "swimbee.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "symeda.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "synaptickz.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ta-sports.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tadcastercircuit.org.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tamex.xyz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tanze-jetzt.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -12261,7 +12226,6 @@
{ "name": "cornodo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "couragefound.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "courses.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "cprnearme.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "craigrouse.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "crazy-crawler.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "crazypaul.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -12547,7 +12511,6 @@
{ "name": "heartyme.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "heavensattic.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hebaus.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "hegen.sk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hegenshop.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "heidilein.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hesaplama.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -12752,7 +12715,6 @@
{ "name": "landofelves.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "langworth.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lastchancetraveler.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "latinred.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lattyware.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lattyware.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lauftrainer-ausbildung.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -13129,7 +13091,6 @@
{ "name": "rmf.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "roadfeast.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "robin.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "robinhoodbingo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "rockeyscrivo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "rondommen.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "roslynpad.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -14902,7 +14863,6 @@
{ "name": "sinquin.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "spicywombat.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "slapen17.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "sleepstar.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sitc.sk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "slevermann.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "spedplus.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -15062,7 +15022,6 @@
{ "name": "travelogue.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "unikitty-on-tour.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "touchbasemail.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "t-tz.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tsv-1894.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "typehub.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tuxie.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -16134,7 +16093,6 @@
{ "name": "praeparation-keppner.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "planete-lira.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "qipp.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "readytongue.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "realwoo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pemagrid.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "purpleplains.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -16380,7 +16338,6 @@
{ "name": "ulmer-schneesport.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "unxicdellum.cat", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vestacp.top", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "u03.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "truckersmp.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "twolivelife.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "usportsgo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -16958,7 +16915,6 @@
{ "name": "cranems.com.ua", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "david-pearce.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cube-cloud.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "cornishcamels.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cubecart-demo.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cuni-cuni-club.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "defero.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -17676,7 +17632,6 @@
{ "name": "lunarsoft.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "malamutedoalasca.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kofler.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "linden.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "losless.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "loongsg.xyz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lebal.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -18186,7 +18141,6 @@
{ "name": "shenghaiautoparts.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schoolotzyv.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sensepixel.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "sambaash.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "royalsignaturecruise.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "serversuit.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "senseofnumber.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -18307,7 +18261,6 @@
{ "name": "sumthing.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "spatzenwerkstatt.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stamboommuller.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "srrdb.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sports.dating", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sport-in-sundern.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "siamsnus.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -19181,7 +19134,6 @@
{ "name": "concerto.amsterdam", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "coolgifs.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "crazycraftland.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "cursos.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "corporateencryption.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cralarm.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dandenongroadapartments.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -19483,7 +19435,6 @@
{ "name": "fnof.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fischer-kundendienst.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fondationwiggli.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "fabrysociety.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "financniexperti.sk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fruition.co.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fixtectools.co.za", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -19640,7 +19591,6 @@
{ "name": "hitter-lauzon.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hentaimaster.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gutuia.blue", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "heimnetze.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hmksq.ae", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "handicapindeles.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hosts.cf", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20004,7 +19954,6 @@
{ "name": "laplaceduvillage.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "maintainerheaven.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lifecoachproviders.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "lunafag.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lucas-garte.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mamadea.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "loyaltech.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20035,7 +19984,6 @@
{ "name": "koriyoukai.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "luxinmo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mcideas.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "marmolesromero.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mangazuki.co", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mademoiselledemargaux.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "matthewemes.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20227,7 +20175,6 @@
{ "name": "nikolaichik.photo", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nicolaszambetti.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "night2stay.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "northfieldyarn.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nordlicht.photography", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "netbears.ro", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ntzwrk.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20284,7 +20231,6 @@
{ "name": "openconcept.no", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "olightstore.ro", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nuiguru.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "paigeglass.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nosbenevolesontdutalent.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "open-letters.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "onlinefashion.it", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20714,7 +20660,6 @@
{ "name": "stream.pub", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stockrow.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stockseyeserum.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "stationcharlie.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "stationcharlie.co.za", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "souravsaha.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "streamlineautogroup.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20853,7 +20798,6 @@
{ "name": "trailforks.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tinchbear.xyz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tn0.club", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "timweb.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "thomascloud.ddns.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tobyx.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tobiashorvath.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20866,7 +20810,6 @@
{ "name": "tobyx.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tom-maxwell.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "timhjalpen.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "timtj.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tjeckien.guide", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tovare.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "transsexualpantyhose.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -20876,7 +20819,6 @@
{ "name": "towaway.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "triddi.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tomi.cc", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "townofbridgewater.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "taxiindenbosch.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tie-online.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "townhouseregister.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -21031,7 +20973,6 @@
{ "name": "wiretime.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "xerblade.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "visaop.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "wonderbill.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "xkcd.pw", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "willeminfo.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "wpblog.com.tw", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -21295,7 +21236,6 @@
{ "name": "careeroptionscoach.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cartesentreprises-unicef.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cartesunicef.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "cashlink.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cathosa.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cdburnerxp.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "censurfridns.dk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -21524,7 +21464,6 @@
{ "name": "hechamano.es", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "heimonen.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hennecke-forstbetrieb.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "hfi.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "highspeed-arnsberg.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hobby-drechselei.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hoesnelwasik.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -21544,7 +21483,6 @@
{ "name": "icpc.pp.ua", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "id7.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "idtheft.gov", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "image-drive.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "imga.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "immobilien-badlippspringe.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "impactfestival.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -21825,7 +21763,6 @@
{ "name": "prepaidkredietkaart.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pressenews.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "printf.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "privateideas.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "promedicalapplications.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "proxydesk.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "proxydesk.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -21873,7 +21810,6 @@
{ "name": "salde.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "salzamt.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sam-football.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "sanael.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sand-islets.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sauerland-schnittgruen.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "saxojoe.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -21892,7 +21828,6 @@
{ "name": "section-31.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "secwise.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sellajoch.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "semjonov.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sendai-sisters.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "senmonsyoku.top", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "seoagentur2go.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -22178,7 +22113,6 @@
{ "name": "3555aa.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "3778vip.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "379700.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "393335.ml", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "3circlefunding.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "3dcart.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "3dprintsondemand.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -22765,7 +22699,6 @@
{ "name": "cmskeyholding.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cmskh.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cnetw.xyz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "co-driversphoto.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "co-factor.ro", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cobrax.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "code-digsite.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -22963,7 +22896,6 @@
{ "name": "dhlinux.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "diagnosia.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "diamorphine.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "diannaobos.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dicelab.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dicionariodegirias.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dicionariodelatim.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -23263,7 +23195,6 @@
{ "name": "fossgruppen.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fotostravestisbr.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fourwheelpartloanssimple.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "fr33tux.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fragilesolar.cf", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "franchini.email", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "franchini.engineer", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -23397,9 +23328,7 @@
{ "name": "gorky.media", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gouldcooksey.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gourmettia.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "gouthro-goteborg.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gouv.ovh", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "gpws.ovh", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "graeber.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "grandcapital.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "grapeintentions.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -23431,7 +23360,6 @@
{ "name": "gympap.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gzitech.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gzpblog.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "h001.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "h2u.tv", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "h3x.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "h3z.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -23629,7 +23557,6 @@
{ "name": "innsalzachsingles.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "inscript.pl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "inst.mobi", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "instinctive.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "int-ma.in", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "integralkk.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "intelligence-explosion.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -24834,10 +24761,8 @@
{ "name": "schau-rein.co.at", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schermreparatierotterdam.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schier.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "schippers-it.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schmelzle.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schmitt.ovh", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "schnyder-werbung.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schsrch.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "schwarzwald-flirt.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "scintilla.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -25364,7 +25289,6 @@
{ "name": "vendigital.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vendorconnect.nyc", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "venmos.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "venoom.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "verliebt-in-bw.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "verliebt-in-niedersachsen.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "versagercloud.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -25742,7 +25666,6 @@
{ "name": "alfaponny.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "3dmusiclab.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "andrewdavidwong.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "alpha.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "americanmediainstitute.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "alex97000.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "anime1video.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -25804,7 +25727,6 @@
{ "name": "abilitycaresoftware.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "arent.kz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "aquatechnologygroup.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "alexdaulby.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "arg.zone", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "armenians.online", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "annetaan.fi", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -26419,7 +26341,6 @@
{ "name": "dorkfarm.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "drakenson.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dundalkdonnie.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "donnachie.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "easelforart.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dovro.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ea2drocks.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -26540,7 +26461,6 @@
{ "name": "everain.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "epicvistas.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ebop.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "eworksmedia.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "exeintel.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "example.wf", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "evilarmy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -26616,7 +26536,6 @@
{ "name": "environment.ai", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "flapoverspeed.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fefelovalex.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "financejobs.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "firmament.space", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fastbackmbm.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "filoitoupediou.gr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -26876,7 +26795,6 @@
{ "name": "hokify.at", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hokify.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "highlegshop.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "honeyhaw.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hollo.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hygo.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hopglass.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -26919,7 +26837,6 @@
{ "name": "iemb.cf", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "i4m1k0su.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ict-crew.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ictcareer.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "idrycleaningi.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "idrinktoomuch.coffee", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ideaplus.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -26967,7 +26884,6 @@
{ "name": "ingalabs.hu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "internetbugbounty.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "indecipherable.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ingjobs.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "indogermantrade.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "industrybazar.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "investigazionimoretti.it", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -26999,7 +26915,6 @@
{ "name": "itis.gov", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "iskai.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ichasco.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ilamparas.mx", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "islief.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ipal.tel", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "interboursegeneva.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -27051,11 +26966,9 @@
{ "name": "joelmunch.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "josefottosson.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jobsuchmaschine.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "jobs4sales.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jelena-adeli.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jobs.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "joelleandpeter.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "jobwinner.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "joelcoustrain.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "josc.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "joelle.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -27387,7 +27300,6 @@
{ "name": "medicocompetente.it", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mekatrotekno.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "margotlondon.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "medtalents.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mbdrogenbos-usedcars.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mbwemmel-usedcars.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mgsisk.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -27677,7 +27589,6 @@
{ "name": "palabr.as", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "openiocdb.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ninjaspiders.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ofo2.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pasadenasandwichcompany.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "padrepio.in", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "papersmart.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -27763,7 +27674,6 @@
{ "name": "pj539999.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "perrau.lt", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pinterest.at", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "pivotanimation.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pinkapple.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pirateproxy.cc", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pikmy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -28441,7 +28351,6 @@
{ "name": "top-obaly.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "traces.ml", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "torstensenf.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "topjobs.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tokyomakino.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "trimarchimanuele.it", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tlsrobot.se", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -28481,7 +28390,6 @@
{ "name": "twem.ddns.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "twenty71.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ttll.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "tsukuba.style", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tuts4you.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "twincitynissantxparts.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "turnsticks.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -28552,7 +28460,6 @@
{ "name": "vergeaccessories.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "upload.cat", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "viditut.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "vacuumreviewcenter.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vaygren.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "unterkunft.guru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ueba1085.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -28922,7 +28829,6 @@
{ "name": "addcrazy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "3wecommerce.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "afbeeldinguploaden.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "aflamtorrent.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "addones.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "aelurus.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "513vpn.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -29106,7 +29012,6 @@
{ "name": "brandcodeconsulting.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "birchbarkfurniture.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "birchbarkfurniture.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "briefhansa.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "birchbarkfurniture.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cabaladada.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "brokenjoysticks.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -29263,9 +29168,7 @@
{ "name": "dariosirangelo.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dcc.cat", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "daemwool.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "cosmeticosnet.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "corpoatletico.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "darbi.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "deborahmarinelli.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "daniel-stahl.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dcc.moe", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -29441,7 +29344,6 @@
{ "name": "exside.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "expresswins.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "eyes-of-universe.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "fanzlive.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fashionunited.lu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fam-kreibich.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fergusoncastle.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -29536,7 +29438,6 @@
{ "name": "goodfeels.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "foxes.no", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "frebi.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "geniuszone.biz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "go-embedded.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "gdiary.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fysiotherapieholtenbroek.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -29699,7 +29600,6 @@
{ "name": "imperialonlinestore.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jameshemmings.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "intertime.services", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "jeffmcneill.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ispsoft.pro", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "joaosampaio.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "josemikkola.fi", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -29779,7 +29679,6 @@
{ "name": "koryfi.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "jacobsenarquitetura.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kitatec.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "lannainnovation.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lazulu.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "leadgenie.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "laraveldirectory.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -29882,7 +29781,6 @@
{ "name": "lojaprimemed.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "malgraph.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "makedonien.guide", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "louduniverse.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "marinekaplama.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "masterofallscience.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "makaleci.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -30103,7 +30001,6 @@
{ "name": "mireiaseuba.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "orangecomputers.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "orleika.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "oliverniebuhr.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "oversight.gov", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "opsnotepad.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "owl.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -30722,7 +30619,6 @@
{ "name": "vital-tel.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "watch-wiki.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vssnederland.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "webpostingpro.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vivid-academy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "webukhost.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "westmeadapartments.com.au", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -30767,7 +30663,6 @@
{ "name": "webwolf.co.za", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "vapesense.co.uk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "x-lan.be", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "wikibulz.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "windowwellcovers.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "torontocorporatelimo.services", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "xlfblog.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -30892,7 +30787,6 @@
{ "name": "artschmidtoptical.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "injust.ml", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "injust.tk", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "graetnew.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "boel073.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "freebarrettbrown.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "flyingpackets.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -30933,7 +30827,6 @@
{ "name": "liberapay.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "meetmygoods.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "8522cn.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "lifecism.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "learninglaw.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "cyberduck.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "fl0333.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -31047,7 +30940,6 @@
{ "name": "jungleculture.co.za", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "www-8522.am", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "savecrypto.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "vigoxatelier.tech", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sproing.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "webveloper.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "sintesysglobal.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -31155,7 +31047,6 @@
{ "name": "halitopuroprodutos.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hanys.xyz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "haogoodair.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "heartview.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "helpstarloja.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "homesandal.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "hotcandlestick.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -31226,18 +31117,11 @@
{ "name": "mundoarabe.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mundokinderland.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mwainc.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "mygeneral.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "mylatestnews.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "mytruecare.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "myupdatestar.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "myupdatestudio.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "myupdatesystems.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nairobibusinessreview.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "naoar.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "neowlan.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "netlentes.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "netmagicas.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "networkposting.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nexusbyte.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nkb.in.th", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nordnetz-hamburg.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -31474,14 +31358,12 @@
{ "name": "danyabanya.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "darlastudio66.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dasgeestig.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "datakick.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "datenschutzgrundverordnung.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ddel.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "de-mail.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "deeparamaraj.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "denis-martinez.photos", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "digicert-support.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "dingcc.xyz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "discoverwellness.center", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "dismail.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "divenwa.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -31715,8 +31597,6 @@
{ "name": "originalniknihy.cz", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "owngeek.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "padzilla.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "pagedesignhub.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "pagedesignpro.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "passionatehorsemanship.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pastorsuico.com.br", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "paul-bronski.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -32050,7 +31930,6 @@
{ "name": "telos-analytics.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "test.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "the-body-shop.hu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "timco.cloud", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tsurezurematome.ga", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "type1joe.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "upgamerengine.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -32098,8 +31977,6 @@
{ "name": "activeclearweb.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "adamh.us", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "adeline.mobi", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "adesa-asesoria.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "adhigamindia.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "adm-sarov.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "admin-serv.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "adriancitu.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -32934,7 +32811,6 @@
{ "name": "mbits.solutions", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "media-pi.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mediadandy.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "medstreaming.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "medtankers.management", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "meetingfriends.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mehmetakif.edu.tr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -33013,7 +32889,6 @@
{ "name": "mymp3singer.co", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "myndcommunication.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mynewselfbariatrics.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "mynn.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mypress.mx", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mypup.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "myrandomtips.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -33180,7 +33055,6 @@
{ "name": "psu.je", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ptal.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pv-paderborn-now.de", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "q8mp3.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "qq-navi.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "quareal.ru", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "quasseldroid.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -33420,7 +33294,6 @@
{ "name": "tijo.ch", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tik.edu.ee", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tik.help", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "timer.fit", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tkn.me", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tlca.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "tlcnet.info", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -33948,7 +33821,6 @@
{ "name": "kinnikinnick.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "kredit-abzocke.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "krypt.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "ktw.lv", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "landyparts.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lang-php.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "lareclame.fr", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -33983,7 +33855,6 @@
{ "name": "melerpaine.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "mes10doigts.ovh", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "messagescelestes-archives.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "michaeljdennis.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "miggy.org", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "misclick.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "misgluteosperfectos.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -34018,7 +33889,6 @@
{ "name": "noslite.nl", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nsdev.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "nsmail.cn", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "oblondata.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "odysseyofthemind.eu", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "oliveoiltest.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "omnibot.tv", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -34029,7 +33899,6 @@
{ "name": "opencad.io", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "ostrov8.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "oxborrow.ca", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
- { "name": "pagedesignweb.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "pages-tocaven.com", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "paipuman.jp", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
{ "name": "party-calendar.net", "policy": "bulk-18-weeks", "mode": "force-https", "include_subdomains": true },
@@ -34416,7 +34285,6 @@
{ "name": "bigcorporateevents.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bigfunbouncycastles.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bikelifetvkidsquads.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bilalic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bilbayt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "billysbouncycastlehire.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bio-disinfestazione.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -34849,7 +34717,6 @@
{ "name": "funtimebourne.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "funtimeentertainment.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "funtimesbouncycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "furigana.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fuzoku.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gaio-automobiles.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gameshowchallenge.ie", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -34892,7 +34759,6 @@
{ "name": "halkirkbouncycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "happybounce.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "happykidscastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "haribilalic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "harryphoto.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "harrysgardengamehire.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "harrysqnc.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -34959,7 +34825,6 @@
{ "name": "interimages.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "internaluse.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "investarholding.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "iobint.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ipmonitoring.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "it-kron.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "itraveille.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35183,7 +35048,6 @@
{ "name": "mendipbouncycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "metadistribution.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "metikam.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "metrolush.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "micado-software.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "michaelschubert.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "microlinks.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35319,7 +35183,6 @@
{ "name": "pjentertainments.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pjleisure.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pkphotobooths.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "plantrustler.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "playawaycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "playdaysparties.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "playtimebouncycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35341,7 +35204,6 @@
{ "name": "poshcastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "premierbouncycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "premierevents.ie", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pressography.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prestigebouncycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prestigeeventshire.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "primalinea.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35379,7 +35241,6 @@
{ "name": "reepay.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "registerforevent.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "regraph.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "reimaginebelonging.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "reinfer.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "reisekosten-gorilla.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "remodelwithlegacy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35461,7 +35322,6 @@
{ "name": "snote.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "so.is-a-cpa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "soccorso-stradale.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sockeye.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sodexam.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "softandbouncy.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "softplay4hire.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35473,7 +35333,6 @@
{ "name": "sonixonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sos-idraulico.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sosoftplay.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "soulcrazy.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "southambouncycastle.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "soutien-naissance.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spahireleeds.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35520,7 +35379,6 @@
{ "name": "tecit.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tecne.ws", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "template-parks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tendomag.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "terra-x.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tewkesburybouncycastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "texasvolunteerattorneys.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35583,7 +35441,6 @@
{ "name": "trianglecastles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "trizone.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "troisdorf-gestalten.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tryupdates.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tubetoon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tubetooncartoons.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tubs4fun.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35600,7 +35457,6 @@
{ "name": "unbelievableplaces.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "underbridgeleisure.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "unique-bouncy-castles.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "universeinform.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "unobrindes.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "unworthy.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "usbevents.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35632,9 +35488,6 @@
{ "name": "wdmg.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "webcatchers.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "webdev-quiz.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "webjobposting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "webpostingmart.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "webpostingreviews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "websandbox.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "websiteout.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "websiteout.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -35843,8 +35696,6 @@
{ "name": "blogexpert.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bloodyexcellent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bluesecure.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bodixite.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "boisewaldorf.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bolovegna.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bosufitness.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "boulzicourt.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -36017,7 +35868,6 @@
{ "name": "handbrake.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "happyschnapper.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "harapecorita.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hashes.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "haus-henne.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "haushenne.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hawkofgeorgia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -36047,7 +35897,6 @@
{ "name": "indiaflowermall.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "indoorplantsexpert.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "inetserver.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "innoteil.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "instaquiz.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "interfloraservices.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "inventoryimages.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -36764,7 +36613,6 @@
{ "name": "omnitrack.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "onepopstore.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "opencircuit.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "optimal-e.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pabloarteaga.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pabloarteaga.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pabloarteaga.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -37078,7 +36926,6 @@
{ "name": "eff-bee-eye.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "egarden.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "electricalagoura.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "elguadia.faith", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elitesensual.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elucron.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "empower.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -37269,7 +37116,6 @@
{ "name": "namazvakitleri.com.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nani.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "natchmatch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nationalcprfoundation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "natlec.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "naturalkitchen.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ncc-qualityandsafety.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -37565,7 +37411,6 @@
{ "name": "augix.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aupasdecourses.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aurelienaltarriba.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "auroware.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "austinuniversityhouse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "australianarmedforces.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "australianimmigrationadvisors.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -37611,7 +37456,6 @@
{ "name": "b98886.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "b9889.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "b9930.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "b99520.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "b9980.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "b99881.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "b99882.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -39419,7 +39263,6 @@
{ "name": "gearallnews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "geecrat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "geek1.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "genchev.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "geocompass.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gepe.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "get2getha.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -39447,7 +39290,6 @@
{ "name": "gymnasium-hittfeld.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gyulakerezsi.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "haccp.milano.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hackerchai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hackerlite.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hacktic.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "haixihui.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -40175,7 +40017,6 @@
{ "name": "emailalaperformance.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "emailing.alsace", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "emilecourriel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "enlnf.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "epyonsuniverse.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ericloud.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "erikwagner.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -40535,7 +40376,6 @@
{ "name": "retireyourpassword.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rga.sh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rickvanderzwet.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "robicue.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rody-design.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roodfruit.studio", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roughcopy.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -40679,7 +40519,6 @@
{ "name": "vorlagen-geburtstagsgruesse.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vosn.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vosser.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "voya.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vpsport.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vuilelakens.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vzce.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -41436,7 +41275,6 @@
{ "name": "wpoptimalizace.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wpsec.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wristreview.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "wrp-timber-mouldings.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wyo.cam", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "x-one.co.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xia.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -42292,7 +42130,6 @@
{ "name": "aussiewebmarketing.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "authoritysolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "avocadooo.stream", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "awesomesit.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "axiumacademy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "az-moga.bg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "azadliq.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -42847,7 +42684,6 @@
{ "name": "whychoosebob.net.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wichitafoundationpros.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wirkaufendeinau.to", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "wlwlwx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ws-meca.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wsadek.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "www-9822.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -43249,7 +43085,6 @@
{ "name": "kiesuwcursus.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kikimilyatacado.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kine-duthil.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "kmdev.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "koi-lexikon.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "koirala.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "koirala.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -43416,7 +43251,6 @@
{ "name": "pself.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "psicologasandrabernal.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "psychiq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "puravida-estate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pushers.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "qi0.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "qto.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -43581,7 +43415,6 @@
{ "name": "weekendinitaly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "weitergedacht.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "westcoastaggregate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "wft-portfolio.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "whateveraspidercan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "whatismycountry.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "workinginsync.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -43747,8 +43580,6 @@
{ "name": "indiroyunu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "insistel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "internalkmc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "invasmani.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "inventtatte.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "iproducemusic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "iro-iro.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "isayoga.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -43758,7 +43589,6 @@
{ "name": "jeffwebb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jkuvw.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kekehouse.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "keywebdesign.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "knowledgeforce.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kopfundseele.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lagriffeduservice.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -43821,7 +43651,6 @@
{ "name": "practicalprogrammer.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "productoinnovador.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "quangngaimedia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "rebelrebel.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "regenerapoint.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "renthelper.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "republictelecom.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -43901,7 +43730,6 @@
{ "name": "akuislam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "alanberger.me.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "amikootours.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "anadiyogacentre.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "andreasbasurto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "androidsphone.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "angrylab.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -44024,7 +43852,6 @@
{ "name": "megarex.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "megustariasaber.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "motoreflex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "musikzentrale.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "my4thtelco.sg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "myfishpalace.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "myrepubic.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -44491,7 +44318,6 @@
{ "name": "jydemarked.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kabarlinux.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kagitreklam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "kanetix.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kanzlei-oehler.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "karupp-did.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kellyssportsbarandgrill.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -44682,7 +44508,6 @@
{ "name": "registerex.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rehabmail.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "reiki-france.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "reimaginebelonging.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rekisuta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rencontres-erotiques.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "retrovideospiele.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -44940,7 +44765,6 @@
{ "name": "best66.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bgtoyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bh-oberland.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bio24.si", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bit.biz.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bithap.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bitlo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -46177,7 +46001,6 @@
{ "name": "onlinexl.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "onyxmoon.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "open-banking-access.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "openscreen.lu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "openstreetmap.lu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "otsfreestyle.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ovirt.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -47150,7 +46973,6 @@
{ "name": "sporttown.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spritsail.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ssconn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "starmtech.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "status.coffee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "steamwhale.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "steven-klix.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -47237,7 +47059,6 @@
{ "name": "watvindtnederland.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wdic.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wearehackerone.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "webhostingshop.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "webpinoytambayan.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "webpinoytv.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "werepairit.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -47349,7 +47170,6 @@
{ "name": "como-se-escribe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "comocurarlagastritistratamientonatural.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cosasque.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cprheartcenter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crimefreeliving.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crochetnerd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "curareldolordeespalda.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -47455,7 +47275,6 @@
{ "name": "kiyotatsu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kkr-bridal.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kndkv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "knispel-online.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kockanakocko.si", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "la-kaz-a-velo.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lacaserita.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -47475,7 +47294,6 @@
{ "name": "m-chemical.com.hk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "m-warrior.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mac.biz.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "maerzpa.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "malufs.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mamamoet.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mansfeld.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -47783,11 +47601,9 @@
{ "name": "christec.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "christerwaren.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "churningtracker.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "chyen.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "classictheatrecumbria.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cleaningservicejulai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cloudns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cocodroid.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "colinsnaith.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "collectorsystems.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "commerce.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -47883,7 +47699,6 @@
{ "name": "fdp-brig-glis.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fedoraproject.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "feel-events.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "fichier-pdf.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fifr.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fiissh.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "filiio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -48420,7 +48235,6 @@
{ "name": "windsorspi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "withextraveg.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wohlpa.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "woltlab-demo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "woofsbakery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "woomai.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "worldmeteo.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -48516,7 +48330,6 @@
{ "name": "chaoswars.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "clad.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "clangwarnings.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "colorfuldots.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "consultimedia.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cordep.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "createme.com.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -48573,7 +48386,6 @@
{ "name": "havetherelationshipyouwant.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "herbhuang.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hotels4teams.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hrbl.lc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "html.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "humorcaliente.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hurleyhomestead.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -49273,7 +49085,6 @@
{ "name": "hausjugo.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "haydentomas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "healthyteame.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hentaiworld.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "henzenhoning.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hgvnet.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hj2999.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -49293,7 +49104,6 @@
{ "name": "howtocommunicate.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hqy.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hsappstatic.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hsex.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hti.digital", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hubapi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hubspot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -49384,7 +49194,6 @@
{ "name": "kolorbon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "komenamanda.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kotobox.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "kucukayvaz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lanahallen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "landlordy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "landscape-photography.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -49471,7 +49280,6 @@
{ "name": "mivzaklive.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mizu.coffee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "modulex-gmbh.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "moeyoo.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mojizuri.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "moneoci.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "moneybird.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -49812,7 +49620,6 @@
{ "name": "syamuwatching.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sympmarc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "systemchile.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "szclsya.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tabi-news.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "taiphanmem.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tannerwj.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -50139,7 +49946,6 @@
{ "name": "ehub.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elcontadorsac.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elekharris.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "elonm.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "enord.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "erics.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "establo.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -50568,7 +50374,6 @@
{ "name": "vitra-showrooms.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vrij-links.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vwo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "waligorska.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "walksfourpaws.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wanlieyan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wapking.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -50673,7 +50478,6 @@
{ "name": "bytemix.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "c5h8no4na.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "calcoolator.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "camcapital.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "camshowstorage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "carlocksmithbaltimore.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "casinomucho.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -50688,7 +50492,6 @@
{ "name": "cathyjf.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cathyjf.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cathyjfitzpatrick.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "caxalt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cesantias.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ceta.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "chenna.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -50841,7 +50644,6 @@
{ "name": "panic.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "patsch-photography.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "paynet.com.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pdfsearch.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pems.gov.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "peto.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "piroleikki.co.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -51903,7 +51705,6 @@
{ "name": "wereoutthere.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "white-ibiza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "williamscomposer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "williamsflintlocks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "willowbrook.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "woaiuhd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "worldrecipes.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -51928,7 +51729,6 @@
{ "name": "23333.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "24hourcyclist.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "2bad2c0.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "357maelai.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "360vrs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "371cloud.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "411416.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -52333,7 +52133,6 @@
{ "name": "idesoft.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "idesoftinnovacion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "idesoftinnovacion.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ihcr.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ijsclubwanneperveen.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ikumi.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "imperiodigital.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -52526,7 +52325,6 @@
{ "name": "noomist.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "noroshi-burger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "northdakotahealthnetwork.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nosproduitsdequalite.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nowall.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "npregion.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nshipster.co.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -53239,7 +53037,6 @@
{ "name": "sopo.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sotai.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spartacuslife.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "spectroom.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spectrum.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "st-bede.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "steemyy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -53250,7 +53047,6 @@
{ "name": "studio44.fit", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "studiohomebase.amsterdam", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "stuffiwouldbuy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sullenholland.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "supioka.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "supmil.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sv-bachum-bergheim.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -53382,7 +53178,6 @@
{ "name": "bestplumbing.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "betaclouds.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bilibili.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "billkochman.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "biscuitcute.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bizbudding.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bizcash.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -55676,7 +55471,6 @@
{ "name": "locksmithhumbletx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "longboat.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "loquo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "loveai.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lovemiku.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lsy.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lugimax.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -55737,7 +55531,6 @@
{ "name": "metron-online.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mfxxx.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mialquilerdecoches.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "michalp.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "michelskovbo.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "micopal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "microneedlingstudio.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -55892,7 +55685,6 @@
{ "name": "peterhons.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pflug.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "phenq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "phil.red", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "phillipsdistribution.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "phpstan.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pimg136.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -56205,7 +55997,6 @@
{ "name": "sunred.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "superidropulitrice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "surfnetparents.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "svak-gutachter.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "swe77.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "swe777.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sweet-spatula.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -56461,7 +56252,6 @@
{ "name": "0ii0.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "233now.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "3dgep.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "52hentai.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "affarsnatverk.nu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "afterdwi.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agenceactiv.immo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -57061,7 +56851,6 @@
{ "name": "falce.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "familie-mischak.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fantasy-judo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "fapplepie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "feldmann-stachelscheid.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "feminism.lgbt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ffrev.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -57406,7 +57195,6 @@
{ "name": "shrimpcam.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sim-usa.mobi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sincemydivorce.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sitiweb.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "six-o-one.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "skolnieks.lv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "skulblaka.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -58287,7 +58075,6 @@
{ "name": "lagsoftware.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lalunaonlinebr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lambangcapgiare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lannamontessori.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lannatefl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lansewu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "laserhealthsolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -58467,7 +58254,6 @@
{ "name": "newhoperailroad.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nexter.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nguyencucthanh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nice.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nicolaiteglskov.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nikpool.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ningbo.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -58615,7 +58401,6 @@
{ "name": "responsecode.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "reviderm-skinmedics-rheinbach.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "revuestarlight.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "riechsteiner.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rileyskains.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rincondenoticas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ristorantelittleitaly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -58872,7 +58657,6 @@
{ "name": "woshiluo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wpboot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wpcs.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "wpherc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wug.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "www-5287.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wyomingexiles.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -59335,7 +59119,6 @@
{ "name": "dietervandenbroeck.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dmzlab.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dollarrp.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "dponetwork.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dr-peter-jahn.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dstvrandburg.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "efreet.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -59504,7 +59287,6 @@
{ "name": "retailcybersolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "retrotown.ws", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rhondanp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "robsutter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roko-foto.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rs-cloud.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rubixstudios.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -59691,7 +59473,6 @@
{ "name": "d4fx.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dadadani.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "danads.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "dapianw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "darf.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dead-letter.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "deepspace4.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -59793,7 +59574,6 @@
{ "name": "linkyou.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lippu1.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "living-with-outlook-2010.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "localegroup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ltlec.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ltlec.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ltmw.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -60173,7 +59953,6 @@
{ "name": "meidev.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "minapin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "minhyukpark.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "miniaturepets.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mirrordream.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mobl.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "moego.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -60189,7 +59968,6 @@
{ "name": "neat-patch.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "neckbeard.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nelflex.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "neosey.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "neppglobal.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "newflavor.design", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nishimebistro.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -60851,7 +60629,6 @@
{ "name": "gwynfryncottages.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hanjuapp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "helensmithpr.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "help207.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "helsenorge.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "heritagecoffee.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "herzwacht.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -60862,7 +60639,6 @@
{ "name": "how-old.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hsturan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hulaginswoodworking.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "i2verify.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ibericarempresas.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ibericarformula.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ibericargestoso.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -61027,7 +60803,6 @@
{ "name": "somethingsomething.work", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sophiahatstudio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "speakersbusiness.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "spotsee.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spt.tf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "staffhunt.org.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "star-darom.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -61052,7 +60827,6 @@
{ "name": "tim-demisch.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tkcafe.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "totalpackers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "trastornolimite.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "travisec.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "trit.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "trosell.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -61407,7 +61181,6 @@
{ "name": "rdcdesign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rdfencingandgates.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "realcolors.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "retefrati.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "retropack.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "richlj.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "richlj.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -61937,7 +61710,6 @@
{ "name": "codeknights.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "codetipi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "compostelle-bouddha.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "compreair.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "computec.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "concilio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cosmicworlds.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -62013,7 +61785,6 @@
{ "name": "itpanda.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ix.mk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jackfletcher.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "jerseyplantsdirect.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jesusvazquez.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jolinebrussel.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jonny5.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -62161,7 +61932,6 @@
{ "name": "topshelf.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "totalaccessnicaragua.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "touhou.tw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "trastornoevitacion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tronlaserarena.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tsrv.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tutorialseo.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -62197,7 +61967,6 @@
{ "name": "267661.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "351113.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "382225.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "54.sb", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "592227.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "599980.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "716227.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -62273,7 +62042,6 @@
{ "name": "coupestanley.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "craft-me-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crain.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "critterguard.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cuminas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cuminas.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cursed.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -62699,7 +62467,6 @@
{ "name": "ejelectrical-qld.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ejkhosting.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "electricgatemotorsballito.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "electricgatemotorsqueensburgh.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elettricisti.roma.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elipsyum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "emilybellydance.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -62803,7 +62570,6 @@
{ "name": "mainone.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mareamoda.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "matthewsaeger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "melanfengshui.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "metadata.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "miaomiaomiao.live", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "micromegas.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -63018,7 +62784,6 @@
{ "name": "673990.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "675660.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "675990.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "679660.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "692660.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "692990.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "695660.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -63056,8 +62821,6 @@
{ "name": "ae86sb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aero.parts", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ag88.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "agilicus.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "agilicus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ai00.vip", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aisin.ae", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "akoofs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -63589,7 +63352,6 @@
{ "name": "maximilian-staedtler.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mazi.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mchost.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mcpebox.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "medbreaker-friends.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "medpost.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "megaxhost.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -63847,7 +63609,6 @@
{ "name": "schuetzen-ehrenbreitstein.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "schultz.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "scp-079.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sds-marburg.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sduoxminty.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sebandroid.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sebastian-haeutle.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -64078,7 +63839,6 @@
{ "name": "whythisguy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "windowseatwanderer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wingspatagonia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "winner.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wishingyou.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "withheld.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wobker.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -64290,7 +64050,6 @@
{ "name": "hmnd.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "htdcomputer.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "i-voting.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "icetravellers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "iglosujemy.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ihearmedical.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "impresa-di-pulizie.milano.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -64382,7 +64141,6 @@
{ "name": "pechonova.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pentagonreviewcenter.com.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pirapiserver.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "planningsagenda.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "plumbingkingsllc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pnnl.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "po0k.ie", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -65902,7 +65660,6 @@
{ "name": "t9728.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tcj.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tclb.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "techvhow.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tecnaa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "telestepina.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "terme.viterbo.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -66716,7 +66473,6 @@
{ "name": "plaros.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ploi.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "poliscentraal.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "poslusny.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pracujwunii.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pranaprinciple.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "princetonnassaupediatrics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -67084,7 +66840,6 @@
{ "name": "6957z.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "6957z.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "6957zz.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "7ka.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "876666365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "88btt.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "918.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -67790,7 +67545,6 @@
{ "name": "dora.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dratini0.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dreamsxxl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "duchateaugyn.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dunyahalleri.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "e-mandataires.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "e-michiganinsurance.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -68232,9 +67986,7 @@
{ "name": "glexia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gobiz.com.my", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gordyf.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "habbstars.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hallaminternet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hanyingw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hashtagswimwear.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "he.kg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "healthyhomesofmichigan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -68342,7 +68094,6 @@
{ "name": "lc8.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8841.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8893.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc8a.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8dc12.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8dc14.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8dc17.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -68592,7 +68343,6 @@
{ "name": "chenx221.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "chenx2210.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "chrystus.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "chun.si", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "clare3dx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "claudiney.eti.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cnbibo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -69168,7 +68918,6 @@
{ "name": "redpatronus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rodrigoacevedo.com.uy", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roh.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "roi.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rotring.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rphyncice.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "russia.wtf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -69202,7 +68951,6 @@
{ "name": "taxi-uslu.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "taxichic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "technology.cx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "techzjc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "teen-porno-video.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "teleport.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "test-allegrodev.pantheonsite.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -69294,7 +69042,6 @@
{ "name": "augehost.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aurbrowser.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "austinchase.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "avi12.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "axa.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "b-tree.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "banfor.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -69635,7 +69382,6 @@
{ "name": "sony-psvita.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sparkar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sparklesdelivery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sphardy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "srsforward.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "srsfwd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "srsfwd.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -70462,7 +70208,6 @@
{ "name": "dizzieforums.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "djdeepstate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dmerkel.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "doceo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "docmed360.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dogboarding.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dogeboy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -70531,7 +70276,6 @@
{ "name": "holunderbluetentee.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "homeable.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hosteleriauno.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hostingsrv.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "huabantxt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "huabanxs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "huimiquan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -70621,7 +70365,6 @@
{ "name": "mastermindbusinesspro.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "masternautconnect.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mb-demo.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "medbreaker.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "megaron.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "meliowebweer.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "meloniecharm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -70737,7 +70480,6 @@
{ "name": "thecontentcloud.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thecraftingstrider.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thekiddz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "theswimdoctors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thutucxuatnhapkhau.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tipsdebellezaysalud.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tobimi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -71171,7 +70913,6 @@
{ "name": "416365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "418663.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "426773.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "4345.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "436773.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "438663.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "444b58.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -72166,7 +71907,6 @@
{ "name": "geschaeftsideen-ebook.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "get-california-real-estate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "getpromo.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "gfac.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gfronline.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "giovannarossi.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "givepenny.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -73660,7 +73400,6 @@
{ "name": "alwayshowher.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "am5188.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "am615.am", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "am8.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "amandahamilton.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "americanunicornparty.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "amoxil.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -74785,7 +74524,6 @@
{ "name": "shevet-achim.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shgw186.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shielddagger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "shiftpsych.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shilpaonline.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shitnikovo.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shkololo.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -75654,7 +75392,6 @@
{ "name": "man-stuff.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maneql.co.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maneql.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "marcus.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "masarn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mbadika.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mdihi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -75667,7 +75404,6 @@
{ "name": "miravelli.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mismart.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mitfx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "motherwell.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mserve.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mydevops.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "n3domains.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -75901,7 +75637,6 @@
{ "name": "castiana.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ceylavi.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "chat36.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "chawa.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cheapnhljerseys.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "christianr.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cjs8866.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -75932,7 +75667,6 @@
{ "name": "distributednya.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "djsanonimo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dk1818.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "dnoid.to", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dogfriendly.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "downtownsuiteliving.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dpim.org.my", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -76134,7 +75868,6 @@
{ "name": "quadron.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "r81818.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "radioheaven.co.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "rainbowflowers.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rainturtle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rawcbd.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rbuddenhagen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -76503,7 +76236,6 @@
{ "name": "mekanika.com.my", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "metroplex.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mivm.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mjproduction.ee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "modderday.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "moens.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "netface.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -76590,7 +76322,6 @@
{ "name": "tian888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "toronto-escorts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "toyopac.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tranceattic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "travelerofcharleston.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tripasia.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tube8.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -76902,7 +76633,6 @@
{ "name": "richieheijmans.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ruf888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "runningandoutdoors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "russstudios.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ryanjarvis.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "s-pro.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "safetysign.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -76936,7 +76666,6 @@
{ "name": "swindontennisclub.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "syncplay.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "szww99.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tasadar.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "taubin.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tehden.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "teriyakiweasel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -77128,7 +76857,6 @@
{ "name": "forexarby.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fortdodgeradio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "franklinmagic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "freshbooks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "furgetmeknot.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "futuristacademy.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "g2jp.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -77767,7 +77495,6 @@
{ "name": "dechetor.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dejongonline.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "depot24.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "desertbloomplasticsurgery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "devmode.fm", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "diariocibao.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "diepanhcare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -77888,7 +77615,6 @@
{ "name": "parkeerbordenhuren.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "paroisses-theix-surzur.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pcdbank.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "piektraining.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pitoufi.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "planisys.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "playlisten.radio.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -77925,7 +77651,6 @@
{ "name": "siepomaga.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "simmtronic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sinakuhestani.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "siulam-wingchun.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "skyblockrebellion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "slalix.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "smaltimento-rifiuti.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -78120,7 +77845,6 @@
{ "name": "equipoweb.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "espacobebecia.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "everydaylatestnews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "evthing.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "exploredouglascountyga.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "f9marketing.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fachfusspflege-exner.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -78397,7 +78121,6 @@
{ "name": "zanjirzanane-shanbeghazan.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "0553z6.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "0571z6.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "09am8.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "1u0m.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "3333ylc.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "364553.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -79169,7 +78892,6 @@
{ "name": "computingsociety.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "comschool.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "contentmarathon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "coteibem.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "couponbre.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cozumel-activities.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crafted.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -79179,7 +78901,6 @@
{ "name": "danskefilm.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dartydiscount.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dc-acupuncture.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "deanstreettacochips.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "decofiori.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "denisadinu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "desert-maroc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -79294,9 +79015,7 @@
{ "name": "latanews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "latinosup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "latinosuptv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc861.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc862.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc863.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "le-cameleon.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "leemankuiper.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lelux.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -79873,7 +79592,6 @@
{ "name": "lesptitstutos.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "liborburda.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lightyear.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "liypoi.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lms-luch.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lomaem-nsk.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "londonlegaltranslation.ae", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80042,7 +79760,6 @@
{ "name": "toorl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "torrentgalaxy.to", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "toudum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tupeuxpastest.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tussier.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "twtr.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ubezpieczenia-poznan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80050,7 +79767,6 @@
{ "name": "ukriate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ultimateappreviews.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "upholsterycleanerslondon.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "urkult.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "username.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "usjunkyardsnearme.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "uv.uy", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80367,7 +80083,6 @@
{ "name": "lightningwirelabs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lincore.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "liveint.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "loveluna.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lxx4380.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lyonslawlink.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "m36533.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80436,7 +80151,6 @@
{ "name": "opsre.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "optimalrehab.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "optimumterapia.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "orphee-beaute.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ostylelimo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "overspeed.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "p36533.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80501,7 +80215,6 @@
{ "name": "sphericalvision.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spmax.design", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sprossenwand.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ssrr.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "stagemaster.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "stamboomforum.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "statuswatch.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80521,7 +80234,6 @@
{ "name": "tcgpraktijk.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "telhabrasil.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "theartistjournal.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "theindiantrip.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thelittlepeartree.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thomasbnt.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "totalemaiildelivery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80710,7 +80422,6 @@
{ "name": "breakout.careers", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "brillio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bronzew.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cadenceconstruction.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cadmax.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cairuz.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "caldersoldas.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80738,7 +80449,6 @@
{ "name": "coinvex.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "competitor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "compra-deuna.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "construction-digitale.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "couponlo.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "couriergrey.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "couriersrs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80960,7 +80670,6 @@
{ "name": "larsson-ornmark.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc0188.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc040.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc18.vip", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc1800.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc2121g.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc245.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -80970,11 +80679,7 @@
{ "name": "lc3747.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc3748.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc3778.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc3780.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc3781.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc3782.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc3799.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc3801.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc6601.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc6602.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc6603.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -81012,7 +80717,6 @@
{ "name": "lc7979.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc7979g.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8.life", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lc8.vc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8005.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8181.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lc8835.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -81755,7 +81459,6 @@
{ "name": "2y3x.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "5i.gs", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "608vets.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "77dd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "88740b.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "a2ch.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "a3mobile.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -81785,7 +81488,6 @@
{ "name": "andriraharjo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "annuaire-auto-ecole.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "antispamcloud.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "aorosora.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "apex.to", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "apirest.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "appliancepronwi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -81798,7 +81500,6 @@
{ "name": "auksnest.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "austerevisuals.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "avonvets.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "badmintonadvisor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bangkokcookingclass.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bavomaes.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "beargoggleson.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -81939,7 +81640,6 @@
{ "name": "floristik-online.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fluffy.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "flyersmarket.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "forum-4.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fotoblog.nrw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fourfourcrew.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fromtheboxoffice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -82702,7 +82402,6 @@
{ "name": "netzwerk-lq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "newyorkhiltonmidtown.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nextechoax.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nguyendiep.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "noranowak.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "notedinstyle.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nougat-anduze.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -82832,7 +82531,6 @@
{ "name": "taskhorizon.audio", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tebebo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tech4arab.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tekingb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tektouch.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "theangelfishfoundation.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "theclonker.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -82907,7 +82605,6 @@
{ "name": "yourname.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yuan.nctu.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yuxiangyuan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "zfj.la", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zhongxigo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zihun.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zngay.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -83237,7 +82934,6 @@
{ "name": "crazycube.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "creditmonkey.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cryptotrendclub.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ctor.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cuitandokter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cupcake.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "curontwerptoolgroenbeton.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -83378,7 +83074,6 @@
{ "name": "feistore.com.tw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "feng-in.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "feng-in.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "finanskredirehberi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "finsecurity.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "firstcolonyengraving.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "firstversionist.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -83697,7 +83392,6 @@
{ "name": "sjenkins.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "skipbounce.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "skysoftbg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "smcquistin.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "smithsanchez.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "soslsd.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spotlabs.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -83726,7 +83420,6 @@
{ "name": "tauerperfumes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tche.digital", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "techfishnews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "techie-show.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tennisportal.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tezwifi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thaiteaw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -83764,7 +83457,6 @@
{ "name": "uurl.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ux-solution.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "uxsto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "v-bank.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vaaes.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vastgoed-lidl.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vbezhenar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -84059,7 +83751,6 @@
{ "name": "departureboard.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "derival.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "descargarwhatsappplusgratis.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "diablocarpet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "diaconat.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "diariorp.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "digitalgyan.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -84199,7 +83890,6 @@
{ "name": "johnnybetstaging.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jonesfor.men", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jonincharacter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "jorganicsolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "journaldesvoisins.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "julian-miller.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jw.fail", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -84428,7 +84118,6 @@
{ "name": "retirementsolutionva.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "revolware.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ricardojsanchez.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "rice.id.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "richviajero.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rigintegrity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rinzler.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -84837,7 +84526,6 @@
{ "name": "flugrecht.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fourwaysplumber24-7.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "freeinfos.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "fundamentalsofaccounting.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "funidelia-tr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "funidelia.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "funidelia.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -84986,7 +84674,6 @@
{ "name": "locationfontaine.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lojastec.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lornabenes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "louiscap.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "loveni.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lovessentials.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lovink.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -85212,7 +84899,6 @@
{ "name": "wordfence.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "workinghardinit.work", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "workinnorway.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "worldwaterprojects.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wouterbruijning.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wprecommend.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wpresscoder.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -85236,7 +84922,6 @@
{ "name": "zubar.bg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zyellowbox.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "0chanru.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "0de3.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "0kun.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "10xnation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "1234888.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -85624,7 +85309,6 @@
{ "name": "ouestfrance-auto.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "outingexpert.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "oyk19bgxj8ljpete71edj2tes-9i4oai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pacificspraydry.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "palatetotable.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "panavision.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "paradisestore.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -85638,7 +85322,6 @@
{ "name": "petstoredog.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pexxi.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pinkbuff.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pishifu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pjylb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "plus15.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pochoden-praha.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -85809,7 +85492,6 @@
{ "name": "2138vip.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "222138vip.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "2345678365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "2378.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "2bet86.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "3007337.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "33138app.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -85893,7 +85575,6 @@
{ "name": "age-encryption.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agencesaintpierre.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agproducts.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "agremo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "albergolafiorita.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "alfadlmedical.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "allentertainment.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -86018,7 +85699,6 @@
{ "name": "brk.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "brujoincaperuano.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "brujonegroperuano.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "btsybt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "buhayprincipal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "buildingbitcoin.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "buzzrow.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -86162,7 +85842,6 @@
{ "name": "e-account.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "e-bap.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "e-bookshelf.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "e2a.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "e4.chat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ebill.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "echo-n.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -86174,7 +85853,6 @@
{ "name": "elarmariodelucia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elbaladshop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "elitelatinas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "email.repair", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "embebelo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "embonus.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "emmamillernovels.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -86544,7 +86222,6 @@
{ "name": "pmg-p4p.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "poemerx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "poemerx.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pollybarks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pompeii.tickets", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "popup-stores.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pornabee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87109,8 +86786,6 @@
{ "name": "mm88game.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "msieursvp.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "musings.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "my-amigo.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "my-ccleaner.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "my-photo.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "myweatherbuzz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mzitu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87235,7 +86910,6 @@
{ "name": "vitanyi.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "votra.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "w51365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "walruscode.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wangzhe100.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "watertorenstraat.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wdmcheng.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87303,7 +86977,6 @@
{ "name": "agagent.vip", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agahi90.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agds.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "agonworks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "algustionesa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aliancapelobrasil.rio.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "alimentsduquebecaumenu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87474,7 +87147,6 @@
{ "name": "matthijsvos.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maxi-corp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mayblossom.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mdhosting.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "meherbaba.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "memoriadeunaciudadzccm2019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "midrandrubbleremovals.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87525,8 +87197,6 @@
{ "name": "petitu.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "phongthuyhoangmanh.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pier1url.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pk8.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pk9.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "planettimer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "plantsupplement.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "play-the-furyu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87787,7 +87457,6 @@
{ "name": "byhenryvera.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cachchoi138bet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cake-n-go.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cakedesignsbyjaclyn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "californiamusicacademy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "camclips.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cantinhodosossegosaojose.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87811,7 +87480,6 @@
{ "name": "coondesign.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cornelia-schiemann.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "coteax.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "countrysmile.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "covert.sh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "credit-10.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crossorig.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -87856,7 +87524,6 @@
{ "name": "empreinte.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "eoy.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "epsi.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "espacioprofundo.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "etkarle.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "etutsplus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "evokewonder.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -88001,10 +87668,8 @@
{ "name": "nwh.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "o2ss.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "octopus-cs.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "odontologia-online.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "offcasesstore.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "offermann-koeln.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ohsweetart.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "onthegosystems.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "orbeimaginario.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "oshea.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -88178,7 +87843,6 @@
{ "name": "yxbet43.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yyr.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "znbr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "zoftbaby.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zusterjansen.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zwilla.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "11ag8.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -88406,7 +88070,6 @@
{ "name": "agvip2008.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agvip2013.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agvip986.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "aiden.cool", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aiwansky.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "akay.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "algoritmususpechu.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -88453,7 +88116,6 @@
{ "name": "crestasantos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crowdstack.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cubeo.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cyclowiz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "d64.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dannyrohde.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "datenschutz-gruenwald.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -88786,7 +88448,6 @@
{ "name": "zz772.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "120percent-inc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "1244546066.rsc.cdn77.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "137kb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "2x.nu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "3d-glow.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "3deni.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -88830,7 +88491,6 @@
{ "name": "affcoupon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aflattr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "afpayday.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "agambarta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agencybeam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "agripartner.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "airalamo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -89094,7 +88754,6 @@
{ "name": "disinfestazione.napoli.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "diskussionsbereich.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dlmit.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "dochub.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dolarenmexico.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dolcett.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dolphinaris.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -89275,7 +88934,6 @@
{ "name": "hinderlider.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hinota.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hiphop2gif.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "historymuseumsb.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hjallboscoutkar.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hjdiaz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hjosh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -89525,7 +89183,6 @@
{ "name": "newlegalsteroid.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "newsheaders.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nginx.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nicolasfriedli.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "night.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nineteensixtyone.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nishiyama-shoten.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -89779,7 +89436,6 @@
{ "name": "simonheung.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "simplechoicesuper.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sindastra.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sinnvoll-online.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sinvideovault.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "siri.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sitethe.best", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -90214,7 +89870,6 @@
{ "name": "cluboc.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "codeetch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "codestats.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "codezenith.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "coffeeshopsandman.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "coinmotion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "colinshark.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -90371,7 +90026,6 @@
{ "name": "fitandfightrijswijk.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "flamencoexplained.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "flatart.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "floorrestore.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "flowscale.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "force-unleashed.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "force-unleashed.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -90921,7 +90575,6 @@
{ "name": "sporthouse-valdisere.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spotonlive.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sssljohannesburg.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sstr5.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "stallardjw.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "starrymc.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "starsdream.win", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -91049,7 +90702,6 @@
{ "name": "vetscore.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vetsmarketing.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vetwebsuccess.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "vgs.computer", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "viditour-golf.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "viditour-zorg.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "visyeva.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -92613,7 +92265,6 @@
{ "name": "bbk365m.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bbk365t.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bbk365zz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bellapierre.ee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "berzkalne.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "besiktasmtsk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bestsellers.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -92851,8 +92502,6 @@
{ "name": "marketingproducts.review", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "marketwingsmobile.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "matchday.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mathleaks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mathleaks.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mauroalejandro.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "meandb.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mecp.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -92918,7 +92567,6 @@
{ "name": "pomadgw.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "priceless-jewelry.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pro100blogger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "projectvault.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prospreads.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prox.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "proxybay.uno", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -92942,7 +92590,6 @@
{ "name": "regtify.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "renewablepedia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rentamosandamios.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "romsp.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ronhose.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ross-mitchell.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rowery.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -93132,7 +92779,6 @@
{ "name": "azur.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "baity.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bangun.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "baobaojihua.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "beakbirds.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "beleadsteam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "benthanhtourist.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -93486,7 +93132,6 @@
{ "name": "arnaqueoufiable.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aszurkolassport.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "baumfreund.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "beginwp.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bio-feed.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bmotorsports.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bmros.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -93518,7 +93163,6 @@
{ "name": "do168.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dojocasts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "drryanstanton.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "duredo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "duttur.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dylanhansch.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "e2ebrindes.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -93954,7 +93598,6 @@
{ "name": "broilertrade.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "brokerstalk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "brunnenhof-welze.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "brunoarruda.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bs3xy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bsystem.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bt121.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -94367,7 +94010,6 @@
{ "name": "essethon.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "estumarca.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "eviadc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "evitacion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "exoticspecialist.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "explorecams.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "extrememusclepump.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -94579,7 +94221,6 @@
{ "name": "mokamelhaa.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "money-spell.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "moreyalta.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mossan.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "msa.bank", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "msaludasuhogar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mt-caza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -94607,7 +94248,6 @@
{ "name": "nexalis.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nextvery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nhadatpho.com.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nibrasfashion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nintendoreporters.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nkuxlogistics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "noirpvp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -95470,7 +95110,6 @@
{ "name": "arkhangelsk.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "arkhangelsk.gq", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "arkhangelsk.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "arknights.work", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "armado.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "armageddonclan.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "armandocorazones.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -98496,7 +98135,6 @@
{ "name": "hotscripting.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hotsmi.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "how-to-build-computer.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "how-to-pc.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "how-to-write-a-book.gq", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "howlers.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "howmuch.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -103308,7 +102946,6 @@
{ "name": "unusualworldd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "unwa.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "up-obmen.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "upbound.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "uploadscript.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "upmail.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "upmusics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -103881,7 +103518,6 @@
{ "name": "xice.wang", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xile.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xinja.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "xlhdh.vip", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn------7cdabibmbihbgykn8elfdbfgbeqxmlc3a.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn------7cdbfcbc0ab6akhadmzphmbibhebcc7b0ahshon.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn-----6kcbb0cahbiskdv1bcj5c7g.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -104496,7 +104132,6 @@
{ "name": "idweblog.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "igust4u-archive.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "imboom.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "infralicht.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "initiative-3d.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "insertface.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "inventaliber.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -104639,7 +104274,6 @@
{ "name": "pauct.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pchan.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pdimitrov.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "peatsuki.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "physiotherapie-kobiella.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pixelflex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "polebarn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -104825,7 +104459,6 @@
{ "name": "bigtexasbeerfest.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bitcoin-youtube.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "blackbbwvideos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "blueberrywinery.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bluheron.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "borza.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bosiquanao.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -104866,7 +104499,6 @@
{ "name": "clevyrlabs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "click4click.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "clinicasesteticas.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cloudmyhome.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cloudmyhome.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cloudmyhome.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "codetrack.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -104925,7 +104557,6 @@
{ "name": "erichoins.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "erkkiaronen.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "erulezz.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ethernia.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "etindustries.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "eve.pub", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "exaduosport.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -105047,7 +104678,6 @@
{ "name": "lasmoarquitectos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "laurabailo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lbpc.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lbph.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lechompenchaine.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "leenaluhtanen.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lefilradio.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -105502,7 +105132,6 @@
{ "name": "happywheels1.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hdmovies.blog", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "healthynutritionguide.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "heeftmijnwebsitehttpsnodig.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hermiyanto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "herychreality.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "horos.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -106244,7 +105873,6 @@
{ "name": "pokermix.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pool-selber-bauen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "porm.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "porowneo.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prelogica.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "presensio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "previous.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -106290,7 +105918,6 @@
{ "name": "sipln.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "smaden.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "smikom.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "snitch.rocks", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sntial.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "socktopus.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sophiegraceshields.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -106409,7 +106036,6 @@
{ "name": "a-colorful-life.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "abaca.bar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "acina.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "acrowebs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "adiscorduser.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "adopt.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "adrianasantos.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -106774,7 +106400,6 @@
{ "name": "progenixlab.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prosperfit.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "provinzblogger.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "pschunt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "psychotiq.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "publish.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "purestkratomusa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -106977,7 +106602,6 @@
{ "name": "artesaniaselmagodeoz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "artisansofsleep.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "artizlibranza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "asabharwal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "asalearn.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "assignmentshelp.co.ke", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "asthma-explained.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107218,7 +106842,6 @@
{ "name": "hottestguyoftech.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "howtocurekennelcough.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "htsm.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hunhee.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hushbabysleep.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hypertensionexplained.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hypno-thera.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107238,7 +106861,6 @@
{ "name": "inscomers.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "inspas.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "institut-coiffureetnature.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "international-books.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "iosbankermyanmar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "itbog.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "j5y.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107333,7 +106955,6 @@
{ "name": "mysafetygear.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mysciencecloset.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "na-n.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "naehtalente.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nakarkhana.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nako.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "narda-sts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107415,7 +107036,6 @@
{ "name": "rgb2hex.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rgfundraising.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rohitpatil.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "rosskopfs.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rostirolla.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rtl.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rtonin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107423,7 +107043,6 @@
{ "name": "rx-diet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ry88url.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sandtime.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sanemind.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sanskrit.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sb-graph.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "schwimmschule-kleine-fische.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107472,7 +107091,6 @@
{ "name": "telosotec.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "teners.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tenkiz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tf2pickup.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tfus.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thailandguru.properties", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "theanimalshadow.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107589,7 +107207,6 @@
{ "name": "asg-egy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "asianet.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "astral.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "atilo.sh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "atmydesk.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "atthehelmins.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "auk.hopto.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107601,7 +107218,6 @@
{ "name": "bellevueduilawyers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bigbeats.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bingchunmoli.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bismi.solutions", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bito3d.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "blankpage.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "blue-olive.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107614,7 +107230,6 @@
{ "name": "bravoasociados.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "burz.media", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "burz.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "burzgroup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bwmcnc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "c1cdn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "c30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107848,7 +107463,6 @@
{ "name": "marmor-resmini.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "matdesign-prod.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maxratmeyer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mc5zvezd.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mejorator.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mejorator.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mejorator.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -107909,7 +107523,6 @@
{ "name": "onlinefurniture.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "onporn.red", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "oo30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "openalgeria.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "optitaxes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "orcz.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "orsal.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -108100,7 +107713,6 @@
{ "name": "the-deep.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "theconversation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thecoorgfoundation.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "thecracks.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tietotori.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tillmanassociates.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tlroadmap.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -108137,7 +107749,6 @@
{ "name": "uyz.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "v30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vaat.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "valorantpicker.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vampireapocalypsesurvival.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vbabe.tube", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "velorail01.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -108155,7 +107766,6 @@
{ "name": "w30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wagn3r.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wainbholle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ward.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wargov.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wildbergh.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wilmingtonzen.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -108171,7 +107781,6 @@
{ "name": "ww30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "x30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xin365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "xmediz.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn--rechtsanwltin-paderborn-37b.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xx30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "y30019.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -108329,7 +107938,6 @@
{ "name": "drjungspine.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dunangel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "e5xbps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ebcfx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ebuyon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ecohousejapan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ecologiahoy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109015,7 +108623,6 @@
{ "name": "lojaonlineshop.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "loopcore.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lost-in-place.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "maianhtravel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maiotik.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maison-coutin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maksimyugai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109123,7 +108730,6 @@
{ "name": "sarkarinaukriworld.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sb-webdev.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "scan.computer", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "schwb.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "scif.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "scphotography.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "seestersmexicancantina.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109148,7 +108754,6 @@
{ "name": "soulplay.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spfl.org.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sprayontv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ssshh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "starseersprophecy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "statefundca.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "statefunddirect.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109215,7 +108820,6 @@
{ "name": "uu939.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vagabond.film", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vanessailustracoes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "veracruzti.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "viatvperu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "victoria.associates", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vincexpertconsulting.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109240,7 +108844,6 @@
{ "name": "xerbisworks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xiaobai.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn----7sbq4auch5b4b.xn--p1ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "xn--6n2ao17b.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn--c1aapkosapc.xn--80asehdb", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn--dy-via.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xpertsunlimited.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109249,7 +108852,6 @@
{ "name": "xpsauto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xpsautomation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xvaldezendocrino.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "xyz.blue", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yamanami.tokyo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yourcrypto.tax", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zamtech.co.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109292,7 +108894,6 @@
{ "name": "auxessenceselfiques.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "awoau.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bakerbasements.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bamheroes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bcome.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "beauty92.com.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "beautyest.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109428,7 +109029,6 @@
{ "name": "grupo-zoom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gsa-online.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gsaauctions.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "habana.ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hdevent.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hekoro.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "heliumbrno.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109592,7 +109192,6 @@
{ "name": "presgrp.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "private-relay.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "privatepilot.lu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "prospect1838.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "putchiconsultorias.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rahulgupta.co.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ranters.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109892,7 +109491,6 @@
{ "name": "ferad.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fernandezvilar.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fibune.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "findcheap.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fleeb.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "flowlytics.host", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fn-0.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109934,7 +109532,6 @@
{ "name": "illuminaterecovery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "immijobs.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "immobilier-swiss.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "immoe.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "inoreader.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "instaart.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "invisitone.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -109957,7 +109554,6 @@
{ "name": "kimino-school.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kinetikos.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kiseki.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "kitaplus.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kreuzbergflieger.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kstasinos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "labels.co.ke", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110185,7 +109781,6 @@
{ "name": "twilo-host.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "txyz.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "typesofdogs.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ubsolutions.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "unblockedgames.live", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "up.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "uradvd.best", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110241,7 +109836,6 @@
{ "name": "zotan.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zotan.network", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zotan.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "17avolemsaberlaveritat.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "2vp-an.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "360kuvia.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "360prokuvat.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110313,7 +109907,6 @@
{ "name": "cardschat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "carevo.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "carsonkoziol.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "caumont-normandie.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cbcf.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cbd-oil.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ccaguavivadonaciones.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110440,7 +110033,6 @@
{ "name": "gentlentgroup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ggld.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gharbala.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ghyvelde.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gloryhere.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "glpreparation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gms-records.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110494,7 +110086,6 @@
{ "name": "kadmirra.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kaleylocks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kalpavriksh.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "karting-normandie.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kennedy.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kennedy.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kinderosteopathie-osteopathie.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110513,7 +110104,6 @@
{ "name": "kryptoforce.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "la-vraie-histoire.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "laby.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lacatta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lamaturitadidaniele.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lambda-calculus.church", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "leidegoncalves.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110562,7 +110152,6 @@
{ "name": "mineralnibani.bg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "minetrack.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "modulkuhni.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mon-dolibarr.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "monidenum.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "moustream.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "muellercustombuild.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110598,7 +110187,6 @@
{ "name": "notrero13.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "npc-ts.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "offgridbound.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "office-dolmetscher-scharnagl.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "okmaybe.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "olajcbd.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "oofishing.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110739,7 +110327,6 @@
{ "name": "triedandtruebytrista.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "trussgenius.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tryin.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ts3.ink", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tschang.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ubetoo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "unblockit.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110859,7 +110446,6 @@
{ "name": "bent-nails.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "besate.ec", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bgm.bg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bieville-beuville.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bigcountry.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "biocbdolej.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "biocbdolja.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110869,7 +110455,6 @@
{ "name": "blockexplorer.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "blockfi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "boostplm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bouville.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "brownwrapper.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "buggiano.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bunbun.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -110916,7 +110501,6 @@
{ "name": "couplesapp.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cpgiiaragon.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "craftyproducts.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cresserons.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cristaleslitios.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cronjob.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cryptoeighty.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111226,8 +110810,6 @@
{ "name": "rioinbox.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "riverdale.net.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rurian-gyohen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "saint-aubin-sur-scie.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "saint-leonard.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sakiborislam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "samanexports.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sechssiwwe.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111304,11 +110886,9 @@
{ "name": "vedshastradata.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "velocitycu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "venturebum.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "veules-les-roses.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vfxstudy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "viera.pe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "viewpointsfromfacebook.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "villers-ecalles.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vinc.name.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "voetbalquizkopen.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vogue.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111343,7 +110923,6 @@
{ "name": "ysoft.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zappy.wtf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zero-skill.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "zigao.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "12gramu.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "1ii.im", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "2isk.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111457,7 +111036,6 @@
{ "name": "cupomia.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cyric.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dafunda.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "dalat.blog", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "darxx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "debut-mebel.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "decorations-elmotamaiz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111519,7 +111097,6 @@
{ "name": "flibanserina.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "foodyshoody.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "foro.red", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "fotografoivanalmeida.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "freebasics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "funtimeusabiloxi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gabe.download", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111553,7 +111130,6 @@
{ "name": "hiker.cool", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hirosehp.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hispasys.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hitechweirdo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hochstift-party.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "holdmybeer.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "holywr.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111757,7 +111333,6 @@
{ "name": "productivemachine.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prosperos-services.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "prostaglandina.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "psd2.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pvpzone.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "pylad.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "quacc.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -111878,7 +111453,6 @@
{ "name": "twilightscans.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "twojajurata.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "udemydownload.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ulement.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "umaykan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "umo.ci", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "unblockit.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112234,7 +111808,6 @@
{ "name": "leleimports.store", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "levis.name", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "levisenlaw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lifeskills-education.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lindazi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "linkinsta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "livinkitchen.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112352,7 +111925,6 @@
{ "name": "ripplenews.world", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ripplenews.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rjicpas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "rodrydesign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roofdoctorutah.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roolnews.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rosdpk.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112361,7 +111933,6 @@
{ "name": "rydeify.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "samurai-implant.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sanin.gq", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sankyo-sys.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sapienza-eclipse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sapienzaconsulting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "scindustries.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112389,7 +111960,6 @@
{ "name": "spacelandpark.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "stad.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "stanzolo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "startnowmakingmoneyonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "startup-lab.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "steamcleaning.expert", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "steamid.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112448,7 +112018,6 @@
{ "name": "tronnews.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tryingtotakeoversweden.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ttwt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "twigandolive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ucero.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ultimadivisao.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "uniekglas.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112643,7 +112212,6 @@
{ "name": "dollarhero.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dolys.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "donarmany.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "doodlebeads.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "drillcalendar.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "driveral.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "droidtuto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112694,7 +112262,6 @@
{ "name": "franchiseguide.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "francuskie.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "freenetflow.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "freethehustle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ftx.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "funreaktor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fureais.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112732,7 +112299,6 @@
{ "name": "hardhatengineer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "harrisexteriors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "helco.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "helpwaarbenik.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hkl-gruppe.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hoistsdirect.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "holyfamilychurch.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -112969,7 +112535,6 @@
{ "name": "satyamshivamsundaram.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "saul-eslake.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "savewithtrove.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sayurstock.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "scoresensei.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sdelatmrt.spb.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "secrets-marketing.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113027,7 +112592,6 @@
{ "name": "surnet.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sylino.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "t-dent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "tacworldusa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tafusu-support.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tappyshop.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "taylored.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113040,7 +112604,6 @@
{ "name": "thediabetesnews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thegoodheartedwoman.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "theracismforum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "thinkscar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "threatdetection.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tinkmai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tobyx.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113264,7 +112827,6 @@
{ "name": "duval.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "duval.pm", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "duval.re", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "dvn.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ecampusontario.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ecgclic.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ekoclin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113278,7 +112840,6 @@
{ "name": "epicapos.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "er.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "erinmyers.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "eucimen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "everaerts.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "eyesee.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "faceyogaforyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113291,7 +112852,6 @@
{ "name": "firstbaptistjeff.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "firstclass.com.kh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "firstmarket.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "fitnessrogue.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fivefortheroad.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fiveloaves.life", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fleetster.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113649,7 +113209,6 @@
{ "name": "topupandearn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "totnhatvina.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tpnky.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "trimtone.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tripguide.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tusupermercado.pe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tuzor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113763,7 +113322,6 @@
{ "name": "bazarfds.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "behavhealth.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "beko.ie", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bestkitchenbuy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bet031.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bet531.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bet631.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113786,7 +113344,6 @@
{ "name": "byteultra.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "byw.cymru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "c-rpg.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "c52iv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "calibracionhd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "calixa.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "callamnow.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -113798,7 +113355,6 @@
{ "name": "case3d.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "catchall.tw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "celebphotos.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "celebrities.pictures", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cendis.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cerbottana.duckdns.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cgmagonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -114144,7 +113700,6 @@
{ "name": "spacecovers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "speakermatch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spyse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ssslinstallers.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "start-school.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "steelfirm.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "stefamedia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -114197,7 +113752,6 @@
{ "name": "trilhasdeconhecimentos.etc.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "trimental.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "troubleshooter.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ts3.gs", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "tubemaze.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "turkup.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "turlewicz.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -114506,7 +114060,6 @@
{ "name": "guiadeprofesionales.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "guiaminhasaude.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "guiaturismovallarta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "guusu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "handyoutdoorgoods.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "havendetoxnow.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hbr.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -114591,7 +114144,6 @@
{ "name": "meaqua.love", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "medidordecampo.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "metalmonocle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "michaelglaser.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "milr.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "minermonitoring.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "misclick.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -114680,7 +114232,6 @@
{ "name": "risecomedy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rixcloud.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rockset.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ropingsupply.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rtestore.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "saludakeuring.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "saygoodbyetoie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -114794,7 +114345,6 @@
{ "name": "xion.nu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xn--6m1a86p.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "xvpn.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "xxzacg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yardandgardenguru.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yasminedewolf.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yousifsaeed.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -114862,7 +114412,6 @@
{ "name": "betawi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bhacit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "binproz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "biocbd.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bitcoinissafe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "blankhang.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "blender.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -115035,7 +114584,6 @@
{ "name": "lojavirtualinfopaper.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "louiselaliberte.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lynkmi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "maashoefer.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "magdafornal.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "magicalminkies.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "maratonsports.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -115157,7 +114705,6 @@
{ "name": "speakeasy.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "spike.sh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "star.my.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "storlead.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sudoash.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sumit.blog", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sunroomsbywoodland.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -115202,7 +114749,6 @@
{ "name": "veosvending.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "verdeplus.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vidimte.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "vive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "voinuocsago.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vov.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "w-e-b--s-e-o.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -115362,7 +114908,6 @@
{ "name": "devensys.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "devs.men", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "diadoc.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "digitalstudios.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dikant.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "disougstroy.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "distributed.cafe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -115487,7 +115032,6 @@
{ "name": "ireiguam.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "isekaimaid.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ivs-romania.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "janitorutah.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jaydensar.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jaynestephenson.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jmanalansan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -115577,7 +115121,6 @@
{ "name": "nedcv.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nehnutelnosti.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "neighbor.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nerdmachina.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nesheimswaterrestoration.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "netrustcontractor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "neurologysantamonica.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -116180,8 +115723,6 @@
{ "name": "fedshat.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "feirasexpomadeonline.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fersan.pe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "fertilityspace.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "fidelitybank.ng", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fifaaddict.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "filehorsefile.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "financialhost.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -116228,7 +115769,6 @@
{ "name": "fun-life.com.tw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "furlan.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fusionstudios.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "futiwolf.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "futureofsex.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fztsoru.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "gadgetadvisor.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -116373,7 +115913,6 @@
{ "name": "jeremyrobinlyons.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jetcost.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jobig.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "jobkaka.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jointechforce.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jonathanrobichaud.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jpegshare.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -116425,7 +115964,6 @@
{ "name": "kwik.cx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "l9297.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "laboiteasous.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "labworks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lacnesidlo.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ladige.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lamergameryt.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -116490,7 +116028,6 @@
{ "name": "marisolcu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "marketingmind.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "marketplace.tf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "markha.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "matejkosiarcik.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "materi.co.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mathieugrant.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -116746,7 +116283,6 @@
{ "name": "sexonv.mobi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shakardara.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shapingthebay.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "sharebee.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shiuki.eu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shop-links.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shopshap.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -116968,7 +116504,6 @@
{ "name": "yourkit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yourrenaissancemedspa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "youthopportunitieshub.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "yoys.ae", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "yuksinau.co.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "z.cash", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zagorod.spb.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117017,7 +116552,6 @@
{ "name": "aprofunda.art.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "aquacitylands.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "arbolesdenavidad.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "arifpurnama.my.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "arpasix.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "arpasix.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "arpasix.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117040,7 +116574,6 @@
{ "name": "billy.wales", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "binabangsaschool.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "biologichemp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "biomon.lt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bioselect.com.cy", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "biuaxia.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "blastoise186.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117222,13 +116755,11 @@
{ "name": "laptopcloseout.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "laricameche.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lcwebsite.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "leesa.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lefroyee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "leontworzy.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lepalierjuridique.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "letsbrand-holding.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "letsbrand-holding.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "letsbrandholding.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "letsbrandholding.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "letweedoo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "levelninehvac.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117239,7 +116770,6 @@
{ "name": "limc.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "liveandinvestoverseas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lleidanoticies.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "lojameuredentorvive.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "lovelyfamilymm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "luparacoes.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "luxegram.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117260,7 +116790,6 @@
{ "name": "miltau.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "miltau.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mindera.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "miniso.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "miniso.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "missouriheatingcoolingadvice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "missyapartman.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117399,7 +116928,6 @@
{ "name": "tutorials.eu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "twidy.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ucphotography.net.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "um.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "urologyspecialistspc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vante.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vilgain.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117498,7 +117026,6 @@
{ "name": "berightthere.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "betantt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "beykozmekan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "bikriads.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "bonusdigital.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "boxofninjas.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "brandt.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117525,7 +117052,6 @@
{ "name": "clarins-unlimited.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cloudprints.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cmsdca.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "cncn3.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "codelistbd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "coenraets.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "colegioalemanmcbo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117701,7 +117227,6 @@
{ "name": "mediaweb.com.ve", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "melikecapkin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mendosuits.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "miaovps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "michaelwmckinney.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "minimal-website.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mission-gesundheit.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -117724,7 +117249,6 @@
{ "name": "npath.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nrf.co.ke", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "nutrindoideias.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "nutsforfruits.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "oase-fuer-wohlbefinden.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "obalky-obaly.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ocsamochodu.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118011,7 +117535,6 @@
{ "name": "darcyinspired.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "denizsartdiary.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "designconformitylibrary.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "desiskinscience.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dieselfiltersonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "digi-tec.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dijitalzade.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118103,7 +117626,6 @@
{ "name": "inwerx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "iqtek.solutions", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "iriscddg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "ivetdata.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jaredkunz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jave.asia", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "jetlaggroup.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118158,7 +117680,6 @@
{ "name": "mayflowerfairytales.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mcsdatum.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mdcallianceparty.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "mdnailspa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "medicardlimited.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "meetanshi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "megalogi.ma", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118169,7 +117690,6 @@
{ "name": "microl.ink", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "midnightcity.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "miku.bar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "milon-apps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mindthe5.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "mindthe5.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "minka.net.bo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118206,7 +117726,6 @@
{ "name": "openchronicles.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "opticamasvision.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "originalgyms.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "owncloud.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "paclease.com.my", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "paganismguide.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "paintlabcustom.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118308,7 +117827,6 @@
{ "name": "thecigarlibrary.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "theeuropeanlibrary.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thehomeofthefuture.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "thehorsesadvocate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "themevilles.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thevirtuousdog.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "thewebguru.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118360,11 +117878,9 @@
{ "name": "vanvanlines.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vashmatrass.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vineethavarma.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "vlice.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wadebet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wake.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wartabangsa.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "waukeshairon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wealthyspeakerschool.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wearesuma.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "wemakeit.live", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118396,8 +117912,6 @@
{ "name": "4929.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "4kvids.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "4web.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "808hao.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "a-fx.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "a-r-t-house.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "acahaymarket.com.ec", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "acgfuli.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118470,7 +117984,6 @@
{ "name": "classyhandmade.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "clever-fit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "clgb.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "code1llp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "code4u.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "compraenpijama.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "comprax.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118501,7 +118014,6 @@
{ "name": "discuss-data.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dollanid.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "drkansal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "dynamitejobs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "dzimchuk.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ebusiness724.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "edv-biela.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118577,7 +118089,6 @@
{ "name": "indomanila.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "innova360.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "instacredito.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "insurancemarketingcoach.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "investingent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "invidiou.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "itbrief.asia", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118594,7 +118105,6 @@
{ "name": "kazy111.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "keepitsimplebitcoin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kekarimi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "kieyne.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kingcourriel.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kinvault.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "klimaatkids.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118604,9 +118114,7 @@
{ "name": "kontur-buhta.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "koobin.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "koobin.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "kora-pluss.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kottbulle.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "kriptodede.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kritical.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kubota.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "kubotagear.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118876,7 +118384,6 @@
{ "name": "carimcoder.website", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "casadilanga.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "catcat.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "catpic.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "catpumpsonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "certreg.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "chaoxi.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118898,12 +118405,10 @@
{ "name": "codedbyjim.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "comercialtech.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "comisarul.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "conservativecore.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "corvaglia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cotejardin.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "councilwise.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "cpaporttraining.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "craveativemedia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "creatapeak.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crowdstrike.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "crypt-app.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118949,7 +118454,6 @@
{ "name": "exact-online-apps-by-invantive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "experimentrak.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "experimetrix.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "extrabits.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fackovcova.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fackovec.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "fan911.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -118999,12 +118503,10 @@
{ "name": "gsiw.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "guanggaonet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hackathonjr.tw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "haigle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "happywater.my", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hax.sc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "healthyfoodster.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "healthykitchen33.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "hermitant.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hifly.aero", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hipo.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "hodor-stage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -119127,7 +118629,6 @@
{ "name": "onporn.tube", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "onthewaypodcast.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "operd.gob.do", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "opinandosannicolas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ostendus.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "oudedokken.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ours-tudio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -119178,12 +118679,10 @@
{ "name": "rentnow.my", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rico-j.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "ricreare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "riku.la", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roi-project.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "roi-project.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rot256.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rtc-israel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "rust.pm", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "rvecomercio.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "s20121946.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "safetymeasuresas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -119200,7 +118699,6 @@
{ "name": "sedirector.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sensitidolls.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "seo.services", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "shareiva.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "shira-diamonds.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "sintpietersabdijgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "slalix.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -119267,7 +118765,6 @@
{ "name": "unikainfocom.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "uyuniscooterluggage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "vaneyckexpo.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
- { "name": "varoscak.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "verhaltenstherapie-weiden.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "verius.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "viasyscorp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
@@ -119305,6 +118802,2785 @@
{ "name": "zorox.sex", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zporno.sex", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
{ "name": "zz.gy", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "104.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "14technology.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "2-euromuenzen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "3987.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "3dagentur.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "4peace.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aalvarezs.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abandoned.photo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aboticaprodutosnaturais.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abplive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "absb.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "access-odata.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "adomicilio.gt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "adscambodia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ae86.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aeolservice.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "afas-apps.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aisteru.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akhepcat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akiekintveld.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akinokae.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alanonsantabarbara.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alaskacruises.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alles-kan.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alleskan.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "allesuitdekast.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "allureonparkway.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alternative-reussite.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anasaci.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anja-vastgoed.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anneeden.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ansellchallenge.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "apartamentscalpatoi.cat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "apex-parts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "apfnxg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "appdrafter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "appfolio.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aqiqahpremium.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arabi-online.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "argentinaxp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "asecus.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "astrophena.name", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "attain.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "auify.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "australianairbrushedtattoos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "balibells.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bancoserfinanza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "banglatypography.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "baysideaba.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bazar.bg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "belmundo.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "belmundo.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "benee-awraham.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "berela.com.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beroepenhuis.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestliege.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestofdrama.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bigeasyfences.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "biokemonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blauequelle.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bluetroodon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bootlesshacker.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "borman.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "brandweergent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bsf-knowledgecity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "btraviswrightmps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "businessdrive.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "butcherpaxtattoo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "calvadia.duckdns.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "catme.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cbca.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ccdiscussion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ccdlab.ooo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ccpaas.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chadoisaac.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chamber.sa", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cheyennelohnen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "christopherpfister.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chromebookcompare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clevyr.ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cloudandco.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cmfcuro.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cocula.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "code9000.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cogknockers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "commonapp.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "company-info-plugins.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "compareicomprei.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "contentyouproductions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cottica-kwaka.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "covid19.gov.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "creditkarma.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "crescentcityironworks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "crowdfavorite.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cruisecheap.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cruiseguy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "csarchispace.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "csimarket.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "csitarz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "css-krebs.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cultuurinonderwijs.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cursive.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "customhash.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cxda.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cyberinc.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cybernest.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cybertik.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cycling74.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dachshundtalk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dashboard.gov.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dashboardph.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dashboardphilippines.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "data-access-point.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "data-loader.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "data-replicator.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "data-replicator.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "database-excel-integration.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "database-word-integration.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "databasedrivers.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "datnenhamiltongarden.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ddjia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dealstream.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "decathlon.com.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "defenceenterprise.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "defietsambassade.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "defietsambassadegent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "delawarehousebuyers.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "devinslick.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dewingerdfreinet.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dfwm.vote", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dfwmv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dfwmv.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dfwmv.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "difc.ae", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dld.to", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dmwaste.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "docsend.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dokidokimodding.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "domowejroboty.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfuckwithmy.vote", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfuckwithmyvote.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfuckwithmyvote.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfuckwithmyvote.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfuckwithmyvote.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfwithmy.vote", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfwithmyvote.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfwithmyvote.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfwithmyvote.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontfwithmyvote.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "draakjefosfor.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dragonfosfor.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "drivesly.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "e-servicerms.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ecovetawindoors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eduroam.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eemoor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eko-vitalis.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eljay.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "elontime.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "emaratalyoum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "endzeit-architekten.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "energozrouti.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "enotecabortone.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eredmenye.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "es-sicherheit.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "espirituracer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "esportslac.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "essentielsduweb.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "euro.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ewatchers.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eworkflow.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "extremecleaning.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ezshopper.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "faapart107certifiedpilot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fabiobarros.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "faboolus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "feedclean.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fietsambassadegent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "finance-equation.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "findenmed.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "findmespot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "finvantive.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fixfix.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "flagma.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "flagma.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "flagma.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "flashlearners.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "foodsavers.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "foodsaversgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "forsigo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fortnite.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "forzamotorsport.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fraservalleyhotdog.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "free-sql-query-tool.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "freshdesk-apps-by-invantive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fuiveningent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fumo.reisen", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gabrielg.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gameship.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "geestelijkgezondgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "genealog.ong.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentblogt.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentbrugsemeersen.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentcongres.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentcongres.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentcongres.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentevenement.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentsefeesten.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentsefeesten.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentslimopweg.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentverwent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "get-my-report.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ghentfilmoffice.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ghentlivinglab.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gidive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gitlab-apps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "globalstar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "glorycamrealty.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "go-site.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "goldenowl.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gorodrabot.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "goskills.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "graceikahu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gravensteengent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "greatergood.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gruppa.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gsiw.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "guidesetc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "h6p.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "h8p.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hairmitage.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hastavem.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "havohravo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hawat.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "help-me.today", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hens.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hhxiaozhan.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "himg.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hirtz.pm", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hof-rijnland.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "holdport.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "homecinema-fr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hulpverleningszonecentrum.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hunterpetstore.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "icesemulator.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "icruise.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ideditorial.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iis.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "imamenu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "immortalcorporation.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "immortol.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "indianarmy.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "infintechdesigns.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inglesfoco.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-for-dynamics-crm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-for-magento.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-for-nmbrs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-for-salesforce.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-for-stackoverflow.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-voor-exact-online.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-voor-loket.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive-apps-voor-xml-auditfiles.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "invantive.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ironraven.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iu.edu.sa", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jandesign.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "javedhasrat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jeremy.codes", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jongenwijs.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "joshu.am", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "justin3d.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "justyardsign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kaibinyang.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "katewrightmba.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "khimno.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "khotool.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kinderopvang.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kingfast.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kingfin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "klapty.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "knabden.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ku.ag", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kylinseating.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "labambi.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "laginghanda.gov.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lamei-group.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leadgem.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lekota.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lenczewski.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lennar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lepkov.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lez2020.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lez2020.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lichtfestivalghent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lindbladcruises.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "liuqiao.pp.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "livinglab.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lligwy.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "loackerbusiness.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lucasferraz.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lumpov.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lyricfind.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "macioszektv.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "madisonivy.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maeterlinck100.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maisonanimale.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maizuru-ongaku-kan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "makasetesan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "makhmudov.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mariowiki.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maximemalfoy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mealsnmemories.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "meayne.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "meiersmarkus.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "meldjeaan.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "memorablewords.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mendix-apps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mgriff.id.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "miatgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "midasauctions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "millikart.az", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mirdon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mobiliteitgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mobiliteitsbedrijfstadgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mobitracker.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "modul8r.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "montserrat.ind.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "movedigital.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "munkavedelemaruhaz.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mycoordinates.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mylearners.vic.gov.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "myrealestateautomation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mzrme.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nagara.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "naranonsantabarbara.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nassconorfolk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "neemo.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nelefon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nerwa.vic.gov.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "newmeproducts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nhsinform.scot", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nmegent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nolaautomotiverepairs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nomio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "npgcdn.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nvsp.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nyawork.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nyfurnitureoutlets.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "octopus-apps.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "of2106.dnsalias.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oldcraft-mc.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oliverjoss.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onderwijscentrum.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onderwijscentrumgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "online-sql-editor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onrealt.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "openarchivaris.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "orionadvisor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oshens.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ov-chipkaart.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "palletsprojects.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pampers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "passgamer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pastelpixels.studio", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "paypodo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pbo.vic.gov.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "perceptionsaestheticspa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pggalleria.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pisearch.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pleiar.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pleier.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pocketdeer.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "politiegent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "popimed.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "povar.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "preserverollinspass.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "priestessbali.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "prm-parken.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "projectguru.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "promodoble.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pt4.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "puzzleetc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "qfes.qld.gov.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "quickjobsfinder.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rajivdeepinsights.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rasmushaslund.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rawbeautysource.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rbs.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "redcarpetmonday.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "regentcruises.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "regional-rabatt.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "remwhile.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "resellrefreshrepeat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "resmigazete.gov.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "restic.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "richandsteph.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "richandsteph.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ripplemarkeg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rollinspass.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "roostminneapolis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rsc.wiki", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rspevents.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ruimtevoor.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sacredsecondhandbooks.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "salebaba.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "saralmai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scrap-car-removal.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sdguitdagingen.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sdipolanight.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "searchlight.community", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seashkey.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "securesuite.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seoified.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seu.edu.sa", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sevenwizes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sglazov.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shareiva.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sharren.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shortbread.systems", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "simplonevents.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sintbaafsabdij.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sintbaafsabdijgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sjout.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "skyterraembrace.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "slimblogger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smartcar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "soldamontanhabeachwear.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sonimei.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sorbire.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "soulconstructors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sounm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "spcollege.edu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "speaklikeapro.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "speeli.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sql-query-tool.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sslsecureproxy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stadgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stadspaleizengent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stamgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "steeble.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stem16plus.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stolarstvi-jiriholy.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "studentenmobiliteit.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "studiofpvet.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stylearray.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "successminds.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sven.ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "swha.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "symlink.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "system.md", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tagarelaskidseteens.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "teachoo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "teamleader-apps-by-invantive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tecart.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "techcult.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "techguidereview.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "technavio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "teeshirtspace.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "teml.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tercosdemaria.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "theitaliantimes.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thekitchenfarnborough.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thewrightflyer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thiasil.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timespreader.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timotheeduran.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tinyhousesforsale-us.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tiwilandcouncil.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tolbertmgmt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "toulis.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "translit.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trendyindi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trevacez.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tridena.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "triplesixdesigns.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tripoutside.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trungtamvipkids.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "turkmenistanairlines.tm", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tutiendadebdsm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tutormedia.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "twinfield-apps.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "two-step-verification.solutions", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ubcutah.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "udid.fyi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ujustsee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "unikrnb2b.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "unleashfido.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "valuta-tools.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "varna-airport.bg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "velosity.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "visitgent.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "visma-apps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "visualstories.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vivablogger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vredesregister.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vredesregister.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "water.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wayficdesign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "webiroha.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "webkitchen.kiev.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wehealasone.gov.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "weladee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wideweb.host", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "willocks.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wishpets.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wmcpaphysicians.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wmphonline.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wmphvacations.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "woutiscoding.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wsjf.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wuxian.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xbox-mag.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xlaw.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn------8cdbtj4bleaohnv2bl3cuy.xn--p1ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn--contrasea-s6a.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn--d1acfdr6h.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yarnandy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yetivisite.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yishizuo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yolks.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yolosh.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yournextagency.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "youthingovernment.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zorgenvoorjean.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zuffel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zulihome.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "0011011.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "01337.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "0xacab.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1234.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "129.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "136book.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "14er.games", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "14er.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "14er.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "16321.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "16345.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "166killearn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xbet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xbet.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xbet.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xbet.ke", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xbet.kz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xtranslate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "2113.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "22bet.ng", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "233333.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "3accounts.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "3dranger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "3os.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "3ringenieria.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "50plusmusikfestival.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "592tk.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-actor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-busty.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-gokan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-hitoduma.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-moe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-shirouto.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-up.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a163.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aaacomms.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aalvarezs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aaronqueen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aarons.law", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abhayaranya.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abilenemachine.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "absolutebritney.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "academiaoposicionescorreos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "acedstudy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "acl-desing.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "advbizintel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aegisaccounting.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "affumico.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ahl.gov.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aidoru.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "airconsandton.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "airportstuttgart.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "airpost.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aitci.com.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akbtv.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akinlau.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akouryy.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aktivpark-lumdatal.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "albertovr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alicedepret.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alignthoughts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alles.cx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "almamarket.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alphabeta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "am-i-on-am-i-on-drugs-dot-com.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "am-i-on-drugs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "americamilitar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amilcalcados.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amiondrugs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amisoft.co.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amlakresan.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anchr.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "andrecanuto.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "androidhub.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "andropia-online.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aneutrallife.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "angelefloramendy.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "angione.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "antonmcclure.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ao6.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "appliedenglish.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aralys.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arianagrande.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armadalelearningpathways.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armanddesign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armanddesign.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armandmusic.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arminreiter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armoedebeleidgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "artbalsam.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arytmicznie.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "atsugi-saisyuusyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aurika.ag", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "autoleaders.gr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "avogel.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aydesignco.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "b144.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "b4a-learn.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "babyanywhere.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "baindayman.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bampizza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bauer-reininghorses.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bcomm.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beastshirt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beeldbankgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beemenergy.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beer-sheva.city", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "behmmjc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bendelllawfirm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "benhoeg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "benjamorphism.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beonas.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bergtoldtrimcarpentry.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "berkbrands.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "best-ergonomic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bet-platform.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "betandyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "biabop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "biden-scandal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "binhdang.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bittounsi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bjelimici.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blatnice.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blauwgras.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blist.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blogyaren.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "boip.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "boldlegal.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bombo.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bompus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bonfloss.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "boxethaishop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "brard.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bridgecobuilders.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "brightesttv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "brio.news", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "britney-galaxy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "britneyuniverse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "brokgency.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "brunettipesco.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bubbelwafel.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "builterra2.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bumblebeekids.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bumblebeekids.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bytebe.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cabosaferide.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "carboneventsupport.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "carboneventsupport.lu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "carbonsupportcofabel.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "carmeny.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "casinhapratica.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cbmanager.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ccaag.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ccu.in.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cdkrot.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cdrom.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cecamericas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "centurion-it.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "certprep.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "certpro.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cfent.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cfo4you.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chiron.care", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "christ.cm", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "christiangaro.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "churchofpop.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cibercheck.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "citycardgante.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "citycardghent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clarkaesthetics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clinicaschirmer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clintburnett.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "codebreakers.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "collectifitness.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "colossalfoods.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "comealong.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "comeros.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "comfis.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "comunicazionenellaristorazione.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "concern.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "condenast.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "conduitzw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "congressmankirk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "connecto.digital", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "conteelegant.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "coral-study.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "craftychameleonbar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cran-automobiles.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "creativecityofmusic.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "crex24.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "crimsonlettersmusic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "csdisaster.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "csx.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ctsl.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cuentadias.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cujubimnoticias.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "custompoolsbydesign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cutter.li", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dabbingtee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "danielwelty.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "danwelty.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "danwelty.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "danwelty.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "danwelty.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "darkgrid.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "darkillusion.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "darnashop.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dbs.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dcorporation.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "de.vg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dealbenzbkk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "debijloke.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "demsh.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "densocean.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "design2u.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "detailingsp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "detectro.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "devsdata.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "devyanijayakar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dewereldvankina.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "diadora-media.hr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "didier-equipereussite.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "didierfle-decibel.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "didierfle-latelier.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "didierfle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digifloat.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digitalandsocialmediaacademy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digitalecom.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digitalfoodbook.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digitalpiloten.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digitizer.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dimi-inside.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "divelyon.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "djvintagevinyl.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dlsolutions-inc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dmramp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dochub.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dolinathome.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dolmeningenieria.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "domain.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "domucmayintainha.com.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "donteffwithmyvote.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "donteffwithmyvote.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "donteffwithmyvote.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontefwithmyvote.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontefwithmyvote.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dontefwithmyvote.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dotsmesh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dreieich.schule", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "drkashany.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "drone-mapping.expert", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "drslawfirm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "duffau.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "duna.com.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dvn.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dynamic-movie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dynamicpl.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dynamicplus.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "e-branchekoden.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eajglobal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eastcairo-egypt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ebabis.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ebcue.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ebipl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "echidna.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ecup.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eczanemheryerde.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "editorweb360.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "edman007.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "edr-d.expert", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "edwardscommercialcleaning.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eekelen.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "efay.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "effortlesshr.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "einomanner.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "electionrunners.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "electricgypsies.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "elementoraddons.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "elevationplumbingandheating.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "elinetv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "elizabethmacdonaldbooks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "elrincondeleer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "emgroup.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "emilieporte.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "emoji.web.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "emotebank.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "emperors.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "englishwithmrsann.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "enlightsec.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eplayer.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eplayer.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "erctra.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "erlebe-salsa.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "erobook.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "escrowalliance.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "esm.run", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "espenandersen.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eucybernet.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "everythinglidia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "examesrush.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "excellence.corsica", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "executivecatering.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "expandtheroom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "expertly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "expovivienda.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fairtradegemeentegent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fer.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "festivaldelumieresgand.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "finditalldirectory.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "findom.network", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "floodheroessaltlakecity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "floria.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fluffypuff.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "flwrightwichita.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "foldnfly.travel", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "forhers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "formommiesbymommy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "formsmarts.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "formvibes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fossildlp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fourstrategy.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "foxbenjaminfox.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "freebonusmembership.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "freundeskreis-tarjan.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fronteimoveis.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fuku-fashion.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "funeraire-365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "funeral-365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "futieltextiel.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fxstock.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "galefacialplastics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "game-garage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gardtools.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "garo.directory", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gavr.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gavr.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gazetekarinca.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gconstruction.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gdpr365.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "geekgao.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "geeksforrent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gekleurdverleden.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "genhu.com.ar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentcongres.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentcreativecityofmusic.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentengarde.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gentseondernemersdagen.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "genuinebackup.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "getwsodo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ghada.blog", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ghentlichtfestival.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "giftedhealthcare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "giga.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gladiium.store", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "globalbusinessrisk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "globalpandemictools.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "globotech.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gnula2.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "goabase.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "goabase.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "goerdeler-alumni-club.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "goetheschule-giessen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gotoeat-aichi.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "greciahora.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gsa.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gsaadvantage.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gscgh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "guaranteedservice.company", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gyefund.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gyefund.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "h2orto.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "habrastorage.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "happicollective.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "happyland.link", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hartmann-hartmann.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hatierchinois.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hcr2bot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "healthyhomeventilation.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hello-design.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "henryishax.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hentai.baby", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hexagon.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hexo.ink", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hierden-bosch.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hiperbusinessblog.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hipersuli.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "historichousesghent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hivekey.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hivekey.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hoeheterobenjij.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hollyworks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "homedecorspecialists.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "housestationlive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "howardhannava.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hsg-lumdatal.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hubanero.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "huisaandecosta.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hurrikane.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hustl.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hyperian.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hzwc.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "i-on.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iamafricacampaign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iamafricacampaign.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iclb.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ideal.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "identifytag.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ienakacs.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "illumini.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "implantesdentalestopete.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inesnutricion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inffin-portal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ingroxd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "innovationrealtygrp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "intechdaybcp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "integra-belgium.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "intelx.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "intercomp-cbu.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inuevostiempos.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "investinghent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ionnex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iransculpture.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "isoq.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "it.com.eg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "itgeeks.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "itshealthtea.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "itzine.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iventuresolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "j0hn.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jack.fr.eu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jackhammerinteractive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jacobpleiness.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jamesonmelbye.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "janakifoods.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jands.co.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jardinesimperiales.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jci.me.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jci.name", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jci.org.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jcinet.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jcinet.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jdecommastermind.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jeugdraad.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jivanplastics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "johny.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "josien.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jp-aic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "judgefuszmediation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jumping4all.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jumping4all.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jumping4all.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jumpingforall.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jumpingforall.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "k.tt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kamata-saisyuusyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "karencatering.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kathakkachakkar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "katja-bjoern.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kesen.news", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kesen.wang", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kfz-sachverstand.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kh.pub.sa", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kitsquid.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kk.gt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kleebauerhof.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "klimaatstad.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kobietydokodu.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kontantfinans.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kontrapolis.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "koolisw.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kplastics.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "krankenpflege.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ksv-friesland.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kuaza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kw.gt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kyn.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kyriakidisship.gr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "laguiadelocioenuruguay.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lan-der.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lapinator.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "larifari.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "larousse-edu.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "larrutan.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "laud.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lawclinic-hsg.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "layan-luxurylighting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leandrebergeron.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leapa.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ledebergleeft.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "legen.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leivadi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lesa.boutique", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leslyandyana.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lianhe.art", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lichtfestival.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lichtfestival.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lichtfestivalgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lichtfestivalgent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lichtfestivalgent.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lichtfestivalghent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lidosparesort.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lifars.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "life-experiment.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "linalynn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "linovelib.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "linuxtips.gq", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "liorggi.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lisacundy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "livienpress.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "llccd.eu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lodewillems.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "logancooper.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lohnsteuerhilfe-essen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lola.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "londonlocks247.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "loulifestyle.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lovemesomegadgets.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lpgaclub.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lyclub.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "machida-saisyuusyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "madamcougar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mafy.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mahmoudeeb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "malawi-portal.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "malie.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "malypiesekzuzi.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "managment.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mandrill.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "manuelpinto.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "manusje-van-alles.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "marinapetruzio.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "markhornsby.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "markhornsby.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "marknb.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "marny.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "marvin-elsen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "marvin.is", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "masduta.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mastpartners.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mattmoorcroft.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maxclers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maximoguk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maximumphysiotherapy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mayaroconstituency.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maynesoftware.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mcpetrade.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mdrp.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "medhiwa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "megaimpressao3d.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "meideas108.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mejitravelcr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "melbet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mendmybackprogram.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "merry.news", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "metait.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "metasearch.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mia-manager.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "micaballo.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mikaelf.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mikkohuupponen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mobiliteit.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mobiliteitstadgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "momochrome.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "monamurlite.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "montuan.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "moonbooth.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "moonpay.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "morifuji.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "morriganbe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mostqbalwatanalqahirah.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mstazakka.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "multifruttisystems.gr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "muon.marketing", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "musecomunicazione.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mvwoensei.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mybuddytheplumbertooele.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mydataprotected.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mylahcollection.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mylocalfoodtrucks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mypower91.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mzr.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "najrecept.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "napoveda.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "navot.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nccoe.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nd.fyi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nebulise.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "needle-demo.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "net-provider.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "netheadsonair.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "netmajstor.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "netrino.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "netrino.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "netsoftit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "newissuesmagazine.com.ng", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "newnationalstar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ninasofian.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nitinpandey.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nonsa.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "noobit.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "noom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "npw.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nsquaredong.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nydbank.ng", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "o2.tn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oapks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oasiskitchens.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "obve.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ocasio.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ocmwgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oettig.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "office365-apps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ogaprinta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oliveoilshop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "olivetbgc.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "olyfed.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onmed.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "opc.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oposicionesjusticia.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oppabet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "orchardscribe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "orioneclipse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "orpf.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ortoinnovapanama.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ourdataprotected.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oyap.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pagerange.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "paidcashforhouses.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "painful.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pamperssamples.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pancybertronics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pandemicoversight.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "paragon-consult.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "paramo.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "parelweb.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "parentsguidetotheworld.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "parenttheirpassion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "passionateracers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "paste.rodeo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "patricklustigmediation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "peace-is-possible.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "peppyflora.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pflege.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "phc4submit.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "philippkaindl.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pierianservices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pindex.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pl2.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "plaxi.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pmbsteelbuildings.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pokkareindeermeat.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "popxclusive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "potnofficial.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pottwist.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "powercomputers.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "prancor.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "primakeysmarketingsolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "prisel.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "privateimoveis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "prochaskamediation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "promotionvillanakarin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "promusicante.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "propcierge.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "prws.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ps-playback.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "psmpl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "psoppc.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pssjd.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "puur.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "qlares.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "qqqq.plus", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "quantuin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "r-ix.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "r3gi.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "radcloud.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "radito.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rafik.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ramydent.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ranking-mensesthe.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rdxbioscience.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reach.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "readingea.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "redlands.net.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "refurb-tracker.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "regalradio.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "regenpfeifer.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reklamaandroid.pp.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reklamaios.pp.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "relevanttomyinterests.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "repalanca.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "republic.gg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "resulttado.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rewardscout.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rez.ee", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rgf.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ringsandthings.scot", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "riveroaksdentaljax.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "robertjquinn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "robertsmits.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rodobike.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rolluplab.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rooferindallas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rowanz.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rozvozznojmo.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rudimart.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rudimeds.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rudimentalconsolidated.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rudimentalconsulting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rudimentalfoods.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rudimentalkitchens.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rudimentalretail.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ruimtevoorgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rushtonparay.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "safeguardstudents.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "saisyuusyou-ikebukuro.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "saisyuusyou-omiya.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "saisyuusyou-takasaki.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "saisyuusyou-utsunomiya.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "salalfoundation.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sald.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "salo.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "savchenko.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "schoolheads.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "schweiz-sextreffen.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scorpioncomputers.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scoutbee.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scpsecretlab.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scpsecretlaboratory.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scriptolab.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sdguitdagingen.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seb8iaan.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sekoia.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sellersmart1.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "semenserang.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sentrybay.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seoulista.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "serenitygwinnett.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seucreditodigital.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sextreffendeutschland.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shellphotostudio.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shiftcrypto.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shiftcrypto.support", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shinta.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shinyoko-saisyuusyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shirosaki-hana.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shivering-isles.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shopcon.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shoppingplaza.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shunliandongli.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sid-giessen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "singerfamily.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sintsationeel.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sipd.go.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "skogmans.co.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sldlcdn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "slimopweg.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smarpshare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smartblock.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smithandnoble.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smolkatours.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smppcenter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smsfa.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sodigent.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "solnascentepapelaria.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sophiefrutti.gr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sosregistration.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "soydoula.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "spanmass-portal.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "spurindustrial.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sr-sam.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "standardbook.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stargroup.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "startupbros.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "steebel.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "steinberg.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "steparovi.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stepupforeurope.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stevenjacobs.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stevenjacobs.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stiebelrewards.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stilida.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stlfamilyattorney.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stnguyen.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stoemp.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stoneocean.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "streetwisebiz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stylidafm.gr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sudabaus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sugardaddy.network", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sugardating.network", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "suikerspinnetje.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sumopages.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "suomiheraa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "swevenstays.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "swostik.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "synergiedenken.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "synobook.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "syronex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "t-cophony.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tabisuta.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tachikawa-saisyuusyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "taciso.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "taikhoanfree.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "taskforce.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tayebbayri.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tcook.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tcook.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tcshop.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "td-bambini.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "team3.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "techanit.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tecnologiaboliviana.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tellerify.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "testq.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tex-salon.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thekickassvirtualassistant.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "themarkup.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "theomegagroup.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "theonyxzone.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "theunitehistoryproject.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thn.la", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timesedlen.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timvandenborre.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tlesptyltd.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tomorrowx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tomservo.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "top-rezepte.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "top10.digital", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "topmarketplace.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tornado-map.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tovse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tpue.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trabia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "transtrack.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "treefeelingsandton.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "treehorn.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "treemadeiras.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trigate.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "truckscout24.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trustee.deals", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trustology.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "try2hack.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tshirtatlowprice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tv-mainzlar.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "twilite.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "twilite.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "typecho.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ugodeal.md", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "unausa.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "unblockit.lat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "universal-techno.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "universalspf.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "urologywi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "utahdentalcrowns.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "utahtriallawyers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "utduc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "v-jo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vaneyckwashere.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vanwoensei.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vanwoensel.cloud", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vanwoensel.directory", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "variusunum.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "varunmaheshwari.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vdw-instruments.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "velassoltas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "veripn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "verkeer.gent", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vetcpd.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "videocall.guide", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vikrammaheshwari.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "visitgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "visuall.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vivaocredito.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "voornaam-at-achternaam.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vote.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vous-etre-utile-ceidf.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vtivision.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vzwregent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "waavit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "walletfox.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "warrioronewgw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wartraining.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "watermitigationspecialists.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "web-info.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "webehurt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "webfiredesigns.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "webplatform.news", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "weektegenarmoede.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "weewoo.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "welty.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "welty.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "welty.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "welty.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wemakemx.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wfsrecruit.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "whichdoctor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wickersmith.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "willowcundy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "willwilkins.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "willywangsextapes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wingchun.edu.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wir-do.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wisdomteethonly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wizardwiz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wordpresshelpmaster.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "worky.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wplan.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wptangtoc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xanzhu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn--80aej8bv.xn--p1ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn--marn-8ra.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xonet.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xplo.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xraven.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yannickcoffi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yearend.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yesterplay.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yflix.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yhs.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ykdlb.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yoduzw.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yogstation.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yooread.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "youiv.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "youiv2.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yourblazeguard.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zahnarzt-backfisch.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zebratee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zelvar.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zerofogmask.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zerty.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zhstar.win", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zimedia.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zorgenvoorherena.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zorgenvoormaria.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zova.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zusammen-grossartig.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "0x21.consulting", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "100words.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "111111.plus", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "123freevectors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1stchoicemoney.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xbet.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xbet.ng", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1xstavka.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "2890.ltd", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "383838.plus", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "500foods.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a-sparks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abacus-essen.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abcrcm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "access-board.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "accesshq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aceleraguria.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "acuityfinishing.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aditro.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aerionsupersonic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "afterhaven.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "agora.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "agribouwmarkt.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ajelen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alfaair.aero", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alisonpaloma.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ama-agency.ma", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "americanpregnancy.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amionamiondrugsdotcom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amodeocarlo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "angelalombardo.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "animelody.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anliting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anthony.games", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anthro.asia", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aperto-nota.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aperto.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "app-cinveninfostream-qa.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arabicdress.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "archispace.com.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "archmirror.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ardiama.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armansazehradis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arztrading.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "asprobet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "astha.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "atah-s.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "att-lda.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "auksel.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "australianallnaturalskincare.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "autojur.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "awutar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aykyamultifest.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "azulimparcial.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "babypaparadise.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "badkamermarkt.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "badkamermarkt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "badkamermarkt.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "barefoodinrome.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "barmenteros.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "baselnazifrei.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bbagramante.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beachwayhomes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beallure.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beckmandxapps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "benabbott.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "berlingeriresort.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestelhetmaar.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestidea.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beyondthecreek.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bhutanonlinetravels.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "biene.rocks", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blaauwgeers.wiki", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blockstudio.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "boodledose.ddns.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "borde.network", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bourestonmedia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "buda.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "business2people.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bustickets.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "c-style.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ca.ma", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cadflow.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cap73.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "capsulekitchen.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "carefy.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "carwreckcowboy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cc3m.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ccaj.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "celebrationoflifeplanning.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "centralitasbaratas.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chaturbates.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chriseldon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cintaraso.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cipies.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cisin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cisinlabs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cisinlive.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "claremontyachtclub.org.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cloudfit.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clovisplumbingservices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "coffeemoment.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "comasystem.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "comita.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "conexionfit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "confer.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "congdongnhatviet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "controversialrisks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "controversialrisks.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "corona-data.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "courier.lk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "covidcoldfacts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "covidstatistiek.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cpfrancophonie.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "creature-comforts.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "crsserviceogkloak.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "csalem.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ctcp.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "curamcare.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cushlaofgullion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cyberry.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cycomm.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "damiengobron.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "data-mining.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dazenelevator.ph", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dblfree.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ddi.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dealdelicate.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "demisch-tim.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "demischtim.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dezevenster.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dfstoryteller.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dieslowhtx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digitalerror.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "directorylib.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "distelbentelo.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "distrim2.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dns.expert", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "doki-list.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dolmencleanroom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dramaquarter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "drbenlight.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dropcop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "drydor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dupforex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dupfx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "easaccounting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eb12.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ebrahimhadimarket.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ecommercefastlane.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "edupedia.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eliott.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eliottlavier.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "energylocals.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "enia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "enoteca.do", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "epicnex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "esignly.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "europeluxuryweddings.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "evaali.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eze-buy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "f-401.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "f-mebel-na-zakaz.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "face-recognition-cctv.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fackovcova.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fackovec.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fairviewfarmacy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fajarrubber.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fakturar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "farmaweb.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fatiguefree.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "feminteligencia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fietsvakman.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fjallconnections.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "florianstroeger.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fluttee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "freecoursepage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "freefiregenerateur.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fromoldbooks.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fuwashima.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fuzzlemann.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gadaj.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "galtelligence.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gamerspawn.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gamertelligence.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "garo.network", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "geartips.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gesditel.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "giftsforaspecialoccasion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gigaclube.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gio-abbigliamento.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gnous.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "greenbritain.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hae.sh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hamminga.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "happygutlife.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "haunt-keeper.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hazana.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "healthl.ink", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "heiliao.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hellofound.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "heroningenieria.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hiseplast.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hivehub.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "homeloanprequalify.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "houthandelbunskoek.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "houthandeljacobs.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "huemul.studio", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hugobarral.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "huntingtonestateproperties.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hv-2020.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hv-2020.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hv-anmeldung.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hv-online.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hv-portal.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hvanmeldung.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hvanmeldung.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hvsdev.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hypnotic-reviews.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iburgs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "icolorpalette.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iemc.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "igualdaton.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iks.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "illumepgh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "im-razmakh.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "immocompar.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inaboutique.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "init3.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inkhub.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ipass.live", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iprep.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "isaacgolding.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ite.st", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ivnext.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jagan.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jalinhgo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jamelhammoud.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jiweadventure.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "joekann.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "joshuaschmitt.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "journeytofi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jperformance.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jurnalilmiah.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kcam91.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kefu.chat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-sports.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kimicar.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kindbear.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kino.ma", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kkutu.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "klaudialeszczynska.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "knowl365.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "koe.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "konducars.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "konuhaber.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kwonghei.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "labsai.cyou", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lady-wishlist.my.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ladywishlist.my.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lakichat.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "landscaping-montreal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lars-mielke.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "latiamona.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lavinde.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leathership.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leccamilafi.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leliekerk.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lesamisdelaroumanie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lesprofsplacotent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lesy.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "librosantimateria.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lifesignals.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lihj.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "linespots.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "linksgruenejugend.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "livehelpindia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "longislandbusiness.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "louisvillefilmfestival.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "luciobarcellona.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "luciogelsi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "machineidle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maclafferty.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "made-dwell.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "madedwell.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maev.si", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "malaysiasentral.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "manforums.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "manteligencia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mantelligence.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "marcositaliandeli.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "masters-burrell.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mayamushrooms.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mayorscouncil.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "medicallicensing.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "melbet.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mendelsphotography.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mentors4stem.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "meshintranet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "minds-academy.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mlcrosoftonlline.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mmot.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mojaapteka.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "moreno820.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "morikami.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mosaicot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mpcdn.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mrc-productivity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mspatexas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "msrohkwrstock.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mudanzasuiza.com.ec", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mydeardreams.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "myrvog.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "myvegasadvisor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mzdiy.cn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "napoleonexclusievesieraden.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nasdarq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "negr.gay", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "negr.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "neocenter.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nextus.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nextvision.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nicecockb.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nietvolgensdeboekjes.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nigerianpilot.news", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nix-sender.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nm2d.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nrdigitalbranding.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nspointers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nyliveauctions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nyrany.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "odijmond.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oermen.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ohmanager.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "omertskn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onsitespeedometer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oonie.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "osa.org.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "palaceinstitute.ac.tz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "parcely.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "paul-zhang.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pepechkov.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pingrc.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "planisware.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "playxylo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "poriadok.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "primeabout.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "qikroof.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "qrguestbook.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "qualiride.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "queerativity.art", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "quickyshare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "r00tsolutions.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rabb-it-days.tokyo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "radixweb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "raiceshebreas.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ralphbisschops.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "realinsurance.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "regatesenbretagne.bzh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reliantfundservices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reportando.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "revolve.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rgtn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ridetothefuture.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rikaz.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rkabworks.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rosdver.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rsa-homeinsurance.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sabaikonotes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "saisyuusyou.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "samanthabiggers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "samuel-brown.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "samuelbramley.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "san.tv", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sangitafoodmess.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sanity.host", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sanity.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sapphirepack.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sbetinsiders.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seatsurfing.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "senseful-online.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sexfactory.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sfpmall.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shoyuf.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "siatris.qc.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sigil.lt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "simply.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sinnvoll-online.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "skarvruet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "skylair.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "slrshoppee.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "snajdr.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "soat.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "soepvork.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "somehowsomeday.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "spotsolutions.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sruthisjewellery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ssmrca.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sterydki.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stevenlapere.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "straalatelier.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "studio3a.design", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sublimesecurity.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "superraclette.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tachoplus.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "talentsfromindia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tapesvip.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tchalian-boulonnerie.store", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "technovisioneng.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "techsaviours.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "textcleaner.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "themomentratchada19.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thinkdata.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thunderboltlaptop.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tim-demisch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tim-demisch.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tim-demisch.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tim-demisch.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tim-niclas-demisch.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tim-niclas-demisch.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timdemisch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timdemisch.email", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timdemisch.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timdemisch.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timniclasdemisch.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "timniclasdemisch.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "todoseaprende.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tonarinoliusan.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "toondergroup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "touch2ship.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trabsky.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "traveljunkie.tips", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trekintel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tricordmedia.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "udemypaidcourse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ultraly.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "unitedrestorationfl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vahl.blue", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vakwinkeldemo.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "valphenn.blue", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vddruckwerk.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vegornonveg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "velocompany.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "velocompany.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vicesetcaprices.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin-kon-sung.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin-kon-sung.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin-kon-sung.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin-kon-sung.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktor-chin.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchin.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchin.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchin.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchinkonsung.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchinkonsung.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchinkonsung.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viktorchinkonsung.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viperperformance.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "viseum.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vitabsolu.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vivetoluca.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vjshi.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vps.management", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vulkanprotektor.rs", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "waffle-backend-sanggyu.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "waffle-sanggyu.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wallendair.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "waytoeasylearn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wdmpa.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wdntcr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wedontcaregroup.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wefillgood.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wincosafari.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "winfar.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "winkelvanmorgen.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wireless-kill-switch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wisdomcue.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wisenetalarm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wksmartmall.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wolfsburgwest.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wow-screenshots.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wsg127.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wyrihaximus.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wyrimaps.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xgirl.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xno-sys.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "you15iv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "you52iv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "youiv1.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yslocksandkeys.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yzddd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zanotti.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zogevikst.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "11046.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "112fryslan.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "123freebrushes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "178spb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1989-bmw-e30-forsale-in-norcal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1bis.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "1stav.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "24bel.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "350.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "3dstore.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "4car.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "521keyvista.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "53pluk.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "55opt.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "8freeporn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "919898.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a1cashforcar.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a1scrapmetalrecyclers.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "a1spareparts.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aaronosmani.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abattepeluqueriacitas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abcc.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abdullaeff.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abdullaeff.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abdullaha.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "abiertoempleos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "activs.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "actualizarapp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "adaptivehedge.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "adboard.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "advancedob-gyn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aerobatt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "afgphotographers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "agleventis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ahbap.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ahoj.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aifx.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aigua.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ailamarket.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "airskystore.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akagiauto.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "akszita.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alchemiya.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aldipresscentre.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alecrimacessorios.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alejandrocruz.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aleks.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alfredlin015.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "algoarmada.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alkozeroks-wiki.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "all-bronza.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "allbetter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "allmodern.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "allurechiro.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "almost.fit", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aloemeda.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alofone.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alphalibraries.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alphasoko.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "altezza-autore.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "altterapevt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "alzulej.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amazefabrics.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "americandisinfectingassociation.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "americandisinfectingassociation.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amniowell.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "amongus-guru.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "an2ic3.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anh-dv.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "anhdvboot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "animalesterrestres.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ao27.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aponte-systems.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "apotheke.market", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "apprentimillionnaire.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "apteka38.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aqua-print.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aquamarinavillas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aradiantlyhealthylife.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "archief-ocmwgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aria.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arirabinowitz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armaringross.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armazemwarenhaus.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "armo.re", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "arockets.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "art-okno.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "artifuse.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aryacollege.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "asciugatureedili.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "asesoriavalledor.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "askbonus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "asniereslesdijon.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "aspiraplasticsurgery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "astrograph.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "atanas.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "atmelook.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "atomicwallet.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "atozblinds.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "autoliga.net.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "automobile-gadgets.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "autopapa.wien", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "autorefuellings.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "avcafe.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "avelux.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "avertoni.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "avito.ooo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "avra.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "awarner.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "awaybot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "axesslab.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "b-angel.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "b3gin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "background4free.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bag66.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "balesetvedelem.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "banfieldtravel.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bankipmr.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "barrenwuffett.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "barwaldesigns.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "barzus.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bayareaplasticsurgery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bb-sportnahrung.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "begovel.shop", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bellaplanta.hr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "benjaminfox.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bereginya-lada.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bertrell.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bessems.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bessems.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestasquadradas.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestdiscount.today", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestfacts.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestinfo.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bestpornclip.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "beta-site-staging.azurewebsites.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "betandslots.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "betanoapp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "betwinner-zerkalo.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "betwinnergiris.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bezboli.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bible4u.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "big-market.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bigbunce.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "billkochman.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "birchlane.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bitazza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bitwoci.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blacksearegion.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bladebotlist.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blankstyle.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blatnic.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blogomoll.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bloomppm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "blummedia.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bluuglass.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bmoabogados.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bodrus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "boeleo.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bookkeepingsolutions.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bouldercountydronepilot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "boulderwagonroad.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bozdech.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bradeales.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bridalsbyada.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "briskbase.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "broadbandforum.co", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bth.wtf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "btln.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "btraviswright.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "buddiescomputers.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "buildbackbetter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bureniemoscow.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "burg-hohnstein.info", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "burnsland.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "businessrights.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "bwzc.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "byladyverdelet.bzh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "byootify.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "byuro.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cabinetmtc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cadiztrabaja.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "calendum.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "callcenterdeluxecalls.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cam-et-xou.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "canali.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cancunsouvenirs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "canivacbd.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "canopycleaning.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "caprigo.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "carddelivery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "casaledibuccole.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cat1solution.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cchat.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cdbp.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "celebrities.pictures", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "centr.dn.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "centrmebeli.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cfenns.ath.cx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chatforums.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chicjewelryla.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chimebank.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "chongming.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cidcca.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cim.pe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cistenikoberculiberec.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cj26.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clarityskin.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clinteam.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "clubexpress.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "code66.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "collectif85.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "colorideas.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "colosseumticket.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "comoenviarcurriculumvitae.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "consultadepsicoterapia.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "content-hub-1.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "countrify.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "craftbyhand.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "crashcoursecenter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cst-vbg.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "curlingclass.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cxologic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cxologic.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cyberpunk.guru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "cyberrepair.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "czqu.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dahfasad.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "danielshaw.co.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "datablender.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "debardo.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "defenestrazionedipra.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "deine-politik.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "delta8.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "digitalis-france.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "disinfectiondoctor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "divinecnainstitute.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dodomy.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dolle-shop.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dpc.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "drc.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dues-eckert.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dxlr.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dylanuwr.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "dynacrop.space", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "e-osago.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eajglobal.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eightballde.luxe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eletrotel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eligasht.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "elpreciosostud.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eltron.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "emojiteka.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "empleandon0s.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "empleosearch.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "enduranceseries.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "energaia.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "enjoybeer.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ensinu.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "enviartucurriculumvitae.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "epiccraft-mc.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "equityloupe.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "equityloupe.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "equityset.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "erechimimoveis.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "erichollander.photography", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "es-vps.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "esiac.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "esmag.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "espacosaudesuplementos.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "etersy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "etury.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "eurogarden.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "europafs.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "evangelise.asia", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "examroll.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "expocomerciovirtual.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fabiankaindl.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "familienoase-koenigstein.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fanescu.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "favorit-stroy-snab.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "felixmendez.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fellas.com.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "felton.network", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fess.ie", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fibril.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "filequit.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "finsall.co.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fiskosceyiz.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fiskosceyiz.com.tr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "flat-tire.biz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "floy.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "forward.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "fotojenico.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "frisaga.travel", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "funktdesign.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "funktdesign.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gabaldon.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gabaldon.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gameday.org.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gehirnapis.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gend.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gensokyo.cafe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "georgemudie.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gestorestecnologicos.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gestorimob.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gestorimobiliaria.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gitedegroupelatruitedor.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gizitalk.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "grantashqg.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "greatsoftwares.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "greencyprus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "gustomsc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "harbourunderwriting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hcs.land", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "healthfulhealthcare.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hedonics.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "heidifuller.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hekate.com.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "heroesorchestra.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "herreriaorozco.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hisax.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "holditdownfc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hometeenorgy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hongfumall88.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hoorgold.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hotelv.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hotrender.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "huelvatrabaja.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "huiskopenspanje.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "hus.gay", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "huureensite.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iblsoft.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iclinic-mrt.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "icollezionisti.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ict.govt.nz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "idohost.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ihost.md", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ihri.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iii-coalition.us", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iipvapi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ikigaiapp.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ikonenmuseumkampen.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ikzoektim.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "illadrodimerendine.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "illi.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "imenfarazalvand.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "incurvy.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "infelko.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "infocom.bg", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inmobiliaria-sanpablo.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "innovadis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "insurance24.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "interlecwa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "internetional.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "intersumka.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "intheevent.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "intvshop.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "inwonderofit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ip-addr.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iqreview.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ironscales.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "isleyfarmsupply.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "israel-escorts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "israelimtovim.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "itsgreener.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ivselena.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ivyhelpers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ivyis.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "iymark.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jadeforallseasons.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jameh.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jarcasting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jarcasting.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jarcasting.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jav0x.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jbliss.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jeek.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jellyfin.spdns.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jhof.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jixun.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jixun.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jobhouse.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jokertv.ovh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "jumperke.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kaeme.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kamin-island.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kandra.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kapri.dn.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kdramaholic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-sports.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-sports.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-sports.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-x.at", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-x.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-x.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keller-x.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "keuvelaar.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "khmrynok.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "klinikasochi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kolodec-pod-kluch.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kowalski7cc.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kozentic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ksp-spb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kt-studio.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kurspmr.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kvaapagarrot.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kvadru.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "kvateka.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ladyklub.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lakemacquariecashforcars.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lamiradaacr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "larry.buzz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lavaccount.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lavocedelviolino.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "laxaf.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lc-8.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "leabharbreac.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "legalservicespanel.gov.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "legiaphu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lestanzedelgattopardo.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "letsagree.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lgshop.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lgstore.sk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "liberecstehovani.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "librairieducontretemps.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "licenciasconstrucciondiamante.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "licx.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "liendar-silver.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lifewaysvillage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "liliang.moe", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "linarite.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "linkedin500.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lmtlabs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "lotposh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "louhomeworkouts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "loyverse.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "loyverse.town", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "luggagehero.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "luisbustamante.mx", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "luxedition.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "m2international.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "machissenefre.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "madampastry.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "madler.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "magicvaporizers.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mahgu.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maitlandcashforcars.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mariasemarias.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "markdaine.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "markdaine.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maslows.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mateidibu.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "matkuling.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "matt.ag", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "matton-ict.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "maxscripts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mechanicweb.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mediapuller.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mejorespatineteselectricos.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mekanova.art", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mellmon.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "meslekifikir.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "messenger.md", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "metall.market", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "metalloprokat.market", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mezemeze.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mfg-forex.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mfg-fx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "miacuario.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "microbird.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "microfinance-crimea.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mikkosa.fi", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mirobuvi.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mlo.no", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "modernhouse.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "moscowartdesign.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "moscowlombard.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mosfetkiller.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mosquitoshop.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "motorrijschoolgul.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mova.club", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mow.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mrsjinthelibrary.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mstr-f-dstrctn.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mtservicescorp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mums.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mvarsamis.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "mvz-ammerland-klinik.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "myblogworld.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "myborder.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "n-cis.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nailsmania.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nanoport.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "napi-menu.hu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "narcologic.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "narsq.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "natasajanvirant.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nativetitle.org.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nds-online.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nearbyprinter.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nehrp.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "neograftaustintx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "newsite.moscow", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nfitraining.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nfl.zapto.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nickwasused.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nickwasused.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nickwasused.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nicola-bertini.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nielsterp.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nilab.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nishiwaki-shonaifoods.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nlponline.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nordlandverliebt.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "noticiasdeautos.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "novacleaning.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nove.news", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "novopromo.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nr1hosting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nsopr.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nsopw.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nutrislice.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "nydig.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "obcevents.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "obdinvest.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oea.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "offertemodule.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "officeefficient.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ognedoor.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oknarating.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onlineradiobr.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onlinewot.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "onlymammoths.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "operadotejo.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "optimalforlife.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "optiqueh.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "optiqueh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "opvoedingswinkelgent.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "oralemiraza.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "orchids.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ordermsg.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "orendamebliv.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "owlazy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "paless-aless.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pasardigi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pattanath.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pcert.lat", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "peliculasviejas.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pelviclinic.pt", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "peral.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "perfect-seo.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "perunsoft.rs", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pharmaciechatelle.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "piesel-piepser.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pimbletree.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pimpstack.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "piotrandpawel.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pipabella.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pirateproxy.buzz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pivotalshift.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "platinmods.my.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "polymathian.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pozyka.site", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "prepz.es", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "presidentinternet.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "press-wall24.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pricesdoors.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "proclimat.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "profarm.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "proklimat.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "prosperegypt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "proxybay.kim", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "psncarddelivery.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "puredisinfecting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "puremosquito.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "purepestandlawn.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "puresanitization.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pusatcucikarpet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "pxld.sh", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "qualitymark.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "quayhudanhbai.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "quellarotondasembrafi.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "raddle.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "raipet.spdns.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ranjanbiswas.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ranjanbiswas.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "raven.express", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rctiads.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "re.yt.nom.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "realnature.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "recepty.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "redireci.one", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "redirection-plf.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "registech.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reklammaster.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "renicimery.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reslv.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "restashorecleaning.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "reverenceglobal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "revinc.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "richmondradiologists.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ridayu.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ridepanda.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rise.africa", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rk-box.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rmtconstruction.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "robimgood.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rockfax.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rockstargame.su", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rorelseprojektet.se", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rosspecstroy.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rotatingchefs.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rotonde.gq", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rovohout.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "runmyvillage.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "runosklep.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "rut2.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sacredart-murals.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "safecoin.tech", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sam.gov", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sanificazioni.roma.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sanodent.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "santehart.by", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sapaship.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sauna.re", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "saybecraft.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sbli-webhook.herokuapp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "schwedenkiosk.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scrapcars.net.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "scrapmycarperth.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sea-man.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seatinglane2u.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "seboluo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sergal.gay", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "serverfile.ml", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sexlounge.pw", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shareiva.cf", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shivkrupanandfoundation.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shockproof.systems", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shoppencph.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shotoniphone.ga", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "shssl.vip", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sib.li", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "signsymptom.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "simbdo.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "simetria.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sinatralegal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "singee.me", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sitebrass.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sk62.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "skateschoolkostroma.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smartedukasi.co.id", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "smrdim.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sochi.tatar", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sochidostavka.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sochiss.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sol-design.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "solve-it-sol.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sotermic.cl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "southocpt.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sowhat.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "spamasaurus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "speedyplatypus.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "speww.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "spicture.in", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "spidometrus.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sport-51.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "springlanguages.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ss23.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sss.rip", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "statsnite.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stellar.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sto-avtovo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stockgraphicdesigns.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stoltz-it.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stop-zavisimost.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stoprog.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "strakonak.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "stratejm.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sunbit.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "supercarpets.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "supportadvantage.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "svetapublic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "swimmingpoolshop.co.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "sygnanet.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tablondeempleo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tahvienovin.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tandemzagan.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tarot-online.com.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tatastudi.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tattoonhamon.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tattootoday.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tdlesovik.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tekittak.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "teleum.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "telving.dk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "teologia.promo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "testikel.be", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tfiik.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thecompanysheffield.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "theislandtime.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thekidneyexperts.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thekillertoxin.de", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thekliniquehotdeal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "therisk.global", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "thiagovarella.com.br", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tkita.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tm-autohandel.pl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tnsolutions.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tok4.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tokimeko.jp", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tomrunting.pro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "too.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "topo.com.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "toranjchap.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "townshipofthenorthshore.ca", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trabajoenmx.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trafficticketsnola.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tragicallytrumped.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "transmoni.vn", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "travelshelper.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "travizgo.online", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trianglepwh.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trumptragedy.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "trumptragic.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tubuscadordeempleo.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tuempleosolucion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "tuinaportugal.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "u2b.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ucstrike.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ukrainskie-konstrukcii.com.ua", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ultimatefilmpromotion.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "uniformesdreamleaguesoccer.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "unitedcarremoval.com.au", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "upwardcreative.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "uradvd.town", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "urbanbageecha.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "uscveteranspark.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "usd.ooo", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "utheatre.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "v-m-shop.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "valagrovoce.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "valerieorsoni.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vault.spdns.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vdheyden.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "verkiezingsuitslagen.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vermaeckbouw.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vfwauxiliary.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vipku.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "virtualgovernance.tk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "visiongroup.top", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vitron.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "vmonetke.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "w4r.nl", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "water-net.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "web-design-india.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "web22.eu", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "web22.ro", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "weblegend.xyz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "webstamil.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wholesalerrr.deals", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wisetoken.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wiseupcorp.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wkymenshealth.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wlombard.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "world-avto.fun", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "world-game-news.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "worldarticles.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "wseo.kz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xg-printonline.co.uk", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xiaomiredmi.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn--80aaagbtu3bfbullc1c.xn--80asehdb", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn--fuze-dpa.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xn--h1ahbcdb8g.xn--p1ai", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "xunki.cc", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yadameshop.ir", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yarcevostom.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yblaccounting.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yellowrooster.net", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yemektarifinet.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yiff.media", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yiff.rocks", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yiff.supply", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yinfor.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yips.org.za", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "your-melody.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "youstyleski.it", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "yukina.kr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zamecnikkladno.cz", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zchuyot.co.il", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zhf.io", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "ziegenhagel.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zigsphere.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zitadel.ch", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zivot.org", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zonadetestes.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zouaouitransport.fr", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zubilo-perm.ru", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zukify.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zwyr157wwiu6eior.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zycie.news", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
+ { "name": "zyciepl.com", "policy": "bulk-1-year", "mode": "force-https", "include_subdomains": true },
// END OF 1-YEAR BULK HSTS ENTRIES
// Only eTLD+1 domains can be submitted automatically to hstspreload.org,
diff --git a/chromium/net/http/transport_security_state_unittest.cc b/chromium/net/http/transport_security_state_unittest.cc
index 4b90996f792..fda88d2b803 100644
--- a/chromium/net/http/transport_security_state_unittest.cc
+++ b/chromium/net/http/transport_security_state_unittest.cc
@@ -10,7 +10,7 @@
#include <vector>
#include "base/base64.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/files/file_path.h"
#include "base/json/json_reader.h"
#include "base/metrics/field_trial.h"
@@ -121,27 +121,34 @@ class MockCertificateReportSender
const GURL& report_uri,
base::StringPiece content_type,
base::StringPiece report,
+ const NetworkIsolationKey& network_isolation_key,
base::OnceCallback<void()> success_callback,
base::OnceCallback<void(const GURL&, int, int)> error_callback) override {
latest_report_uri_ = report_uri;
latest_report_.assign(report.data(), report.size());
latest_content_type_.assign(content_type.data(), content_type.size());
+ latest_network_isolation_key_ = network_isolation_key;
}
void Clear() {
latest_report_uri_ = GURL();
latest_report_ = std::string();
latest_content_type_ = std::string();
+ latest_network_isolation_key_ = NetworkIsolationKey();
}
const GURL& latest_report_uri() { return latest_report_uri_; }
const std::string& latest_report() { return latest_report_; }
const std::string& latest_content_type() { return latest_content_type_; }
+ const NetworkIsolationKey& latest_network_isolation_key() {
+ return latest_network_isolation_key_;
+ }
private:
GURL latest_report_uri_;
std::string latest_report_;
std::string latest_content_type_;
+ NetworkIsolationKey latest_network_isolation_key_;
};
// A mock ReportSenderInterface that simulates a net error on every report sent.
@@ -158,6 +165,7 @@ class MockFailingCertificateReportSender
const GURL& report_uri,
base::StringPiece content_type,
base::StringPiece report,
+ const NetworkIsolationKey& network_isolation_key,
base::OnceCallback<void()> success_callback,
base::OnceCallback<void(const GURL&, int, int)> error_callback) override {
ASSERT_FALSE(error_callback.is_null());
@@ -328,7 +336,7 @@ std::string CreateUniqueHostName() {
}
// As with CreateUniqueHostName(), returns a unique NetworkIsolationKey for use
-// with Expect-CT prunung tests.
+// with Expect-CT pruning tests.
NetworkIsolationKey CreateUniqueNetworkIsolationKey(bool is_transient) {
if (is_transient)
return NetworkIsolationKey::CreateTransient();
@@ -914,6 +922,8 @@ TEST_F(TransportSecurityStateTest, PreloadedPKPReportUri) {
const char kPreloadedPinDomain[] = "with-report-uri-pkp.preloaded.test";
const uint16_t kPort = 443;
HostPortPair host_port_pair(kPreloadedPinDomain, kPort);
+ net::NetworkIsolationKey network_isolation_key =
+ NetworkIsolationKey::CreateTransient();
TransportSecurityState state;
MockCertificateReportSender mock_report_sender;
@@ -948,9 +958,10 @@ TEST_F(TransportSecurityStateTest, PreloadedPKPReportUri) {
// Trigger a violation and check that it sends a report.
std::string failure_log;
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
- state.CheckPublicKeyPins(
- host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, true, bad_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
EXPECT_EQ(report_uri, mock_report_sender.latest_report_uri());
@@ -961,6 +972,8 @@ TEST_F(TransportSecurityStateTest, PreloadedPKPReportUri) {
ASSERT_NO_FATAL_FAILURE(CheckHPKPReport(
report, host_port_pair, pkp_state.include_subdomains, pkp_state.domain,
cert1.get(), cert2.get(), pkp_state.spki_hashes));
+ EXPECT_EQ(network_isolation_key,
+ mock_report_sender.latest_network_isolation_key());
}
// Tests that report URIs are thrown out if they point to the same host,
@@ -969,6 +982,8 @@ TEST_F(TransportSecurityStateTest, HPKPReportUriToSameHost) {
HostPortPair host_port_pair(kHost, kPort);
GURL https_report_uri("https://example.test/report");
GURL http_report_uri("http://example.test/report");
+ NetworkIsolationKey network_isolation_key =
+ NetworkIsolationKey::CreateTransient();
TransportSecurityState state;
MockCertificateReportSender mock_report_sender;
state.SetReportSender(&mock_report_sender);
@@ -998,20 +1013,24 @@ TEST_F(TransportSecurityStateTest, HPKPReportUriToSameHost) {
// because the report-uri is HTTPS and same-host as the pins.
std::string failure_log;
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
- state.CheckPublicKeyPins(
- host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, true, bad_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
EXPECT_TRUE(mock_report_sender.latest_report_uri().is_empty());
// An HTTP report uri to the same host should be okay.
state.AddHPKP("example.test", expiry, true, good_hashes, http_report_uri);
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
- state.CheckPublicKeyPins(
- host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, true, bad_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
EXPECT_EQ(http_report_uri, mock_report_sender.latest_report_uri());
+ EXPECT_EQ(network_isolation_key,
+ mock_report_sender.latest_network_isolation_key());
}
// Tests that static (preloaded) expect CT state is read correctly.
@@ -3165,6 +3184,8 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReportRateLimiting) {
HostPortPair host_port_pair(kHost, kPort);
HostPortPair subdomain_host_port_pair(kSubdomain, kPort);
GURL report_uri(kReportUri);
+ NetworkIsolationKey network_isolation_key =
+ NetworkIsolationKey::CreateTransient();
// Two dummy certs to use as the server-sent and validated chains. The
// contents don't matter.
scoped_refptr<X509Certificate> cert1 =
@@ -3191,9 +3212,10 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReportRateLimiting) {
std::string failure_log;
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
- state.CheckPublicKeyPins(
- host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, true, bad_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
// A report should have been sent. Check that it contains the
// right information.
@@ -3203,22 +3225,29 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReportRateLimiting) {
ASSERT_NO_FATAL_FAILURE(CheckHPKPReport(report, host_port_pair, true, kHost,
cert1.get(), cert2.get(),
good_hashes));
+ EXPECT_EQ(network_isolation_key,
+ mock_report_sender.latest_network_isolation_key());
mock_report_sender.Clear();
// Now trigger the same violation; a duplicative report should not be
// sent.
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
- state.CheckPublicKeyPins(
- host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, true, bad_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
EXPECT_EQ(GURL(), mock_report_sender.latest_report_uri());
EXPECT_EQ(std::string(), mock_report_sender.latest_report());
+ EXPECT_EQ(NetworkIsolationKey(),
+ mock_report_sender.latest_network_isolation_key());
}
TEST_F(TransportSecurityStateStaticTest, HPKPReporting) {
HostPortPair host_port_pair(kHost, kPort);
HostPortPair subdomain_host_port_pair(kSubdomain, kPort);
GURL report_uri(kReportUri);
+ NetworkIsolationKey network_isolation_key =
+ NetworkIsolationKey::CreateTransient();
// Two dummy certs to use as the server-sent and validated chains. The
// contents don't matter.
scoped_refptr<X509Certificate> cert1 =
@@ -3247,7 +3276,8 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReporting) {
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
state.CheckPublicKeyPins(
host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::DISABLE_PIN_REPORTS, &failure_log));
+ TransportSecurityState::DISABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
// No report should have been sent because of the DISABLE_PIN_REPORTS
// argument.
@@ -3255,18 +3285,20 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReporting) {
EXPECT_EQ(std::string(), mock_report_sender.latest_report());
EXPECT_EQ(TransportSecurityState::PKPStatus::OK,
- state.CheckPublicKeyPins(
- host_port_pair, true, good_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, true, good_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
// No report should have been sent because there was no violation.
EXPECT_EQ(GURL(), mock_report_sender.latest_report_uri());
EXPECT_EQ(std::string(), mock_report_sender.latest_report());
EXPECT_EQ(TransportSecurityState::PKPStatus::BYPASSED,
- state.CheckPublicKeyPins(
- host_port_pair, false, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, false, bad_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
// No report should have been sent because the certificate chained to a
// non-public root.
@@ -3274,9 +3306,10 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReporting) {
EXPECT_EQ(std::string(), mock_report_sender.latest_report());
EXPECT_EQ(TransportSecurityState::PKPStatus::OK,
- state.CheckPublicKeyPins(
- host_port_pair, false, good_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, false, good_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
// No report should have been sent because there was no violation, even though
// the certificate chained to a local trust anchor.
@@ -3284,9 +3317,10 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReporting) {
EXPECT_EQ(std::string(), mock_report_sender.latest_report());
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
- state.CheckPublicKeyPins(
- host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ state.CheckPublicKeyPins(host_port_pair, true, bad_hashes,
+ cert1.get(), cert2.get(),
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ network_isolation_key, &failure_log));
// Now a report should have been sent. Check that it contains the
// right information.
@@ -3303,7 +3337,7 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReporting) {
state.CheckPublicKeyPins(subdomain_host_port_pair, true, bad_hashes,
cert1.get(), cert2.get(),
TransportSecurityState::ENABLE_PIN_REPORTS,
- &failure_log));
+ network_isolation_key, &failure_log));
// Now a report should have been sent for the subdomain. Check that it
// contains the right information.
@@ -3315,6 +3349,8 @@ TEST_F(TransportSecurityStateStaticTest, HPKPReporting) {
ASSERT_NO_FATAL_FAILURE(CheckHPKPReport(report, subdomain_host_port_pair,
true, kHost, cert1.get(), cert2.get(),
good_hashes));
+ EXPECT_EQ(network_isolation_key,
+ mock_report_sender.latest_network_isolation_key());
}
// Tests that a histogram entry is recorded when TransportSecurityState
@@ -3352,7 +3388,8 @@ TEST_F(TransportSecurityStateStaticTest, UMAOnHPKPReportingFailure) {
EXPECT_EQ(TransportSecurityState::PKPStatus::VIOLATED,
state.CheckPublicKeyPins(
host_port_pair, true, bad_hashes, cert1.get(), cert2.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &failure_log));
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ NetworkIsolationKey::CreateTransient(), &failure_log));
// Check that the UMA histogram was updated when the report failed to
// send.
diff --git a/chromium/net/http2/platform/impl/http2_string_utils_impl.h b/chromium/net/http2/platform/impl/http2_string_utils_impl.h
index b04030acdc9..655d52121bd 100644
--- a/chromium/net/http2/platform/impl/http2_string_utils_impl.h
+++ b/chromium/net/http2/platform/impl/http2_string_utils_impl.h
@@ -41,15 +41,15 @@ inline std::string Http2HexEncodeImpl(const void* bytes, size_t size) {
return base::HexEncode(bytes, size);
}
-inline std::string Http2HexDecodeImpl(quiche::QuicheStringPiece data) {
- return quiche::QuicheTextUtils::HexDecode(data);
+inline std::string Http2HexDecodeImpl(absl::string_view data) {
+ return absl::HexStringToBytes(data);
}
-inline std::string Http2HexDumpImpl(quiche::QuicheStringPiece data) {
+inline std::string Http2HexDumpImpl(absl::string_view data) {
return quiche::QuicheTextUtils::HexDump(data);
}
-inline std::string Http2HexEscapeImpl(quiche::QuicheStringPiece data) {
+inline std::string Http2HexEscapeImpl(absl::string_view data) {
return net::EscapeQueryParamValue(base::StringViewToStringPiece(data), false);
}
diff --git a/chromium/net/log/DIR_METADATA b/chromium/net/log/DIR_METADATA
new file mode 100644
index 00000000000..8c78ff5bc54
--- /dev/null
+++ b/chromium/net/log/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Logging"
+} \ No newline at end of file
diff --git a/chromium/net/log/OWNERS b/chromium/net/log/OWNERS
index ff5c63b6e7f..53e68eb7787 100644
--- a/chromium/net/log/OWNERS
+++ b/chromium/net/log/OWNERS
@@ -1,4 +1 @@
-eroman@chromium.org
mmenke@chromium.org
-
-# COMPONENT: Internals>Network>Logging
diff --git a/chromium/net/log/file_net_log_observer.cc b/chromium/net/log/file_net_log_observer.cc
index b5573129702..337ff2a1892 100644
--- a/chromium/net/log/file_net_log_observer.cc
+++ b/chromium/net/log/file_net_log_observer.cc
@@ -333,17 +333,19 @@ class FileNetLogObserver::FileWriter {
std::unique_ptr<FileNetLogObserver> FileNetLogObserver::CreateBounded(
const base::FilePath& log_path,
uint64_t max_total_size,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants) {
return CreateInternal(log_path, SiblingInprogressDirectory(log_path),
base::nullopt, max_total_size, kDefaultNumFiles,
- std::move(constants));
+ capture_mode, std::move(constants));
}
std::unique_ptr<FileNetLogObserver> FileNetLogObserver::CreateUnbounded(
const base::FilePath& log_path,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants) {
return CreateInternal(log_path, base::FilePath(), base::nullopt, kNoLimit,
- kDefaultNumFiles, std::move(constants));
+ kDefaultNumFiles, capture_mode, std::move(constants));
}
std::unique_ptr<FileNetLogObserver>
@@ -351,19 +353,23 @@ FileNetLogObserver::CreateBoundedPreExisting(
const base::FilePath& inprogress_dir_path,
base::File output_file,
uint64_t max_total_size,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants) {
return CreateInternal(base::FilePath(), inprogress_dir_path,
base::make_optional<base::File>(std::move(output_file)),
- max_total_size, kDefaultNumFiles, std::move(constants));
+ max_total_size, kDefaultNumFiles, capture_mode,
+ std::move(constants));
}
std::unique_ptr<FileNetLogObserver>
FileNetLogObserver::CreateUnboundedPreExisting(
base::File output_file,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants) {
return CreateInternal(base::FilePath(), base::FilePath(),
base::make_optional<base::File>(std::move(output_file)),
- kNoLimit, kDefaultNumFiles, std::move(constants));
+ kNoLimit, kDefaultNumFiles, capture_mode,
+ std::move(constants));
}
FileNetLogObserver::~FileNetLogObserver() {
@@ -378,9 +384,8 @@ FileNetLogObserver::~FileNetLogObserver() {
file_task_runner_->DeleteSoon(FROM_HERE, file_writer_.release());
}
-void FileNetLogObserver::StartObserving(NetLog* net_log,
- NetLogCaptureMode capture_mode) {
- net_log->AddObserver(this, capture_mode);
+void FileNetLogObserver::StartObserving(NetLog* net_log) {
+ net_log->AddObserver(this, capture_mode_);
}
void FileNetLogObserver::StopObserving(std::unique_ptr<base::Value> polled_data,
@@ -425,10 +430,11 @@ std::unique_ptr<FileNetLogObserver> FileNetLogObserver::CreateBoundedForTests(
const base::FilePath& log_path,
uint64_t max_total_size,
size_t total_num_event_files,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants) {
return CreateInternal(log_path, SiblingInprogressDirectory(log_path),
base::nullopt, max_total_size, total_num_event_files,
- std::move(constants));
+ capture_mode, std::move(constants));
}
std::unique_ptr<FileNetLogObserver> FileNetLogObserver::CreateInternal(
@@ -437,6 +443,7 @@ std::unique_ptr<FileNetLogObserver> FileNetLogObserver::CreateInternal(
base::Optional<base::File> pre_existing_log_file,
uint64_t max_total_size,
size_t total_num_event_files,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants) {
DCHECK_GT(total_num_event_files, 0u);
@@ -469,25 +476,43 @@ std::unique_ptr<FileNetLogObserver> FileNetLogObserver::CreateInternal(
return base::WrapUnique(new FileNetLogObserver(
file_task_runner, std::move(file_writer),
base::WrapRefCounted(new WriteQueue(write_queue_memory_max)),
- std::move(constants)));
+ capture_mode, std::move(constants)));
}
FileNetLogObserver::FileNetLogObserver(
scoped_refptr<base::SequencedTaskRunner> file_task_runner,
std::unique_ptr<FileWriter> file_writer,
scoped_refptr<WriteQueue> write_queue,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants)
: file_task_runner_(std::move(file_task_runner)),
write_queue_(std::move(write_queue)),
- file_writer_(std::move(file_writer)) {
+ file_writer_(std::move(file_writer)),
+ capture_mode_(capture_mode) {
if (!constants)
constants = base::Value::ToUniquePtrValue(GetNetConstants());
+
+ DCHECK(!constants->FindKey("logCaptureMode"));
+ constants->SetStringKey("logCaptureMode", CaptureModeToString(capture_mode));
file_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&FileNetLogObserver::FileWriter::Initialize,
base::Unretained(file_writer_.get()),
std::move(constants)));
}
+std::string FileNetLogObserver::CaptureModeToString(NetLogCaptureMode mode) {
+ switch (mode) {
+ case NetLogCaptureMode::kDefault:
+ return "Default";
+ case NetLogCaptureMode::kIncludeSensitive:
+ return "IncludeSensitive";
+ case NetLogCaptureMode::kEverything:
+ return "Everything";
+ }
+ NOTREACHED();
+ return "UNKNOWN";
+}
+
FileNetLogObserver::WriteQueue::WriteQueue(uint64_t memory_max)
: memory_(0), memory_max_(memory_max) {}
diff --git a/chromium/net/log/file_net_log_observer.h b/chromium/net/log/file_net_log_observer.h
index 05943c12686..2ed9862b2d8 100644
--- a/chromium/net/log/file_net_log_observer.h
+++ b/chromium/net/log/file_net_log_observer.h
@@ -58,11 +58,13 @@ class NET_EXPORT FileNetLogObserver : public NetLog::ThreadSafeObserver {
static std::unique_ptr<FileNetLogObserver> CreateBounded(
const base::FilePath& log_path,
uint64_t max_total_size,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants);
// Shortcut for calling CreateBounded() with kNoLimit.
static std::unique_ptr<FileNetLogObserver> CreateUnbounded(
const base::FilePath& log_path,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants);
// Creates a bounded log that writes to a pre-existing file (truncating
@@ -73,18 +75,20 @@ class NET_EXPORT FileNetLogObserver : public NetLog::ThreadSafeObserver {
const base::FilePath& inprogress_dir_path,
base::File output_file,
uint64_t max_total_size,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants);
// Creates an unbounded log that writes to a pre-existing file (truncating
// it to start with, and closing it upon completion).
static std::unique_ptr<FileNetLogObserver> CreateUnboundedPreExisting(
base::File output_file,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants);
~FileNetLogObserver() override;
// Attaches this observer to |net_log| and begins observing events.
- void StartObserving(NetLog* net_log, NetLogCaptureMode capture_mode);
+ void StartObserving(NetLog* net_log);
// Stops observing net_log() and closes the output file(s). Must be called
// after StartObserving. Should be called before destruction of the
@@ -112,6 +116,7 @@ class NET_EXPORT FileNetLogObserver : public NetLog::ThreadSafeObserver {
const base::FilePath& log_path,
uint64_t max_total_size,
size_t total_num_event_files,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants);
private:
@@ -124,13 +129,17 @@ class NET_EXPORT FileNetLogObserver : public NetLog::ThreadSafeObserver {
base::Optional<base::File> pre_existing_out_file,
uint64_t max_total_size,
size_t total_num_event_files,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants);
FileNetLogObserver(scoped_refptr<base::SequencedTaskRunner> file_task_runner,
std::unique_ptr<FileWriter> file_writer,
scoped_refptr<WriteQueue> write_queue,
+ NetLogCaptureMode capture_mode,
std::unique_ptr<base::Value> constants);
+ static std::string CaptureModeToString(NetLogCaptureMode mode);
+
scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
// The |write_queue_| object is shared between the file task runner and the
@@ -147,6 +156,8 @@ class NET_EXPORT FileNetLogObserver : public NetLog::ThreadSafeObserver {
// finished (since it is posted using base::Unretained()).
std::unique_ptr<FileWriter> file_writer_;
+ const NetLogCaptureMode capture_mode_;
+
DISALLOW_COPY_AND_ASSIGN(FileNetLogObserver);
};
diff --git a/chromium/net/log/file_net_log_observer_unittest.cc b/chromium/net/log/file_net_log_observer_unittest.cc
index c4ae9cdb748..611266e2dea 100644
--- a/chromium/net/log/file_net_log_observer_unittest.cc
+++ b/chromium/net/log/file_net_log_observer_unittest.cc
@@ -234,16 +234,19 @@ class FileNetLogObserverTest : public ::testing::TestWithParam<bool>,
bool IsBounded() const { return GetParam(); }
- void CreateAndStartObserving(std::unique_ptr<base::Value> constants) {
+ void CreateAndStartObserving(
+ std::unique_ptr<base::Value> constants,
+ NetLogCaptureMode capture_mode = NetLogCaptureMode::kDefault) {
if (IsBounded()) {
logger_ = FileNetLogObserver::CreateBoundedForTests(
- log_path_, kLargeFileSize, kTotalNumFiles, std::move(constants));
+ log_path_, kLargeFileSize, kTotalNumFiles, capture_mode,
+ std::move(constants));
} else {
- logger_ =
- FileNetLogObserver::CreateUnbounded(log_path_, std::move(constants));
+ logger_ = FileNetLogObserver::CreateUnbounded(log_path_, capture_mode,
+ std::move(constants));
}
- logger_->StartObserving(&net_log_, NetLogCaptureMode::kDefault);
+ logger_->StartObserving(&net_log_);
}
void CreateAndStartObservingPreExisting(
@@ -259,13 +262,13 @@ class FileNetLogObserverTest : public ::testing::TestWithParam<bool>,
if (IsBounded()) {
logger_ = FileNetLogObserver::CreateBoundedPreExisting(
scratch_dir_.GetPath(), std::move(file), kLargeFileSize,
- std::move(constants));
+ NetLogCaptureMode::kDefault, std::move(constants));
} else {
logger_ = FileNetLogObserver::CreateUnboundedPreExisting(
- std::move(file), std::move(constants));
+ std::move(file), NetLogCaptureMode::kDefault, std::move(constants));
}
- logger_->StartObserving(&net_log_, NetLogCaptureMode::kDefault);
+ logger_->StartObserving(&net_log_);
}
bool LogFileExists() {
@@ -303,8 +306,9 @@ class FileNetLogObserverBoundedTest : public ::testing::Test,
uint64_t total_file_size,
int num_files) {
logger_ = FileNetLogObserver::CreateBoundedForTests(
- log_path_, total_file_size, num_files, std::move(constants));
- logger_->StartObserving(&net_log_, NetLogCaptureMode::kDefault);
+ log_path_, total_file_size, num_files, NetLogCaptureMode::kDefault,
+ std::move(constants));
+ logger_->StartObserving(&net_log_);
}
// Returns the path for an internally directory created for bounded logs (this
@@ -486,11 +490,12 @@ TEST_P(FileNetLogObserverTest, PreExistingFileBroken) {
EXPECT_FALSE(file.IsValid());
if (IsBounded())
logger_ = FileNetLogObserver::CreateBoundedPreExisting(
- scratch_dir_.GetPath(), std::move(file), kLargeFileSize, nullptr);
+ scratch_dir_.GetPath(), std::move(file), kLargeFileSize,
+ NetLogCaptureMode::kDefault, nullptr);
else
- logger_ = FileNetLogObserver::CreateUnboundedPreExisting(std::move(file),
- nullptr);
- logger_->StartObserving(&net_log_, NetLogCaptureMode::kDefault);
+ logger_ = FileNetLogObserver::CreateUnboundedPreExisting(
+ std::move(file), NetLogCaptureMode::kDefault, nullptr);
+ logger_->StartObserving(&net_log_);
// Send dummy event.
AddEntries(logger_.get(), 1, kDummyEventSize);
@@ -551,6 +556,28 @@ TEST_P(FileNetLogObserverTest, GeneratesValidJSONWithPolledData) {
kDummyPolledDataString);
}
+// Ensure that the Capture Mode is recorded as a constant in the NetLog.
+TEST_P(FileNetLogObserverTest, LogModeRecorded) {
+ struct TestCase {
+ NetLogCaptureMode capture_mode;
+ const char* expected_value;
+ } test_cases[] = {// Challenges that result in success results.
+ {NetLogCaptureMode::kEverything, "Everything"},
+ {NetLogCaptureMode::kIncludeSensitive, "IncludeSensitive"},
+ {NetLogCaptureMode::kDefault, "Default"}};
+
+ TestClosure closure;
+ for (const auto& test_case : test_cases) {
+ CreateAndStartObserving(nullptr, test_case.capture_mode);
+ logger_->StopObserving(nullptr, closure.closure());
+ closure.WaitForResult();
+ std::unique_ptr<ParsedNetLog> log = ReadNetLogFromDisk(log_path_);
+ ASSERT_TRUE(log);
+ ExpectDictionaryContainsProperty(log->constants, "logCaptureMode",
+ test_case.expected_value);
+ }
+}
+
// Adds events concurrently from several different threads. The exact order of
// events seen by this test is non-deterministic.
TEST_P(FileNetLogObserverTest, AddEventsFromMultipleThreads) {
@@ -946,8 +973,9 @@ TEST_F(FileNetLogObserverBoundedTest, PreExistingUsesSpecifiedDir) {
file.Write(0, "not json", 8);
logger_ = FileNetLogObserver::CreateBoundedPreExisting(
- scratch_dir.GetPath(), std::move(file), kLargeFileSize, nullptr);
- logger_->StartObserving(&net_log_, NetLogCaptureMode::kDefault);
+ scratch_dir.GetPath(), std::move(file), kLargeFileSize,
+ NetLogCaptureMode::kDefault, nullptr);
+ logger_->StartObserving(&net_log_);
base::ThreadPoolInstance::Get()->FlushForTesting();
EXPECT_TRUE(base::PathExists(log_path_));
diff --git a/chromium/net/log/net_log_event_type_list.h b/chromium/net/log/net_log_event_type_list.h
index cde2b503fe6..04e817fb799 100644
--- a/chromium/net/log/net_log_event_type_list.h
+++ b/chromium/net/log/net_log_event_type_list.h
@@ -2247,6 +2247,12 @@ EVENT_TYPE(QUIC_SESSION_DROPPED_UNDECRYPTABLE_PACKET)
// }
EVENT_TYPE(QUIC_SESSION_ATTEMPTING_TO_PROCESS_UNDECRYPTABLE_PACKET)
+// Session has updated to the next set of 1-RTT keys.
+// {
+// "reason": <the reason the key update was triggered>
+// }
+EVENT_TYPE(QUIC_SESSION_KEY_UPDATE)
+
// ------------------------------------------------------------------------
// QuicHttpStream
// ------------------------------------------------------------------------
diff --git a/chromium/net/log/net_log_util.cc b/chromium/net/log/net_log_util.cc
index 7510d7987e5..980dc11caa4 100644
--- a/chromium/net/log/net_log_util.cc
+++ b/chromium/net/log/net_log_util.cc
@@ -19,6 +19,7 @@
#include "net/base/address_family.h"
#include "net/base/load_states.h"
#include "net/base/net_errors.h"
+#include "net/base/net_info_source_list.h"
#include "net/cert/cert_verifier.h"
#include "net/cert/internal/simple_path_builder_delegate.h"
#include "net/cert/internal/trust_store.h"
@@ -62,25 +63,19 @@ struct StringToConstant {
};
const StringToConstant kCertStatusFlags[] = {
-#define CERT_STATUS_FLAG(label, value) \
- { #label, value } \
- ,
+#define CERT_STATUS_FLAG(label, value) {#label, value},
#include "net/cert/cert_status_flags_list.h"
#undef CERT_STATUS_FLAG
};
const StringToConstant kLoadFlags[] = {
-#define LOAD_FLAG(label, value) \
- { #label, value } \
- ,
+#define LOAD_FLAG(label, value) {#label, value},
#include "net/base/load_flags_list.h"
#undef LOAD_FLAG
};
const StringToConstant kLoadStateTable[] = {
-#define LOAD_STATE(label, value) \
- { #label, LOAD_STATE_##label } \
- ,
+#define LOAD_STATE(label, value) {#label, LOAD_STATE_##label},
#include "net/base/load_states_list.h"
#undef LOAD_STATE
};
@@ -121,21 +116,18 @@ bool RequestCreatedBefore(const URLRequest* request1,
return request1->net_log().source().id < request2->net_log().source().id;
}
-} // namespace
-
-const char* NetInfoSourceToString(NetInfoSource source) {
- switch (source) {
-#define NET_INFO_SOURCE(label, string, value) \
- case NET_INFO_##label: \
- return string;
-#include "net/base/net_info_source_list.h"
-#undef NET_INFO_SOURCE
- case NET_INFO_ALL_SOURCES:
- return "All";
+base::Value GetActiveFieldTrialList() {
+ base::FieldTrial::ActiveGroups active_groups;
+ base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups);
+ base::Value field_trial_groups(base::Value::Type::LIST);
+ for (const auto& group : active_groups) {
+ field_trial_groups.Append(group.trial_name + ":" + group.group_name);
}
- return "?";
+ return field_trial_groups;
}
+} // namespace
+
base::Value GetNetConstants() {
base::Value constants_dict(base::Value::Type::DICTIONARY);
@@ -231,15 +223,6 @@ base::Value GetNetConstants() {
constants_dict.SetKey("loadState", std::move(dict));
}
- {
- base::Value dict(base::Value::Type::DICTIONARY);
-#define NET_INFO_SOURCE(label, string, value) \
- dict.SetIntKey(string, NET_INFO_##label);
-#include "net/base/net_info_source_list.h"
-#undef NET_INFO_SOURCE
- constants_dict.SetKey("netInfoSources", std::move(dict));
- }
-
// Add information on the relationship between net error codes and their
// symbolic names.
{
@@ -335,33 +318,22 @@ base::Value GetNetConstants() {
constants_dict.SetKey("clientInfo",
base::Value(base::Value::Type::DICTIONARY));
- // Add a list of active field experiments.
- {
- base::FieldTrial::ActiveGroups active_groups;
- base::FieldTrialList::GetActiveFieldTrialGroups(&active_groups);
- auto field_trial_groups = std::make_unique<base::ListValue>();
- for (base::FieldTrial::ActiveGroups::const_iterator it =
- active_groups.begin();
- it != active_groups.end(); ++it) {
- field_trial_groups->AppendString(it->trial_name + ":" + it->group_name);
- }
- constants_dict.SetKey(
- "activeFieldTrialGroups",
- base::Value::FromUniquePtrValue(std::move(field_trial_groups)));
- }
+ // Add a list of field experiments active at the start of the capture.
+ // Additional trials may be enabled later in the browser session.
+ constants_dict.SetKey(kNetInfoFieldTrials, GetActiveFieldTrialList());
return constants_dict;
}
-NET_EXPORT base::Value GetNetInfo(URLRequestContext* context,
- int info_sources) {
+NET_EXPORT base::Value GetNetInfo(URLRequestContext* context) {
// May only be called on the context's thread.
context->AssertCalledOnValidThread();
base::Value net_info_dict =
- context->proxy_resolution_service()->GetProxyNetLogValues(info_sources);
+ context->proxy_resolution_service()->GetProxyNetLogValues();
- if (info_sources & NET_INFO_HOST_RESOLVER) {
+ // Log Host Resolver info.
+ {
HostResolver* host_resolver = context->host_resolver();
DCHECK(host_resolver);
HostCache* cache = host_resolver->GetHostCache();
@@ -384,28 +356,30 @@ NET_EXPORT base::Value GetNetInfo(URLRequestContext* context,
cache_info_dict.SetKey("entries", std::move(cache_contents_list));
dict.SetKey("cache", std::move(cache_info_dict));
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_HOST_RESOLVER),
- std::move(dict));
+ net_info_dict.SetKey(kNetInfoHostResolver, std::move(dict));
}
}
HttpNetworkSession* http_network_session =
context->http_transaction_factory()->GetSession();
- if (info_sources & NET_INFO_SOCKET_POOL) {
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_SOCKET_POOL),
+ // Log Socket Pool info.
+ {
+ net_info_dict.SetKey(kNetInfoSocketPool,
base::Value::FromUniquePtrValue(
http_network_session->SocketPoolInfoToValue()));
}
- if (info_sources & NET_INFO_SPDY_SESSIONS) {
+ // Log SPDY Sessions.
+ {
net_info_dict.SetKey(
- NetInfoSourceToString(NET_INFO_SPDY_SESSIONS),
+ kNetInfoSpdySessions,
base::Value::FromUniquePtrValue(
http_network_session->SpdySessionPoolInfoToValue()));
}
- if (info_sources & NET_INFO_SPDY_STATUS) {
+ // Log SPDY status.
+ {
base::Value status_dict(base::Value::Type::DICTIONARY);
status_dict.SetBoolKey("enable_http2",
@@ -423,26 +397,25 @@ NET_EXPORT base::Value GetNetInfo(URLRequestContext* context,
status_dict.SetStringKey("alpn_protos", next_protos_string);
}
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_SPDY_STATUS),
- std::move(status_dict));
+ net_info_dict.SetKey(kNetInfoSpdyStatus, std::move(status_dict));
}
- if (info_sources & NET_INFO_ALT_SVC_MAPPINGS) {
+ // Log ALT_SVC mappings.
+ {
const HttpServerProperties& http_server_properties =
*context->http_server_properties();
net_info_dict.SetKey(
- NetInfoSourceToString(NET_INFO_ALT_SVC_MAPPINGS),
- base::Value::FromUniquePtrValue(
- http_server_properties.GetAlternativeServiceInfoAsValue()));
+ kNetInfoAltSvcMappings,
+ http_server_properties.GetAlternativeServiceInfoAsValue());
}
- if (info_sources & NET_INFO_QUIC) {
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_QUIC),
- base::Value::FromUniquePtrValue(
- http_network_session->QuicInfoToValue()));
+ // Log QUIC info.
+ {
+ net_info_dict.SetKey(kNetInfoQuic, http_network_session->QuicInfoToValue());
}
- if (info_sources & NET_INFO_HTTP_CACHE) {
+ // Log HTTP Cache info.
+ {
base::Value info_dict(base::Value::Type::DICTIONARY);
base::Value stats_dict(base::Value::Type::DICTIONARY);
@@ -458,11 +431,11 @@ NET_EXPORT base::Value GetNetInfo(URLRequestContext* context,
}
info_dict.SetKey("stats", std::move(stats_dict));
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_HTTP_CACHE),
- std::move(info_dict));
+ net_info_dict.SetKey(kNetInfoHTTPCache, std::move(info_dict));
}
- if (info_sources & NET_INFO_REPORTING) {
+ // Log Reporting API info.
+ {
#if BUILDFLAG(ENABLE_REPORTING)
ReportingService* reporting_service = context->reporting_service();
if (reporting_service) {
@@ -473,23 +446,24 @@ NET_EXPORT base::Value GetNetInfo(URLRequestContext* context,
reporting_dict.SetKey("networkErrorLogging",
network_error_logging_service->StatusAsValue());
}
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_REPORTING),
- std::move(reporting_dict));
+ net_info_dict.SetKey(kNetInfoReporting, std::move(reporting_dict));
} else {
base::Value reporting_dict(base::Value::Type::DICTIONARY);
reporting_dict.SetKey("reportingEnabled", base::Value(false));
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_REPORTING),
- std::move(reporting_dict));
+ net_info_dict.SetKey(kNetInfoReporting, std::move(reporting_dict));
}
#else // BUILDFLAG(ENABLE_REPORTING)
base::Value reporting_dict(base::Value::Type::DICTIONARY);
reporting_dict.SetKey("reportingEnabled", base::Value(false));
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_REPORTING),
- std::move(reporting_dict));
+ net_info_dict.SetKey(kNetInfoReporting, std::move(reporting_dict));
#endif // BUILDFLAG(ENABLE_REPORTING)
}
+ // Log currently-active field trials. New trials may have been enabled since
+ // the start of this browser session (crbug.com/1133396).
+ net_info_dict.SetKey(kNetInfoFieldTrials, GetActiveFieldTrialList());
+
return net_info_dict;
}
diff --git a/chromium/net/log/net_log_util.h b/chromium/net/log/net_log_util.h
index 5de85dcedc8..569be89b218 100644
--- a/chromium/net/log/net_log_util.h
+++ b/chromium/net/log/net_log_util.h
@@ -15,30 +15,16 @@ namespace net {
class URLRequestContext;
-// A set of flags that can be OR'd together to request specific information
-// about the current state of the URLRequestContext. See GetNetInfo, below.
-enum NetInfoSource {
-#define NET_INFO_SOURCE(label, string, value) NET_INFO_##label = value,
-#include "net/base/net_info_source_list.h"
-#undef NET_INFO_SOURCE
- NET_INFO_ALL_SOURCES = -1,
-};
-
// Utility methods for creating NetLog dumps.
-// Returns a friendly string to use for a given NetInfoSource in the net log.
-NET_EXPORT const char* NetInfoSourceToString(NetInfoSource source);
-
// Creates a dictionary containing a legend for net/ constants.
NET_EXPORT base::Value GetNetConstants();
// Retrieves a dictionary containing information about the current state of
-// |context|. |info_sources| is a set of NetInfoSources OR'd together,
-// indicating just what information is being requested. Each NetInfoSource adds
-// one top-level entry to the returned dictionary.
+// |context|.
//
// May only be called on |context|'s thread.
-NET_EXPORT base::Value GetNetInfo(URLRequestContext* context, int info_sources);
+NET_EXPORT base::Value GetNetInfo(URLRequestContext* context);
// Takes in a set of contexts and a NetLog::Observer, and passes in
// NetLog::Entries to the observer for certain NetLogSources with pending
diff --git a/chromium/net/log/net_log_util_unittest.cc b/chromium/net/log/net_log_util_unittest.cc
index 2189cd53954..c36f65d46a5 100644
--- a/chromium/net/log/net_log_util_unittest.cc
+++ b/chromium/net/log/net_log_util_unittest.cc
@@ -8,6 +8,8 @@
#include <vector>
#include "base/files/file_path.h"
+#include "base/metrics/field_trial.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "net/base/net_errors.h"
@@ -40,22 +42,51 @@ TEST(NetLogUtil, GetNetInfo) {
// Get NetInfo when there's no cache backend (It's only created on first use).
EXPECT_FALSE(http_cache->GetCurrentBackend());
- base::Value net_info_without_cache(
- GetNetInfo(&context, NET_INFO_ALL_SOURCES));
+ base::Value net_info_without_cache(GetNetInfo(&context));
EXPECT_FALSE(http_cache->GetCurrentBackend());
EXPECT_GT(net_info_without_cache.DictSize(), 0u);
- // Fore creation of a cache backend, and get NetInfo again.
+ // Force creation of a cache backend, and get NetInfo again.
disk_cache::Backend* backend = nullptr;
EXPECT_EQ(OK, context.http_transaction_factory()->GetCache()->GetBackend(
&backend, TestCompletionCallback().callback()));
EXPECT_TRUE(http_cache->GetCurrentBackend());
- base::Value net_info_with_cache = GetNetInfo(&context, NET_INFO_ALL_SOURCES);
+ base::Value net_info_with_cache = GetNetInfo(&context);
EXPECT_GT(net_info_with_cache.DictSize(), 0u);
EXPECT_EQ(net_info_without_cache.DictSize(), net_info_with_cache.DictSize());
}
+// Verify that active Field Trials are reflected.
+TEST(NetLogUtil, GetNetInfoIncludesFieldTrials) {
+ base::test::TaskEnvironment task_environment;
+
+ // Clear all Field Trials.
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitWithFeatureList(
+ std::make_unique<base::FeatureList>());
+
+ // Add and activate a new Field Trial.
+ base::FieldTrial* field_trial = base::FieldTrialList::FactoryGetFieldTrial(
+ "NewFieldTrial", 100, "Default", base::FieldTrial::ONE_TIME_RANDOMIZED,
+ nullptr);
+ field_trial->AppendGroup("Active", 100);
+ EXPECT_EQ(field_trial->group_name(), "Active");
+
+ TestURLRequestContext context;
+ base::Value net_info(GetNetInfo(&context));
+
+ // Verify that the returned information reflects the new trial.
+ ASSERT_TRUE(net_info.is_dict());
+ base::Value* trials = net_info.FindListPath("activeFieldTrialGroups");
+ ASSERT_NE(nullptr, trials);
+ const auto& trial_list = trials->GetList();
+ EXPECT_EQ(1u, trial_list.size());
+ std::string result;
+ EXPECT_TRUE(trial_list[0].GetAsString(&result));
+ EXPECT_EQ("NewFieldTrial:Active", result);
+}
+
// Make sure CreateNetLogEntriesForActiveObjects works for requests from a
// single URLRequestContext.
TEST(NetLogUtil, CreateNetLogEntriesForActiveObjectsOneContext) {
diff --git a/chromium/net/network_error_logging/DIR_METADATA b/chromium/net/network_error_logging/DIR_METADATA
new file mode 100644
index 00000000000..eed1c3b6800
--- /dev/null
+++ b/chromium/net/network_error_logging/DIR_METADATA
@@ -0,0 +1,14 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+# This is the component for the Network Error Logging API.
+# For chrome://net-export and NetLogs, see Internals>Network>Logging.
+# For network errors in general, see Internals>Network.
+monorail {
+ component: "Internals>Network>ReportingAndNEL"
+} \ No newline at end of file
diff --git a/chromium/net/network_error_logging/OWNERS b/chromium/net/network_error_logging/OWNERS
index 4e378e9fde3..7117a80a72b 100644
--- a/chromium/net/network_error_logging/OWNERS
+++ b/chromium/net/network_error_logging/OWNERS
@@ -1,7 +1 @@
chlily@chromium.org
-
-# This is the component for the Network Error Logging API.
-# For chrome://net-export and NetLogs, see Internals>Network>Logging.
-# For network errors in general, see Internals>Network.
-
-# COMPONENT: Internals>Network>ReportingAndNEL
diff --git a/chromium/net/network_error_logging/mock_persistent_nel_store.cc b/chromium/net/network_error_logging/mock_persistent_nel_store.cc
index 9de31285f7f..468c241a94c 100644
--- a/chromium/net/network_error_logging/mock_persistent_nel_store.cc
+++ b/chromium/net/network_error_logging/mock_persistent_nel_store.cc
@@ -16,12 +16,12 @@ MockPersistentNelStore::Command::Command(
MockPersistentNelStore::Command::Command(
Type type,
const NetworkErrorLoggingService::NelPolicy& policy)
- : type(type), origin(policy.origin) {}
+ : type(type), key(policy.key) {}
MockPersistentNelStore::Command::Command(Type type) : type(type) {}
MockPersistentNelStore::Command::Command(const Command& other)
- : type(other.type), origin(other.origin) {}
+ : type(other.type), key(other.key) {}
MockPersistentNelStore::Command::Command(Command&& other) = default;
@@ -37,11 +37,11 @@ bool operator==(const MockPersistentNelStore::Command& lhs,
case MockPersistentNelStore::Command::Type::FLUSH:
return true;
// For ADD_NEL_POLICY, UPDATE_NEL_POLICY, and DELETE_NEL_POLICY,
- // additionally check the policy's origin.
+ // additionally check the policy's key.
case MockPersistentNelStore::Command::Type::ADD_NEL_POLICY:
case MockPersistentNelStore::Command::Type::UPDATE_NEL_POLICY:
case MockPersistentNelStore::Command::Type::DELETE_NEL_POLICY:
- return (lhs.origin == rhs.origin);
+ return (lhs.key == rhs.key);
}
}
@@ -132,30 +132,4 @@ MockPersistentNelStore::CommandList MockPersistentNelStore::GetAllCommands()
return command_list_;
}
-std::string MockPersistentNelStore::GetDebugString() const {
- std::ostringstream s;
-
- for (const Command& command : command_list_) {
- switch (command.type) {
- case Command::Type::LOAD_NEL_POLICIES:
- s << "LOAD; ";
- break;
- case Command::Type::ADD_NEL_POLICY:
- s << "ADD(" << command.origin.Serialize() << "); ";
- break;
- case Command::Type::UPDATE_NEL_POLICY:
- s << "UPDATE(" << command.origin.Serialize() << "); ";
- break;
- case Command::Type::DELETE_NEL_POLICY:
- s << "DELETE(" << command.origin.Serialize() << "); ";
- break;
- case Command::Type::FLUSH:
- s << "FLUSH; ";
- break;
- }
- }
-
- return s.str();
-}
-
} // namespace net
diff --git a/chromium/net/network_error_logging/mock_persistent_nel_store.h b/chromium/net/network_error_logging/mock_persistent_nel_store.h
index cbf2f52add0..a5a646da609 100644
--- a/chromium/net/network_error_logging/mock_persistent_nel_store.h
+++ b/chromium/net/network_error_logging/mock_persistent_nel_store.h
@@ -48,9 +48,9 @@ class MockPersistentNelStore
// Type of command.
Type type;
- // The origin of the policy that the command pertains to. (Only applies for
+ // The key of the policy that the command pertains to. (Only applies for
// add, update, and delete)
- url::Origin origin;
+ NetworkErrorLoggingService::NelPolicyKey key;
// The supplied callback to be run when loading is complete. (Only applies
// for load commands).
@@ -94,9 +94,6 @@ class MockPersistentNelStore
// this were a real store.
int StoredPoliciesCount() const { return policy_count_; }
- // Generates a string with the list of commands, for ease of debugging.
- std::string GetDebugString() const;
-
private:
// List of commands that we have received so far.
CommandList command_list_;
diff --git a/chromium/net/network_error_logging/mock_persistent_nel_store_unittest.cc b/chromium/net/network_error_logging/mock_persistent_nel_store_unittest.cc
index 601a7672162..8914640b700 100644
--- a/chromium/net/network_error_logging/mock_persistent_nel_store_unittest.cc
+++ b/chromium/net/network_error_logging/mock_persistent_nel_store_unittest.cc
@@ -5,7 +5,9 @@
#include <string>
#include "base/location.h"
-#include "base/test/bind_test_util.h"
+#include "base/strings/strcat.h"
+#include "base/test/bind.h"
+#include "net/base/network_isolation_key.h"
#include "net/network_error_logging/mock_persistent_nel_store.h"
#include "net/network_error_logging/network_error_logging_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -16,9 +18,12 @@ namespace net {
namespace {
-NetworkErrorLoggingService::NelPolicy MakePolicyForOrigin(url::Origin origin) {
+NetworkErrorLoggingService::NelPolicy MakePolicy(
+ const url::Origin& origin,
+ const net::NetworkIsolationKey& network_isolation_key) {
NetworkErrorLoggingService::NelPolicy policy;
- policy.origin = std::move(origin);
+ policy.key =
+ NetworkErrorLoggingService::NelPolicyKey(network_isolation_key, origin);
policy.expires = base::Time();
policy.last_used = base::Time();
@@ -43,8 +48,23 @@ MakeExpectedRunNelPoliciesLoadedCallback(
policies_out);
}
+class MockPersistentNelStoreTest : public testing::Test {
+ public:
+ MockPersistentNelStoreTest() = default;
+ ~MockPersistentNelStoreTest() override = default;
+
+ protected:
+ const url::Origin origin_ =
+ url::Origin::Create(GURL("https://example.test/"));
+ const NetworkIsolationKey network_isolation_key_ =
+ NetworkIsolationKey(url::Origin::Create(GURL("https://foo.test/")),
+ url::Origin::Create(GURL("https://bar.test/")));
+ const NetworkErrorLoggingService::NelPolicy nel_policy_ =
+ MakePolicy(origin_, network_isolation_key_);
+};
+
// Test that FinishLoading() runs the callback.
-TEST(MockPersistentNelStoreTest, FinishLoading) {
+TEST_F(MockPersistentNelStoreTest, FinishLoading) {
MockPersistentNelStore store;
MockPersistentNelStore::CommandList expected_commands;
std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies;
@@ -59,13 +79,12 @@ TEST(MockPersistentNelStoreTest, FinishLoading) {
EXPECT_EQ(1u, store.GetAllCommands().size());
EXPECT_TRUE(store.VerifyCommands(expected_commands));
- EXPECT_EQ("LOAD; ", store.GetDebugString());
// Test should not crash because the callback has been run.
}
-TEST(MockPersistentNelStoreTest, PreStoredPolicies) {
- const url::Origin kOrigin =
+TEST_F(MockPersistentNelStoreTest, PreStoredPolicies) {
+ const url::Origin origin_ =
url::Origin::Create(GURL("https://example.test/"));
MockPersistentNelStore store;
@@ -73,7 +92,7 @@ TEST(MockPersistentNelStoreTest, PreStoredPolicies) {
std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies;
std::vector<NetworkErrorLoggingService::NelPolicy> prestored_policies = {
- MakePolicyForOrigin(kOrigin)};
+ nel_policy_};
store.SetPrestoredPolicies(std::move(prestored_policies));
EXPECT_EQ(1, store.StoredPoliciesCount());
@@ -83,21 +102,22 @@ TEST(MockPersistentNelStoreTest, PreStoredPolicies) {
MockPersistentNelStore::Command::Type::LOAD_NEL_POLICIES);
store.FinishLoading(true /* load_success */);
ASSERT_EQ(1u, loaded_policies.size());
- EXPECT_EQ(kOrigin, loaded_policies[0].origin);
+ EXPECT_EQ(origin_, loaded_policies[0].key.origin);
+ EXPECT_EQ(network_isolation_key_,
+ loaded_policies[0].key.network_isolation_key);
EXPECT_EQ(1u, store.GetAllCommands().size());
EXPECT_TRUE(store.VerifyCommands(expected_commands));
- EXPECT_EQ("LOAD; ", store.GetDebugString());
}
// Failed load should yield empty vector of policies.
-TEST(MockPersistentNelStoreTest, FailedLoad) {
+TEST_F(MockPersistentNelStoreTest, FailedLoad) {
MockPersistentNelStore store;
MockPersistentNelStore::CommandList expected_commands;
std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies;
std::vector<NetworkErrorLoggingService::NelPolicy> prestored_policies = {
- MakePolicyForOrigin(url::Origin::Create(GURL("https://example.test/")))};
+ nel_policy_};
store.SetPrestoredPolicies(std::move(prestored_policies));
EXPECT_EQ(1, store.StoredPoliciesCount());
@@ -111,13 +131,9 @@ TEST(MockPersistentNelStoreTest, FailedLoad) {
EXPECT_EQ(1u, store.GetAllCommands().size());
EXPECT_TRUE(store.VerifyCommands(expected_commands));
- EXPECT_EQ("LOAD; ", store.GetDebugString());
}
-TEST(MockPersistentNelStoreTest, Add) {
- const url::Origin kOrigin =
- url::Origin::Create(GURL("https://example.test/"));
-
+TEST_F(MockPersistentNelStoreTest, Add) {
MockPersistentNelStore store;
MockPersistentNelStore::CommandList expected_commands;
std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies;
@@ -131,7 +147,7 @@ TEST(MockPersistentNelStoreTest, Add) {
store.FinishLoading(true /* load_success */);
EXPECT_EQ(0u, loaded_policies.size());
- NetworkErrorLoggingService::NelPolicy policy = MakePolicyForOrigin(kOrigin);
+ NetworkErrorLoggingService::NelPolicy policy = nel_policy_;
store.AddNelPolicy(policy);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::ADD_NEL_POLICY, policy);
@@ -145,14 +161,9 @@ TEST(MockPersistentNelStoreTest, Add) {
EXPECT_EQ(3u, store.GetAllCommands().size());
EXPECT_TRUE(store.VerifyCommands(expected_commands));
- EXPECT_EQ("LOAD; ADD(" + kOrigin.Serialize() + "); FLUSH; ",
- store.GetDebugString());
}
-TEST(MockPersistentNelStoreTest, AddThenDelete) {
- const url::Origin kOrigin =
- url::Origin::Create(GURL("https://example.test/"));
-
+TEST_F(MockPersistentNelStoreTest, AddThenDelete) {
MockPersistentNelStore store;
MockPersistentNelStore::CommandList expected_commands;
std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies;
@@ -166,7 +177,7 @@ TEST(MockPersistentNelStoreTest, AddThenDelete) {
store.FinishLoading(true /* load_success */);
EXPECT_EQ(0u, loaded_policies.size());
- NetworkErrorLoggingService::NelPolicy policy = MakePolicyForOrigin(kOrigin);
+ NetworkErrorLoggingService::NelPolicy policy = nel_policy_;
store.AddNelPolicy(policy);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::ADD_NEL_POLICY, policy);
@@ -183,17 +194,9 @@ TEST(MockPersistentNelStoreTest, AddThenDelete) {
EXPECT_EQ(4u, store.GetAllCommands().size());
EXPECT_TRUE(store.VerifyCommands(expected_commands));
- EXPECT_EQ("LOAD; ADD(" + kOrigin.Serialize() +
- "); "
- "DELETE(" +
- kOrigin.Serialize() + "); FLUSH; ",
- store.GetDebugString());
}
-TEST(MockPersistentNelStoreTest, AddFlushThenDelete) {
- const url::Origin kOrigin =
- url::Origin::Create(GURL("https://example.test/"));
-
+TEST_F(MockPersistentNelStoreTest, AddFlushThenDelete) {
MockPersistentNelStore store;
MockPersistentNelStore::CommandList expected_commands;
std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies;
@@ -207,7 +210,7 @@ TEST(MockPersistentNelStoreTest, AddFlushThenDelete) {
store.FinishLoading(true /* load_success */);
EXPECT_EQ(0u, loaded_policies.size());
- NetworkErrorLoggingService::NelPolicy policy = MakePolicyForOrigin(kOrigin);
+ NetworkErrorLoggingService::NelPolicy policy = nel_policy_;
store.AddNelPolicy(policy);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::ADD_NEL_POLICY, policy);
@@ -229,17 +232,9 @@ TEST(MockPersistentNelStoreTest, AddFlushThenDelete) {
EXPECT_EQ(5u, store.GetAllCommands().size());
EXPECT_TRUE(store.VerifyCommands(expected_commands));
- EXPECT_EQ("LOAD; ADD(" + kOrigin.Serialize() +
- "); FLUSH; "
- "DELETE(" +
- kOrigin.Serialize() + "); FLUSH; ",
- store.GetDebugString());
}
-TEST(MockPersistentNelStoreTest, AddThenUpdate) {
- const url::Origin kOrigin =
- url::Origin::Create(GURL("https://example.test/"));
-
+TEST_F(MockPersistentNelStoreTest, AddThenUpdate) {
MockPersistentNelStore store;
MockPersistentNelStore::CommandList expected_commands;
std::vector<NetworkErrorLoggingService::NelPolicy> loaded_policies;
@@ -252,7 +247,7 @@ TEST(MockPersistentNelStoreTest, AddThenUpdate) {
store.FinishLoading(true /* load_success */);
- NetworkErrorLoggingService::NelPolicy policy = MakePolicyForOrigin(kOrigin);
+ NetworkErrorLoggingService::NelPolicy policy = nel_policy_;
store.AddNelPolicy(policy);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::ADD_NEL_POLICY, policy);
@@ -269,11 +264,6 @@ TEST(MockPersistentNelStoreTest, AddThenUpdate) {
EXPECT_EQ(4u, store.GetAllCommands().size());
EXPECT_TRUE(store.VerifyCommands(expected_commands));
- EXPECT_EQ("LOAD; ADD(" + kOrigin.Serialize() +
- "); "
- "UPDATE(" +
- kOrigin.Serialize() + "); FLUSH; ",
- store.GetDebugString());
}
} // namespace
diff --git a/chromium/net/network_error_logging/network_error_logging_service.cc b/chromium/net/network_error_logging/network_error_logging_service.cc
index c63d8e9a09c..7f0df95ffe9 100644
--- a/chromium/net/network_error_logging/network_error_logging_service.cc
+++ b/chromium/net/network_error_logging/network_error_logging_service.cc
@@ -10,6 +10,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/feature_list.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -20,6 +21,7 @@
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "net/base/features.h"
#include "net/base/ip_address.h"
#include "net/base/net_errors.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
@@ -165,7 +167,8 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
// NetworkErrorLoggingService implementation:
- void OnHeader(const url::Origin& origin,
+ void OnHeader(const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
const IPAddress& received_ip_address,
const std::string& value) override {
// NEL is only available to secure origins, so don't permit insecure origins
@@ -178,6 +181,8 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
// task_backlog_, so the callback will not outlive |*this|.
DoOrBacklogTask(base::BindOnce(
&NetworkErrorLoggingServiceImpl::DoOnHeader, base::Unretained(this),
+ respect_network_isolation_key_ ? network_isolation_key
+ : NetworkIsolationKey(),
origin, received_ip_address, value, header_received_time));
}
@@ -188,6 +193,9 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
if (!reporting_service_)
return;
+ if (!respect_network_isolation_key_)
+ details.network_isolation_key = NetworkIsolationKey();
+
base::Time request_received_time = clock_->Now();
// base::Unretained is safe because the callback gets stored in
// task_backlog_, so the callback will not outlive |*this|.
@@ -208,6 +216,9 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
return;
}
+ if (!respect_network_isolation_key_)
+ details.network_isolation_key = NetworkIsolationKey();
+
base::Time request_received_time = clock_->Now();
// base::Unretained is safe because the callback gets stored in
// task_backlog_, so the callback will not outlive |*this|.
@@ -238,11 +249,14 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
std::vector<base::Value> policy_list;
// We wanted sorted (or at least reproducible) output; luckily, policies_ is
// a std::map, and therefore already sorted.
- for (const auto& origin_and_policy : policies_) {
- const auto& origin = origin_and_policy.first;
- const auto& policy = origin_and_policy.second;
+ for (const auto& key_and_policy : policies_) {
+ const NelPolicyKey& key = key_and_policy.first;
+ const NelPolicy& policy = key_and_policy.second;
base::Value policy_dict(base::Value::Type::DICTIONARY);
- policy_dict.SetKey("origin", base::Value(origin.Serialize()));
+ policy_dict.SetKey(
+ "networkIsolationKey",
+ base::Value(key.network_isolation_key.ToDebugString()));
+ policy_dict.SetKey("origin", base::Value(key.origin.Serialize()));
policy_dict.SetKey("includeSubdomains",
base::Value(policy.include_subdomains));
policy_dict.SetKey("reportTo", base::Value(policy.report_to));
@@ -258,12 +272,12 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
return dict;
}
- std::set<url::Origin> GetPolicyOriginsForTesting() override {
- std::set<url::Origin> origins;
+ std::set<NelPolicyKey> GetPolicyKeysForTesting() override {
+ std::set<NelPolicyKey> keys;
for (const auto& entry : policies_) {
- origins.insert(entry.first);
+ keys.insert(entry.first);
}
- return origins;
+ return keys;
}
NetworkErrorLoggingService::PersistentNelStore*
@@ -276,22 +290,27 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
}
private:
- // Map from origin to origin's (owned) policy.
- // Would be unordered_map, but url::Origin has no hash.
- using PolicyMap = std::map<url::Origin, NelPolicy>;
+ // Map from (NIK, origin) to owned policy.
+ using PolicyMap = std::map<NelPolicyKey, NelPolicy>;
// Wildcard policies are policies for which the include_subdomains flag is
- // set.
+ // true.
//
- // Wildcard policies are accessed by domain name, not full origin, so there
- // can be multiple wildcard policies per domain name.
+ // Wildcard policies are accessed by domain name, not full origin. The key
+ // consists of the NetworkIsolationKey of the policy, plus a string which is
+ // the host part of the policy's origin.
//
- // This is a map from domain name to the set of pointers to wildcard policies
- // in that domain.
+ // Looking up a wildcard policy for a domain yields the wildcard policy with
+ // the longest host part (most specific subdomain) that is a substring of the
+ // domain.
//
- // Policies in the map are unowned; they are pointers to the original in the
- // PolicyMap.
- using WildcardPolicyMap = std::map<std::string, std::set<const NelPolicy*>>;
+ // When multiple policies with the same (NIK, origin.host()) are present, they
+ // are all stored, the policy returned is not well defined.
+ //
+ // Policies in the map are unowned; they are pointers to the original in
+ // the PolicyMap.
+ using WildcardPolicyMap =
+ std::map<WildcardNelPolicyKey, std::set<const NelPolicy*>>;
PolicyMap policies_;
WildcardPolicyMap wildcard_policies_;
@@ -318,6 +337,11 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
// Backlog of tasks waiting on initialization.
std::vector<base::OnceClosure> task_backlog_;
+ // Set based on features::kPartitionNelAndReportingByNetworkIsolationKey on
+ // construction.
+ bool respect_network_isolation_key_ = base::FeatureList::IsEnabled(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
base::WeakPtrFactory<NetworkErrorLoggingServiceImpl> weak_factory_{this};
bool PoliciesArePersisted() const { return store_ != nullptr; }
@@ -348,14 +372,15 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
task_backlog_.clear();
}
- void DoOnHeader(const url::Origin& origin,
+ void DoOnHeader(const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
const IPAddress& received_ip_address,
const std::string& value,
base::Time header_received_time) {
DCHECK(initialized_);
NelPolicy policy;
- policy.origin = origin;
+ policy.key = NelPolicyKey(network_isolation_key, origin);
policy.received_ip_address = received_ip_address;
policy.last_used = header_received_time;
@@ -365,14 +390,14 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
// Disallow eTLDs from setting include_subdomains policies.
if (policy.include_subdomains &&
registry_controlled_domains::GetRegistryLength(
- policy.origin.GetURL(),
+ policy.key.origin.GetURL(),
registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES,
registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES) == 0) {
return;
}
- // If a policy for |origin| already existed, remove the old policy.
- auto it = policies_.find(origin);
+ // If a policy for this NelPolicyKey already existed, remove the old policy.
+ auto it = policies_.find(policy.key);
if (it != policies_.end())
RemovePolicy(it);
@@ -382,7 +407,6 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
if (policy.expires.is_null())
return;
- DVLOG(1) << "Received NEL policy for " << origin;
AddPolicy(std::move(policy));
// Evict policies if the policy limit is exceeded.
@@ -398,8 +422,12 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
DCHECK(reporting_service_);
DCHECK(initialized_);
+ if (!respect_network_isolation_key_)
+ details.network_isolation_key = NetworkIsolationKey();
+
auto report_origin = url::Origin::Create(details.uri);
- const NelPolicy* policy = FindPolicyForOrigin(report_origin);
+ const NelPolicy* policy =
+ FindPolicyForReport(details.network_isolation_key, report_origin);
if (!policy)
return;
@@ -460,8 +488,10 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
<< ", status=" << details.status_code
<< ", depth=" << details.reporting_upload_depth << ") for "
<< details.uri;
+
reporting_service_->QueueReport(
- details.uri, details.user_agent, policy->report_to, kReportType,
+ details.uri, details.network_isolation_key, details.user_agent,
+ policy->report_to, kReportType,
CreateReportBody(phase_string, type_string, sampling_fraction.value(),
details),
details.reporting_upload_depth);
@@ -472,7 +502,8 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
DCHECK(reporting_service_);
const auto report_origin = url::Origin::Create(details.outer_url);
- const NelPolicy* policy = FindPolicyForOrigin(report_origin);
+ const NelPolicy* policy =
+ FindPolicyForReport(details.network_isolation_key, report_origin);
if (!policy) {
RecordSignedExchangeRequestOutcome(
RequestOutcome::kDiscardedNoOriginPolicy);
@@ -505,8 +536,10 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
: RequestOutcome::kDiscardedUnsampledFailure);
return;
}
+
reporting_service_->QueueReport(
- details.outer_url, details.user_agent, policy->report_to, kReportType,
+ details.outer_url, details.network_isolation_key, details.user_agent,
+ policy->report_to, kReportType,
CreateSignedExchangeReportBody(details, sampling_fraction.value()),
0 /* depth */);
RecordSignedExchangeRequestOutcome(RequestOutcome::kQueued);
@@ -516,9 +549,9 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
const base::RepeatingCallback<bool(const GURL&)>& origin_filter) {
DCHECK(initialized_);
for (auto it = policies_.begin(); it != policies_.end();) {
- const url::Origin& origin = it->first;
+ const NelPolicyKey& key = it->first;
// Remove policies matching the filter.
- if (origin_filter.Run(origin.GetURL())) {
+ if (origin_filter.Run(key.origin.GetURL())) {
it = RemovePolicy(it);
} else {
++it;
@@ -607,49 +640,47 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
return true;
}
- const NelPolicy* FindPolicyForOrigin(const url::Origin& origin) const {
+ const NelPolicy* FindPolicyForReport(
+ const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& report_origin) const {
DCHECK(initialized_);
- auto it = policies_.find(origin);
+ auto it =
+ policies_.find(NelPolicyKey(network_isolation_key, report_origin));
if (it != policies_.end() && clock_->Now() < it->second.expires)
return &it->second;
- std::string domain = origin.host();
+ std::string domain = report_origin.host();
const NelPolicy* wildcard_policy = nullptr;
while (!wildcard_policy && !domain.empty()) {
- wildcard_policy = FindWildcardPolicyForDomain(domain);
+ wildcard_policy = FindWildcardPolicy(network_isolation_key, domain);
domain = GetSuperdomain(domain);
}
return wildcard_policy;
}
- const NelPolicy* FindWildcardPolicyForDomain(
+ const NelPolicy* FindWildcardPolicy(
+ const NetworkIsolationKey& network_isolation_key,
const std::string& domain) const {
DCHECK(!domain.empty());
- auto it = wildcard_policies_.find(domain);
+ auto it = wildcard_policies_.find(
+ WildcardNelPolicyKey(network_isolation_key, domain));
if (it == wildcard_policies_.end())
return nullptr;
DCHECK(!it->second.empty());
- // TODO(juliatuttle): Come up with a deterministic way to resolve these.
- if (it->second.size() > 1) {
- LOG(WARNING) << "Domain " << domain
- << " matches multiple origins with include_subdomains; "
- << "choosing one arbitrarily.";
- }
-
- for (auto jt = it->second.begin(); jt != it->second.end(); ++jt) {
- if (clock_->Now() < (*jt)->expires)
- return *jt;
+ for (const NelPolicy* policy : it->second) {
+ if (clock_->Now() < policy->expires)
+ return policy;
}
return nullptr;
}
- // There must be no pre-existing policy for |policy.origin|. Returns iterator
+ // There must be no pre-existing policy for |policy.key|. Returns iterator
// to the inserted policy.
PolicyMap::iterator AddPolicy(NelPolicy policy) {
// If |initialized_| is false, then we are calling this from
@@ -659,24 +690,25 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
store_->AddNelPolicy(policy);
auto iter_and_result =
- policies_.insert(std::make_pair(policy.origin, std::move(policy)));
+ policies_.insert(std::make_pair(policy.key, std::move(policy)));
DCHECK(iter_and_result.second);
const NelPolicy& inserted_policy = iter_and_result.first->second;
- MaybeAddWildcardPolicy(inserted_policy.origin, &inserted_policy);
+ MaybeAddWildcardPolicy(inserted_policy.key, &inserted_policy);
return iter_and_result.first;
}
- void MaybeAddWildcardPolicy(const url::Origin& origin,
+ void MaybeAddWildcardPolicy(const NelPolicyKey& origin_key,
const NelPolicy* policy) {
DCHECK(policy);
- DCHECK_EQ(policy, &policies_[origin]);
+ DCHECK_EQ(policy, &policies_[origin_key]);
if (!policy->include_subdomains)
return;
- auto inserted = wildcard_policies_[origin.host()].insert(policy);
+ WildcardNelPolicyKey wildcard_key(origin_key);
+ auto inserted = wildcard_policies_[wildcard_key].insert(policy);
DCHECK(inserted.second);
}
@@ -699,10 +731,11 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
if (!policy->include_subdomains)
return;
- const url::Origin& origin = policy->origin;
- DCHECK_EQ(policy, &policies_[origin]);
+ const NelPolicyKey& origin_key = policy->key;
+ DCHECK_EQ(policy, &policies_[origin_key]);
- auto wildcard_it = wildcard_policies_.find(origin.host());
+ auto wildcard_it =
+ wildcard_policies_.find(WildcardNelPolicyKey(origin_key));
DCHECK(wildcard_it != wildcard_policies_.end());
size_t erased = wildcard_it->second.erase(policy);
@@ -791,7 +824,7 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
bool IsMismatchingSubdomainReport(const NelPolicy& policy,
const url::Origin& report_origin) const {
- return policy.include_subdomains && (policy.origin != report_origin);
+ return policy.include_subdomains && (policy.key.origin != report_origin);
}
// Returns a valid value of matching fraction iff the event should be sampled.
@@ -850,6 +883,60 @@ class NetworkErrorLoggingServiceImpl : public NetworkErrorLoggingService {
} // namespace
+NetworkErrorLoggingService::NelPolicyKey::NelPolicyKey() = default;
+
+NetworkErrorLoggingService::NelPolicyKey::NelPolicyKey(
+ const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin)
+ : network_isolation_key(network_isolation_key), origin(origin) {}
+
+NetworkErrorLoggingService::NelPolicyKey::NelPolicyKey(
+ const NelPolicyKey& other) = default;
+
+bool NetworkErrorLoggingService::NelPolicyKey::operator<(
+ const NelPolicyKey& other) const {
+ return std::tie(network_isolation_key, origin) <
+ std::tie(other.network_isolation_key, other.origin);
+}
+
+bool NetworkErrorLoggingService::NelPolicyKey::operator==(
+ const NelPolicyKey& other) const {
+ return std::tie(network_isolation_key, origin) ==
+ std::tie(other.network_isolation_key, other.origin);
+}
+
+bool NetworkErrorLoggingService::NelPolicyKey::operator!=(
+ const NelPolicyKey& other) const {
+ return !(*this == other);
+}
+
+NetworkErrorLoggingService::NelPolicyKey::~NelPolicyKey() = default;
+
+NetworkErrorLoggingService::WildcardNelPolicyKey::WildcardNelPolicyKey() =
+ default;
+
+NetworkErrorLoggingService::WildcardNelPolicyKey::WildcardNelPolicyKey(
+ const NetworkIsolationKey& network_isolation_key,
+ const std::string& domain)
+ : network_isolation_key(network_isolation_key), domain(domain) {}
+
+NetworkErrorLoggingService::WildcardNelPolicyKey::WildcardNelPolicyKey(
+ const NelPolicyKey& origin_key)
+ : WildcardNelPolicyKey(origin_key.network_isolation_key,
+ origin_key.origin.host()) {}
+
+NetworkErrorLoggingService::WildcardNelPolicyKey::WildcardNelPolicyKey(
+ const WildcardNelPolicyKey& other) = default;
+
+bool NetworkErrorLoggingService::WildcardNelPolicyKey::operator<(
+ const WildcardNelPolicyKey& other) const {
+ return std::tie(network_isolation_key, domain) <
+ std::tie(other.network_isolation_key, other.domain);
+}
+
+NetworkErrorLoggingService::WildcardNelPolicyKey::~WildcardNelPolicyKey() =
+ default;
+
NetworkErrorLoggingService::NelPolicy::NelPolicy() = default;
NetworkErrorLoggingService::NelPolicy::NelPolicy(const NelPolicy& other) =
@@ -938,9 +1025,10 @@ base::Value NetworkErrorLoggingService::StatusAsValue() const {
return base::Value();
}
-std::set<url::Origin> NetworkErrorLoggingService::GetPolicyOriginsForTesting() {
+std::set<NetworkErrorLoggingService::NelPolicyKey>
+NetworkErrorLoggingService::GetPolicyKeysForTesting() {
NOTIMPLEMENTED();
- return std::set<url::Origin>();
+ return std::set<NelPolicyKey>();
}
NetworkErrorLoggingService::PersistentNelStore*
diff --git a/chromium/net/network_error_logging/network_error_logging_service.h b/chromium/net/network_error_logging/network_error_logging_service.h
index 514d61c5a64..9d560d58355 100644
--- a/chromium/net/network_error_logging/network_error_logging_service.h
+++ b/chromium/net/network_error_logging/network_error_logging_service.h
@@ -18,6 +18,7 @@
#include "net/base/ip_address.h"
#include "net/base/net_errors.h"
#include "net/base/net_export.h"
+#include "net/base/network_isolation_key.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -43,13 +44,54 @@ class NET_EXPORT NetworkErrorLoggingService {
public:
class PersistentNelStore;
+ // Every (NIK, origin) pair can have at most one policy.
+ struct NET_EXPORT NelPolicyKey {
+ NelPolicyKey();
+ NelPolicyKey(const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin);
+ NelPolicyKey(const NelPolicyKey& other);
+ ~NelPolicyKey();
+
+ bool operator<(const NelPolicyKey& other) const;
+ bool operator==(const NelPolicyKey& other) const;
+ bool operator!=(const NelPolicyKey& other) const;
+
+ // The NIK of the request this policy was received from. This will be used
+ // for any requests uploading reports according to this policy. (Not
+ // included in the report itself.)
+ NetworkIsolationKey network_isolation_key;
+
+ url::Origin origin;
+ };
+
+ // Used for wildcard policies that are applicable to |domain| and its
+ // subdomains.
+ struct WildcardNelPolicyKey {
+ WildcardNelPolicyKey();
+ WildcardNelPolicyKey(const NetworkIsolationKey& network_isolation_key,
+ const std::string& domain);
+ explicit WildcardNelPolicyKey(const NelPolicyKey& origin_key);
+ WildcardNelPolicyKey(const WildcardNelPolicyKey& other);
+ ~WildcardNelPolicyKey();
+
+ bool operator<(const WildcardNelPolicyKey& other) const;
+
+ // The NIK of the request this policy was received from. This will be used
+ // for any requests uploading reports according to this policy. (Not
+ // included in the report itself.)
+ NetworkIsolationKey network_isolation_key;
+
+ std::string domain;
+ };
+
// NEL policy set by an origin.
struct NET_EXPORT NelPolicy {
NelPolicy();
NelPolicy(const NelPolicy& other);
~NelPolicy();
- url::Origin origin;
+ NelPolicyKey key;
+
IPAddress received_ip_address = IPAddress();
// Reporting API endpoint group to which reports should be sent.
@@ -75,6 +117,10 @@ class NET_EXPORT NetworkErrorLoggingService {
RequestDetails(const RequestDetails& other);
~RequestDetails();
+ // NetworkIsolationKey of the request triggering the error. Not included
+ // in the uploaded report.
+ NetworkIsolationKey network_isolation_key;
+
GURL uri;
GURL referrer;
std::string user_agent;
@@ -101,6 +147,10 @@ class NET_EXPORT NetworkErrorLoggingService {
SignedExchangeReportDetails(const SignedExchangeReportDetails& other);
~SignedExchangeReportDetails();
+ // NetworkIsolationKey of the request triggering the error. Not included
+ // in the uploaded report.
+ NetworkIsolationKey network_isolation_key;
+
bool success;
std::string type;
GURL outer_url;
@@ -171,10 +221,11 @@ class NET_EXPORT NetworkErrorLoggingService {
virtual ~NetworkErrorLoggingService();
- // Ingests a "NEL:" header received for |origin| from |received_ip_address|
- // with normalized value |value|. May or may not actually set a policy for
- // that origin.
- virtual void OnHeader(const url::Origin& origin,
+ // Ingests a "NEL:" header received for |network_isolation_key| and |origin|
+ // from |received_ip_address| with normalized value |value|. May or may not
+ // actually set a policy for that origin.
+ virtual void OnHeader(const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
const IPAddress& received_ip_address,
const std::string& value) = 0;
@@ -224,8 +275,9 @@ class NET_EXPORT NetworkErrorLoggingService {
// Used to display information about NEL policies on the NetLog Reporting tab.
virtual base::Value StatusAsValue() const;
- // Gets the origins of all currently stored policies, including expired ones.
- virtual std::set<url::Origin> GetPolicyOriginsForTesting();
+ // Gets the (NIK, origin) keys of all currently stored policies, including
+ // expired ones.
+ virtual std::set<NelPolicyKey> GetPolicyKeysForTesting();
virtual PersistentNelStore* GetPersistentNelStoreForTesting();
virtual ReportingService* GetReportingServiceForTesting();
diff --git a/chromium/net/network_error_logging/network_error_logging_service_unittest.cc b/chromium/net/network_error_logging/network_error_logging_service_unittest.cc
index ba7e5fef3f7..147f6f29d36 100644
--- a/chromium/net/network_error_logging/network_error_logging_service_unittest.cc
+++ b/chromium/net/network_error_logging/network_error_logging_service_unittest.cc
@@ -10,10 +10,12 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/strings/stringprintf.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/test/values_test_util.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "net/base/features.h"
#include "net/base/ip_address.h"
#include "net/base/net_errors.h"
#include "net/network_error_logging/mock_persistent_nel_store.h"
@@ -37,7 +39,12 @@ namespace {
// must be called after the first call to one of the above methods.
class NetworkErrorLoggingServiceTest : public ::testing::TestWithParam<bool> {
protected:
+ using NelPolicyKey = NetworkErrorLoggingService::NelPolicyKey;
+
NetworkErrorLoggingServiceTest() {
+ feature_list_.InitAndEnableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
if (GetParam()) {
store_ = std::make_unique<MockPersistentNelStore>();
} else {
@@ -55,13 +62,15 @@ class NetworkErrorLoggingServiceTest : public ::testing::TestWithParam<bool> {
}
NetworkErrorLoggingService::RequestDetails MakeRequestDetails(
- GURL url,
+ const NetworkIsolationKey& network_isolation_key,
+ const GURL& url,
Error error_type,
std::string method = "GET",
int status_code = 0,
IPAddress server_ip = IPAddress()) {
NetworkErrorLoggingService::RequestDetails details;
+ details.network_isolation_key = network_isolation_key;
details.uri = url;
details.referrer = kReferrer_;
details.user_agent = kUserAgent_;
@@ -76,13 +85,16 @@ class NetworkErrorLoggingServiceTest : public ::testing::TestWithParam<bool> {
}
NetworkErrorLoggingService::SignedExchangeReportDetails
- MakeSignedExchangeReportDetails(bool success,
- const std::string& type,
- const GURL& outer_url,
- const GURL& inner_url,
- const GURL& cert_url,
- const IPAddress& server_ip_address) {
+ MakeSignedExchangeReportDetails(
+ const NetworkIsolationKey& network_isolation_key,
+ bool success,
+ const std::string& type,
+ const GURL& outer_url,
+ const GURL& inner_url,
+ const GURL& cert_url,
+ const IPAddress& server_ip_address) {
NetworkErrorLoggingService::SignedExchangeReportDetails details;
+ details.network_isolation_key = network_isolation_key;
details.success = success;
details.type = type;
details.outer_url = outer_url;
@@ -103,17 +115,27 @@ class NetworkErrorLoggingServiceTest : public ::testing::TestWithParam<bool> {
return reporting_service_->reports();
}
- const url::Origin MakeOrigin(size_t index) {
- GURL url(base::StringPrintf("https://example%zd.com/", index));
+ // These methods are design so that using them together will create unique
+ // Origin, NetworkIsolationKey pairs, but they do return repeated values when
+ // called separately, so they can be used to ensure that reports are keyed on
+ // both NIK and Origin.
+ url::Origin MakeOrigin(size_t index) {
+ GURL url(base::StringPrintf("https://example%zd.com/", index / 2));
return url::Origin::Create(url);
}
+ NetworkIsolationKey MakeNetworkIsolationKey(size_t index) {
+ url::Origin origin = url::Origin::Create(
+ GURL(base::StringPrintf("https://example%zd.com/", (index + 1) / 2)));
+ return NetworkIsolationKey(origin, origin);
+ }
- NetworkErrorLoggingService::NelPolicy MakePolicyForOrigin(
- url::Origin origin,
+ NetworkErrorLoggingService::NelPolicy MakePolicy(
+ const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
base::Time expires = base::Time(),
base::Time last_used = base::Time()) {
NetworkErrorLoggingService::NelPolicy policy;
- policy.origin = std::move(origin);
+ policy.key = NelPolicyKey(network_isolation_key, origin);
policy.expires = expires;
policy.last_used = last_used;
@@ -121,14 +143,17 @@ class NetworkErrorLoggingServiceTest : public ::testing::TestWithParam<bool> {
}
// Returns whether the NetworkErrorLoggingService has a policy corresponding
- // to |origin|. Returns true if so, even if the policy is expired.
- bool HasPolicyForOrigin(const url::Origin& origin) {
- std::set<url::Origin> all_policy_origins =
- service_->GetPolicyOriginsForTesting();
- return all_policy_origins.find(origin) != all_policy_origins.end();
+ // to |network_isolation_key| and |origin|. Returns true if so, even if the
+ // policy is expired.
+ bool HasPolicy(const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin) {
+ std::set<NelPolicyKey> all_policy_keys =
+ service_->GetPolicyKeysForTesting();
+ return all_policy_keys.find(NelPolicyKey(network_isolation_key, origin)) !=
+ all_policy_keys.end();
}
- size_t PolicyCount() { return service_->GetPolicyOriginsForTesting().size(); }
+ size_t PolicyCount() { return service_->GetPolicyKeysForTesting().size(); }
// Makes the rest of the test run synchronously.
void FinishLoading(bool load_success) {
@@ -136,10 +161,12 @@ class NetworkErrorLoggingServiceTest : public ::testing::TestWithParam<bool> {
store()->FinishLoading(load_success);
}
+ base::test::ScopedFeatureList feature_list_;
+
const GURL kUrl_ = GURL("https://example.com/path");
const GURL kUrlDifferentPort_ = GURL("https://example.com:4433/path");
const GURL kUrlSubdomain_ = GURL("https://subdomain.example.com/path");
- const GURL kUrlDifferentHost_ = GURL("https://example2.com/path");
+ const GURL kUrlDifferentHost_ = GURL("https://somewhere-else.com/path");
const GURL kUrlEtld_ = GURL("https://co.uk/foo.html");
const GURL kInnerUrl_ = GURL("https://example.net/path");
@@ -154,6 +181,9 @@ class NetworkErrorLoggingServiceTest : public ::testing::TestWithParam<bool> {
const url::Origin kOriginDifferentHost_ =
url::Origin::Create(kUrlDifferentHost_);
const url::Origin kOriginEtld_ = url::Origin::Create(kUrlEtld_);
+ const NetworkIsolationKey kNik_ = NetworkIsolationKey(kOrigin_, kOrigin_);
+ const NetworkIsolationKey kOtherNik_ =
+ NetworkIsolationKey(kOriginDifferentHost_, kOriginDifferentHost_);
const std::string kHeader_ = "{\"report_to\":\"group\",\"max_age\":86400}";
const std::string kHeaderSuccessFraction0_ =
@@ -199,83 +229,198 @@ TEST_P(NetworkErrorLoggingServiceTest, CreateService) {
TEST_P(NetworkErrorLoggingServiceTest, NoReportingService) {
service_ = NetworkErrorLoggingService::Create(store_.get());
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
// Should not crash.
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
+}
+
+TEST_P(NetworkErrorLoggingServiceTest, NoPolicy) {
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
+
+ // Make the rest of the test run synchronously.
+ FinishLoading(true /* load_success */);
+
+ EXPECT_TRUE(reports().empty());
+}
+
+TEST_P(NetworkErrorLoggingServiceTest, PolicyKeyMatchesNikAndOrigin) {
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
+
+ // Make the rest of the test run synchronously.
+ FinishLoading(true /* load_success */);
+
+ // Wrong NIK and origin.
+ service()->OnRequest(MakeRequestDetails(kOtherNik_, kUrlDifferentHost_,
+ ERR_CONNECTION_REFUSED));
+ EXPECT_TRUE(reports().empty());
+
+ // Wrong NIK.
+ service()->OnRequest(
+ MakeRequestDetails(kOtherNik_, kUrl_, ERR_CONNECTION_REFUSED));
+ EXPECT_TRUE(reports().empty());
+
+ // Wrong origin.
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrlDifferentHost_, ERR_CONNECTION_REFUSED));
+ EXPECT_TRUE(reports().empty());
+
+ // Correct key.
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
+ EXPECT_EQ(1u, reports().size());
+ EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
+ EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
+ EXPECT_EQ(kGroup_, reports()[0].group);
+ EXPECT_EQ(kType_, reports()[0].type);
}
-TEST_P(NetworkErrorLoggingServiceTest, NoPolicyForOrigin) {
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+TEST_P(NetworkErrorLoggingServiceTest,
+ PolicyKeyMatchesNikAndOriginIncludeSubdomains) {
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
+ // Wrong NIK and origin.
+ service()->OnRequest(MakeRequestDetails(kOtherNik_, kUrlDifferentHost_,
+ ERR_CONNECTION_REFUSED));
+ EXPECT_TRUE(reports().empty());
+
+ // Wrong NIK (same origin).
+ service()->OnRequest(
+ MakeRequestDetails(kOtherNik_, kUrl_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
+
+ // Wrong NIK (subdomain).
+ service()->OnRequest(
+ MakeRequestDetails(kOtherNik_, kUrlSubdomain_, ERR_CONNECTION_REFUSED));
+ EXPECT_TRUE(reports().empty());
+
+ // Wrong origin.
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrlDifferentHost_, ERR_CONNECTION_REFUSED));
+ EXPECT_TRUE(reports().empty());
+
+ // Correct key (same origin).
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
+ EXPECT_EQ(1u, reports().size());
+ EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
+ EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
+ EXPECT_EQ(kGroup_, reports()[0].group);
+ EXPECT_EQ(kType_, reports()[0].type);
+
+ // Correct key (subdomain).
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
+ EXPECT_EQ(2u, reports().size());
+ EXPECT_EQ(kUrl_, reports()[1].url);
+ EXPECT_EQ(kNik_, reports()[1].network_isolation_key);
+ EXPECT_EQ(kUserAgent_, reports()[1].user_agent);
+ EXPECT_EQ(kGroup_, reports()[1].group);
+ EXPECT_EQ(kType_, reports()[1].type);
+}
+
+TEST_P(NetworkErrorLoggingServiceTest, NetworkIsolationKeyDisabled) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
+ // Need to re-create the service, since it caches the feature value on
+ // creation.
+ service_ = NetworkErrorLoggingService::Create(store_.get());
+ reporting_service_ = std::make_unique<TestReportingService>();
+ service_->SetReportingService(reporting_service_.get());
+
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
+
+ // Make the rest of the test run synchronously.
+ FinishLoading(true /* load_success */);
+
+ // Wrong NIK, but a report should be generated anyways.
+ service()->OnRequest(
+ MakeRequestDetails(kOtherNik_, kUrl_, ERR_CONNECTION_REFUSED));
+ EXPECT_EQ(1u, reports().size());
+ EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(NetworkIsolationKey(), reports()[0].network_isolation_key);
+ EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
+ EXPECT_EQ(kGroup_, reports()[0].group);
+ EXPECT_EQ(kType_, reports()[0].type);
}
TEST_P(NetworkErrorLoggingServiceTest, JsonTooLong) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderTooLong_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderTooLong_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, JsonTooDeep) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderTooDeep_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderTooDeep_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, IncludeSubdomainsEtldRejected) {
- service()->OnHeader(kOriginEtld_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOriginEtld_, kServerIP_,
+ kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
EXPECT_EQ(0u, PolicyCount());
- service()->OnRequest(MakeRequestDetails(kUrlEtld_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrlEtld_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, NonIncludeSubdomainsEtldAccepted) {
- service()->OnHeader(kOriginEtld_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOriginEtld_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
EXPECT_EQ(1u, PolicyCount());
- service()->OnRequest(MakeRequestDetails(kUrlEtld_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrlEtld_, ERR_CONNECTION_REFUSED));
EXPECT_EQ(1u, reports().size());
EXPECT_EQ(kUrlEtld_, reports()[0].url);
}
TEST_P(NetworkErrorLoggingServiceTest, SuccessReportQueued) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, OK));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, OK));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
@@ -307,15 +452,17 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessReportQueued) {
TEST_P(NetworkErrorLoggingServiceTest, FailureReportQueued) {
static const std::string kHeaderFailureFraction1 =
"{\"report_to\":\"group\",\"max_age\":86400,\"failure_fraction\":1.0}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderFailureFraction1);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderFailureFraction1);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
@@ -347,14 +494,14 @@ TEST_P(NetworkErrorLoggingServiceTest, FailureReportQueued) {
TEST_P(NetworkErrorLoggingServiceTest, UnknownFailureReportQueued) {
static const std::string kHeaderFailureFraction1 =
"{\"report_to\":\"group\",\"max_age\":86400,\"failure_fraction\":1.0}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderFailureFraction1);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderFailureFraction1);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
// This error code happens to not be mapped to a NEL report `type` field
// value.
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_FILE_NO_SPACE));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, ERR_FILE_NO_SPACE));
ASSERT_EQ(1u, reports().size());
const base::DictionaryValue* body;
@@ -368,7 +515,7 @@ TEST_P(NetworkErrorLoggingServiceTest, UnknownFailureReportQueued) {
TEST_P(NetworkErrorLoggingServiceTest, UnknownCertFailureReportQueued) {
static const std::string kHeaderFailureFraction1 =
"{\"report_to\":\"group\",\"max_age\":86400,\"failure_fraction\":1.0}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderFailureFraction1);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderFailureFraction1);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -376,7 +523,8 @@ TEST_P(NetworkErrorLoggingServiceTest, UnknownCertFailureReportQueued) {
// This error code happens to not be mapped to a NEL report `type` field
// value. Because it's a certificate error, we'll set the `phase` to be
// `connection`.
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CERT_NON_UNIQUE_NAME));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CERT_NON_UNIQUE_NAME));
ASSERT_EQ(1u, reports().size());
const base::DictionaryValue* body;
@@ -390,15 +538,16 @@ TEST_P(NetworkErrorLoggingServiceTest, UnknownCertFailureReportQueued) {
TEST_P(NetworkErrorLoggingServiceTest, HttpErrorReportQueued) {
static const std::string kHeaderFailureFraction1 =
"{\"report_to\":\"group\",\"max_age\":86400,\"failure_fraction\":1.0}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderFailureFraction1);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderFailureFraction1);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, OK, "GET", 504));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, OK, "GET", 504));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
@@ -428,16 +577,17 @@ TEST_P(NetworkErrorLoggingServiceTest, HttpErrorReportQueued) {
}
TEST_P(NetworkErrorLoggingServiceTest, SuccessReportDowngraded) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrl_, OK, "GET", 200, kOtherServerIP_));
+ MakeRequestDetails(kNik_, kUrl_, OK, "GET", 200, kOtherServerIP_));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
EXPECT_EQ(0, reports()[0].depth);
@@ -465,16 +615,17 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessReportDowngraded) {
}
TEST_P(NetworkErrorLoggingServiceTest, FailureReportDowngraded) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED, "GET",
- 200, kOtherServerIP_));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED,
+ "GET", 200, kOtherServerIP_));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
EXPECT_EQ(0, reports()[0].depth);
@@ -502,16 +653,17 @@ TEST_P(NetworkErrorLoggingServiceTest, FailureReportDowngraded) {
}
TEST_P(NetworkErrorLoggingServiceTest, HttpErrorReportDowngraded) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrl_, OK, "GET", 504, kOtherServerIP_));
+ MakeRequestDetails(kNik_, kUrl_, OK, "GET", 504, kOtherServerIP_));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
EXPECT_EQ(0, reports()[0].depth);
@@ -539,16 +691,17 @@ TEST_P(NetworkErrorLoggingServiceTest, HttpErrorReportDowngraded) {
}
TEST_P(NetworkErrorLoggingServiceTest, DNSFailureReportNotDowngraded) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_NAME_NOT_RESOLVED, "GET",
- 0, kOtherServerIP_));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, ERR_NAME_NOT_RESOLVED,
+ "GET", 0, kOtherServerIP_));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
EXPECT_EQ(0, reports()[0].depth);
@@ -576,15 +729,16 @@ TEST_P(NetworkErrorLoggingServiceTest, DNSFailureReportNotDowngraded) {
}
TEST_P(NetworkErrorLoggingServiceTest, SuccessPOSTReportQueued) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, OK, "POST"));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, OK, "POST"));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
EXPECT_EQ(0, reports()[0].depth);
@@ -608,7 +762,7 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessPOSTReportQueued) {
}
TEST_P(NetworkErrorLoggingServiceTest, MaxAge0) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -616,16 +770,17 @@ TEST_P(NetworkErrorLoggingServiceTest, MaxAge0) {
EXPECT_EQ(1u, PolicyCount());
// Max_age of 0 removes the policy.
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderMaxAge0_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderMaxAge0_);
EXPECT_EQ(0u, PolicyCount());
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, SuccessFraction0) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction0_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction0_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -634,7 +789,7 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessFraction0) {
// verify that no reports are produced.
constexpr size_t kReportCount = 100;
for (size_t i = 0; i < kReportCount; ++i)
- service()->OnRequest(MakeRequestDetails(kUrl_, OK));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, OK));
EXPECT_TRUE(reports().empty());
}
@@ -645,7 +800,7 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessFractionHalf) {
static const std::string kHeaderSuccessFractionHalf =
"{\"report_to\":\"group\",\"max_age\":86400,\"success_fraction\":0.5,"
"\"failure_fraction\":0.25}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFractionHalf);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFractionHalf);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -655,7 +810,7 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessFractionHalf) {
// verify exact counts because each decision is made randomly.)
constexpr size_t kReportCount = 100;
for (size_t i = 0; i < kReportCount; ++i)
- service()->OnRequest(MakeRequestDetails(kUrl_, OK));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, OK));
// If our random selection logic is correct, there is a 2^-100 chance that
// every single report above was skipped. If this check fails, it's much more
@@ -679,7 +834,7 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessFractionHalf) {
TEST_P(NetworkErrorLoggingServiceTest, FailureFraction0) {
static const std::string kHeaderFailureFraction0 =
"{\"report_to\":\"group\",\"max_age\":86400,\"failure_fraction\":0.0}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderFailureFraction0);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderFailureFraction0);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -688,7 +843,8 @@ TEST_P(NetworkErrorLoggingServiceTest, FailureFraction0) {
// verify that no reports are produced.
constexpr size_t kReportCount = 100;
for (size_t i = 0; i < kReportCount; ++i)
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
@@ -699,7 +855,7 @@ TEST_P(NetworkErrorLoggingServiceTest, FailureFractionHalf) {
static const std::string kHeaderFailureFractionHalf =
"{\"report_to\":\"group\",\"max_age\":86400,\"failure_fraction\":0.5,"
"\"success_fraction\":0.25}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderFailureFractionHalf);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderFailureFractionHalf);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -709,7 +865,8 @@ TEST_P(NetworkErrorLoggingServiceTest, FailureFractionHalf) {
// verify exact counts because each decision is made randomly.)
constexpr size_t kReportCount = 100;
for (size_t i = 0; i < kReportCount; ++i)
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
// If our random selection logic is correct, there is a 2^-100 chance that
// every single report above was skipped. If this check fails, it's much more
@@ -730,99 +887,100 @@ TEST_P(NetworkErrorLoggingServiceTest, FailureFractionHalf) {
TEST_P(NetworkErrorLoggingServiceTest,
ExcludeSubdomainsDoesntMatchDifferentPort) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrlDifferentPort_, ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kUrlDifferentPort_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, ExcludeSubdomainsDoesntMatchSubdomain) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrlSubdomain_, ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kUrlSubdomain_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, IncludeSubdomainsMatchesDifferentPort) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrlDifferentPort_, ERR_NAME_NOT_RESOLVED));
+ MakeRequestDetails(kNik_, kUrlDifferentPort_, ERR_NAME_NOT_RESOLVED));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrlDifferentPort_, reports()[0].url);
}
TEST_P(NetworkErrorLoggingServiceTest, IncludeSubdomainsMatchesSubdomain) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrlSubdomain_, ERR_NAME_NOT_RESOLVED));
+ MakeRequestDetails(kNik_, kUrlSubdomain_, ERR_NAME_NOT_RESOLVED));
ASSERT_EQ(1u, reports().size());
}
TEST_P(NetworkErrorLoggingServiceTest,
IncludeSubdomainsDoesntMatchSuperdomain) {
- service()->OnHeader(kOriginSubdomain_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOriginSubdomain_, kServerIP_,
+ kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_NAME_NOT_RESOLVED));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, ERR_NAME_NOT_RESOLVED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest,
IncludeSubdomainsDoesntReportConnectionError) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrlSubdomain_, ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kUrlSubdomain_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest,
IncludeSubdomainsDoesntReportApplicationError) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->OnRequest(
- MakeRequestDetails(kUrlSubdomain_, ERR_INVALID_HTTP_RESPONSE));
+ MakeRequestDetails(kNik_, kUrlSubdomain_, ERR_INVALID_HTTP_RESPONSE));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, IncludeSubdomainsDoesntReportSuccess) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrlSubdomain_, OK));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrlSubdomain_, OK));
EXPECT_TRUE(reports().empty());
}
@@ -832,42 +990,44 @@ TEST_P(NetworkErrorLoggingServiceTest,
static const std::string kHeaderIncludeSubdomainsSuccess1 =
"{\"report_to\":\"group\",\"max_age\":86400,"
"\"include_subdomains\":true,\"success_fraction\":1.0}";
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderIncludeSubdomainsSuccess1);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_,
+ kHeaderIncludeSubdomainsSuccess1);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnRequest(MakeRequestDetails(kUrl_, OK));
+ service()->OnRequest(MakeRequestDetails(kNik_, kUrl_, OK));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
}
TEST_P(NetworkErrorLoggingServiceTest, RemoveAllBrowsingData) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
EXPECT_EQ(1u, PolicyCount());
- EXPECT_TRUE(HasPolicyForOrigin(kOrigin_));
+ EXPECT_TRUE(HasPolicy(kNik_, kOrigin_));
service()->RemoveAllBrowsingData();
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
EXPECT_EQ(0u, PolicyCount());
- EXPECT_FALSE(HasPolicyForOrigin(kOrigin_));
+ EXPECT_FALSE(HasPolicy(kNik_, kOrigin_));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, RemoveSomeBrowsingData) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnHeader(kOriginDifferentHost_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOriginDifferentHost_, kServerIP_, kHeader_);
EXPECT_EQ(2u, PolicyCount());
// Remove policy for kOrigin_ but not kOriginDifferentHost_
@@ -876,27 +1036,28 @@ TEST_P(NetworkErrorLoggingServiceTest, RemoveSomeBrowsingData) {
return origin.host() == "example.com";
}));
EXPECT_EQ(1u, PolicyCount());
- EXPECT_TRUE(HasPolicyForOrigin(kOriginDifferentHost_));
- EXPECT_FALSE(HasPolicyForOrigin(kOrigin_));
+ EXPECT_TRUE(HasPolicy(kNik_, kOriginDifferentHost_));
+ EXPECT_FALSE(HasPolicy(kNik_, kOrigin_));
- service()->OnRequest(MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED));
+ service()->OnRequest(
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED));
EXPECT_TRUE(reports().empty());
service()->OnRequest(
- MakeRequestDetails(kUrlDifferentHost_, ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kUrlDifferentHost_, ERR_CONNECTION_REFUSED));
ASSERT_EQ(1u, reports().size());
}
TEST_P(NetworkErrorLoggingServiceTest, Nested) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
NetworkErrorLoggingService::RequestDetails details =
- MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED);
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED);
details.reporting_upload_depth =
NetworkErrorLoggingService::kMaxNestedReportDepth;
service()->OnRequest(details);
@@ -907,13 +1068,13 @@ TEST_P(NetworkErrorLoggingServiceTest, Nested) {
}
TEST_P(NetworkErrorLoggingServiceTest, NestedTooDeep) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
NetworkErrorLoggingService::RequestDetails details =
- MakeRequestDetails(kUrl_, ERR_CONNECTION_REFUSED);
+ MakeRequestDetails(kNik_, kUrl_, ERR_CONNECTION_REFUSED);
details.reporting_upload_depth =
NetworkErrorLoggingService::kMaxNestedReportDepth + 1;
service()->OnRequest(details);
@@ -935,13 +1096,14 @@ TEST_P(NetworkErrorLoggingServiceTest, StatusAsValue) {
base::TimeTicks::UnixEpoch().since_origin();
clock.Advance(delta_from_origin);
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->OnHeader(kOriginDifferentHost_, kServerIP_, kHeader_);
- service()->OnHeader(kOriginSubdomain_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOriginDifferentHost_, kServerIP_, kHeader_);
+ service()->OnHeader(kOtherNik_, kOriginSubdomain_, kServerIP_,
+ kHeaderIncludeSubdomains_);
const std::string kHeaderWrongTypes =
("{\"report_to\":\"group\","
"\"max_age\":86400,"
@@ -951,7 +1113,7 @@ TEST_P(NetworkErrorLoggingServiceTest, StatusAsValue) {
"\"success_fraction\": \"1.0\","
"\"failure_fraction\": \"0.0\"}");
service()->OnHeader(
- url::Origin::Create(GURL("https://invalid-types.example.com")),
+ kNik_, url::Origin::Create(GURL("https://invalid-types.example.com")),
kServerIP_, kHeaderWrongTypes);
base::Value actual = service()->StatusAsValue();
@@ -960,6 +1122,7 @@ TEST_P(NetworkErrorLoggingServiceTest, StatusAsValue) {
{
"originPolicies": [
{
+ "networkIsolationKey": "https://example.com https://example.com",
"origin": "https://example.com",
"includeSubdomains": false,
"expires": "86400000",
@@ -968,7 +1131,8 @@ TEST_P(NetworkErrorLoggingServiceTest, StatusAsValue) {
"failureFraction": 1.0,
},
{
- "origin": "https://example2.com",
+ "networkIsolationKey": "https://example.com https://example.com",
+ "origin": "https://invalid-types.example.com",
"includeSubdomains": false,
"expires": "86400000",
"reportTo": "group",
@@ -976,7 +1140,8 @@ TEST_P(NetworkErrorLoggingServiceTest, StatusAsValue) {
"failureFraction": 1.0,
},
{
- "origin": "https://invalid-types.example.com",
+ "networkIsolationKey": "https://example.com https://example.com",
+ "origin": "https://somewhere-else.com",
"includeSubdomains": false,
"expires": "86400000",
"reportTo": "group",
@@ -984,6 +1149,7 @@ TEST_P(NetworkErrorLoggingServiceTest, StatusAsValue) {
"failureFraction": 1.0,
},
{
+ "networkIsolationKey": "https://somewhere-else.com https://somewhere-else.com",
"origin": "https://subdomain.example.com",
"includeSubdomains": true,
"expires": "86400000",
@@ -1000,19 +1166,19 @@ TEST_P(NetworkErrorLoggingServiceTest, StatusAsValue) {
TEST_P(NetworkErrorLoggingServiceTest, NoReportingService_SignedExchange) {
service_ = NetworkErrorLoggingService::Create(store_.get());
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
// Should not crash
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
}
TEST_P(NetworkErrorLoggingServiceTest, NoPolicyForOrigin_SignedExchange) {
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -1021,7 +1187,7 @@ TEST_P(NetworkErrorLoggingServiceTest, NoPolicyForOrigin_SignedExchange) {
}
TEST_P(NetworkErrorLoggingServiceTest, SuccessFraction0_SignedExchange) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction0_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction0_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -1031,22 +1197,23 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessFraction0_SignedExchange) {
constexpr size_t kReportCount = 100;
for (size_t i = 0; i < kReportCount; ++i) {
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- true, "ok", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, true, "ok", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
}
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, SuccessReportQueued_SignedExchange) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- true, "ok", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, true, "ok", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
@@ -1088,15 +1255,16 @@ TEST_P(NetworkErrorLoggingServiceTest, SuccessReportQueued_SignedExchange) {
}
TEST_P(NetworkErrorLoggingServiceTest, FailureReportQueued_SignedExchange) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
ASSERT_EQ(1u, reports().size());
EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(kNik_, reports()[0].network_isolation_key);
EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
EXPECT_EQ(kGroup_, reports()[0].group);
EXPECT_EQ(kType_, reports()[0].type);
@@ -1138,27 +1306,59 @@ TEST_P(NetworkErrorLoggingServiceTest, FailureReportQueued_SignedExchange) {
}
TEST_P(NetworkErrorLoggingServiceTest, MismatchingSubdomain_SignedExchange) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderIncludeSubdomains_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrlSubdomain_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrlSubdomain_, kInnerUrl_, kCertUrl_,
+ kServerIP_));
EXPECT_TRUE(reports().empty());
}
TEST_P(NetworkErrorLoggingServiceTest, MismatchingIPAddress_SignedExchange) {
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
- service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kOtherServerIP_));
+ service()->QueueSignedExchangeReport(
+ MakeSignedExchangeReportDetails(kNik_, false, "sxg.failed", kUrl_,
+ kInnerUrl_, kCertUrl_, kOtherServerIP_));
EXPECT_TRUE(reports().empty());
}
+TEST_P(NetworkErrorLoggingServiceTest,
+ SignedExchangeNetworkIsolationKeyDisabled) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
+ // Need to re-create the service, since it caches the feature value on
+ // creation.
+ service_ = NetworkErrorLoggingService::Create(store_.get());
+ reporting_service_ = std::make_unique<TestReportingService>();
+ service_->SetReportingService(reporting_service_.get());
+
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeaderSuccessFraction1_);
+
+ // Make the rest of the test run synchronously.
+ FinishLoading(true /* load_success */);
+
+ // Wrong NIK, but a report should be generated anyways.
+ service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
+ kOtherNik_, true, "ok", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+
+ ASSERT_EQ(1u, reports().size());
+ EXPECT_EQ(kUrl_, reports()[0].url);
+ EXPECT_EQ(NetworkIsolationKey(), reports()[0].network_isolation_key);
+ EXPECT_EQ(kUserAgent_, reports()[0].user_agent);
+ EXPECT_EQ(kGroup_, reports()[0].group);
+ EXPECT_EQ(kType_, reports()[0].type);
+ EXPECT_EQ(0, reports()[0].depth);
+}
+
// When the max number of policies is exceeded, first try to remove expired
// policies before evicting the least recently used unexpired policy.
TEST_P(NetworkErrorLoggingServiceTest, EvictAllExpiredPoliciesFirst) {
@@ -1167,7 +1367,8 @@ TEST_P(NetworkErrorLoggingServiceTest, EvictAllExpiredPoliciesFirst) {
// Add 100 policies then make them expired.
for (size_t i = 0; i < 100; ++i) {
- service()->OnHeader(MakeOrigin(i), kServerIP_, kHeader_);
+ service()->OnHeader(MakeNetworkIsolationKey(i), MakeOrigin(i), kServerIP_,
+ kHeader_);
}
// Make the rest of the test run synchronously.
FinishLoading(true /* load_success */);
@@ -1179,12 +1380,13 @@ TEST_P(NetworkErrorLoggingServiceTest, EvictAllExpiredPoliciesFirst) {
// Reach the max policy limit.
for (size_t i = 100; i < NetworkErrorLoggingService::kMaxPolicies; ++i) {
- service()->OnHeader(MakeOrigin(i), kServerIP_, kHeader_);
+ service()->OnHeader(MakeNetworkIsolationKey(i), MakeOrigin(i), kServerIP_,
+ kHeader_);
}
EXPECT_EQ(NetworkErrorLoggingService::kMaxPolicies, PolicyCount());
// Add one more policy to trigger eviction of only the expired policies.
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
EXPECT_EQ(NetworkErrorLoggingService::kMaxPolicies - 100 + 1, PolicyCount());
}
@@ -1194,7 +1396,8 @@ TEST_P(NetworkErrorLoggingServiceTest, EvictLeastRecentlyUsedPolicy) {
// A policy's |last_used| is updated when it is added
for (size_t i = 0; i < NetworkErrorLoggingService::kMaxPolicies; ++i) {
- service()->OnHeader(MakeOrigin(i), kServerIP_, kHeader_);
+ service()->OnHeader(MakeNetworkIsolationKey(i), MakeOrigin(i), kServerIP_,
+ kHeader_);
clock.Advance(base::TimeDelta::FromSeconds(1));
}
// Make the rest of the test run synchronously.
@@ -1205,40 +1408,43 @@ TEST_P(NetworkErrorLoggingServiceTest, EvictLeastRecentlyUsedPolicy) {
// Set another policy which triggers eviction. None of the policies have
// expired, so the least recently used (i.e. least recently added) policy
// should be evicted.
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
clock.Advance(base::TimeDelta::FromSeconds(1));
EXPECT_EQ(PolicyCount(), NetworkErrorLoggingService::kMaxPolicies);
- EXPECT_FALSE(HasPolicyForOrigin(MakeOrigin(0))); // evicted
- std::set<url::Origin> all_policy_origins =
- service()->GetPolicyOriginsForTesting();
+ EXPECT_FALSE(
+ HasPolicy(MakeNetworkIsolationKey(0), MakeOrigin(0))); // evicted
+ std::set<NelPolicyKey> all_policy_keys = service()->GetPolicyKeysForTesting();
for (size_t i = 1; i < NetworkErrorLoggingService::kMaxPolicies; ++i) {
- // Avoid n calls to HasPolicyForOrigin(), which would be O(n^2).
- EXPECT_EQ(1u, all_policy_origins.count(MakeOrigin(i)));
+ // Avoid n calls to HasPolicy(), which would be O(n^2).
+ NelPolicyKey key(MakeNetworkIsolationKey(i), MakeOrigin(i));
+ EXPECT_EQ(1u, all_policy_keys.count(key));
}
- EXPECT_TRUE(HasPolicyForOrigin(kOrigin_));
+ EXPECT_TRUE(HasPolicy(kNik_, kOrigin_));
// Now use the policies in reverse order starting with kOrigin_, then add
// another policy to trigger eviction, to check that the stalest policy is
// identified correctly.
service()->OnRequest(
- MakeRequestDetails(kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
clock.Advance(base::TimeDelta::FromSeconds(1));
for (size_t i = NetworkErrorLoggingService::kMaxPolicies - 1; i >= 1; --i) {
- service()->OnRequest(
- MakeRequestDetails(MakeOrigin(i).GetURL(), ERR_CONNECTION_REFUSED));
+ service()->OnRequest(MakeRequestDetails(MakeNetworkIsolationKey(i),
+ MakeOrigin(i).GetURL(),
+ ERR_CONNECTION_REFUSED));
clock.Advance(base::TimeDelta::FromSeconds(1));
}
- service()->OnHeader(kOriginSubdomain_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOriginSubdomain_, kServerIP_, kHeader_);
EXPECT_EQ(PolicyCount(), NetworkErrorLoggingService::kMaxPolicies);
- EXPECT_FALSE(HasPolicyForOrigin(kOrigin_)); // evicted
- all_policy_origins = service()->GetPolicyOriginsForTesting();
+ EXPECT_FALSE(HasPolicy(kNik_, kOrigin_)); // evicted
+ all_policy_keys = service()->GetPolicyKeysForTesting();
for (size_t i = NetworkErrorLoggingService::kMaxPolicies - 1; i >= 1; --i) {
- // Avoid n calls to HasPolicyForOrigin(), which would be O(n^2).
- EXPECT_EQ(1u, all_policy_origins.count(MakeOrigin(i)));
+ // Avoid n calls to HasPolicy(), which would be O(n^2).
+ NelPolicyKey key(MakeNetworkIsolationKey(i), MakeOrigin(i));
+ EXPECT_EQ(1u, all_policy_keys.count(key));
}
- EXPECT_TRUE(HasPolicyForOrigin(kOriginSubdomain_)); // most recently added
+ EXPECT_TRUE(HasPolicy(kNik_, kOriginSubdomain_)); // most recently added
// Note: This test advances the clock by ~2000 seconds, which is below the
// specified max_age of 86400 seconds, so none of the policies expire during
@@ -1250,15 +1456,15 @@ TEST_P(NetworkErrorLoggingServiceTest, SendsCommandsToStoreSynchronous) {
return;
MockPersistentNelStore::CommandList expected_commands;
- NetworkErrorLoggingService::NelPolicy policy1 = MakePolicyForOrigin(kOrigin_);
+ NetworkErrorLoggingService::NelPolicy policy1 = MakePolicy(kNik_, kOrigin_);
NetworkErrorLoggingService::NelPolicy policy2 =
- MakePolicyForOrigin(kOriginDifferentHost_);
+ MakePolicy(kNik_, kOriginDifferentHost_);
std::vector<NetworkErrorLoggingService::NelPolicy> prestored_policies = {
policy1, policy2};
store()->SetPrestoredPolicies(std::move(prestored_policies));
// The first call to any of the public methods triggers a load.
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::LOAD_NEL_POLICIES);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
@@ -1273,13 +1479,13 @@ TEST_P(NetworkErrorLoggingServiceTest, SendsCommandsToStoreSynchronous) {
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->OnRequest(
- MakeRequestDetails(kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::UPDATE_NEL_POLICY, policy1);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::UPDATE_NEL_POLICY, policy1);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
@@ -1311,25 +1517,25 @@ TEST_P(NetworkErrorLoggingServiceTest, SendsCommandsToStoreDeferred) {
return;
MockPersistentNelStore::CommandList expected_commands;
- NetworkErrorLoggingService::NelPolicy policy1 = MakePolicyForOrigin(kOrigin_);
+ NetworkErrorLoggingService::NelPolicy policy1 = MakePolicy(kNik_, kOrigin_);
NetworkErrorLoggingService::NelPolicy policy2 =
- MakePolicyForOrigin(kOriginDifferentHost_);
+ MakePolicy(kNik_, kOriginDifferentHost_);
std::vector<NetworkErrorLoggingService::NelPolicy> prestored_policies = {
policy1, policy2};
store()->SetPrestoredPolicies(std::move(prestored_policies));
// The first call to any of the public methods triggers a load.
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::LOAD_NEL_POLICIES);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->OnRequest(
- MakeRequestDetails(kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
// Removes policy1 but not policy2.
@@ -1377,15 +1583,15 @@ TEST_P(NetworkErrorLoggingServiceTest,
return;
MockPersistentNelStore::CommandList expected_commands;
- NetworkErrorLoggingService::NelPolicy policy1 = MakePolicyForOrigin(kOrigin_);
+ NetworkErrorLoggingService::NelPolicy policy1 = MakePolicy(kNik_, kOrigin_);
NetworkErrorLoggingService::NelPolicy policy2 =
- MakePolicyForOrigin(kOriginDifferentHost_);
+ MakePolicy(kNik_, kOriginDifferentHost_);
std::vector<NetworkErrorLoggingService::NelPolicy> prestored_policies = {
policy1, policy2};
store()->SetPrestoredPolicies(std::move(prestored_policies));
// The first call to any of the public methods triggers a load.
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::LOAD_NEL_POLICIES);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
@@ -1398,16 +1604,15 @@ TEST_P(NetworkErrorLoggingServiceTest,
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::ADD_NEL_POLICY, policy1);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
- LOG(INFO) << store()->GetDebugString();
service()->OnRequest(
- MakeRequestDetails(kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::UPDATE_NEL_POLICY, policy1);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::UPDATE_NEL_POLICY, policy1);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
@@ -1434,25 +1639,25 @@ TEST_P(NetworkErrorLoggingServiceTest, SendsCommandsToStoreDeferredLoadFailed) {
return;
MockPersistentNelStore::CommandList expected_commands;
- NetworkErrorLoggingService::NelPolicy policy1 = MakePolicyForOrigin(kOrigin_);
+ NetworkErrorLoggingService::NelPolicy policy1 = MakePolicy(kNik_, kOrigin_);
NetworkErrorLoggingService::NelPolicy policy2 =
- MakePolicyForOrigin(kOriginDifferentHost_);
+ MakePolicy(kNik_, kOriginDifferentHost_);
std::vector<NetworkErrorLoggingService::NelPolicy> prestored_policies = {
policy1, policy2};
store()->SetPrestoredPolicies(std::move(prestored_policies));
// The first call to any of the public methods triggers a load.
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::LOAD_NEL_POLICIES);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->OnRequest(
- MakeRequestDetails(kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
// Removes policy1 but not policy2.
@@ -1495,7 +1700,7 @@ TEST_P(NetworkErrorLoggingServiceTest, FlushesStoreOnDestruction) {
MockPersistentNelStore::CommandList expected_commands;
- service->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::LOAD_NEL_POLICIES);
EXPECT_TRUE(store->VerifyCommands(expected_commands));
@@ -1503,7 +1708,7 @@ TEST_P(NetworkErrorLoggingServiceTest, FlushesStoreOnDestruction) {
store->FinishLoading(false /* load_success */);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::ADD_NEL_POLICY,
- MakePolicyForOrigin(kOrigin_));
+ MakePolicy(kNik_, kOrigin_));
EXPECT_TRUE(store->VerifyCommands(expected_commands));
// Store should be flushed on destruction of service.
@@ -1529,15 +1734,15 @@ TEST_P(NetworkErrorLoggingServiceTest, DoNothingIfShutDown) {
MockPersistentNelStore::CommandList expected_commands;
// The first call to any of the public methods triggers a load.
- service()->OnHeader(kOrigin_, kServerIP_, kHeader_);
+ service()->OnHeader(kNik_, kOrigin_, kServerIP_, kHeader_);
expected_commands.emplace_back(
MockPersistentNelStore::Command::Type::LOAD_NEL_POLICIES);
EXPECT_TRUE(store()->VerifyCommands(expected_commands));
service()->OnRequest(
- MakeRequestDetails(kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
+ MakeRequestDetails(kNik_, kOrigin_.GetURL(), ERR_CONNECTION_REFUSED));
service()->QueueSignedExchangeReport(MakeSignedExchangeReportDetails(
- false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
+ kNik_, false, "sxg.failed", kUrl_, kInnerUrl_, kCertUrl_, kServerIP_));
service()->RemoveBrowsingData(
base::BindRepeating([](const GURL& origin) -> bool {
return origin.host() == "example.com";
diff --git a/chromium/net/network_error_logging/network_error_logging_test_util.cc b/chromium/net/network_error_logging/network_error_logging_test_util.cc
index a75a06d8e49..f574e937160 100644
--- a/chromium/net/network_error_logging/network_error_logging_test_util.cc
+++ b/chromium/net/network_error_logging/network_error_logging_test_util.cc
@@ -14,11 +14,13 @@ TestNetworkErrorLoggingService::TestNetworkErrorLoggingService() = default;
TestNetworkErrorLoggingService::~TestNetworkErrorLoggingService() = default;
void TestNetworkErrorLoggingService::OnHeader(
+ const NetworkIsolationKey& network_isolation_key,
const url::Origin& origin,
const IPAddress& received_ip_address,
const std::string& value) {
VLOG(1) << "Received NEL policy for " << origin;
Header header;
+ header.network_isolation_key = network_isolation_key;
header.origin = origin;
header.received_ip_address = received_ip_address;
header.value = value;
diff --git a/chromium/net/network_error_logging/network_error_logging_test_util.h b/chromium/net/network_error_logging/network_error_logging_test_util.h
index c6af9416b29..df9c422d091 100644
--- a/chromium/net/network_error_logging/network_error_logging_test_util.h
+++ b/chromium/net/network_error_logging/network_error_logging_test_util.h
@@ -32,6 +32,7 @@ class TestNetworkErrorLoggingService : public NetworkErrorLoggingService {
// addresses in |address_list|.
bool MatchesAddressList(const AddressList& address_list) const;
+ NetworkIsolationKey network_isolation_key;
url::Origin origin;
IPAddress received_ip_address;
std::string value;
@@ -44,7 +45,8 @@ class TestNetworkErrorLoggingService : public NetworkErrorLoggingService {
const std::vector<RequestDetails>& errors() { return errors_; }
// NetworkErrorLoggingService implementation
- void OnHeader(const url::Origin& origin,
+ void OnHeader(const NetworkIsolationKey& network_isolation_key,
+ const url::Origin& origin,
const IPAddress& received_ip_address,
const std::string& value) override;
void OnRequest(RequestDetails details) override;
diff --git a/chromium/net/nqe/DIR_METADATA b/chromium/net/nqe/DIR_METADATA
new file mode 100644
index 00000000000..2107bb97d49
--- /dev/null
+++ b/chromium/net/nqe/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>NetworkQuality"
+} \ No newline at end of file
diff --git a/chromium/net/nqe/OWNERS b/chromium/net/nqe/OWNERS
index 30f461a85f9..af8e48604fc 100644
--- a/chromium/net/nqe/OWNERS
+++ b/chromium/net/nqe/OWNERS
@@ -4,6 +4,3 @@ ryansturm@chromium.org
# Secondary
bengr@chromium.org
-
-# TEAM: net-dev@chromium.org
-# COMPONENT: Internals>Network>NetworkQuality \ No newline at end of file
diff --git a/chromium/net/nqe/connectivity_monitor_unittest.cc b/chromium/net/nqe/connectivity_monitor_unittest.cc
index 1d253530016..8b504711d25 100644
--- a/chromium/net/nqe/connectivity_monitor_unittest.cc
+++ b/chromium/net/nqe/connectivity_monitor_unittest.cc
@@ -8,7 +8,7 @@
#include "base/optional.h"
#include "base/run_loop.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
diff --git a/chromium/net/nqe/network_quality_estimator.cc b/chromium/net/nqe/network_quality_estimator.cc
index e319a350975..729c146013e 100644
--- a/chromium/net/nqe/network_quality_estimator.cc
+++ b/chromium/net/nqe/network_quality_estimator.cc
@@ -10,7 +10,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/location.h"
#include "base/metrics/field_trial_params.h"
diff --git a/chromium/net/nqe/network_quality_estimator_unittest.cc b/chromium/net/nqe/network_quality_estimator_unittest.cc
index 9ee756a00f0..84469b30de9 100644
--- a/chromium/net/nqe/network_quality_estimator_unittest.cc
+++ b/chromium/net/nqe/network_quality_estimator_unittest.cc
@@ -20,6 +20,7 @@
#include "base/optional.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
+#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/threading/platform_thread.h"
@@ -67,6 +68,20 @@ void ExpectBucketCountAtLeast(base::HistogramTester* histogram_tester,
<< " expected_min_count_samples=" << expected_min_count_samples;
}
+size_t GetHistogramCount(base::HistogramTester* histogram_tester,
+ const std::string& histogram_name) {
+ base::ThreadPoolInstance::Get()->FlushForTesting();
+ base::RunLoop().RunUntilIdle();
+
+ const std::vector<base::Bucket> buckets =
+ histogram_tester->GetAllSamples(histogram_name);
+ size_t total_count = 0;
+ for (const auto& bucket : buckets) {
+ total_count += bucket.count;
+ }
+ return total_count;
+}
+
} // namespace
namespace net {
@@ -2248,9 +2263,13 @@ TEST_F(NetworkQualityEstimatorTest, MAYBE_TestTCPSocketRTT) {
}
TEST_F(NetworkQualityEstimatorTest, TestRecordNetworkIDAvailability) {
- base::HistogramTester histogram_tester;
TestNetworkQualityEstimator estimator;
+ // Create the histogram tester after |estimator| is constructed. This ensures
+ // that any network checks done at the time of |estimator| construction do not
+ // affect |histogram_tester|.
+ base::HistogramTester histogram_tester;
+
// The NetworkID is recorded as available on Wi-Fi connection.
estimator.SimulateNetworkChange(
NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test-1");
@@ -3067,21 +3086,28 @@ TEST_F(NetworkQualityEstimatorTest, TestPeerToPeerConnectionsCountObserver) {
// Tests that the signal strength API is not called too frequently.
TEST_F(NetworkQualityEstimatorTest, MAYBE_CheckSignalStrength) {
- base::HistogramTester histogram_tester;
constexpr char histogram_name[] = "NQE.SignalStrengthQueried.WiFi";
constexpr int kWiFiSignalStrengthQueryIntervalSeconds = 30 * 60;
std::map<std::string, std::string> variation_params;
variation_params["get_signal_strength_and_detailed_network_id"] = "true";
TestNetworkQualityEstimator estimator(variation_params);
+
estimator.SimulateNetworkChange(
NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test");
base::SimpleTestTickClock tick_clock;
- tick_clock.SetNowTicks(base::TimeTicks::Now());
+ // SimulateNetworkChange() above can produce entries in the histogram bucket
+ // if the test system has real wifi or cellular connections, and can also
+ // leave the NQE inside its timeout. To avoid that, fastforward fake time for
+ // more than the query interval.
+ tick_clock.SetNowTicks(base::TimeTicks::Now() +
+ base::TimeDelta::FromSeconds(
+ kWiFiSignalStrengthQueryIntervalSeconds * 2));
estimator.SetTickClockForTesting(&tick_clock);
+ base::HistogramTester histogram_tester;
base::Optional<int32_t> signal_strength =
estimator.GetCurrentSignalStrengthWithThrottling();
@@ -3113,18 +3139,22 @@ TEST_F(NetworkQualityEstimatorTest, MAYBE_CheckSignalStrength) {
histogram_tester.ExpectTotalCount(histogram_name, 3);
// Changing the connection type should make the signal strength available
- // again.
+ // again. Verify that the signal strength is not queried too frequently
+ // (currently, the threshold is set to 5). This is partially indeterminsitic
+ // due to the indeterminism at the connection change.
estimator.SimulateNetworkChange(
NetworkChangeNotifier::ConnectionType::CONNECTION_WIFI, "test");
- histogram_tester.ExpectTotalCount(histogram_name, 5);
+ size_t samples_count = GetHistogramCount(&histogram_tester, histogram_name);
+ EXPECT_LE(4u, samples_count);
+ EXPECT_GE(8u, samples_count);
tick_clock.Advance(base::TimeDelta::FromMilliseconds(2));
signal_strength = estimator.GetCurrentSignalStrengthWithThrottling();
- histogram_tester.ExpectTotalCount(histogram_name, 6);
+ histogram_tester.ExpectTotalCount(histogram_name, samples_count + 1);
tick_clock.Advance(base::TimeDelta::FromMilliseconds(2));
signal_strength = estimator.GetCurrentSignalStrengthWithThrottling();
- histogram_tester.ExpectTotalCount(histogram_name, 6);
+ histogram_tester.ExpectTotalCount(histogram_name, samples_count + 1);
}
TEST_F(NetworkQualityEstimatorTest, CheckSignalStrengthDisabledByDefault) {
diff --git a/chromium/net/nqe/throughput_analyzer_unittest.cc b/chromium/net/nqe/throughput_analyzer_unittest.cc
index acd6bca9f8e..5bd2bdc8355 100644
--- a/chromium/net/nqe/throughput_analyzer_unittest.cc
+++ b/chromium/net/nqe/throughput_analyzer_unittest.cc
@@ -13,7 +13,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/containers/circular_deque.h"
#include "base/location.h"
#include "base/macros.h"
@@ -236,7 +236,7 @@ TEST_F(ThroughputAnalyzerTest, MAYBE_MaximumRequestsWithNetworkIsolationKey) {
TRAFFIC_ANNOTATION_FOR_TESTS));
if (use_network_isolation_key)
request->set_isolation_info(IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing, kNetworkIsolationKey));
+ IsolationInfo::RequestType::kOther, kNetworkIsolationKey));
throughput_analyzer.NotifyStartTransaction(*(request.get()));
requests.push_back(std::move(request));
}
diff --git a/chromium/net/ntlm/DIR_METADATA b/chromium/net/ntlm/DIR_METADATA
new file mode 100644
index 00000000000..d8e8e027aab
--- /dev/null
+++ b/chromium/net/ntlm/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Auth"
+} \ No newline at end of file
diff --git a/chromium/net/ntlm/OWNERS b/chromium/net/ntlm/OWNERS
index 156ce37c4df..f18201c77cb 100644
--- a/chromium/net/ntlm/OWNERS
+++ b/chromium/net/ntlm/OWNERS
@@ -1,6 +1,3 @@
asanka@chromium.org
rsleevi@chromium.org
zentaro@chromium.org
-
-# COMPONENT: Internals>Network>Auth
-# TEAM: net-dev@chromium.org
diff --git a/chromium/net/proxy_resolution/DIR_METADATA b/chromium/net/proxy_resolution/DIR_METADATA
new file mode 100644
index 00000000000..e05317a9b32
--- /dev/null
+++ b/chromium/net/proxy_resolution/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>Proxy"
+} \ No newline at end of file
diff --git a/chromium/net/proxy_resolution/OWNERS b/chromium/net/proxy_resolution/OWNERS
index b03baf3a747..e7cdae42abe 100644
--- a/chromium/net/proxy_resolution/OWNERS
+++ b/chromium/net/proxy_resolution/OWNERS
@@ -1,6 +1,3 @@
-eroman@chromium.org
mmenke@chromium.org
per-file *_v8*=jochen@chromium.org
-
-# COMPONENT: Internals>Network>Proxy
diff --git a/chromium/net/proxy_resolution/configured_proxy_resolution_request.cc b/chromium/net/proxy_resolution/configured_proxy_resolution_request.cc
index 0c2dfc65569..88b06c43dba 100644
--- a/chromium/net/proxy_resolution/configured_proxy_resolution_request.cc
+++ b/chromium/net/proxy_resolution/configured_proxy_resolution_request.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "net/base/net_errors.h"
#include "net/log/net_log_event_type.h"
#include "net/proxy_resolution/configured_proxy_resolution_service.h"
diff --git a/chromium/net/proxy_resolution/configured_proxy_resolution_service.cc b/chromium/net/proxy_resolution/configured_proxy_resolution_service.cc
index 7a7ca7518ee..c4ef89aa46b 100644
--- a/chromium/net/proxy_resolution/configured_proxy_resolution_service.cc
+++ b/chromium/net/proxy_resolution/configured_proxy_resolution_service.cc
@@ -9,7 +9,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/logging.h"
@@ -21,6 +21,7 @@
#include "base/values.h"
#include "build/build_config.h"
#include "net/base/net_errors.h"
+#include "net/base/net_info_source_list.h"
#include "net/base/network_isolation_key.h"
#include "net/base/proxy_delegate.h"
#include "net/base/url_util.h"
@@ -1347,22 +1348,22 @@ void ConfiguredProxyResolutionService::ForceReloadProxyConfig() {
ApplyProxyConfigIfAvailable();
}
-base::Value ConfiguredProxyResolutionService::GetProxyNetLogValues(
- int info_sources) {
+base::Value ConfiguredProxyResolutionService::GetProxyNetLogValues() {
base::Value net_info_dict(base::Value::Type::DICTIONARY);
- if (info_sources & NET_INFO_PROXY_SETTINGS) {
+ // Log Proxy Settings.
+ {
base::Value dict(base::Value::Type::DICTIONARY);
if (fetched_config_)
dict.SetKey("original", fetched_config_->value().ToValue());
if (config_)
dict.SetKey("effective", config_->value().ToValue());
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_PROXY_SETTINGS),
- std::move(dict));
+ net_info_dict.SetKey(kNetInfoProxySettings, std::move(dict));
}
- if (info_sources & NET_INFO_BAD_PROXIES) {
+ // Log Bad Proxies.
+ {
base::Value list(base::Value::Type::LIST);
for (const auto& it : proxy_retry_info_) {
@@ -1377,8 +1378,7 @@ base::Value ConfiguredProxyResolutionService::GetProxyNetLogValues(
list.Append(std::move(dict));
}
- net_info_dict.SetKey(NetInfoSourceToString(NET_INFO_BAD_PROXIES),
- std::move(list));
+ net_info_dict.SetKey(kNetInfoBadProxies, std::move(list));
}
return net_info_dict;
diff --git a/chromium/net/proxy_resolution/configured_proxy_resolution_service.h b/chromium/net/proxy_resolution/configured_proxy_resolution_service.h
index d2ea119490b..b5ee7944bb6 100644
--- a/chromium/net/proxy_resolution/configured_proxy_resolution_service.h
+++ b/chromium/net/proxy_resolution/configured_proxy_resolution_service.h
@@ -171,7 +171,7 @@ class NET_EXPORT ConfiguredProxyResolutionService
void ForceReloadProxyConfig();
// ProxyResolutionService
- base::Value GetProxyNetLogValues(int info_sources) override;
+ base::Value GetProxyNetLogValues() override;
// ProxyResolutionService
bool CastToConfiguredProxyResolutionService(
diff --git a/chromium/net/proxy_resolution/multi_threaded_proxy_resolver.cc b/chromium/net/proxy_resolution/multi_threaded_proxy_resolver.cc
index d213b042dbd..a762caec0a1 100644
--- a/chromium/net/proxy_resolution/multi_threaded_proxy_resolver.cc
+++ b/chromium/net/proxy_resolution/multi_threaded_proxy_resolver.cc
@@ -8,7 +8,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/containers/circular_deque.h"
#include "base/location.h"
diff --git a/chromium/net/proxy_resolution/network_delegate_error_observer_unittest.cc b/chromium/net/proxy_resolution/network_delegate_error_observer_unittest.cc
index b0c9ff4322c..c9448fd2a4c 100644
--- a/chromium/net/proxy_resolution/network_delegate_error_observer_unittest.cc
+++ b/chromium/net/proxy_resolution/network_delegate_error_observer_unittest.cc
@@ -5,7 +5,7 @@
#include "net/proxy_resolution/network_delegate_error_observer.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/optional.h"
#include "base/run_loop.h"
diff --git a/chromium/net/proxy_resolution/pac_file_decider.cc b/chromium/net/proxy_resolution/pac_file_decider.cc
index b5ddde9fd39..31bf669295f 100644
--- a/chromium/net/proxy_resolution/pac_file_decider.cc
+++ b/chromium/net/proxy_resolution/pac_file_decider.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/format_macros.h"
diff --git a/chromium/net/proxy_resolution/proxy_config_service_android_unittest.cc b/chromium/net/proxy_resolution/proxy_config_service_android_unittest.cc
index 775e7d3f12c..9350a831d63 100644
--- a/chromium/net/proxy_resolution/proxy_config_service_android_unittest.cc
+++ b/chromium/net/proxy_resolution/proxy_config_service_android_unittest.cc
@@ -9,7 +9,7 @@
#include <string>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
diff --git a/chromium/net/proxy_resolution/proxy_resolution_service.h b/chromium/net/proxy_resolution/proxy_resolution_service.h
index 93673f76126..3caac54c192 100644
--- a/chromium/net/proxy_resolution/proxy_resolution_service.h
+++ b/chromium/net/proxy_resolution/proxy_resolution_service.h
@@ -93,9 +93,8 @@ class NET_EXPORT ProxyResolutionService {
virtual const ProxyRetryInfoMap& proxy_retry_info() const = 0;
// Returns proxy related debug information to be included in the NetLog. The
- // data should be appropriate for any capture mode. |info_sources| is a bit
- // field of NET_INFO_SOURCE.
- virtual base::Value GetProxyNetLogValues(int info_sources) = 0;
+ // data should be appropriate for any capture mode (sensitivity level).
+ virtual base::Value GetProxyNetLogValues() = 0;
// Returns true if |this| is an instance of ConfiguredProxyResolutionService
// and assigns |this| to the out parameter. Otherwise returns false and sets
diff --git a/chromium/net/proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.cc b/chromium/net/proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.cc
index 8ca57498990..ae9d03813b9 100644
--- a/chromium/net/proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.cc
+++ b/chromium/net/proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.cc
@@ -5,7 +5,7 @@
#include "net/proxy_resolution/win/dhcp_pac_file_adapter_fetcher_win.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/free_deleter.h"
diff --git a/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win.cc b/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win.cc
index db45e22d825..7fa02621075 100644
--- a/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win.cc
+++ b/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win.cc
@@ -8,7 +8,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/containers/queue.h"
#include "base/memory/free_deleter.h"
#include "base/synchronization/lock.h"
diff --git a/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc b/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc
index dbc98c83a5f..20d89f7671c 100644
--- a/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc
+++ b/chromium/net/proxy_resolution/win/dhcp_pac_file_fetcher_win_unittest.cc
@@ -7,7 +7,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/rand_util.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
diff --git a/chromium/net/proxy_resolution/win/proxy_config_service_win.cc b/chromium/net/proxy_resolution/win/proxy_config_service_win.cc
index 5c7b72a216d..a5c3a196ae9 100644
--- a/chromium/net/proxy_resolution/win/proxy_config_service_win.cc
+++ b/chromium/net/proxy_resolution/win/proxy_config_service_win.cc
@@ -8,7 +8,8 @@
#include <winhttp.h>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
diff --git a/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc b/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc
index 1dcf0964681..64f9bc6c79e 100644
--- a/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc
+++ b/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.cc
@@ -139,8 +139,7 @@ const ProxyRetryInfoMap& WindowsSystemProxyResolutionService::proxy_retry_info()
return proxy_retry_info_;
}
-base::Value WindowsSystemProxyResolutionService::GetProxyNetLogValues(
- int info_sources) {
+base::Value WindowsSystemProxyResolutionService::GetProxyNetLogValues() {
// TODO (https://crbug.com/1032820): Implement net logs.
base::Value net_info_dict(base::Value::Type::DICTIONARY);
return net_info_dict;
diff --git a/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.h b/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.h
index 1e82a11d0c6..b994b99877e 100644
--- a/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.h
+++ b/chromium/net/proxy_resolution/win/windows_system_proxy_resolution_service.h
@@ -66,7 +66,7 @@ class NET_EXPORT WindowsSystemProxyResolutionService
const NetLogWithSource& net_log) override;
void ClearBadProxiesCache() override;
const ProxyRetryInfoMap& proxy_retry_info() const override;
- base::Value GetProxyNetLogValues(int info_sources) override;
+ base::Value GetProxyNetLogValues() override;
bool CastToConfiguredProxyResolutionService(
ConfiguredProxyResolutionService** configured_proxy_resolution_service)
override WARN_UNUSED_RESULT;
diff --git a/chromium/net/quic/DIR_METADATA b/chromium/net/quic/DIR_METADATA
new file mode 100644
index 00000000000..123352d107a
--- /dev/null
+++ b/chromium/net/quic/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>QUIC"
+} \ No newline at end of file
diff --git a/chromium/net/quic/OWNERS b/chromium/net/quic/OWNERS
index 4d12d7e8fff..c1f9db3838d 100644
--- a/chromium/net/quic/OWNERS
+++ b/chromium/net/quic/OWNERS
@@ -1,7 +1,4 @@
dschinazi@chromium.org
nharper@chromium.org
vasilvv@chromium.org
-zhongyi@chromium.org
bnc@chromium.org
-
-# COMPONENT: Internals>Network>QUIC
diff --git a/chromium/net/quic/bidirectional_stream_quic_impl.cc b/chromium/net/quic/bidirectional_stream_quic_impl.cc
index a8d332f2f21..dad946d00e6 100644
--- a/chromium/net/quic/bidirectional_stream_quic_impl.cc
+++ b/chromium/net/quic/bidirectional_stream_quic_impl.cc
@@ -124,7 +124,7 @@ void BidirectionalStreamQuicImpl::SendRequestHeaders() {
int BidirectionalStreamQuicImpl::WriteHeaders() {
DCHECK(!has_sent_headers_);
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
HttpRequestInfo http_request_info;
http_request_info.url = request_info_->url;
http_request_info.method = request_info_->method;
diff --git a/chromium/net/quic/bidirectional_stream_quic_impl.h b/chromium/net/quic/bidirectional_stream_quic_impl.h
index cb3927bcacc..7622b6340bf 100644
--- a/chromium/net/quic/bidirectional_stream_quic_impl.h
+++ b/chromium/net/quic/bidirectional_stream_quic_impl.h
@@ -95,8 +95,8 @@ class NET_EXPORT_PRIVATE BidirectionalStreamQuicImpl
// received.
LoadTimingInfo::ConnectTiming connect_timing_;
- spdy::SpdyHeaderBlock initial_headers_;
- spdy::SpdyHeaderBlock trailing_headers_;
+ spdy::Http2HeaderBlock initial_headers_;
+ spdy::Http2HeaderBlock trailing_headers_;
// User provided read buffer for ReadData() response.
scoped_refptr<IOBuffer> read_buffer_;
diff --git a/chromium/net/quic/bidirectional_stream_quic_impl_unittest.cc b/chromium/net/quic/bidirectional_stream_quic_impl_unittest.cc
index 9aabe5361a3..e37a87832d2 100644
--- a/chromium/net/quic/bidirectional_stream_quic_impl_unittest.cc
+++ b/chromium/net/quic/bidirectional_stream_quic_impl_unittest.cc
@@ -8,6 +8,7 @@
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
+#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_tick_clock.h"
@@ -89,10 +90,10 @@ struct TestParams {
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
std::vector<TestParams> GetTestParams() {
@@ -148,7 +149,7 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
}
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override {
+ const spdy::Http2HeaderBlock& response_headers) override {
CHECK(!on_failed_called_);
CHECK(!not_expect_callback_);
@@ -178,7 +179,7 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
loop_->Quit();
}
- void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) override {
+ void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override {
CHECK(!on_failed_called_);
CHECK(!not_expect_callback_);
@@ -308,10 +309,10 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
// Const getters for internal states.
const std::string& data_received() const { return data_received_; }
int error() const { return error_; }
- const spdy::SpdyHeaderBlock& response_headers() const {
+ const spdy::Http2HeaderBlock& response_headers() const {
return response_headers_;
}
- const spdy::SpdyHeaderBlock& trailers() const { return trailers_; }
+ const spdy::Http2HeaderBlock& trailers() const { return trailers_; }
int on_data_read_count() const { return on_data_read_count_; }
int on_data_sent_count() const { return on_data_sent_count_; }
bool on_failed_called() const { return on_failed_called_; }
@@ -328,8 +329,8 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
std::unique_ptr<base::OneShotTimer> timer_;
std::string data_received_;
std::unique_ptr<base::RunLoop> loop_;
- spdy::SpdyHeaderBlock response_headers_;
- spdy::SpdyHeaderBlock trailers_;
+ spdy::Http2HeaderBlock response_headers_;
+ spdy::Http2HeaderBlock trailers_;
NextProto next_proto_;
int64_t received_bytes_;
int64_t sent_bytes_;
@@ -374,10 +375,10 @@ class DeleteStreamDelegate : public TestDelegateBase {
}
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override {
+ const spdy::Http2HeaderBlock& response_headers) override {
// Make a copy of |response_headers| before the stream is deleted, since
// the headers are owned by the stream.
- spdy::SpdyHeaderBlock headers_copy = response_headers.Clone();
+ spdy::Http2HeaderBlock headers_copy = response_headers.Clone();
if (phase_ == ON_HEADERS_RECEIVED)
DeleteStream();
TestDelegateBase::OnHeadersReceived(headers_copy);
@@ -392,12 +393,12 @@ class DeleteStreamDelegate : public TestDelegateBase {
TestDelegateBase::OnDataRead(bytes_read);
}
- void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) override {
+ void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override {
DCHECK_NE(ON_HEADERS_RECEIVED, phase_);
DCHECK_NE(ON_DATA_READ, phase_);
// Make a copy of |response_headers| before the stream is deleted, since
// the headers are owned by the stream.
- spdy::SpdyHeaderBlock trailers_copy = trailers.Clone();
+ spdy::Http2HeaderBlock trailers_copy = trailers.Clone();
if (phase_ == ON_TRAILERS_RECEIVED)
DeleteStream();
TestDelegateBase::OnTrailersReceived(trailers_copy);
@@ -530,8 +531,8 @@ class BidirectionalStreamQuicImplTest
new QuicChromiumConnectionHelper(&clock_, &random_generator_));
alarm_factory_.reset(new QuicChromiumAlarmFactory(runner_.get(), &clock_));
connection_ = new quic::QuicConnection(
- connection_id_, ToQuicSocketAddress(peer_addr_), helper_.get(),
- alarm_factory_.get(),
+ connection_id_, quic::QuicSocketAddress(),
+ ToQuicSocketAddress(peer_addr_), helper_.get(), alarm_factory_.get(),
new QuicChromiumPacketWriter(socket.get(), runner_.get()),
true /* owns_writer */, quic::Perspective::IS_CLIENT,
quic::test::SupportedVersions(version_));
@@ -598,7 +599,7 @@ class BidirectionalStreamQuicImplTest
request_headers_ = client_maker_.GetRequestHeaders(method, "http", path);
}
- spdy::SpdyHeaderBlock ConstructResponseHeaders(
+ spdy::Http2HeaderBlock ConstructResponseHeaders(
const std::string& response_code) {
return server_maker_.GetResponseHeaders(response_code);
}
@@ -607,7 +608,7 @@ class BidirectionalStreamQuicImplTest
uint64_t packet_number,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
std::unique_ptr<quic::QuicReceivedPacket> packet(
server_maker_.MakeDataPacket(packet_number, stream_id_,
should_include_version, fin, data));
@@ -619,7 +620,7 @@ class BidirectionalStreamQuicImplTest
std::unique_ptr<quic::QuicReceivedPacket> ConstructClientDataPacket(
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return client_maker_.MakeDataPacket(++packet_number_, stream_id_,
should_include_version, fin, data);
}
@@ -679,7 +680,7 @@ class BidirectionalStreamQuicImplTest
std::unique_ptr<quic::QuicReceivedPacket> ConstructResponseHeadersPacket(
uint64_t packet_number,
bool fin,
- spdy::SpdyHeaderBlock response_headers,
+ spdy::Http2HeaderBlock response_headers,
size_t* spdy_headers_frame_length) {
return ConstructResponseHeadersPacketInner(packet_number, stream_id_, fin,
std::move(response_headers),
@@ -690,7 +691,7 @@ class BidirectionalStreamQuicImplTest
uint64_t packet_number,
quic::QuicStreamId stream_id,
bool fin,
- spdy::SpdyHeaderBlock response_headers,
+ spdy::Http2HeaderBlock response_headers,
size_t* spdy_headers_frame_length) {
return server_maker_.MakeResponseHeadersPacket(
packet_number, stream_id, !kIncludeVersion, fin,
@@ -700,7 +701,7 @@ class BidirectionalStreamQuicImplTest
std::unique_ptr<quic::QuicReceivedPacket> ConstructResponseTrailersPacket(
uint64_t packet_number,
bool fin,
- spdy::SpdyHeaderBlock trailers,
+ spdy::Http2HeaderBlock trailers,
size_t* spdy_headers_frame_length) {
return server_maker_.MakeResponseHeadersPacket(
packet_number, stream_id_, !kIncludeVersion, fin, std::move(trailers),
@@ -750,7 +751,7 @@ class BidirectionalStreamQuicImplTest
uint64_t largest_received,
uint64_t smallest_received,
bool fin,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
QuicTestPacketMaker* maker) {
std::unique_ptr<quic::QuicReceivedPacket> packet(
maker->MakeAckAndDataPacket(packet_number, should_include_version,
@@ -831,7 +832,7 @@ class BidirectionalStreamQuicImplTest
HttpRequestHeaders headers_;
HttpResponseInfo response_;
scoped_refptr<IOBufferWithSize> read_buffer_;
- spdy::SpdyHeaderBlock request_headers_;
+ spdy::Http2HeaderBlock request_headers_;
const quic::QuicConnectionId connection_id_;
const quic::QuicStreamId stream_id_;
QuicTestPacketMaker client_maker_;
@@ -860,8 +861,7 @@ TEST_P(BidirectionalStreamQuicImplTest, GetRequest) {
if (VersionUsesHttp3(version_.transport_version))
AddWrite(ConstructInitialSettingsPacket());
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructClientAckPacket(3, 1));
@@ -888,7 +888,7 @@ TEST_P(BidirectionalStreamQuicImplTest, GetRequest) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -914,7 +914,7 @@ TEST_P(BidirectionalStreamQuicImplTest, GetRequest) {
TestCompletionCallback cb2;
EXPECT_THAT(delegate->ReadData(cb2.callback()), IsError(ERR_IO_PENDING));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
size_t spdy_trailers_frame_length;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
@@ -964,13 +964,12 @@ TEST_P(BidirectionalStreamQuicImplTest, LoadTimingTwoRequests) {
if (VersionUsesHttp3(version_.transport_version))
AddWrite(ConstructInitialSettingsPacket());
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY, nullptr));
+ GetNthClientInitiatedBidirectionalStreamId(0), kFin, DEFAULT_PRIORITY,
+ nullptr));
// SetRequest() again for second request as |request_headers_| was moved.
SetRequest("GET", "/", DEFAULT_PRIORITY);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(1), kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(1), kFin, DEFAULT_PRIORITY,
GetNthClientInitiatedBidirectionalStreamId(0), nullptr));
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructClientAckPacket(3, 1));
@@ -1046,8 +1045,7 @@ TEST_P(BidirectionalStreamQuicImplTest, CoalesceDataBuffersNotHeadersFrame) {
std::string header2 = ConstructDataHeader(kBody2.length());
std::vector<std::string> two_writes = {kBody1, kBody2};
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
if (!version_.UsesHttp3()) {
AddWrite(
@@ -1111,7 +1109,7 @@ TEST_P(BidirectionalStreamQuicImplTest, CoalesceDataBuffersNotHeadersFrame) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
ConstructResponseHeadersPacket(2, !kFin, std::move(response_headers),
@@ -1143,7 +1141,7 @@ TEST_P(BidirectionalStreamQuicImplTest, CoalesceDataBuffersNotHeadersFrame) {
delegate->WaitUntilNextCallback(kOnDataSent);
size_t spdy_trailers_frame_length;
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
trailers[quic::kFinalOffsetHeaderKey] =
@@ -1187,7 +1185,8 @@ TEST_P(BidirectionalStreamQuicImplTest,
std::string header = ConstructDataHeader(strlen(kBody1));
if (version_.UsesHttp3()) {
AddWrite(ConstructRequestHeadersAndMultipleDataFramesPacket(
- !kFin, MEDIUM, &spdy_request_headers_frame_length, {header, kBody1}));
+ !kFin, DEFAULT_PRIORITY, &spdy_request_headers_frame_length,
+ {header, kBody1}));
} else {
AddWrite(ConstructRequestHeadersAndMultipleDataFramesPacket(
!kFin, DEFAULT_PRIORITY, &spdy_request_headers_frame_length, {kBody1}));
@@ -1233,7 +1232,7 @@ TEST_P(BidirectionalStreamQuicImplTest,
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
ConstructResponseHeadersPacket(2, !kFin, std::move(response_headers),
@@ -1260,7 +1259,7 @@ TEST_P(BidirectionalStreamQuicImplTest,
delegate->WaitUntilNextCallback(kOnDataSent);
size_t spdy_trailers_frame_length;
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
trailers[quic::kFinalOffsetHeaderKey] =
@@ -1305,7 +1304,7 @@ TEST_P(BidirectionalStreamQuicImplTest,
if (version_.UsesHttp3()) {
AddWrite(ConstructRequestHeadersAndMultipleDataFramesPacket(
- !kFin, MEDIUM, &spdy_request_headers_frame_length,
+ !kFin, DEFAULT_PRIORITY, &spdy_request_headers_frame_length,
{header + kBody1 + header2 + kBody2}));
} else {
AddWrite(ConstructRequestHeadersAndMultipleDataFramesPacket(
@@ -1362,7 +1361,7 @@ TEST_P(BidirectionalStreamQuicImplTest,
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
ConstructResponseHeadersPacket(2, !kFin, std::move(response_headers),
@@ -1394,7 +1393,7 @@ TEST_P(BidirectionalStreamQuicImplTest,
delegate->WaitUntilNextCallback(kOnDataSent);
size_t spdy_trailers_frame_length;
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
trailers[quic::kFinalOffsetHeaderKey] =
@@ -1510,8 +1509,7 @@ TEST_P(BidirectionalStreamQuicImplTest, PostRequest) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
std::string header = ConstructDataHeader(strlen(kUploadData));
if (version_.UsesHttp3()) {
@@ -1551,7 +1549,7 @@ TEST_P(BidirectionalStreamQuicImplTest, PostRequest) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
ConstructResponseHeadersPacket(2, !kFin, std::move(response_headers),
@@ -1571,7 +1569,7 @@ TEST_P(BidirectionalStreamQuicImplTest, PostRequest) {
EXPECT_EQ(static_cast<int>(strlen(kResponseBody)), cb.WaitForResult());
size_t spdy_trailers_frame_length;
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
trailers[quic::kFinalOffsetHeaderKey] =
@@ -1605,8 +1603,7 @@ TEST_P(BidirectionalStreamQuicImplTest, EarlyDataOverrideRequest) {
if (VersionUsesHttp3(version_.transport_version))
AddWrite(ConstructInitialSettingsPacket());
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructClientAckPacket(3, 1));
@@ -1634,7 +1631,7 @@ TEST_P(BidirectionalStreamQuicImplTest, EarlyDataOverrideRequest) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -1660,7 +1657,7 @@ TEST_P(BidirectionalStreamQuicImplTest, EarlyDataOverrideRequest) {
TestCompletionCallback cb2;
EXPECT_THAT(delegate->ReadData(cb2.callback()), IsError(ERR_IO_PENDING));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
size_t spdy_trailers_frame_length;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
@@ -1712,8 +1709,7 @@ TEST_P(BidirectionalStreamQuicImplTest, InterleaveReadDataAndSendData) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
std::string header = ConstructDataHeader(strlen(kUploadData));
@@ -1751,7 +1747,7 @@ TEST_P(BidirectionalStreamQuicImplTest, InterleaveReadDataAndSendData) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
ConstructResponseHeadersPacket(2, !kFin, std::move(response_headers),
@@ -1822,8 +1818,7 @@ TEST_P(BidirectionalStreamQuicImplTest, ServerSendsRstAfterHeaders) {
if (VersionUsesHttp3(version_.transport_version))
AddWrite(ConstructInitialSettingsPacket());
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
Initialize();
@@ -1869,8 +1864,7 @@ TEST_P(BidirectionalStreamQuicImplTest, ServerSendsRstAfterReadData) {
if (VersionUsesHttp3(version_.transport_version))
AddWrite(ConstructInitialSettingsPacket());
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
// Why does QUIC ack Rst? Is this expected?
@@ -1897,7 +1891,7 @@ TEST_P(BidirectionalStreamQuicImplTest, ServerSendsRstAfterReadData) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -1935,8 +1929,7 @@ TEST_P(BidirectionalStreamQuicImplTest, SessionClosedBeforeReadData) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
Initialize();
@@ -1959,7 +1952,7 @@ TEST_P(BidirectionalStreamQuicImplTest, SessionClosedBeforeReadData) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -2076,8 +2069,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnStreamReady) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
AddWrite(ConstructClientEarlyRstStreamPacket());
@@ -2111,8 +2103,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamAfterReadData) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
AddWrite(ConstructClientAckAndRstStreamPacket(2, 1));
@@ -2137,7 +2128,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamAfterReadData) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
ConstructResponseHeadersPacket(2, !kFin, std::move(response_headers),
@@ -2170,8 +2161,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnHeadersReceived) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
AddWrite(ConstructClientAckAndRstStreamPacket(2, 1));
@@ -2197,7 +2187,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnHeadersReceived) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -2221,8 +2211,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnDataRead) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
AddWrite(ConstructClientAckPacket(3, 1));
AddWrite(ConstructClientRstStreamPacket());
@@ -2248,7 +2237,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnDataRead) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -2284,8 +2273,7 @@ TEST_P(BidirectionalStreamQuicImplTest, AsyncFinRead) {
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
AddWrite(ConstructRequestHeadersPacketInner(
- GetNthClientInitiatedBidirectionalStreamId(0), !kFin,
- version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
+ GetNthClientInitiatedBidirectionalStreamId(0), !kFin, DEFAULT_PRIORITY,
&spdy_request_headers_frame_length));
std::string header = ConstructDataHeader(strlen(kBody));
if (version_.UsesHttp3()) {
@@ -2323,7 +2311,7 @@ TEST_P(BidirectionalStreamQuicImplTest, AsyncFinRead) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -2360,9 +2348,8 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnTrailersReceived) {
if (VersionUsesHttp3(version_.transport_version))
AddWrite(ConstructInitialSettingsPacket());
client_maker_.SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
- AddWrite(ConstructRequestHeadersPacket(
- kFin, version_.UsesHttp3() ? MEDIUM : DEFAULT_PRIORITY,
- &spdy_request_headers_frame_length));
+ AddWrite(ConstructRequestHeadersPacket(kFin, DEFAULT_PRIORITY,
+ &spdy_request_headers_frame_length));
AddWrite(ConstructClientAckPacket(3, 1)); // Ack the data packet
AddWrite(ConstructClientAckAndRstStreamPacket(4, 4));
@@ -2388,7 +2375,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnTrailersReceived) {
ProcessPacket(ConstructServerAckPacket(1, 1, 1, 1));
// Server sends the response headers.
- spdy::SpdyHeaderBlock response_headers = ConstructResponseHeaders("200");
+ spdy::Http2HeaderBlock response_headers = ConstructResponseHeaders("200");
size_t spdy_response_headers_frame_length;
ProcessPacket(
@@ -2413,7 +2400,7 @@ TEST_P(BidirectionalStreamQuicImplTest, DeleteStreamDuringOnTrailersReceived) {
EXPECT_EQ(std::string(kResponseBody), delegate->data_received());
size_t spdy_trailers_frame_length;
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
trailers[quic::kFinalOffsetHeaderKey] =
diff --git a/chromium/net/quic/crypto/proof_source_chromium.cc b/chromium/net/quic/crypto/proof_source_chromium.cc
index 39e76c5df32..b923516b9c6 100644
--- a/chromium/net/quic/crypto/proof_source_chromium.cc
+++ b/chromium/net/quic/crypto/proof_source_chromium.cc
@@ -78,7 +78,7 @@ bool ProofSourceChromium::GetProofInner(
const string& hostname,
const string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
quic::QuicReferenceCountedPointer<quic::ProofSource::Chain>* out_chain,
quic::QuicCryptoProof* proof) {
DCHECK(proof != nullptr);
@@ -134,7 +134,7 @@ void ProofSourceChromium::GetProof(const quic::QuicSocketAddress& server_addr,
const std::string& hostname,
const std::string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<Callback> callback) {
// As a transitional implementation, just call the synchronous version of
// GetProof, then invoke the callback with the results and destroy it.
@@ -160,7 +160,7 @@ void ProofSourceChromium::ComputeTlsSignature(
const quic::QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<SignatureCallback> callback) {
crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE);
bssl::ScopedEVP_MD_CTX sign_context;
diff --git a/chromium/net/quic/crypto/proof_source_chromium.h b/chromium/net/quic/crypto/proof_source_chromium.h
index c16a2073b41..0addbc7de11 100644
--- a/chromium/net/quic/crypto/proof_source_chromium.h
+++ b/chromium/net/quic/crypto/proof_source_chromium.h
@@ -38,7 +38,7 @@ class NET_EXPORT_PRIVATE ProofSourceChromium : public quic::ProofSource {
const std::string& hostname,
const std::string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<Callback> callback) override;
quic::QuicReferenceCountedPointer<Chain> GetCertChain(
@@ -51,7 +51,7 @@ class NET_EXPORT_PRIVATE ProofSourceChromium : public quic::ProofSource {
const quic::QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<SignatureCallback> callback) override;
TicketCrypter* GetTicketCrypter() override;
@@ -63,7 +63,7 @@ class NET_EXPORT_PRIVATE ProofSourceChromium : public quic::ProofSource {
const std::string& hostname,
const std::string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
quic::QuicReferenceCountedPointer<quic::ProofSource::Chain>* out_chain,
quic::QuicCryptoProof* proof);
diff --git a/chromium/net/quic/crypto/proof_test_chromium.cc b/chromium/net/quic/crypto/proof_test_chromium.cc
index 5720991912f..c1512ae41d9 100644
--- a/chromium/net/quic/crypto/proof_test_chromium.cc
+++ b/chromium/net/quic/crypto/proof_test_chromium.cc
@@ -57,7 +57,7 @@ void RunVerification(quic::ProofVerifier* verifier,
const uint16_t port,
const string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<string>& certs,
const string& proof,
bool expected_ok) {
diff --git a/chromium/net/quic/crypto/proof_verifier_chromium.cc b/chromium/net/quic/crypto/proof_verifier_chromium.cc
index 5b4dd1e29b7..ed730753f56 100644
--- a/chromium/net/quic/crypto/proof_verifier_chromium.cc
+++ b/chromium/net/quic/crypto/proof_verifier_chromium.cc
@@ -7,7 +7,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
@@ -43,7 +42,6 @@ ProofVerifyDetailsChromium::ProofVerifyDetailsChromium(
quic::ProofVerifyDetails* ProofVerifyDetailsChromium::Clone() const {
ProofVerifyDetailsChromium* other = new ProofVerifyDetailsChromium;
other->cert_verify_result = cert_verify_result;
- other->ct_verify_result = ct_verify_result;
return other;
}
@@ -69,7 +67,7 @@ class ProofVerifierChromium::Job {
const uint16_t port,
const std::string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -120,7 +118,7 @@ class ProofVerifierChromium::Job {
bool VerifySignature(const std::string& signed_data,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::string& signature,
const std::string& cert);
@@ -212,7 +210,7 @@ quic::QuicAsyncStatus ProofVerifierChromium::Job::VerifyProof(
const uint16_t port,
const string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<string>& certs,
const std::string& cert_sct,
const string& signature,
@@ -237,13 +235,6 @@ quic::QuicAsyncStatus ProofVerifierChromium::Job::VerifyProof(
if (!GetX509Certificate(certs, error_details, verify_details))
return quic::QUIC_FAILURE;
- // Note that this is a completely synchronous operation: The CT Log Verifier
- // gets all the data it needs for SCT verification and does not do any
- // external communication.
- cert_transparency_verifier_->Verify(
- hostname, cert_.get(), std::string(), cert_sct,
- &verify_details_->ct_verify_result.scts, net_log_);
-
// We call VerifySignature first to avoid copying of server_config and
// signature.
if (!VerifySignature(server_config, quic_version, chlo_hash, signature,
@@ -286,13 +277,6 @@ quic::QuicAsyncStatus ProofVerifierChromium::Job::VerifyCertChain(
if (!GetX509Certificate(certs, error_details, verify_details))
return quic::QUIC_FAILURE;
- // Note that this is a completely synchronous operation: The CT Log Verifier
- // gets all the data it needs for SCT verification and does not do any
- // external communication.
- cert_transparency_verifier_->Verify(
- hostname, cert_.get(), std::string(), cert_sct,
- &verify_details_->ct_verify_result.scts, net_log_);
-
return VerifyCert(hostname, port, ocsp_response, cert_sct, error_details,
verify_details, std::move(callback));
}
@@ -421,16 +405,25 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
// If the connection was good, check HPKP and CT status simultaneously,
// but prefer to treat the HPKP error as more serious, if there was one.
if (result == OK) {
- ct::SCTList verified_scts = ct::SCTsMatchingStatus(
- verify_details_->ct_verify_result.scts, ct::SCT_STATUS_OK);
-
- verify_details_->ct_verify_result.policy_compliance =
+ // Note that this is a completely synchronous operation: The CT Log Verifier
+ // gets all the data it needs for SCT verification and does not do any
+ // external communication.
+ cert_transparency_verifier_->Verify(
+ hostname_, cert_.get(), std::string(), cert_sct_,
+ &verify_details_->cert_verify_result.scts, net_log_);
+
+ ct::SCTList verified_scts;
+ for (const auto& sct_and_status : cert_verify_result.scts) {
+ if (sct_and_status.status == ct::SCT_STATUS_OK)
+ verified_scts.push_back(sct_and_status.sct);
+ }
+ verify_details_->cert_verify_result.policy_compliance =
policy_enforcer_->CheckCompliance(
cert_verify_result.verified_cert.get(), verified_scts, net_log_);
if (verify_details_->cert_verify_result.cert_status & CERT_STATUS_IS_EV) {
- if (verify_details_->ct_verify_result.policy_compliance !=
+ if (verify_details_->cert_verify_result.policy_compliance !=
ct::CTPolicyCompliance::CT_POLICY_COMPLIES_VIA_SCTS &&
- verify_details_->ct_verify_result.policy_compliance !=
+ verify_details_->cert_verify_result.policy_compliance !=
ct::CTPolicyCompliance::CT_POLICY_BUILD_NOT_TIMELY) {
verify_details_->cert_verify_result.cert_status |=
CERT_STATUS_CT_COMPLIANCE_FAILED;
@@ -443,7 +436,7 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
if (verify_details_->cert_verify_result.is_issued_by_known_root) {
UMA_HISTOGRAM_ENUMERATION(
"Net.CertificateTransparency.EVCompliance2.QUIC",
- verify_details_->ct_verify_result.policy_compliance,
+ cert_verify_result.policy_compliance,
ct::CTPolicyCompliance::CT_POLICY_COUNT);
}
}
@@ -453,7 +446,7 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
if (verify_details_->cert_verify_result.is_issued_by_known_root) {
UMA_HISTOGRAM_ENUMERATION(
"Net.CertificateTransparency.ConnectionComplianceStatus2.QUIC",
- verify_details_->ct_verify_result.policy_compliance,
+ verify_details_->cert_verify_result.policy_compliance,
ct::CTPolicyCompliance::CT_POLICY_COUNT);
}
@@ -464,12 +457,11 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
cert_verify_result.is_issued_by_known_root,
cert_verify_result.public_key_hashes,
cert_verify_result.verified_cert.get(), cert_.get(),
- verify_details_->ct_verify_result.scts,
+ cert_verify_result.scts,
TransportSecurityState::ENABLE_EXPECT_CT_REPORTS,
- verify_details_->ct_verify_result.policy_compliance,
+ cert_verify_result.policy_compliance,
proof_verifier_->network_isolation_key_);
if (ct_requirement_status != TransportSecurityState::CT_NOT_REQUIRED) {
- verify_details_->ct_verify_result.policy_compliance_required = true;
if (verify_details_->cert_verify_result.is_issued_by_known_root) {
// Record the CT compliance of connections for which compliance is
// required; this helps answer the question: "Of all connections that
@@ -478,11 +470,9 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
UMA_HISTOGRAM_ENUMERATION(
"Net.CertificateTransparency.CTRequiredConnectionComplianceStatus2."
"QUIC",
- verify_details_->ct_verify_result.policy_compliance,
+ cert_verify_result.policy_compliance,
ct::CTPolicyCompliance::CT_POLICY_COUNT);
}
- } else {
- verify_details_->ct_verify_result.policy_compliance_required = false;
}
if (sct_auditing_delegate_ &&
@@ -490,8 +480,7 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
cert_verify_result.is_issued_by_known_root) {
sct_auditing_delegate_->MaybeEnqueueReport(
HostPortPair(hostname_, port_),
- cert_verify_result.verified_cert.get(),
- verify_details_->ct_verify_result.scts);
+ cert_verify_result.verified_cert.get(), cert_verify_result.scts);
}
switch (ct_requirement_status) {
@@ -506,7 +495,6 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
// possible values of CheckCTRequirements() are handled.
break;
}
-
TransportSecurityState::PKPStatus pin_validity =
transport_security_state_->CheckPublicKeyPins(
HostPortPair(hostname_, port_),
@@ -514,6 +502,7 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
cert_verify_result.public_key_hashes, cert_.get(),
cert_verify_result.verified_cert.get(),
TransportSecurityState::ENABLE_PIN_REPORTS,
+ proof_verifier_->network_isolation_key_,
&verify_details_->pinning_failure_log);
switch (pin_validity) {
case TransportSecurityState::PKPStatus::VIOLATED:
@@ -558,7 +547,7 @@ int ProofVerifierChromium::Job::DoVerifyCertComplete(int result) {
bool ProofVerifierChromium::Job::VerifySignature(
const string& signed_data,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const string& signature,
const string& cert) {
size_t size_bits;
@@ -634,7 +623,7 @@ quic::QuicAsyncStatus ProofVerifierChromium::VerifyProof(
const uint16_t port,
const std::string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -672,6 +661,7 @@ quic::QuicAsyncStatus ProofVerifierChromium::VerifyCertChain(
const quic::ProofVerifyContext* verify_context,
std::string* error_details,
std::unique_ptr<quic::ProofVerifyDetails>* verify_details,
+ uint8_t* /*out_alert*/,
std::unique_ptr<quic::ProofVerifierCallback> callback) {
if (!verify_context) {
*error_details = "Missing context";
diff --git a/chromium/net/quic/crypto/proof_verifier_chromium.h b/chromium/net/quic/crypto/proof_verifier_chromium.h
index 4884840fb8c..4e361aa8933 100644
--- a/chromium/net/quic/crypto/proof_verifier_chromium.h
+++ b/chromium/net/quic/crypto/proof_verifier_chromium.h
@@ -15,7 +15,6 @@
#include "net/base/net_export.h"
#include "net/base/network_isolation_key.h"
#include "net/cert/cert_verify_result.h"
-#include "net/cert/ct_verify_result.h"
#include "net/cert/x509_certificate.h"
#include "net/log/net_log_with_source.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h"
@@ -41,7 +40,6 @@ class NET_EXPORT_PRIVATE ProofVerifyDetailsChromium
quic::ProofVerifyDetails* Clone() const override;
CertVerifyResult cert_verify_result;
- ct::CTVerifyResult ct_verify_result;
// pinning_failure_log contains a message produced by
// TransportSecurityState::PKPState::CheckPublicKeyPins in the event of a
@@ -87,7 +85,7 @@ class NET_EXPORT_PRIVATE ProofVerifierChromium : public quic::ProofVerifier {
const uint16_t port,
const std::string& server_config,
quic::QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -104,6 +102,7 @@ class NET_EXPORT_PRIVATE ProofVerifierChromium : public quic::ProofVerifier {
const quic::ProofVerifyContext* verify_context,
std::string* error_details,
std::unique_ptr<quic::ProofVerifyDetails>* verify_details,
+ uint8_t* out_alert,
std::unique_ptr<quic::ProofVerifierCallback> callback) override;
std::unique_ptr<quic::ProofVerifyContext> CreateDefaultContext() override;
diff --git a/chromium/net/quic/crypto/proof_verifier_chromium_test.cc b/chromium/net/quic/crypto/proof_verifier_chromium_test.cc
index de6a0f4aff8..a5f18ac8bb7 100644
--- a/chromium/net/quic/crypto/proof_verifier_chromium_test.cc
+++ b/chromium/net/quic/crypto/proof_verifier_chromium_test.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/memory/ref_counted.h"
+#include "base/strings/string_piece.h"
#include "base/test/metrics/histogram_tester.h"
#include "net/base/completion_once_callback.h"
#include "net/base/net_errors.h"
@@ -133,6 +134,35 @@ const quic::QuicTransportVersion kTestTransportVersion =
} // namespace
+// A mock ReportSenderInterface that just remembers the latest report
+// URI and its NetworkIsolationKey.
+class MockCertificateReportSender
+ : public TransportSecurityState::ReportSenderInterface {
+ public:
+ MockCertificateReportSender() = default;
+ ~MockCertificateReportSender() override = default;
+
+ void Send(
+ const GURL& report_uri,
+ base::StringPiece content_type,
+ base::StringPiece report,
+ const NetworkIsolationKey& network_isolation_key,
+ base::OnceCallback<void()> success_callback,
+ base::OnceCallback<void(const GURL&, int, int)> error_callback) override {
+ latest_report_uri_ = report_uri;
+ latest_network_isolation_key_ = network_isolation_key;
+ }
+
+ const GURL& latest_report_uri() { return latest_report_uri_; }
+ const NetworkIsolationKey& latest_network_isolation_key() {
+ return latest_network_isolation_key_;
+ }
+
+ private:
+ GURL latest_report_uri_;
+ NetworkIsolationKey latest_network_isolation_key_;
+};
+
class ProofVerifierChromiumTest : public ::testing::Test {
public:
ProofVerifierChromiumTest()
@@ -190,17 +220,17 @@ class ProofVerifierChromiumTest : public ::testing::Test {
void CheckSCT(bool sct_expected_ok) {
ProofVerifyDetailsChromium* proof_details =
reinterpret_cast<ProofVerifyDetailsChromium*>(details_.get());
- const ct::CTVerifyResult& ct_verify_result =
- proof_details->ct_verify_result;
+ const CertVerifyResult& cert_verify_result =
+ proof_details->cert_verify_result;
if (sct_expected_ok) {
- ASSERT_TRUE(ct::CheckForSingleVerifiedSCTInResult(ct_verify_result.scts,
+ EXPECT_TRUE(ct::CheckForSingleVerifiedSCTInResult(cert_verify_result.scts,
kLogDescription));
- ASSERT_TRUE(ct::CheckForSCTOrigin(
- ct_verify_result.scts,
+ EXPECT_TRUE(ct::CheckForSCTOrigin(
+ cert_verify_result.scts,
ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION));
} else {
- EXPECT_EQ(1U, ct_verify_result.scts.size());
- EXPECT_EQ(ct::SCT_STATUS_LOG_UNKNOWN, ct_verify_result.scts[0].status);
+ ASSERT_EQ(1U, cert_verify_result.scts.size());
+ EXPECT_EQ(ct::SCT_STATUS_LOG_UNKNOWN, cert_verify_result.scts[0].status);
}
}
@@ -213,6 +243,7 @@ class ProofVerifierChromiumTest : public ::testing::Test {
std::unique_ptr<quic::ProofVerifyContext> verify_context_;
std::unique_ptr<quic::ProofVerifyDetails> details_;
std::string error_details_;
+ uint8_t tls_alert_;
std::vector<std::string> certs_;
CertVerifyResult dummy_result_;
scoped_refptr<X509Certificate> test_cert_;
@@ -243,7 +274,8 @@ TEST_F(ProofVerifierChromiumTest, VerifyProof) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
ASSERT_TRUE(details_.get());
@@ -271,65 +303,66 @@ TEST_F(ProofVerifierChromiumTest, FailsIfCertFails) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
}
-// Valid SCT, but invalid signature.
+// Valid SCT and cert
TEST_F(ProofVerifierChromiumTest, ValidSCTList) {
// Use different certificates for SCT tests.
ASSERT_NO_FATAL_FAILURE(GetSCTTestCertificates(&certs_));
- MockCertVerifier cert_verifier;
+ std::string der_test_cert(ct::GetDerEncodedX509Cert());
+ scoped_refptr<X509Certificate> test_cert = X509Certificate::CreateFromBytes(
+ der_test_cert.data(), der_test_cert.length());
+ ASSERT_TRUE(test_cert);
+ CertVerifyResult dummy_result;
+ dummy_result.verified_cert = test_cert;
+ dummy_result.is_issued_by_known_root = true;
+ MockCertVerifier dummy_verifier;
+ dummy_verifier.AddResultForCert(test_cert.get(), dummy_result, OK);
ProofVerifierChromium proof_verifier(
- &cert_verifier, &ct_policy_enforcer_, &transport_security_state_,
+ &dummy_verifier, &ct_policy_enforcer_, &transport_security_state_,
ct_verifier_.get(), nullptr, {}, NetworkIsolationKey());
std::unique_ptr<DummyProofVerifierCallback> callback(
new DummyProofVerifierCallback);
- quic::QuicAsyncStatus status = proof_verifier.VerifyProof(
- kTestHostname, kTestPort, kTestConfig, kTestTransportVersion,
- kTestChloHash, certs_, ct::GetSCTListForTesting(), kTestEmptySignature,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
- ASSERT_EQ(quic::QUIC_FAILURE, status);
- CheckSCT(/*sct_expected_ok=*/true);
-
- callback = std::make_unique<DummyProofVerifierCallback>();
- status = proof_verifier.VerifyCertChain(
+ quic::QuicAsyncStatus status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse,
ct::GetSCTListForTesting(), verify_context_.get(), &error_details_,
- &details_, std::move(callback));
- ASSERT_EQ(quic::QUIC_FAILURE, status);
+ &details_, &tls_alert_, std::move(callback));
+ ASSERT_EQ(quic::QUIC_SUCCESS, status);
CheckSCT(/*sct_expected_ok=*/true);
}
-// Invalid SCT and signature.
+// Invalid SCT, but valid cert
TEST_F(ProofVerifierChromiumTest, InvalidSCTList) {
// Use different certificates for SCT tests.
ASSERT_NO_FATAL_FAILURE(GetSCTTestCertificates(&certs_));
- MockCertVerifier cert_verifier;
+ std::string der_test_cert(ct::GetDerEncodedX509Cert());
+ scoped_refptr<X509Certificate> test_cert = X509Certificate::CreateFromBytes(
+ der_test_cert.data(), der_test_cert.length());
+ ASSERT_TRUE(test_cert);
+ CertVerifyResult dummy_result;
+ dummy_result.verified_cert = test_cert;
+ dummy_result.is_issued_by_known_root = true;
+ MockCertVerifier dummy_verifier;
+ dummy_verifier.AddResultForCert(test_cert.get(), dummy_result, OK);
+
ProofVerifierChromium proof_verifier(
- &cert_verifier, &ct_policy_enforcer_, &transport_security_state_,
+ &dummy_verifier, &ct_policy_enforcer_, &transport_security_state_,
ct_verifier_.get(), nullptr, {}, NetworkIsolationKey());
std::unique_ptr<DummyProofVerifierCallback> callback(
new DummyProofVerifierCallback);
- quic::QuicAsyncStatus status = proof_verifier.VerifyProof(
- kTestHostname, kTestPort, kTestConfig, kTestTransportVersion,
- kTestChloHash, certs_, ct::GetSCTListWithInvalidSCT(),
- kTestEmptySignature, verify_context_.get(), &error_details_, &details_,
- std::move(callback));
- ASSERT_EQ(quic::QUIC_FAILURE, status);
- CheckSCT(/*sct_expected_ok=*/false);
-
- callback = std::make_unique<DummyProofVerifierCallback>();
- status = proof_verifier.VerifyCertChain(
+ quic::QuicAsyncStatus status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse,
ct::GetSCTListWithInvalidSCT(), verify_context_.get(), &error_details_,
- &details_, std::move(callback));
- ASSERT_EQ(quic::QUIC_FAILURE, status);
+ &details_, &tls_alert_, std::move(callback));
+ ASSERT_EQ(quic::QUIC_SUCCESS, status);
CheckSCT(/*sct_expected_ok=*/false);
}
@@ -384,7 +417,8 @@ TEST_F(ProofVerifierChromiumTest, PreservesEVIfAllowed) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
ASSERT_TRUE(details_.get());
@@ -427,7 +461,8 @@ TEST_F(ProofVerifierChromiumTest, StripsEVIfNotAllowed) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
ASSERT_TRUE(details_.get());
@@ -480,7 +515,8 @@ TEST_F(ProofVerifierChromiumTest, CTEVHistogramNonCompliant) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_TRUE(details_.get());
verify_details = static_cast<ProofVerifyDetailsChromium*>(details_.get());
@@ -535,7 +571,8 @@ TEST_F(ProofVerifierChromiumTest, CTEVHistogramCompliant) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_TRUE(details_.get());
verify_details = static_cast<ProofVerifyDetailsChromium*>(details_.get());
@@ -581,7 +618,8 @@ TEST_F(ProofVerifierChromiumTest, IsFatalErrorNotSetForNonFatalError) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
verify_details = static_cast<ProofVerifyDetailsChromium*>(details_.get());
@@ -617,7 +655,8 @@ TEST_F(ProofVerifierChromiumTest, IsFatalErrorSetForFatalError) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
verify_details = static_cast<ProofVerifyDetailsChromium*>(details_.get());
EXPECT_TRUE(verify_details->is_fatal_cert_error);
@@ -657,7 +696,8 @@ TEST_F(ProofVerifierChromiumTest, PKPEnforced) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kCTAndPKPHost, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
ASSERT_TRUE(details_.get());
@@ -700,7 +740,8 @@ TEST_F(ProofVerifierChromiumTest, PKPBypassFlagSet) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kCTAndPKPHost, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
ASSERT_TRUE(details_.get());
@@ -708,6 +749,70 @@ TEST_F(ProofVerifierChromiumTest, PKPBypassFlagSet) {
EXPECT_TRUE(verify_details->pkp_bypassed);
}
+// Test that PKP errors result in sending reports.
+TEST_F(ProofVerifierChromiumTest, PKPReport) {
+ NetworkIsolationKey network_isolation_key =
+ NetworkIsolationKey::CreateTransient();
+
+ MockCertificateReportSender report_sender;
+ transport_security_state_.SetReportSender(&report_sender);
+
+ HashValueVector spki_hashes;
+ HashValue hash(HASH_VALUE_SHA256);
+ memset(hash.data(), 0, hash.size());
+ spki_hashes.push_back(hash);
+
+ GURL report_uri("https://foo.test/");
+ transport_security_state_.AddHPKP(
+ kCTAndPKPHost, base::Time::Now() + base::TimeDelta::FromDays(1),
+ false /* include_subdomains */, spki_hashes, report_uri);
+ ScopedTransportSecurityStateSource scoped_security_state_source;
+
+ dummy_result_.is_issued_by_known_root = true;
+ dummy_result_.public_key_hashes = MakeHashValueVector(0x01);
+
+ MockCertVerifier dummy_verifier;
+ dummy_verifier.AddResultForCert(test_cert_.get(), dummy_result_, OK);
+
+ ProofVerifierChromium proof_verifier(
+ &dummy_verifier, &ct_policy_enforcer_, &transport_security_state_,
+ ct_verifier_.get(), nullptr, {}, network_isolation_key);
+
+ std::unique_ptr<DummyProofVerifierCallback> callback(
+ new DummyProofVerifierCallback);
+ quic::QuicAsyncStatus status = proof_verifier.VerifyProof(
+ kCTAndPKPHost, kTestPort, kTestConfig, kTestTransportVersion,
+ kTestChloHash, certs_, kTestEmptySCT, GetTestSignature(),
+ verify_context_.get(), &error_details_, &details_, std::move(callback));
+ ASSERT_EQ(quic::QUIC_FAILURE, status);
+
+ ASSERT_TRUE(details_.get());
+ ProofVerifyDetailsChromium* verify_details =
+ static_cast<ProofVerifyDetailsChromium*>(details_.get());
+ EXPECT_TRUE(verify_details->cert_verify_result.cert_status &
+ CERT_STATUS_PINNED_KEY_MISSING);
+ EXPECT_FALSE(verify_details->pkp_bypassed);
+ EXPECT_NE("", verify_details->pinning_failure_log);
+
+ callback = std::make_unique<DummyProofVerifierCallback>();
+ status = proof_verifier.VerifyCertChain(
+ kCTAndPKPHost, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
+ ASSERT_EQ(quic::QUIC_FAILURE, status);
+
+ ASSERT_TRUE(details_.get());
+ verify_details = static_cast<ProofVerifyDetailsChromium*>(details_.get());
+ EXPECT_TRUE(verify_details->cert_verify_result.cert_status &
+ CERT_STATUS_PINNED_KEY_MISSING);
+ EXPECT_FALSE(verify_details->pkp_bypassed);
+ EXPECT_NE("", verify_details->pinning_failure_log);
+
+ EXPECT_EQ(report_uri, report_sender.latest_report_uri());
+ EXPECT_EQ(network_isolation_key,
+ report_sender.latest_network_isolation_key());
+}
+
// Test that when CT is required (in this case, by the delegate), the
// absence of CT information is a socket error.
TEST_F(ProofVerifierChromiumTest, CTIsRequired) {
@@ -751,7 +856,8 @@ TEST_F(ProofVerifierChromiumTest, CTIsRequired) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
ASSERT_TRUE(details_.get());
@@ -806,7 +912,8 @@ TEST_F(ProofVerifierChromiumTest, CTIsRequiredHistogramNonCompliant) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
histograms.ExpectUniqueSample(
@@ -857,7 +964,8 @@ TEST_F(ProofVerifierChromiumTest, CTIsRequiredHistogramCompliant) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
histograms.ExpectTotalCount(kHistogramName, 0);
@@ -887,7 +995,8 @@ TEST_F(ProofVerifierChromiumTest, CTIsRequiredHistogramCompliant) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
histograms.ExpectUniqueSample(
@@ -925,7 +1034,8 @@ TEST_F(ProofVerifierChromiumTest, CTIsNotRequiredHistogram) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
histograms.ExpectTotalCount(kHistogramName, 0);
@@ -979,7 +1089,8 @@ TEST_F(ProofVerifierChromiumTest, PKPAndCTBothTested) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kCTAndPKPHost, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
ASSERT_TRUE(details_.get());
@@ -1022,7 +1133,8 @@ TEST_F(ProofVerifierChromiumTest, CTComplianceStatusHistogram) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
// The histogram should not have been recorded.
@@ -1055,7 +1167,8 @@ TEST_F(ProofVerifierChromiumTest, CTComplianceStatusHistogram) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
// The histogram should have been recorded with the CT compliance status.
@@ -1066,112 +1179,6 @@ TEST_F(ProofVerifierChromiumTest, CTComplianceStatusHistogram) {
}
}
-// Tests that when CT is required but the connection is not compliant, the
-// relevant flag is set in the CTVerifyResult.
-TEST_F(ProofVerifierChromiumTest, CTRequirementsFlagNotMet) {
- dummy_result_.is_issued_by_known_root = true;
- MockCertVerifier dummy_verifier;
- dummy_verifier.AddResultForCert(test_cert_.get(), dummy_result_, OK);
-
- // Set up CT.
- MockRequireCTDelegate require_ct_delegate;
- transport_security_state_.SetRequireCTDelegate(&require_ct_delegate);
- EXPECT_CALL(require_ct_delegate, IsCTRequiredForHost(_, _, _))
- .WillRepeatedly(Return(TransportSecurityState::RequireCTDelegate::
- CTRequirementLevel::REQUIRED));
- EXPECT_CALL(ct_policy_enforcer_, CheckCompliance(_, _, _))
- .WillRepeatedly(
- Return(ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS));
-
- ProofVerifierChromium proof_verifier(
- &dummy_verifier, &ct_policy_enforcer_, &transport_security_state_,
- ct_verifier_.get(), nullptr, {}, NetworkIsolationKey());
-
- {
- std::unique_ptr<DummyProofVerifierCallback> callback(
- new DummyProofVerifierCallback);
- proof_verifier.VerifyProof(
- kTestHostname, kTestPort, kTestConfig, kTestTransportVersion,
- kTestChloHash, certs_, kTestEmptySCT, GetTestSignature(),
- verify_context_.get(), &error_details_, &details_, std::move(callback));
-
- // The flag should be set in the CTVerifyResult.
- ProofVerifyDetailsChromium* proof_details =
- reinterpret_cast<ProofVerifyDetailsChromium*>(details_.get());
- const ct::CTVerifyResult& ct_verify_result =
- proof_details->ct_verify_result;
- EXPECT_TRUE(ct_verify_result.policy_compliance_required);
- }
-
- {
- std::unique_ptr<DummyProofVerifierCallback> callback(
- new DummyProofVerifierCallback);
- proof_verifier.VerifyCertChain(
- kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
-
- // The flag should be set in the CTVerifyResult.
- ProofVerifyDetailsChromium* proof_details =
- reinterpret_cast<ProofVerifyDetailsChromium*>(details_.get());
- const ct::CTVerifyResult& ct_verify_result =
- proof_details->ct_verify_result;
- EXPECT_TRUE(ct_verify_result.policy_compliance_required);
- }
-}
-
-// Tests that when CT is required and the connection is compliant, the relevant
-// flag is set in the CTVerifyResult.
-TEST_F(ProofVerifierChromiumTest, CTRequirementsFlagMet) {
- dummy_result_.is_issued_by_known_root = true;
- MockCertVerifier dummy_verifier;
- dummy_verifier.AddResultForCert(test_cert_.get(), dummy_result_, OK);
-
- // Set up CT.
- MockRequireCTDelegate require_ct_delegate;
- transport_security_state_.SetRequireCTDelegate(&require_ct_delegate);
- EXPECT_CALL(require_ct_delegate, IsCTRequiredForHost(_, _, _))
- .WillRepeatedly(Return(TransportSecurityState::RequireCTDelegate::
- CTRequirementLevel::REQUIRED));
- EXPECT_CALL(ct_policy_enforcer_, CheckCompliance(_, _, _))
- .WillRepeatedly(
- Return(ct::CTPolicyCompliance::CT_POLICY_COMPLIES_VIA_SCTS));
-
- ProofVerifierChromium proof_verifier(
- &dummy_verifier, &ct_policy_enforcer_, &transport_security_state_,
- ct_verifier_.get(), nullptr, {}, NetworkIsolationKey());
-
- {
- std::unique_ptr<DummyProofVerifierCallback> callback(
- new DummyProofVerifierCallback);
- proof_verifier.VerifyProof(
- kTestHostname, kTestPort, kTestConfig, kTestTransportVersion,
- kTestChloHash, certs_, kTestEmptySCT, GetTestSignature(),
- verify_context_.get(), &error_details_, &details_, std::move(callback));
-
- // The flag should be set in the CTVerifyResult.
- ProofVerifyDetailsChromium* proof_details =
- reinterpret_cast<ProofVerifyDetailsChromium*>(details_.get());
- const ct::CTVerifyResult& ct_verify_result =
- proof_details->ct_verify_result;
- EXPECT_TRUE(ct_verify_result.policy_compliance_required);
- }
-
- {
- std::unique_ptr<DummyProofVerifierCallback> callback(
- new DummyProofVerifierCallback);
- proof_verifier.VerifyCertChain(
- kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
-
- // The flag should be set in the CTVerifyResult.
- ProofVerifyDetailsChromium* proof_details =
- reinterpret_cast<ProofVerifyDetailsChromium*>(details_.get());
- const ct::CTVerifyResult& ct_verify_result =
- proof_details->ct_verify_result;
- EXPECT_TRUE(ct_verify_result.policy_compliance_required);
- }
-}
-
TEST_F(ProofVerifierChromiumTest, UnknownRootRejected) {
dummy_result_.is_issued_by_known_root = false;
@@ -1196,7 +1203,8 @@ TEST_F(ProofVerifierChromiumTest, UnknownRootRejected) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
EXPECT_EQ(
"Failed to verify certificate chain: net::ERR_QUIC_CERT_ROOT_NOT_KNOWN",
@@ -1230,7 +1238,8 @@ TEST_F(ProofVerifierChromiumTest, UnknownRootAcceptedWithOverride) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
ASSERT_TRUE(details_.get());
@@ -1266,7 +1275,8 @@ TEST_F(ProofVerifierChromiumTest, UnknownRootAcceptedWithWildcardOverride) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
ASSERT_TRUE(details_.get());
@@ -1308,7 +1318,8 @@ TEST_F(ProofVerifierChromiumTest, SCTAuditingReportCollected) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_SUCCESS, status);
}
@@ -1344,7 +1355,8 @@ TEST_F(ProofVerifierChromiumTest, SCTAuditingNonPublicCertsNotReported) {
callback = std::make_unique<DummyProofVerifierCallback>();
status = proof_verifier.VerifyCertChain(
kTestHostname, kTestPort, certs_, kTestEmptyOCSPResponse, kTestEmptySCT,
- verify_context_.get(), &error_details_, &details_, std::move(callback));
+ verify_context_.get(), &error_details_, &details_, &tls_alert_,
+ std::move(callback));
ASSERT_EQ(quic::QUIC_FAILURE, status);
}
diff --git a/chromium/net/quic/mock_crypto_client_stream.cc b/chromium/net/quic/mock_crypto_client_stream.cc
index da40f4f630b..5ed02c1120b 100644
--- a/chromium/net/quic/mock_crypto_client_stream.cc
+++ b/chromium/net/quic/mock_crypto_client_stream.cc
@@ -47,7 +47,6 @@ using quic::QuicSpdyClientSessionBase;
using quic::QuicTagVector;
using quic::QuicTime;
using quic::TransportParameters;
-using quiche::QuicheStringPiece;
using std::string;
namespace net {
@@ -127,6 +126,9 @@ bool MockCryptoClientStream::CryptoConnect() {
std::make_unique<MockDecrypter>(Perspective::IS_CLIENT));
}
session()->connection()->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<MockEncrypter>(Perspective::IS_CLIENT));
+ session()->connection()->SetEncrypter(
ENCRYPTION_ZERO_RTT,
std::make_unique<MockEncrypter>(Perspective::IS_CLIENT));
} else {
@@ -142,6 +144,9 @@ bool MockCryptoClientStream::CryptoConnect() {
if (session()->version().UsesHttp3()) {
SetConfigNegotiated();
}
+ session()->connection()->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(Perspective::IS_CLIENT));
session()->OnNewEncryptionKeyAvailable(
ENCRYPTION_ZERO_RTT,
std::make_unique<NullEncrypter>(Perspective::IS_CLIENT));
@@ -221,7 +226,7 @@ bool MockCryptoClientStream::CryptoConnect() {
case COLD_START_WITH_CHLO_SENT: {
handshake_confirmed_ = false;
encryption_established_ = false;
- SendHandshakeMessage(GetDummyCHLOMessage());
+ SendHandshakeMessage(GetDummyCHLOMessage(), ENCRYPTION_INITIAL);
break;
}
}
diff --git a/chromium/net/quic/mock_decrypter.cc b/chromium/net/quic/mock_decrypter.cc
index cf7b906434f..51350fdec55 100644
--- a/chromium/net/quic/mock_decrypter.cc
+++ b/chromium/net/quic/mock_decrypter.cc
@@ -4,13 +4,14 @@
#include "net/quic/mock_decrypter.h"
+#include <limits>
+
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
using quic::DiversificationNonce;
using quic::Perspective;
using quic::QuicPacketNumber;
-using quiche::QuicheStringPiece;
namespace net {
@@ -22,28 +23,35 @@ const size_t kPaddingSize = 12;
MockDecrypter::MockDecrypter(Perspective perspective) {}
-bool MockDecrypter::SetKey(quiche::QuicheStringPiece key) {
+bool MockDecrypter::SetKey(absl::string_view key) {
return key.empty();
}
-bool MockDecrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
+bool MockDecrypter::SetNoncePrefix(absl::string_view nonce_prefix) {
+ return nonce_prefix.empty();
+}
+
+bool MockDecrypter::SetIV(absl::string_view iv) {
+ return iv.empty();
+}
+
+bool MockDecrypter::SetHeaderProtectionKey(absl::string_view key) {
return key.empty();
}
-std::string MockDecrypter::GenerateHeaderProtectionMask(
- quic::QuicDataReader* sample_reader) {
- return std::string(5, 0);
+size_t MockDecrypter::GetKeySize() const {
+ return 0;
}
-bool MockDecrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
- return nonce_prefix.empty();
+size_t MockDecrypter::GetIVSize() const {
+ return 0;
}
-bool MockDecrypter::SetIV(quiche::QuicheStringPiece iv) {
- return iv.empty();
+size_t MockDecrypter::GetNoncePrefixSize() const {
+ return 0;
}
-bool MockDecrypter::SetPreliminaryKey(quiche::QuicheStringPiece key) {
+bool MockDecrypter::SetPreliminaryKey(absl::string_view key) {
QUIC_BUG << "Should not be called";
return false;
}
@@ -54,8 +62,8 @@ bool MockDecrypter::SetDiversificationNonce(const DiversificationNonce& nonce) {
}
bool MockDecrypter::DecryptPacket(uint64_t /*packet_number*/,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) {
@@ -72,28 +80,25 @@ bool MockDecrypter::DecryptPacket(uint64_t /*packet_number*/,
return true;
}
-size_t MockDecrypter::GetKeySize() const {
- return 0;
-}
-
-size_t MockDecrypter::GetNoncePrefixSize() const {
- return 0;
+std::string MockDecrypter::GenerateHeaderProtectionMask(
+ quic::QuicDataReader* sample_reader) {
+ return std::string(5, 0);
}
-size_t MockDecrypter::GetIVSize() const {
+uint32_t MockDecrypter::cipher_id() const {
return 0;
}
-quiche::QuicheStringPiece MockDecrypter::GetKey() const {
- return quiche::QuicheStringPiece();
+quic::QuicPacketCount MockDecrypter::GetIntegrityLimit() const {
+ return std::numeric_limits<quic::QuicPacketCount>::max();
}
-quiche::QuicheStringPiece MockDecrypter::GetNoncePrefix() const {
- return quiche::QuicheStringPiece();
+absl::string_view MockDecrypter::GetKey() const {
+ return absl::string_view();
}
-uint32_t MockDecrypter::cipher_id() const {
- return 0;
+absl::string_view MockDecrypter::GetNoncePrefix() const {
+ return absl::string_view();
}
} // namespace net
diff --git a/chromium/net/quic/mock_decrypter.h b/chromium/net/quic/mock_decrypter.h
index 0fa3404bf8b..7e8cec13900 100644
--- a/chromium/net/quic/mock_decrypter.h
+++ b/chromium/net/quic/mock_decrypter.h
@@ -26,29 +26,31 @@ class MockDecrypter : public quic::QuicDecrypter {
explicit MockDecrypter(quic::Perspective perspective);
~MockDecrypter() override {}
+ // QuicCrypter implementation
+ bool SetKey(absl::string_view key) override;
+ bool SetNoncePrefix(absl::string_view nonce_prefix) override;
+ bool SetIV(absl::string_view iv) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
+ size_t GetKeySize() const override;
+ size_t GetIVSize() const override;
+ size_t GetNoncePrefixSize() const override;
+
// QuicDecrypter implementation
- bool SetKey(quiche::QuicheStringPiece key) override;
- bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
- bool SetIV(quiche::QuicheStringPiece iv) override;
- bool SetPreliminaryKey(quiche::QuicheStringPiece key) override;
+ bool SetPreliminaryKey(absl::string_view key) override;
bool SetDiversificationNonce(
const quic::DiversificationNonce& nonce) override;
bool DecryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) override;
- size_t GetKeySize() const override;
- size_t GetNoncePrefixSize() const override;
- size_t GetIVSize() const override;
- quiche::QuicheStringPiece GetKey() const override;
- quiche::QuicheStringPiece GetNoncePrefix() const override;
std::string GenerateHeaderProtectionMask(
quic::QuicDataReader* sample_reader) override;
-
uint32_t cipher_id() const override;
+ quic::QuicPacketCount GetIntegrityLimit() const override;
+ absl::string_view GetKey() const override;
+ absl::string_view GetNoncePrefix() const override;
private:
DISALLOW_COPY_AND_ASSIGN(MockDecrypter);
diff --git a/chromium/net/quic/mock_encrypter.cc b/chromium/net/quic/mock_encrypter.cc
index 18c02248317..05a1123b421 100644
--- a/chromium/net/quic/mock_encrypter.cc
+++ b/chromium/net/quic/mock_encrypter.cc
@@ -10,7 +10,6 @@
using quic::DiversificationNonce;
using quic::Perspective;
using quic::QuicPacketNumber;
-using quiche::QuicheStringPiece;
namespace net {
@@ -22,21 +21,21 @@ const size_t kPaddingSize = 12;
MockEncrypter::MockEncrypter(Perspective perspective) {}
-bool MockEncrypter::SetKey(quiche::QuicheStringPiece key) {
+bool MockEncrypter::SetKey(absl::string_view key) {
return key.empty();
}
-bool MockEncrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
+bool MockEncrypter::SetNoncePrefix(absl::string_view nonce_prefix) {
return nonce_prefix.empty();
}
-bool MockEncrypter::SetIV(quiche::QuicheStringPiece iv) {
+bool MockEncrypter::SetIV(absl::string_view iv) {
return iv.empty();
}
bool MockEncrypter::EncryptPacket(uint64_t /*packet_number*/,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) {
@@ -49,12 +48,12 @@ bool MockEncrypter::EncryptPacket(uint64_t /*packet_number*/,
return true;
}
-bool MockEncrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
+bool MockEncrypter::SetHeaderProtectionKey(absl::string_view key) {
return key.empty();
}
std::string MockEncrypter::GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) {
+ absl::string_view sample) {
return std::string(5, 0);
}
@@ -78,12 +77,16 @@ size_t MockEncrypter::GetCiphertextSize(size_t plaintext_size) const {
return plaintext_size + kPaddingSize;
}
-quiche::QuicheStringPiece MockEncrypter::GetKey() const {
- return quiche::QuicheStringPiece();
+quic::QuicPacketCount MockEncrypter::GetConfidentialityLimit() const {
+ return std::numeric_limits<quic::QuicPacketCount>::max();
}
-quiche::QuicheStringPiece MockEncrypter::GetNoncePrefix() const {
- return quiche::QuicheStringPiece();
+absl::string_view MockEncrypter::GetKey() const {
+ return absl::string_view();
+}
+
+absl::string_view MockEncrypter::GetNoncePrefix() const {
+ return absl::string_view();
}
} // namespace net
diff --git a/chromium/net/quic/mock_encrypter.h b/chromium/net/quic/mock_encrypter.h
index a71333b1e59..c6939abe7a9 100644
--- a/chromium/net/quic/mock_encrypter.h
+++ b/chromium/net/quic/mock_encrypter.h
@@ -6,6 +6,7 @@
#define NET_QUIC_MOCK_ENCRYPTER_H_
#include <cstddef>
+#include <limits>
#include "base/compiler_specific.h"
#include "base/macros.h"
@@ -25,25 +26,25 @@ class MockEncrypter : public quic::QuicEncrypter {
~MockEncrypter() override {}
// QuicEncrypter implementation
- bool SetKey(quiche::QuicheStringPiece key) override;
- bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
- bool SetIV(quiche::QuicheStringPiece iv) override;
+ bool SetKey(absl::string_view key) override;
+ bool SetNoncePrefix(absl::string_view nonce_prefix) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
+ bool SetIV(absl::string_view iv) override;
bool EncryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) override;
- std::string GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) override;
+ std::string GenerateHeaderProtectionMask(absl::string_view sample) override;
size_t GetKeySize() const override;
size_t GetNoncePrefixSize() const override;
size_t GetIVSize() const override;
size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
size_t GetCiphertextSize(size_t plaintext_size) const override;
- quiche::QuicheStringPiece GetKey() const override;
- quiche::QuicheStringPiece GetNoncePrefix() const override;
+ quic::QuicPacketCount GetConfidentialityLimit() const override;
+ absl::string_view GetKey() const override;
+ absl::string_view GetNoncePrefix() const override;
private:
DISALLOW_COPY_AND_ASSIGN(MockEncrypter);
diff --git a/chromium/net/quic/platform/impl/quic_cert_utils_impl.h b/chromium/net/quic/platform/impl/quic_cert_utils_impl.h
index 8a87b3f2851..6b481fdaf6d 100644
--- a/chromium/net/quic/platform/impl/quic_cert_utils_impl.h
+++ b/chromium/net/quic/platform/impl/quic_cert_utils_impl.h
@@ -13,9 +13,8 @@ namespace quic {
class QuicCertUtilsImpl {
public:
- static bool ExtractSubjectNameFromDERCert(
- quiche::QuicheStringPiece cert,
- quiche::QuicheStringPiece* subject_out) {
+ static bool ExtractSubjectNameFromDERCert(absl::string_view cert,
+ absl::string_view* subject_out) {
base::StringPiece out;
bool result = net::asn1::ExtractSubjectFromDERCert(
base::StringViewToStringPiece(cert), &out);
diff --git a/chromium/net/quic/platform/impl/quic_file_utils_impl.h b/chromium/net/quic/platform/impl/quic_file_utils_impl.h
index ef89ebd5c38..36295daf366 100644
--- a/chromium/net/quic/platform/impl/quic_file_utils_impl.h
+++ b/chromium/net/quic/platform/impl/quic_file_utils_impl.h
@@ -30,8 +30,7 @@ std::vector<std::string> ReadFileContentsImpl(const std::string& dirname) {
}
// Reads the contents of |filename| as a string into |contents|.
-void ReadFileContentsImpl(quiche::QuicheStringPiece filename,
- std::string* contents) {
+void ReadFileContentsImpl(absl::string_view filename, std::string* contents) {
base::ReadFileToString(
FilePath::FromUTF8Unsafe(base::StringViewToStringPiece(filename)),
contents);
diff --git a/chromium/net/quic/platform/impl/quic_flags_impl.cc b/chromium/net/quic/platform/impl/quic_flags_impl.cc
index f2c1542c57f..c92a71569af 100644
--- a/chromium/net/quic/platform/impl/quic_flags_impl.cc
+++ b/chromium/net/quic/platform/impl/quic_flags_impl.cc
@@ -21,10 +21,34 @@
#include "build/build_config.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#define QUIC_FLAG(type, flag, value) type flag = value;
-#include "net/quic/quic_flags_list.h"
+#define QUIC_FLAG(flag, value) bool flag = value;
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
#undef QUIC_FLAG
+#define DEFINE_QUIC_PROTOCOL_FLAG_SINGLE_VALUE(type, flag, value, doc) \
+ type FLAGS_##flag = value;
+
+#define DEFINE_QUIC_PROTOCOL_FLAG_TWO_VALUES(type, flag, internal_value, \
+ external_value, doc) \
+ type FLAGS_##flag = external_value;
+
+// Preprocessor macros can only have one definition.
+// Select the right macro based on the number of arguments.
+#define GET_6TH_ARG(arg1, arg2, arg3, arg4, arg5, arg6, ...) arg6
+#define QUIC_PROTOCOL_FLAG_MACRO_CHOOSER(...) \
+ GET_6TH_ARG(__VA_ARGS__, DEFINE_QUIC_PROTOCOL_FLAG_TWO_VALUES, \
+ DEFINE_QUIC_PROTOCOL_FLAG_SINGLE_VALUE)
+#define QUIC_PROTOCOL_FLAG(...) \
+ QUIC_PROTOCOL_FLAG_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__)
+
+#include "net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h"
+
+#undef QUIC_PROTOCOL_FLAG
+#undef QUIC_PROTOCOL_FLAG_MACRO_CHOOSER
+#undef GET_6TH_ARG
+#undef DEFINE_QUIC_PROTOCOL_FLAG_TWO_VALUES
+#undef DEFINE_QUIC_PROTOCOL_FLAG_SINGLE_VALUE
+
namespace quic {
namespace {
@@ -259,9 +283,9 @@ void SetQuicFlagByName_double(double* flag, const std::string& value) {
*flag = val;
}
-void SetQuicFlagByName_uint32_t(uint32_t* flag, const std::string& value) {
- int val;
- if (base::StringToInt(value, &val) && val >= 0)
+void SetQuicFlagByName_uint64_t(uint64_t* flag, const std::string& value) {
+ uint64_t val;
+ if (base::StringToUint64(value, &val) && val >= 0)
*flag = val;
}
@@ -280,11 +304,19 @@ void SetQuicFlagByName_int64_t(int64_t* flag, const std::string& value) {
} // namespace
void SetQuicFlagByName(const std::string& flag_name, const std::string& value) {
-#define QUIC_FLAG(type, flag, default_value) \
- if (flag_name == #flag) { \
- SetQuicFlagByName_##type(&flag, value); \
- return; \
+#define QUIC_FLAG(flag, default_value) \
+ if (flag_name == #flag) { \
+ SetQuicFlagByName_bool(&flag, value); \
+ return; \
}
-#include "net/quic/quic_flags_list.h"
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
#undef QUIC_FLAG
+
+#define QUIC_PROTOCOL_FLAG(type, flag, ...) \
+ if (flag_name == "FLAGS_" #flag) { \
+ SetQuicFlagByName_##type(&FLAGS_##flag, value); \
+ return; \
+ }
+#include "net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h"
+#undef QUIC_PROTOCOL_FLAG
}
diff --git a/chromium/net/quic/platform/impl/quic_flags_impl.h b/chromium/net/quic/platform/impl/quic_flags_impl.h
index edbf52799ca..c1a2eee49fa 100644
--- a/chromium/net/quic/platform/impl/quic_flags_impl.h
+++ b/chromium/net/quic/platform/impl/quic_flags_impl.h
@@ -16,10 +16,15 @@
#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#define QUIC_FLAG(type, flag, value) QUIC_EXPORT_PRIVATE extern type flag;
-#include "net/quic/quic_flags_list.h"
+#define QUIC_FLAG(flag, value) QUIC_EXPORT_PRIVATE extern bool flag;
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
#undef QUIC_FLAG
+#define QUIC_PROTOCOL_FLAG(type, flag, ...) \
+ QUIC_EXPORT_PRIVATE extern type FLAGS_##flag;
+#include "net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h"
+#undef QUIC_PROTOCOL_FLAG
+
namespace base {
class CommandLine;
template <typename T>
@@ -34,9 +39,6 @@ inline bool GetQuicFlagImpl(bool flag) {
inline int32_t GetQuicFlagImpl(int32_t flag) {
return flag;
}
-inline uint32_t GetQuicFlagImpl(uint32_t flag) {
- return flag;
-}
inline int64_t GetQuicFlagImpl(int64_t flag) {
return flag;
}
diff --git a/chromium/net/quic/platform/impl/quic_flags_test.cc b/chromium/net/quic/platform/impl/quic_flags_test.cc
index 3bc0b2677f8..708f90708ab 100644
--- a/chromium/net/quic/platform/impl/quic_flags_test.cc
+++ b/chromium/net/quic/platform/impl/quic_flags_test.cc
@@ -221,28 +221,22 @@ TEST_F(QuicFlagsTest, SetQuicFlagByName_int64_t_invalid) {
EXPECT_EQ(100, FLAGS_quic_max_tracked_packet_count);
}
-TEST_F(QuicFlagsTest, SetQuicFlagByName_uint32_t) {
- FLAGS_quic_send_buffer_max_data_slice_size = 4096;
- SetQuicFlagByName("FLAGS_quic_send_buffer_max_data_slice_size", "1024");
- EXPECT_EQ(1024u, FLAGS_quic_send_buffer_max_data_slice_size);
+TEST_F(QuicFlagsTest, SetQuicFlagByName_uint64_t) {
+ FLAGS_quic_key_update_confidentiality_limit = 100;
+ SetQuicFlagByName("FLAGS_quic_key_update_confidentiality_limit", "5");
+ EXPECT_EQ(5u, FLAGS_quic_key_update_confidentiality_limit);
}
-TEST_F(QuicFlagsTest, SetQuicFlagByName_uint32_t_invalid) {
- FLAGS_quic_send_buffer_max_data_slice_size = 4096;
- SetQuicFlagByName("FLAGS_quic_send_buffer_max_data_slice_size", "false");
- EXPECT_EQ(4096u, FLAGS_quic_send_buffer_max_data_slice_size);
+TEST_F(QuicFlagsTest, SetQuicFlagByName_uint64_t_invalid) {
+ FLAGS_quic_key_update_confidentiality_limit = 100;
+ SetQuicFlagByName("FLAGS_quic_key_update_confidentiality_limit", "false");
+ EXPECT_EQ(100u, FLAGS_quic_key_update_confidentiality_limit);
}
-TEST_F(QuicFlagsTest, SetQuicFlagByName_uint32_t_negative) {
- FLAGS_quic_send_buffer_max_data_slice_size = 4096;
- SetQuicFlagByName("FLAGS_quic_send_buffer_max_data_slice_size", "-1");
- EXPECT_EQ(4096u, FLAGS_quic_send_buffer_max_data_slice_size);
-}
-
-TEST_F(QuicFlagsTest, SetQuicFlagByName_uint32_t_too_large) {
- FLAGS_quic_send_buffer_max_data_slice_size = 4096;
- SetQuicFlagByName("FLAGS_quic_send_buffer_max_data_slice_size", "4294967297");
- EXPECT_EQ(4096u, FLAGS_quic_send_buffer_max_data_slice_size);
+TEST_F(QuicFlagsTest, SetQuicFlagByName_uint64_t_negative) {
+ FLAGS_quic_key_update_confidentiality_limit = 4096;
+ SetQuicFlagByName("FLAGS_quic_key_update_confidentiality_limit", "-1");
+ EXPECT_EQ(4096u, FLAGS_quic_key_update_confidentiality_limit);
}
TEST_F(QuicFlagsTest, SetQuicFlagByName_int32_t) {
diff --git a/chromium/net/quic/platform/impl/quic_hostname_utils_impl.cc b/chromium/net/quic/platform/impl/quic_hostname_utils_impl.cc
index 4550da45938..aa23f3a69e0 100644
--- a/chromium/net/quic/platform/impl/quic_hostname_utils_impl.cc
+++ b/chromium/net/quic/platform/impl/quic_hostname_utils_impl.cc
@@ -12,7 +12,7 @@
namespace quic {
// static
-bool QuicHostnameUtilsImpl::IsValidSNI(quiche::QuicheStringPiece sni) {
+bool QuicHostnameUtilsImpl::IsValidSNI(absl::string_view sni) {
// TODO(rtenneti): Support RFC2396 hostname.
// NOTE: Microsoft does NOT enforce this spec, so if we throw away hostnames
// based on the above spec, we may be losing some hostnames that windows
@@ -28,7 +28,7 @@ bool QuicHostnameUtilsImpl::IsValidSNI(quiche::QuicheStringPiece sni) {
// static
std::string QuicHostnameUtilsImpl::NormalizeHostname(
- quiche::QuicheStringPiece hostname) {
+ absl::string_view hostname) {
url::CanonHostInfo host_info;
std::string host(net::CanonicalizeHost(
base::StringPiece(hostname.data(), hostname.size()), &host_info));
diff --git a/chromium/net/quic/platform/impl/quic_hostname_utils_impl.h b/chromium/net/quic/platform/impl/quic_hostname_utils_impl.h
index 307c025d4fe..eaf6e1f0335 100644
--- a/chromium/net/quic/platform/impl/quic_hostname_utils_impl.h
+++ b/chromium/net/quic/platform/impl/quic_hostname_utils_impl.h
@@ -17,11 +17,11 @@ class QUIC_EXPORT_PRIVATE QuicHostnameUtilsImpl {
// (1) disallow IP addresses;
// (2) check that the hostname contains valid characters only; and
// (3) contains at least one dot.
- static bool IsValidSNI(quiche::QuicheStringPiece sni);
+ static bool IsValidSNI(absl::string_view sni);
// Convert hostname to lowercase and remove the trailing '.'.
// WARNING: mutates |hostname| in place and returns |hostname|.
- static std::string NormalizeHostname(quiche::QuicheStringPiece hostname);
+ static std::string NormalizeHostname(absl::string_view hostname);
private:
DISALLOW_COPY_AND_ASSIGN(QuicHostnameUtilsImpl);
diff --git a/chromium/net/quic/platform/impl/quic_mem_slice_span_impl.h b/chromium/net/quic/platform/impl/quic_mem_slice_span_impl.h
index 5775ffd74d2..b5ac5410d70 100644
--- a/chromium/net/quic/platform/impl/quic_mem_slice_span_impl.h
+++ b/chromium/net/quic/platform/impl/quic_mem_slice_span_impl.h
@@ -28,8 +28,8 @@ class QUIC_EXPORT_PRIVATE QuicMemSliceSpanImpl {
~QuicMemSliceSpanImpl();
- quiche::QuicheStringPiece GetData(size_t index) {
- return quiche::QuicheStringPiece(buffers_[index]->data(), lengths_[index]);
+ absl::string_view GetData(size_t index) {
+ return absl::string_view(buffers_[index]->data(), lengths_[index]);
}
template <typename ConsumeFunction>
diff --git a/chromium/net/quic/platform/impl/quic_socket_utils.cc b/chromium/net/quic/platform/impl/quic_socket_utils.cc
index 9fe56a19040..97f3b857cfd 100644
--- a/chromium/net/quic/platform/impl/quic_socket_utils.cc
+++ b/chromium/net/quic/platform/impl/quic_socket_utils.cc
@@ -15,7 +15,6 @@
#include <string>
#include "base/notreached.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
@@ -222,9 +221,9 @@ int QuicSocketUtils::ReadPacket(int fd,
hdr.msg_flags = 0;
struct cmsghdr* cmsg = reinterpret_cast<struct cmsghdr*>(cbuf);
- cmsg->cmsg_len = QUICHE_ARRAYSIZE(cbuf);
+ cmsg->cmsg_len = sizeof(cbuf);
hdr.msg_control = cmsg;
- hdr.msg_controllen = QUICHE_ARRAYSIZE(cbuf);
+ hdr.msg_controllen = sizeof(cbuf);
int bytes_read = recvmsg(fd, &hdr, 0);
@@ -239,7 +238,7 @@ int QuicSocketUtils::ReadPacket(int fd,
if (hdr.msg_flags & MSG_CTRUNC) {
QUIC_BUG << "Incorrectly set control length: " << hdr.msg_controllen
- << ", expected " << QUICHE_ARRAYSIZE(cbuf);
+ << ", expected " << sizeof(cbuf);
return -1;
}
diff --git a/chromium/net/quic/platform/impl/quic_test_impl.cc b/chromium/net/quic/platform/impl/quic_test_impl.cc
index 9feb757176d..859012ff614 100644
--- a/chromium/net/quic/platform/impl/quic_test_impl.cc
+++ b/chromium/net/quic/platform/impl/quic_test_impl.cc
@@ -8,14 +8,14 @@
#include "base/path_service.h"
QuicFlagSaverImpl::QuicFlagSaverImpl() {
-#define QUIC_FLAG(type, flag, value) saved_##flag##_ = flag;
-#include "net/quic/quic_flags_list.h"
+#define QUIC_FLAG(flag, value) saved_##flag##_ = flag;
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
#undef QUIC_FLAG
}
QuicFlagSaverImpl::~QuicFlagSaverImpl() {
-#define QUIC_FLAG(type, flag, value) flag = saved_##flag##_;
-#include "net/quic/quic_flags_list.h"
+#define QUIC_FLAG(flag, value) flag = saved_##flag##_;
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
#undef QUIC_FLAG
}
diff --git a/chromium/net/quic/platform/impl/quic_test_impl.h b/chromium/net/quic/platform/impl/quic_test_impl.h
index 1bcda9fde67..8ce1924bda0 100644
--- a/chromium/net/quic/platform/impl/quic_test_impl.h
+++ b/chromium/net/quic/platform/impl/quic_test_impl.h
@@ -21,8 +21,8 @@ class QuicFlagSaverImpl {
~QuicFlagSaverImpl();
private:
-#define QUIC_FLAG(type, flag, value) type saved_##flag##_;
-#include "net/quic/quic_flags_list.h"
+#define QUIC_FLAG(flag, value) bool saved_##flag##_;
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
#undef QUIC_FLAG
};
@@ -30,12 +30,12 @@ class QuicFlagSaverImpl {
class QuicFlagChecker {
public:
QuicFlagChecker() {
-#define QUIC_FLAG(type, flag, value) \
+#define QUIC_FLAG(flag, value) \
CHECK_EQ(value, flag) \
<< "Flag set to an unexpected value. A prior test is likely " \
<< "setting a flag without using a QuicFlagSaver. Use QuicTest to " \
"avoid this issue.";
-#include "net/quic/quic_flags_list.h"
+#include "net/third_party/quiche/src/quic/core/quic_flags_list.h"
#undef QUIC_FLAG
}
};
diff --git a/chromium/net/quic/platform/impl/quic_test_output_impl.cc b/chromium/net/quic/platform/impl/quic_test_output_impl.cc
index d84e9e0fdb0..a0d6cca045b 100644
--- a/chromium/net/quic/platform/impl/quic_test_output_impl.cc
+++ b/chromium/net/quic/platform/impl/quic_test_output_impl.cc
@@ -17,8 +17,8 @@
namespace quic {
-void QuicRecordTestOutputToFile(quiche::QuicheStringPiece filename,
- quiche::QuicheStringPiece data) {
+void QuicRecordTestOutputToFile(absl::string_view filename,
+ absl::string_view data) {
std::string output_dir;
if (!base::Environment::Create()->GetVar("QUIC_TEST_OUTPUT_DIR",
&output_dir) ||
@@ -38,13 +38,12 @@ void QuicRecordTestOutputToFile(quiche::QuicheStringPiece filename,
QUIC_LOG(INFO) << "Recorded test output into " << path;
}
-void QuicSaveTestOutputImpl(quiche::QuicheStringPiece filename,
- quiche::QuicheStringPiece data) {
+void QuicSaveTestOutputImpl(absl::string_view filename,
+ absl::string_view data) {
QuicRecordTestOutputToFile(filename, data);
}
-bool QuicLoadTestOutputImpl(quiche::QuicheStringPiece filename,
- std::string* data) {
+bool QuicLoadTestOutputImpl(absl::string_view filename, std::string* data) {
std::string output_dir;
if (!base::Environment::Create()->GetVar("QUIC_TEST_OUTPUT_DIR",
&output_dir) ||
@@ -61,8 +60,7 @@ bool QuicLoadTestOutputImpl(quiche::QuicheStringPiece filename,
return base::ReadFileToString(path, data);
}
-void QuicRecordTraceImpl(quiche::QuicheStringPiece identifier,
- quiche::QuicheStringPiece data) {
+void QuicRecordTraceImpl(absl::string_view identifier, absl::string_view data) {
const testing::TestInfo* test_info =
testing::UnitTest::GetInstance()->current_test_info();
diff --git a/chromium/net/quic/platform/impl/quic_test_output_impl.h b/chromium/net/quic/platform/impl/quic_test_output_impl.h
index 5ab6414463f..cb572a32284 100644
--- a/chromium/net/quic/platform/impl/quic_test_output_impl.h
+++ b/chromium/net/quic/platform/impl/quic_test_output_impl.h
@@ -9,14 +9,11 @@
namespace quic {
-void QuicSaveTestOutputImpl(quiche::QuicheStringPiece filename,
- quiche::QuicheStringPiece data);
+void QuicSaveTestOutputImpl(absl::string_view filename, absl::string_view data);
-bool QuicLoadTestOutputImpl(quiche::QuicheStringPiece filename,
- std::string* data);
+bool QuicLoadTestOutputImpl(absl::string_view filename, std::string* data);
-void QuicRecordTraceImpl(quiche::QuicheStringPiece identifier,
- quiche::QuicheStringPiece data);
+void QuicRecordTraceImpl(absl::string_view identifier, absl::string_view data);
} // namespace quic
diff --git a/chromium/net/quic/platform/impl/quic_testvalue_impl.h b/chromium/net/quic/platform/impl/quic_testvalue_impl.h
index 3c46aff845b..e24ca0b1cdc 100644
--- a/chromium/net/quic/platform/impl/quic_testvalue_impl.h
+++ b/chromium/net/quic/platform/impl/quic_testvalue_impl.h
@@ -10,7 +10,7 @@
namespace quic {
template <class T>
-void AdjustTestValueImpl(quiche::QuicheStringPiece label, T* var) {}
+void AdjustTestValueImpl(absl::string_view label, T* var) {}
} // namespace quic
diff --git a/chromium/net/quic/quic_chromium_client_session.cc b/chromium/net/quic/quic_chromium_client_session.cc
index 6e08826bbb0..b8a4b13d8b4 100644
--- a/chromium/net/quic/quic_chromium_client_session.cc
+++ b/chromium/net/quic/quic_chromium_client_session.cc
@@ -29,6 +29,7 @@
#include "net/base/network_isolation_key.h"
#include "net/base/privacy_mode.h"
#include "net/base/url_util.h"
+#include "net/cert/signed_certificate_timestamp_and_status.h"
#include "net/http/transport_security_state.h"
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source_type.h"
@@ -72,12 +73,6 @@ const size_t kWaitTimeForNewNetworkSecs = 10;
const size_t kMinRetryTimeForDefaultNetworkSecs = 1;
-// Default value for maximum number of consecutive pings that can be sent
-// with aggressive initial retransmittable on wire timeout if there is no new
-// data received. After which, the timeout will be exponentially back off until
-// exceeds the default ping timeout.
-const int kDefaultMaxAggressiveRetransmittableOnWirePingCount = 200;
-
// Maximum RTT time for this session when set initial timeout for probing
// network.
const int kDefaultRTTMilliSecs = 300;
@@ -134,6 +129,10 @@ void RecordConnectionCloseErrorCodeImpl(const std::string& histogram,
}
}
+void LogMigrateToSocketStatus(bool success) {
+ UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.MigrateToSocketSuccess", success);
+}
+
void RecordConnectionCloseErrorCode(const quic::QuicConnectionCloseFrame& frame,
quic::ConnectionCloseSource source,
const std::string& hostname,
@@ -297,12 +296,13 @@ base::Value NetLogQuicClientSessionParams(
}
base::Value NetLogQuicPushPromiseReceivedParams(
- const spdy::SpdyHeaderBlock* headers,
+ const spdy::Http2HeaderBlock* headers,
spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId promised_stream_id,
NetLogCaptureMode capture_mode) {
base::DictionaryValue dict;
- dict.SetKey("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode));
+ dict.SetKey("headers",
+ ElideHttp2HeaderBlockForNetLog(*headers, capture_mode));
dict.SetInteger("id", stream_id);
dict.SetInteger("promised_stream_id", promised_stream_id);
return std::move(dict);
@@ -473,7 +473,7 @@ bool QuicChromiumClientSession::Handle::SharesSameSession(
}
int QuicChromiumClientSession::Handle::RendezvousWithPromised(
- const spdy::SpdyHeaderBlock& headers,
+ const spdy::Http2HeaderBlock& headers,
CompletionOnceCallback callback) {
if (!session_)
return ERR_CONNECTION_CLOSED;
@@ -581,9 +581,9 @@ bool QuicChromiumClientSession::Handle::WasEverUsed() const {
}
bool QuicChromiumClientSession::Handle::CheckVary(
- const spdy::SpdyHeaderBlock& client_request,
- const spdy::SpdyHeaderBlock& promise_request,
- const spdy::SpdyHeaderBlock& promise_response) {
+ const spdy::Http2HeaderBlock& client_request,
+ const spdy::Http2HeaderBlock& promise_request,
+ const spdy::Http2HeaderBlock& promise_response) {
HttpRequestInfo promise_request_info;
ConvertHeaderBlockToHttpRequestHeaders(promise_request,
&promise_request_info.extra_headers);
@@ -864,6 +864,8 @@ QuicChromiumClientSession::QuicChromiumClientSession(
max_allowed_push_id_(max_allowed_push_id),
attempted_zero_rtt_(false),
num_pings_sent_(0),
+ num_migrations_(0),
+ last_key_update_reason_(quic::KeyUpdateReason::kInvalid),
push_promise_index_(std::move(push_promise_index)) {
// Make sure connection migration and goaway on path degrading are not turned
// on at the same time.
@@ -904,13 +906,6 @@ QuicChromiumClientSession::QuicChromiumClientSession(
if (!retransmittable_on_wire_timeout.IsZero()) {
connection->set_initial_retransmittable_on_wire_timeout(
retransmittable_on_wire_timeout);
- if (GetQuicFlag(
- FLAGS_quic_max_aggressive_retransmittable_on_wire_ping_count) ==
- 0) {
- // Set a default value for this flag if no custom value is provided.
- SetQuicFlag(FLAGS_quic_max_aggressive_retransmittable_on_wire_ping_count,
- kDefaultMaxAggressiveRetransmittableOnWirePingCount);
- }
}
}
@@ -1046,7 +1041,7 @@ void QuicChromiumClientSession::Initialize() {
size_t QuicChromiumClientSession::WriteHeadersOnHeadersStream(
quic::QuicStreamId id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
bool fin,
const spdy::SpdyStreamPrecedence& precedence,
quic::QuicReferenceCountedPointer<quic::QuicAckListenerInterface>
@@ -1299,7 +1294,8 @@ bool QuicChromiumClientSession::GetSSLInfo(SSLInfo* ssl_info) const {
ssl_info->pinning_failure_log = pinning_failure_log_;
ssl_info->is_fatal_cert_error = is_fatal_cert_error_;
- ssl_info->UpdateCertificateTransparencyInfo(*ct_verify_result_);
+ ssl_info->signed_certificate_timestamps = cert_verify_result_->scts;
+ ssl_info->ct_policy_compliance = cert_verify_result_->policy_compliance;
const auto& crypto_params = crypto_stream_->crypto_negotiated_params();
uint16_t cipher_suite;
@@ -1685,7 +1681,7 @@ void QuicChromiumClientSession::OnCryptoHandshakeMessageReceived(
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.RejectLength",
message.GetSerialized().length(), 1000, 10000,
50);
- quiche::QuicheStringPiece proof;
+ absl::string_view proof;
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.RejectHasProof",
message.GetStringPiece(quic::kPROF, &proof));
}
@@ -1873,6 +1869,62 @@ void QuicChromiumClientSession::OnConnectionClosed(
UMA_HISTOGRAM_LONG_TIMES_100(
"Net.QuicSession.ConnectionDuration",
tick_clock_->NowTicks() - connect_timing_.connect_end);
+ UMA_HISTOGRAM_COUNTS_100("Net.QuicSession.NumMigrations", num_migrations_);
+ // These values are persisted to logs. Entries should not be renumbered
+ // and numeric values should never be reused.
+ enum class KeyUpdateSupported {
+ kInvalid = 0,
+ kUnsupported = 1,
+ kSupported = 2,
+ kSupportedLocallyOnly = 3,
+ kSupportedRemotelyOnly = 4,
+ kMaxValue = kSupportedRemotelyOnly,
+ };
+ KeyUpdateSupported key_update_supported = KeyUpdateSupported::kInvalid;
+ if (config()->KeyUpdateSupportedForConnection()) {
+ key_update_supported = KeyUpdateSupported::kSupported;
+ } else if (config()->KeyUpdateSupportedLocally()) {
+ key_update_supported = KeyUpdateSupported::kSupportedLocallyOnly;
+ } else if (config()->KeyUpdateSupportedRemotely()) {
+ key_update_supported = KeyUpdateSupported::kSupportedRemotelyOnly;
+ } else {
+ key_update_supported = KeyUpdateSupported::kUnsupported;
+ }
+ base::UmaHistogramEnumeration("Net.QuicSession.KeyUpdate.Supported",
+ key_update_supported);
+ if (config()->KeyUpdateSupportedForConnection()) {
+ base::UmaHistogramCounts100("Net.QuicSession.KeyUpdate.PerConnection2",
+ connection()->GetStats().key_update_count);
+ base::UmaHistogramCounts100(
+ "Net.QuicSession.KeyUpdate.PotentialPeerKeyUpdateAttemptCount",
+ connection()->PotentialPeerKeyUpdateAttemptCount());
+ if (last_key_update_reason_ != quic::KeyUpdateReason::kInvalid) {
+ std::string suffix =
+ last_key_update_reason_ == quic::KeyUpdateReason::kRemote ? "Remote"
+ : "Local";
+ // These values are persisted to logs. Entries should not be renumbered
+ // and numeric values should never be reused.
+ enum class KeyUpdateSuccess {
+ kInvalid = 0,
+ kSuccess = 1,
+ kFailedInitial = 2,
+ kFailedNonInitial = 3,
+ kMaxValue = kFailedNonInitial,
+ };
+ KeyUpdateSuccess value = KeyUpdateSuccess::kInvalid;
+ if (connection()->HaveSentPacketsInCurrentKeyPhaseButNoneAcked()) {
+ if (connection()->GetStats().key_update_count >= 2) {
+ value = KeyUpdateSuccess::kFailedNonInitial;
+ } else {
+ value = KeyUpdateSuccess::kFailedInitial;
+ }
+ } else {
+ value = KeyUpdateSuccess::kSuccess;
+ }
+ base::UmaHistogramEnumeration(
+ "Net.QuicSession.KeyUpdate.Success." + suffix, value);
+ }
+ }
} else {
if (error == quic::QUIC_PUBLIC_RESET) {
RecordHandshakeFailureReason(HANDSHAKE_FAILURE_PUBLIC_RESET);
@@ -1892,6 +1944,9 @@ void QuicChromiumClientSession::OnConnectionClosed(
connection()->GetStats().crypto_retransmit_count);
}
+ base::UmaHistogramCounts1M(
+ "Net.QuicSession.UndecryptablePacketsReceivedWithDecrypter",
+ connection()->GetStats().num_failed_authentication_packets_received);
base::UmaHistogramSparse("Net.QuicSession.QuicVersion",
connection()->transport_version());
NotifyFactoryOfSessionGoingAway();
@@ -2176,11 +2231,14 @@ void QuicChromiumClientSession::OnProbeSucceeded(
// be acquired by connection and used as default on success.
if (!MigrateToSocket(std::move(socket), std::move(reader),
std::move(writer))) {
+ LogMigrateToSocketStatus(false);
net_log_.AddEvent(
NetLogEventType::QUIC_CONNECTION_MIGRATION_FAILURE_AFTER_PROBING);
return;
}
+ LogMigrateToSocketStatus(true);
+
// Notify the connection that migration succeeds after probing.
if (connection()->IsPathDegrading())
connection()->OnSuccessfulMigrationAfterProbing();
@@ -2188,6 +2246,7 @@ void QuicChromiumClientSession::OnProbeSucceeded(
net_log_.AddEventWithInt64Params(
NetLogEventType::QUIC_CONNECTION_MIGRATION_SUCCESS_AFTER_PROBING,
"migrate_to_network", network);
+ num_migrations_++;
HistogramAndLogMigrationSuccess(connection_id());
if (network == default_network_) {
DVLOG(1) << "Client successfully migrated to default network: "
@@ -2496,6 +2555,16 @@ void QuicChromiumClientSession::OnForwardProgressMadeAfterPathDegrading() {
observer.OnSessionResumedPostPathDegrading(this, current_network);
}
+void QuicChromiumClientSession::OnKeyUpdate(quic::KeyUpdateReason reason) {
+ net_log_.AddEventWithStringParams(NetLogEventType::QUIC_SESSION_KEY_UPDATE,
+ "reason",
+ quic::KeyUpdateReasonString(reason));
+
+ base::UmaHistogramEnumeration("Net.QuicSession.KeyUpdate.Reason", reason);
+
+ last_key_update_reason_ = reason;
+}
+
void QuicChromiumClientSession::OnProofValid(
const quic::QuicCryptoClientConfig::CachedState& cached) {
DCHECK(cached.proof_valid());
@@ -2523,9 +2592,6 @@ void QuicChromiumClientSession::OnProofVerifyDetailsAvailable(
cert_verify_result_.reset(
new CertVerifyResult(verify_details_chromium->cert_verify_result));
pinning_failure_log_ = verify_details_chromium->pinning_failure_log;
- std::unique_ptr<ct::CTVerifyResult> ct_verify_result_copy(
- new ct::CTVerifyResult(verify_details_chromium->ct_verify_result));
- ct_verify_result_ = std::move(ct_verify_result_copy);
logger_->OnCertificateVerified(*cert_verify_result_);
pkp_bypassed_ = verify_details_chromium->pkp_bypassed;
is_fatal_cert_error_ = verify_details_chromium->is_fatal_cert_error;
@@ -3317,7 +3383,7 @@ bool QuicChromiumClientSession::IsAuthorized(const std::string& hostname) {
bool QuicChromiumClientSession::HandlePromised(
quic::QuicStreamId id,
quic::QuicStreamId promised_id,
- const spdy::SpdyHeaderBlock& headers) {
+ const spdy::Http2HeaderBlock& headers) {
bool result =
quic::QuicSpdyClientSessionBase::HandlePromised(id, promised_id, headers);
if (result) {
diff --git a/chromium/net/quic/quic_chromium_client_session.h b/chromium/net/quic/quic_chromium_client_session.h
index c4d751369dc..cd053d99b71 100644
--- a/chromium/net/quic/quic_chromium_client_session.h
+++ b/chromium/net/quic/quic_chromium_client_session.h
@@ -28,7 +28,6 @@
#include "net/base/net_error_details.h"
#include "net/base/net_export.h"
#include "net/base/proxy_server.h"
-#include "net/cert/ct_verify_result.h"
#include "net/log/net_log_with_source.h"
#include "net/quic/quic_chromium_client_stream.h"
#include "net/quic/quic_chromium_packet_reader.h"
@@ -205,7 +204,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
// returned, then |push_stream_| will be updated with the promised
// stream. If ERR_IO_PENDING is returned, then when the rendezvous is
// eventually completed |callback| will be called.
- int RendezvousWithPromised(const spdy::SpdyHeaderBlock& headers,
+ int RendezvousWithPromised(const spdy::Http2HeaderBlock& headers,
CompletionOnceCallback callback);
// Starts a request to create a stream. If OK is returned, then
@@ -273,9 +272,9 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
}
// quic::QuicClientPushPromiseIndex::Delegate implementation
- bool CheckVary(const spdy::SpdyHeaderBlock& client_request,
- const spdy::SpdyHeaderBlock& promise_request,
- const spdy::SpdyHeaderBlock& promise_response) override;
+ bool CheckVary(const spdy::Http2HeaderBlock& client_request,
+ const spdy::Http2HeaderBlock& promise_request,
+ const spdy::Http2HeaderBlock& promise_response) override;
void OnRendezvousResult(quic::QuicSpdyStream* stream) override;
// Returns true if the session's connection has sent or received any bytes.
@@ -519,7 +518,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
// quic::QuicSpdySession methods:
size_t WriteHeadersOnHeadersStream(
quic::QuicStreamId id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
bool fin,
const spdy::SpdyStreamPrecedence& precedence,
quic::QuicReferenceCountedPointer<quic::QuicAckListenerInterface>
@@ -568,6 +567,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
bool is_connectivity_probe) override;
void OnPathDegrading() override;
void OnForwardProgressMadeAfterPathDegrading() override;
+ void OnKeyUpdate(quic::KeyUpdateReason reason) override;
// QuicChromiumPacketReader::Visitor methods:
void OnReadError(int result, const DatagramClientSocket* socket) override;
@@ -701,7 +701,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
bool HandlePromised(quic::QuicStreamId associated_id,
quic::QuicStreamId promised_id,
- const spdy::SpdyHeaderBlock& headers) override;
+ const spdy::Http2HeaderBlock& headers) override;
void DeletePromised(quic::QuicClientPromisedInfo* promised) override;
@@ -871,7 +871,6 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
SSLConfigService* ssl_config_service_;
std::unique_ptr<QuicServerInfo> server_info_;
std::unique_ptr<CertVerifyResult> cert_verify_result_;
- std::unique_ptr<ct::CTVerifyResult> ct_verify_result_;
std::string pinning_failure_log_;
bool pkp_bypassed_;
bool is_fatal_cert_error_;
@@ -932,6 +931,12 @@ class NET_EXPORT_PRIVATE QuicChromiumClientSession
size_t num_pings_sent_;
+ size_t num_migrations_;
+
+ // The reason for the last 1-RTT key update on the connection. Will be
+ // kInvalid if no key updates have occurred.
+ quic::KeyUpdateReason last_key_update_reason_;
+
std::unique_ptr<quic::QuicClientPushPromiseIndex> push_promise_index_;
base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_{this};
diff --git a/chromium/net/quic/quic_chromium_client_session_test.cc b/chromium/net/quic/quic_chromium_client_session_test.cc
index 17b089556e5..13a0379fba3 100644
--- a/chromium/net/quic/quic_chromium_client_session_test.cc
+++ b/chromium/net/quic/quic_chromium_client_session_test.cc
@@ -10,6 +10,7 @@
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
+#include "base/strings/strcat.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_tick_clock.h"
@@ -89,10 +90,10 @@ struct TestParams {
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
std::vector<TestParams> GetTestParams() {
@@ -181,8 +182,8 @@ class QuicChromiumClientSessionTest
socket.get(), base::ThreadTaskRunnerHandle::Get().get());
quic::QuicConnection* connection = new quic::QuicConnection(
quic::QuicUtils::CreateRandomConnectionId(&random_),
- ToQuicSocketAddress(kIpEndPoint), &helper_, &alarm_factory_, writer,
- true, quic::Perspective::IS_CLIENT,
+ quic::QuicSocketAddress(), ToQuicSocketAddress(kIpEndPoint), &helper_,
+ &alarm_factory_, writer, true, quic::Perspective::IS_CLIENT,
quic::test::SupportedVersions(version_));
session_.reset(new TestingQuicChromiumClientSession(
connection, std::move(socket),
@@ -273,7 +274,7 @@ class QuicChromiumClientSessionTest
// For version99, the count will include both static and dynamic streams.
// These tests are only concerned with dynamic streams (that is, the number
// of streams that they can create), so back out the static header stream.
- return quic::test::QuicSessionPeer::v99_streamid_manager(quic_session)
+ return quic::test::QuicSessionPeer::ietf_streamid_manager(quic_session)
->max_outgoing_bidirectional_streams();
}
@@ -334,9 +335,8 @@ TEST_P(QuicChromiumClientSessionTest, GetSSLInfo1) {
details.cert_verify_result.verified_cert =
ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem");
details.cert_verify_result.is_issued_by_known_root = true;
- details.ct_verify_result.policy_compliance =
+ details.cert_verify_result.policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_COMPLIES_VIA_SCTS;
- details.ct_verify_result.policy_compliance_required = true;
CompleteCryptoHandshake();
session_->OnProofVerifyDetailsAvailable(details);
@@ -351,10 +351,8 @@ TEST_P(QuicChromiumClientSessionTest, GetSSLInfo1) {
EXPECT_EQ(details.cert_verify_result.cert_status, ssl_info.cert_status);
EXPECT_EQ(details.cert_verify_result.is_issued_by_known_root,
ssl_info.is_issued_by_known_root);
- EXPECT_EQ(details.ct_verify_result.policy_compliance,
+ EXPECT_EQ(details.cert_verify_result.policy_compliance,
ssl_info.ct_policy_compliance);
- EXPECT_EQ(details.ct_verify_result.policy_compliance_required,
- ssl_info.ct_policy_compliance_required);
}
// Just like GetSSLInfo1, but uses different values.
@@ -373,9 +371,8 @@ TEST_P(QuicChromiumClientSessionTest, GetSSLInfo2) {
details.cert_verify_result.verified_cert =
ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem");
details.cert_verify_result.is_issued_by_known_root = false;
- details.ct_verify_result.policy_compliance =
+ details.cert_verify_result.policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_NOT_ENOUGH_SCTS;
- details.ct_verify_result.policy_compliance_required = false;
CompleteCryptoHandshake();
session_->OnProofVerifyDetailsAvailable(details);
@@ -390,10 +387,8 @@ TEST_P(QuicChromiumClientSessionTest, GetSSLInfo2) {
EXPECT_EQ(details.cert_verify_result.cert_status, ssl_info.cert_status);
EXPECT_EQ(details.cert_verify_result.is_issued_by_known_root,
ssl_info.is_issued_by_known_root);
- EXPECT_EQ(details.ct_verify_result.policy_compliance,
+ EXPECT_EQ(details.cert_verify_result.policy_compliance,
ssl_info.ct_policy_compliance);
- EXPECT_EQ(details.ct_verify_result.policy_compliance_required,
- ssl_info.ct_policy_compliance_required);
}
TEST_P(QuicChromiumClientSessionTest, IsFatalErrorNotSetForNonFatalError) {
@@ -1158,7 +1153,7 @@ TEST_P(QuicChromiumClientSessionTest, PushStreamTimedOutNoResponse) {
QuicChromiumClientSessionPeer::CreateOutgoingStream(session_.get());
EXPECT_TRUE(stream);
- spdy::SpdyHeaderBlock promise_headers;
+ spdy::Http2HeaderBlock promise_headers;
promise_headers[":method"] = "GET";
promise_headers[":authority"] = "www.example.org";
promise_headers[":scheme"] = "https";
@@ -1214,7 +1209,7 @@ TEST_P(QuicChromiumClientSessionTest, PushStreamTimedOutWithResponse) {
QuicChromiumClientSessionPeer::CreateOutgoingStream(session_.get());
EXPECT_TRUE(stream);
- spdy::SpdyHeaderBlock promise_headers;
+ spdy::Http2HeaderBlock promise_headers;
promise_headers[":method"] = "GET";
promise_headers[":authority"] = "www.example.org";
promise_headers[":scheme"] = "https";
@@ -1226,10 +1221,10 @@ TEST_P(QuicChromiumClientSessionTest, PushStreamTimedOutWithResponse) {
stream->id(), GetNthServerInitiatedUnidirectionalStreamId(0),
promise_headers));
session_->OnInitialHeadersComplete(
- GetNthServerInitiatedUnidirectionalStreamId(0), spdy::SpdyHeaderBlock());
+ GetNthServerInitiatedUnidirectionalStreamId(0), spdy::Http2HeaderBlock());
// Read data on the pushed stream.
quic::QuicStreamFrame data(GetNthServerInitiatedUnidirectionalStreamId(0),
- false, 0, quiche::QuicheStringPiece("SP"));
+ false, 0, absl::string_view("SP"));
session_->OnStreamFrame(data);
quic::QuicClientPromisedInfo* promised =
@@ -1267,7 +1262,7 @@ TEST_P(QuicChromiumClientSessionTest, PendingStreamOnRst) {
CompleteCryptoHandshake();
quic::QuicStreamFrame data(GetNthServerInitiatedUnidirectionalStreamId(0),
- false, 1, quiche::QuicheStringPiece("SP"));
+ false, 1, absl::string_view("SP"));
session_->OnStreamFrame(data);
EXPECT_EQ(0u, session_->GetNumActiveStreams());
quic::QuicRstStreamFrame rst(quic::kInvalidControlFrameId,
@@ -1299,7 +1294,7 @@ TEST_P(QuicChromiumClientSessionTest, ClosePendingStream) {
CompleteCryptoHandshake();
quic::QuicStreamId id = GetNthServerInitiatedUnidirectionalStreamId(0);
- quic::QuicStreamFrame data(id, false, 1, quiche::QuicheStringPiece("SP"));
+ quic::QuicStreamFrame data(id, false, 1, absl::string_view("SP"));
session_->OnStreamFrame(data);
EXPECT_EQ(0u, session_->GetNumActiveStreams());
session_->ResetStream(id, quic::QUIC_STREAM_NO_ERROR);
@@ -1336,7 +1331,7 @@ TEST_P(QuicChromiumClientSessionTest, CancelPushWhenPendingValidation) {
QuicChromiumClientSessionPeer::CreateOutgoingStream(session_.get());
EXPECT_TRUE(stream);
- spdy::SpdyHeaderBlock promise_headers;
+ spdy::Http2HeaderBlock promise_headers;
promise_headers[":method"] = "GET";
promise_headers[":authority"] = "www.example.org";
promise_headers[":scheme"] = "https";
@@ -1352,7 +1347,7 @@ TEST_P(QuicChromiumClientSessionTest, CancelPushWhenPendingValidation) {
EXPECT_TRUE(promised);
// Initiate rendezvous.
- spdy::SpdyHeaderBlock client_request = promise_headers.Clone();
+ spdy::Http2HeaderBlock client_request = promise_headers.Clone();
quic::test::TestPushPromiseDelegate delegate(/*match=*/true);
promised->HandleClientRequest(client_request, &delegate);
@@ -1397,7 +1392,7 @@ TEST_P(QuicChromiumClientSessionTest, CancelPushBeforeReceivingResponse) {
QuicChromiumClientSessionPeer::CreateOutgoingStream(session_.get());
EXPECT_TRUE(stream);
- spdy::SpdyHeaderBlock promise_headers;
+ spdy::Http2HeaderBlock promise_headers;
promise_headers[":method"] = "GET";
promise_headers[":authority"] = "www.example.org";
promise_headers[":scheme"] = "https";
@@ -1454,7 +1449,7 @@ TEST_P(QuicChromiumClientSessionTest, CancelPushAfterReceivingResponse) {
QuicChromiumClientSessionPeer::CreateOutgoingStream(session_.get());
EXPECT_TRUE(stream);
- spdy::SpdyHeaderBlock promise_headers;
+ spdy::Http2HeaderBlock promise_headers;
promise_headers[":method"] = "GET";
promise_headers[":authority"] = "www.example.org";
promise_headers[":scheme"] = "https";
@@ -1466,10 +1461,10 @@ TEST_P(QuicChromiumClientSessionTest, CancelPushAfterReceivingResponse) {
stream->id(), GetNthServerInitiatedUnidirectionalStreamId(0),
promise_headers));
session_->OnInitialHeadersComplete(
- GetNthServerInitiatedUnidirectionalStreamId(0), spdy::SpdyHeaderBlock());
+ GetNthServerInitiatedUnidirectionalStreamId(0), spdy::Http2HeaderBlock());
// Read data on the pushed stream.
quic::QuicStreamFrame data(GetNthServerInitiatedUnidirectionalStreamId(0),
- false, 0, quiche::QuicheStringPiece("SP"));
+ false, 0, absl::string_view("SP"));
session_->OnStreamFrame(data);
quic::QuicClientPromisedInfo* promised =
@@ -1690,7 +1685,7 @@ TEST_P(QuicChromiumClientSessionTest, CanPoolExpectCT) {
ImportCertFromFile(GetTestCertsDirectory(), "spdy_pooling.pem");
ASSERT_TRUE(details.cert_verify_result.verified_cert.get());
details.cert_verify_result.is_issued_by_known_root = true;
- details.ct_verify_result.policy_compliance =
+ details.cert_verify_result.policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_NOT_ENOUGH_SCTS;
CompleteCryptoHandshake();
@@ -1906,7 +1901,7 @@ TEST_P(QuicChromiumClientSessionTest, MigrateToSocket) {
}
ack_and_data_out = client_maker_.MakeDataPacket(
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true, false,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
std::unique_ptr<quic::QuicEncryptedPacket> server_ping(
server_maker_.MakePingPacket(1, /*include_version=*/false));
MockRead reads[] = {
@@ -1950,7 +1945,7 @@ TEST_P(QuicChromiumClientSessionTest, MigrateToSocket) {
quic::test::QuicStreamPeer::SendBuffer(stream).SaveStreamData(iov, 1, 0, 4);
quic::test::QuicStreamPeer::SetStreamBytesWritten(4, stream);
session_->WritevData(stream->id(), 4, 0, quic::NO_FIN,
- quic::NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ quic::NOT_RETRANSMISSION, absl::nullopt);
EXPECT_TRUE(socket_data.AllReadDataConsumed());
EXPECT_TRUE(socket_data.AllWriteDataConsumed());
@@ -2218,7 +2213,7 @@ TEST_P(QuicChromiumClientSessionTest, ResetOnEmptyResponseHeaders) {
// In case of IETF QUIC, QuicSpdyStream::OnStreamHeaderList() calls
// QuicChromiumClientStream::OnInitialHeadersComplete() with the empty
// header list, and QuicChromiumClientStream signals an error.
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
int rv = stream_handle->ReadInitialHeaders(&header_block,
CompletionOnceCallback());
EXPECT_THAT(rv, IsError(ERR_INVALID_RESPONSE));
diff --git a/chromium/net/quic/quic_chromium_client_stream.cc b/chromium/net/quic/quic_chromium_client_stream.cc
index cd5e3523818..1b216909665 100644
--- a/chromium/net/quic/quic_chromium_client_stream.cc
+++ b/chromium/net/quic/quic_chromium_client_stream.cc
@@ -7,7 +7,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
@@ -145,7 +144,7 @@ void QuicChromiumClientStream::Handle::InvokeCallbacksOnClose(int error) {
}
int QuicChromiumClientStream::Handle::ReadInitialHeaders(
- spdy::SpdyHeaderBlock* header_block,
+ spdy::Http2HeaderBlock* header_block,
CompletionOnceCallback callback) {
ScopedBoolSaver saver(&may_invoke_callbacks_, false);
if (!stream_)
@@ -183,7 +182,7 @@ int QuicChromiumClientStream::Handle::ReadBody(
}
int QuicChromiumClientStream::Handle::ReadTrailingHeaders(
- spdy::SpdyHeaderBlock* header_block,
+ spdy::Http2HeaderBlock* header_block,
CompletionOnceCallback callback) {
ScopedBoolSaver saver(&may_invoke_callbacks_, false);
if (!stream_)
@@ -199,7 +198,7 @@ int QuicChromiumClientStream::Handle::ReadTrailingHeaders(
}
int QuicChromiumClientStream::Handle::WriteHeaders(
- spdy::SpdyHeaderBlock header_block,
+ spdy::Http2HeaderBlock header_block,
bool fin,
quic::QuicReferenceCountedPointer<quic::QuicAckListenerInterface>
ack_notifier_delegate) {
@@ -447,7 +446,7 @@ void QuicChromiumClientStream::OnInitialHeadersComplete(
const quic::QuicHeaderList& header_list) {
quic::QuicSpdyStream::OnInitialHeadersComplete(fin, frame_len, header_list);
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
int64_t length = -1;
if (!quic::SpdyUtils::CopyAndValidateHeaders(header_list, &length,
&header_block)) {
@@ -487,7 +486,7 @@ void QuicChromiumClientStream::OnPromiseHeaderList(
quic::QuicStreamId promised_id,
size_t frame_len,
const quic::QuicHeaderList& header_list) {
- spdy::SpdyHeaderBlock promise_headers;
+ spdy::Http2HeaderBlock promise_headers;
int64_t content_length = -1;
if (!quic::SpdyUtils::CopyAndValidateHeaders(header_list, &content_length,
&promise_headers)) {
@@ -535,7 +534,7 @@ void QuicChromiumClientStream::OnCanWrite() {
}
size_t QuicChromiumClientStream::WriteHeaders(
- spdy::SpdyHeaderBlock header_block,
+ spdy::Http2HeaderBlock header_block,
bool fin,
quic::QuicReferenceCountedPointer<quic::QuicAckListenerInterface>
ack_listener) {
@@ -556,7 +555,7 @@ size_t QuicChromiumClientStream::WriteHeaders(
return len;
}
-bool QuicChromiumClientStream::WriteStreamData(quiche::QuicheStringPiece data,
+bool QuicChromiumClientStream::WriteStreamData(absl::string_view data,
bool fin) {
// Must not be called when data is buffered.
DCHECK(!HasBufferedData());
@@ -574,7 +573,7 @@ bool QuicChromiumClientStream::WritevStreamData(
// Writes the data, or buffers it.
for (size_t i = 0; i < buffers.size(); ++i) {
bool is_fin = fin && (i == buffers.size() - 1);
- quiche::QuicheStringPiece string_data(buffers[i]->data(), lengths[i]);
+ absl::string_view string_data(buffers[i]->data(), lengths[i]);
WriteOrBufferBody(string_data, is_fin);
}
return !HasBufferedData(); // Was all data written?
@@ -659,7 +658,7 @@ void QuicChromiumClientStream::NotifyHandleOfTrailingHeadersAvailable() {
}
int QuicChromiumClientStream::DeliverInitialHeaders(
- spdy::SpdyHeaderBlock* headers) {
+ spdy::Http2HeaderBlock* headers) {
if (!initial_headers_arrived_) {
return ERR_IO_PENDING;
}
@@ -682,7 +681,7 @@ int QuicChromiumClientStream::DeliverInitialHeaders(
}
bool QuicChromiumClientStream::DeliverTrailingHeaders(
- spdy::SpdyHeaderBlock* headers,
+ spdy::Http2HeaderBlock* headers,
int* frame_len) {
if (received_trailers().empty())
return false;
diff --git a/chromium/net/quic/quic_chromium_client_stream.h b/chromium/net/quic/quic_chromium_client_stream.h
index e65d041e3f8..74f129ca79e 100644
--- a/chromium/net/quic/quic_chromium_client_stream.h
+++ b/chromium/net/quic/quic_chromium_client_stream.h
@@ -24,6 +24,7 @@
#include "net/log/net_log_with_source.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h"
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
namespace quic {
@@ -50,7 +51,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
// the headers arrive.
// TODO(rch): Invoke |callback| when there is a stream or connection error
// instead of calling OnClose() or OnError().
- int ReadInitialHeaders(spdy::SpdyHeaderBlock* header_block,
+ int ReadInitialHeaders(spdy::Http2HeaderBlock* header_block,
CompletionOnceCallback callback);
// Reads at most |buffer_len| bytes of body into |buffer| and returns the
@@ -68,7 +69,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
// the headers arrive.
// TODO(rch): Invoke |callback| when there is a stream or connection error
// instead of calling OnClose() or OnError().
- int ReadTrailingHeaders(spdy::SpdyHeaderBlock* header_block,
+ int ReadTrailingHeaders(spdy::Http2HeaderBlock* header_block,
CompletionOnceCallback callback);
// Writes |header_block| to the peer. Closes the write side if |fin| is
@@ -77,7 +78,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
// an error writing the headers, or the number of bytes written on
// success. Will not return ERR_IO_PENDING.
int WriteHeaders(
- spdy::SpdyHeaderBlock header_block,
+ spdy::Http2HeaderBlock header_block,
bool fin,
quic::QuicReferenceCountedPointer<quic::QuicAckListenerInterface>
ack_notifier_delegate);
@@ -166,7 +167,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
// Callback to be invoked when ReadHeaders completes asynchronously.
CompletionOnceCallback read_headers_callback_;
- spdy::SpdyHeaderBlock* read_headers_buffer_;
+ spdy::Http2HeaderBlock* read_headers_buffer_;
// Callback to be invoked when ReadBody completes asynchronously.
CompletionOnceCallback read_body_callback_;
@@ -228,7 +229,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
void OnClose() override;
void OnCanWrite() override;
size_t WriteHeaders(
- spdy::SpdyHeaderBlock header_block,
+ spdy::Http2HeaderBlock header_block,
bool fin,
quic::QuicReferenceCountedPointer<quic::QuicAckListenerInterface>
ack_listener) override;
@@ -240,7 +241,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
// Writes |data| to the peer and closes the write side if |fin| is true.
// Returns true if the data have been fully written. If the data was not fully
// written, returns false and OnCanWrite() will be invoked later.
- bool WriteStreamData(quiche::QuicheStringPiece data, bool fin);
+ bool WriteStreamData(absl::string_view data, bool fin);
// Same as WriteStreamData except it writes data from a vector of IOBuffers,
// with the length of each buffer at the corresponding index in |lengths|.
bool WritevStreamData(const std::vector<scoped_refptr<IOBuffer>>& buffers,
@@ -272,9 +273,9 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
// True if this stream is the first data stream created on this session.
bool IsFirstStream();
- int DeliverInitialHeaders(spdy::SpdyHeaderBlock* header_block);
+ int DeliverInitialHeaders(spdy::Http2HeaderBlock* header_block);
- bool DeliverTrailingHeaders(spdy::SpdyHeaderBlock* header_block,
+ bool DeliverTrailingHeaders(spdy::Http2HeaderBlock* header_block,
int* frame_len);
using quic::QuicSpdyStream::HasBufferedData;
@@ -306,7 +307,7 @@ class NET_EXPORT_PRIVATE QuicChromiumClientStream
// True if initial headers have been delivered to the handle..
bool headers_delivered_;
// Stores the initial header until they are delivered to the handle.
- spdy::SpdyHeaderBlock initial_headers_;
+ spdy::Http2HeaderBlock initial_headers_;
// Length of the HEADERS frame containing initial headers.
size_t initial_headers_frame_len_;
diff --git a/chromium/net/quic/quic_chromium_client_stream_test.cc b/chromium/net/quic/quic_chromium_client_stream_test.cc
index 3db1a336755..8fb1152a779 100644
--- a/chromium/net/quic/quic_chromium_client_stream_test.cc
+++ b/chromium/net/quic/quic_chromium_client_stream_test.cc
@@ -60,14 +60,14 @@ class MockQuicClientSessionBase : public quic::QuicSpdyClientSessionBase {
quic::QuicSpdyStream*(quic::PendingStream* pending));
MOCK_METHOD0(CreateOutgoingBidirectionalStream, QuicChromiumClientStream*());
MOCK_METHOD0(CreateOutgoingUnidirectionalStream, QuicChromiumClientStream*());
- MOCK_METHOD6(WritevData,
- quic::QuicConsumedData(
- quic::QuicStreamId id,
- size_t write_length,
- quic::QuicStreamOffset offset,
- quic::StreamSendingState state,
- quic::TransmissionType type,
- quiche::QuicheOptional<quic::EncryptionLevel> level));
+ MOCK_METHOD6(
+ WritevData,
+ quic::QuicConsumedData(quic::QuicStreamId id,
+ size_t write_length,
+ quic::QuicStreamOffset offset,
+ quic::StreamSendingState state,
+ quic::TransmissionType type,
+ absl::optional<quic::EncryptionLevel> level));
MOCK_METHOD4(SendRstStream,
void(quic::QuicStreamId stream_id,
quic::QuicRstStreamErrorCode error,
@@ -76,7 +76,7 @@ class MockQuicClientSessionBase : public quic::QuicSpdyClientSessionBase {
MOCK_METHOD2(OnStreamHeaders,
void(quic::QuicStreamId stream_id,
- quiche::QuicheStringPiece headers_data));
+ absl::string_view headers_data));
MOCK_METHOD2(OnStreamHeadersPriority,
void(quic::QuicStreamId stream_id,
const spdy::SpdyStreamPrecedence& precedence));
@@ -84,17 +84,17 @@ class MockQuicClientSessionBase : public quic::QuicSpdyClientSessionBase {
void(quic::QuicStreamId stream_id, bool fin, size_t frame_len));
MOCK_METHOD2(OnPromiseHeaders,
void(quic::QuicStreamId stream_id,
- quiche::QuicheStringPiece headers_data));
+ absl::string_view headers_data));
MOCK_METHOD3(OnPromiseHeadersComplete,
void(quic::QuicStreamId stream_id,
quic::QuicStreamId promised_stream_id,
size_t frame_len));
MOCK_CONST_METHOD0(OneRttKeysAvailable, bool());
- // Methods taking non-copyable types like spdy::SpdyHeaderBlock by value
+ // Methods taking non-copyable types like spdy::Http2HeaderBlock by value
// cannot be mocked directly.
size_t WriteHeadersOnHeadersStream(
quic::QuicStreamId id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
bool fin,
const spdy::SpdyStreamPrecedence& precedence,
quic::QuicReferenceCountedPointer<quic::QuicAckListenerInterface>
@@ -104,7 +104,7 @@ class MockQuicClientSessionBase : public quic::QuicSpdyClientSessionBase {
}
MOCK_METHOD5(WriteHeadersOnHeadersStreamMock,
size_t(quic::QuicStreamId id,
- const spdy::SpdyHeaderBlock& headers,
+ const spdy::Http2HeaderBlock& headers,
bool fin,
const spdy::SpdyStreamPrecedence& precedence,
const quic::QuicReferenceCountedPointer<
@@ -216,29 +216,29 @@ class QuicChromiumClientStreamTest
"JBCScs_ejbKaqBDoB7ZGxTvqlrB__2ZmnHHjCr8RgMRtKNtIeuZAo ";
}
- void ReadData(quiche::QuicheStringPiece expected_data) {
+ void ReadData(absl::string_view expected_data) {
scoped_refptr<IOBuffer> buffer =
base::MakeRefCounted<IOBuffer>(expected_data.length() + 1);
EXPECT_EQ(static_cast<int>(expected_data.length()),
stream_->Read(buffer.get(), expected_data.length() + 1));
- EXPECT_EQ(expected_data, quiche::QuicheStringPiece(buffer->data(),
- expected_data.length()));
+ EXPECT_EQ(expected_data,
+ absl::string_view(buffer->data(), expected_data.length()));
}
- quic::QuicHeaderList ProcessHeaders(const spdy::SpdyHeaderBlock& headers) {
+ quic::QuicHeaderList ProcessHeaders(const spdy::Http2HeaderBlock& headers) {
quic::QuicHeaderList h = quic::test::AsHeaderList(headers);
stream_->OnStreamHeaderList(false, h.uncompressed_header_bytes(), h);
return h;
}
- quic::QuicHeaderList ProcessTrailers(const spdy::SpdyHeaderBlock& headers) {
+ quic::QuicHeaderList ProcessTrailers(const spdy::Http2HeaderBlock& headers) {
quic::QuicHeaderList h = quic::test::AsHeaderList(headers);
stream_->OnStreamHeaderList(true, h.uncompressed_header_bytes(), h);
return h;
}
quic::QuicHeaderList ProcessHeadersFull(
- const spdy::SpdyHeaderBlock& headers) {
+ const spdy::Http2HeaderBlock& headers) {
quic::QuicHeaderList h = ProcessHeaders(headers);
TestCompletionCallback callback;
EXPECT_EQ(static_cast<int>(h.uncompressed_header_bytes()),
@@ -280,8 +280,8 @@ class QuicChromiumClientStreamTest
quic::test::MockAlarmFactory alarm_factory_;
MockQuicClientSessionBase session_;
QuicChromiumClientStream* stream_;
- spdy::SpdyHeaderBlock headers_;
- spdy::SpdyHeaderBlock trailers_;
+ spdy::Http2HeaderBlock headers_;
+ spdy::Http2HeaderBlock trailers_;
quic::QuicClientPushPromiseIndex push_promise_index_;
};
@@ -312,7 +312,7 @@ TEST_P(QuicChromiumClientStreamTest, Handle) {
quic::QuicStreamFrame frame2(
quic::test::GetNthClientInitiatedBidirectionalStreamId(
version_.transport_version, 0),
- true, offset, quiche::QuicheStringPiece());
+ true, offset, absl::string_view());
stream_->OnStreamFrame(frame2);
EXPECT_TRUE(handle_->fin_received());
handle_->OnFinRead();
@@ -359,7 +359,7 @@ TEST_P(QuicChromiumClientStreamTest, Handle) {
ERR_CONNECTION_CLOSED,
handle_->WritevStreamData(buffers, lengths, true, callback.callback()));
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
EXPECT_EQ(0, handle_->WriteHeaders(std::move(headers), true, nullptr));
}
@@ -417,7 +417,7 @@ TEST_P(QuicChromiumClientStreamTest, OnFinRead) {
quic::QuicStreamFrame frame2(
quic::test::GetNthClientInitiatedBidirectionalStreamId(
version_.transport_version, 0),
- true, offset, quiche::QuicheStringPiece());
+ true, offset, absl::string_view());
stream_->OnStreamFrame(frame2);
}
@@ -448,8 +448,8 @@ TEST_P(QuicChromiumClientStreamTest, OnDataAvailable) {
scoped_refptr<IOBuffer> buffer = base::MakeRefCounted<IOBuffer>(2 * data_len);
EXPECT_EQ(data_len,
handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback()));
- EXPECT_EQ(quiche::QuicheStringPiece(data),
- quiche::QuicheStringPiece(buffer->data(), data_len));
+ EXPECT_EQ(absl::string_view(data),
+ absl::string_view(buffer->data(), data_len));
}
TEST_P(QuicChromiumClientStreamTest, OnDataAvailableAfterReadBody) {
@@ -483,13 +483,13 @@ TEST_P(QuicChromiumClientStreamTest, OnDataAvailableAfterReadBody) {
/*offset=*/offset, data));
EXPECT_EQ(data_len, callback.WaitForResult());
- EXPECT_EQ(quiche::QuicheStringPiece(data),
- quiche::QuicheStringPiece(buffer->data(), data_len));
+ EXPECT_EQ(absl::string_view(data),
+ absl::string_view(buffer->data(), data_len));
base::RunLoop().RunUntilIdle();
}
TEST_P(QuicChromiumClientStreamTest, ProcessHeadersWithError) {
- spdy::SpdyHeaderBlock bad_headers;
+ spdy::Http2HeaderBlock bad_headers;
bad_headers["NAME"] = "...";
EXPECT_CALL(
session_,
@@ -581,10 +581,10 @@ TEST_P(QuicChromiumClientStreamTest, OnTrailers) {
scoped_refptr<IOBuffer> buffer = base::MakeRefCounted<IOBuffer>(2 * data_len);
EXPECT_EQ(data_len,
handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback()));
- EXPECT_EQ(quiche::QuicheStringPiece(data),
- quiche::QuicheStringPiece(buffer->data(), data_len));
+ EXPECT_EQ(absl::string_view(data),
+ absl::string_view(buffer->data(), data_len));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["bar"] = "foo";
if (!version_.HasIetfQuicFrames()) {
trailers[quic::kFinalOffsetHeaderKey] = base::NumberToString(strlen(data));
@@ -637,15 +637,15 @@ TEST_P(QuicChromiumClientStreamTest, MarkTrailersConsumedWhenNotifyDelegate) {
scoped_refptr<IOBuffer> buffer = base::MakeRefCounted<IOBuffer>(2 * data_len);
EXPECT_EQ(data_len,
handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback()));
- EXPECT_EQ(quiche::QuicheStringPiece(data),
- quiche::QuicheStringPiece(buffer->data(), data_len));
+ EXPECT_EQ(absl::string_view(data),
+ absl::string_view(buffer->data(), data_len));
// Read again, and it will be pending.
EXPECT_THAT(
handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback()),
IsError(ERR_IO_PENDING));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["bar"] = "foo";
if (!version_.HasIetfQuicFrames()) {
trailers[quic::kFinalOffsetHeaderKey] = base::NumberToString(strlen(data));
@@ -700,11 +700,11 @@ TEST_P(QuicChromiumClientStreamTest, ReadAfterTrailersReceivedButNotDelivered) {
scoped_refptr<IOBuffer> buffer = base::MakeRefCounted<IOBuffer>(2 * data_len);
EXPECT_EQ(data_len,
handle_->ReadBody(buffer.get(), 2 * data_len, callback.callback()));
- EXPECT_EQ(quiche::QuicheStringPiece(data),
- quiche::QuicheStringPiece(buffer->data(), data_len));
+ EXPECT_EQ(absl::string_view(data),
+ absl::string_view(buffer->data(), data_len));
// Deliver trailers. Delegate notification is posted asynchronously.
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers["bar"] = "foo";
if (!version_.HasIetfQuicFrames()) {
trailers[quic::kFinalOffsetHeaderKey] = base::NumberToString(strlen(data));
@@ -939,8 +939,8 @@ TEST_P(QuicChromiumClientStreamTest, HeadersAndDataBeforeHandle) {
int data_len = base::size(data) - 1;
scoped_refptr<IOBuffer> buffer = base::MakeRefCounted<IOBuffer>(data_len + 1);
ASSERT_EQ(data_len, stream2->Read(buffer.get(), data_len + 1));
- EXPECT_EQ(quiche::QuicheStringPiece(data),
- quiche::QuicheStringPiece(buffer->data(), data_len));
+ EXPECT_EQ(absl::string_view(data),
+ absl::string_view(buffer->data(), data_len));
}
// Regression test for https://crbug.com/1043531.
@@ -952,7 +952,7 @@ TEST_P(QuicChromiumClientStreamTest, ResetOnEmptyResponseHeaders) {
quic::QUIC_HEADERS_TOO_LARGE, 0, _));
}
- const spdy::SpdyHeaderBlock empty_response_headers;
+ const spdy::Http2HeaderBlock empty_response_headers;
ProcessHeaders(empty_response_headers);
if (VersionUsesHttp3(version_.transport_version)) {
diff --git a/chromium/net/quic/quic_client_session_cache_unittests.cc b/chromium/net/quic/quic_client_session_cache_unittests.cc
index c1e241df403..32ecc7d271e 100644
--- a/chromium/net/quic/quic_client_session_cache_unittests.cc
+++ b/chromium/net/quic/quic_client_session_cache_unittests.cc
@@ -128,8 +128,7 @@ class QuicClientSessionCacheTest : public testing::Test {
protected:
bssl::UniquePtr<SSL_SESSION> NewSSLSession() {
- std::string cached_session =
- quiche::QuicheTextUtils::HexDecode(kCachedSession);
+ std::string cached_session = absl::HexStringToBytes(kCachedSession);
SSL_SESSION* session = SSL_SESSION_from_bytes(
reinterpret_cast<const uint8_t*>(cached_session.data()),
cached_session.size(), ssl_ctx_.get());
diff --git a/chromium/net/quic/quic_connection_logger.cc b/chromium/net/quic/quic_connection_logger.cc
index a8d3875bcf5..193c7051aa7 100644
--- a/chromium/net/quic/quic_connection_logger.cc
+++ b/chromium/net/quic/quic_connection_logger.cc
@@ -183,40 +183,40 @@ void QuicConnectionLogger::OnStreamFrameCoalesced(
}
void QuicConnectionLogger::OnPacketSent(
- const quic::SerializedPacket& serialized_packet,
+ quic::QuicPacketNumber packet_number,
+ quic::QuicPacketLength packet_length,
+ bool has_crypto_handshake,
quic::TransmissionType transmission_type,
+ quic::EncryptionLevel encryption_level,
+ const quic::QuicFrames& retransmittable_frames,
+ const quic::QuicFrames& nonretransmittable_frames,
quic::QuicTime sent_time) {
// 4.4.1.4. Minimum Packet Size
// The payload of a UDP datagram carrying the Initial packet MUST be
// expanded to at least 1200 octets
const quic::QuicPacketLength kMinClientInitialPacketLength = 1200;
- const quic::QuicPacketLength encrypted_length =
- serialized_packet.encrypted_length;
- switch (serialized_packet.encryption_level) {
+ switch (encryption_level) {
case quic::ENCRYPTION_INITIAL:
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.SendPacketSize.Initial",
- encrypted_length, 1, kMaxOutgoingPacketSize,
- 50);
- if (encrypted_length < kMinClientInitialPacketLength) {
+ packet_length, 1, kMaxOutgoingPacketSize, 50);
+ if (packet_length < kMinClientInitialPacketLength) {
UMA_HISTOGRAM_CUSTOM_COUNTS(
"Net.QuicSession.TooSmallInitialSentPacket",
- kMinClientInitialPacketLength - encrypted_length, 1,
+ kMinClientInitialPacketLength - packet_length, 1,
kMinClientInitialPacketLength, 50);
}
break;
case quic::ENCRYPTION_HANDSHAKE:
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.SendPacketSize.Hanshake",
- encrypted_length, 1, kMaxOutgoingPacketSize,
- 50);
+ packet_length, 1, kMaxOutgoingPacketSize, 50);
break;
case quic::ENCRYPTION_ZERO_RTT:
UMA_HISTOGRAM_CUSTOM_COUNTS("Net.QuicSession.SendPacketSize.0RTT",
- encrypted_length, 1, kMaxOutgoingPacketSize,
- 50);
+ packet_length, 1, kMaxOutgoingPacketSize, 50);
break;
case quic::ENCRYPTION_FORWARD_SECURE:
UMA_HISTOGRAM_CUSTOM_COUNTS(
- "Net.QuicSession.SendPacketSize.ForwardSecure", encrypted_length, 1,
+ "Net.QuicSession.SendPacketSize.ForwardSecure", packet_length, 1,
kMaxOutgoingPacketSize, 50);
break;
case quic::NUM_ENCRYPTION_LEVELS:
@@ -224,7 +224,22 @@ void QuicConnectionLogger::OnPacketSent(
break;
}
- event_logger_.OnPacketSent(serialized_packet, transmission_type, sent_time);
+ event_logger_.OnPacketSent(packet_number, packet_length, has_crypto_handshake,
+ transmission_type, encryption_level,
+ retransmittable_frames, nonretransmittable_frames,
+ sent_time);
+}
+
+void QuicConnectionLogger::OnPacketSent(
+ const quic::SerializedPacket& serialized_packet,
+ quic::TransmissionType transmission_type,
+ quic::QuicTime sent_time) {
+ OnPacketSent(serialized_packet.packet_number,
+ serialized_packet.encrypted_length,
+ serialized_packet.has_crypto_handshake != quic::NOT_HANDSHAKE,
+ transmission_type, serialized_packet.encryption_level,
+ serialized_packet.retransmittable_frames,
+ serialized_packet.nonretransmittable_frames, sent_time);
}
void QuicConnectionLogger::OnPacketLoss(
@@ -290,8 +305,9 @@ void QuicConnectionLogger::OnProtocolVersionMismatch(
// TODO(rtenneti): Add logging.
}
-void QuicConnectionLogger::OnPacketHeader(
- const quic::QuicPacketHeader& header) {
+void QuicConnectionLogger::OnPacketHeader(const quic::QuicPacketHeader& header,
+ quic::QuicTime receive_time,
+ quic::EncryptionLevel level) {
if (!first_received_packet_number_.IsInitialized()) {
first_received_packet_number_ = header.packet_number;
} else if (header.packet_number < first_received_packet_number_) {
@@ -338,7 +354,7 @@ void QuicConnectionLogger::OnPacketHeader(
no_packet_received_after_ping_ = false;
}
last_received_packet_number_ = header.packet_number;
- event_logger_.OnPacketHeader(header);
+ event_logger_.OnPacketHeader(header, receive_time, level);
}
void QuicConnectionLogger::OnStreamFrame(const quic::QuicStreamFrame& frame) {
@@ -485,7 +501,7 @@ void QuicConnectionLogger::OnVersionNegotiationPacket(
void QuicConnectionLogger::OnCryptoHandshakeMessageReceived(
const quic::CryptoHandshakeMessage& message) {
if (message.tag() == quic::kSHLO) {
- quiche::QuicheStringPiece address;
+ absl::string_view address;
quic::QuicSocketAddressCoder decoder;
if (message.GetStringPiece(quic::kCADR, &address) &&
decoder.Decode(address.data(), address.size())) {
diff --git a/chromium/net/quic/quic_connection_logger.h b/chromium/net/quic/quic_connection_logger.h
index 9c5e351f947..2909f046c0f 100644
--- a/chromium/net/quic/quic_connection_logger.h
+++ b/chromium/net/quic/quic_connection_logger.h
@@ -46,10 +46,18 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
void OnFrameAddedToPacket(const quic::QuicFrame& frame) override;
void OnStreamFrameCoalesced(const quic::QuicStreamFrame& frame) override;
- // QuicConnectionDebugVisitor Interface
+ // quic::QuicConnectionDebugVisitor Interface
void OnPacketSent(const quic::SerializedPacket& serialized_packet,
quic::TransmissionType transmission_type,
quic::QuicTime sent_time) override;
+ void OnPacketSent(quic::QuicPacketNumber packet_number,
+ quic::QuicPacketLength packet_length,
+ bool has_crypto_handshake,
+ quic::TransmissionType transmission_type,
+ quic::EncryptionLevel encryption_level,
+ const quic::QuicFrames& retransmittable_frames,
+ const quic::QuicFrames& nonretransmittable_frames,
+ quic::QuicTime sent_time) override;
void OnIncomingAck(quic::QuicPacketNumber ack_packet_number,
quic::EncryptionLevel ack_decrypted_level,
const quic::QuicAckFrame& frame,
@@ -73,7 +81,9 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
quic::EncryptionLevel decryption_level) override;
void OnDuplicatePacket(quic::QuicPacketNumber packet_number) override;
void OnProtocolVersionMismatch(quic::ParsedQuicVersion version) override;
- void OnPacketHeader(const quic::QuicPacketHeader& header) override;
+ void OnPacketHeader(const quic::QuicPacketHeader& header,
+ quic::QuicTime receive_time,
+ quic::EncryptionLevel level) override;
void OnPathChallengeFrame(const quic::QuicPathChallengeFrame& frame) override;
void OnPathResponseFrame(const quic::QuicPathResponseFrame& frame) override;
void OnCryptoFrame(const quic::QuicCryptoFrame& frame) override;
diff --git a/chromium/net/quic/quic_connectivity_monitor.cc b/chromium/net/quic/quic_connectivity_monitor.cc
index 733faa779e9..6aa56e08dc0 100644
--- a/chromium/net/quic/quic_connectivity_monitor.cc
+++ b/chromium/net/quic/quic_connectivity_monitor.cc
@@ -71,7 +71,8 @@ void QuicConnectivityMonitor::RecordConnectivityStatsToHistograms(
"Net.QuicConnectivityMonitor.PercentageAllDegradedSessions." +
notification;
- base::UmaHistogramPercentage(percentage_histogram_name1, percentage);
+ base::UmaHistogramPercentageObsoleteDoNotUse(percentage_histogram_name1,
+ percentage);
// Skip degrading session collection if there are less than two sessions.
if (active_sessions_.size() < 2u)
@@ -89,7 +90,8 @@ void QuicConnectivityMonitor::RecordConnectivityStatsToHistograms(
const std::string percentage_histogram_name =
"Net.QuicConnectivityMonitor.PercentageActiveDegradingSessions." +
notification;
- base::UmaHistogramPercentage(percentage_histogram_name, percentage);
+ base::UmaHistogramPercentageObsoleteDoNotUse(percentage_histogram_name,
+ percentage);
}
size_t QuicConnectivityMonitor::GetNumDegradingSessions() const {
diff --git a/chromium/net/quic/quic_context.h b/chromium/net/quic/quic_context.h
index d89ec0f8340..b622eaddfda 100644
--- a/chromium/net/quic/quic_context.h
+++ b/chromium/net/quic/quic_context.h
@@ -174,6 +174,9 @@ struct NET_EXPORT QuicParams {
bool disable_tls_zero_rtt = false;
// If true, gQUIC requests will always require confirmation.
bool disable_gquic_zero_rtt = false;
+ // Network Service Type of the socket for iOS. Default is NET_SERVICE_TYPE_BE
+ // (best effort).
+ int ios_network_service_type = 0;
};
// QuicContext contains QUIC-related variables that are shared across all of the
diff --git a/chromium/net/quic/quic_crypto_framer_parse_message_fuzzer.cc b/chromium/net/quic/quic_crypto_framer_parse_message_fuzzer.cc
index 4d70b4c0cd4..4ecc9de4494 100644
--- a/chromium/net/quic/quic_crypto_framer_parse_message_fuzzer.cc
+++ b/chromium/net/quic/quic_crypto_framer_parse_message_fuzzer.cc
@@ -10,8 +10,7 @@
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- quiche::QuicheStringPiece crypto_input(reinterpret_cast<const char*>(data),
- size);
+ absl::string_view crypto_input(reinterpret_cast<const char*>(data), size);
std::unique_ptr<quic::CryptoHandshakeMessage> handshake_message(
quic::CryptoFramer::ParseMessage(crypto_input));
diff --git a/chromium/net/quic/quic_end_to_end_unittest.cc b/chromium/net/quic/quic_end_to_end_unittest.cc
index de027561567..ce28ee63d91 100644
--- a/chromium/net/quic/quic_end_to_end_unittest.cc
+++ b/chromium/net/quic/quic_end_to_end_unittest.cc
@@ -170,10 +170,10 @@ class QuicEndToEndTest : public ::testing::Test, public WithTaskEnvironment {
// Adds an entry to the cache used by the QUIC server to serve
// responses.
- void AddToCache(quiche::QuicheStringPiece path,
+ void AddToCache(absl::string_view path,
int response_code,
- quiche::QuicheStringPiece response_detail,
- quiche::QuicheStringPiece body) {
+ absl::string_view response_detail,
+ absl::string_view body) {
memory_cache_backend_.AddSimpleResponse("test.example.com", path,
response_code, body);
}
diff --git a/chromium/net/quic/quic_event_logger.cc b/chromium/net/quic/quic_event_logger.cc
index e1023fa7bf3..51f71762870 100644
--- a/chromium/net/quic/quic_event_logger.cc
+++ b/chromium/net/quic/quic_event_logger.cc
@@ -24,20 +24,19 @@ base::Value NetLogQuicPacketParams(const quic::QuicSocketAddress& self_address,
return dict;
}
-base::Value NetLogQuicPacketSentParams(
- const quic::SerializedPacket& serialized_packet,
- quic::TransmissionType transmission_type,
- quic::QuicTime sent_time) {
+base::Value NetLogQuicPacketSentParams(quic::QuicPacketNumber packet_number,
+ quic::QuicPacketLength packet_length,
+ quic::TransmissionType transmission_type,
+ quic::EncryptionLevel encryption_level,
+ quic::QuicTime sent_time) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("transmission_type",
quic::TransmissionTypeToString(transmission_type));
- dict.SetKey("packet_number",
- NetLogNumberValue(serialized_packet.packet_number.ToUint64()));
- dict.SetIntKey("size", serialized_packet.encrypted_length);
+ dict.SetKey("packet_number", NetLogNumberValue(packet_number.ToUint64()));
+ dict.SetIntKey("size", packet_length);
dict.SetKey("sent_time_us", NetLogNumberValue(sent_time.ToDebuggingValue()));
- dict.SetStringKey(
- "encryption_level",
- quic::EncryptionLevelToString(serialized_packet.encryption_level));
+ dict.SetStringKey("encryption_level",
+ quic::EncryptionLevelToString(encryption_level));
return dict;
}
@@ -547,17 +546,35 @@ void QuicEventLogger::OnStreamFrameCoalesced(
}
void QuicEventLogger::OnPacketSent(
- const quic::SerializedPacket& serialized_packet,
+ quic::QuicPacketNumber packet_number,
+ quic::QuicPacketLength packet_length,
+ bool /*has_crypto_handshake*/,
quic::TransmissionType transmission_type,
+ quic::EncryptionLevel encryption_level,
+ const quic::QuicFrames& /*retransmittable_frames*/,
+ const quic::QuicFrames& /*nonretransmittable_frames*/,
quic::QuicTime sent_time) {
if (!net_log_.IsCapturing())
return;
net_log_.AddEvent(NetLogEventType::QUIC_SESSION_PACKET_SENT, [&] {
- return NetLogQuicPacketSentParams(serialized_packet, transmission_type,
+ return NetLogQuicPacketSentParams(packet_number, packet_length,
+ transmission_type, encryption_level,
sent_time);
});
}
+void QuicEventLogger::OnPacketSent(
+ const quic::SerializedPacket& serialized_packet,
+ quic::TransmissionType transmission_type,
+ quic::QuicTime sent_time) {
+ OnPacketSent(serialized_packet.packet_number,
+ serialized_packet.encrypted_length,
+ serialized_packet.has_crypto_handshake != quic::NOT_HANDSHAKE,
+ transmission_type, serialized_packet.encryption_level,
+ serialized_packet.retransmittable_frames,
+ serialized_packet.nonretransmittable_frames, sent_time);
+}
+
void QuicEventLogger::OnIncomingAck(
quic::QuicPacketNumber ack_packet_number,
quic::EncryptionLevel /*ack_decrypted_level*/,
@@ -642,7 +659,9 @@ void QuicEventLogger::OnDuplicatePacket(quic::QuicPacketNumber packet_number) {
[&] { return NetLogQuicDuplicatePacketParams(packet_number); });
}
-void QuicEventLogger::OnPacketHeader(const quic::QuicPacketHeader& header) {
+void QuicEventLogger::OnPacketHeader(const quic::QuicPacketHeader& header,
+ quic::QuicTime /*receive_time*/,
+ quic::EncryptionLevel /*level*/) {
if (!net_log_.IsCapturing())
return;
net_log_.AddEvent(NetLogEventType::QUIC_SESSION_PACKET_AUTHENTICATED);
@@ -842,7 +861,7 @@ void QuicEventLogger::OnVersionNegotiationPacket(
void QuicEventLogger::OnCryptoHandshakeMessageReceived(
const quic::CryptoHandshakeMessage& message) {
if (message.tag() == quic::kSHLO) {
- quiche::QuicheStringPiece address;
+ absl::string_view address;
quic::QuicSocketAddressCoder decoder;
if (message.GetStringPiece(quic::kCADR, &address) &&
decoder.Decode(address.data(), address.size())) {
diff --git a/chromium/net/quic/quic_event_logger.h b/chromium/net/quic/quic_event_logger.h
index d25a8f69976..6f4c4f8c739 100644
--- a/chromium/net/quic/quic_event_logger.h
+++ b/chromium/net/quic/quic_event_logger.h
@@ -28,10 +28,18 @@ class NET_EXPORT_PRIVATE QuicEventLogger
void OnFrameAddedToPacket(const quic::QuicFrame& frame) override;
void OnStreamFrameCoalesced(const quic::QuicStreamFrame& frame) override;
- // QuicConnectionDebugVisitor Interface
+ // quic::QuicConnectionDebugVisitor Interface
void OnPacketSent(const quic::SerializedPacket& serialized_packet,
quic::TransmissionType transmission_type,
quic::QuicTime sent_time) override;
+ void OnPacketSent(quic::QuicPacketNumber packet_number,
+ quic::QuicPacketLength packet_length,
+ bool has_crypto_handshake,
+ quic::TransmissionType transmission_type,
+ quic::EncryptionLevel encryption_level,
+ const quic::QuicFrames& retransmittable_frames,
+ const quic::QuicFrames& nonretransmittable_frames,
+ quic::QuicTime sent_time) override;
void OnIncomingAck(quic::QuicPacketNumber ack_packet_number,
quic::EncryptionLevel ack_decrypted_level,
const quic::QuicAckFrame& frame,
@@ -52,7 +60,9 @@ class NET_EXPORT_PRIVATE QuicEventLogger
void OnAttemptingToProcessUndecryptablePacket(
quic::EncryptionLevel decryption_level) override;
void OnDuplicatePacket(quic::QuicPacketNumber packet_number) override;
- void OnPacketHeader(const quic::QuicPacketHeader& header) override;
+ void OnPacketHeader(const quic::QuicPacketHeader& header,
+ quic::QuicTime receive_time,
+ quic::EncryptionLevel level) override;
void OnPathChallengeFrame(const quic::QuicPathChallengeFrame& frame) override;
void OnPathResponseFrame(const quic::QuicPathResponseFrame& frame) override;
void OnCryptoFrame(const quic::QuicCryptoFrame& frame) override;
diff --git a/chromium/net/quic/quic_flags_list.h b/chromium/net/quic/quic_flags_list.h
deleted file mode 100644
index bf264bdf4ea..00000000000
--- a/chromium/net/quic/quic_flags_list.h
+++ /dev/null
@@ -1,458 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This file intentionally does not have header guards, it's included
-// inside a macro to generate values. The following line silences a
-// presubmit warning that would otherwise be triggered by this:
-// no-include-guard-because-multiply-included
-// NOLINT(build/header_guard)
-
-// This file contains the list of QUIC protocol flags.
-
-// Time period for which a given connection_id should live in the time-wait
-// state.
-QUIC_FLAG(int64_t, FLAGS_quic_time_wait_list_seconds, 200)
-
-// Currently, this number is quite conservative. The max QPS limit for an
-// individual server silo is currently set to 1000 qps, though the actual max
-// that we see in the wild is closer to 450 qps. Regardless, this means that
-// the longest time-wait list we should see is 200 seconds * 1000 qps, 200000.
-// Of course, there are usually many queries per QUIC connection, so we allow a
-// factor of 3 leeway.
-//
-// Maximum number of connections on the time-wait list. A negative value implies
-// no configured limit.
-QUIC_FLAG(int64_t, FLAGS_quic_time_wait_list_max_connections, 600000)
-
-// If true, require handshake confirmation for QUIC connections, functionally
-// disabling 0-rtt handshakes.
-// TODO(rtenneti): Enable this flag after CryptoServerTest's are fixed.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_require_handshake_confirmation,
- false)
-
-// If true, disable pacing in QUIC.
-QUIC_FLAG(bool, FLAGS_quic_disable_pacing_for_perf_tests, false)
-
-// If true, enforce that QUIC CHLOs fit in one packet.
-QUIC_FLAG(bool, FLAGS_quic_enforce_single_packet_chlo, true)
-
-// If true, allows packets to be buffered in anticipation of a future CHLO, and
-// allow CHLO packets to be buffered until next iteration of the event loop.
-QUIC_FLAG(bool, FLAGS_quic_allow_chlo_buffering, true)
-
-// If greater than zero, mean RTT variation is multiplied by the specified
-// factor and added to the congestion window limit.
-QUIC_FLAG(double, FLAGS_quic_bbr_rtt_variation_weight, 0.0f)
-
-// Congestion window gain for QUIC BBR during PROBE_BW phase.
-QUIC_FLAG(double, FLAGS_quic_bbr_cwnd_gain, 2.0f)
-
-// When true, defaults to BBR congestion control instead of Cubic.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_default_to_bbr, false)
-
-// If true, use BBRv2 as the default congestion controller.
-// Takes precedence over --quic_default_to_bbr.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_default_to_bbr_v2, false)
-
-// If buffered data in QUIC stream is less than this threshold, buffers all
-// provided data or asks upper layer for more data.
-QUIC_FLAG(uint32_t, FLAGS_quic_buffered_data_threshold, 8192u)
-
-// Max size of data slice in bytes for QUIC stream send buffer.
-QUIC_FLAG(uint32_t, FLAGS_quic_send_buffer_max_data_slice_size, 4096u)
-
-// Anti-amplification factor. Before address validation, server will
-// send no more than factor times bytes received.
-QUIC_FLAG(int32_t, FLAGS_quic_anti_amplification_factor, 3)
-
-// When true, set the initial congestion control window from connection options
-// in QuicSentPacketManager rather than TcpCubicSenderBytes.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_unified_iw_options, false)
-
-// Number of packets that the pacing sender allows in bursts during pacing.
-QUIC_FLAG(int32_t, FLAGS_quic_lumpy_pacing_size, 2)
-
-// Congestion window fraction that the pacing sender allows in bursts during
-// pacing.
-QUIC_FLAG(double, FLAGS_quic_lumpy_pacing_cwnd_fraction, 0.25f)
-
-// If true, QUIC offload pacing when using USPS as egress method.
-QUIC_FLAG(bool, FLAGS_quic_restart_flag_quic_offload_pacing_to_usps2, false)
-
-// Max time that QUIC can pace packets into the future in ms.
-QUIC_FLAG(int32_t, FLAGS_quic_max_pace_time_into_future_ms, 10)
-
-// Smoothed RTT fraction that a connection can pace packets into the future.
-QUIC_FLAG(double, FLAGS_quic_pace_time_into_future_srtt_fraction, 0.125f)
-
-// Mechanism to override version label and ALPN for IETF interop.
-QUIC_FLAG(int32_t, FLAGS_quic_ietf_draft_version, 0)
-
-// If true, stop resetting ideal_next_packet_send_time_ in pacing sender.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_donot_reset_ideal_next_packet_send_time,
- false)
-
-// When the STMP connection option is sent by the client, timestamps in the QUIC
-// ACK frame are sent and processed.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_send_timestamps, false)
-
-// When in STARTUP and recovery, do not add bytes_acked to QUIC BBR's CWND in
-// CalculateCongestionWindow()
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_bbr_no_bytes_acked_in_startup_recovery,
- false)
-
-// If true and using Leto for QUIC shared-key calculations, GFE will react to a
-// failure to contact Leto by sending a REJ containing a fallback ServerConfig,
-// allowing the client to continue the handshake.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_send_quic_fallback_server_config_on_leto_error,
- false)
-
-// If true, GFE will not request private keys when fetching QUIC ServerConfigs
-// from Leto.
-QUIC_FLAG(bool,
- FLAGS_quic_restart_flag_dont_fetch_quic_private_keys_from_leto,
- false)
-
-// If true, set burst token to 2 in cwnd bootstrapping experiment.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_conservative_bursts, false)
-
-// If true, export number of packets written per write operation histogram.")
-QUIC_FLAG(bool, FLAGS_quic_export_server_num_packets_per_write_histogram, false)
-
-// If true, uses conservative cwnd gain and pacing gain.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_conservative_cwnd_and_pacing_gains,
- false)
-
-// If true, use predictable version negotiation versions.
-QUIC_FLAG(bool, FLAGS_quic_disable_version_negotiation_grease_randomness, false)
-
-// Maximum number of tracked packets.
-QUIC_FLAG(int64_t, FLAGS_quic_max_tracked_packet_count, 10000)
-
-// If true, HTTP request header names sent from QuicSpdyClientBase(and
-// descendents) will be automatically converted to lower case.
-QUIC_FLAG(bool, FLAGS_quic_client_convert_http_header_name_to_lowercase, true)
-
-// If true, allow client to enable BBRv2 on server via connection option 'B2ON'.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_allow_client_enabled_bbr_v2,
- false)
-
-// If true, QuicFramer::WriteClientVersionNegotiationProbePacket uses
-// length-prefixed connection IDs.
-QUIC_FLAG(bool, FLAGS_quic_prober_uses_length_prefixed_connection_ids, false)
-
-// The maximum amount of CRYPTO frame data that can be buffered.
-QUIC_FLAG(int32_t, FLAGS_quic_max_buffered_crypto_bytes, 16 * 1024)
-
-// If the bandwidth during ack aggregation is smaller than (estimated
-// bandwidth * this flag), consider the current aggregation completed
-// and starts a new one.
-QUIC_FLAG(double, FLAGS_quic_ack_aggregation_bandwidth_threshold, 1.0)
-
-// If set to non-zero, the maximum number of consecutive pings that can be sent
-// with aggressive initial retransmittable on wire timeout if there is no new
-// data received. After which, the timeout will be exponentially back off until
-// exceeds the default ping timeout.
-QUIC_FLAG(int32_t,
- FLAGS_quic_max_aggressive_retransmittable_on_wire_ping_count,
- 0)
-
-// The maximum congestion window in packets.
-QUIC_FLAG(int32_t, FLAGS_quic_max_congestion_window, 2000)
-
-// The default minimum duration for BBRv2-native probes, in milliseconds.
-QUIC_FLAG(int32_t, FLAGS_quic_bbr2_default_probe_bw_base_duration_ms, 2000)
-
-// The default upper bound of the random amount of BBRv2-native
-// probes, in milliseconds.
-QUIC_FLAG(int32_t, FLAGS_quic_bbr2_default_probe_bw_max_rand_duration_ms, 1000)
-
-// The default period for entering PROBE_RTT, in milliseconds.
-QUIC_FLAG(int32_t, FLAGS_quic_bbr2_default_probe_rtt_period_ms, 10000)
-
-// The default loss threshold for QUIC BBRv2, should be a value
-// between 0 and 1.
-QUIC_FLAG(double, FLAGS_quic_bbr2_default_loss_threshold, 0.02)
-
-// The default minimum number of loss marking events to exit STARTUP.
-QUIC_FLAG(int32_t, FLAGS_quic_bbr2_default_startup_full_loss_count, 8)
-
-// The default fraction of unutilized headroom to try to leave in path
-// upon high loss.
-QUIC_FLAG(double, FLAGS_quic_bbr2_default_inflight_hi_headroom, 0.01)
-
-// If true, disable QUIC version Q043.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_q043, false)
-
-// If true, disable QUIC version Q046.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_q046, false)
-
-// If true, disable QUIC version Q050.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_q050, false)
-
-// A testonly reloadable flag that will always default to false.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_testonly_default_false, false)
-
-// A testonly reloadable flag that will always default to true.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_testonly_default_true, true)
-
-// A testonly restart flag that will always default to false.
-QUIC_FLAG(bool, FLAGS_quic_restart_flag_quic_testonly_default_false, false)
-
-// A testonly restart flag that will always default to true.
-QUIC_FLAG(bool, FLAGS_quic_restart_flag_quic_testonly_default_true, true)
-
-// The default initial value of the max ack height filter's window length.
-QUIC_FLAG(int32_t, FLAGS_quic_bbr2_default_initial_ack_height_filter_window, 10)
-
-// The default minimum number of loss marking events to exit PROBE_UP phase.
-QUIC_FLAG(double, FLAGS_quic_bbr2_default_probe_bw_full_loss_count, 2)
-
-// When true, ensure the ACK delay is never less than the alarm granularity when
-// ACK decimation is enabled.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_ack_delay_alarm_granularity,
- false)
-
-// If true, use predictable grease settings identifiers and values.
-QUIC_FLAG(bool, FLAGS_quic_enable_http3_grease_randomness, true)
-
-// If true, disable QUIC version h3-27.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_draft_27, false)
-
-// If true, server push will be allowed in QUIC versions using HTTP/3.
-QUIC_FLAG(bool, FLAGS_quic_enable_http3_server_push, false)
-
-// The divisor that controls how often MAX_STREAMS frames are sent.
-QUIC_FLAG(int32_t, FLAGS_quic_max_streams_window_divisor, 2)
-
-// If true, QUIC BBRv2\'s PROBE_BW mode will not reduce cwnd below
-// BDP+ack_height.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_bbr2_avoid_too_low_probe_bw_cwnd,
- false)
-
-// When true, the 1RTT and 2RTT connection options decrease the number of round
-// trips in BBRv2 STARTUP without a 25% bandwidth increase to 1 or 2 round trips
-// respectively.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_bbr2_fewer_startup_round_trips,
- false)
-
-// If true, support for IETF QUIC 0-rtt is enabled.
-QUIC_FLAG(bool, FLAGS_quic_restart_flag_quic_enable_zero_rtt_for_tls_v2, true)
-
-// If true, default on PTO which unifies TLP + RTO loss recovery.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_default_on_pto, false)
-
-// If true, the B2HI connection option limits reduction of inflight_hi to
-// (1-Beta)*CWND.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_bbr2_limit_inflight_hi, false)
-
-// If true, disable QUIC version h3-T050.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_t050, false)
-
-// If true, default-enable 5RTO blachole detection.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_default_enable_5rto_blackhole_detection2,
- true)
-
-// If true, disable QUIC version h3-29.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_draft_29, false)
-
-// If true, record the received min_ack_delay in transport parameters to QUIC
-// config.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_record_received_min_ack_delay,
- false)
-
-// If true, disable blackhole detection on server side.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_disable_server_blackhole_detection,
- false)
-
-// If true, when server is silently closing connections due to idle timeout,
-// serialize the connection close packets which will be added to time wait list.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_add_silent_idle_timeout, true)
-
-// When true, QUIC+TLS versions will send the key_update_not_yet_supported
-// transport parameter.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_send_key_update_not_yet_supported,
- true)
-
-// If true, QUIC will default enable MTU discovery, with a target of 1450 bytes.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_enable_mtu_discovery_at_server,
- false)
-
-// If true, while reading an IETF quic packet, start peer migration immediately
-// when detecting the existence of any non-probing frame instead of at the end
-// of the packet.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_start_peer_migration_earlier,
- false)
-
-// If true, neuter initial packet in the coalescer when discarding initial keys.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_neuter_initial_packet_in_coalescer_with_initial_key_discarded,
- true)
-
-// If true, convert bytes_left_for_batch_write_ to unsigned int.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_fix_bytes_left_for_batch_write,
- true)
-
-// If true, add missing connected checks.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_add_missing_connected_checks,
- true)
-
-// If true, QuicStream::kDefaultUrgency is 3, otherwise 1.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_http3_new_default_urgency_value,
- false)
-
-// If true, close connection on packet serialization failures
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_close_connection_on_serialization_failure,
- true)
-
-// If true, send PATH_RESPONSE upon receiving PATH_CHALLENGE regardless
-// of perspective.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_send_path_response, false)
-
-// If true, when switching from BBR to BBR2, use BBR's CWND as the initial CWND.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_copy_bbr_cwnd_to_bbr2, true)
-
-// If true, send the lowest stream ID that can be retried by the client in a
-// GOAWAY frame.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_fix_http3_goaway_stream_id,
- false)
-
-// If true, close connection if writer is still blocked when OnCanWrite is
-// called.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_close_connection_in_on_can_write_with_blocked_writer,
- true)
-
-// If true, include stream information in idle timeout connection close detail.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_add_stream_info_to_idle_close_detail,
- true)
-
-// If true, use IETF QUIC application error codes in STOP_SENDING frames.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_stop_sending_uses_ietf_error_code,
- true)
-
-// If true, QuicSpdySession's destructor won't need to do cleanup.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_clean_up_spdy_session_destructor,
- true)
-
-// If true, discard INITIAL packet if the key has been dropped.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_discard_initial_packet_with_key_dropped,
- true)
-
-// If true, disable QUIC version h3-T051.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_disable_version_t051, false)
-
-// If true, make sure there is pending timer credit when trying to PTO
-// retransmit any packets.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_fix_pto_pending_timer_count,
- true)
-
-// If true, QUIC connection will pass sent packet information to the debug
-// visitor after a packet is recorded as sent in sent packet manager.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_give_sent_packet_to_debug_visitor_after_sent,
- true)
-
-// If true, abort async QPACK header decompression in QuicSpdyStream::OnClose().
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_abort_qpack_on_stream_close,
- false)
-
-// If true, do not arm PTO for application data until handshake confirmed.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_fix_arm_pto_for_application_data,
- true)
-
-// If true, cap client suggested initial RTT to 1s if it is longer than 1s.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_cap_large_client_initial_rtt,
- true)
-
-// If true, fix a potential out of order sending caused by handshake gets
-// confirmed while the coalescer is not empty.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_fix_out_of_order_sending2, true)
-
-// If true, remove processed undecryptable packets.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_fix_undecryptable_packets2,
- true)
-
-// If true, QUIC BBRv2 will use inflight byte after congestion event to detect
-// queuing during PROBE_UP.
-QUIC_FLAG(
- bool,
- FLAGS_quic_reloadable_flag_quic_bbr2_use_post_inflight_to_detect_queuing,
- false)
-
-// If true, QUIC BBRv2 will use 15% inflight_hi headroom, which is the default
-// for TCP.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_bbr2_use_tcp_inflight_hi_headroom,
- false)
-
-// If true, HTTP/3 will treat HTTP/2 specific SETTINGS as error.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_reject_spdy_settings, false)
-
-// If true, discard 0-RTT keys after installing 1-RTT keys on the client side.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_postpone_discarding_zero_rtt_keys,
- true)
-
-// If true, for IETF QUIC, uses 2 * RTTVAR when calculating PTO delay.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_default_to_2_rttvar, true)
-
-// Deallocate data in QuicMessageFrame right after the corresponding packet is
-// sent.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_deallocate_message_right_after_sent,
- false)
-
-// If true, drop initial keys at the end of writing and unify the fixes for
-// missing initial keys.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_fix_missing_initial_keys2, true)
-
-// If true, check whether framer has the right key before writing data.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_check_keys_before_writing, true)
-
-// If true, received error codes larger than QUIC_LAST_ERROR are preserved.
-QUIC_FLAG(bool,
- FLAGS_quic_reloadable_flag_quic_do_not_clip_received_error_code,
- false)
-
-// If true, check for NULL before sending a fallback config.
-QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_check_fallback_null, true)
diff --git a/chromium/net/quic/quic_http3_logger.cc b/chromium/net/quic/quic_http3_logger.cc
index 552a5f576e5..7c9dd767d1f 100644
--- a/chromium/net/quic/quic_http3_logger.cc
+++ b/chromium/net/quic/quic_http3_logger.cc
@@ -365,7 +365,7 @@ void QuicHttp3Logger::OnDataFrameSent(quic::QuicStreamId stream_id,
void QuicHttp3Logger::OnHeadersFrameSent(
quic::QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock& header_block) {
+ const spdy::Http2HeaderBlock& header_block) {
if (!net_log_.IsCapturing()) {
return;
}
@@ -376,7 +376,7 @@ void QuicHttp3Logger::OnHeadersFrameSent(
dict.SetKey("stream_id",
NetLogNumberValue(static_cast<uint64_t>(stream_id)));
dict.SetKey("headers",
- ElideSpdyHeaderBlockForNetLog(header_block, capture_mode));
+ ElideHttp2HeaderBlockForNetLog(header_block, capture_mode));
return dict;
});
}
@@ -384,7 +384,7 @@ void QuicHttp3Logger::OnHeadersFrameSent(
void QuicHttp3Logger::OnPushPromiseFrameSent(
quic::QuicStreamId stream_id,
quic::QuicStreamId push_id,
- const spdy::SpdyHeaderBlock& header_block) {
+ const spdy::Http2HeaderBlock& header_block) {
if (!net_log_.IsCapturing()) {
return;
}
@@ -397,7 +397,7 @@ void QuicHttp3Logger::OnPushPromiseFrameSent(
dict.SetKey("push_id",
NetLogNumberValue(static_cast<uint64_t>(push_id)));
dict.SetKey("headers",
- ElideSpdyHeaderBlockForNetLog(header_block, capture_mode));
+ ElideHttp2HeaderBlockForNetLog(header_block, capture_mode));
return dict;
});
}
diff --git a/chromium/net/quic/quic_http3_logger.h b/chromium/net/quic/quic_http3_logger.h
index 36e24e2dc84..d0f90defd38 100644
--- a/chromium/net/quic/quic_http3_logger.h
+++ b/chromium/net/quic/quic_http3_logger.h
@@ -69,11 +69,11 @@ class NET_EXPORT_PRIVATE QuicHttp3Logger : public quic::Http3DebugVisitor {
void OnDataFrameSent(quic::QuicStreamId stream_id,
quic::QuicByteCount payload_length) override;
void OnHeadersFrameSent(quic::QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock& header_block) override;
+ const spdy::Http2HeaderBlock& header_block) override;
void OnPushPromiseFrameSent(
quic::QuicStreamId stream_id,
quic::QuicStreamId push_id,
- const spdy::SpdyHeaderBlock& header_block) override;
+ const spdy::Http2HeaderBlock& header_block) override;
private:
NetLogWithSource net_log_;
diff --git a/chromium/net/quic/quic_http_stream.cc b/chromium/net/quic/quic_http_stream.cc
index 41a46fbfd4a..41d98d619d4 100644
--- a/chromium/net/quic/quic_http_stream.cc
+++ b/chromium/net/quic/quic_http_stream.cc
@@ -598,7 +598,7 @@ int QuicHttpStream::DoSendHeaders() {
if (rv > 0)
headers_bytes_sent_ += rv;
- request_headers_ = spdy::SpdyHeaderBlock();
+ request_headers_ = spdy::Http2HeaderBlock();
return rv;
}
@@ -672,7 +672,7 @@ int QuicHttpStream::DoSendBodyComplete(int rv) {
}
int QuicHttpStream::ProcessResponseHeaders(
- const spdy::SpdyHeaderBlock& headers) {
+ const spdy::Http2HeaderBlock& headers) {
if (!SpdyHeadersToHttpResponse(headers, response_info_)) {
DLOG(WARNING) << "Invalid headers";
return ERR_QUIC_PROTOCOL_ERROR;
diff --git a/chromium/net/quic/quic_http_stream.h b/chromium/net/quic/quic_http_stream.h
index 5f56553d0c3..aa2bd7beaca 100644
--- a/chromium/net/quic/quic_http_stream.h
+++ b/chromium/net/quic/quic_http_stream.h
@@ -106,7 +106,7 @@ class NET_EXPORT_PRIVATE QuicHttpStream : public MultiplexedHttpStream {
int DoSendBodyComplete(int rv);
void OnReadResponseHeadersComplete(int rv);
- int ProcessResponseHeaders(const spdy::SpdyHeaderBlock& headers);
+ int ProcessResponseHeaders(const spdy::Http2HeaderBlock& headers);
void ReadTrailingHeaders();
void OnReadTrailingHeadersComplete(int rv);
@@ -172,12 +172,12 @@ class NET_EXPORT_PRIVATE QuicHttpStream : public MultiplexedHttpStream {
int response_status_;
// Serialized request headers.
- spdy::SpdyHeaderBlock request_headers_;
+ spdy::Http2HeaderBlock request_headers_;
- spdy::SpdyHeaderBlock response_header_block_;
+ spdy::Http2HeaderBlock response_header_block_;
bool response_headers_received_;
- spdy::SpdyHeaderBlock trailing_header_block_;
+ spdy::Http2HeaderBlock trailing_header_block_;
bool trailing_headers_received_;
// Number of bytes received by the headers stream on behalf of this stream.
diff --git a/chromium/net/quic/quic_http_stream_test.cc b/chromium/net/quic/quic_http_stream_test.cc
index cfec1ae1a20..e5ba6a40f2a 100644
--- a/chromium/net/quic/quic_http_stream_test.cc
+++ b/chromium/net/quic/quic_http_stream_test.cc
@@ -99,10 +99,10 @@ struct TestParams {
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
std::vector<TestParams> GetTestParams() {
@@ -165,6 +165,7 @@ class TestQuicConnection : public quic::QuicConnection {
QuicChromiumAlarmFactory* alarm_factory,
quic::QuicPacketWriter* writer)
: quic::QuicConnection(connection_id,
+ quic::QuicSocketAddress(),
ToQuicSocketAddress(address),
helper,
alarm_factory,
@@ -464,7 +465,7 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<TestParams>,
uint64_t packet_number,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return client_maker_.MakeDataPacket(packet_number, stream_id_,
should_include_version, fin, data);
}
@@ -473,7 +474,7 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<TestParams>,
uint64_t packet_number,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return server_maker_.MakeDataPacket(packet_number, stream_id_,
should_include_version, fin, data);
}
@@ -562,7 +563,7 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket> ConstructResponseTrailersPacket(
uint64_t packet_number,
bool fin,
- spdy::SpdyHeaderBlock trailers,
+ spdy::Http2HeaderBlock trailers,
size_t* spdy_headers_frame_length) {
return server_maker_.MakeResponseHeadersPacket(
packet_number, stream_id_, !kIncludeVersion, fin, std::move(trailers),
@@ -675,15 +676,15 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<TestParams>,
HttpRequestHeaders headers_;
HttpResponseInfo response_;
scoped_refptr<IOBufferWithSize> read_buffer_;
- spdy::SpdyHeaderBlock request_headers_;
- spdy::SpdyHeaderBlock response_headers_;
+ spdy::Http2HeaderBlock request_headers_;
+ spdy::Http2HeaderBlock response_headers_;
string request_data_;
string response_data_;
// For server push testing
std::unique_ptr<QuicHttpStream> promised_stream_;
- spdy::SpdyHeaderBlock push_promise_;
- spdy::SpdyHeaderBlock promised_response_;
+ spdy::Http2HeaderBlock push_promise_;
+ spdy::Http2HeaderBlock promised_response_;
const quic::QuicStreamId promise_id_;
string promise_url_;
const quic::QuicStreamId stream_id_;
@@ -932,7 +933,7 @@ TEST_P(QuicHttpStreamTest, GetRequestWithTrailers) {
std::string header = ConstructDataHeader(strlen(kResponseBody));
ProcessPacket(
ConstructServerDataPacket(3, false, !kFin, header + kResponseBody));
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
size_t spdy_trailers_frame_length;
trailers["foo"] = "bar";
if (!quic::VersionUsesHttp3(version_.transport_version)) {
diff --git a/chromium/net/quic/quic_http_utils.cc b/chromium/net/quic/quic_http_utils.cc
index 1faf58cce2f..5778a9de0cd 100644
--- a/chromium/net/quic/quic_http_utils.cc
+++ b/chromium/net/quic/quic_http_utils.cc
@@ -36,10 +36,10 @@ RequestPriority ConvertQuicPriorityToRequestPriority(
}
base::Value QuicRequestNetLogParams(quic::QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock* headers,
+ const spdy::Http2HeaderBlock* headers,
spdy::SpdyPriority priority,
NetLogCaptureMode capture_mode) {
- base::Value dict = SpdyHeaderBlockNetLogParams(headers, capture_mode);
+ base::Value dict = Http2HeaderBlockNetLogParams(headers, capture_mode);
DCHECK(dict.is_dict());
dict.SetIntKey("quic_priority", static_cast<int>(priority));
dict.SetIntKey("quic_stream_id", static_cast<int>(stream_id));
@@ -48,9 +48,9 @@ base::Value QuicRequestNetLogParams(quic::QuicStreamId stream_id,
base::Value QuicResponseNetLogParams(quic::QuicStreamId stream_id,
bool fin_received,
- const spdy::SpdyHeaderBlock* headers,
+ const spdy::Http2HeaderBlock* headers,
NetLogCaptureMode capture_mode) {
- base::Value dict = SpdyHeaderBlockNetLogParams(headers, capture_mode);
+ base::Value dict = Http2HeaderBlockNetLogParams(headers, capture_mode);
dict.SetIntKey("quic_stream_id", static_cast<int>(stream_id));
dict.SetBoolKey("fin", fin_received);
return dict;
diff --git a/chromium/net/quic/quic_http_utils.h b/chromium/net/quic/quic_http_utils.h
index 8fbe7270912..fac27774a34 100644
--- a/chromium/net/quic/quic_http_utils.h
+++ b/chromium/net/quic/quic_http_utils.h
@@ -23,19 +23,19 @@ NET_EXPORT_PRIVATE spdy::SpdyPriority ConvertRequestPriorityToQuicPriority(
NET_EXPORT_PRIVATE RequestPriority
ConvertQuicPriorityToRequestPriority(spdy::SpdyPriority priority);
-// Converts a spdy::SpdyHeaderBlock, stream_id and priority into NetLog event
+// Converts a spdy::Http2HeaderBlock, stream_id and priority into NetLog event
// parameters.
NET_EXPORT base::Value QuicRequestNetLogParams(
quic::QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock* headers,
+ const spdy::Http2HeaderBlock* headers,
spdy::SpdyPriority priority,
NetLogCaptureMode capture_mode);
-// Converts a spdy::SpdyHeaderBlock and stream into NetLog event parameters.
+// Converts a spdy::Http2HeaderBlock and stream into NetLog event parameters.
NET_EXPORT base::Value QuicResponseNetLogParams(
quic::QuicStreamId stream_id,
bool fin_received,
- const spdy::SpdyHeaderBlock* headers,
+ const spdy::Http2HeaderBlock* headers,
NetLogCaptureMode capture_mode);
// Parses |alt_svc_versions| into a quic::ParsedQuicVersionVector and removes
diff --git a/chromium/net/quic/quic_network_transaction_unittest.cc b/chromium/net/quic/quic_network_transaction_unittest.cc
index 070c574bc4f..82e9f2ffb0d 100644
--- a/chromium/net/quic/quic_network_transaction_unittest.cc
+++ b/chromium/net/quic/quic_network_transaction_unittest.cc
@@ -127,10 +127,10 @@ struct TestParams {
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
// Run QuicNetworkTransactionWithDestinationTest instances with all value
@@ -155,10 +155,10 @@ std::string PrintToString(const PoolingTestParams& p) {
destination_string = "DIFFERENT";
break;
}
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_", destination_string, "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_", destination_string, "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
std::string GenerateQuicAltSvcHeader(
@@ -485,31 +485,31 @@ class QuicNetworkTransactionTest
}
// Uses default QuicTestPacketMaker.
- spdy::SpdyHeaderBlock GetRequestHeaders(const std::string& method,
- const std::string& scheme,
- const std::string& path) {
+ spdy::Http2HeaderBlock GetRequestHeaders(const std::string& method,
+ const std::string& scheme,
+ const std::string& path) {
return GetRequestHeaders(method, scheme, path, client_maker_.get());
}
// Uses customized QuicTestPacketMaker.
- spdy::SpdyHeaderBlock GetRequestHeaders(const std::string& method,
- const std::string& scheme,
- const std::string& path,
- QuicTestPacketMaker* maker) {
+ spdy::Http2HeaderBlock GetRequestHeaders(const std::string& method,
+ const std::string& scheme,
+ const std::string& path,
+ QuicTestPacketMaker* maker) {
return maker->GetRequestHeaders(method, scheme, path);
}
- spdy::SpdyHeaderBlock ConnectRequestHeaders(const std::string& host_port) {
+ spdy::Http2HeaderBlock ConnectRequestHeaders(const std::string& host_port) {
return client_maker_->ConnectRequestHeaders(host_port);
}
- spdy::SpdyHeaderBlock GetResponseHeaders(const std::string& status) {
+ spdy::Http2HeaderBlock GetResponseHeaders(const std::string& status) {
return server_maker_.GetResponseHeaders(status);
}
// Appends alt_svc headers in the response headers.
- spdy::SpdyHeaderBlock GetResponseHeaders(const std::string& status,
- const std::string& alt_svc) {
+ spdy::Http2HeaderBlock GetResponseHeaders(const std::string& status,
+ const std::string& alt_svc) {
return server_maker_.GetResponseHeaders(status, alt_svc);
}
@@ -518,7 +518,7 @@ class QuicNetworkTransactionTest
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return server_maker_.MakeDataPacket(packet_number, stream_id,
should_include_version, fin, data);
}
@@ -528,7 +528,7 @@ class QuicNetworkTransactionTest
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return client_maker_->MakeDataPacket(packet_number, stream_id,
should_include_version, fin, data);
}
@@ -540,7 +540,7 @@ class QuicNetworkTransactionTest
uint64_t largest_received,
uint64_t smallest_received,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return client_maker_->MakeAckAndDataPacket(packet_number, include_version,
stream_id, largest_received,
smallest_received, fin, data);
@@ -551,7 +551,7 @@ class QuicNetworkTransactionTest
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
return ConstructClientRequestHeadersPacket(packet_number, stream_id,
should_include_version, fin,
std::move(headers), 0);
@@ -562,7 +562,7 @@ class QuicNetworkTransactionTest
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id) {
return ConstructClientRequestHeadersPacket(
packet_number, stream_id, should_include_version, fin, DEFAULT_PRIORITY,
@@ -575,7 +575,7 @@ class QuicNetworkTransactionTest
bool should_include_version,
bool fin,
RequestPriority request_priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id) {
spdy::SpdyPriority priority =
ConvertRequestPriorityToQuicPriority(request_priority);
@@ -591,7 +591,7 @@ class QuicNetworkTransactionTest
bool should_include_version,
bool fin,
RequestPriority request_priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id,
size_t* spdy_headers_frame_length,
const std::vector<std::string>& data_writes) {
@@ -608,7 +608,7 @@ class QuicNetworkTransactionTest
quic::QuicStreamId stream_id,
quic::QuicStreamId promised_stream_id,
bool should_include_version,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
return server_maker_.MakePushPromisePacket(
packet_number, stream_id, promised_stream_id, should_include_version,
false, std::move(headers), nullptr);
@@ -619,7 +619,7 @@ class QuicNetworkTransactionTest
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
return server_maker_.MakeResponseHeadersPacket(packet_number, stream_id,
should_include_version, fin,
std::move(headers), nullptr);
@@ -1205,6 +1205,12 @@ TEST_P(QuicNetworkTransactionTest, ForceQuic) {
NetLogEventPhase::NONE);
EXPECT_LT(0, pos);
+ // ... and also a TYPE_QUIC_SESSION_PACKET_SENT.
+ pos = ExpectLogContainsSomewhere(entries, 0,
+ NetLogEventType::QUIC_SESSION_PACKET_SENT,
+ NetLogEventPhase::NONE);
+ EXPECT_LT(0, pos);
+
// ... and also a TYPE_QUIC_SESSION_UNAUTHENTICATED_PACKET_HEADER_RECEIVED.
pos = ExpectLogContainsSomewhere(
entries, 0,
@@ -1257,7 +1263,7 @@ TEST_P(QuicNetworkTransactionTest, ResetOnEmptyResponseHeaders) {
const quic::QuicStreamId request_stream_id =
GetNthClientInitiatedBidirectionalStreamId(0);
- spdy::SpdyHeaderBlock empty_response_headers;
+ spdy::Http2HeaderBlock empty_response_headers;
const std::string response_data = server_maker_.QpackEncodeHeaders(
request_stream_id, std::move(empty_response_headers), nullptr);
uint64_t read_packet_num = 1;
@@ -1298,7 +1304,7 @@ TEST_P(QuicNetworkTransactionTest, LargeResponseHeaders) {
ConstructClientRequestHeadersPacket(
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
true, GetRequestHeaders("GET", "https", "/")));
- spdy::SpdyHeaderBlock response_headers = GetResponseHeaders("200 OK");
+ spdy::Http2HeaderBlock response_headers = GetResponseHeaders("200 OK");
response_headers["key1"] = std::string(30000, 'A');
response_headers["key2"] = std::string(30000, 'A');
response_headers["key3"] = std::string(30000, 'A');
@@ -1370,7 +1376,7 @@ TEST_P(QuicNetworkTransactionTest, TooLargeResponseHeaders) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
true, GetRequestHeaders("GET", "https", "/")));
- spdy::SpdyHeaderBlock response_headers = GetResponseHeaders("200 OK");
+ spdy::Http2HeaderBlock response_headers = GetResponseHeaders("200 OK");
response_headers["key1"] = std::string(30000, 'A');
response_headers["key2"] = std::string(30000, 'A');
response_headers["key3"] = std::string(30000, 'A');
@@ -3117,11 +3123,6 @@ TEST_P(QuicNetworkTransactionTest,
// Verify that if a QUIC connection times out, the QuicHttpStream will
// return QUIC_PROTOCOL_ERROR.
TEST_P(QuicNetworkTransactionTest, TimeoutAfterHandshakeConfirmed) {
- if (version_.UsesTls()) {
- // QUIC with TLS1.3 handshake doesn't support 0-rtt.
- return;
- }
-
context_.params()->retry_without_alt_svc_on_quic_errors = false;
context_.params()->idle_connection_timeout = base::TimeDelta::FromSeconds(5);
@@ -3146,27 +3147,50 @@ TEST_P(QuicNetworkTransactionTest, TimeoutAfterHandshakeConfirmed) {
client_maker_->SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
if (VersionUsesHttp3(version_.transport_version)) {
- // TLP 1
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 1
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
- // TLP 2
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 2
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
2, packet_num++, true));
- // RTO 1
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 3
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
- quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
- 2, packet_num++, true));
- // RTO 2
+
+ quic_data.AddWrite(SYNCHRONOUS,
+ client_maker_->MakeConnectionClosePacket(
+ packet_num++, true, quic::QUIC_NETWORK_IDLE_TIMEOUT,
+ "No recent network activity after 4s. Timeout:4s"));
+ } else if (version_.UsesTls()) {
+ // Settings were sent in the request packet so there is only 1 packet to
+ // retransmit.
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 1
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
- quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
- 2, packet_num++, true));
- // RTO 3
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 2
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 3
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
- 2, packet_num++, true));
+ 1, packet_num++, true));
quic_data.AddWrite(SYNCHRONOUS,
client_maker_->MakeConnectionClosePacket(
@@ -3316,11 +3340,6 @@ TEST_P(QuicNetworkTransactionTest, ProtocolErrorAfterHandshakeConfirmed) {
// connection times out, then QUIC will be marked as broken and the request
// retried over TCP.
TEST_P(QuicNetworkTransactionTest, TimeoutAfterHandshakeConfirmedThenBroken2) {
- if (version_.UsesTls()) {
- // QUIC with TLS1.3 handshake doesn't support 0-rtt.
- return;
- }
-
context_.params()->idle_connection_timeout = base::TimeDelta::FromSeconds(5);
// The request will initially go out over QUIC.
@@ -3343,27 +3362,52 @@ TEST_P(QuicNetworkTransactionTest, TimeoutAfterHandshakeConfirmedThenBroken2) {
client_maker_->SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
if (VersionUsesHttp3(version_.transport_version)) {
- // TLP 1
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 1
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
- // TLP 2
+
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 2
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
2, packet_num++, true));
- // RTO 1
+
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 3
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
- quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
- 2, packet_num++, true));
- // RTO 2
+
+ quic_data.AddWrite(SYNCHRONOUS,
+ client_maker_->MakeConnectionClosePacket(
+ packet_num++, true, quic::QUIC_NETWORK_IDLE_TIMEOUT,
+ "No recent network activity after 4s. Timeout:4s"));
+ } else if (version_.UsesTls()) {
+ // Settings were sent in the request packet so there is only 1 packet to
+ // retransmit.
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 1
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
- quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
- 2, packet_num++, true));
- // RTO 3
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 2
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
1, packet_num++, true));
+ // QuicConnection::OnRetransmissionTimeout skips a packet number when
+ // sending PTO packets.
+ packet_num++;
+ // PTO 3
quic_data.AddWrite(SYNCHRONOUS, client_maker_->MakeRetransmissionPacket(
- 2, packet_num++, true));
+ 1, packet_num++, true));
quic_data.AddWrite(SYNCHRONOUS,
client_maker_->MakeConnectionClosePacket(
@@ -3560,11 +3604,6 @@ TEST_P(QuicNetworkTransactionTest,
// Much like above test, but verifies that NetworkIsolationKey is respected.
TEST_P(QuicNetworkTransactionTest,
ProtocolErrorAfterHandshakeConfirmedThenBrokenWithNetworkIsolationKey) {
- if (version_.UsesTls()) {
- // QUIC with TLS1.3 handshake doesn't support 0-rtt.
- return;
- }
-
const url::Origin kOrigin1 = url::Origin::Create(GURL("https://foo.test/"));
const net::NetworkIsolationKey kNetworkIsolationKey1(kOrigin1, kOrigin1);
const url::Origin kOrigin2 = url::Origin::Create(GURL("https://bar.test/"));
@@ -3606,9 +3645,13 @@ TEST_P(QuicNetworkTransactionTest,
1, false, GetNthClientInitiatedBidirectionalStreamId(47),
quic::QUIC_STREAM_LAST_ERROR));
std::string quic_error_details = "Data for nonexistent stream";
+ quic::QuicErrorCode quic_error_code = quic::QUIC_INVALID_STREAM_ID;
+ if (version_.HasIetfQuicFrames()) {
+ quic_error_code = quic::QUIC_HTTP_STREAM_WRONG_DIRECTION;
+ }
quic_data.AddWrite(SYNCHRONOUS,
ConstructClientAckAndConnectionClosePacket(
- packet_number++, 1, 1, quic::QUIC_INVALID_STREAM_ID,
+ packet_number++, 1, 1, quic_error_code,
quic_error_details, quic::IETF_RST_STREAM));
quic_data.AddSocketDataToFactory(&socket_factory_);
@@ -4734,11 +4777,6 @@ TEST_P(QuicNetworkTransactionTest, HungAlternativeService) {
}
TEST_P(QuicNetworkTransactionTest, ZeroRTTWithHttpRace) {
- if (version_.UsesTls()) {
- // QUIC with TLS1.3 handshake doesn't support 0-rtt.
- return;
- }
-
MockQuicData mock_quic_data(version_);
client_maker_->SetEncryptionLevel(quic::ENCRYPTION_ZERO_RTT);
int packet_num = 1;
@@ -4759,6 +4797,9 @@ TEST_P(QuicNetworkTransactionTest, ZeroRTTWithHttpRace) {
ASYNC, ConstructServerDataPacket(
2, GetNthClientInitiatedBidirectionalStreamId(0), false, true,
ConstructDataFrame("hello!")));
+ if (version_.UsesTls()) {
+ client_maker_->SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
+ }
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructClientAckPacket(packet_num++, 2, 1));
mock_quic_data.AddRead(ASYNC, ERR_IO_PENDING); // No more data to read
@@ -4780,11 +4821,6 @@ TEST_P(QuicNetworkTransactionTest, ZeroRTTWithHttpRace) {
}
TEST_P(QuicNetworkTransactionTest, ZeroRTTWithNoHttpRace) {
- if (version_.UsesTls()) {
- // QUIC with TLS1.3 handshake doesn't support 0-rtt.
- return;
- }
-
MockQuicData mock_quic_data(version_);
client_maker_->SetEncryptionLevel(quic::ENCRYPTION_ZERO_RTT);
int packet_number = 1;
@@ -4805,6 +4841,9 @@ TEST_P(QuicNetworkTransactionTest, ZeroRTTWithNoHttpRace) {
ASYNC, ConstructServerDataPacket(
2, GetNthClientInitiatedBidirectionalStreamId(0), false, true,
ConstructDataFrame("hello!")));
+ if (version_.UsesTls()) {
+ client_maker_->SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
+ }
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructClientAckPacket(packet_number++, 2, 1));
mock_quic_data.AddRead(ASYNC, ERR_IO_PENDING); // No more data to read
@@ -5517,11 +5556,6 @@ TEST_P(QuicNetworkTransactionTest, NoBrokenAlternateProtocolIfTcpFails) {
}
TEST_P(QuicNetworkTransactionTest, DelayTCPOnStartWithQuicSupportOnSameIP) {
- if (version_.UsesTls()) {
- // QUIC with TLS1.3 handshake doesn't support 0-rtt.
- return;
- }
-
// Tests that TCP job is delayed and QUIC job does not require confirmation
// if QUIC was recently supported on the same IP on start.
@@ -5551,6 +5585,9 @@ TEST_P(QuicNetworkTransactionTest, DelayTCPOnStartWithQuicSupportOnSameIP) {
ASYNC, ConstructServerDataPacket(
2, GetNthClientInitiatedBidirectionalStreamId(0), false, true,
ConstructDataFrame("hello!")));
+ if (version_.UsesTls()) {
+ client_maker_->SetEncryptionLevel(quic::ENCRYPTION_FORWARD_SECURE);
+ }
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructClientAckPacket(packet_number++, 2, 1));
mock_quic_data.AddRead(ASYNC, ERR_IO_PENDING); // No more data to read
@@ -5731,11 +5768,6 @@ TEST_P(QuicNetworkTransactionTest, FailedZeroRttBrokenAlternateProtocol) {
TEST_P(QuicNetworkTransactionTest,
FailedZeroRttBrokenAlternateProtocolWithNetworkIsolationKey) {
- if (version_.UsesTls()) {
- // QUIC with TLS1.3 handshake doesn't support 0-rtt.
- return;
- }
-
base::test::ScopedFeatureList feature_list;
feature_list.InitWithFeatures(
// enabled_features
@@ -5800,31 +5832,6 @@ TEST_P(QuicNetworkTransactionTest,
ExpectQuicAlternateProtocolMapping(kNetworkIsolationKey2);
}
-TEST_P(QuicNetworkTransactionTest, DISABLED_HangingZeroRttFallback) {
- // Alternate-protocol job
- MockRead quic_reads[] = {
- MockRead(SYNCHRONOUS, ERR_IO_PENDING),
- };
- StaticSocketDataProvider quic_data(quic_reads, base::span<MockWrite>());
- socket_factory_.AddSocketDataProvider(&quic_data);
-
- // Main job that will proceed when the QUIC job fails.
- MockRead http_reads[] = {
- MockRead("HTTP/1.1 200 OK\r\n\r\n"), MockRead("hello from http"),
- MockRead(SYNCHRONOUS, ERR_TEST_PEER_CLOSE_AFTER_NEXT_MOCK_READ),
- MockRead(ASYNC, OK)};
-
- StaticSocketDataProvider http_data(http_reads, base::span<MockWrite>());
- socket_factory_.AddSocketDataProvider(&http_data);
-
- AddHangingNonAlternateProtocolSocketData();
- CreateSession();
-
- AddQuicAlternateProtocolMapping(MockCryptoClientStream::ZERO_RTT);
-
- SendRequestAndExpectHttpResponse("hello from http");
-}
-
TEST_P(QuicNetworkTransactionTest, BrokenAlternateProtocolOnConnectFailure) {
// Alternate-protocol job will fail before creating a QUIC session.
StaticSocketDataProvider quic_data;
@@ -6217,9 +6224,9 @@ TEST_P(QuicNetworkTransactionTest, NoMigrationForMsgTooBig) {
context_.params()->retry_without_alt_svc_on_quic_errors = false;
context_.params()->origins_to_force_quic_on.insert(
HostPortPair::FromString("mail.example.org:443"));
- const std::string error_details =
- quiche::QuicheStrCat("Write failed with error: ", ERR_MSG_TOO_BIG, " (",
- strerror(ERR_MSG_TOO_BIG), ")");
+ const std::string error_details = base::StrCat(
+ {"Write failed with error: ", base::NumberToString(ERR_MSG_TOO_BIG), " (",
+ strerror(ERR_MSG_TOO_BIG), ")"});
MockQuicData socket_data(version_);
socket_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
@@ -6773,7 +6780,7 @@ TEST_P(QuicNetworkTransactionTest, RawHeaderSizeSuccessfullRequest) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
}
- spdy::SpdyHeaderBlock headers(GetRequestHeaders("GET", "https", "/"));
+ spdy::Http2HeaderBlock headers(GetRequestHeaders("GET", "https", "/"));
headers["user-agent"] = "";
headers["accept-encoding"] = "gzip, deflate";
mock_quic_data.AddWrite(
@@ -6846,7 +6853,7 @@ TEST_P(QuicNetworkTransactionTest, RawHeaderSizeSuccessfullPushHeadersFirst) {
mock_quic_data.AddWrite(
SYNCHRONOUS, ConstructInitialSettingsPacket(client_packet_number++));
}
- spdy::SpdyHeaderBlock headers(GetRequestHeaders("GET", "https", "/"));
+ spdy::Http2HeaderBlock headers(GetRequestHeaders("GET", "https", "/"));
headers["user-agent"] = "";
headers["accept-encoding"] = "gzip, deflate";
mock_quic_data.AddWrite(
@@ -7132,7 +7139,7 @@ class QuicNetworkTransactionWithDestinationTest
QuicTestPacketMaker* maker) {
spdy::SpdyPriority priority =
ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
maker->GetRequestHeaders("GET", "https", "/"));
return maker->MakeRequestHeadersPacket(
packet_number, stream_id, should_include_version, true, priority,
@@ -7152,7 +7159,7 @@ class QuicNetworkTransactionWithDestinationTest
ConstructServerResponseHeadersPacket(uint64_t packet_number,
quic::QuicStreamId stream_id,
QuicTestPacketMaker* maker) {
- spdy::SpdyHeaderBlock headers(maker->GetResponseHeaders("200 OK"));
+ spdy::Http2HeaderBlock headers(maker->GetResponseHeaders("200 OK"));
return maker->MakeResponseHeadersPacket(packet_number, stream_id, false,
false, std::move(headers), nullptr);
}
@@ -7663,7 +7670,7 @@ TEST_P(QuicNetworkTransactionTest, QuicServerPushWithEmptyHostname) {
client_maker_->set_max_allowed_push_id(quic::kMaxQuicStreamId);
context_.params()->max_allowed_push_id = quic::kMaxQuicStreamId;
- spdy::SpdyHeaderBlock pushed_request_headers;
+ spdy::Http2HeaderBlock pushed_request_headers;
pushed_request_headers[":authority"] = "";
pushed_request_headers[":method"] = "GET";
pushed_request_headers[":path"] = "/";
@@ -7741,12 +7748,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectHttpsServer) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -7754,7 +7755,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectHttpsServer) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
mock_quic_data.AddRead(
@@ -7837,12 +7838,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectSpdyServer) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -7850,7 +7845,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectSpdyServer) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
mock_quic_data.AddRead(
@@ -7937,12 +7932,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectReuseTransportSocket) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(
SYNCHRONOUS, ConstructInitialSettingsPacket(write_packet_index++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- write_packet_index++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -7950,7 +7939,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectReuseTransportSocket) {
write_packet_index++, GetNthClientInitiatedBidirectionalStreamId(0),
true, false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
mock_quic_data.AddRead(
@@ -8070,12 +8059,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectReuseQuicSession) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
// CONNECT request and response for first request
@@ -8085,7 +8068,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectReuseQuicSession) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
mock_quic_data.AddRead(
@@ -8119,21 +8102,13 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectReuseQuicSession) {
ConstructClientAckPacket(packet_num++, 3, 2));
// CONNECT request and response for second request
- if (VersionUsesHttp3(version_.transport_version)) {
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(1), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
- }
mock_quic_data.AddWrite(
SYNCHRONOUS,
ConstructClientRequestHeadersPacket(
packet_num++, GetNthClientInitiatedBidirectionalStreamId(1), false,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("different.example.org:443"),
GetNthClientInitiatedBidirectionalStreamId(0)));
@@ -8244,12 +8219,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectFailure) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -8257,7 +8226,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectFailure) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
mock_quic_data.AddRead(
@@ -8301,12 +8270,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyQuicConnectionError) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -8314,7 +8277,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyQuicConnectionError) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
mock_quic_data.AddRead(ASYNC, ERR_CONNECTION_FAILED);
@@ -8348,12 +8311,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectBadCertificate) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -8361,7 +8318,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectBadCertificate) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
mock_quic_data.AddRead(
@@ -8386,22 +8343,13 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyConnectBadCertificate) {
quic::QUIC_STREAM_CANCELLED, 1, 1));
}
- if (VersionUsesHttp3(version_.transport_version)) {
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(1), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
- }
-
mock_quic_data.AddWrite(
SYNCHRONOUS,
ConstructClientRequestHeadersPacket(
packet_num++, GetNthClientInitiatedBidirectionalStreamId(1), false,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"),
GetNthClientInitiatedBidirectionalStreamId(0)));
@@ -8498,15 +8446,10 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyUserAgent) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
- spdy::SpdyHeaderBlock headers = ConnectRequestHeaders("mail.example.org:443");
+ spdy::Http2HeaderBlock headers =
+ ConnectRequestHeaders("mail.example.org:443");
headers["user-agent"] = kConfiguredUserAgent;
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -8514,7 +8457,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyUserAgent) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
std::move(headers), 0));
// Return an error, so the transaction stops here (this test isn't interested
@@ -8557,12 +8500,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyRequestPriority) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(SYNCHRONOUS,
ConstructInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker_->MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
SYNCHRONOUS,
@@ -8570,7 +8507,7 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyRequestPriority) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? MEDIUM
+ ? DEFAULT_PRIORITY
: HttpProxyConnectJob::kH2QuicTunnelPriority,
ConnectRequestHeaders("mail.example.org:443"), 0));
// Return an error, so the transaction stops here (this test isn't interested
@@ -8698,12 +8635,6 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyAuth) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data.AddWrite(
SYNCHRONOUS, client_maker.MakeInitialSettingsPacket(packet_num++));
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker.MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data.AddWrite(
@@ -8712,13 +8643,13 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyAuth) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? 1
+ ? quic::QuicStream::kDefaultUrgency
: ConvertRequestPriorityToQuicPriority(
HttpProxyConnectJob::kH2QuicTunnelPriority),
client_maker.ConnectRequestHeaders("mail.example.org:443"), 0,
nullptr));
- spdy::SpdyHeaderBlock headers =
+ spdy::Http2HeaderBlock headers =
server_maker.GetResponseHeaders("407 Proxy Authentication Required");
headers["proxy-authenticate"] = "Basic realm=\"MyRealm1\"";
headers["content-length"] = "10";
@@ -8760,21 +8691,13 @@ TEST_P(QuicNetworkTransactionTest, QuicProxyAuth) {
headers = client_maker.ConnectRequestHeaders("mail.example.org:443");
headers["proxy-authorization"] = "Basic Zm9vOmJheg==";
- if (VersionUsesHttp3(version_.transport_version)) {
- mock_quic_data.AddWrite(
- SYNCHRONOUS, client_maker.MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(1), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
- }
mock_quic_data.AddWrite(
SYNCHRONOUS,
client_maker.MakeRequestHeadersPacket(
packet_num++, GetNthClientInitiatedBidirectionalStreamId(1), false,
false,
VersionUsesHttp3(version_.transport_version)
- ? 1
+ ? quic::QuicStream::kDefaultUrgency
: ConvertRequestPriorityToQuicPriority(
HttpProxyConnectJob::kH2QuicTunnelPriority),
std::move(headers), GetNthClientInitiatedBidirectionalStreamId(0),
@@ -9403,12 +9326,6 @@ TEST_P(QuicNetworkTransactionTest, NetworkIsolationTunnel) {
if (VersionUsesHttp3(version_.transport_version)) {
mock_quic_data[index]->AddWrite(
SYNCHRONOUS, client_maker.MakeInitialSettingsPacket(packet_num++));
- mock_quic_data[index]->AddWrite(
- SYNCHRONOUS, client_maker.MakePriorityPacket(
- packet_num++, true,
- GetNthClientInitiatedBidirectionalStreamId(0), 0,
- ConvertRequestPriorityToQuicPriority(
- HttpProxyConnectJob::kH2QuicTunnelPriority)));
}
mock_quic_data[index]->AddWrite(
@@ -9417,7 +9334,7 @@ TEST_P(QuicNetworkTransactionTest, NetworkIsolationTunnel) {
packet_num++, GetNthClientInitiatedBidirectionalStreamId(0), true,
false,
VersionUsesHttp3(version_.transport_version)
- ? 1
+ ? quic::QuicStream::kDefaultUrgency
: ConvertRequestPriorityToQuicPriority(
HttpProxyConnectJob::kH2QuicTunnelPriority),
ConnectRequestHeaders("mail.example.org:443"), 0, nullptr));
@@ -9721,10 +9638,9 @@ TEST_P(QuicNetworkTransactionTest, IncorrectHttp3GoAway) {
quic::QuicUtils::GetFirstUnidirectionalStreamId(
version_.transport_version, quic::Perspective::IS_SERVER);
mock_quic_data.AddRead(
- ASYNC,
- ConstructServerDataPacket(
- read_packet_number++, control_stream_id, false, false,
- quiche::QuicheStringPiece(goaway_buffer.get(), goaway_length)));
+ ASYNC, ConstructServerDataPacket(
+ read_packet_number++, control_stream_id, false, false,
+ absl::string_view(goaway_buffer.get(), goaway_length)));
mock_quic_data.AddWrite(
SYNCHRONOUS,
ConstructClientAckAndConnectionClosePacket(
@@ -9798,10 +9714,9 @@ TEST_P(QuicNetworkTransactionTest, RetryOnHttp3GoAway) {
quic::QuicUtils::GetFirstUnidirectionalStreamId(
version_.transport_version, quic::Perspective::IS_SERVER);
mock_quic_data1.AddRead(
- ASYNC,
- ConstructServerDataPacket(
- read_packet_number1++, control_stream_id, false, false,
- quiche::QuicheStringPiece(goaway_buffer.get(), goaway_length)));
+ ASYNC, ConstructServerDataPacket(
+ read_packet_number1++, control_stream_id, false, false,
+ absl::string_view(goaway_buffer.get(), goaway_length)));
mock_quic_data1.AddWrite(
ASYNC, ConstructClientAckPacket(write_packet_number1++, 2, 1));
diff --git a/chromium/net/quic/quic_proxy_client_socket.cc b/chromium/net/quic/quic_proxy_client_socket.cc
index 45597a3df5c..da92002f815 100644
--- a/chromium/net/quic/quic_proxy_client_socket.cc
+++ b/chromium/net/quic/quic_proxy_client_socket.cc
@@ -8,7 +8,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/values.h"
#include "net/base/proxy_delegate.h"
@@ -368,7 +367,7 @@ int QuicProxyClientSocket::DoSendRequest() {
NetLogEventType::HTTP_TRANSACTION_SEND_TUNNEL_HEADERS,
request_line, &request_.extra_headers);
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
CreateSpdyHeadersFromHttpRequest(request_, request_.extra_headers, &headers);
return stream_->WriteHeaders(std::move(headers), false, nullptr);
@@ -444,7 +443,7 @@ int QuicProxyClientSocket::DoReadReplyComplete(int result) {
}
void QuicProxyClientSocket::OnReadResponseHeadersComplete(int result) {
- // Convert the now-populated spdy::SpdyHeaderBlock to HttpResponseInfo
+ // Convert the now-populated spdy::Http2HeaderBlock to HttpResponseInfo
if (result > 0)
result = ProcessResponseHeaders(response_header_block_);
@@ -453,7 +452,7 @@ void QuicProxyClientSocket::OnReadResponseHeadersComplete(int result) {
}
int QuicProxyClientSocket::ProcessResponseHeaders(
- const spdy::SpdyHeaderBlock& headers) {
+ const spdy::Http2HeaderBlock& headers) {
if (!SpdyHeadersToHttpResponse(headers, &response_)) {
DLOG(WARNING) << "Invalid headers";
return ERR_QUIC_PROTOCOL_ERROR;
diff --git a/chromium/net/quic/quic_proxy_client_socket.h b/chromium/net/quic/quic_proxy_client_socket.h
index a65d0cc4bbb..070ef3758b0 100644
--- a/chromium/net/quic/quic_proxy_client_socket.h
+++ b/chromium/net/quic/quic_proxy_client_socket.h
@@ -98,7 +98,7 @@ class NET_EXPORT_PRIVATE QuicProxyClientSocket : public ProxyClientSocket {
// Callback for stream_->ReadInitialHeaders()
void OnReadResponseHeadersComplete(int result);
- int ProcessResponseHeaders(const spdy::SpdyHeaderBlock& headers);
+ int ProcessResponseHeaders(const spdy::Http2HeaderBlock& headers);
int DoLoop(int last_io_result);
int DoGenerateAuthToken();
@@ -131,7 +131,7 @@ class NET_EXPORT_PRIVATE QuicProxyClientSocket : public ProxyClientSocket {
HttpRequestInfo request_;
HttpResponseInfo response_;
- spdy::SpdyHeaderBlock response_header_block_;
+ spdy::Http2HeaderBlock response_header_block_;
// The hostname and port of the endpoint. This is not necessarily the one
// specified by the URL, due to Alternate-Protocol or fixed testing ports.
diff --git a/chromium/net/quic/quic_proxy_client_socket_unittest.cc b/chromium/net/quic/quic_proxy_client_socket_unittest.cc
index 2876669c8e9..0102c631702 100644
--- a/chromium/net/quic/quic_proxy_client_socket_unittest.cc
+++ b/chromium/net/quic/quic_proxy_client_socket_unittest.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
#include "base/run_loop.h"
+#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_tick_clock.h"
@@ -90,10 +91,10 @@ struct TestParams {
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
std::vector<TestParams> GetTestParams() {
@@ -227,7 +228,8 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
QuicChromiumPacketWriter* writer = new QuicChromiumPacketWriter(
socket.get(), base::ThreadTaskRunnerHandle::Get().get());
quic::QuicConnection* connection = new quic::QuicConnection(
- connection_id_, net::ToQuicSocketAddress(peer_addr_), helper_.get(),
+ connection_id_, quic::QuicSocketAddress(),
+ net::ToQuicSocketAddress(peer_addr_), helper_.get(),
alarm_factory_.get(), writer, true /* owns_writer */,
quic::Perspective::IS_CLIENT, quic::test::SupportedVersions(version_));
connection->set_visitor(&visitor_);
@@ -316,7 +318,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
session_->StartReading();
}
- void PopulateConnectRequestIR(spdy::SpdyHeaderBlock* block) {
+ void PopulateConnectRequestIR(spdy::Http2HeaderBlock* block) {
(*block)[":method"] = "CONNECT";
(*block)[":authority"] = endpoint_host_port_.ToString();
(*block)["user-agent"] = kUserAgent;
@@ -362,11 +364,8 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket> ConstructConnectRequestPacket(
uint64_t packet_number,
RequestPriority request_priority = LOWEST) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectRequestIR(&block);
- if (VersionUsesHttp3(version_.transport_version)) {
- request_priority = MEDIUM;
- }
return client_maker_.MakeRequestHeadersPacket(
packet_number, client_data_stream_id1_, kIncludeVersion, !kFin,
ConvertRequestPriorityToQuicPriority(request_priority),
@@ -378,15 +377,12 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
uint64_t packet_number,
std::vector<std::pair<std::string, std::string>> extra_headers,
RequestPriority request_priority = LOWEST) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[":method"] = "CONNECT";
block[":authority"] = endpoint_host_port_.ToString();
for (const auto& header : extra_headers) {
block[header.first] = header.second;
}
- if (VersionUsesHttp3(version_.transport_version)) {
- request_priority = MEDIUM;
- }
return client_maker_.MakeRequestHeadersPacket(
packet_number, client_data_stream_id1_, kIncludeVersion, !kFin,
ConvertRequestPriorityToQuicPriority(request_priority),
@@ -396,10 +392,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket> ConstructConnectAuthRequestPacket(
uint64_t packet_number) {
RequestPriority request_priority = LOWEST;
- if (VersionUsesHttp3(version_.transport_version)) {
- request_priority = MEDIUM;
- }
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectRequestIR(&block);
block["proxy-authorization"] = "Basic Zm9vOmJhcg==";
return client_maker_.MakeRequestHeadersPacket(
@@ -410,7 +403,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket> ConstructDataPacket(
uint64_t packet_number,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return client_maker_.MakeDataPacket(packet_number, client_data_stream_id1_,
!kIncludeVersion, !kFin, data);
}
@@ -419,7 +412,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
uint64_t packet_number,
uint64_t largest_received,
uint64_t smallest_received,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return client_maker_.MakeAckAndDataPacket(
packet_number, !kIncludeVersion, client_data_stream_id1_,
largest_received, smallest_received, !kFin, data);
@@ -445,14 +438,14 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket> ConstructServerDataPacket(
uint64_t packet_number,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return server_maker_.MakeDataPacket(packet_number, client_data_stream_id1_,
!kIncludeVersion, !kFin, data);
}
std::unique_ptr<quic::QuicReceivedPacket> ConstructServerDataFinPacket(
uint64_t packet_number,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return server_maker_.MakeDataPacket(packet_number, client_data_stream_id1_,
!kIncludeVersion, kFin, data);
}
@@ -461,7 +454,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
uint64_t packet_number,
bool fin,
size_t* header_length = nullptr) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[":status"] = "200";
return server_maker_.MakeResponseHeadersPacket(
@@ -474,7 +467,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
uint64_t packet_number,
bool fin,
std::vector<std::pair<std::string, std::string>> extra_headers) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[":status"] = "200";
for (const auto& header : extra_headers) {
block[header.first] = header.second;
@@ -487,7 +480,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket>
ConstructServerConnectAuthReplyPacket(uint64_t packet_number, bool fin) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[":status"] = "407";
block["proxy-authenticate"] = "Basic realm=\"MyRealm1\"";
return server_maker_.MakeResponseHeadersPacket(
@@ -497,7 +490,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket>
ConstructServerConnectRedirectReplyPacket(uint64_t packet_number, bool fin) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[":status"] = "302";
block["location"] = kRedirectUrl;
block["set-cookie"] = "foo=bar";
@@ -508,7 +501,7 @@ class QuicProxyClientSocketTest : public ::testing::TestWithParam<TestParams>,
std::unique_ptr<quic::QuicReceivedPacket>
ConstructServerConnectErrorReplyPacket(uint64_t packet_number, bool fin) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[":status"] = "500";
return server_maker_.MakeResponseHeadersPacket(
diff --git a/chromium/net/quic/quic_stream_factory.cc b/chromium/net/quic/quic_stream_factory.cc
index ad845cba168..bb888cf7f62 100644
--- a/chromium/net/quic/quic_stream_factory.cc
+++ b/chromium/net/quic/quic_stream_factory.cc
@@ -1117,7 +1117,7 @@ QuicStreamFactory::QuicStreamFactory(
DCHECK(transport_security_state_);
DCHECK(http_server_properties_);
if (params_.disable_tls_zero_rtt)
- SetQuicRestartFlag(quic_enable_zero_rtt_for_tls_v2, false);
+ SetQuicFlag(FLAGS_quic_disable_client_tls_zero_rtt, true);
InitializeMigrationOptions();
}
@@ -1462,6 +1462,9 @@ std::unique_ptr<DatagramClientSocket> QuicStreamFactory::CreateSocket(
DatagramSocket::DEFAULT_BIND, net_log, source);
if (params_.enable_socket_recv_optimization)
socket->EnableRecvOptimization();
+ if (params_.ios_network_service_type > 0) {
+ socket->SetIOSNetworkServiceType(params_.ios_network_service_type);
+ }
return socket;
}
@@ -1774,8 +1777,8 @@ int QuicStreamFactory::CreateSession(
QuicChromiumPacketWriter* writer =
new QuicChromiumPacketWriter(socket.get(), task_runner_);
quic::QuicConnection* connection = new quic::QuicConnection(
- connection_id, ToQuicSocketAddress(addr), helper_.get(),
- alarm_factory_.get(), writer, true /* owns_writer */,
+ connection_id, quic::QuicSocketAddress(), ToQuicSocketAddress(addr),
+ helper_.get(), alarm_factory_.get(), writer, true /* owns_writer */,
quic::Perspective::IS_CLIENT, {quic_version});
connection->set_ping_timeout(ping_timeout_);
connection->SetMaxPacketLength(params_.max_packet_length);
diff --git a/chromium/net/quic/quic_stream_factory_test.cc b/chromium/net/quic/quic_stream_factory_test.cc
index 738945303b2..5461653adbf 100644
--- a/chromium/net/quic/quic_stream_factory_test.cc
+++ b/chromium/net/quic/quic_stream_factory_test.cc
@@ -12,6 +12,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/run_loop.h"
+#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -118,10 +119,10 @@ struct TestParams {
// Used by ::testing::PrintToStringParamName().
std::string PrintToString(const TestParams& p) {
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
std::vector<TestParams> GetTestParams() {
@@ -157,10 +158,10 @@ std::string PrintToString(const PoolingTestParams& p) {
destination_string = "DIFFERENT";
break;
}
- return quiche::QuicheStrCat(
- ParsedQuicVersionToString(p.version), "_", destination_string, "_",
- (p.client_headers_include_h2_stream_dependency ? "" : "No"),
- "Dependency");
+ return base::StrCat(
+ {ParsedQuicVersionToString(p.version), "_", destination_string, "_",
+ (p.client_headers_include_h2_stream_dependency ? "" : "No"),
+ "Dependency"});
}
std::vector<PoolingTestParams> GetPoolingTestParams() {
@@ -425,7 +426,7 @@ class QuicStreamFactoryTestBase : public WithTaskEnvironment {
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin) {
- spdy::SpdyHeaderBlock headers =
+ spdy::Http2HeaderBlock headers =
client_maker_.GetRequestHeaders("GET", "https", "/");
spdy::SpdyPriority priority =
ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
@@ -441,7 +442,7 @@ class QuicStreamFactoryTestBase : public WithTaskEnvironment {
quic::QuicStreamId parent_stream_id,
bool should_include_version,
bool fin) {
- spdy::SpdyHeaderBlock headers =
+ spdy::Http2HeaderBlock headers =
client_maker_.GetRequestHeaders("GET", "https", "/");
spdy::SpdyPriority priority =
ConvertRequestPriorityToQuicPriority(DEFAULT_PRIORITY);
@@ -456,7 +457,7 @@ class QuicStreamFactoryTestBase : public WithTaskEnvironment {
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin) {
- spdy::SpdyHeaderBlock headers = server_maker_.GetResponseHeaders("200 OK");
+ spdy::Http2HeaderBlock headers = server_maker_.GetResponseHeaders("200 OK");
size_t spdy_headers_frame_len;
return server_maker_.MakeResponseHeadersPacket(
packet_number, stream_id, should_include_version, fin,
@@ -849,7 +850,7 @@ class QuicStreamFactoryTestBase : public WithTaskEnvironment {
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
return server_maker_.MakeDataPacket(packet_number, stream_id,
should_include_version, fin, data);
}
diff --git a/chromium/net/quic/quic_test_packet_maker.cc b/chromium/net/quic/quic_test_packet_maker.cc
index 6cae96fc9aa..d9495be2188 100644
--- a/chromium/net/quic/quic_test_packet_maker.cc
+++ b/chromium/net/quic/quic_test_packet_maker.cc
@@ -15,6 +15,7 @@
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/quic_framer.h"
+#include "net/third_party/quiche/src/quic/core/quic_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_random.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
@@ -267,7 +268,7 @@ QuicTestPacketMaker::MakeRstAndDataPacket(
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode rst_error_code,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
InitializeHeader(num, include_version);
AddQuicRstStreamFrame(rst_stream_id, rst_error_code);
@@ -286,7 +287,7 @@ QuicTestPacketMaker::MakeDataAndRstPacket(
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode rst_error_code) {
InitializeHeader(num, include_version);
@@ -306,7 +307,7 @@ QuicTestPacketMaker::MakeDataRstAndAckPacket(
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode rst_error_code,
uint64_t largest_received,
@@ -415,7 +416,7 @@ QuicTestPacketMaker::MakeDataRstAndConnectionClosePacket(
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode error_code,
quic::QuicErrorCode quic_error,
@@ -439,7 +440,7 @@ QuicTestPacketMaker::MakeDataRstAckAndConnectionClosePacket(
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode error_code,
uint64_t largest_received,
@@ -520,7 +521,7 @@ std::unique_ptr<quic::QuicReceivedPacket> QuicTestPacketMaker::MakeDataPacket(
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
InitializeHeader(packet_number, should_include_version);
AddQuicStreamFrame(stream_id, fin, data);
return BuildPacket();
@@ -533,7 +534,7 @@ QuicTestPacketMaker::MakeAckAndDataPacket(uint64_t packet_number,
uint64_t largest_received,
uint64_t smallest_received,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
InitializeHeader(packet_number, include_version);
AddQuicAckFrame(largest_received, smallest_received);
@@ -549,7 +550,7 @@ QuicTestPacketMaker::MakeRequestHeadersAndMultipleDataFramesPacket(
bool should_include_version,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id,
size_t* spdy_headers_frame_length,
const std::vector<std::string>& data_writes) {
@@ -558,7 +559,7 @@ QuicTestPacketMaker::MakeRequestHeadersAndMultipleDataFramesPacket(
if (quic::VersionUsesHttp3(version_.transport_version)) {
MaybeAddHttp3SettingsFrames();
- if (priority != 1) {
+ if (priority != quic::QuicStream::kDefaultUrgency) {
std::string priority_data =
GenerateHttp3PriorityData(priority, stream_id);
AddQuicStreamFrame(2, false, priority_data);
@@ -580,14 +581,12 @@ QuicTestPacketMaker::MakeRequestHeadersAndMultipleDataFramesPacket(
if (spdy_headers_frame_length) {
*spdy_headers_frame_length = spdy_frame.size();
}
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
for (size_t i = 0; i < data_writes.size(); ++i) {
bool is_fin = fin && (i == data_writes.size() - 1);
- AddQuicStreamFrame(stream_id, is_fin,
- quiche::QuicheStringPiece(data_writes[i]));
+ AddQuicStreamFrame(stream_id, is_fin, absl::string_view(data_writes[i]));
}
return BuildPacket();
@@ -600,7 +599,7 @@ QuicTestPacketMaker::MakeRequestHeadersPacket(
bool should_include_version,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id,
size_t* spdy_headers_frame_length) {
InitializeHeader(packet_number, should_include_version);
@@ -608,7 +607,7 @@ QuicTestPacketMaker::MakeRequestHeadersPacket(
if (quic::VersionUsesHttp3(version_.transport_version)) {
MaybeAddHttp3SettingsFrames();
- if (priority != 1) {
+ if (priority != quic::QuicStream::kDefaultUrgency) {
std::string priority_data =
GenerateHttp3PriorityData(priority, stream_id);
AddQuicStreamFrame(2, false, priority_data);
@@ -625,9 +624,8 @@ QuicTestPacketMaker::MakeRequestHeadersPacket(
stream_id, fin, priority, std::move(headers), parent_stream_id);
if (spdy_headers_frame_length)
*spdy_headers_frame_length = spdy_frame.size();
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
return BuildPacket();
}
@@ -639,7 +637,7 @@ QuicTestPacketMaker::MakeRequestHeadersAndRstPacket(
bool should_include_version,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id,
size_t* spdy_headers_frame_length,
quic::QuicRstStreamErrorCode error_code) {
@@ -648,8 +646,11 @@ QuicTestPacketMaker::MakeRequestHeadersAndRstPacket(
if (quic::VersionUsesHttp3(version_.transport_version)) {
MaybeAddHttp3SettingsFrames();
- std::string priority_data = GenerateHttp3PriorityData(priority, stream_id);
- AddQuicStreamFrame(2, false, priority_data);
+ if (priority != quic::QuicStream::kDefaultUrgency) {
+ std::string priority_data =
+ GenerateHttp3PriorityData(priority, stream_id);
+ AddQuicStreamFrame(2, false, priority_data);
+ }
std::string data = QpackEncodeHeaders(stream_id, std::move(headers),
spdy_headers_frame_length);
@@ -665,9 +666,8 @@ QuicTestPacketMaker::MakeRequestHeadersAndRstPacket(
if (spdy_headers_frame_length) {
*spdy_headers_frame_length = spdy_frame.size();
}
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
AddQuicRstStreamFrame(stream_id, error_code);
@@ -685,7 +685,7 @@ QuicTestPacketMaker::MakePushPromisePacket(
quic::QuicStreamId promised_stream_id,
bool should_include_version,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
size_t* spdy_headers_frame_length) {
InitializeHeader(packet_number, should_include_version);
@@ -714,9 +714,8 @@ QuicTestPacketMaker::MakePushPromisePacket(
if (spdy_headers_frame_length) {
*spdy_headers_frame_length = spdy_frame.size();
}
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
return BuildPacket();
}
@@ -727,7 +726,7 @@ QuicTestPacketMaker::MakeResponseHeadersPacket(
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
size_t* spdy_headers_frame_length) {
InitializeHeader(packet_number, should_include_version);
@@ -748,9 +747,8 @@ QuicTestPacketMaker::MakeResponseHeadersPacket(
if (spdy_headers_frame_length) {
*spdy_headers_frame_length = spdy_frame.size();
}
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
return BuildPacket();
}
@@ -767,9 +765,8 @@ QuicTestPacketMaker::MakeInitialSettingsPacket(uint64_t packet_number) {
quic::kDefaultMaximumBlockedStreams);
spdy::SpdySerializedFrame spdy_frame(
spdy_request_framer_.SerializeFrame(settings_frame));
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
return BuildPacket();
}
@@ -797,13 +794,12 @@ QuicTestPacketMaker::MakePriorityPacket(uint64_t packet_number,
exclusive);
spdy::SpdySerializedFrame spdy_frame(
spdy_request_framer_.SerializeFrame(priority_frame));
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
return BuildPacket();
}
- if (priority != quic::QuicStream::DefaultUrgency()) {
+ if (priority != quic::QuicStream::kDefaultUrgency) {
std::string priority_data = GenerateHttp3PriorityData(priority, id);
AddQuicStreamFrame(2, false, priority_data);
}
@@ -835,13 +831,12 @@ QuicTestPacketMaker::MakeAckAndPriorityPacket(
exclusive);
spdy::SpdySerializedFrame spdy_frame(
spdy_request_framer_.SerializeFrame(priority_frame));
- AddQuicStreamFrame(
- GetHeadersStreamId(), false,
- quiche::QuicheStringPiece(spdy_frame.data(), spdy_frame.size()));
+ AddQuicStreamFrame(GetHeadersStreamId(), false,
+ absl::string_view(spdy_frame.data(), spdy_frame.size()));
return BuildPacket();
}
- if (priority != quic::QuicStream::DefaultUrgency()) {
+ if (priority != quic::QuicStream::kDefaultUrgency) {
std::string priority_data = GenerateHttp3PriorityData(priority, id);
AddQuicStreamFrame(2, false, priority_data);
}
@@ -970,11 +965,11 @@ void QuicTestPacketMaker::SetEncryptionLevel(quic::EncryptionLevel level) {
}
}
-spdy::SpdyHeaderBlock QuicTestPacketMaker::GetRequestHeaders(
+spdy::Http2HeaderBlock QuicTestPacketMaker::GetRequestHeaders(
const std::string& method,
const std::string& scheme,
const std::string& path) const {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers[":method"] = method;
headers[":authority"] = host_;
headers[":scheme"] = scheme;
@@ -982,26 +977,26 @@ spdy::SpdyHeaderBlock QuicTestPacketMaker::GetRequestHeaders(
return headers;
}
-spdy::SpdyHeaderBlock QuicTestPacketMaker::ConnectRequestHeaders(
+spdy::Http2HeaderBlock QuicTestPacketMaker::ConnectRequestHeaders(
const std::string& host_port) const {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers[":method"] = "CONNECT";
headers[":authority"] = host_port;
return headers;
}
-spdy::SpdyHeaderBlock QuicTestPacketMaker::GetResponseHeaders(
+spdy::Http2HeaderBlock QuicTestPacketMaker::GetResponseHeaders(
const std::string& status) const {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers[":status"] = status;
headers["content-type"] = "text/plain";
return headers;
}
-spdy::SpdyHeaderBlock QuicTestPacketMaker::GetResponseHeaders(
+spdy::Http2HeaderBlock QuicTestPacketMaker::GetResponseHeaders(
const std::string& status,
const std::string& alt_svc) const {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers[":status"] = status;
headers["alt-svc"] = alt_svc;
headers["content-type"] = "text/plain";
@@ -1014,7 +1009,7 @@ void QuicTestPacketMaker::Reset() {
std::string QuicTestPacketMaker::QpackEncodeHeaders(
quic::QuicStreamId stream_id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
size_t* encoded_data_length) {
DCHECK(quic::VersionUsesHttp3(version_.transport_version));
std::string data;
@@ -1106,7 +1101,7 @@ void QuicTestPacketMaker::AddQuicStreamsBlockedFrame(
void QuicTestPacketMaker::AddQuicStreamFrame(quic::QuicStreamId stream_id,
bool fin,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
AddQuicStreamFrameWithOffset(stream_id, fin, stream_offsets_[stream_id],
data);
stream_offsets_[stream_id] += data.length();
@@ -1116,10 +1111,10 @@ void QuicTestPacketMaker::AddQuicStreamFrameWithOffset(
quic::QuicStreamId stream_id,
bool fin,
quic::QuicStreamOffset offset,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
// Save the stream data so that callers can use temporary objects for data.
saved_stream_data_.push_back(std::make_unique<std::string>(data));
- quiche::QuicheStringPiece saved_data = *saved_stream_data_.back();
+ absl::string_view saved_data = *saved_stream_data_.back();
quic::QuicStreamFrame stream_frame(stream_id, fin, offset, saved_data);
frames_.push_back(quic::QuicFrame(stream_frame));
@@ -1305,7 +1300,7 @@ spdy::SpdySerializedFrame QuicTestPacketMaker::MakeSpdyHeadersFrame(
quic::QuicStreamId stream_id,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id) {
spdy::SpdyHeadersIR headers_frame(stream_id, std::move(headers));
headers_frame.set_fin(fin);
@@ -1417,7 +1412,7 @@ std::string QuicTestPacketMaker::GenerateHttp3PriorityData(
priority_update.prioritized_element_type = quic::REQUEST_STREAM;
priority_update.prioritized_element_id = stream_id;
priority_update.priority_field_value =
- quiche::QuicheStrCat("u=", static_cast<int>(priority));
+ base::StrCat({"u=", base::NumberToString(priority)});
std::unique_ptr<char[]> buffer;
quic::QuicByteCount frame_length =
quic::HttpEncoder::SerializePriorityUpdateFrame(priority_update, &buffer);
diff --git a/chromium/net/quic/quic_test_packet_maker.h b/chromium/net/quic/quic_test_packet_maker.h
index f39c758802c..3b76b33c091 100644
--- a/chromium/net/quic/quic_test_packet_maker.h
+++ b/chromium/net/quic/quic_test_packet_maker.h
@@ -105,13 +105,13 @@ class QuicTestPacketMaker {
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode rst_error_code,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
std::unique_ptr<quic::QuicReceivedPacket> MakeDataAndRstPacket(
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode rst_error_code);
@@ -119,7 +119,7 @@ class QuicTestPacketMaker {
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode rst_error_code,
uint64_t largest_received,
@@ -164,7 +164,7 @@ class QuicTestPacketMaker {
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode error_code,
quic::QuicErrorCode quic_error,
@@ -175,7 +175,7 @@ class QuicTestPacketMaker {
uint64_t num,
bool include_version,
quic::QuicStreamId data_stream_id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
quic::QuicStreamId rst_stream_id,
quic::QuicRstStreamErrorCode error_code,
uint64_t largest_received,
@@ -219,7 +219,7 @@ class QuicTestPacketMaker {
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
std::unique_ptr<quic::QuicReceivedPacket> MakeAckAndDataPacket(
uint64_t packet_number,
@@ -228,7 +228,7 @@ class QuicTestPacketMaker {
uint64_t largest_received,
uint64_t smallest_received,
bool fin,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
std::unique_ptr<quic::QuicReceivedPacket>
MakeRequestHeadersAndMultipleDataFramesPacket(
@@ -237,7 +237,7 @@ class QuicTestPacketMaker {
bool should_include_version,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id,
size_t* spdy_headers_frame_length,
const std::vector<std::string>& data_writes);
@@ -250,7 +250,7 @@ class QuicTestPacketMaker {
bool should_include_version,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id,
size_t* spdy_headers_frame_length);
@@ -260,7 +260,7 @@ class QuicTestPacketMaker {
bool should_include_version,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id,
size_t* spdy_headers_frame_length,
quic::QuicRstStreamErrorCode error_code);
@@ -273,7 +273,7 @@ class QuicTestPacketMaker {
quic::QuicStreamId promised_stream_id,
bool should_include_version,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
size_t* spdy_headers_frame_length);
// If |spdy_headers_frame_length| is non-null, it will be set to the size of
@@ -283,7 +283,7 @@ class QuicTestPacketMaker {
quic::QuicStreamId stream_id,
bool should_include_version,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
size_t* spdy_headers_frame_length);
// Creates a packet containing the initial SETTINGS frame, and saves the
@@ -340,17 +340,17 @@ class QuicTestPacketMaker {
void SetEncryptionLevel(quic::EncryptionLevel level);
- spdy::SpdyHeaderBlock GetRequestHeaders(const std::string& method,
- const std::string& scheme,
- const std::string& path) const;
+ spdy::Http2HeaderBlock GetRequestHeaders(const std::string& method,
+ const std::string& scheme,
+ const std::string& path) const;
- spdy::SpdyHeaderBlock ConnectRequestHeaders(
+ spdy::Http2HeaderBlock ConnectRequestHeaders(
const std::string& host_port) const;
- spdy::SpdyHeaderBlock GetResponseHeaders(const std::string& status) const;
+ spdy::Http2HeaderBlock GetResponseHeaders(const std::string& status) const;
- spdy::SpdyHeaderBlock GetResponseHeaders(const std::string& status,
- const std::string& alt_svc) const;
+ spdy::Http2HeaderBlock GetResponseHeaders(const std::string& status,
+ const std::string& alt_svc) const;
spdy::SpdyFramer* spdy_request_framer() { return &spdy_request_framer_; }
spdy::SpdyFramer* spdy_response_framer() { return &spdy_response_framer_; }
@@ -366,7 +366,7 @@ class QuicTestPacketMaker {
}
std::string QpackEncodeHeaders(quic::QuicStreamId stream_id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
size_t* encoded_data_length);
private:
@@ -385,12 +385,12 @@ class QuicTestPacketMaker {
// Use and increase stream's current offset.
void AddQuicStreamFrame(quic::QuicStreamId stream_id,
bool fin,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
// Use |offset| and do not change stream's current offset.
void AddQuicStreamFrameWithOffset(quic::QuicStreamId stream_id,
bool fin,
quic::QuicStreamOffset offset,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
void AddQuicAckFrame(uint64_t largest_received, uint64_t smallest_received);
void AddQuicAckFrame(uint64_t first_received,
uint64_t largest_received,
@@ -425,7 +425,7 @@ class QuicTestPacketMaker {
quic::QuicStreamId stream_id,
bool fin,
spdy::SpdyPriority priority,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
quic::QuicStreamId parent_stream_id);
bool ShouldIncludeVersion(bool include_version) const;
diff --git a/chromium/net/quic/quic_test_packet_printer.cc b/chromium/net/quic/quic_test_packet_printer.cc
index 86edab085bd..9b4f4588f78 100644
--- a/chromium/net/quic/quic_test_packet_printer.cc
+++ b/chromium/net/quic/quic_test_packet_printer.cc
@@ -40,9 +40,9 @@ class QuicPacketPrinter : public QuicFramerVisitorInterface {
}
void OnRetryPacket(QuicConnectionId original_connection_id,
QuicConnectionId new_connection_id,
- quiche::QuicheStringPiece retry_token,
- quiche::QuicheStringPiece retry_integrity_tag,
- quiche::QuicheStringPiece retry_without_tag) override {
+ absl::string_view retry_token,
+ absl::string_view retry_integrity_tag,
+ absl::string_view retry_without_tag) override {
*output_ << "OnRetryPacket\n";
}
bool OnUnauthenticatedPublicHeader(const QuicPacketHeader& header) override {
@@ -72,16 +72,16 @@ class QuicPacketPrinter : public QuicFramerVisitorInterface {
bool OnStreamFrame(const QuicStreamFrame& frame) override {
*output_ << "OnStreamFrame: " << frame;
*output_ << " data: { "
- << quiche::QuicheTextUtils::HexEncode(frame.data_buffer,
- frame.data_length)
+ << absl::BytesToHexString(
+ absl::string_view(frame.data_buffer, frame.data_length))
<< " }\n";
return true;
}
bool OnCryptoFrame(const QuicCryptoFrame& frame) override {
*output_ << "OnCryptoFrame: " << frame;
*output_ << " data: { "
- << quiche::QuicheTextUtils::HexEncode(frame.data_buffer,
- frame.data_length)
+ << absl::BytesToHexString(
+ absl::string_view(frame.data_buffer, frame.data_length))
<< " }\n";
return true;
}
@@ -164,6 +164,21 @@ class QuicPacketPrinter : public QuicFramerVisitorInterface {
*output_ << "OnStreamsBlockedFrame: " << frame;
return true;
}
+ void OnKeyUpdate(KeyUpdateReason reason) override {
+ *output_ << "OnKeyUpdate: " << reason << "\n";
+ }
+ void OnDecryptedFirstPacketInKeyPhase() override {
+ *output_ << "OnDecryptedFirstPacketInKeyPhase\n";
+ }
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ *output_ << "AdvanceKeysAndCreateCurrentOneRttDecrypter\n";
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ *output_ << "CreateCurrentOneRttEncrypter\n";
+ return nullptr;
+ }
bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override {
*output_ << "OnWindowUpdateFrame: " << frame;
return true;
diff --git a/chromium/net/quic/quic_transport_client.cc b/chromium/net/quic/quic_transport_client.cc
index 6f2138d6f01..25f05ecc816 100644
--- a/chromium/net/quic/quic_transport_client.cc
+++ b/chromium/net/quic/quic_transport_client.cc
@@ -275,8 +275,9 @@ void QuicTransportClient::CreateConnection() {
quic::QuicUtils::CreateRandomConnectionId(
quic_context_->random_generator());
connection_ = std::make_unique<quic::QuicConnection>(
- connection_id, ToQuicSocketAddress(server_address),
- quic_context_->helper(), alarm_factory_.get(),
+ connection_id, quic::QuicSocketAddress(),
+ ToQuicSocketAddress(server_address), quic_context_->helper(),
+ alarm_factory_.get(),
new QuicChromiumPacketWriter(socket_.get(), task_runner_),
/* owns_writer */ true, quic::Perspective::IS_CLIENT,
supported_versions_);
@@ -381,8 +382,7 @@ void QuicTransportClient::OnIncomingUnidirectionalStreamAvailable() {
visitor_->OnIncomingUnidirectionalStreamAvailable();
}
-void QuicTransportClient::OnDatagramReceived(
- quiche::QuicheStringPiece datagram) {
+void QuicTransportClient::OnDatagramReceived(absl::string_view datagram) {
visitor_->OnDatagramReceived(base::StringViewToStringPiece(datagram));
}
diff --git a/chromium/net/quic/quic_transport_client.h b/chromium/net/quic/quic_transport_client.h
index 38135c333ed..9c581f50d18 100644
--- a/chromium/net/quic/quic_transport_client.h
+++ b/chromium/net/quic/quic_transport_client.h
@@ -127,7 +127,7 @@ class NET_EXPORT QuicTransportClient
void OnSessionReady() override;
void OnIncomingBidirectionalStreamAvailable() override;
void OnIncomingUnidirectionalStreamAvailable() override;
- void OnDatagramReceived(quiche::QuicheStringPiece datagram) override;
+ void OnDatagramReceived(absl::string_view datagram) override;
void OnCanCreateNewOutgoingBidirectionalStream() override;
void OnCanCreateNewOutgoingUnidirectionalStream() override;
diff --git a/chromium/net/quic/quic_transport_end_to_end_test.cc b/chromium/net/quic/quic_transport_end_to_end_test.cc
index f97a81de977..4ab0a246b98 100644
--- a/chromium/net/quic/quic_transport_end_to_end_test.cc
+++ b/chromium/net/quic/quic_transport_end_to_end_test.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/strings/strcat.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/cert/mock_cert_verifier.h"
#include "net/dns/mock_host_resolver.h"
@@ -122,8 +123,8 @@ class QuicTransportEndToEndTest : public TestWithTaskEnvironment {
}
GURL GetURL(const std::string& suffix) {
- return GURL{quiche::QuicheStrCat(
- "quic-transport://test.example.com:", port_, suffix)};
+ return GURL{base::StrCat({"quic-transport://test.example.com:",
+ base::NumberToString(port_), suffix})};
}
void StartServer(std::unique_ptr<quic::ProofSource> proof_source = nullptr) {
diff --git a/chromium/net/quic/quic_transport_error.cc b/chromium/net/quic/quic_transport_error.cc
index 8c76d6705e9..94030a4934f 100644
--- a/chromium/net/quic/quic_transport_error.cc
+++ b/chromium/net/quic/quic_transport_error.cc
@@ -4,7 +4,7 @@
#include "net/quic/quic_transport_error.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
+#include "base/strings/strcat.h"
namespace net {
@@ -13,7 +13,7 @@ std::string QuicTransportErrorToString(const QuicTransportError& error) {
ExtendedErrorToString(error.net_error, error.quic_error);
if (error.details == message)
return message;
- return quiche::QuicheStrCat(message, " (", error.details, ")");
+ return base::StrCat({message, " (", error.details, ")"});
}
std::ostream& operator<<(std::ostream& os, const QuicTransportError& error) {
diff --git a/chromium/net/quiche/common/platform/impl/quiche_arraysize_impl.h b/chromium/net/quiche/common/platform/impl/quiche_arraysize_impl.h
deleted file mode 100644
index b7e4fd81b84..00000000000
--- a/chromium/net/quiche/common/platform/impl/quiche_arraysize_impl.h
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_ARRAYSIZE_IMPL_H_
-#define NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_ARRAYSIZE_IMPL_H_
-
-#include "third_party/abseil-cpp/absl/base/macros.h"
-
-#define QUICHE_ARRAYSIZE_IMPL(x) ABSL_ARRAYSIZE(x)
-
-#endif // NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_ARRAYSIZE_IMPL_H_
diff --git a/chromium/net/quiche/common/platform/impl/quiche_endian_impl.h b/chromium/net/quiche/common/platform/impl/quiche_endian_impl.h
deleted file mode 100644
index a29fb5db28f..00000000000
--- a/chromium/net/quiche/common/platform/impl/quiche_endian_impl.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_ENDIAN_IMPL_H_
-#define NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_ENDIAN_IMPL_H_
-
-#include "base/sys_byteorder.h"
-#include "build/build_config.h"
-
-namespace quiche {
-
-class QuicheEndianImpl {
- public:
- // Convert |x| from host order (can be either little or big endian depending
- // on the platform) to network order (big endian).
- static uint16_t HostToNet16(uint16_t x) { return base::HostToNet16(x); }
- static uint32_t HostToNet32(uint32_t x) { return base::HostToNet32(x); }
- static uint64_t HostToNet64(uint64_t x) { return base::HostToNet64(x); }
-
- // Convert |x| from network order (big endian) to host order (can be either
- // little or big endian depending on the platform).
- static uint16_t NetToHost16(uint16_t x) { return base::NetToHost16(x); }
- static uint32_t NetToHost32(uint32_t x) { return base::NetToHost32(x); }
- static uint64_t NetToHost64(uint64_t x) { return base::NetToHost64(x); }
-
- // Returns true if current host order is little endian.
- static bool HostIsLittleEndian() {
-#if defined(ARCH_CPU_LITTLE_ENDIAN)
- return true;
-#else
- return false;
-#endif
- }
-};
-
-} // namespace quiche
-
-#endif // NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_ENDIAN_IMPL_H_
diff --git a/chromium/net/quiche/common/platform/impl/quiche_optional_impl.h b/chromium/net/quiche/common/platform/impl/quiche_optional_impl.h
deleted file mode 100644
index f1dc5b1096c..00000000000
--- a/chromium/net/quiche/common/platform/impl/quiche_optional_impl.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_OPTIONAL_IMPL_H_
-#define NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_OPTIONAL_IMPL_H_
-
-#include "third_party/abseil-cpp/absl/types/optional.h"
-
-namespace quiche {
-
-template <typename T>
-using QuicheOptionalImpl = absl::optional<T>;
-
-#define QUICHE_NULLOPT_IMPL absl::nullopt
-
-} // namespace quiche
-
-#endif // NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_OPTIONAL_IMPL_H_
diff --git a/chromium/net/quiche/common/platform/impl/quiche_ptr_util_impl.h b/chromium/net/quiche/common/platform/impl/quiche_ptr_util_impl.h
deleted file mode 100644
index 4a7b319885b..00000000000
--- a/chromium/net/quiche/common/platform/impl/quiche_ptr_util_impl.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_PTR_UTIL_IMPL_H_
-#define NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_PTR_UTIL_IMPL_H_
-
-#include <memory>
-#include <utility>
-
-#include "base/memory/ptr_util.h"
-
-namespace quiche {
-
-template <typename T>
-std::unique_ptr<T> QuicheWrapUniqueImpl(T* ptr) {
- return base::WrapUnique<T>(ptr);
-}
-
-} // namespace quiche
-
-#endif // NET_QUICHE_COMMON_PLATFORM_IMPL_QUICHE_PTR_UTIL_IMPL_H_
diff --git a/chromium/net/quiche/common/platform/impl/quiche_str_cat_impl.h b/chromium/net/quiche/common/platform/impl/quiche_str_cat_impl.h
index 64268de0ade..c1579b56f63 100644
--- a/chromium/net/quiche/common/platform/impl/quiche_str_cat_impl.h
+++ b/chromium/net/quiche/common/platform/impl/quiche_str_cat_impl.h
@@ -9,16 +9,24 @@
#include <string>
#include <utility>
+#include "base/strings/abseil_string_conversions.h"
#include "base/strings/stringprintf.h"
+#include "third_party/abseil-cpp/absl/strings/str_cat.h"
namespace quiche {
+inline absl::string_view MaybeStringPieceToStringView(base::StringPiece arg) {
+ return base::StringPieceToStringView(arg);
+}
+
+template <typename T>
+inline T MaybeStringPieceToStringView(const T& arg) {
+ return arg;
+}
+
template <typename... Args>
inline std::string QuicheStrCatImpl(const Args&... args) {
- std::ostringstream oss;
- int dummy[] = {1, (oss << args, 0)...};
- static_cast<void>(dummy);
- return oss.str();
+ return absl::StrCat(MaybeStringPieceToStringView(args)...);
}
template <typename... Args>
diff --git a/chromium/net/quiche/common/platform/impl/quiche_string_piece_impl.h b/chromium/net/quiche/common/platform/impl/quiche_string_piece_impl.h
index 5c68910f264..5664d34ad5f 100644
--- a/chromium/net/quiche/common/platform/impl/quiche_string_piece_impl.h
+++ b/chromium/net/quiche/common/platform/impl/quiche_string_piece_impl.h
@@ -10,12 +10,8 @@
namespace quiche {
-using QuicheStringPieceImpl = absl::string_view;
-
-using QuicheStringPieceHashImpl = absl::Hash<absl::string_view>;
-
-inline size_t QuicheHashStringPairImpl(QuicheStringPieceImpl a,
- QuicheStringPieceImpl b) {
+inline size_t QuicheHashStringPairImpl(absl::string_view a,
+ absl::string_view b) {
auto pair = std::make_pair(a, b);
return absl::Hash<decltype(pair)>()(pair);
}
diff --git a/chromium/net/quiche/common/platform/impl/quiche_text_utils_impl.h b/chromium/net/quiche/common/platform/impl/quiche_text_utils_impl.h
index 144c966ea45..ba75dcfc0ff 100644
--- a/chromium/net/quiche/common/platform/impl/quiche_text_utils_impl.h
+++ b/chromium/net/quiche/common/platform/impl/quiche_text_utils_impl.h
@@ -13,13 +13,13 @@
#include "base/strings/abseil_string_conversions.h"
#include "net/base/hex_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "third_party/abseil-cpp/absl/strings/ascii.h"
#include "third_party/abseil-cpp/absl/strings/escaping.h"
#include "third_party/abseil-cpp/absl/strings/match.h"
#include "third_party/abseil-cpp/absl/strings/str_cat.h"
#include "third_party/abseil-cpp/absl/strings/str_split.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
namespace quiche {
@@ -27,52 +27,52 @@ namespace quiche {
class QuicheTextUtilsImpl {
public:
// Returns true of |data| starts with |prefix|, case sensitively.
- static bool StartsWith(QuicheStringPiece data, QuicheStringPiece prefix) {
+ static bool StartsWith(absl::string_view data, absl::string_view prefix) {
return absl::StartsWith(data, prefix);
}
// Returns true if |data| end with |suffix|, case sensitively.
- static bool EndsWith(QuicheStringPiece data, QuicheStringPiece suffix) {
+ static bool EndsWith(absl::string_view data, absl::string_view suffix) {
return absl::EndsWith(data, suffix);
}
// Returns true of |data| ends with |suffix|, case insensitively.
- static bool EndsWithIgnoreCase(QuicheStringPiece data,
- QuicheStringPiece suffix) {
+ static bool EndsWithIgnoreCase(absl::string_view data,
+ absl::string_view suffix) {
return absl::EndsWithIgnoreCase(data, suffix);
}
// Returns a new std::string in which |data| has been converted to lower case.
- static std::string ToLower(QuicheStringPiece data) {
+ static std::string ToLower(absl::string_view data) {
return absl::AsciiStrToLower(data);
}
// Remove leading and trailing whitespace from |data|.
- static void RemoveLeadingAndTrailingWhitespace(QuicheStringPiece* data) {
+ static void RemoveLeadingAndTrailingWhitespace(absl::string_view* data) {
*data = absl::StripAsciiWhitespace(*data);
}
// Returns true if |in| represents a valid uint64, and stores that value in
// |out|.
- static bool StringToUint64(QuicheStringPiece in, uint64_t* out) {
+ static bool StringToUint64(absl::string_view in, uint64_t* out) {
return absl::SimpleAtoi(in, out);
}
// Returns true if |in| represents a valid int, and stores that value in
// |out|.
- static bool StringToInt(QuicheStringPiece in, int* out) {
+ static bool StringToInt(absl::string_view in, int* out) {
return absl::SimpleAtoi(in, out);
}
// Returns true if |in| represents a valid uint32, and stores that value in
// |out|.
- static bool StringToUint32(QuicheStringPiece in, uint32_t* out) {
+ static bool StringToUint32(absl::string_view in, uint32_t* out) {
return absl::SimpleAtoi(in, out);
}
// Returns true if |in| represents a valid size_t, and stores that value in
// |out|.
- static bool StringToSizeT(QuicheStringPiece in, size_t* out) {
+ static bool StringToSizeT(absl::string_view in, size_t* out) {
return absl::SimpleAtoi(in, out);
}
@@ -82,7 +82,7 @@ class QuicheTextUtilsImpl {
// This converts |length| bytes of binary to a 2*|length|-character
// hexadecimal representation.
// Return value: 2*|length| characters of ASCII std::string.
- static std::string HexEncode(QuicheStringPiece data) {
+ static std::string HexEncode(absl::string_view data) {
return absl::BytesToHexString(data);
}
@@ -90,7 +90,7 @@ class QuicheTextUtilsImpl {
// Converts |data| from a hexadecimal ASCII string to a binary string
// that is |data.length()/2| bytes long. On failure returns empty string.
- static std::string HexDecode(QuicheStringPiece data) {
+ static std::string HexDecode(absl::string_view data) {
return absl::HexStringToBytes(data);
}
@@ -115,10 +115,10 @@ class QuicheTextUtilsImpl {
// Decodes a base64-encoded |input|. Returns nullopt when the input is
// invalid.
- static QuicheOptional<std::string> Base64Decode(QuicheStringPiece input) {
+ static absl::optional<std::string> Base64Decode(absl::string_view input) {
std::string output;
if (!absl::Base64Unescape(input, &output)) {
- return QuicheOptional<std::string>();
+ return absl::optional<std::string>();
}
return output;
}
@@ -128,22 +128,22 @@ class QuicheTextUtilsImpl {
// printed as '.' in the ASCII output.
// For example, given the input "Hello, QUIC!\01\02\03\04", returns:
// "0x0000: 4865 6c6c 6f2c 2051 5549 4321 0102 0304 Hello,.QUIC!...."
- static std::string HexDump(QuicheStringPiece binary_input) {
+ static std::string HexDump(absl::string_view binary_input) {
return net::HexDump(base::StringViewToStringPiece(binary_input));
}
// Returns true if |data| contains any uppercase characters.
- static bool ContainsUpperCase(QuicheStringPiece data) {
+ static bool ContainsUpperCase(absl::string_view data) {
return std::any_of(data.begin(), data.end(), absl::ascii_isupper);
}
// Returns true if |data| contains only decimal digits.
- static bool IsAllDigits(QuicheStringPiece data) {
+ static bool IsAllDigits(absl::string_view data) {
return std::all_of(data.begin(), data.end(), absl::ascii_isdigit);
}
// Splits |data| into a vector of pieces delimited by |delim|.
- static std::vector<QuicheStringPiece> Split(QuicheStringPiece data,
+ static std::vector<absl::string_view> Split(absl::string_view data,
char delim) {
return absl::StrSplit(data, delim);
}
diff --git a/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.cc b/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.cc
index 94e60f4cf4c..5e21518e139 100644
--- a/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.cc
+++ b/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.cc
@@ -9,7 +9,7 @@
#include <iostream>
namespace quiche {
-QuicheOptional<int64_t> QuicheUtcDateTimeToUnixSecondsInner(int year,
+absl::optional<int64_t> QuicheUtcDateTimeToUnixSecondsInner(int year,
int month,
int day,
int hour,
@@ -27,7 +27,7 @@ QuicheOptional<int64_t> QuicheUtcDateTimeToUnixSecondsInner(int year,
return (time - base::Time::UnixEpoch()).InSeconds();
}
-QuicheOptional<int64_t> QuicheUtcDateTimeToUnixSecondsImpl(int year,
+absl::optional<int64_t> QuicheUtcDateTimeToUnixSecondsImpl(int year,
int month,
int day,
int hour,
diff --git a/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.h b/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.h
index 60dda04eb65..07e41cd6be6 100644
--- a/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.h
+++ b/chromium/net/quiche/common/platform/impl/quiche_time_utils_impl.h
@@ -8,11 +8,11 @@
#include <cstdint>
#include "net/base/net_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
namespace quiche {
-NET_EXPORT_PRIVATE QuicheOptional<int64_t> QuicheUtcDateTimeToUnixSecondsImpl(
+NET_EXPORT_PRIVATE absl::optional<int64_t> QuicheUtcDateTimeToUnixSecondsImpl(
int year,
int month,
int day,
diff --git a/chromium/net/reporting/mock_persistent_reporting_store_unittest.cc b/chromium/net/reporting/mock_persistent_reporting_store_unittest.cc
index aeff851910e..04439db578b 100644
--- a/chromium/net/reporting/mock_persistent_reporting_store_unittest.cc
+++ b/chromium/net/reporting/mock_persistent_reporting_store_unittest.cc
@@ -7,7 +7,7 @@
#include <vector>
#include "base/location.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/time/time.h"
#include "net/base/network_isolation_key.h"
#include "net/reporting/reporting_endpoint.h"
diff --git a/chromium/net/reporting/reporting_cache_unittest.cc b/chromium/net/reporting/reporting_cache_unittest.cc
index 49739c243a5..5ac623ea17f 100644
--- a/chromium/net/reporting/reporting_cache_unittest.cc
+++ b/chromium/net/reporting/reporting_cache_unittest.cc
@@ -11,10 +11,12 @@
#include "base/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/values_test_util.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "net/base/features.h"
#include "net/base/network_isolation_key.h"
#include "net/reporting/mock_persistent_reporting_store.h"
#include "net/reporting/reporting_cache_impl.h"
@@ -57,7 +59,13 @@ class TestReportingCacheObserver : public ReportingCacheObserver {
class ReportingCacheTest : public ReportingTestBase,
public ::testing::WithParamInterface<bool> {
protected:
- ReportingCacheTest() : ReportingTestBase() {
+ ReportingCacheTest() {
+ // This is a private API of the reporting service, so no need to test the
+ // case kPartitionNelAndReportingByNetworkIsolationKey is disabled - the
+ // feature is only applied at the entry points of the service.
+ feature_list_.InitAndEnableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
ReportingPolicy policy;
policy.max_report_count = 5;
policy.max_endpoints_per_origin = 3;
@@ -170,6 +178,8 @@ class ReportingCacheTest : public ReportingTestBase,
EndpointGroupExistsInCache(group, OriginSubdomains::DEFAULT));
}
+ base::test::ScopedFeatureList feature_list_;
+
const GURL kUrl1_ = GURL("https://origin1/path");
const GURL kUrl2_ = GURL("https://origin2/path");
const url::Origin kOrigin1_ = url::Origin::Create(GURL("https://origin1/"));
diff --git a/chromium/net/reporting/reporting_delivery_agent_unittest.cc b/chromium/net/reporting/reporting_delivery_agent_unittest.cc
index 7812de93c4d..078ab9df56b 100644
--- a/chromium/net/reporting/reporting_delivery_agent_unittest.cc
+++ b/chromium/net/reporting/reporting_delivery_agent_unittest.cc
@@ -7,12 +7,14 @@
#include <vector>
#include "base/json/json_reader.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/test/values_test_util.h"
#include "base/time/time.h"
#include "base/timer/mock_timer.h"
#include "base/values.h"
#include "net/base/backoff_entry.h"
+#include "net/base/features.h"
#include "net/base/network_isolation_key.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_report.h"
@@ -28,6 +30,12 @@ namespace {
class ReportingDeliveryAgentTest : public ReportingTestBase {
protected:
ReportingDeliveryAgentTest() {
+ // This is a private API of the reporting service, so no need to test the
+ // case kPartitionNelAndReportingByNetworkIsolationKey is disabled - the
+ // feature is only applied at the entry points of the service.
+ feature_list_.InitAndEnableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
ReportingPolicy policy;
policy.endpoint_backoff_policy.num_errors_to_ignore = 0;
policy.endpoint_backoff_policy.initial_delay_ms = 60000;
@@ -68,6 +76,8 @@ class ReportingDeliveryAgentTest : public ReportingTestBase {
EXPECT_TRUE(delivery_timer()->IsRunning());
}
+ base::test::ScopedFeatureList feature_list_;
+
base::Value report_body_{base::Value::Type::DICTIONARY};
const GURL kUrl_ = GURL("https://origin/path");
const GURL kOtherUrl_ = GURL("https://other-origin/path");
@@ -75,9 +85,9 @@ class ReportingDeliveryAgentTest : public ReportingTestBase {
const url::Origin kOrigin_ = url::Origin::Create(GURL("https://origin/"));
const url::Origin kOtherOrigin_ =
url::Origin::Create(GURL("https://other-origin/"));
- const NetworkIsolationKey kNik_;
+ const NetworkIsolationKey kNik_ = NetworkIsolationKey(kOrigin_, kOrigin_);
const NetworkIsolationKey kOtherNik_ =
- NetworkIsolationKey(kOrigin_, kOtherOrigin_);
+ NetworkIsolationKey(kOtherOrigin_, kOtherOrigin_);
const GURL kEndpoint_ = GURL("https://endpoint/");
const std::string kUserAgent_ = "Mozilla/1.0";
const std::string kGroup_ = "group";
diff --git a/chromium/net/reporting/reporting_header_parser.cc b/chromium/net/reporting/reporting_header_parser.cc
index 50b983b7bf6..faf20881916 100644
--- a/chromium/net/reporting/reporting_header_parser.cc
+++ b/chromium/net/reporting/reporting_header_parser.cc
@@ -206,8 +206,7 @@ void ReportingHeaderParser::ParseHeader(
// Remove the client if it has no valid endpoint groups.
if (parsed_header.empty()) {
- // TODO(chlily): Pass NIK to cache.
- cache->RemoveClient(NetworkIsolationKey::Todo(), origin);
+ cache->RemoveClient(network_isolation_key, origin);
return;
}
diff --git a/chromium/net/reporting/reporting_header_parser_unittest.cc b/chromium/net/reporting/reporting_header_parser_unittest.cc
index 9d72c0409b4..20b2f1f9595 100644
--- a/chromium/net/reporting/reporting_header_parser_unittest.cc
+++ b/chromium/net/reporting/reporting_header_parser_unittest.cc
@@ -12,9 +12,11 @@
#include "base/json/json_reader.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
+#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "net/base/features.h"
#include "net/reporting/mock_persistent_reporting_store.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_endpoint.h"
@@ -33,7 +35,13 @@ using CommandType = MockPersistentReportingStore::Command::Type;
class ReportingHeaderParserTest : public ReportingTestBase,
public ::testing::WithParamInterface<bool> {
protected:
- ReportingHeaderParserTest() : ReportingTestBase() {
+ ReportingHeaderParserTest() {
+ // This is a private API of the reporting service, so no need to test the
+ // case kPartitionNelAndReportingByNetworkIsolationKey is disabled - the
+ // feature is only applied at the entry points of the service.
+ feature_list_.InitAndEnableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
ReportingPolicy policy;
policy.max_endpoints_per_origin = 10;
policy.max_endpoint_count = 20;
@@ -138,13 +146,15 @@ class ReportingHeaderParserTest : public ReportingTestBase,
}
}
+ base::test::ScopedFeatureList feature_list_;
+
const GURL kUrl1_ = GURL("https://origin1.test/path");
const url::Origin kOrigin1_ = url::Origin::Create(kUrl1_);
const GURL kUrl2_ = GURL("https://origin2.test/path");
const url::Origin kOrigin2_ = url::Origin::Create(kUrl2_);
- const NetworkIsolationKey kNik_;
+ const NetworkIsolationKey kNik_ = NetworkIsolationKey(kOrigin1_, kOrigin1_);
const NetworkIsolationKey kOtherNik_ =
- NetworkIsolationKey(kOrigin1_, kOrigin2_);
+ NetworkIsolationKey(kOrigin2_, kOrigin2_);
const GURL kUrlEtld_ = GURL("https://co.uk/foo.html/");
const url::Origin kOriginEtld_ = url::Origin::Create(kUrlEtld_);
const GURL kEndpoint1_ = GURL("https://endpoint1.test/");
@@ -1440,6 +1450,164 @@ TEST_P(ReportingHeaderParserTest, ZeroMaxAgeRemovesEndpointGroup) {
}
}
+// Invalid advertisements that parse as JSON should remove an endpoint group,
+// while those that don't are ignored.
+TEST_P(ReportingHeaderParserTest, InvalidAdvertisementRemovesEndpointGroup) {
+ std::string invalid_non_json_header = "Goats should wear hats.";
+ std::string invalid_json_header = "\"Goats should wear hats.\"";
+
+ // Without a pre-existing client, neither invalid header does anything.
+
+ ASSERT_EQ(0u, cache()->GetEndpointCount());
+ ParseHeader(kNik_, kUrl1_, invalid_non_json_header);
+ EXPECT_EQ(0u, cache()->GetEndpointCount());
+ if (mock_store()) {
+ mock_store()->Flush();
+ EXPECT_EQ(0,
+ mock_store()->CountCommands(CommandType::ADD_REPORTING_ENDPOINT));
+ EXPECT_EQ(0, mock_store()->CountCommands(
+ CommandType::ADD_REPORTING_ENDPOINT_GROUP));
+ }
+
+ ASSERT_EQ(0u, cache()->GetEndpointCount());
+ ParseHeader(kNik_, kUrl1_, invalid_json_header);
+ EXPECT_EQ(0u, cache()->GetEndpointCount());
+ if (mock_store()) {
+ mock_store()->Flush();
+ EXPECT_EQ(0,
+ mock_store()->CountCommands(CommandType::ADD_REPORTING_ENDPOINT));
+ EXPECT_EQ(0, mock_store()->CountCommands(
+ CommandType::ADD_REPORTING_ENDPOINT_GROUP));
+ }
+
+ // Set a header with two endpoint groups.
+ std::vector<ReportingEndpoint::EndpointInfo> endpoints1 = {{kEndpoint1_}};
+ std::vector<ReportingEndpoint::EndpointInfo> endpoints2 = {{kEndpoint2_}};
+ std::string header1 =
+ ConstructHeaderGroupString(MakeEndpointGroup(kGroup1_, endpoints1)) +
+ ", " +
+ ConstructHeaderGroupString(MakeEndpointGroup(kGroup2_, endpoints2));
+ ParseHeader(kNik_, kUrl1_, header1);
+
+ EXPECT_TRUE(ClientExistsInCacheForOrigin(kOrigin1_));
+ EXPECT_EQ(2u, cache()->GetEndpointGroupCountForTesting());
+ EXPECT_TRUE(
+ EndpointGroupExistsInCache(kGroupKey11_, OriginSubdomains::DEFAULT));
+ EXPECT_TRUE(
+ EndpointGroupExistsInCache(kGroupKey12_, OriginSubdomains::DEFAULT));
+ EXPECT_EQ(2u, cache()->GetEndpointCount());
+ if (mock_store()) {
+ mock_store()->Flush();
+ EXPECT_EQ(2,
+ mock_store()->CountCommands(CommandType::ADD_REPORTING_ENDPOINT));
+ EXPECT_EQ(2, mock_store()->CountCommands(
+ CommandType::ADD_REPORTING_ENDPOINT_GROUP));
+ MockPersistentReportingStore::CommandList expected_commands;
+ expected_commands.emplace_back(CommandType::ADD_REPORTING_ENDPOINT,
+ kGroupKey11_, kEndpoint1_);
+ expected_commands.emplace_back(CommandType::ADD_REPORTING_ENDPOINT,
+ kGroupKey12_, kEndpoint2_);
+ expected_commands.emplace_back(CommandType::ADD_REPORTING_ENDPOINT_GROUP,
+ kGroupKey11_);
+ expected_commands.emplace_back(CommandType::ADD_REPORTING_ENDPOINT_GROUP,
+ kGroupKey12_);
+ EXPECT_THAT(mock_store()->GetAllCommands(),
+ testing::IsSupersetOf(expected_commands));
+ }
+
+ // Set another header with max_age: 0 to delete one of the groups.
+ std::string header2 = ConstructHeaderGroupString(MakeEndpointGroup(
+ kGroup1_, endpoints1, OriginSubdomains::DEFAULT,
+ base::TimeDelta::FromSeconds(0))) +
+ ", " +
+ ConstructHeaderGroupString(MakeEndpointGroup(
+ kGroup2_, endpoints2)); // Other group stays.
+ ParseHeader(kNik_, kUrl1_, header2);
+
+ EXPECT_TRUE(ClientExistsInCacheForOrigin(kOrigin1_));
+ EXPECT_EQ(1u, cache()->GetEndpointGroupCountForTesting());
+
+ // Group was deleted.
+ EXPECT_FALSE(
+ EndpointGroupExistsInCache(kGroupKey11_, OriginSubdomains::DEFAULT));
+ // Other group remains in the cache.
+ EXPECT_TRUE(
+ EndpointGroupExistsInCache(kGroupKey12_, OriginSubdomains::DEFAULT));
+ EXPECT_EQ(1u, cache()->GetEndpointCount());
+ if (mock_store()) {
+ mock_store()->Flush();
+ EXPECT_EQ(2,
+ mock_store()->CountCommands(CommandType::ADD_REPORTING_ENDPOINT));
+ EXPECT_EQ(2, mock_store()->CountCommands(
+ CommandType::ADD_REPORTING_ENDPOINT_GROUP));
+ EXPECT_EQ(
+ 1, mock_store()->CountCommands(CommandType::DELETE_REPORTING_ENDPOINT));
+ EXPECT_EQ(1, mock_store()->CountCommands(
+ CommandType::DELETE_REPORTING_ENDPOINT_GROUP));
+ MockPersistentReportingStore::CommandList expected_commands;
+ expected_commands.emplace_back(CommandType::DELETE_REPORTING_ENDPOINT,
+ kGroupKey11_, kEndpoint1_);
+ expected_commands.emplace_back(CommandType::DELETE_REPORTING_ENDPOINT_GROUP,
+ kGroupKey11_);
+ EXPECT_THAT(mock_store()->GetAllCommands(),
+ testing::IsSupersetOf(expected_commands));
+ }
+
+ // Invalid header values that are not JSON lists (without the outer brackets)
+ // are ignored.
+ ParseHeader(kNik_, kUrl1_, invalid_non_json_header);
+ EXPECT_TRUE(ClientExistsInCacheForOrigin(kOrigin1_));
+ EXPECT_TRUE(
+ EndpointGroupExistsInCache(kGroupKey12_, OriginSubdomains::DEFAULT));
+ EXPECT_EQ(1u, cache()->GetEndpointCount());
+ if (mock_store()) {
+ mock_store()->Flush();
+ EXPECT_EQ(2,
+ mock_store()->CountCommands(CommandType::ADD_REPORTING_ENDPOINT));
+ EXPECT_EQ(2, mock_store()->CountCommands(
+ CommandType::ADD_REPORTING_ENDPOINT_GROUP));
+ EXPECT_EQ(
+ 1, mock_store()->CountCommands(CommandType::DELETE_REPORTING_ENDPOINT));
+ EXPECT_EQ(1, mock_store()->CountCommands(
+ CommandType::DELETE_REPORTING_ENDPOINT_GROUP));
+ MockPersistentReportingStore::CommandList expected_commands;
+ expected_commands.emplace_back(CommandType::DELETE_REPORTING_ENDPOINT,
+ kGroupKey11_, kEndpoint1_);
+ expected_commands.emplace_back(CommandType::DELETE_REPORTING_ENDPOINT_GROUP,
+ kGroupKey11_);
+ EXPECT_THAT(mock_store()->GetAllCommands(),
+ testing::IsSupersetOf(expected_commands));
+ }
+
+ // Invalid headers that do parse as JSON should delete the corresponding
+ // client.
+ ParseHeader(kNik_, kUrl1_, invalid_json_header);
+
+ // Deletion of the last remaining group also deletes the client for this
+ // origin.
+ EXPECT_FALSE(ClientExistsInCacheForOrigin(kOrigin1_));
+ EXPECT_EQ(0u, cache()->GetEndpointGroupCountForTesting());
+ EXPECT_EQ(0u, cache()->GetEndpointCount());
+ if (mock_store()) {
+ mock_store()->Flush();
+ EXPECT_EQ(2,
+ mock_store()->CountCommands(CommandType::ADD_REPORTING_ENDPOINT));
+ EXPECT_EQ(2, mock_store()->CountCommands(
+ CommandType::ADD_REPORTING_ENDPOINT_GROUP));
+ EXPECT_EQ(1 + 1, mock_store()->CountCommands(
+ CommandType::DELETE_REPORTING_ENDPOINT));
+ EXPECT_EQ(1 + 1, mock_store()->CountCommands(
+ CommandType::DELETE_REPORTING_ENDPOINT_GROUP));
+ MockPersistentReportingStore::CommandList expected_commands;
+ expected_commands.emplace_back(CommandType::DELETE_REPORTING_ENDPOINT,
+ kGroupKey12_, kEndpoint2_);
+ expected_commands.emplace_back(CommandType::DELETE_REPORTING_ENDPOINT_GROUP,
+ kGroupKey12_);
+ EXPECT_THAT(mock_store()->GetAllCommands(),
+ testing::IsSupersetOf(expected_commands));
+ }
+}
+
TEST_P(ReportingHeaderParserTest, EvictEndpointsOverPerOriginLimit1) {
// Set a header with too many endpoints, all in the same group.
std::vector<ReportingEndpoint::EndpointInfo> endpoints;
diff --git a/chromium/net/reporting/reporting_service.cc b/chromium/net/reporting/reporting_service.cc
index ca44492f9e2..c30d7c833ca 100644
--- a/chromium/net/reporting/reporting_service.cc
+++ b/chromium/net/reporting/reporting_service.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/bind.h"
+#include "base/feature_list.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/macros.h"
@@ -14,6 +15,7 @@
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "net/base/features.h"
#include "net/reporting/reporting_browsing_data_remover.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_context.h"
@@ -52,6 +54,7 @@ class ReportingServiceImpl : public ReportingService {
}
void QueueReport(const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
const std::string& user_agent,
const std::string& group,
const std::string& type,
@@ -72,15 +75,15 @@ class ReportingServiceImpl : public ReportingService {
// base::Unretained is safe because the callback is stored in
// |task_backlog_| which will not outlive |this|.
- // TODO(chlily): Get NetworkIsolationKey from caller.
- NetworkIsolationKey network_isolation_key = NetworkIsolationKey::Todo();
DoOrBacklogTask(base::BindOnce(
&ReportingServiceImpl::DoQueueReport, base::Unretained(this),
- network_isolation_key, std::move(sanitized_url), user_agent, group,
- type, std::move(body), depth, queued_ticks));
+ FixupNetworkIsolationKey(network_isolation_key),
+ std::move(sanitized_url), user_agent, group, type, std::move(body),
+ depth, queued_ticks));
}
void ProcessHeader(const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
const std::string& header_string) override {
if (header_string.size() > kMaxJsonSize)
return;
@@ -92,10 +95,10 @@ class ReportingServiceImpl : public ReportingService {
return;
DVLOG(1) << "Received Reporting policy for " << url.GetOrigin();
- // TODO(chlily): Get the proper NetworkIsolationKey from the caller.
DoOrBacklogTask(base::BindOnce(
&ReportingServiceImpl::DoProcessHeader, base::Unretained(this),
- NetworkIsolationKey::Todo(), url, std::move(header_value)));
+ FixupNetworkIsolationKey(network_isolation_key), url,
+ std::move(header_value)));
}
void RemoveBrowsingData(uint64_t data_type_mask,
@@ -222,11 +225,29 @@ class ReportingServiceImpl : public ReportingService {
ExecuteBacklog();
}
+ // Returns either |network_isolation_key| or an empty NetworkIsolationKey,
+ // based on |respect_network_isolation_key_|. Should be used on all
+ // NetworkIsolationKeys passed in through public API calls.
+ const NetworkIsolationKey& FixupNetworkIsolationKey(
+ const NetworkIsolationKey& network_isolation_key) {
+ if (respect_network_isolation_key_)
+ return network_isolation_key;
+ return empty_nik_;
+ }
+
std::unique_ptr<ReportingContext> context_;
bool shut_down_;
bool started_loading_from_store_;
bool initialized_;
std::vector<base::OnceClosure> task_backlog_;
+
+ bool respect_network_isolation_key_ = base::FeatureList::IsEnabled(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
+ // Allows returning a NetworkIsolationKey by reference when
+ // |respect_network_isolation_key_| is false.
+ NetworkIsolationKey empty_nik_;
+
base::WeakPtrFactory<ReportingServiceImpl> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(ReportingServiceImpl);
diff --git a/chromium/net/reporting/reporting_service.h b/chromium/net/reporting/reporting_service.h
index e2152361002..b32b3fd78a1 100644
--- a/chromium/net/reporting/reporting_service.h
+++ b/chromium/net/reporting/reporting_service.h
@@ -21,6 +21,7 @@ class Value;
namespace net {
+class NetworkIsolationKey;
class ReportingContext;
struct ReportingPolicy;
class URLRequestContext;
@@ -47,6 +48,8 @@ class NET_EXPORT ReportingService {
std::unique_ptr<ReportingContext> reporting_context);
// Queues a report for delivery. |url| is the URL that originated the report.
+ // |network_isolation_key| is used to restrict what reports can be merged, and
+ // for sending the report.
// |user_agent| is the User-Agent header that was used for the request.
// |group| is the endpoint group to which the report should be delivered.
// |type| is the type of the report. |body| is the body of the report.
@@ -54,6 +57,7 @@ class NET_EXPORT ReportingService {
// The Reporting system will take ownership of |body|; all other parameters
// will be copied.
virtual void QueueReport(const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
const std::string& user_agent,
const std::string& group,
const std::string& type,
@@ -63,6 +67,7 @@ class NET_EXPORT ReportingService {
// Processes a Report-To header. |url| is the URL that originated the header;
// |header_value| is the normalized value of the Report-To header.
virtual void ProcessHeader(const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
const std::string& header_value) = 0;
// Removes browsing data from the Reporting system. See
diff --git a/chromium/net/reporting/reporting_service_unittest.cc b/chromium/net/reporting/reporting_service_unittest.cc
index 0ac00ac44d7..99e226ddafe 100644
--- a/chromium/net/reporting/reporting_service_unittest.cc
+++ b/chromium/net/reporting/reporting_service_unittest.cc
@@ -9,8 +9,10 @@
#include "base/bind.h"
#include "base/memory/ptr_util.h"
+#include "base/test/scoped_feature_list.h"
#include "base/time/tick_clock.h"
#include "base/values.h"
+#include "net/base/features.h"
#include "net/base/network_isolation_key.h"
#include "net/reporting/mock_persistent_reporting_store.h"
#include "net/reporting/reporting_browsing_data_remover.h"
@@ -43,12 +45,21 @@ class ReportingServiceTest : public ::testing::TestWithParam<bool>,
const std::string kUserAgent_ = "Mozilla/1.0";
const std::string kGroup_ = "group";
const std::string kType_ = "type";
+ const NetworkIsolationKey kNik_ = NetworkIsolationKey(kOrigin_, kOrigin_);
+ const NetworkIsolationKey kNik2_ = NetworkIsolationKey(kOrigin2_, kOrigin2_);
const ReportingEndpointGroupKey kGroupKey_ =
- ReportingEndpointGroupKey(NetworkIsolationKey(), kOrigin_, kGroup_);
+ ReportingEndpointGroupKey(kNik_, kOrigin_, kGroup_);
const ReportingEndpointGroupKey kGroupKey2_ =
- ReportingEndpointGroupKey(NetworkIsolationKey(), kOrigin2_, kGroup_);
+ ReportingEndpointGroupKey(kNik2_, kOrigin2_, kGroup_);
ReportingServiceTest() {
+ feature_list_.InitAndEnableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+ Init();
+ }
+
+ // Initializes, or re-initializes, |service_| and its dependencies.
+ void Init() {
if (GetParam())
store_ = std::make_unique<MockPersistentReportingStore>();
else
@@ -73,6 +84,8 @@ class ReportingServiceTest : public ::testing::TestWithParam<bool>,
ReportingService* service() { return service_.get(); }
private:
+ base::test::ScopedFeatureList feature_list_;
+
base::SimpleTestClock clock_;
base::SimpleTestTickClock tick_clock_;
@@ -82,7 +95,7 @@ class ReportingServiceTest : public ::testing::TestWithParam<bool>,
};
TEST_P(ReportingServiceTest, QueueReport) {
- service()->QueueReport(kUrl_, kUserAgent_, kGroup_, kType_,
+ service()->QueueReport(kUrl_, kNik_, kUserAgent_, kGroup_, kType_,
std::make_unique<base::DictionaryValue>(), 0);
FinishLoading(true /* load_success */);
@@ -90,6 +103,7 @@ TEST_P(ReportingServiceTest, QueueReport) {
context()->cache()->GetReports(&reports);
ASSERT_EQ(1u, reports.size());
EXPECT_EQ(kUrl_, reports[0]->url);
+ EXPECT_EQ(kNik_, reports[0]->network_isolation_key);
EXPECT_EQ(kUserAgent_, reports[0]->user_agent);
EXPECT_EQ(kGroup_, reports[0]->group);
EXPECT_EQ(kType_, reports[0]->type);
@@ -98,7 +112,7 @@ TEST_P(ReportingServiceTest, QueueReport) {
TEST_P(ReportingServiceTest, QueueReportSanitizeUrl) {
// Same as kUrl_ but with username, password, and fragment.
GURL url = GURL("https://username:password@origin/path#fragment");
- service()->QueueReport(url, kUserAgent_, kGroup_, kType_,
+ service()->QueueReport(url, kNik_, kUserAgent_, kGroup_, kType_,
std::make_unique<base::DictionaryValue>(), 0);
FinishLoading(true /* load_success */);
@@ -106,6 +120,7 @@ TEST_P(ReportingServiceTest, QueueReportSanitizeUrl) {
context()->cache()->GetReports(&reports);
ASSERT_EQ(1u, reports.size());
EXPECT_EQ(kUrl_, reports[0]->url);
+ EXPECT_EQ(kNik_, reports[0]->network_isolation_key);
EXPECT_EQ(kUserAgent_, reports[0]->user_agent);
EXPECT_EQ(kGroup_, reports[0]->group);
EXPECT_EQ(kType_, reports[0]->type);
@@ -115,7 +130,7 @@ TEST_P(ReportingServiceTest, DontQueueReportInvalidUrl) {
GURL url = GURL("https://");
// This does not trigger an attempt to load from the store because the url
// is immediately rejected as invalid.
- service()->QueueReport(url, kUserAgent_, kGroup_, kType_,
+ service()->QueueReport(url, kNik_, kUserAgent_, kGroup_, kType_,
std::make_unique<base::DictionaryValue>(), 0);
std::vector<const ReportingReport*> reports;
@@ -123,21 +138,49 @@ TEST_P(ReportingServiceTest, DontQueueReportInvalidUrl) {
ASSERT_EQ(0u, reports.size());
}
+TEST_P(ReportingServiceTest, QueueReportNetworkIsolationKeyDisabled) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
+ // Re-create the store, so it reads the new feature value.
+ Init();
+
+ service()->QueueReport(kUrl_, kNik_, kUserAgent_, kGroup_, kType_,
+ std::make_unique<base::DictionaryValue>(), 0);
+ FinishLoading(true /* load_success */);
+
+ std::vector<const ReportingReport*> reports;
+ context()->cache()->GetReports(&reports);
+ ASSERT_EQ(1u, reports.size());
+
+ // NetworkIsolationKey should be empty, instead of kNik_;
+ EXPECT_EQ(NetworkIsolationKey(), reports[0]->network_isolation_key);
+ EXPECT_NE(kNik_, reports[0]->network_isolation_key);
+
+ EXPECT_EQ(kUrl_, reports[0]->url);
+ EXPECT_EQ(kUserAgent_, reports[0]->user_agent);
+ EXPECT_EQ(kGroup_, reports[0]->group);
+ EXPECT_EQ(kType_, reports[0]->type);
+}
+
TEST_P(ReportingServiceTest, ProcessHeader) {
- service()->ProcessHeader(kUrl_, "{\"endpoints\":[{\"url\":\"" +
- kEndpoint_.spec() +
- "\"}],"
- "\"group\":\"" +
- kGroup_ +
- "\","
- "\"max_age\":86400}");
+ service()->ProcessHeader(kUrl_, kNik_,
+ "{\"endpoints\":[{\"url\":\"" + kEndpoint_.spec() +
+ "\"}],"
+ "\"group\":\"" +
+ kGroup_ +
+ "\","
+ "\"max_age\":86400}");
FinishLoading(true /* load_success */);
EXPECT_EQ(1u, context()->cache()->GetEndpointCount());
+ EXPECT_TRUE(context()->cache()->GetEndpointForTesting(
+ ReportingEndpointGroupKey(kNik_, kOrigin_, kGroup_), kEndpoint_));
}
TEST_P(ReportingServiceTest, ProcessHeaderPathAbsolute) {
- service()->ProcessHeader(kUrl_,
+ service()->ProcessHeader(kUrl_, kNik_,
"{\"endpoints\":[{\"url\":\"/path-absolute\"}],"
"\"group\":\"" +
kGroup_ +
@@ -159,7 +202,7 @@ TEST_P(ReportingServiceTest, ProcessHeader_TooLong) {
"\"junk\":\"" + std::string(32 * 1024, 'a') + "\"}";
// This does not trigger an attempt to load from the store because the header
// is immediately rejected as invalid.
- service()->ProcessHeader(kUrl_, header_too_long);
+ service()->ProcessHeader(kUrl_, kNik_, header_too_long);
EXPECT_EQ(0u, context()->cache()->GetEndpointCount());
}
@@ -175,11 +218,36 @@ TEST_P(ReportingServiceTest, ProcessHeader_TooDeep) {
"\"junk\":[[[[[[[[[[]]]]]]]]]]}";
// This does not trigger an attempt to load from the store because the header
// is immediately rejected as invalid.
- service()->ProcessHeader(kUrl_, header_too_deep);
+ service()->ProcessHeader(kUrl_, kNik_, header_too_deep);
EXPECT_EQ(0u, context()->cache()->GetEndpointCount());
}
+TEST_P(ReportingServiceTest, ProcessHeaderNetworkIsolationKeyDisabled) {
+ base::test::ScopedFeatureList feature_list;
+ feature_list.InitAndDisableFeature(
+ features::kPartitionNelAndReportingByNetworkIsolationKey);
+
+ // Re-create the store, so it reads the new feature value.
+ Init();
+
+ service()->ProcessHeader(kUrl_, kNik_,
+ "{\"endpoints\":[{\"url\":\"" + kEndpoint_.spec() +
+ "\"}],"
+ "\"group\":\"" +
+ kGroup_ +
+ "\","
+ "\"max_age\":86400}");
+ FinishLoading(true /* load_success */);
+
+ EXPECT_EQ(1u, context()->cache()->GetEndpointCount());
+ EXPECT_FALSE(context()->cache()->GetEndpointForTesting(
+ ReportingEndpointGroupKey(kNik_, kOrigin_, kGroup_), kEndpoint_));
+ EXPECT_TRUE(context()->cache()->GetEndpointForTesting(
+ ReportingEndpointGroupKey(NetworkIsolationKey(), kOrigin_, kGroup_),
+ kEndpoint_));
+}
+
TEST_P(ReportingServiceTest, WriteToStore) {
if (!store())
return;
@@ -188,13 +256,13 @@ TEST_P(ReportingServiceTest, WriteToStore) {
// This first call to any public method triggers a load. The load will block
// until we call FinishLoading.
- service()->ProcessHeader(kUrl_, "{\"endpoints\":[{\"url\":\"" +
- kEndpoint_.spec() +
- "\"}],"
- "\"group\":\"" +
- kGroup_ +
- "\","
- "\"max_age\":86400}");
+ service()->ProcessHeader(kUrl_, kNik_,
+ "{\"endpoints\":[{\"url\":\"" + kEndpoint_.spec() +
+ "\"}],"
+ "\"group\":\"" +
+ kGroup_ +
+ "\","
+ "\"max_age\":86400}");
expected_commands.emplace_back(CommandType::LOAD_REPORTING_CLIENTS);
EXPECT_THAT(store()->GetAllCommands(),
testing::UnorderedElementsAreArray(expected_commands));
@@ -209,13 +277,13 @@ TEST_P(ReportingServiceTest, WriteToStore) {
EXPECT_THAT(store()->GetAllCommands(),
testing::UnorderedElementsAreArray(expected_commands));
- service()->ProcessHeader(kUrl2_, "{\"endpoints\":[{\"url\":\"" +
- kEndpoint_.spec() +
- "\"}],"
- "\"group\":\"" +
- kGroup_ +
- "\","
- "\"max_age\":86400}");
+ service()->ProcessHeader(kUrl2_, kNik2_,
+ "{\"endpoints\":[{\"url\":\"" + kEndpoint_.spec() +
+ "\"}],"
+ "\"group\":\"" +
+ kGroup_ +
+ "\","
+ "\"max_age\":86400}");
expected_commands.emplace_back(CommandType::ADD_REPORTING_ENDPOINT,
kGroupKey2_, kEndpoint_);
expected_commands.emplace_back(CommandType::ADD_REPORTING_ENDPOINT_GROUP,
@@ -223,7 +291,7 @@ TEST_P(ReportingServiceTest, WriteToStore) {
EXPECT_THAT(store()->GetAllCommands(),
testing::UnorderedElementsAreArray(expected_commands));
- service()->QueueReport(kUrl_, kUserAgent_, kGroup_, kType_,
+ service()->QueueReport(kUrl_, kNik_, kUserAgent_, kGroup_, kType_,
std::make_unique<base::DictionaryValue>(), 0);
expected_commands.emplace_back(
CommandType::UPDATE_REPORTING_ENDPOINT_GROUP_ACCESS_TIME, kGroupKey_);
@@ -261,28 +329,28 @@ TEST_P(ReportingServiceTest, WaitUntilLoadFinishesBeforeWritingToStore) {
// This first call to any public method triggers a load. The load will block
// until we call FinishLoading.
- service()->ProcessHeader(kUrl_, "{\"endpoints\":[{\"url\":\"" +
- kEndpoint_.spec() +
- "\"}],"
- "\"group\":\"" +
- kGroup_ +
- "\","
- "\"max_age\":86400}");
+ service()->ProcessHeader(kUrl_, kNik_,
+ "{\"endpoints\":[{\"url\":\"" + kEndpoint_.spec() +
+ "\"}],"
+ "\"group\":\"" +
+ kGroup_ +
+ "\","
+ "\"max_age\":86400}");
expected_commands.emplace_back(CommandType::LOAD_REPORTING_CLIENTS);
EXPECT_THAT(store()->GetAllCommands(),
testing::UnorderedElementsAreArray(expected_commands));
- service()->ProcessHeader(kUrl2_, "{\"endpoints\":[{\"url\":\"" +
- kEndpoint_.spec() +
- "\"}],"
- "\"group\":\"" +
- kGroup_ +
- "\","
- "\"max_age\":86400}");
+ service()->ProcessHeader(kUrl2_, kNik2_,
+ "{\"endpoints\":[{\"url\":\"" + kEndpoint_.spec() +
+ "\"}],"
+ "\"group\":\"" +
+ kGroup_ +
+ "\","
+ "\"max_age\":86400}");
EXPECT_THAT(store()->GetAllCommands(),
testing::UnorderedElementsAreArray(expected_commands));
- service()->QueueReport(kUrl_, kUserAgent_, kGroup_, kType_,
+ service()->QueueReport(kUrl_, kNik_, kUserAgent_, kGroup_, kType_,
std::make_unique<base::DictionaryValue>(), 0);
EXPECT_THAT(store()->GetAllCommands(),
testing::UnorderedElementsAreArray(expected_commands));
diff --git a/chromium/net/reporting/reporting_test_util.cc b/chromium/net/reporting/reporting_test_util.cc
index fc3b0150182..2128f58251d 100644
--- a/chromium/net/reporting/reporting_test_util.cc
+++ b/chromium/net/reporting/reporting_test_util.cc
@@ -291,21 +291,18 @@ base::TimeTicks ReportingTestBase::tomorrow() {
TestReportingService::Report::Report() = default;
-TestReportingService::Report::Report(Report&& other)
- : url(other.url),
- user_agent(other.user_agent),
- group(other.group),
- type(other.type),
- body(std::move(other.body)),
- depth(other.depth) {}
-
-TestReportingService::Report::Report(const GURL& url,
- const std::string& user_agent,
- const std::string& group,
- const std::string& type,
- std::unique_ptr<const base::Value> body,
- int depth)
+TestReportingService::Report::Report(Report&& other) = default;
+
+TestReportingService::Report::Report(
+ const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
+ const std::string& user_agent,
+ const std::string& group,
+ const std::string& type,
+ std::unique_ptr<const base::Value> body,
+ int depth)
: url(url),
+ network_isolation_key(network_isolation_key),
user_agent(user_agent),
group(group),
type(type),
@@ -318,18 +315,22 @@ TestReportingService::TestReportingService() = default;
TestReportingService::~TestReportingService() = default;
-void TestReportingService::QueueReport(const GURL& url,
- const std::string& user_agent,
- const std::string& group,
- const std::string& type,
- std::unique_ptr<const base::Value> body,
- int depth) {
- reports_.push_back(
- Report(url, user_agent, group, type, std::move(body), depth));
+void TestReportingService::QueueReport(
+ const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
+ const std::string& user_agent,
+ const std::string& group,
+ const std::string& type,
+ std::unique_ptr<const base::Value> body,
+ int depth) {
+ reports_.emplace_back(Report(url, network_isolation_key, user_agent, group,
+ type, std::move(body), depth));
}
-void TestReportingService::ProcessHeader(const GURL& url,
- const std::string& header_value) {
+void TestReportingService::ProcessHeader(
+ const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
+ const std::string& header_value) {
NOTREACHED();
}
diff --git a/chromium/net/reporting/reporting_test_util.h b/chromium/net/reporting/reporting_test_util.h
index e58f449154a..2c5c312bc12 100644
--- a/chromium/net/reporting/reporting_test_util.h
+++ b/chromium/net/reporting/reporting_test_util.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/test/simple_test_clock.h"
#include "base/test/simple_test_tick_clock.h"
+#include "net/base/network_isolation_key.h"
#include "net/base/rand_callback.h"
#include "net/reporting/reporting_cache.h"
#include "net/reporting/reporting_context.h"
@@ -283,6 +284,7 @@ class TestReportingService : public ReportingService {
Report(Report&& other);
Report(const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
const std::string& user_agent,
const std::string& group,
const std::string& type,
@@ -292,6 +294,7 @@ class TestReportingService : public ReportingService {
~Report();
GURL url;
+ NetworkIsolationKey network_isolation_key;
std::string user_agent;
std::string group;
std::string type;
@@ -311,13 +314,16 @@ class TestReportingService : public ReportingService {
~TestReportingService() override;
void QueueReport(const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
const std::string& user_agent,
const std::string& group,
const std::string& type,
std::unique_ptr<const base::Value> body,
int depth) override;
- void ProcessHeader(const GURL& url, const std::string& header_value) override;
+ void ProcessHeader(const GURL& url,
+ const NetworkIsolationKey& network_isolation_key,
+ const std::string& header_value) override;
void RemoveBrowsingData(
uint64_t data_type_mask,
diff --git a/chromium/net/reporting/reporting_uploader.cc b/chromium/net/reporting/reporting_uploader.cc
index a54bfc4fcbe..49c7eac6b36 100644
--- a/chromium/net/reporting/reporting_uploader.cc
+++ b/chromium/net/reporting/reporting_uploader.cc
@@ -156,8 +156,7 @@ class ReportingUploaderImpl : public ReportingUploader, URLRequest::Delegate {
upload->request->SetLoadFlags(LOAD_DISABLE_CACHE);
upload->request->set_allow_credentials(false);
upload->request->set_isolation_info(IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing,
- upload->network_isolation_key));
+ IsolationInfo::RequestType::kOther, upload->network_isolation_key));
upload->request->SetExtraRequestHeaderByName(
HttpRequestHeaders::kOrigin, upload->report_origin.Serialize(), true);
@@ -189,8 +188,7 @@ class ReportingUploaderImpl : public ReportingUploader, URLRequest::Delegate {
upload->request->SetLoadFlags(LOAD_DISABLE_CACHE);
upload->request->set_allow_credentials(false);
upload->request->set_isolation_info(IsolationInfo::CreatePartial(
- IsolationInfo::RedirectMode::kUpdateNothing,
- upload->network_isolation_key));
+ IsolationInfo::RequestType::kOther, upload->network_isolation_key));
upload->request->SetExtraRequestHeaderByName(
HttpRequestHeaders::kContentType, kUploadContentType, true);
diff --git a/chromium/net/server/http_server_unittest.cc b/chromium/net/server/http_server_unittest.cc
index 4101e825dd5..6268bc96d71 100644
--- a/chromium/net/server/http_server_unittest.cc
+++ b/chromium/net/server/http_server_unittest.cc
@@ -13,7 +13,6 @@
#include "base/auto_reset.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/compiler_specific.h"
diff --git a/chromium/net/socket/client_socket_handle.cc b/chromium/net/socket/client_socket_handle.cc
index f269dce0b3a..525a22f0441 100644
--- a/chromium/net/socket/client_socket_handle.cc
+++ b/chromium/net/socket/client_socket_handle.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/compiler_specific.h"
#include "base/notreached.h"
diff --git a/chromium/net/socket/client_socket_pool_base_unittest.cc b/chromium/net/socket/client_socket_pool_base_unittest.cc
index 1f41a49911c..483fc82cd96 100644
--- a/chromium/net/socket/client_socket_pool_base_unittest.cc
+++ b/chromium/net/socket/client_socket_pool_base_unittest.cc
@@ -9,8 +9,8 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
diff --git a/chromium/net/socket/datagram_client_socket.h b/chromium/net/socket/datagram_client_socket.h
index ae344024ef5..9ec34829de1 100644
--- a/chromium/net/socket/datagram_client_socket.h
+++ b/chromium/net/socket/datagram_client_socket.h
@@ -132,6 +132,10 @@ class NET_EXPORT_PRIVATE DatagramClientSocket : public DatagramSocket,
// ConnectUsingDefaultNetwork().
// Returns a network error code.
virtual int SetMulticastInterface(uint32_t interface_index) = 0;
+
+ // Set iOS Network Service Type for socket option SO_NET_SERVICE_TYPE.
+ // No-op by default.
+ virtual void SetIOSNetworkServiceType(int ios_network_service_type) {}
};
} // namespace net
diff --git a/chromium/net/socket/socket_test_util.cc b/chromium/net/socket/socket_test_util.cc
index ce05c02e336..2dcc15e539c 100644
--- a/chromium/net/socket/socket_test_util.cc
+++ b/chromium/net/socket/socket_test_util.cc
@@ -14,7 +14,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
diff --git a/chromium/net/socket/ssl_client_socket_impl.cc b/chromium/net/socket/ssl_client_socket_impl.cc
index 4381f3ec63a..d29204c414f 100644
--- a/chromium/net/socket/ssl_client_socket_impl.cc
+++ b/chromium/net/socket/ssl_client_socket_impl.cc
@@ -45,6 +45,7 @@
#include "net/cert/ct_verifier.h"
#include "net/cert/internal/parse_certificate.h"
#include "net/cert/sct_auditing_delegate.h"
+#include "net/cert/sct_status_flags.h"
#include "net/cert/x509_certificate_net_log_param.h"
#include "net/cert/x509_util.h"
#include "net/der/parse_values.h"
@@ -604,7 +605,8 @@ bool SSLClientSocketImpl::GetSSLInfo(SSLInfo* ssl_info) {
ssl_info->pinning_failure_log = pinning_failure_log_;
ssl_info->ocsp_result = server_cert_verify_result_.ocsp_result;
ssl_info->is_fatal_cert_error = is_fatal_cert_error_;
- AddCTInfoToSSLInfo(ssl_info);
+ ssl_info->signed_certificate_timestamps = server_cert_verify_result_.scts;
+ ssl_info->ct_policy_compliance = server_cert_verify_result_.policy_compliance;
const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl_.get());
CHECK(cipher);
@@ -1201,7 +1203,8 @@ ssl_verify_result_t SSLClientSocketImpl::HandleVerifyResult() {
host_and_port_, server_cert_verify_result_.is_issued_by_known_root,
server_cert_verify_result_.public_key_hashes, server_cert_.get(),
server_cert_verify_result_.verified_cert.get(),
- TransportSecurityState::ENABLE_PIN_REPORTS, &pinning_failure_log_);
+ TransportSecurityState::ENABLE_PIN_REPORTS,
+ ssl_config_.network_isolation_key, &pinning_failure_log_);
switch (pin_validity) {
case TransportSecurityState::PKPStatus::VIOLATED:
server_cert_verify_result_.cert_status |=
@@ -1542,19 +1545,21 @@ int SSLClientSocketImpl::VerifyCT() {
// external communication.
context_->cert_transparency_verifier()->Verify(
host_and_port().host(), server_cert_verify_result_.verified_cert.get(),
- ocsp_response, sct_list, &ct_verify_result_.scts, net_log_);
+ ocsp_response, sct_list, &server_cert_verify_result_.scts, net_log_);
- ct::SCTList verified_scts =
- ct::SCTsMatchingStatus(ct_verify_result_.scts, ct::SCT_STATUS_OK);
-
- ct_verify_result_.policy_compliance =
+ ct::SCTList verified_scts;
+ for (const auto& sct_and_status : server_cert_verify_result_.scts) {
+ if (sct_and_status.status == ct::SCT_STATUS_OK)
+ verified_scts.push_back(sct_and_status.sct);
+ }
+ server_cert_verify_result_.policy_compliance =
context_->ct_policy_enforcer()->CheckCompliance(
server_cert_verify_result_.verified_cert.get(), verified_scts,
net_log_);
if (server_cert_verify_result_.cert_status & CERT_STATUS_IS_EV) {
- if (ct_verify_result_.policy_compliance !=
+ if (server_cert_verify_result_.policy_compliance !=
ct::CTPolicyCompliance::CT_POLICY_COMPLIES_VIA_SCTS &&
- ct_verify_result_.policy_compliance !=
+ server_cert_verify_result_.policy_compliance !=
ct::CTPolicyCompliance::CT_POLICY_BUILD_NOT_TIMELY) {
server_cert_verify_result_.cert_status |=
CERT_STATUS_CT_COMPLIANCE_FAILED;
@@ -1566,7 +1571,7 @@ int SSLClientSocketImpl::VerifyCT() {
// compliance.
if (server_cert_verify_result_.is_issued_by_known_root) {
UMA_HISTOGRAM_ENUMERATION("Net.CertificateTransparency.EVCompliance2.SSL",
- ct_verify_result_.policy_compliance,
+ server_cert_verify_result_.policy_compliance,
ct::CTPolicyCompliance::CT_POLICY_COUNT);
}
}
@@ -1576,7 +1581,7 @@ int SSLClientSocketImpl::VerifyCT() {
if (server_cert_verify_result_.is_issued_by_known_root) {
UMA_HISTOGRAM_ENUMERATION(
"Net.CertificateTransparency.ConnectionComplianceStatus2.SSL",
- ct_verify_result_.policy_compliance,
+ server_cert_verify_result_.policy_compliance,
ct::CTPolicyCompliance::CT_POLICY_COUNT);
}
@@ -1585,12 +1590,11 @@ int SSLClientSocketImpl::VerifyCT() {
host_and_port_, server_cert_verify_result_.is_issued_by_known_root,
server_cert_verify_result_.public_key_hashes,
server_cert_verify_result_.verified_cert.get(), server_cert_.get(),
- ct_verify_result_.scts,
+ server_cert_verify_result_.scts,
TransportSecurityState::ENABLE_EXPECT_CT_REPORTS,
- ct_verify_result_.policy_compliance,
+ server_cert_verify_result_.policy_compliance,
ssl_config_.network_isolation_key);
if (ct_requirement_status != TransportSecurityState::CT_NOT_REQUIRED) {
- ct_verify_result_.policy_compliance_required = true;
if (server_cert_verify_result_.is_issued_by_known_root) {
// Record the CT compliance of connections for which compliance is
// required; this helps answer the question: "Of all connections that are
@@ -1598,11 +1602,9 @@ int SSLClientSocketImpl::VerifyCT() {
UMA_HISTOGRAM_ENUMERATION(
"Net.CertificateTransparency.CTRequiredConnectionComplianceStatus2."
"SSL",
- ct_verify_result_.policy_compliance,
+ server_cert_verify_result_.policy_compliance,
ct::CTPolicyCompliance::CT_POLICY_COUNT);
}
- } else {
- ct_verify_result_.policy_compliance_required = false;
}
if (context_->sct_auditing_delegate() &&
@@ -1610,7 +1612,7 @@ int SSLClientSocketImpl::VerifyCT() {
server_cert_verify_result_.is_issued_by_known_root) {
context_->sct_auditing_delegate()->MaybeEnqueueReport(
host_and_port_, server_cert_verify_result_.verified_cert.get(),
- ct_verify_result_.scts);
+ server_cert_verify_result_.scts);
}
switch (ct_requirement_status) {
@@ -1706,10 +1708,6 @@ int SSLClientSocketImpl::NewSessionCallback(SSL_SESSION* session) {
return 1;
}
-void SSLClientSocketImpl::AddCTInfoToSSLInfo(SSLInfo* ssl_info) const {
- ssl_info->UpdateCertificateTransparencyInfo(ct_verify_result_);
-}
-
SSLClientSessionCache::Key SSLClientSocketImpl::GetSessionCacheKey(
base::Optional<IPAddress> dest_ip_addr) const {
SSLClientSessionCache::Key key;
diff --git a/chromium/net/socket/ssl_client_socket_impl.h b/chromium/net/socket/ssl_client_socket_impl.h
index 7388274b5b6..d01133268d2 100644
--- a/chromium/net/socket/ssl_client_socket_impl.h
+++ b/chromium/net/socket/ssl_client_socket_impl.h
@@ -22,7 +22,6 @@
#include "net/base/io_buffer.h"
#include "net/cert/cert_verifier.h"
#include "net/cert/cert_verify_result.h"
-#include "net/cert/ct_verify_result.h"
#include "net/log/net_log_with_source.h"
#include "net/socket/next_proto.h"
#include "net/socket/socket_bio_adapter.h"
@@ -158,14 +157,6 @@ class SSLClientSocketImpl : public SSLClientSocket,
// Called from the SSL layer whenever a new session is established.
int NewSessionCallback(SSL_SESSION* session);
- // Adds the Certificate Transparency info from ct_verify_result_ to
- // |ssl_info|.
- // SCTs are held in three separate vectors in ct_verify_result, each
- // vetor representing a particular verification state, this method associates
- // each of the SCTs with the corresponding SCTVerifyStatus as it adds it to
- // the |ssl_info|.signed_certificate_timestamps list.
- void AddCTInfoToSSLInfo(SSLInfo* ssl_info) const;
-
// Returns a session cache key for this socket.
SSLClientSessionCache::Key GetSessionCacheKey(
base::Optional<IPAddress> dest_ip_addr) const;
@@ -255,9 +246,6 @@ class SSLClientSocketImpl : public SSLClientSocket,
// Result from Cert Verifier.
int cert_verification_result_;
- // Certificate Transparency: Verifier and result holder.
- ct::CTVerifyResult ct_verify_result_;
-
// OpenSSL stuff
bssl::UniquePtr<SSL> ssl_;
diff --git a/chromium/net/socket/ssl_client_socket_unittest.cc b/chromium/net/socket/ssl_client_socket_unittest.cc
index 9063ef48450..0a3fe64d9b9 100644
--- a/chromium/net/socket/ssl_client_socket_unittest.cc
+++ b/chromium/net/socket/ssl_client_socket_unittest.cc
@@ -4319,76 +4319,6 @@ TEST_P(SSLClientSocketVersionTest, CTRequiredHistogramNonCompliant) {
static_cast<int>(ct::CTPolicyCompliance::CT_POLICY_NOT_ENOUGH_SCTS), 1);
}
-// Test that when CT is required (in this case, by an Expect-CT opt-in) but the
-// connection is not compliant, the relevant flag is set on the SSLInfo.
-TEST_P(SSLClientSocketVersionTest, CTRequirementsFlagNotMet) {
- ASSERT_TRUE(
- StartEmbeddedTestServer(EmbeddedTestServer::CERT_OK, GetServerConfig()));
- scoped_refptr<X509Certificate> server_cert =
- embedded_test_server()->GetCertificate();
-
- // Certificate is trusted and chains to a public root.
- CertVerifyResult verify_result;
- verify_result.is_issued_by_known_root = true;
- verify_result.verified_cert = server_cert;
- verify_result.public_key_hashes =
- MakeHashValueVector(kGoodHashValueVectorInput);
- cert_verifier_->AddResultForCert(server_cert.get(), verify_result, OK);
-
- // Set up the Expect-CT opt-in.
- const base::Time current_time(base::Time::Now());
- const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000);
- transport_security_state_->AddExpectCT(host_port_pair().host(), expiry,
- true /* enforce */, GURL(),
- NetworkIsolationKey());
-
- EXPECT_CALL(*ct_policy_enforcer_, CheckCompliance(server_cert.get(), _, _))
- .WillRepeatedly(
- Return(ct::CTPolicyCompliance::CT_POLICY_NOT_ENOUGH_SCTS));
-
- SSLConfig ssl_config;
- int rv;
- ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
- SSLInfo ssl_info;
- ASSERT_TRUE(sock_->GetSSLInfo(&ssl_info));
- EXPECT_TRUE(ssl_info.ct_policy_compliance_required);
-}
-
-// Test that when CT is required (in this case, by an Expect-CT opt-in) and the
-// connection is compliant, the relevant flag is set on the SSLInfo.
-TEST_P(SSLClientSocketVersionTest, CTRequirementsFlagMet) {
- ASSERT_TRUE(
- StartEmbeddedTestServer(EmbeddedTestServer::CERT_OK, GetServerConfig()));
- scoped_refptr<X509Certificate> server_cert =
- embedded_test_server()->GetCertificate();
-
- // Certificate is trusted and chains to a public root.
- CertVerifyResult verify_result;
- verify_result.is_issued_by_known_root = true;
- verify_result.verified_cert = server_cert;
- verify_result.public_key_hashes =
- MakeHashValueVector(kGoodHashValueVectorInput);
- cert_verifier_->AddResultForCert(server_cert.get(), verify_result, OK);
-
- // Set up the Expect-CT opt-in.
- const base::Time current_time(base::Time::Now());
- const base::Time expiry = current_time + base::TimeDelta::FromSeconds(1000);
- transport_security_state_->AddExpectCT(host_port_pair().host(), expiry,
- true /* enforce */, GURL(),
- NetworkIsolationKey());
-
- EXPECT_CALL(*ct_policy_enforcer_, CheckCompliance(server_cert.get(), _, _))
- .WillRepeatedly(
- Return(ct::CTPolicyCompliance::CT_POLICY_COMPLIES_VIA_SCTS));
-
- SSLConfig ssl_config;
- int rv;
- ASSERT_TRUE(CreateAndConnectSSLClientSocket(ssl_config, &rv));
- SSLInfo ssl_info;
- ASSERT_TRUE(sock_->GetSSLInfo(&ssl_info));
- EXPECT_TRUE(ssl_info.ct_policy_compliance_required);
-}
-
// Test that when CT is required (in this case, by a CT delegate), the CT
// required histogram is not recorded for a locally installed root.
TEST_P(SSLClientSocketVersionTest, CTRequiredHistogramNonCompliantLocalRoot) {
diff --git a/chromium/net/socket/ssl_connect_job.cc b/chromium/net/socket/ssl_connect_job.cc
index 87f752a0fbe..fe29b37b5e5 100644
--- a/chromium/net/socket/ssl_connect_job.cc
+++ b/chromium/net/socket/ssl_connect_job.cc
@@ -8,7 +8,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
diff --git a/chromium/net/socket/tcp_client_socket_unittest.cc b/chromium/net/socket/tcp_client_socket_unittest.cc
index 8d7ce636d01..5b3f52124b3 100644
--- a/chromium/net/socket/tcp_client_socket_unittest.cc
+++ b/chromium/net/socket/tcp_client_socket_unittest.cc
@@ -13,7 +13,7 @@
#include "base/power_monitor/power_monitor.h"
#include "base/power_monitor/power_monitor_source.h"
#include "base/strings/string_number_conversions.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "build/build_config.h"
diff --git a/chromium/net/socket/tcp_server_socket.cc b/chromium/net/socket/tcp_server_socket.cc
index 3b9624b86f7..f19c8b5b40e 100644
--- a/chromium/net/socket/tcp_server_socket.cc
+++ b/chromium/net/socket/tcp_server_socket.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check.h"
#include "base/notreached.h"
#include "net/base/net_errors.h"
diff --git a/chromium/net/socket/tcp_socket_unittest.cc b/chromium/net/socket/tcp_socket_unittest.cc
index c211c6bb7cb..74b60b784c9 100644
--- a/chromium/net/socket/tcp_socket_unittest.cc
+++ b/chromium/net/socket/tcp_socket_unittest.cc
@@ -13,7 +13,7 @@
#include "base/bind.h"
#include "base/memory/ref_counted.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "net/base/address_list.h"
diff --git a/chromium/net/socket/transport_client_socket_pool_unittest.cc b/chromium/net/socket/transport_client_socket_pool_unittest.cc
index 89cc8a4c97d..1ef24e0c16f 100644
--- a/chromium/net/socket/transport_client_socket_pool_unittest.cc
+++ b/chromium/net/socket/transport_client_socket_pool_unittest.cc
@@ -7,13 +7,13 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/memory/ref_counted.h"
#include "base/optional.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/platform_thread.h"
#include "build/build_config.h"
diff --git a/chromium/net/socket/udp_client_socket.cc b/chromium/net/socket/udp_client_socket.cc
index a0709a08c2c..928a0458459 100644
--- a/chromium/net/socket/udp_client_socket.cc
+++ b/chromium/net/socket/udp_client_socket.cc
@@ -189,4 +189,10 @@ void UDPClientSocket::EnableRecvOptimization() {
#endif
}
+void UDPClientSocket::SetIOSNetworkServiceType(int ios_network_service_type) {
+#if defined(OS_POSIX)
+ socket_.SetIOSNetworkServiceType(ios_network_service_type);
+#endif
+}
+
} // namespace net
diff --git a/chromium/net/socket/udp_client_socket.h b/chromium/net/socket/udp_client_socket.h
index 585f684c594..d8a7348c549 100644
--- a/chromium/net/socket/udp_client_socket.h
+++ b/chromium/net/socket/udp_client_socket.h
@@ -73,6 +73,7 @@ class NET_EXPORT_PRIVATE UDPClientSocket : public DatagramClientSocket {
void SetSendmmsgEnabled(bool enabled) override;
void SetWriteBatchingActive(bool active) override;
int SetMulticastInterface(uint32_t interface_index) override;
+ void SetIOSNetworkServiceType(int ios_network_service_type) override;
private:
UDPSocket socket_;
diff --git a/chromium/net/socket/udp_socket_posix.cc b/chromium/net/socket/udp_socket_posix.cc
index 71265568be5..525307c46eb 100644
--- a/chromium/net/socket/udp_socket_posix.cc
+++ b/chromium/net/socket/udp_socket_posix.cc
@@ -1450,4 +1450,17 @@ int UDPSocketPosix::ResetWrittenBytes() {
return bytes;
}
+int UDPSocketPosix::SetIOSNetworkServiceType(int ios_network_service_type) {
+ if (ios_network_service_type == 0) {
+ return OK;
+ }
+#if defined(OS_IOS)
+ if (setsockopt(socket_, SOL_SOCKET, SO_NET_SERVICE_TYPE,
+ &ios_network_service_type, sizeof(ios_network_service_type))) {
+ return MapSystemError(errno);
+ }
+#endif // defined(OS_IOS)
+ return OK;
+}
+
} // namespace net
diff --git a/chromium/net/socket/udp_socket_posix.h b/chromium/net/socket/udp_socket_posix.h
index 8fecbc9c5b0..ba011e7bd11 100644
--- a/chromium/net/socket/udp_socket_posix.h
+++ b/chromium/net/socket/udp_socket_posix.h
@@ -388,6 +388,9 @@ class NET_EXPORT UDPSocketPosix {
experimental_recv_optimization_enabled_ = true;
}
+ // Sets iOS Network Service Type for option SO_NET_SERVICE_TYPE.
+ int SetIOSNetworkServiceType(int ios_network_service_type);
+
protected:
// WriteAsync batching etc. are to improve throughput of large high
// bandwidth uploads.
diff --git a/chromium/net/socket/websocket_transport_client_socket_pool_unittest.cc b/chromium/net/socket/websocket_transport_client_socket_pool_unittest.cc
index 1466159873e..002b7c22e83 100644
--- a/chromium/net/socket/websocket_transport_client_socket_pool_unittest.cc
+++ b/chromium/net/socket/websocket_transport_client_socket_pool_unittest.cc
@@ -7,8 +7,8 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/optional.h"
#include "base/run_loop.h"
diff --git a/chromium/net/spdy/DIR_METADATA b/chromium/net/spdy/DIR_METADATA
new file mode 100644
index 00000000000..c94ca62f8a7
--- /dev/null
+++ b/chromium/net/spdy/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>HTTP2"
+} \ No newline at end of file
diff --git a/chromium/net/spdy/OWNERS b/chromium/net/spdy/OWNERS
index e041764c5b6..c8e47768694 100644
--- a/chromium/net/spdy/OWNERS
+++ b/chromium/net/spdy/OWNERS
@@ -3,5 +3,3 @@ bnc@chromium.org
dahollings@chromium.org
diannahu@chromium.org
yasong@chromium.org
-
-# COMPONENT: Internals>Network>HTTP2
diff --git a/chromium/net/spdy/bidirectional_stream_spdy_impl.cc b/chromium/net/spdy/bidirectional_stream_spdy_impl.cc
index ba029b04faa..193a3fdf880 100644
--- a/chromium/net/spdy/bidirectional_stream_spdy_impl.cc
+++ b/chromium/net/spdy/bidirectional_stream_spdy_impl.cc
@@ -207,8 +207,8 @@ void BidirectionalStreamSpdyImpl::OnHeadersSent() {
}
void BidirectionalStreamSpdyImpl::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {
DCHECK(stream_);
if (delegate_)
@@ -246,7 +246,7 @@ void BidirectionalStreamSpdyImpl::OnDataSent() {
}
void BidirectionalStreamSpdyImpl::OnTrailers(
- const spdy::SpdyHeaderBlock& trailers) {
+ const spdy::Http2HeaderBlock& trailers) {
DCHECK(stream_);
DCHECK(!stream_closed_);
@@ -291,7 +291,7 @@ NetLogSource BidirectionalStreamSpdyImpl::source_dependency() const {
}
int BidirectionalStreamSpdyImpl::SendRequestHeadersHelper() {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
HttpRequestInfo http_request_info;
http_request_info.url = request_info_->url;
http_request_info.method = request_info_->method;
diff --git a/chromium/net/spdy/bidirectional_stream_spdy_impl.h b/chromium/net/spdy/bidirectional_stream_spdy_impl.h
index 8ee9a67528b..2059147dc3f 100644
--- a/chromium/net/spdy/bidirectional_stream_spdy_impl.h
+++ b/chromium/net/spdy/bidirectional_stream_spdy_impl.h
@@ -22,15 +22,12 @@
#include "net/spdy/spdy_read_queue.h"
#include "net/spdy/spdy_session.h"
#include "net/spdy/spdy_stream.h"
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace base {
class OneShotTimer;
} // namespace base
-namespace spdy {
-class SpdyHeaderBlock;
-} // namespace spdy
-
namespace net {
class IOBuffer;
@@ -66,11 +63,11 @@ class NET_EXPORT_PRIVATE BidirectionalStreamSpdyImpl
// SpdyStream::Delegate implementation:
void OnHeadersSent() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override;
void OnDataSent() override;
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override;
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override;
void OnClose(int status) override;
bool CanGreaseFrameType() const override;
NetLogSource source_dependency() const override;
diff --git a/chromium/net/spdy/bidirectional_stream_spdy_impl_unittest.cc b/chromium/net/spdy/bidirectional_stream_spdy_impl_unittest.cc
index 95fbca97059..ff93e27a11d 100644
--- a/chromium/net/spdy/bidirectional_stream_spdy_impl_unittest.cc
+++ b/chromium/net/spdy/bidirectional_stream_spdy_impl_unittest.cc
@@ -93,7 +93,7 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
}
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override {
+ const spdy::Http2HeaderBlock& response_headers) override {
CHECK(!on_failed_called_);
CHECK(!not_expect_callback_);
response_headers_ = response_headers.Clone();
@@ -118,7 +118,7 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
on_data_sent_count_++;
}
- void OnTrailersReceived(const spdy::SpdyHeaderBlock& trailers) override {
+ void OnTrailersReceived(const spdy::Http2HeaderBlock& trailers) override {
CHECK(!on_failed_called_);
trailers_ = trailers.Clone();
if (run_until_completion_)
@@ -204,10 +204,10 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
const std::string& data_received() const { return data_received_; }
int bytes_read() const { return bytes_read_; }
int error() const { return error_; }
- const spdy::SpdyHeaderBlock& response_headers() const {
+ const spdy::Http2HeaderBlock& response_headers() const {
return response_headers_;
}
- const spdy::SpdyHeaderBlock& trailers() const { return trailers_; }
+ const spdy::Http2HeaderBlock& trailers() const { return trailers_; }
int on_data_read_count() const { return on_data_read_count_; }
int on_data_sent_count() const { return on_data_sent_count_; }
bool on_failed_called() const { return on_failed_called_; }
@@ -223,8 +223,8 @@ class TestDelegateBase : public BidirectionalStreamImpl::Delegate {
int read_buf_len_;
std::string data_received_;
std::unique_ptr<base::RunLoop> loop_;
- spdy::SpdyHeaderBlock response_headers_;
- spdy::SpdyHeaderBlock trailers_;
+ spdy::Http2HeaderBlock response_headers_;
+ spdy::Http2HeaderBlock trailers_;
int error_;
int bytes_read_;
int on_data_read_count_;
diff --git a/chromium/net/spdy/buffered_spdy_framer.h b/chromium/net/spdy/buffered_spdy_framer.h
index 0bfb5e6aa65..910f8122aad 100644
--- a/chromium/net/spdy/buffered_spdy_framer.h
+++ b/chromium/net/spdy/buffered_spdy_framer.h
@@ -44,7 +44,7 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface {
spdy::SpdyStreamId parent_stream_id,
bool exclusive,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
base::TimeTicks recv_first_byte_time) = 0;
// Called when a data frame header is received.
@@ -101,7 +101,7 @@ class NET_EXPORT_PRIVATE BufferedSpdyFramerVisitorInterface {
// Called when a PUSH_PROMISE frame has been parsed.
virtual void OnPushPromise(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers) = 0;
+ spdy::Http2HeaderBlock headers) = 0;
// Called when an ALTSVC frame has been parsed.
virtual void OnAltSvc(
diff --git a/chromium/net/spdy/buffered_spdy_framer_unittest.cc b/chromium/net/spdy/buffered_spdy_framer_unittest.cc
index 49f835989c6..4f4efb86d5e 100644
--- a/chromium/net/spdy/buffered_spdy_framer_unittest.cc
+++ b/chromium/net/spdy/buffered_spdy_framer_unittest.cc
@@ -48,7 +48,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface {
spdy::SpdyStreamId parent_stream_id,
bool exclusive,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
base::TimeTicks recv_first_byte_time) override {
header_stream_id_ = stream_id;
headers_frame_count_++;
@@ -111,7 +111,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface {
void OnPushPromise(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers) override {
+ spdy::Http2HeaderBlock headers) override {
header_stream_id_ = stream_id;
push_promise_frame_count_++;
promised_stream_id_ = promised_stream_id;
@@ -169,7 +169,7 @@ class TestBufferedSpdyVisitor : public BufferedSpdyFramerVisitorInterface {
spdy::SpdyStreamId promised_stream_id_;
// Headers from OnHeaders and OnPushPromise for verification.
- spdy::SpdyHeaderBlock headers_;
+ spdy::Http2HeaderBlock headers_;
// OnGoAway parameters.
spdy::SpdyStreamId goaway_last_accepted_stream_id_;
@@ -201,7 +201,7 @@ TEST_F(BufferedSpdyFramerTest, OnSetting) {
}
TEST_F(BufferedSpdyFramerTest, HeaderListTooLarge) {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
std::string long_header_value(256 * 1024, 'x');
headers["foo"] = long_header_value;
spdy::SpdyHeadersIR headers_ir(/*stream_id=*/1, std::move(headers));
@@ -216,14 +216,14 @@ TEST_F(BufferedSpdyFramerTest, HeaderListTooLarge) {
EXPECT_EQ(1, visitor.error_count_);
EXPECT_EQ(0, visitor.headers_frame_count_);
EXPECT_EQ(0, visitor.push_promise_frame_count_);
- EXPECT_EQ(spdy::SpdyHeaderBlock(), visitor.headers_);
+ EXPECT_EQ(spdy::Http2HeaderBlock(), visitor.headers_);
}
TEST_F(BufferedSpdyFramerTest, ValidHeadersAfterInvalidHeaders) {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers["invalid"] = "\r\n\r\n";
- spdy::SpdyHeaderBlock headers2;
+ spdy::Http2HeaderBlock headers2;
headers["alpha"] = "beta";
SpdyTestUtil spdy_test_util;
@@ -243,7 +243,7 @@ TEST_F(BufferedSpdyFramerTest, ValidHeadersAfterInvalidHeaders) {
}
TEST_F(BufferedSpdyFramerTest, ReadHeadersHeaderBlock) {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers["alpha"] = "beta";
headers["gamma"] = "delta";
spdy::SpdyHeadersIR headers_ir(/*stream_id=*/1, headers.Clone());
@@ -261,7 +261,7 @@ TEST_F(BufferedSpdyFramerTest, ReadHeadersHeaderBlock) {
}
TEST_F(BufferedSpdyFramerTest, ReadPushPromiseHeaderBlock) {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers["alpha"] = "beta";
headers["gamma"] = "delta";
NetLogWithSource net_log;
diff --git a/chromium/net/spdy/header_coalescer.cc b/chromium/net/spdy/header_coalescer.cc
index c4719625f52..cf139ed9620 100644
--- a/chromium/net/spdy/header_coalescer.cc
+++ b/chromium/net/spdy/header_coalescer.cc
@@ -55,7 +55,7 @@ void HeaderCoalescer::OnHeader(absl::string_view key, absl::string_view value) {
error_seen_ = true;
}
-spdy::SpdyHeaderBlock HeaderCoalescer::release_headers() {
+spdy::Http2HeaderBlock HeaderCoalescer::release_headers() {
DCHECK(headers_valid_);
headers_valid_ = false;
return std::move(headers_);
diff --git a/chromium/net/spdy/header_coalescer.h b/chromium/net/spdy/header_coalescer.h
index e07490bbfdc..5369d34c7ef 100644
--- a/chromium/net/spdy/header_coalescer.h
+++ b/chromium/net/spdy/header_coalescer.h
@@ -26,7 +26,7 @@ class NET_EXPORT_PRIVATE HeaderCoalescer
void OnHeaderBlockEnd(size_t uncompressed_header_bytes,
size_t compressed_header_bytes) override {}
- spdy::SpdyHeaderBlock release_headers();
+ spdy::Http2HeaderBlock release_headers();
bool error_seen() const { return error_seen_; }
// Returns the estimate of dynamically allocated memory in bytes.
@@ -36,7 +36,7 @@ class NET_EXPORT_PRIVATE HeaderCoalescer
// Helper to add a header. Return true on success.
bool AddHeader(base::StringPiece key, base::StringPiece value);
- spdy::SpdyHeaderBlock headers_;
+ spdy::Http2HeaderBlock headers_;
bool headers_valid_ = true;
size_t header_list_size_ = 0;
bool error_seen_ = false;
diff --git a/chromium/net/spdy/header_coalescer_test.cc b/chromium/net/spdy/header_coalescer_test.cc
index c7c1c8ee333..c8b0115831d 100644
--- a/chromium/net/spdy/header_coalescer_test.cc
+++ b/chromium/net/spdy/header_coalescer_test.cc
@@ -51,7 +51,7 @@ TEST_F(HeaderCoalescerTest, CorrectHeaders) {
header_coalescer_.OnHeader("baz", "qux");
EXPECT_FALSE(header_coalescer_.error_seen());
- spdy::SpdyHeaderBlock header_block = header_coalescer_.release_headers();
+ spdy::Http2HeaderBlock header_block = header_coalescer_.release_headers();
EXPECT_THAT(header_block,
ElementsAre(Pair(":foo", "bar"), Pair("baz", "qux")));
}
@@ -90,7 +90,7 @@ TEST_F(HeaderCoalescerTest, Append) {
header_coalescer_.OnHeader("cookie", "qux");
EXPECT_FALSE(header_coalescer_.error_seen());
- spdy::SpdyHeaderBlock header_block = header_coalescer_.release_headers();
+ spdy::Http2HeaderBlock header_block = header_coalescer_.release_headers();
EXPECT_THAT(header_block,
ElementsAre(Pair("foo", absl::string_view("bar\0quux", 8)),
Pair("cookie", "baz; qux")));
@@ -125,7 +125,7 @@ TEST_F(HeaderCoalescerTest, HeaderNameValid) {
"^_`|~");
header_coalescer_.OnHeader(header_name, "foo");
EXPECT_FALSE(header_coalescer_.error_seen());
- spdy::SpdyHeaderBlock header_block = header_coalescer_.release_headers();
+ spdy::Http2HeaderBlock header_block = header_coalescer_.release_headers();
EXPECT_THAT(header_block, ElementsAre(Pair(header_name, "foo")));
}
diff --git a/chromium/net/spdy/multiplexed_http_stream.cc b/chromium/net/spdy/multiplexed_http_stream.cc
index ac902b0ffb3..84dbd38a24f 100644
--- a/chromium/net/spdy/multiplexed_http_stream.cc
+++ b/chromium/net/spdy/multiplexed_http_stream.cc
@@ -61,7 +61,7 @@ void MultiplexedHttpStream::SetRequestHeadersCallback(
}
void MultiplexedHttpStream::DispatchRequestHeadersCallback(
- const spdy::SpdyHeaderBlock& spdy_headers) {
+ const spdy::Http2HeaderBlock& spdy_headers) {
if (!request_headers_callback_)
return;
HttpRawRequestHeaders raw_headers;
diff --git a/chromium/net/spdy/multiplexed_http_stream.h b/chromium/net/spdy/multiplexed_http_stream.h
index f2c34fb7e77..3be0aca1eeb 100644
--- a/chromium/net/spdy/multiplexed_http_stream.h
+++ b/chromium/net/spdy/multiplexed_http_stream.h
@@ -10,10 +10,8 @@
#include "net/http/http_stream.h"
#include "net/spdy/multiplexed_session.h"
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
-namespace spdy {
-class SpdyHeaderBlock;
-} // namespace spdy
namespace net {
// Base class for SPDY and QUIC HttpStream subclasses.
@@ -37,7 +35,7 @@ class NET_EXPORT_PRIVATE MultiplexedHttpStream : public HttpStream {
protected:
void DispatchRequestHeadersCallback(
- const spdy::SpdyHeaderBlock& spdy_headers);
+ const spdy::Http2HeaderBlock& spdy_headers);
MultiplexedSessionHandle* session() { return session_.get(); }
const MultiplexedSessionHandle* session() const { return session_.get(); }
diff --git a/chromium/net/spdy/platform/impl/spdy_endianness_util_impl.h b/chromium/net/spdy/platform/impl/spdy_endianness_util_impl.h
deleted file mode 100644
index 901f5ba18d4..00000000000
--- a/chromium/net/spdy/platform/impl/spdy_endianness_util_impl.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_SPDY_PLATFORM_IMPL_SPDY_ENDIANNESS_UTIL_IMPL_H_
-#define NET_SPDY_PLATFORM_IMPL_SPDY_ENDIANNESS_UTIL_IMPL_H_
-
-#include "base/sys_byteorder.h"
-
-inline uint16_t SpdyNetToHost16Impl(uint16_t x) {
- return base::NetToHost16(x);
-}
-
-inline uint32_t SpdyNetToHost32Impl(uint32_t x) {
- return base::NetToHost32(x);
-}
-
-inline uint64_t SpdyNetToHost64Impl(uint64_t x) {
- return base::NetToHost64(x);
-}
-
-inline uint16_t SpdyHostToNet16Impl(uint16_t x) {
- return base::HostToNet16(x);
-}
-
-inline uint32_t SpdyHostToNet32Impl(uint32_t x) {
- return base::HostToNet32(x);
-}
-
-inline uint64_t SpdyHostToNet64Impl(uint64_t x) {
- return base::HostToNet64(x);
-}
-
-#endif // NET_SPDY_PLATFORM_IMPL_SPDY_ENDIANNESS_UTIL_IMPL_H_
diff --git a/chromium/net/spdy/platform/impl/spdy_flags_impl.cc b/chromium/net/spdy/platform/impl/spdy_flags_impl.cc
deleted file mode 100644
index abb4a9a4d1b..00000000000
--- a/chromium/net/spdy/platform/impl/spdy_flags_impl.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/spdy/platform/impl/spdy_flags_impl.h"
-
-// If true, use indexed name if possible when sending
-// Literal Header Field without Indexing instruction.
-bool spdy_hpack_use_indexed_name = true;
-
-namespace spdy {} // namespace spdy
diff --git a/chromium/net/spdy/platform/impl/spdy_flags_impl.h b/chromium/net/spdy/platform/impl/spdy_flags_impl.h
index ae3f74e26a4..886410734c1 100644
--- a/chromium/net/spdy/platform/impl/spdy_flags_impl.h
+++ b/chromium/net/spdy/platform/impl/spdy_flags_impl.h
@@ -6,26 +6,18 @@
#define NET_SPDY_PLATFORM_IMPL_SPDY_FLAGS_IMPL_H_
#include "net/base/net_export.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-NET_EXPORT_PRIVATE extern bool spdy_hpack_use_indexed_name;
-
-inline bool GetSpdyReloadableFlagImpl(bool flag) {
- return flag;
-}
+#define GetSpdyReloadableFlagImpl GetQuicReloadableFlagImpl
#define SPDY_CODE_COUNT_IMPL(name) \
do { \
} while (0)
-namespace spdy {
-
-inline bool GetSpdyRestartFlagImpl(bool flag) {
- return flag;
-}
+#define GetSpdyRestartFlagImpl GetQuicRestartFlagImpl
#define SPDY_CODE_COUNT_N_IMPL(name, instance, total) \
do { \
} while (0)
-} // namespace spdy
#endif // NET_SPDY_PLATFORM_IMPL_SPDY_FLAGS_IMPL_H_
diff --git a/chromium/net/spdy/platform/impl/spdy_string_utils_impl.cc b/chromium/net/spdy/platform/impl/spdy_string_utils_impl.cc
index 50c345546f6..b6a85c5d05b 100644
--- a/chromium/net/spdy/platform/impl/spdy_string_utils_impl.cc
+++ b/chromium/net/spdy/platform/impl/spdy_string_utils_impl.cc
@@ -8,7 +8,7 @@
namespace spdy {
-bool SpdyHexDecodeToUInt32Impl(quiche::QuicheStringPiece data, uint32_t* out) {
+bool SpdyHexDecodeToUInt32Impl(absl::string_view data, uint32_t* out) {
if (data.empty() || data.size() > 8u)
return false;
// Pad with leading zeros.
diff --git a/chromium/net/spdy/platform/impl/spdy_string_utils_impl.h b/chromium/net/spdy/platform/impl/spdy_string_utils_impl.h
index 534b169d5b8..c36102fc4ef 100644
--- a/chromium/net/spdy/platform/impl/spdy_string_utils_impl.h
+++ b/chromium/net/spdy/platform/impl/spdy_string_utils_impl.h
@@ -34,28 +34,27 @@ inline char SpdyHexDigitToIntImpl(char c) {
return base::HexDigitToInt(c);
}
-inline std::string SpdyHexDecodeImpl(quiche::QuicheStringPiece data) {
- return quiche::QuicheTextUtils::HexDecode(data);
+inline std::string SpdyHexDecodeImpl(absl::string_view data) {
+ return absl::HexStringToBytes(data);
}
-NET_EXPORT_PRIVATE bool SpdyHexDecodeToUInt32Impl(
- quiche::QuicheStringPiece data,
- uint32_t* out);
+NET_EXPORT_PRIVATE bool SpdyHexDecodeToUInt32Impl(absl::string_view data,
+ uint32_t* out);
inline std::string SpdyHexEncodeImpl(const char* bytes, size_t size) {
- return quiche::QuicheTextUtils::HexEncode(bytes, size);
+ return absl::BytesToHexString(absl::string_view(bytes, size));
}
inline std::string SpdyHexEncodeUInt32AndTrimImpl(uint32_t data) {
return base::StringPrintf("%x", data);
}
-inline std::string SpdyHexDumpImpl(quiche::QuicheStringPiece data) {
+inline std::string SpdyHexDumpImpl(absl::string_view data) {
return quiche::QuicheTextUtils::HexDump(data);
}
struct SpdyStringPieceCaseHashImpl {
- size_t operator()(quiche::QuicheStringPiece data) const {
+ size_t operator()(absl::string_view data) const {
std::string lower = absl::AsciiStrToLower(data);
absl::Hash<absl::string_view> hasher;
return hasher(lower);
@@ -63,8 +62,7 @@ struct SpdyStringPieceCaseHashImpl {
};
struct SpdyStringPieceCaseEqImpl {
- bool operator()(quiche::QuicheStringPiece piece1,
- quiche::QuicheStringPiece piece2) const {
+ bool operator()(absl::string_view piece1, absl::string_view piece2) const {
return absl::EqualsIgnoreCase(piece1, piece2);
}
};
diff --git a/chromium/net/spdy/spdy_http_stream.cc b/chromium/net/spdy/spdy_http_stream.cc
index 92de83a7518..eed86571dd6 100644
--- a/chromium/net/spdy/spdy_http_stream.cc
+++ b/chromium/net/spdy/spdy_http_stream.cc
@@ -33,11 +33,12 @@ namespace net {
namespace {
-bool ValidatePushedHeaders(const HttpRequestInfo& request_info,
- const spdy::SpdyHeaderBlock& pushed_request_headers,
- const spdy::SpdyHeaderBlock& pushed_response_headers,
- const HttpResponseInfo& pushed_response_info) {
- spdy::SpdyHeaderBlock::const_iterator status_it =
+bool ValidatePushedHeaders(
+ const HttpRequestInfo& request_info,
+ const spdy::Http2HeaderBlock& pushed_request_headers,
+ const spdy::Http2HeaderBlock& pushed_response_headers,
+ const HttpResponseInfo& pushed_response_info) {
+ spdy::Http2HeaderBlock::const_iterator status_it =
pushed_response_headers.find(spdy::kHttp2StatusHeader);
DCHECK(status_it != pushed_response_headers.end());
// 206 Partial Content and 416 Requested Range Not Satisfiable are range
@@ -51,7 +52,7 @@ bool ValidatePushedHeaders(const HttpRequestInfo& request_info,
SpdyPushedStreamFate::kClientRequestNotRange);
return false;
}
- spdy::SpdyHeaderBlock::const_iterator pushed_request_range_it =
+ spdy::Http2HeaderBlock::const_iterator pushed_request_range_it =
pushed_request_headers.find("range");
if (pushed_request_range_it == pushed_request_headers.end()) {
// Pushed request is not a range request.
@@ -344,12 +345,12 @@ int SpdyHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
return ERR_IO_PENDING;
}
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
CreateSpdyHeadersFromHttpRequest(*request_info_, request_headers, &headers);
stream_->net_log().AddEvent(
NetLogEventType::HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS,
[&](NetLogCaptureMode capture_mode) {
- return SpdyHeaderBlockNetLogParams(&headers, capture_mode);
+ return Http2HeaderBlockNetLogParams(&headers, capture_mode);
});
DispatchRequestHeadersCallback(headers);
@@ -386,8 +387,8 @@ void SpdyHttpStream::OnHeadersSent() {
}
void SpdyHttpStream::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {
DCHECK(!response_headers_complete_);
response_headers_complete_ = true;
@@ -463,7 +464,7 @@ void SpdyHttpStream::OnDataSent() {
}
// TODO(xunjieli): Maybe do something with the trailers. crbug.com/422958.
-void SpdyHttpStream::OnTrailers(const spdy::SpdyHeaderBlock& trailers) {}
+void SpdyHttpStream::OnTrailers(const spdy::Http2HeaderBlock& trailers) {}
void SpdyHttpStream::OnClose(int status) {
DCHECK(stream_);
diff --git a/chromium/net/spdy/spdy_http_stream.h b/chromium/net/spdy/spdy_http_stream.h
index 3986e004a88..d2bb2d4d913 100644
--- a/chromium/net/spdy/spdy_http_stream.h
+++ b/chromium/net/spdy/spdy_http_stream.h
@@ -87,11 +87,11 @@ class NET_EXPORT_PRIVATE SpdyHttpStream : public SpdyStream::Delegate,
// SpdyStream::Delegate implementation.
void OnHeadersSent() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override;
void OnDataSent() override;
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override;
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override;
void OnClose(int status) override;
bool CanGreaseFrameType() const override;
NetLogSource source_dependency() const override;
diff --git a/chromium/net/spdy/spdy_http_stream_unittest.cc b/chromium/net/spdy/spdy_http_stream_unittest.cc
index 52c57ccb6a2..ad3f2ef97de 100644
--- a/chromium/net/spdy/spdy_http_stream_unittest.cc
+++ b/chromium/net/spdy/spdy_http_stream_unittest.cc
@@ -1181,7 +1181,7 @@ TEST_F(SpdyHttpStreamTest, DownloadWithEmptyDataFrame) {
session_deps_.http2_end_stream_with_data_frame = true;
// HEADERS frame without END_STREAM
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[spdy::kHttp2MethodHeader] = "GET";
spdy_util_.AddUrlToHeaderBlock(kDefaultUrl, &request_headers);
spdy::SpdySerializedFrame req = spdy_util_.ConstructSpdyHeaders(
diff --git a/chromium/net/spdy/spdy_http_utils.cc b/chromium/net/spdy/spdy_http_utils.cc
index c74decbaa36..fea2c6a5108 100644
--- a/chromium/net/spdy/spdy_http_utils.cc
+++ b/chromium/net/spdy/spdy_http_utils.cc
@@ -27,7 +27,7 @@ namespace {
void AddSpdyHeader(const std::string& name,
const std::string& value,
- spdy::SpdyHeaderBlock* headers) {
+ spdy::Http2HeaderBlock* headers) {
if (headers->find(name) == headers->end()) {
(*headers)[name] = value;
} else {
@@ -40,10 +40,10 @@ void AddSpdyHeader(const std::string& name,
} // namespace
-bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers,
+bool SpdyHeadersToHttpResponse(const spdy::Http2HeaderBlock& headers,
HttpResponseInfo* response) {
// The ":status" header is required.
- spdy::SpdyHeaderBlock::const_iterator it =
+ spdy::Http2HeaderBlock::const_iterator it =
headers.find(spdy::kHttp2StatusHeader);
if (it == headers.end())
return false;
@@ -93,7 +93,7 @@ bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers,
void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
const HttpRequestHeaders& request_headers,
- spdy::SpdyHeaderBlock* headers) {
+ spdy::Http2HeaderBlock* headers) {
(*headers)[spdy::kHttp2MethodHeader] = info.method;
if (info.method == "CONNECT") {
(*headers)[spdy::kHttp2AuthorityHeader] = GetHostAndPort(info.url);
@@ -118,7 +118,7 @@ void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
void CreateSpdyHeadersFromHttpRequestForWebSocket(
const GURL& url,
const HttpRequestHeaders& request_headers,
- spdy::SpdyHeaderBlock* headers) {
+ spdy::Http2HeaderBlock* headers) {
(*headers)[spdy::kHttp2MethodHeader] = "CONNECT";
(*headers)[spdy::kHttp2AuthorityHeader] = GetHostAndOptionalPort(url);
(*headers)[spdy::kHttp2SchemeHeader] = "https";
@@ -159,7 +159,7 @@ ConvertSpdyPriorityToRequestPriority(spdy::SpdyPriority priority) {
}
NET_EXPORT_PRIVATE void ConvertHeaderBlockToHttpRequestHeaders(
- const spdy::SpdyHeaderBlock& spdy_headers,
+ const spdy::Http2HeaderBlock& spdy_headers,
HttpRequestHeaders* http_headers) {
for (const auto& it : spdy_headers) {
base::StringPiece key = base::StringViewToStringPiece(it.first);
diff --git a/chromium/net/spdy/spdy_http_utils.h b/chromium/net/spdy/spdy_http_utils.h
index d1622618343..d2319e17a4b 100644
--- a/chromium/net/spdy/spdy_http_utils.h
+++ b/chromium/net/spdy/spdy_http_utils.h
@@ -18,30 +18,30 @@ class HttpResponseInfo;
struct HttpRequestInfo;
class HttpRequestHeaders;
-// Convert a spdy::SpdyHeaderBlock into an HttpResponseInfo.
-// |headers| input parameter with the spdy::SpdyHeaderBlock.
+// Convert a spdy::Http2HeaderBlock into an HttpResponseInfo.
+// |headers| input parameter with the spdy::Http2HeaderBlock.
// |response| output parameter for the HttpResponseInfo.
-// Returns true if successfully converted. False if the spdy::SpdyHeaderBlock
+// Returns true if successfully converted. False if the spdy::Http2HeaderBlock
// is incomplete (e.g. missing 'status' or 'version').
-NET_EXPORT bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers,
+NET_EXPORT bool SpdyHeadersToHttpResponse(const spdy::Http2HeaderBlock& headers,
HttpResponseInfo* response);
-// Create a spdy::SpdyHeaderBlock from HttpRequestInfo and HttpRequestHeaders.
+// Create a spdy::Http2HeaderBlock from HttpRequestInfo and HttpRequestHeaders.
NET_EXPORT void CreateSpdyHeadersFromHttpRequest(
const HttpRequestInfo& info,
const HttpRequestHeaders& request_headers,
- spdy::SpdyHeaderBlock* headers);
+ spdy::Http2HeaderBlock* headers);
-// Create a spdy::SpdyHeaderBlock from HttpRequestInfo and HttpRequestHeaders
+// Create a spdy::Http2HeaderBlock from HttpRequestInfo and HttpRequestHeaders
// for a WebSockets over HTTP/2 request.
NET_EXPORT void CreateSpdyHeadersFromHttpRequestForWebSocket(
const GURL& url,
const HttpRequestHeaders& request_headers,
- spdy::SpdyHeaderBlock* headers);
+ spdy::Http2HeaderBlock* headers);
-// Create HttpRequestHeaders from spdy::SpdyHeaderBlock.
+// Create HttpRequestHeaders from spdy::Http2HeaderBlock.
NET_EXPORT void ConvertHeaderBlockToHttpRequestHeaders(
- const spdy::SpdyHeaderBlock& spdy_headers,
+ const spdy::Http2HeaderBlock& spdy_headers,
HttpRequestHeaders* http_headers);
NET_EXPORT spdy::SpdyPriority ConvertRequestPriorityToSpdyPriority(
diff --git a/chromium/net/spdy/spdy_http_utils_unittest.cc b/chromium/net/spdy/spdy_http_utils_unittest.cc
index 49dc3310694..427584bea7f 100644
--- a/chromium/net/spdy/spdy_http_utils_unittest.cc
+++ b/chromium/net/spdy/spdy_http_utils_unittest.cc
@@ -44,7 +44,7 @@ TEST(SpdyHttpUtilsTest, CreateSpdyHeadersFromHttpRequestHTTP2) {
request.method = "GET";
request.url = url;
request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, "Chrome/1.1");
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
CreateSpdyHeadersFromHttpRequest(request, request.extra_headers, &headers);
EXPECT_EQ("GET", headers[":method"]);
EXPECT_EQ("https", headers[":scheme"]);
@@ -60,7 +60,7 @@ TEST(SpdyHttpUtilsTest, CreateSpdyHeadersFromHttpRequestConnectHTTP2) {
request.method = "CONNECT";
request.url = url;
request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent, "Chrome/1.1");
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
CreateSpdyHeadersFromHttpRequest(request, request.extra_headers, &headers);
EXPECT_EQ("CONNECT", headers[":method"]);
EXPECT_TRUE(headers.end() == headers.find(":scheme"));
diff --git a/chromium/net/spdy/spdy_log_util.cc b/chromium/net/spdy/spdy_log_util.cc
index d0d55c1cf58..e46fb3159de 100644
--- a/chromium/net/spdy/spdy_log_util.cc
+++ b/chromium/net/spdy/spdy_log_util.cc
@@ -24,8 +24,8 @@ base::Value ElideGoAwayDebugDataForNetLog(NetLogCaptureMode capture_mode,
{"[", base::NumberToString(debug_data.size()), " bytes were stripped]"}));
}
-base::ListValue ElideSpdyHeaderBlockForNetLog(
- const spdy::SpdyHeaderBlock& headers,
+base::ListValue ElideHttp2HeaderBlockForNetLog(
+ const spdy::Http2HeaderBlock& headers,
NetLogCaptureMode capture_mode) {
base::ListValue headers_list;
for (const auto& header : headers) {
@@ -39,10 +39,11 @@ base::ListValue ElideSpdyHeaderBlockForNetLog(
return headers_list;
}
-base::Value SpdyHeaderBlockNetLogParams(const spdy::SpdyHeaderBlock* headers,
- NetLogCaptureMode capture_mode) {
+base::Value Http2HeaderBlockNetLogParams(const spdy::Http2HeaderBlock* headers,
+ NetLogCaptureMode capture_mode) {
base::DictionaryValue dict;
- dict.SetKey("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode));
+ dict.SetKey("headers",
+ ElideHttp2HeaderBlockForNetLog(*headers, capture_mode));
return std::move(dict);
}
diff --git a/chromium/net/spdy/spdy_log_util.h b/chromium/net/spdy/spdy_log_util.h
index 4638caa9848..5757ef96585 100644
--- a/chromium/net/spdy/spdy_log_util.h
+++ b/chromium/net/spdy/spdy_log_util.h
@@ -28,14 +28,14 @@ NET_EXPORT_PRIVATE base::Value ElideGoAwayDebugDataForNetLog(
NetLogCaptureMode capture_mode,
base::StringPiece debug_data);
-// Given a spdy::SpdyHeaderBlock, return its base::ListValue representation.
-NET_EXPORT_PRIVATE base::ListValue ElideSpdyHeaderBlockForNetLog(
- const spdy::SpdyHeaderBlock& headers,
+// Given a spdy::Http2HeaderBlock, return its base::ListValue representation.
+NET_EXPORT_PRIVATE base::ListValue ElideHttp2HeaderBlockForNetLog(
+ const spdy::Http2HeaderBlock& headers,
NetLogCaptureMode capture_mode);
-// Converts a spdy::SpdyHeaderBlock into NetLog event parameters.
-NET_EXPORT_PRIVATE base::Value SpdyHeaderBlockNetLogParams(
- const spdy::SpdyHeaderBlock* headers,
+// Converts a spdy::Http2HeaderBlock into NetLog event parameters.
+NET_EXPORT_PRIVATE base::Value Http2HeaderBlockNetLogParams(
+ const spdy::Http2HeaderBlock* headers,
NetLogCaptureMode capture_mode);
} // namespace net
diff --git a/chromium/net/spdy/spdy_log_util_unittest.cc b/chromium/net/spdy/spdy_log_util_unittest.cc
index 9d4594620f9..19a6f431102 100644
--- a/chromium/net/spdy/spdy_log_util_unittest.cc
+++ b/chromium/net/spdy/spdy_log_util_unittest.cc
@@ -30,13 +30,13 @@ TEST(SpdyLogUtilTest, ElideGoAwayDebugDataForNetLog) {
NetLogCaptureMode::kIncludeSensitive, "\xfe\xff\x00"));
}
-TEST(SpdyLogUtilTest, ElideSpdyHeaderBlockForNetLog) {
- spdy::SpdyHeaderBlock headers;
+TEST(SpdyLogUtilTest, ElideHttp2HeaderBlockForNetLog) {
+ spdy::Http2HeaderBlock headers;
headers["foo"] = "bar";
headers["cookie"] = "name=value";
base::ListValue list =
- ElideSpdyHeaderBlockForNetLog(headers, NetLogCaptureMode::kDefault);
+ ElideHttp2HeaderBlockForNetLog(headers, NetLogCaptureMode::kDefault);
ASSERT_FALSE(list.is_none());
ASSERT_EQ(2u, list.GetList().size());
@@ -47,8 +47,8 @@ TEST(SpdyLogUtilTest, ElideSpdyHeaderBlockForNetLog) {
ASSERT_TRUE(list.GetList()[1].is_string());
EXPECT_EQ("cookie: [10 bytes were stripped]", list.GetList()[1].GetString());
- list = ElideSpdyHeaderBlockForNetLog(headers,
- NetLogCaptureMode::kIncludeSensitive);
+ list = ElideHttp2HeaderBlockForNetLog(headers,
+ NetLogCaptureMode::kIncludeSensitive);
ASSERT_FALSE(list.is_none());
ASSERT_EQ(2u, list.GetList().size());
@@ -60,13 +60,13 @@ TEST(SpdyLogUtilTest, ElideSpdyHeaderBlockForNetLog) {
EXPECT_EQ("cookie: name=value", list.GetList()[1].GetString());
}
-TEST(SpdyLogUtilTest, SpdyHeaderBlockNetLogParams) {
- spdy::SpdyHeaderBlock headers;
+TEST(SpdyLogUtilTest, Http2HeaderBlockNetLogParams) {
+ spdy::Http2HeaderBlock headers;
headers["foo"] = "bar";
headers["cookie"] = "name=value";
std::unique_ptr<base::Value> dict = base::Value::ToUniquePtrValue(
- SpdyHeaderBlockNetLogParams(&headers, NetLogCaptureMode::kDefault));
+ Http2HeaderBlockNetLogParams(&headers, NetLogCaptureMode::kDefault));
ASSERT_TRUE(dict);
ASSERT_TRUE(dict->is_dict());
@@ -84,7 +84,7 @@ TEST(SpdyLogUtilTest, SpdyHeaderBlockNetLogParams) {
EXPECT_EQ("cookie: [10 bytes were stripped]",
header_list->GetList()[1].GetString());
- dict = base::Value::ToUniquePtrValue(SpdyHeaderBlockNetLogParams(
+ dict = base::Value::ToUniquePtrValue(Http2HeaderBlockNetLogParams(
&headers, NetLogCaptureMode::kIncludeSensitive));
ASSERT_TRUE(dict);
@@ -104,14 +104,14 @@ TEST(SpdyLogUtilTest, SpdyHeaderBlockNetLogParams) {
}
// Regression test for https://crbug.com/800282.
-TEST(SpdyLogUtilTest, ElideSpdyHeaderBlockForNetLogWithNonUTF8Characters) {
- spdy::SpdyHeaderBlock headers;
+TEST(SpdyLogUtilTest, ElideHttp2HeaderBlockForNetLogWithNonUTF8Characters) {
+ spdy::Http2HeaderBlock headers;
headers["foo"] = "bar\x81";
headers["O\xe2"] = "bar";
headers["\xde\xad"] = "\xbe\xef";
base::ListValue list =
- ElideSpdyHeaderBlockForNetLog(headers, NetLogCaptureMode::kDefault);
+ ElideHttp2HeaderBlockForNetLog(headers, NetLogCaptureMode::kDefault);
ASSERT_EQ(3u, list.GetSize());
std::string field;
diff --git a/chromium/net/spdy/spdy_network_transaction_unittest.cc b/chromium/net/spdy/spdy_network_transaction_unittest.cc
index 4136de0e6b4..af95a159f9f 100644
--- a/chromium/net/spdy/spdy_network_transaction_unittest.cc
+++ b/chromium/net/spdy/spdy_network_transaction_unittest.cc
@@ -7,7 +7,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
@@ -1729,7 +1729,7 @@ TEST_F(SpdyNetworkTransactionTest, Put) {
// Setup the request.
request_.method = "PUT";
- spdy::SpdyHeaderBlock put_headers(
+ spdy::Http2HeaderBlock put_headers(
spdy_util_.ConstructPutHeaderBlock(kDefaultUrl, 0));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(put_headers), LOWEST, true));
@@ -1759,7 +1759,7 @@ TEST_F(SpdyNetworkTransactionTest, Head) {
// Setup the request.
request_.method = "HEAD";
- spdy::SpdyHeaderBlock head_headers(
+ spdy::Http2HeaderBlock head_headers(
spdy_util_.ConstructHeadHeaderBlock(kDefaultUrl, 0));
spdy::SpdySerializedFrame req(spdy_util_.ConstructSpdyHeaders(
1, std::move(head_headers), LOWEST, true));
@@ -1969,7 +1969,7 @@ TEST_F(SpdyNetworkTransactionTest, NullPost) {
// When request.upload_data_stream is NULL for post, content-length is
// expected to be 0.
- spdy::SpdyHeaderBlock req_block(
+ spdy::Http2HeaderBlock req_block(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, 0));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(req_block), LOWEST, true));
@@ -2007,7 +2007,7 @@ TEST_F(SpdyNetworkTransactionTest, EmptyPost) {
const uint64_t kContentLength = 0;
- spdy::SpdyHeaderBlock req_block(
+ spdy::Http2HeaderBlock req_block(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kContentLength));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(req_block), LOWEST, true));
@@ -2433,7 +2433,7 @@ TEST_F(SpdyNetworkTransactionTest, DeleteSessionOnReadCallback) {
}
TEST_F(SpdyNetworkTransactionTest, TestRawHeaderSizeSuccessfullRequest) {
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
headers["user-agent"] = "";
headers["accept-encoding"] = "gzip, deflate";
@@ -2482,7 +2482,7 @@ TEST_F(SpdyNetworkTransactionTest, TestRawHeaderSizeSuccessfullRequest) {
TEST_F(SpdyNetworkTransactionTest,
TestRawHeaderSizeSuccessfullPushHeadersFirst) {
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
headers["user-agent"] = "";
headers["accept-encoding"] = "gzip, deflate";
@@ -2500,7 +2500,7 @@ TEST_F(SpdyNetworkTransactionTest,
spdy::SpdySerializedFrame response_body_frame(
spdy_util_.ConstructSpdyDataFrame(1, "should not include", true));
- spdy::SpdyHeaderBlock push_headers;
+ spdy::Http2HeaderBlock push_headers;
push_headers[":method"] = "GET";
spdy_util_.AddUrlToHeaderBlock(std::string(kDefaultUrl) + "b.dat",
&push_headers);
@@ -2565,7 +2565,7 @@ TEST_F(SpdyNetworkTransactionTest, RedirectGetRequest) {
spdy_url_request_context.socket_factory().AddSSLSocketDataProvider(
&ssl_provider0);
- spdy::SpdyHeaderBlock headers0(
+ spdy::Http2HeaderBlock headers0(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
headers0["user-agent"] = "";
headers0["accept-encoding"] = "gzip, deflate";
@@ -2590,7 +2590,7 @@ TEST_F(SpdyNetworkTransactionTest, RedirectGetRequest) {
&ssl_provider1);
SpdyTestUtil spdy_util1;
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util1.ConstructGetHeaderBlock(kRedirectUrl));
headers1["user-agent"] = "";
headers1["accept-encoding"] = "gzip, deflate";
@@ -2646,7 +2646,7 @@ TEST_F(SpdyNetworkTransactionTest, RedirectServerPush) {
spdy_url_request_context.socket_factory().AddSSLSocketDataProvider(
&ssl_provider0);
- spdy::SpdyHeaderBlock headers0(
+ spdy::Http2HeaderBlock headers0(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
headers0["user-agent"] = "";
headers0["accept-encoding"] = "gzip, deflate";
@@ -2676,7 +2676,7 @@ TEST_F(SpdyNetworkTransactionTest, RedirectServerPush) {
&ssl_provider1);
SpdyTestUtil spdy_util1;
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util1.ConstructGetHeaderBlock(redirected_url));
headers1["user-agent"] = "";
headers1["accept-encoding"] = "gzip, deflate";
@@ -2836,13 +2836,13 @@ TEST_F(SpdyNetworkTransactionTest, ServerPushHeadMethod) {
spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true));
MockWrite writes[] = {CreateMockWrite(req, 0), CreateMockWrite(priority, 2)};
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
push_promise_header_block[spdy::kHttp2MethodHeader] = "HEAD";
spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_promise_header_block);
spdy::SpdySerializedFrame push_promise(spdy_util_.ConstructSpdyPushPromise(
1, 2, std::move(push_promise_header_block)));
- spdy::SpdyHeaderBlock push_response_headers;
+ spdy::Http2HeaderBlock push_response_headers;
push_response_headers[spdy::kHttp2StatusHeader] = "200";
push_response_headers["foo"] = "bar";
spdy::SpdyHeadersIR headers_ir(2, std::move(push_response_headers));
@@ -2902,13 +2902,13 @@ TEST_F(SpdyNetworkTransactionTest, ServerPushHeadDoesNotMatchGetRequest) {
MockWrite writes[] = {CreateMockWrite(req1, 0), CreateMockWrite(priority, 2),
CreateMockWrite(req2, 6)};
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
push_promise_header_block[spdy::kHttp2MethodHeader] = "HEAD";
spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_promise_header_block);
spdy::SpdySerializedFrame push_promise(spdy_util_.ConstructSpdyPushPromise(
1, 2, std::move(push_promise_header_block)));
- spdy::SpdyHeaderBlock push_response_headers;
+ spdy::Http2HeaderBlock push_response_headers;
push_response_headers[spdy::kHttp2StatusHeader] = "200";
push_response_headers["foo"] = "bar";
spdy::SpdyHeadersIR headers_ir(2, std::move(push_response_headers));
@@ -3343,7 +3343,7 @@ TEST_F(SpdyNetworkTransactionTest, ServerPushInvalidUrl) {
base::HistogramTester histogram_tester;
// Coverage on how a non-empty invalid GURL in a PUSH_PROMISE is handled.
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(headers), LOWEST, true));
@@ -3351,7 +3351,7 @@ TEST_F(SpdyNetworkTransactionTest, ServerPushInvalidUrl) {
// Can't use ConstructSpdyPush here since it wants to parse a URL and
// split it into the appropriate :header pieces. So we have to hand-fill
// those pieces in.
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
push_promise_header_block[spdy::kHttp2AuthorityHeader] = "";
push_promise_header_block[spdy::kHttp2SchemeHeader] = "";
push_promise_header_block[spdy::kHttp2PathHeader] = "/index.html";
@@ -3444,7 +3444,7 @@ TEST_F(SpdyNetworkTransactionTest, ServerPushNoURL) {
spdy::SpdySerializedFrame stream1_reply(
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
- spdy::SpdyHeaderBlock incomplete_headers;
+ spdy::Http2HeaderBlock incomplete_headers;
incomplete_headers[spdy::kHttp2StatusHeader] = "200 OK";
incomplete_headers["hello"] = "bye";
spdy::SpdySerializedFrame stream2_syn(
@@ -4260,7 +4260,7 @@ TEST_F(SpdyNetworkTransactionTest, RejectServerPushWithNoMethod) {
spdy::SpdySerializedFrame reply(
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_promise_header_block);
spdy::SpdySerializedFrame push_promise(spdy_util_.ConstructSpdyPushPromise(
1, 2, std::move(push_promise_header_block)));
@@ -4293,7 +4293,7 @@ TEST_F(SpdyNetworkTransactionTest, RejectServerPushWithInvalidMethod) {
spdy::SpdySerializedFrame reply(
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
push_promise_header_block[":method"] = "POST";
spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_promise_header_block);
spdy::SpdySerializedFrame push_promise(spdy_util_.ConstructSpdyPushPromise(
@@ -4330,10 +4330,10 @@ TEST_F(SpdyNetworkTransactionTest, ResponseHeaders) {
2,
{"hello", "bye", "cookie", "val1, val2"}},
// Multiple headers are preserved: they are joined with \0 separator in
- // spdy::SpdyHeaderBlock.AppendValueOrAddHeader(), then split up in
+ // spdy::Http2HeaderBlock.AppendValueOrAddHeader(), then split up in
// HpackEncoder, then joined with \0 separator when
// spdy::HpackDecoderAdapter::ListenerAdapter::OnHeader() calls
- // spdy::SpdyHeaderBlock.AppendValueOrAddHeader(), then split up again in
+ // spdy::Http2HeaderBlock.AppendValueOrAddHeader(), then split up again in
// HttpResponseHeaders.
{2,
{"content-encoding", "val1", "content-encoding", "val2"},
@@ -4413,7 +4413,7 @@ TEST_F(SpdyNetworkTransactionTest, InvalidResponseHeaders) {
};
// Construct the reply.
- spdy::SpdyHeaderBlock reply_headers;
+ spdy::Http2HeaderBlock reply_headers;
AppendToHeaderBlock(
test_cases[i].headers, test_cases[i].num_headers, &reply_headers);
spdy::SpdySerializedFrame resp(
@@ -5235,7 +5235,7 @@ TEST_F(SpdyNetworkTransactionTest, HTTP11RequiredRetry) {
NormalSpdyTransactionHelper helper(request_, DEFAULT_PRIORITY, log_, nullptr);
// First socket: HTTP/2 request rejected with HTTP_1_1_REQUIRED.
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(headers), LOWEST, true));
@@ -5334,7 +5334,7 @@ TEST_F(SpdyNetworkTransactionTest, HTTP11RequiredRetryWithNetworkIsolationKey) {
// First socket: HTTP/2 request rejected with HTTP_1_1_REQUIRED.
SpdyTestUtil spdy_util;
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req(
spdy_util.ConstructSpdyHeaders(1, std::move(headers), LOWEST, true));
@@ -6064,7 +6064,7 @@ class SpdyNetworkTransactionPushHeaderTest
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST));
writes.push_back(CreateMockWrite(req1, seq++));
- spdy::SpdyHeaderBlock pushed_request_headers;
+ spdy::Http2HeaderBlock pushed_request_headers;
pushed_request_headers[spdy::kHttp2MethodHeader] = "GET";
for (const auto& header : GetParam().extra_pushed_request_headers) {
pushed_request_headers.insert(header);
@@ -6081,7 +6081,7 @@ class SpdyNetworkTransactionPushHeaderTest
reads.push_back(MockRead(ASYNC, ERR_IO_PENDING, seq++));
- spdy::SpdyHeaderBlock pushed_response_headers;
+ spdy::Http2HeaderBlock pushed_response_headers;
pushed_response_headers[spdy::kHttp2StatusHeader] =
GetParam().pushed_status_code;
for (const auto& header : GetParam().extra_pushed_response_headers) {
@@ -6112,7 +6112,7 @@ class SpdyNetworkTransactionPushHeaderTest
rst = spdy_util_.ConstructSpdyRstStream(2, spdy::ERROR_CODE_CANCEL);
writes.push_back(CreateMockWrite(rst, seq++));
- spdy::SpdyHeaderBlock request_headers2(
+ spdy::Http2HeaderBlock request_headers2(
spdy_util_.ConstructGetHeaderBlock(kPushedUrl));
for (const auto& header : GetParam().extra_request_headers) {
request_headers2.insert(header);
@@ -6225,7 +6225,7 @@ TEST_F(SpdyNetworkTransactionTest, ResponseHeadersTwice) {
spdy::SpdySerializedFrame stream1_reply(
spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1));
- spdy::SpdyHeaderBlock late_headers;
+ spdy::Http2HeaderBlock late_headers;
late_headers["hello"] = "bye";
spdy::SpdySerializedFrame stream1_headers(
spdy_util_.ConstructSpdyResponseHeaders(1, std::move(late_headers),
@@ -6261,7 +6261,7 @@ TEST_F(SpdyNetworkTransactionTest, SyncReplyDataAfterTrailers) {
spdy::SpdySerializedFrame stream1_body(
spdy_util_.ConstructSpdyDataFrame(1, false));
- spdy::SpdyHeaderBlock late_headers;
+ spdy::Http2HeaderBlock late_headers;
late_headers["hello"] = "bye";
spdy::SpdySerializedFrame stream1_headers(
spdy_util_.ConstructSpdyResponseHeaders(1, std::move(late_headers),
@@ -7925,7 +7925,7 @@ TEST_F(SpdyNetworkTransactionTest, FlowControlNegativeSendWindowSize) {
TEST_F(SpdyNetworkTransactionTest, GoAwayOnOddPushStreamId) {
base::HistogramTester histogram_tester;
- spdy::SpdyHeaderBlock push_headers;
+ spdy::Http2HeaderBlock push_headers;
spdy_util_.AddUrlToHeaderBlock("http://www.example.org/a.dat", &push_headers);
spdy::SpdySerializedFrame push(
spdy_util_.ConstructSpdyPushPromise(1, 3, std::move(push_headers)));
@@ -7958,7 +7958,7 @@ TEST_F(SpdyNetworkTransactionTest,
spdy::SpdySerializedFrame push_a(spdy_util_.ConstructSpdyPush(
nullptr, 0, 4, 1, "https://www.example.org/a.dat"));
- spdy::SpdyHeaderBlock push_b_headers;
+ spdy::Http2HeaderBlock push_b_headers;
spdy_util_.AddUrlToHeaderBlock("https://www.example.org/b.dat",
&push_b_headers);
spdy::SpdySerializedFrame push_b(
@@ -7999,7 +7999,7 @@ TEST_F(SpdyNetworkTransactionTest, LargeRequest) {
request_.extra_headers.SetHeader(kKey, kValue);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
headers[kKey] = kValue;
spdy::SpdySerializedFrame req(
@@ -8028,7 +8028,7 @@ TEST_F(SpdyNetworkTransactionTest, LargeRequest) {
// Regression test for https://crbug.com/535629: response header exceeds 16 kB.
TEST_F(SpdyNetworkTransactionTest, LargeResponseHeader) {
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(headers), LOWEST, true));
@@ -8134,7 +8134,7 @@ TEST_F(SpdyNetworkTransactionTest, 100Continue) {
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST));
MockWrite writes[] = {CreateMockWrite(req, 0)};
- spdy::SpdyHeaderBlock informational_headers;
+ spdy::Http2HeaderBlock informational_headers;
informational_headers[spdy::kHttp2StatusHeader] = "100";
spdy::SpdySerializedFrame informational_response(
spdy_util_.ConstructSpdyReply(1, std::move(informational_headers)));
@@ -8705,7 +8705,7 @@ TEST_F(SpdyNetworkTransactionTest, WebSocketOverHTTP2) {
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, HIGHEST));
spdy::SpdySerializedFrame settings_ack(spdy_util_.ConstructSpdySettingsAck());
- spdy::SpdyHeaderBlock websocket_request_headers;
+ spdy::Http2HeaderBlock websocket_request_headers;
websocket_request_headers[spdy::kHttp2MethodHeader] = "CONNECT";
websocket_request_headers[spdy::kHttp2AuthorityHeader] = "www.example.org";
websocket_request_headers[spdy::kHttp2SchemeHeader] = "https";
@@ -8987,7 +8987,7 @@ TEST_F(SpdyNetworkTransactionTest,
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, HIGHEST));
spdy::SpdySerializedFrame settings_ack(spdy_util_.ConstructSpdySettingsAck());
- spdy::SpdyHeaderBlock websocket_request_headers;
+ spdy::Http2HeaderBlock websocket_request_headers;
websocket_request_headers[spdy::kHttp2MethodHeader] = "CONNECT";
websocket_request_headers[spdy::kHttp2AuthorityHeader] = "example.test";
websocket_request_headers[spdy::kHttp2SchemeHeader] = "https";
@@ -9308,7 +9308,7 @@ TEST_F(SpdyNetworkTransactionTest, WebSocketHttp11Required) {
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, HIGHEST));
spdy::SpdySerializedFrame settings_ack(spdy_util_.ConstructSpdySettingsAck());
- spdy::SpdyHeaderBlock websocket_request_headers;
+ spdy::Http2HeaderBlock websocket_request_headers;
websocket_request_headers[spdy::kHttp2MethodHeader] = "CONNECT";
websocket_request_headers[spdy::kHttp2AuthorityHeader] = "www.example.org";
websocket_request_headers[spdy::kHttp2SchemeHeader] = "https";
@@ -9742,11 +9742,11 @@ TEST_F(SpdyNetworkTransactionTest, ZeroRTTNoConfirmMultipleStreams) {
// Run multiple concurrent streams that require handshake confirmation.
TEST_F(SpdyNetworkTransactionTest, ZeroRTTConfirmMultipleStreams) {
- spdy::SpdyHeaderBlock req_block1(
+ spdy::Http2HeaderBlock req_block1(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, 0));
spdy::SpdySerializedFrame req1(
spdy_util_.ConstructSpdyHeaders(1, std::move(req_block1), LOWEST, true));
- spdy::SpdyHeaderBlock req_block2(
+ spdy::Http2HeaderBlock req_block2(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, 0));
spdy::SpdySerializedFrame req2(
spdy_util_.ConstructSpdyHeaders(3, std::move(req_block2), LOWEST, true));
@@ -9832,11 +9832,11 @@ TEST_F(SpdyNetworkTransactionTest, ZeroRTTConfirmMultipleStreams) {
TEST_F(SpdyNetworkTransactionTest, ZeroRTTConfirmNoConfirmStreams) {
// This test orders the writes such that the GET (no confirmation) is written
// before the POST (confirmation required).
- spdy::SpdyHeaderBlock req_block1(
+ spdy::Http2HeaderBlock req_block1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req1(
spdy_util_.ConstructSpdyHeaders(1, std::move(req_block1), LOWEST, true));
- spdy::SpdyHeaderBlock req_block2(
+ spdy::Http2HeaderBlock req_block2(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, 0));
spdy::SpdySerializedFrame req2(
spdy_util_.ConstructSpdyHeaders(3, std::move(req_block2), LOWEST, true));
@@ -9925,11 +9925,11 @@ TEST_F(SpdyNetworkTransactionTest, ZeroRTTConfirmNoConfirmStreams) {
TEST_F(SpdyNetworkTransactionTest, ZeroRTTNoConfirmConfirmStreams) {
// This test orders the writes such that the GET (no confirmation) is written
// before the POST (confirmation required).
- spdy::SpdyHeaderBlock req_block1(
+ spdy::Http2HeaderBlock req_block1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req1(
spdy_util_.ConstructSpdyHeaders(1, std::move(req_block1), LOWEST, true));
- spdy::SpdyHeaderBlock req_block2(
+ spdy::Http2HeaderBlock req_block2(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, 0));
spdy::SpdySerializedFrame req2(
spdy_util_.ConstructSpdyHeaders(3, std::move(req_block2), LOWEST, true));
@@ -10282,7 +10282,7 @@ TEST_F(SpdyNetworkTransactionTest, GreaseFrameTypeWithGetRequest) {
NormalSpdyTransactionHelper helper(request_, DEFAULT_PRIORITY, log_,
std::move(session_deps));
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(headers), DEFAULT_PRIORITY,
@@ -10547,7 +10547,7 @@ TEST_F(SpdyNetworkTransactionTest, OnDataSentDoesNotCrashWithGreasedFrameType) {
NormalSpdyTransactionHelper helper(request_, DEFAULT_PRIORITY, log_,
std::move(session_deps));
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy::SpdySerializedFrame req(
spdy_util_.ConstructSpdyHeaders(1, std::move(headers), DEFAULT_PRIORITY,
diff --git a/chromium/net/spdy/spdy_proxy_client_socket.cc b/chromium/net/spdy/spdy_proxy_client_socket.cc
index ef9682ed124..94ab2675b5f 100644
--- a/chromium/net/spdy/spdy_proxy_client_socket.cc
+++ b/chromium/net/spdy/spdy_proxy_client_socket.cc
@@ -8,7 +8,6 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/location.h"
@@ -384,7 +383,7 @@ int SpdyProxyClientSocket::DoSendRequest() {
NetLogEventType::HTTP_TRANSACTION_SEND_TUNNEL_HEADERS,
request_line, &request_.extra_headers);
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
CreateSpdyHeadersFromHttpRequest(request_, request_.extra_headers, &headers);
return spdy_stream_->SendRequestHeaders(std::move(headers),
@@ -452,8 +451,8 @@ void SpdyProxyClientSocket::OnHeadersSent() {
}
void SpdyProxyClientSocket::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {
// If we've already received the reply, existing headers are too late.
// TODO(mbelshe): figure out a way to make HEADERS frames useful after the
// initial response.
@@ -508,7 +507,7 @@ void SpdyProxyClientSocket::OnDataSent() {
std::move(write_callback_), rv));
}
-void SpdyProxyClientSocket::OnTrailers(const spdy::SpdyHeaderBlock& trailers) {
+void SpdyProxyClientSocket::OnTrailers(const spdy::Http2HeaderBlock& trailers) {
// |spdy_stream_| is of type SPDY_BIDIRECTIONAL_STREAM, so trailers are
// combined with response headers and this method will not be calld.
NOTREACHED();
diff --git a/chromium/net/spdy/spdy_proxy_client_socket.h b/chromium/net/spdy/spdy_proxy_client_socket.h
index 4ad7a96f4b0..e1d89a26245 100644
--- a/chromium/net/spdy/spdy_proxy_client_socket.h
+++ b/chromium/net/spdy/spdy_proxy_client_socket.h
@@ -101,11 +101,11 @@ class NET_EXPORT_PRIVATE SpdyProxyClientSocket : public ProxyClientSocket,
// SpdyStream::Delegate implementation.
void OnHeadersSent() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override;
void OnDataSent() override;
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override;
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override;
void OnClose(int status) override;
bool CanGreaseFrameType() const override;
NetLogSource source_dependency() const override;
diff --git a/chromium/net/spdy/spdy_proxy_client_socket_unittest.cc b/chromium/net/spdy/spdy_proxy_client_socket_unittest.cc
index adad8301b55..fdf4930211d 100644
--- a/chromium/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/chromium/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/strings/string_piece.h"
@@ -132,8 +132,9 @@ class SpdyProxyClientSocketTest : public PlatformTest,
protected:
void Initialize(base::span<const MockRead> reads,
base::span<const MockWrite> writes);
- void PopulateConnectRequestIR(spdy::SpdyHeaderBlock* syn_ir);
- void PopulateConnectReplyIR(spdy::SpdyHeaderBlock* block, const char* status);
+ void PopulateConnectRequestIR(spdy::Http2HeaderBlock* syn_ir);
+ void PopulateConnectReplyIR(spdy::Http2HeaderBlock* block,
+ const char* status);
spdy::SpdySerializedFrame ConstructConnectRequestFrame(
RequestPriority priority = LOWEST);
spdy::SpdySerializedFrame ConstructConnectAuthRequestFrame();
@@ -395,14 +396,14 @@ void SpdyProxyClientSocketTest::AssertWriteLength(int len) {
}
void SpdyProxyClientSocketTest::PopulateConnectRequestIR(
- spdy::SpdyHeaderBlock* block) {
+ spdy::Http2HeaderBlock* block) {
(*block)[spdy::kHttp2MethodHeader] = "CONNECT";
(*block)[spdy::kHttp2AuthorityHeader] = kOriginHostPort;
(*block)["user-agent"] = kUserAgent;
}
void SpdyProxyClientSocketTest::PopulateConnectReplyIR(
- spdy::SpdyHeaderBlock* block,
+ spdy::Http2HeaderBlock* block,
const char* status) {
(*block)[spdy::kHttp2StatusHeader] = status;
}
@@ -411,7 +412,7 @@ void SpdyProxyClientSocketTest::PopulateConnectReplyIR(
spdy::SpdySerializedFrame
SpdyProxyClientSocketTest::ConstructConnectRequestFrame(
RequestPriority priority) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectRequestIR(&block);
return spdy_util_.ConstructSpdyHeaders(kStreamId, std::move(block), priority,
false);
@@ -421,7 +422,7 @@ SpdyProxyClientSocketTest::ConstructConnectRequestFrame(
// Proxy-Authorization headers.
spdy::SpdySerializedFrame
SpdyProxyClientSocketTest::ConstructConnectAuthRequestFrame() {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectRequestIR(&block);
block["proxy-authorization"] = "Basic Zm9vOmJhcg==";
return spdy_util_.ConstructSpdyHeaders(kStreamId, std::move(block), LOWEST,
@@ -431,7 +432,7 @@ SpdyProxyClientSocketTest::ConstructConnectAuthRequestFrame() {
// Constructs a standard SPDY HEADERS frame to match the SPDY CONNECT.
spdy::SpdySerializedFrame
SpdyProxyClientSocketTest::ConstructConnectReplyFrame() {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectReplyIR(&block, "200");
return spdy_util_.ConstructSpdyReply(kStreamId, std::move(block));
}
@@ -440,7 +441,7 @@ SpdyProxyClientSocketTest::ConstructConnectReplyFrame() {
// including Proxy-Authenticate headers.
spdy::SpdySerializedFrame
SpdyProxyClientSocketTest::ConstructConnectAuthReplyFrame() {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectReplyIR(&block, "407");
block["proxy-authenticate"] = "Basic realm=\"MyRealm1\"";
return spdy_util_.ConstructSpdyReply(kStreamId, std::move(block));
@@ -449,7 +450,7 @@ SpdyProxyClientSocketTest::ConstructConnectAuthReplyFrame() {
// Constructs a SPDY HEADERS frame with an HTTP 302 redirect.
spdy::SpdySerializedFrame
SpdyProxyClientSocketTest::ConstructConnectRedirectReplyFrame() {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectReplyIR(&block, "302");
block["location"] = kRedirectUrl;
block["set-cookie"] = "foo=bar";
@@ -459,7 +460,7 @@ SpdyProxyClientSocketTest::ConstructConnectRedirectReplyFrame() {
// Constructs a SPDY HEADERS frame with an HTTP 500 error.
spdy::SpdySerializedFrame
SpdyProxyClientSocketTest::ConstructConnectErrorReplyFrame() {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
PopulateConnectReplyIR(&block, "500");
return spdy_util_.ConstructSpdyReply(kStreamId, std::move(block));
}
diff --git a/chromium/net/spdy/spdy_session.cc b/chromium/net/spdy/spdy_session.cc
index c197413eb88..6eb6fcb3be2 100644
--- a/chromium/net/spdy/spdy_session.cc
+++ b/chromium/net/spdy/spdy_session.cc
@@ -129,8 +129,8 @@ const char kStar[] = "*";
const char kAcceptEncoding[] = "accept-encoding";
enum PushedStreamVaryResponseHeaderValues ParseVaryInPushedResponse(
- const spdy::SpdyHeaderBlock& headers) {
- spdy::SpdyHeaderBlock::iterator it = headers.find(kVary);
+ const spdy::Http2HeaderBlock& headers) {
+ spdy::Http2HeaderBlock::iterator it = headers.find(kVary);
if (it == headers.end())
return kNoVaryHeader;
base::StringPiece value = base::StringViewToStringPiece(it->second);
@@ -223,7 +223,7 @@ bool IsPushEnabled(const spdy::SettingsMap& initial_settings) {
return it->second == 1;
}
-base::Value NetLogSpdyHeadersSentParams(const spdy::SpdyHeaderBlock* headers,
+base::Value NetLogSpdyHeadersSentParams(const spdy::Http2HeaderBlock* headers,
bool fin,
spdy::SpdyStreamId stream_id,
bool has_priority,
@@ -233,7 +233,8 @@ base::Value NetLogSpdyHeadersSentParams(const spdy::SpdyHeaderBlock* headers,
NetLogSource source_dependency,
NetLogCaptureMode capture_mode) {
base::Value dict(base::Value::Type::DICTIONARY);
- dict.SetKey("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode));
+ dict.SetKey("headers",
+ ElideHttp2HeaderBlockForNetLog(*headers, capture_mode));
dict.SetBoolKey("fin", fin);
dict.SetIntKey("stream_id", stream_id);
dict.SetBoolKey("has_priority", has_priority);
@@ -249,12 +250,13 @@ base::Value NetLogSpdyHeadersSentParams(const spdy::SpdyHeaderBlock* headers,
}
base::Value NetLogSpdyHeadersReceivedParams(
- const spdy::SpdyHeaderBlock* headers,
+ const spdy::Http2HeaderBlock* headers,
bool fin,
spdy::SpdyStreamId stream_id,
NetLogCaptureMode capture_mode) {
base::Value dict(base::Value::Type::DICTIONARY);
- dict.SetKey("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode));
+ dict.SetKey("headers",
+ ElideHttp2HeaderBlockForNetLog(*headers, capture_mode));
dict.SetBoolKey("fin", fin);
dict.SetIntKey("stream_id", stream_id);
return dict;
@@ -385,12 +387,13 @@ base::Value NetLogSpdyRecvGoAwayParams(spdy::SpdyStreamId last_stream_id,
}
base::Value NetLogSpdyPushPromiseReceivedParams(
- const spdy::SpdyHeaderBlock* headers,
+ const spdy::Http2HeaderBlock* headers,
spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId promised_stream_id,
NetLogCaptureMode capture_mode) {
base::Value dict(base::Value::Type::DICTIONARY);
- dict.SetKey("headers", ElideSpdyHeaderBlockForNetLog(*headers, capture_mode));
+ dict.SetKey("headers",
+ ElideHttp2HeaderBlockForNetLog(*headers, capture_mode));
dict.SetIntKey("id", stream_id);
dict.SetIntKey("promised_stream_id", promised_stream_id);
return dict;
@@ -882,7 +885,7 @@ bool SpdySession::CanPool(
HostPortPair(new_hostname, 0), ssl_info.is_issued_by_known_root,
ssl_info.public_key_hashes, ssl_info.unverified_cert.get(),
ssl_info.cert.get(), TransportSecurityState::DISABLE_PIN_REPORTS,
- &pinning_failure_log) ==
+ network_isolation_key, &pinning_failure_log) ==
TransportSecurityState::PKPStatus::VIOLATED) {
return false;
}
@@ -1173,7 +1176,7 @@ std::unique_ptr<spdy::SpdySerializedFrame> SpdySession::CreateHeaders(
spdy::SpdyStreamId stream_id,
RequestPriority priority,
spdy::SpdyControlFlags flags,
- spdy::SpdyHeaderBlock block,
+ spdy::Http2HeaderBlock block,
NetLogSource source_dependency) {
ActiveStreamMap::const_iterator it = active_streams_.find(stream_id);
CHECK(it != active_streams_.end());
@@ -1647,9 +1650,9 @@ bool SpdySession::ValidatePushedStream(spdy::SpdyStreamId stream_id,
NOTREACHED();
return false;
}
- const spdy::SpdyHeaderBlock& request_headers =
+ const spdy::Http2HeaderBlock& request_headers =
stream_it->second->request_headers();
- spdy::SpdyHeaderBlock::const_iterator method_it =
+ spdy::Http2HeaderBlock::const_iterator method_it =
request_headers.find(spdy::kHttp2MethodHeader);
if (method_it == request_headers.end()) {
// TryCreatePushStream() would have reset the stream if it had no method.
@@ -1901,7 +1904,7 @@ void SpdySession::ProcessPendingStreamRequests() {
void SpdySession::TryCreatePushStream(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId associated_stream_id,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
// Pushed streams are speculative, so they start at an IDLE priority.
// TODO(bnc): Send pushed stream cancellation with higher priority to avoid
// wasting bandwidth.
@@ -1980,7 +1983,7 @@ void SpdySession::TryCreatePushStream(spdy::SpdyStreamId stream_id,
// "Promised requests MUST be cacheable and MUST be safe [...]" (RFC7540
// Section 8.2). Only cacheable safe request methods are GET and HEAD.
// GetPromisedUrlFromHeaders() guarantees that the method is GET or HEAD.
- spdy::SpdyHeaderBlock::const_iterator it =
+ spdy::Http2HeaderBlock::const_iterator it =
headers.find(spdy::kHttp2MethodHeader);
DCHECK(it != headers.end() && (it->second == "GET" || it->second == "HEAD"));
@@ -2919,7 +2922,7 @@ void SpdySession::RecordProtocolErrorHistogram(
// static
void SpdySession::RecordPushedStreamVaryResponseHeaderHistogram(
- const spdy::SpdyHeaderBlock& headers) {
+ const spdy::Http2HeaderBlock& headers) {
UMA_HISTOGRAM_ENUMERATION("Net.PushedStreamVaryResponseHeader",
ParseVaryInPushedResponse(headers),
kNumberOfVaryEntries);
@@ -3353,7 +3356,7 @@ void SpdySession::OnWindowUpdate(spdy::SpdyStreamId stream_id,
void SpdySession::OnPushPromise(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
CHECK(in_io_loop_);
net_log_.AddEvent(NetLogEventType::HTTP2_SESSION_RECV_PUSH_PROMISE,
@@ -3372,7 +3375,7 @@ void SpdySession::OnHeaders(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId parent_stream_id,
bool exclusive,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
base::TimeTicks recv_first_byte_time) {
CHECK(in_io_loop_);
diff --git a/chromium/net/spdy/spdy_session.h b/chromium/net/spdy/spdy_session.h
index 7946b7bba6b..a0aa330ef64 100644
--- a/chromium/net/spdy/spdy_session.h
+++ b/chromium/net/spdy/spdy_session.h
@@ -453,7 +453,7 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
spdy::SpdyStreamId stream_id,
RequestPriority priority,
spdy::SpdyControlFlags flags,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
NetLogSource source_dependency);
// Creates and returns a SpdyBuffer holding a data frame with the given data.
@@ -710,7 +710,7 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
void TryCreatePushStream(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId associated_stream_id,
- spdy::SpdyHeaderBlock headers);
+ spdy::Http2HeaderBlock headers);
// Close the stream pointed to by the given iterator. Note that that
// stream may hold the last reference to the session.
@@ -847,7 +847,7 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
void RecordHistograms();
void RecordProtocolErrorHistogram(SpdyProtocolErrorDetails details);
static void RecordPushedStreamVaryResponseHeaderHistogram(
- const spdy::SpdyHeaderBlock& headers);
+ const spdy::Http2HeaderBlock& headers);
// DCHECKs that |availability_state_| >= STATE_GOING_AWAY, that
// there are no pending stream creation requests, and that there are
@@ -910,14 +910,14 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
int delta_window_size) override;
void OnPushPromise(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers) override;
+ spdy::Http2HeaderBlock headers) override;
void OnHeaders(spdy::SpdyStreamId stream_id,
bool has_priority,
int weight,
spdy::SpdyStreamId parent_stream_id,
bool exclusive,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
base::TimeTicks recv_first_byte_time) override;
void OnAltSvc(spdy::SpdyStreamId stream_id,
base::StringPiece origin,
diff --git a/chromium/net/spdy/spdy_session_fuzzer.cc b/chromium/net/spdy/spdy_session_fuzzer.cc
index 26de4b0489d..c5a3c10ffa8 100644
--- a/chromium/net/spdy/spdy_session_fuzzer.cc
+++ b/chromium/net/spdy/spdy_session_fuzzer.cc
@@ -34,11 +34,11 @@ class FuzzerDelegate : public net::SpdyStream::Delegate {
void OnHeadersSent() override {}
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override {}
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override {}
void OnDataReceived(std::unique_ptr<net::SpdyBuffer> buffer) override {}
void OnDataSent() override {}
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override {}
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override {}
void OnClose(int status) override { std::move(done_closure_).Run(); }
bool CanGreaseFrameType() const override { return false; }
diff --git a/chromium/net/spdy/spdy_session_pool.cc b/chromium/net/spdy/spdy_session_pool.cc
index 2343ad8f09e..f2079962a2b 100644
--- a/chromium/net/spdy/spdy_session_pool.cc
+++ b/chromium/net/spdy/spdy_session_pool.cc
@@ -419,9 +419,8 @@ void SpdySessionPool::CloseCurrentSessions(Error error) {
false /* idle_only */);
}
-void SpdySessionPool::CloseCurrentIdleSessions() {
- CloseCurrentSessionsHelper(ERR_ABORTED, "Closing idle sessions.",
- true /* idle_only */);
+void SpdySessionPool::CloseCurrentIdleSessions(const std::string& description) {
+ CloseCurrentSessionsHelper(ERR_ABORTED, description, true /* idle_only */);
}
void SpdySessionPool::CloseAllSessions() {
diff --git a/chromium/net/spdy/spdy_session_pool.h b/chromium/net/spdy/spdy_session_pool.h
index 5a2cacabcaa..9ae95803487 100644
--- a/chromium/net/spdy/spdy_session_pool.h
+++ b/chromium/net/spdy/spdy_session_pool.h
@@ -264,7 +264,7 @@ class NET_EXPORT SpdySessionPool
// Close only the currently existing SpdySessions that are idle.
// Let any new ones created while this method is running continue to
// live.
- void CloseCurrentIdleSessions();
+ void CloseCurrentIdleSessions(const std::string& description);
// Repeatedly close all SpdySessions until all of them (including new ones
// created in the process of closing the current ones, and new ones created in
diff --git a/chromium/net/spdy/spdy_session_pool_unittest.cc b/chromium/net/spdy/spdy_session_pool_unittest.cc
index c416de9e132..6a5e091000e 100644
--- a/chromium/net/spdy/spdy_session_pool_unittest.cc
+++ b/chromium/net/spdy/spdy_session_pool_unittest.cc
@@ -11,7 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/run_loop.h"
#include "base/stl_util.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "base/trace_event/process_memory_dump.h"
@@ -178,14 +178,14 @@ class SessionOpeningDelegate : public SpdyStream::Delegate {
void OnHeadersSent() override {}
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override {}
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override {}
void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override {}
void OnDataSent() override {}
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override {}
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override {}
void OnClose(int status) override {
ignore_result(CreateFakeSpdySession(spdy_session_pool_, key_));
@@ -250,6 +250,7 @@ TEST_F(SpdySessionPoolTest, CloseCurrentSessions) {
}
TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
+ const std::string close_session_description = "Closing idle sessions.";
MockConnect connect_data(SYNCHRONOUS, OK);
MockRead reads[] = {
MockRead(SYNCHRONOUS, ERR_IO_PENDING) // Stall forever.
@@ -318,7 +319,7 @@ TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
EXPECT_TRUE(session3->IsAvailable());
// Should not do anything, all are active
- spdy_session_pool_->CloseCurrentIdleSessions();
+ spdy_session_pool_->CloseCurrentIdleSessions(close_session_description);
EXPECT_TRUE(session1->is_active());
EXPECT_TRUE(session1->IsAvailable());
EXPECT_TRUE(session2->is_active());
@@ -340,7 +341,7 @@ TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
EXPECT_TRUE(session3->IsAvailable());
// Should close session 1 and 3, 2 should be left open
- spdy_session_pool_->CloseCurrentIdleSessions();
+ spdy_session_pool_->CloseCurrentIdleSessions(close_session_description);
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(session1);
@@ -349,7 +350,7 @@ TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
EXPECT_FALSE(session3);
// Should not do anything
- spdy_session_pool_->CloseCurrentIdleSessions();
+ spdy_session_pool_->CloseCurrentIdleSessions(close_session_description);
base::RunLoop().RunUntilIdle();
EXPECT_TRUE(session2->is_active());
@@ -364,7 +365,7 @@ TEST_F(SpdySessionPoolTest, CloseCurrentIdleSessions) {
EXPECT_TRUE(session2->IsAvailable());
// This should close session 2
- spdy_session_pool_->CloseCurrentIdleSessions();
+ spdy_session_pool_->CloseCurrentIdleSessions(close_session_description);
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(session2);
@@ -582,7 +583,7 @@ void SpdySessionPoolTest::RunIPPoolingTest(
// Test that calling CloseIdleSessions, does not cause a crash.
// http://crbug.com/181400
- spdy_session_pool_->CloseCurrentIdleSessions();
+ spdy_session_pool_->CloseCurrentIdleSessions("Closing idle sessions.");
base::RunLoop().RunUntilIdle();
// Verify spdy_session and spdy_session1 are closed.
@@ -860,7 +861,8 @@ TEST_F(SpdySessionPoolTest, IPAddressChanged) {
test::StreamDelegateDoNothing delegateA(spdy_streamA);
spdy_streamA->SetDelegate(&delegateA);
- spdy::SpdyHeaderBlock headers(spdy_util.ConstructGetHeaderBlock(urlA.spec()));
+ spdy::Http2HeaderBlock headers(
+ spdy_util.ConstructGetHeaderBlock(urlA.spec()));
spdy_streamA->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
base::RunLoop().RunUntilIdle(); // Allow headers to write.
@@ -974,7 +976,7 @@ TEST_F(SpdySessionPoolTest, HandleIPAddressChangeThenShutdown) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(spdy_util.ConstructGetHeaderBlock(url.spec()));
+ spdy::Http2HeaderBlock headers(spdy_util.ConstructGetHeaderBlock(url.spec()));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
base::RunLoop().RunUntilIdle();
@@ -1032,7 +1034,7 @@ TEST_F(SpdySessionPoolTest, HandleGracefulGoawayThenShutdown) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(spdy_util.ConstructGetHeaderBlock(url.spec()));
+ spdy::Http2HeaderBlock headers(spdy_util.ConstructGetHeaderBlock(url.spec()));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
// Send headers.
@@ -1190,7 +1192,7 @@ TEST_F(SpdySessionPoolTest, IPConnectionPoolingWithWebSockets) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(spdy_util.ConstructGetHeaderBlock(url.spec()));
+ spdy::Http2HeaderBlock headers(spdy_util.ConstructGetHeaderBlock(url.spec()));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
base::RunLoop().RunUntilIdle();
diff --git a/chromium/net/spdy/spdy_session_unittest.cc b/chromium/net/spdy/spdy_session_unittest.cc
index 997d6c50e11..bb7faa4a050 100644
--- a/chromium/net/spdy/spdy_session_unittest.cc
+++ b/chromium/net/spdy/spdy_session_unittest.cc
@@ -562,9 +562,9 @@ TEST_F(SpdySessionTest, GoAwayWithActiveStreams) {
test::StreamDelegateDoNothing delegate2(spdy_stream2);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
- spdy::SpdyHeaderBlock headers2(headers.Clone());
+ spdy::Http2HeaderBlock headers2(headers.Clone());
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -624,7 +624,7 @@ TEST_F(SpdySessionTest, GoAwayWithActiveAndCreatedStream) {
test_url_, MEDIUM, NetLogWithSource());
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -691,9 +691,9 @@ TEST_F(SpdySessionTest, GoAwayTwice) {
test::StreamDelegateDoNothing delegate2(spdy_stream2);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
- spdy::SpdyHeaderBlock headers2(headers.Clone());
+ spdy::Http2HeaderBlock headers2(headers.Clone());
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -759,9 +759,9 @@ TEST_F(SpdySessionTest, GoAwayWithActiveStreamsThenClose) {
test::StreamDelegateDoNothing delegate2(spdy_stream2);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
- spdy::SpdyHeaderBlock headers2(headers.Clone());
+ spdy::Http2HeaderBlock headers2(headers.Clone());
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -841,7 +841,7 @@ TEST_F(SpdySessionTest, GoAwayWhileDraining) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -881,7 +881,7 @@ TEST_F(SpdySessionTest, CreateStreamAfterGoAway) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -943,7 +943,7 @@ TEST_F(SpdySessionTest, HeadersAfterGoAway) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -977,14 +977,14 @@ TEST_F(SpdySessionTest, HeadersAfterGoAway) {
TEST_F(SpdySessionTest, UnsupportedPushedStatusCode) {
base::HistogramTester histogram_tester;
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
push_promise_header_block[spdy::kHttp2MethodHeader] = "GET";
spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_promise_header_block);
spdy::SpdySerializedFrame push_promise_frame(
spdy_util_.ConstructSpdyPushPromise(
1, 2, std::move(push_promise_header_block)));
- spdy::SpdyHeaderBlock response_header_block;
+ spdy::Http2HeaderBlock response_header_block;
response_header_block[spdy::kHttp2StatusHeader] = "401";
spdy::SpdySerializedFrame response_headers_frame(
spdy_util_.ConstructSpdyResponseHeaders(
@@ -1018,7 +1018,7 @@ TEST_F(SpdySessionTest, UnsupportedPushedStatusCode) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -1062,7 +1062,7 @@ TEST_F(SpdySessionTest, NetworkChangeWithActiveStreams) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -1240,7 +1240,7 @@ TEST_F(SpdySessionTest, PingAndWriteLoop) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -1457,7 +1457,7 @@ TEST_F(SpdySessionTest, MaxConcurrentStreamsZero) {
base::WeakPtr<SpdyStream> stream = request.ReleaseStream();
test::StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -1569,7 +1569,7 @@ TEST_F(SpdySessionTest, CancelPushAfterSessionGoesAway) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -1635,7 +1635,7 @@ TEST_F(SpdySessionTestWithMockTime, CancelPushAfterExpired) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -1715,7 +1715,7 @@ TEST_F(SpdySessionTestWithMockTime, ClaimPushedStreamBeforeExpires) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -1806,7 +1806,7 @@ TEST_F(SpdySessionTest, CancelPushBeforeClaimed) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -2306,7 +2306,7 @@ TEST_F(SpdySessionTest, HeadersCompressionHistograms) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -2378,12 +2378,12 @@ TEST_F(SpdySessionTest, OutOfOrderHeaders) {
// Queue the lower priority one first.
- spdy::SpdyHeaderBlock headers_lowest(
+ spdy::Http2HeaderBlock headers_lowest(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream_lowest->SendRequestHeaders(std::move(headers_lowest),
NO_MORE_DATA_TO_SEND);
- spdy::SpdyHeaderBlock headers_highest(
+ spdy::Http2HeaderBlock headers_highest(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream_highest->SendRequestHeaders(std::move(headers_highest),
NO_MORE_DATA_TO_SEND);
@@ -2437,11 +2437,11 @@ TEST_F(SpdySessionTest, CancelStream) {
test::StreamDelegateDoNothing delegate2(spdy_stream2);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -2499,11 +2499,11 @@ TEST_F(SpdySessionTest, CloseSessionWithTwoCreatedSelfClosingStreams) {
test::ClosingDelegate delegate2(spdy_stream2);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -2555,11 +2555,11 @@ TEST_F(SpdySessionTest, CloseSessionWithTwoCreatedMutuallyClosingStreams) {
test::ClosingDelegate delegate2(spdy_stream1);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -2621,11 +2621,11 @@ TEST_F(SpdySessionTest, CloseSessionWithTwoActivatedSelfClosingStreams) {
test::ClosingDelegate delegate2(spdy_stream2);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -2696,11 +2696,11 @@ TEST_F(SpdySessionTest, CloseSessionWithTwoActivatedMutuallyClosingStreams) {
test::ClosingDelegate delegate2(spdy_stream1);
spdy_stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -2782,7 +2782,7 @@ TEST_F(SpdySessionTest, CloseActivatedStreamThatClosesSession) {
SessionClosingDelegate delegate(spdy_stream, session_);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -2968,7 +2968,7 @@ TEST_F(SpdySessionTest, CloseTwoStalledCreateStream) {
EXPECT_EQ(1u, num_created_streams());
EXPECT_EQ(2u, pending_create_stream_queue_size(LOWEST));
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -2992,7 +2992,7 @@ TEST_F(SpdySessionTest, CloseTwoStalledCreateStream) {
base::WeakPtr<SpdyStream> stream2 = request2.ReleaseStream();
test::StreamDelegateDoNothing delegate2(stream2);
stream2->SetDelegate(&delegate2);
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
stream2->SendRequestHeaders(std::move(headers2), NO_MORE_DATA_TO_SEND);
@@ -3016,7 +3016,7 @@ TEST_F(SpdySessionTest, CloseTwoStalledCreateStream) {
base::WeakPtr<SpdyStream> stream3 = request3.ReleaseStream();
test::StreamDelegateDoNothing delegate3(stream3);
stream3->SetDelegate(&delegate3);
- spdy::SpdyHeaderBlock headers3(
+ spdy::Http2HeaderBlock headers3(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
stream3->SendRequestHeaders(std::move(headers3), NO_MORE_DATA_TO_SEND);
@@ -3171,7 +3171,7 @@ TEST_F(SpdySessionTest, ReadDataWithoutYielding) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -3234,7 +3234,7 @@ TEST_F(SpdySessionTest, TestYieldingSlowReads) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -3305,7 +3305,7 @@ TEST_F(SpdySessionTest, TestYieldingSlowSynchronousReads) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -3386,7 +3386,7 @@ TEST_F(SpdySessionTest, TestYieldingDuringReadData) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -3496,7 +3496,7 @@ TEST_F(SpdySessionTest, TestYieldingDuringAsyncReadData) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -3560,7 +3560,7 @@ TEST_F(SpdySessionTest, GoAwayWhileInDoReadLoop) {
ASSERT_TRUE(spdy_stream1);
EXPECT_EQ(0u, spdy_stream1->stream_id());
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers1), NO_MORE_DATA_TO_SEND);
@@ -3787,7 +3787,7 @@ TEST_F(SpdySessionTest, CloseSessionOnIdleWhenPoolStalled) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, spdy_stream1->SendRequestHeaders(
std::move(headers1), NO_MORE_DATA_TO_SEND));
@@ -3923,7 +3923,7 @@ TEST_F(SpdySessionTest, CreateStreamOnStreamReset) {
StreamCreatingDelegate delegate(spdy_stream, session_);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -4193,7 +4193,7 @@ TEST_F(SpdySessionTest, StreamFlowControlTooMuchData) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, spdy_stream->SendRequestHeaders(
std::move(headers), NO_MORE_DATA_TO_SEND));
@@ -4328,7 +4328,7 @@ TEST_F(SpdySessionTest, StreamFlowControlTooMuchDataTwoDataFrames) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, spdy_stream->SendRequestHeaders(
std::move(headers), NO_MORE_DATA_TO_SEND));
@@ -4419,7 +4419,7 @@ TEST_F(SpdySessionTest, SessionFlowControlNoReceiveLeaks) {
DropReceivedDataDelegate delegate(stream, msg_data);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kMsgDataSize));
EXPECT_EQ(ERR_IO_PENDING,
stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND));
@@ -4484,7 +4484,7 @@ TEST_F(SpdySessionTest, SessionFlowControlNoSendLeaks) {
test::StreamDelegateSendImmediate delegate(stream, msg_data);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kMsgDataSize));
EXPECT_EQ(ERR_IO_PENDING,
stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND));
@@ -4566,7 +4566,7 @@ TEST_F(SpdySessionTest, SessionFlowControlEndToEnd) {
test::StreamDelegateSendImmediate delegate(stream, msg_data);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kMsgDataSize));
EXPECT_EQ(ERR_IO_PENDING,
stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND));
@@ -4660,7 +4660,7 @@ void SpdySessionTest::RunResumeAfterUnstallTest(
EXPECT_FALSE(stream->send_stalled_by_flow_control());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING,
stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND));
@@ -4795,7 +4795,7 @@ TEST_F(SpdySessionTest, ResumeByPriorityAfterSendWindowSizeIncrease) {
StallSessionSend();
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream1->SendRequestHeaders(std::move(headers1),
MORE_DATA_TO_SEND));
@@ -4805,7 +4805,7 @@ TEST_F(SpdySessionTest, ResumeByPriorityAfterSendWindowSizeIncrease) {
EXPECT_EQ(1u, stream1->stream_id());
EXPECT_TRUE(stream1->send_stalled_by_flow_control());
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream2->SendRequestHeaders(std::move(headers2),
MORE_DATA_TO_SEND));
@@ -4901,7 +4901,7 @@ TEST_F(SpdySessionTest, ResumeSessionWithStalledStream) {
StallSessionSend();
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream1->SendRequestHeaders(std::move(headers1),
MORE_DATA_TO_SEND));
@@ -4911,7 +4911,7 @@ TEST_F(SpdySessionTest, ResumeSessionWithStalledStream) {
EXPECT_EQ(1u, stream1->stream_id());
EXPECT_TRUE(stream1->send_stalled_by_flow_control());
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream2->SendRequestHeaders(std::move(headers2),
MORE_DATA_TO_SEND));
@@ -5052,7 +5052,7 @@ TEST_F(SpdySessionTest, SendWindowSizeIncreaseWithDeletedStreams) {
StallSessionSend();
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream1->SendRequestHeaders(std::move(headers1),
MORE_DATA_TO_SEND));
@@ -5062,7 +5062,7 @@ TEST_F(SpdySessionTest, SendWindowSizeIncreaseWithDeletedStreams) {
EXPECT_EQ(1u, stream1->stream_id());
EXPECT_TRUE(stream1->send_stalled_by_flow_control());
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream2->SendRequestHeaders(std::move(headers2),
MORE_DATA_TO_SEND));
@@ -5072,7 +5072,7 @@ TEST_F(SpdySessionTest, SendWindowSizeIncreaseWithDeletedStreams) {
EXPECT_EQ(3u, stream2->stream_id());
EXPECT_TRUE(stream2->send_stalled_by_flow_control());
- spdy::SpdyHeaderBlock headers3(
+ spdy::Http2HeaderBlock headers3(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream3->SendRequestHeaders(std::move(headers3),
MORE_DATA_TO_SEND));
@@ -5175,7 +5175,7 @@ TEST_F(SpdySessionTest, SendWindowSizeIncreaseWithDeletedSession) {
StallSessionSend();
- spdy::SpdyHeaderBlock headers1(
+ spdy::Http2HeaderBlock headers1(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream1->SendRequestHeaders(std::move(headers1),
MORE_DATA_TO_SEND));
@@ -5185,7 +5185,7 @@ TEST_F(SpdySessionTest, SendWindowSizeIncreaseWithDeletedSession) {
EXPECT_EQ(1u, stream1->stream_id());
EXPECT_TRUE(stream1->send_stalled_by_flow_control());
- spdy::SpdyHeaderBlock headers2(
+ spdy::Http2HeaderBlock headers2(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kBodyDataSize));
EXPECT_EQ(ERR_IO_PENDING, stream2->SendRequestHeaders(std::move(headers2),
MORE_DATA_TO_SEND));
@@ -5255,7 +5255,7 @@ TEST_F(SpdySessionTest, GoAwayOnSessionFlowControlError) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -5325,7 +5325,7 @@ TEST_F(SpdySessionTest, PushedStreamShouldNotCountToClientConcurrencyLimit) {
EXPECT_EQ(0u, num_pushed_streams());
EXPECT_EQ(0u, num_active_pushed_streams());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -5412,7 +5412,7 @@ TEST_F(SpdySessionTest, RejectPushedStreamExceedingConcurrencyLimit) {
EXPECT_EQ(0u, num_pushed_streams());
EXPECT_EQ(0u, num_active_pushed_streams());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -5511,7 +5511,7 @@ TEST_F(SpdySessionTest, TrustedSpdyProxy) {
EXPECT_EQ(0u, num_pushed_streams());
EXPECT_EQ(0u, num_active_pushed_streams());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -5599,7 +5599,7 @@ TEST_F(SpdySessionTest, TrustedSpdyProxyNotSet) {
EXPECT_EQ(0u, num_pushed_streams());
EXPECT_EQ(0u, num_active_pushed_streams());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -5628,7 +5628,7 @@ TEST_F(SpdySessionTest, IgnoreReservedRemoteStreamsCount) {
spdy::SpdySerializedFrame push_a(
spdy_util_.ConstructSpdyPush(nullptr, 0, 2, 1, kPushedUrl));
- spdy::SpdyHeaderBlock push_headers;
+ spdy::Http2HeaderBlock push_headers;
push_headers[":method"] = "GET";
spdy_util_.AddUrlToHeaderBlock("https://www.example.org/b.dat",
&push_headers);
@@ -5678,7 +5678,7 @@ TEST_F(SpdySessionTest, IgnoreReservedRemoteStreamsCount) {
EXPECT_EQ(0u, num_pushed_streams());
EXPECT_EQ(0u, num_active_pushed_streams());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -5728,7 +5728,7 @@ TEST_F(SpdySessionTest, IgnoreReservedRemoteStreamsCount) {
}
TEST_F(SpdySessionTest, CancelReservedStreamOnHeadersReceived) {
- spdy::SpdyHeaderBlock push_headers;
+ spdy::Http2HeaderBlock push_headers;
push_headers[":method"] = "GET";
spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_headers);
spdy::SpdySerializedFrame push_promise(
@@ -5773,7 +5773,7 @@ TEST_F(SpdySessionTest, CancelReservedStreamOnHeadersReceived) {
EXPECT_EQ(0u, num_pushed_streams());
EXPECT_EQ(0u, num_active_pushed_streams());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -5836,7 +5836,7 @@ TEST_F(SpdySessionTest, CancelReservedStreamOnHeadersReceived) {
}
TEST_F(SpdySessionTest, GetPushedStream) {
- spdy::SpdyHeaderBlock push_headers;
+ spdy::Http2HeaderBlock push_headers;
push_headers[":method"] = "GET";
spdy_util_.AddUrlToHeaderBlock(kPushedUrl, &push_headers);
spdy::SpdySerializedFrame push_promise(
@@ -5878,7 +5878,7 @@ TEST_F(SpdySessionTest, GetPushedStream) {
EXPECT_EQ(0u, num_pushed_streams());
EXPECT_EQ(0u, num_active_pushed_streams());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -6216,7 +6216,7 @@ TEST_P(SpdySessionReadIfReadyTest, ReadIfReady) {
test::StreamDelegateDoNothing delegate(spdy_stream);
spdy_stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
spdy_stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -6582,7 +6582,7 @@ TEST_F(AltSvcFrameTest, ProcessAltSvcFrameOnActiveStream) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(request_origin));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -6662,7 +6662,7 @@ TEST_F(AltSvcFrameTest,
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(request_origin));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -6731,7 +6731,7 @@ TEST_F(AltSvcFrameTest, DoNotProcessAltSvcFrameOnStreamWithInsecureOrigin) {
test::StreamDelegateDoNothing delegate1(spdy_stream1);
spdy_stream1->SetDelegate(&delegate1);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(request_origin));
spdy_stream1->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND);
@@ -7195,7 +7195,7 @@ TEST(RecordPushedStreamHistogramTest, VaryResponseHeader) {
{1, {"vary", "foo, accept-encodingbar"}, 5}};
for (size_t i = 0; i < base::size(test_cases); ++i) {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
for (size_t j = 0; j < test_cases[i].num_headers; ++j) {
headers[test_cases[i].headers[2 * j]] = test_cases[i].headers[2 * j + 1];
}
diff --git a/chromium/net/spdy/spdy_stream.cc b/chromium/net/spdy/spdy_stream.cc
index 1d92a0b0821..d84c4345520 100644
--- a/chromium/net/spdy/spdy_stream.cc
+++ b/chromium/net/spdy/spdy_stream.cc
@@ -384,7 +384,7 @@ void SpdyStream::SetRequestTime(base::Time t) {
}
void SpdyStream::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock& response_headers,
base::Time response_time,
base::TimeTicks recv_first_byte_time) {
switch (response_state_) {
@@ -392,7 +392,7 @@ void SpdyStream::OnHeadersReceived(
// No header block has been received yet.
DCHECK(response_headers_.empty());
- spdy::SpdyHeaderBlock::const_iterator it =
+ spdy::Http2HeaderBlock::const_iterator it =
response_headers.find(spdy::kHttp2StatusHeader);
if (it == response_headers.end()) {
const std::string error("Response headers do not include :status.");
@@ -494,7 +494,7 @@ bool SpdyStream::ShouldRetryRSTPushStream() const {
return (response_headers_.empty() && type_ == SPDY_PUSH_STREAM && delegate_);
}
-void SpdyStream::OnPushPromiseHeadersReceived(spdy::SpdyHeaderBlock headers,
+void SpdyStream::OnPushPromiseHeadersReceived(spdy::Http2HeaderBlock headers,
GURL url) {
CHECK(!request_headers_valid_);
CHECK_EQ(io_state_, STATE_IDLE);
@@ -731,7 +731,7 @@ base::WeakPtr<SpdyStream> SpdyStream::GetWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
-int SpdyStream::SendRequestHeaders(spdy::SpdyHeaderBlock request_headers,
+int SpdyStream::SendRequestHeaders(spdy::Http2HeaderBlock request_headers,
SpdySendStatus send_status) {
CHECK_NE(type_, SPDY_PUSH_STREAM);
CHECK_EQ(pending_send_status_, MORE_DATA_TO_SEND);
@@ -903,7 +903,7 @@ void SpdyStream::QueueNextDataFrame() {
}
void SpdyStream::SaveResponseHeaders(
- const spdy::SpdyHeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock& response_headers,
int status) {
DCHECK(response_headers_.empty());
if (response_headers.find("transfer-encoding") != response_headers.end()) {
@@ -912,7 +912,7 @@ void SpdyStream::SaveResponseHeaders(
return;
}
- for (spdy::SpdyHeaderBlock::const_iterator it = response_headers.begin();
+ for (spdy::Http2HeaderBlock::const_iterator it = response_headers.begin();
it != response_headers.end(); ++it) {
response_headers_.insert(*it);
}
diff --git a/chromium/net/spdy/spdy_stream.h b/chromium/net/spdy/spdy_stream.h
index 922c43fefc1..a579bf98759 100644
--- a/chromium/net/spdy/spdy_stream.h
+++ b/chromium/net/spdy/spdy_stream.h
@@ -85,8 +85,8 @@ class NET_EXPORT_PRIVATE SpdyStream {
// Called when response headers have been received. In case of a pushed
// stream, the pushed request headers are also passed.
virtual void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) = 0;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) = 0;
// Called when data is received. |buffer| may be NULL, which signals EOF.
// May cause the stream to be closed.
@@ -96,7 +96,7 @@ class NET_EXPORT_PRIVATE SpdyStream {
virtual void OnDataSent() = 0;
// Called when trailers are received.
- virtual void OnTrailers(const spdy::SpdyHeaderBlock& trailers) = 0;
+ virtual void OnTrailers(const spdy::Http2HeaderBlock& trailers) = 0;
// Called when SpdyStream is closed. No other delegate functions
// will be called after this is called, and the delegate must not
@@ -253,13 +253,13 @@ class NET_EXPORT_PRIVATE SpdyStream {
// Called by SpdySession when headers are received for this stream. May close
// the stream.
- void OnHeadersReceived(const spdy::SpdyHeaderBlock& response_headers,
+ void OnHeadersReceived(const spdy::Http2HeaderBlock& response_headers,
base::Time response_time,
base::TimeTicks recv_first_byte_time);
// Called by the SpdySession when a frame carrying request headers opening a
// push stream is received. Stream transits to STATE_RESERVED_REMOTE state.
- void OnPushPromiseHeadersReceived(spdy::SpdyHeaderBlock headers, GURL url);
+ void OnPushPromiseHeadersReceived(spdy::Http2HeaderBlock headers, GURL url);
// Called by the SpdySession when response data has been received
// for this stream. This callback may be called multiple times as
@@ -324,7 +324,7 @@ class NET_EXPORT_PRIVATE SpdyStream {
// MORE_DATA_TO_SEND for bidirectional streams; for request/response streams,
// it must be MORE_DATA_TO_SEND if the request has data to upload, or
// NO_MORE_DATA_TO_SEND if not.
- int SendRequestHeaders(spdy::SpdyHeaderBlock request_headers,
+ int SendRequestHeaders(spdy::Http2HeaderBlock request_headers,
SpdySendStatus send_status);
// Sends a DATA frame. The delegate will be notified via
@@ -384,10 +384,10 @@ class NET_EXPORT_PRIVATE SpdyStream {
bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const;
- const spdy::SpdyHeaderBlock& request_headers() const {
+ const spdy::Http2HeaderBlock& request_headers() const {
return request_headers_;
}
- const spdy::SpdyHeaderBlock& response_headers() const {
+ const spdy::Http2HeaderBlock& response_headers() const {
return response_headers_;
}
@@ -449,7 +449,7 @@ class NET_EXPORT_PRIVATE SpdyStream {
// Saves the given headers into |response_headers_| and calls
// OnHeadersReceived() on the delegate if attached.
- void SaveResponseHeaders(const spdy::SpdyHeaderBlock& response_headers,
+ void SaveResponseHeaders(const spdy::Http2HeaderBlock& response_headers,
int status);
static std::string DescribeState(State state);
@@ -487,7 +487,7 @@ class NET_EXPORT_PRIVATE SpdyStream {
// The headers for the request to send.
bool request_headers_valid_;
- spdy::SpdyHeaderBlock request_headers_;
+ spdy::Http2HeaderBlock request_headers_;
// Data waiting to be sent, and the close state of the local endpoint
// after the data is fully written.
@@ -504,7 +504,7 @@ class NET_EXPORT_PRIVATE SpdyStream {
// For cached responses, this time could be "far" in the past.
base::Time request_time_;
- spdy::SpdyHeaderBlock response_headers_;
+ spdy::Http2HeaderBlock response_headers_;
ResponseState response_state_;
base::Time response_time_;
diff --git a/chromium/net/spdy/spdy_stream_test_util.cc b/chromium/net/spdy/spdy_stream_test_util.cc
index ac023567031..0aa1c0bfb79 100644
--- a/chromium/net/spdy/spdy_stream_test_util.cc
+++ b/chromium/net/spdy/spdy_stream_test_util.cc
@@ -25,14 +25,14 @@ ClosingDelegate::~ClosingDelegate() = default;
void ClosingDelegate::OnHeadersSent() {}
void ClosingDelegate::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {}
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {}
void ClosingDelegate::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) {}
void ClosingDelegate::OnDataSent() {}
-void ClosingDelegate::OnTrailers(const spdy::SpdyHeaderBlock& trailers) {}
+void ClosingDelegate::OnTrailers(const spdy::Http2HeaderBlock& trailers) {}
void ClosingDelegate::OnClose(int status) {
DCHECK(stream_);
@@ -64,8 +64,8 @@ void StreamDelegateBase::OnHeadersSent() {
}
void StreamDelegateBase::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {
EXPECT_EQ(stream_->type() != SPDY_PUSH_STREAM, send_headers_completed_);
response_headers_ = response_headers.Clone();
}
@@ -77,7 +77,7 @@ void StreamDelegateBase::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) {
void StreamDelegateBase::OnDataSent() {}
-void StreamDelegateBase::OnTrailers(const spdy::SpdyHeaderBlock& trailers) {}
+void StreamDelegateBase::OnTrailers(const spdy::Http2HeaderBlock& trailers) {}
void StreamDelegateBase::OnClose(int status) {
if (!stream_.get())
@@ -114,7 +114,7 @@ std::string StreamDelegateBase::TakeReceivedData() {
std::string StreamDelegateBase::GetResponseHeaderValue(
const std::string& name) const {
- spdy::SpdyHeaderBlock::const_iterator it = response_headers_.find(name);
+ spdy::Http2HeaderBlock::const_iterator it = response_headers_.find(name);
return (it == response_headers_.end()) ? std::string()
: std::string(it->second);
}
@@ -138,8 +138,8 @@ StreamDelegateSendImmediate::StreamDelegateSendImmediate(
StreamDelegateSendImmediate::~StreamDelegateSendImmediate() = default;
void StreamDelegateSendImmediate::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {
StreamDelegateBase::OnHeadersReceived(response_headers,
pushed_request_headers);
if (data_.data()) {
@@ -170,8 +170,8 @@ StreamDelegateCloseOnHeaders::StreamDelegateCloseOnHeaders(
StreamDelegateCloseOnHeaders::~StreamDelegateCloseOnHeaders() = default;
void StreamDelegateCloseOnHeaders::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {
stream()->Cancel(ERR_ABORTED);
}
diff --git a/chromium/net/spdy/spdy_stream_test_util.h b/chromium/net/spdy/spdy_stream_test_util.h
index 2453c78bd41..01c254529bc 100644
--- a/chromium/net/spdy/spdy_stream_test_util.h
+++ b/chromium/net/spdy/spdy_stream_test_util.h
@@ -32,11 +32,11 @@ class ClosingDelegate : public SpdyStream::Delegate {
// SpdyStream::Delegate implementation.
void OnHeadersSent() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override;
void OnDataSent() override;
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override;
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override;
void OnClose(int status) override;
bool CanGreaseFrameType() const override;
NetLogSource source_dependency() const override;
@@ -57,11 +57,11 @@ class StreamDelegateBase : public SpdyStream::Delegate {
void OnHeadersSent() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override;
void OnDataSent() override;
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override;
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override;
void OnClose(int status) override;
bool CanGreaseFrameType() const override;
NetLogSource source_dependency() const override;
@@ -96,7 +96,7 @@ class StreamDelegateBase : public SpdyStream::Delegate {
spdy::SpdyStreamId stream_id_;
TestCompletionCallback callback_;
bool send_headers_completed_;
- spdy::SpdyHeaderBlock response_headers_;
+ spdy::Http2HeaderBlock response_headers_;
SpdyReadQueue received_data_queue_;
LoadTimingInfo load_timing_info_;
};
@@ -118,8 +118,8 @@ class StreamDelegateSendImmediate : public StreamDelegateBase {
~StreamDelegateSendImmediate() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
private:
base::StringPiece data_;
@@ -146,8 +146,8 @@ class StreamDelegateCloseOnHeaders : public StreamDelegateBase {
~StreamDelegateCloseOnHeaders() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
};
} // namespace test
diff --git a/chromium/net/spdy/spdy_stream_unittest.cc b/chromium/net/spdy/spdy_stream_unittest.cc
index c3fad7a4173..c072208d1d3 100644
--- a/chromium/net/spdy/spdy_stream_unittest.cc
+++ b/chromium/net/spdy/spdy_stream_unittest.cc
@@ -191,7 +191,7 @@ TEST_F(SpdyStreamTest, SendDataAfterOpen) {
StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -214,14 +214,14 @@ class StreamDelegateWithTrailers : public test::StreamDelegateWithBody {
~StreamDelegateWithTrailers() override = default;
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override {
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override {
trailers_ = trailers.Clone();
}
- const spdy::SpdyHeaderBlock& trailers() const { return trailers_; }
+ const spdy::Http2HeaderBlock& trailers() const { return trailers_; }
private:
- spdy::SpdyHeaderBlock trailers_;
+ spdy::Http2HeaderBlock trailers_;
};
// Regression test for https://crbug.com/481033.
@@ -241,7 +241,7 @@ TEST_F(SpdyStreamTest, Trailers) {
spdy_util_.ConstructSpdyDataFrame(1, kPostBodyStringPiece, false));
AddRead(echo);
- spdy::SpdyHeaderBlock late_headers;
+ spdy::Http2HeaderBlock late_headers;
late_headers["foo"] = "bar";
spdy::SpdySerializedFrame trailers(spdy_util_.ConstructSpdyResponseHeaders(
1, std::move(late_headers), false));
@@ -266,7 +266,7 @@ TEST_F(SpdyStreamTest, Trailers) {
StreamDelegateWithTrailers delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -275,8 +275,8 @@ TEST_F(SpdyStreamTest, Trailers) {
EXPECT_TRUE(delegate.send_headers_completed());
EXPECT_EQ("200", delegate.GetResponseHeaderValue(spdy::kHttp2StatusHeader));
- const spdy::SpdyHeaderBlock& received_trailers = delegate.trailers();
- spdy::SpdyHeaderBlock::const_iterator it = received_trailers.find("foo");
+ const spdy::Http2HeaderBlock& received_trailers = delegate.trailers();
+ spdy::Http2HeaderBlock::const_iterator it = received_trailers.find("foo");
EXPECT_EQ("bar", it->second);
EXPECT_EQ(std::string(kPostBody, kPostBodyLength),
delegate.TakeReceivedData());
@@ -335,7 +335,7 @@ TEST_F(SpdyStreamTest, PushedStream) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_THAT(
stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND),
@@ -433,7 +433,7 @@ TEST_F(SpdyStreamTest, StreamError) {
StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -500,7 +500,7 @@ TEST_F(SpdyStreamTest, SendLargeDataAfterOpenRequestResponse) {
StreamDelegateWithBody delegate(stream, body_data);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -550,7 +550,7 @@ TEST_F(SpdyStreamTest, SendLargeDataAfterOpenBidirectional) {
StreamDelegateSendImmediate delegate(stream, body_data);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -597,7 +597,7 @@ TEST_F(SpdyStreamTest, UpperCaseHeaders) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_THAT(
stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND),
@@ -657,7 +657,7 @@ TEST_F(SpdyStreamTest, UpperCaseHeadersOnPush) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_THAT(
stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND),
@@ -681,7 +681,7 @@ TEST_F(SpdyStreamTest, HeadersMustHaveStatus) {
AddWrite(req);
// Response headers without ":status" header field: protocol error.
- spdy::SpdyHeaderBlock header_block_without_status;
+ spdy::Http2HeaderBlock header_block_without_status;
header_block_without_status[spdy::kHttp2MethodHeader] = "GET";
header_block_without_status[spdy::kHttp2AuthorityHeader] = "www.example.org";
header_block_without_status[spdy::kHttp2SchemeHeader] = "https";
@@ -713,7 +713,7 @@ TEST_F(SpdyStreamTest, HeadersMustHaveStatus) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -745,7 +745,7 @@ TEST_F(SpdyStreamTest, HeadersMustHaveStatusOnPushedStream) {
AddWrite(priority);
// Response headers without ":status" header field: protocol error.
- spdy::SpdyHeaderBlock header_block_without_status;
+ spdy::Http2HeaderBlock header_block_without_status;
header_block_without_status[spdy::kHttp2MethodHeader] = "GET";
header_block_without_status[spdy::kHttp2AuthorityHeader] = "www.example.org";
header_block_without_status[spdy::kHttp2SchemeHeader] = "https";
@@ -781,7 +781,7 @@ TEST_F(SpdyStreamTest, HeadersMustHaveStatusOnPushedStream) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_THAT(
stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND),
@@ -832,7 +832,7 @@ TEST_F(SpdyStreamTest, HeadersMustPreceedData) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -888,7 +888,7 @@ TEST_F(SpdyStreamTest, HeadersMustPreceedDataOnPushedStream) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_THAT(
stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND),
@@ -919,7 +919,7 @@ TEST_F(SpdyStreamTest, TrailersMustNotFollowTrailers) {
spdy_util_.ConstructSpdyDataFrame(1, kPostBodyStringPiece, false));
AddRead(body);
- spdy::SpdyHeaderBlock trailers_block;
+ spdy::Http2HeaderBlock trailers_block;
trailers_block["foo"] = "bar";
spdy::SpdySerializedFrame first_trailers(
spdy_util_.ConstructSpdyResponseHeaders(1, std::move(trailers_block),
@@ -955,7 +955,7 @@ TEST_F(SpdyStreamTest, TrailersMustNotFollowTrailers) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -982,7 +982,7 @@ TEST_F(SpdyStreamTest, DataMustNotFollowTrailers) {
spdy_util_.ConstructSpdyDataFrame(1, kPostBodyStringPiece, false));
AddRead(body);
- spdy::SpdyHeaderBlock trailers_block;
+ spdy::Http2HeaderBlock trailers_block;
trailers_block["foo"] = "bar";
spdy::SpdySerializedFrame trailers(spdy_util_.ConstructSpdyResponseHeaders(
1, std::move(trailers_block), false));
@@ -1014,7 +1014,7 @@ TEST_F(SpdyStreamTest, DataMustNotFollowTrailers) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -1033,7 +1033,7 @@ TEST_F(SpdyStreamTest, InformationalHeaders) {
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST));
AddWrite(req);
- spdy::SpdyHeaderBlock informational_headers;
+ spdy::Http2HeaderBlock informational_headers;
informational_headers[":status"] = "100";
spdy::SpdySerializedFrame informational_response(
spdy_util_.ConstructSpdyResponseHeaders(
@@ -1067,7 +1067,7 @@ TEST_F(SpdyStreamTest, InformationalHeaders) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -1092,7 +1092,7 @@ TEST_F(SpdyStreamTest, EarlyHints) {
AddWrite(req);
// Serve the early hints.
- spdy::SpdyHeaderBlock informational_headers;
+ spdy::Http2HeaderBlock informational_headers;
informational_headers[":status"] = "103";
spdy::SpdySerializedFrame informational_response(
spdy_util_.ConstructSpdyResponseHeaders(
@@ -1126,7 +1126,7 @@ TEST_F(SpdyStreamTest, EarlyHints) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -1152,7 +1152,7 @@ TEST_F(SpdyStreamTest, StatusMustBeNumber) {
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST));
AddWrite(req);
- spdy::SpdyHeaderBlock incorrect_headers;
+ spdy::Http2HeaderBlock incorrect_headers;
incorrect_headers[":status"] = "nan";
spdy::SpdySerializedFrame reply(spdy_util_.ConstructSpdyResponseHeaders(
1, std::move(incorrect_headers), false));
@@ -1181,7 +1181,7 @@ TEST_F(SpdyStreamTest, StatusMustBeNumber) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -1200,7 +1200,7 @@ TEST_F(SpdyStreamTest, StatusCannotHaveExtraText) {
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST));
AddWrite(req);
- spdy::SpdyHeaderBlock headers_with_status_text;
+ spdy::Http2HeaderBlock headers_with_status_text;
headers_with_status_text[":status"] =
"200 Some random extra text describing status";
spdy::SpdySerializedFrame reply(spdy_util_.ConstructSpdyResponseHeaders(
@@ -1234,7 +1234,7 @@ TEST_F(SpdyStreamTest, StatusCannotHaveExtraText) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -1253,7 +1253,7 @@ TEST_F(SpdyStreamTest, StatusMustBePresent) {
spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST));
AddWrite(req);
- spdy::SpdyHeaderBlock headers_without_status;
+ spdy::Http2HeaderBlock headers_without_status;
spdy::SpdySerializedFrame reply(spdy_util_.ConstructSpdyResponseHeaders(
1, std::move(headers_without_status), false));
AddRead(reply);
@@ -1285,7 +1285,7 @@ TEST_F(SpdyStreamTest, StatusMustBePresent) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_EQ(ERR_IO_PENDING, stream->SendRequestHeaders(std::move(headers),
NO_MORE_DATA_TO_SEND));
@@ -1335,7 +1335,7 @@ TEST_F(SpdyStreamTest, IncreaseSendWindowSizeOverflow) {
StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -1423,7 +1423,7 @@ void SpdyStreamTest::RunResumeAfterUnstallRequestResponseTest(
EXPECT_FALSE(stream->send_stalled_by_flow_control());
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -1497,7 +1497,7 @@ void SpdyStreamTest::RunResumeAfterUnstallBidirectionalTest(
StreamDelegateSendImmediate delegate(stream, kPostBodyStringPiece);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
@@ -1575,7 +1575,7 @@ TEST_F(SpdyStreamTest, ReceivedBytes) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructGetHeaderBlock(kDefaultUrl));
EXPECT_THAT(
stream->SendRequestHeaders(std::move(headers), NO_MORE_DATA_TO_SEND),
@@ -1613,7 +1613,7 @@ TEST_F(SpdyStreamTest, DataOnHalfClosedRemoveStream) {
kDefaultUrl, 1, kPostBodyLength, LOWEST, nullptr, 0));
AddWrite(req);
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[spdy::kHttp2StatusHeader] = "200";
spdy::SpdySerializedFrame resp(spdy_util_.ConstructSpdyResponseHeaders(
1, std::move(response_headers), /* fin = */ true));
@@ -1646,7 +1646,7 @@ TEST_F(SpdyStreamTest, DataOnHalfClosedRemoveStream) {
StreamDelegateDoNothing delegate(stream);
stream->SetDelegate(&delegate);
- spdy::SpdyHeaderBlock headers(
+ spdy::Http2HeaderBlock headers(
spdy_util_.ConstructPostHeaderBlock(kDefaultUrl, kPostBodyLength));
EXPECT_THAT(stream->SendRequestHeaders(std::move(headers), MORE_DATA_TO_SEND),
IsError(ERR_IO_PENDING));
diff --git a/chromium/net/spdy/spdy_test_util_common.cc b/chromium/net/spdy/spdy_test_util_common.cc
index 07395292f90..a6634943697 100644
--- a/chromium/net/spdy/spdy_test_util_common.cc
+++ b/chromium/net/spdy/spdy_test_util_common.cc
@@ -95,7 +95,7 @@ std::unique_ptr<MockWrite[]> ChopWriteFrame(
// |headers| gets filled in from |extra_headers|.
void AppendToHeaderBlock(const char* const extra_headers[],
int extra_header_count,
- spdy::SpdyHeaderBlock* headers) {
+ spdy::Http2HeaderBlock* headers) {
if (!extra_header_count)
return;
@@ -187,7 +187,7 @@ class PriorityGetter : public BufferedSpdyFramerVisitorInterface {
spdy::SpdyStreamId parent_stream_id,
bool exclusive,
bool fin,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
base::TimeTicks recv_first_byte_time) override {
if (has_priority) {
priority_ = spdy::Http2WeightToSpdy3Priority(weight);
@@ -215,7 +215,7 @@ class PriorityGetter : public BufferedSpdyFramerVisitorInterface {
int delta_window_size) override {}
void OnPushPromise(spdy::SpdyStreamId stream_id,
spdy::SpdyStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers) override {}
+ spdy::Http2HeaderBlock headers) override {}
void OnAltSvc(spdy::SpdyStreamId stream_id,
base::StringPiece origin,
const spdy::SpdyAltSvcWireFormat::AlternativeServiceVector&
@@ -672,7 +672,7 @@ SpdyTestUtil::SpdyTestUtil()
SpdyTestUtil::~SpdyTestUtil() = default;
void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url,
- spdy::SpdyHeaderBlock* headers) const {
+ spdy::Http2HeaderBlock* headers) const {
std::string scheme, host, path;
ParseUrl(url, &scheme, &host, &path);
(*headers)[spdy::kHttp2AuthorityHeader] = host;
@@ -681,42 +681,42 @@ void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url,
}
// static
-spdy::SpdyHeaderBlock SpdyTestUtil::ConstructGetHeaderBlock(
+spdy::Http2HeaderBlock SpdyTestUtil::ConstructGetHeaderBlock(
base::StringPiece url) {
return ConstructHeaderBlock("GET", url, nullptr);
}
// static
-spdy::SpdyHeaderBlock SpdyTestUtil::ConstructGetHeaderBlockForProxy(
+spdy::Http2HeaderBlock SpdyTestUtil::ConstructGetHeaderBlockForProxy(
base::StringPiece url) {
return ConstructGetHeaderBlock(url);
}
// static
-spdy::SpdyHeaderBlock SpdyTestUtil::ConstructHeadHeaderBlock(
+spdy::Http2HeaderBlock SpdyTestUtil::ConstructHeadHeaderBlock(
base::StringPiece url,
int64_t content_length) {
return ConstructHeaderBlock("HEAD", url, nullptr);
}
// static
-spdy::SpdyHeaderBlock SpdyTestUtil::ConstructPostHeaderBlock(
+spdy::Http2HeaderBlock SpdyTestUtil::ConstructPostHeaderBlock(
base::StringPiece url,
int64_t content_length) {
return ConstructHeaderBlock("POST", url, &content_length);
}
// static
-spdy::SpdyHeaderBlock SpdyTestUtil::ConstructPutHeaderBlock(
+spdy::Http2HeaderBlock SpdyTestUtil::ConstructPutHeaderBlock(
base::StringPiece url,
int64_t content_length) {
return ConstructHeaderBlock("PUT", url, &content_length);
}
std::string SpdyTestUtil::ConstructSpdyReplyString(
- const spdy::SpdyHeaderBlock& headers) const {
+ const spdy::Http2HeaderBlock& headers) const {
std::string reply_string;
- for (spdy::SpdyHeaderBlock::const_iterator it = headers.begin();
+ for (spdy::Http2HeaderBlock::const_iterator it = headers.begin();
it != headers.end(); ++it) {
auto key = std::string(it->first);
// Remove leading colon from pseudo headers.
@@ -812,7 +812,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyGet(
const char* const url,
spdy::SpdyStreamId stream_id,
RequestPriority request_priority) {
- spdy::SpdyHeaderBlock block(ConstructGetHeaderBlock(url));
+ spdy::Http2HeaderBlock block(ConstructGetHeaderBlock(url));
return ConstructSpdyHeaders(stream_id, std::move(block), request_priority,
true);
}
@@ -822,7 +822,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyGet(
int extra_header_count,
int stream_id,
RequestPriority request_priority) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[spdy::kHttp2MethodHeader] = "GET";
AddUrlToHeaderBlock(default_url_.spec(), &block);
AppendToHeaderBlock(extra_headers, extra_header_count, &block);
@@ -836,7 +836,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyConnect(
int stream_id,
RequestPriority priority,
const HostPortPair& host_port_pair) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[spdy::kHttp2MethodHeader] = "CONNECT";
block[spdy::kHttp2AuthorityHeader] = host_port_pair.ToString();
AppendToHeaderBlock(extra_headers, extra_header_count, &block);
@@ -849,13 +849,13 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPush(
int stream_id,
int associated_stream_id,
const char* url) {
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
push_promise_header_block[spdy::kHttp2MethodHeader] = "GET";
AddUrlToHeaderBlock(url, &push_promise_header_block);
spdy::SpdySerializedFrame push_promise_frame(ConstructSpdyPushPromise(
associated_stream_id, stream_id, std::move(push_promise_header_block)));
- spdy::SpdyHeaderBlock headers_header_block;
+ spdy::Http2HeaderBlock headers_header_block;
headers_header_block[spdy::kHttp2StatusHeader] = "200";
headers_header_block["hello"] = "bye";
AppendToHeaderBlock(extra_headers, extra_header_count, &headers_header_block);
@@ -874,13 +874,13 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPush(
const char* url,
const char* status,
const char* location) {
- spdy::SpdyHeaderBlock push_promise_header_block;
+ spdy::Http2HeaderBlock push_promise_header_block;
push_promise_header_block[spdy::kHttp2MethodHeader] = "GET";
AddUrlToHeaderBlock(url, &push_promise_header_block);
spdy::SpdySerializedFrame push_promise_frame(ConstructSpdyPushPromise(
associated_stream_id, stream_id, std::move(push_promise_header_block)));
- spdy::SpdyHeaderBlock headers_header_block;
+ spdy::Http2HeaderBlock headers_header_block;
headers_header_block["hello"] = "bye";
headers_header_block[spdy::kHttp2StatusHeader] = status;
headers_header_block["location"] = location;
@@ -895,7 +895,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPush(
spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPushPromise(
spdy::SpdyStreamId associated_stream_id,
spdy::SpdyStreamId stream_id,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
spdy::SpdyPushPromiseIR push_promise(associated_stream_id, stream_id,
std::move(headers));
return spdy::SpdySerializedFrame(
@@ -906,7 +906,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPushHeaders(
int stream_id,
const char* const extra_headers[],
int extra_header_count) {
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
header_block[spdy::kHttp2StatusHeader] = "200";
AppendToHeaderBlock(extra_headers, extra_header_count, &header_block);
spdy::SpdyHeadersIR headers(stream_id, std::move(header_block));
@@ -916,7 +916,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPushHeaders(
spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyResponseHeaders(
int stream_id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
bool fin) {
spdy::SpdyHeadersIR spdy_headers(stream_id, std::move(headers));
spdy_headers.set_fin(fin);
@@ -926,7 +926,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyResponseHeaders(
spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyHeaders(
int stream_id,
- spdy::SpdyHeaderBlock block,
+ spdy::Http2HeaderBlock block,
RequestPriority priority,
bool fin) {
// Get the stream id of the next highest priority request
@@ -960,7 +960,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyHeaders(
spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyReply(
int stream_id,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
spdy::SpdyHeadersIR reply(stream_id, std::move(headers));
return spdy::SpdySerializedFrame(response_spdy_framer_.SerializeFrame(reply));
}
@@ -970,7 +970,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyReplyError(
const char* const* const extra_headers,
int extra_header_count,
int stream_id) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[spdy::kHttp2StatusHeader] = status;
block["hello"] = "bye";
AppendToHeaderBlock(extra_headers, extra_header_count, &block);
@@ -987,7 +987,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyGetReply(
const char* const extra_headers[],
int extra_header_count,
int stream_id) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[spdy::kHttp2StatusHeader] = "200";
block["hello"] = "bye";
AppendToHeaderBlock(extra_headers, extra_header_count, &block);
@@ -1002,7 +1002,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPost(
RequestPriority priority,
const char* const extra_headers[],
int extra_header_count) {
- spdy::SpdyHeaderBlock block(ConstructPostHeaderBlock(url, content_length));
+ spdy::Http2HeaderBlock block(ConstructPostHeaderBlock(url, content_length));
AppendToHeaderBlock(extra_headers, extra_header_count, &block);
return ConstructSpdyHeaders(stream_id, std::move(block), priority, false);
}
@@ -1010,7 +1010,7 @@ spdy::SpdySerializedFrame SpdyTestUtil::ConstructSpdyPost(
spdy::SpdySerializedFrame SpdyTestUtil::ConstructChunkedSpdyPost(
const char* const extra_headers[],
int extra_header_count) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block[spdy::kHttp2MethodHeader] = "POST";
AddUrlToHeaderBlock(default_url_.spec(), &block);
AppendToHeaderBlock(extra_headers, extra_header_count, &block);
@@ -1078,13 +1078,13 @@ void SpdyTestUtil::UpdateWithStreamDestruction(int stream_id) {
}
// static
-spdy::SpdyHeaderBlock SpdyTestUtil::ConstructHeaderBlock(
+spdy::Http2HeaderBlock SpdyTestUtil::ConstructHeaderBlock(
base::StringPiece method,
base::StringPiece url,
int64_t* content_length) {
std::string scheme, host, path;
ParseUrl(url, &scheme, &host, &path);
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers[spdy::kHttp2MethodHeader] = method.as_string();
headers[spdy::kHttp2AuthorityHeader] = host.c_str();
headers[spdy::kHttp2SchemeHeader] = scheme.c_str();
diff --git a/chromium/net/spdy/spdy_test_util_common.h b/chromium/net/spdy/spdy_test_util_common.h
index 73071608994..49e4a18de5d 100644
--- a/chromium/net/spdy/spdy_test_util_common.h
+++ b/chromium/net/spdy/spdy_test_util_common.h
@@ -85,7 +85,7 @@ std::unique_ptr<MockWrite[]> ChopWriteFrame(
// |headers| gets filled in from |extra_headers|.
void AppendToHeaderBlock(const char* const extra_headers[],
int extra_header_count,
- spdy::SpdyHeaderBlock* headers);
+ spdy::Http2HeaderBlock* headers);
// Create an async MockWrite from the given spdy::SpdySerializedFrame.
MockWrite CreateMockWrite(const spdy::SpdySerializedFrame& req);
@@ -315,21 +315,23 @@ class SpdyTestUtil {
// Add the appropriate headers to put |url| into |block|.
void AddUrlToHeaderBlock(base::StringPiece url,
- spdy::SpdyHeaderBlock* headers) const;
+ spdy::Http2HeaderBlock* headers) const;
- static spdy::SpdyHeaderBlock ConstructGetHeaderBlock(base::StringPiece url);
- static spdy::SpdyHeaderBlock ConstructGetHeaderBlockForProxy(
+ static spdy::Http2HeaderBlock ConstructGetHeaderBlock(base::StringPiece url);
+ static spdy::Http2HeaderBlock ConstructGetHeaderBlockForProxy(
base::StringPiece url);
- static spdy::SpdyHeaderBlock ConstructHeadHeaderBlock(base::StringPiece url,
+ static spdy::Http2HeaderBlock ConstructHeadHeaderBlock(
+ base::StringPiece url,
+ int64_t content_length);
+ static spdy::Http2HeaderBlock ConstructPostHeaderBlock(
+ base::StringPiece url,
+ int64_t content_length);
+ static spdy::Http2HeaderBlock ConstructPutHeaderBlock(base::StringPiece url,
int64_t content_length);
- static spdy::SpdyHeaderBlock ConstructPostHeaderBlock(base::StringPiece url,
- int64_t content_length);
- static spdy::SpdyHeaderBlock ConstructPutHeaderBlock(base::StringPiece url,
- int64_t content_length);
// Construct an expected SPDY reply string from the given headers.
std::string ConstructSpdyReplyString(
- const spdy::SpdyHeaderBlock& headers) const;
+ const spdy::Http2HeaderBlock& headers) const;
// Construct an expected SPDY SETTINGS frame.
// |settings| are the settings to set.
@@ -420,7 +422,7 @@ class SpdyTestUtil {
spdy::SpdySerializedFrame ConstructSpdyPushPromise(
spdy::SpdyStreamId associated_stream_id,
spdy::SpdyStreamId stream_id,
- spdy::SpdyHeaderBlock headers);
+ spdy::Http2HeaderBlock headers);
spdy::SpdySerializedFrame ConstructSpdyPushHeaders(
int stream_id,
@@ -431,19 +433,19 @@ class SpdyTestUtil {
// END_STREAM flag set to |fin|.
spdy::SpdySerializedFrame ConstructSpdyResponseHeaders(
int stream_id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
bool fin);
// Construct a HEADERS frame carrying exactly the given headers and priority.
spdy::SpdySerializedFrame ConstructSpdyHeaders(int stream_id,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
RequestPriority priority,
bool fin);
// Construct a reply HEADERS frame carrying exactly the given headers and the
// default priority.
spdy::SpdySerializedFrame ConstructSpdyReply(int stream_id,
- spdy::SpdyHeaderBlock headers);
+ spdy::Http2HeaderBlock headers);
// Constructs a standard SPDY HEADERS frame to match the SPDY GET.
// |extra_headers| are the extra header-value pairs, which typically
@@ -520,9 +522,9 @@ class SpdyTestUtil {
private:
// |content_length| may be NULL, in which case the content-length
// header will be omitted.
- static spdy::SpdyHeaderBlock ConstructHeaderBlock(base::StringPiece method,
- base::StringPiece url,
- int64_t* content_length);
+ static spdy::Http2HeaderBlock ConstructHeaderBlock(base::StringPiece method,
+ base::StringPiece url,
+ int64_t* content_length);
// Multiple SpdyFramers are required to keep track of header compression
// state.
diff --git a/chromium/net/ssl/DIR_METADATA b/chromium/net/ssl/DIR_METADATA
new file mode 100644
index 00000000000..b64db52841e
--- /dev/null
+++ b/chromium/net/ssl/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>SSL"
+} \ No newline at end of file
diff --git a/chromium/net/ssl/OWNERS b/chromium/net/ssl/OWNERS
index 0d1ddab3c7d..f8d21715738 100644
--- a/chromium/net/ssl/OWNERS
+++ b/chromium/net/ssl/OWNERS
@@ -1,5 +1,3 @@
davidben@chromium.org
mattm@chromium.org
svaldez@chromium.org
-
-# COMPONENT: Internals>Network>SSL
diff --git a/chromium/net/ssl/client_cert_store_mac.cc b/chromium/net/ssl/client_cert_store_mac.cc
index fc448f46332..68615be4fae 100644
--- a/chromium/net/ssl/client_cert_store_mac.cc
+++ b/chromium/net/ssl/client_cert_store_mac.cc
@@ -18,8 +18,8 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/mac/mac_logging.h"
#include "base/mac/scoped_cftyperef.h"
diff --git a/chromium/net/ssl/client_cert_store_nss.cc b/chromium/net/ssl/client_cert_store_nss.cc
index 0e5d02c625c..9ef425caaa5 100644
--- a/chromium/net/ssl/client_cert_store_nss.cc
+++ b/chromium/net/ssl/client_cert_store_nss.cc
@@ -13,7 +13,7 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/strings/string_piece.h"
diff --git a/chromium/net/ssl/client_cert_store_win.cc b/chromium/net/ssl/client_cert_store_win.cc
index 76263e31ef9..226d7efbbcc 100644
--- a/chromium/net/ssl/client_cert_store_win.cc
+++ b/chromium/net/ssl/client_cert_store_win.cc
@@ -14,7 +14,6 @@
#include <security.h>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
diff --git a/chromium/net/ssl/openssl_ssl_util.cc b/chromium/net/ssl/openssl_ssl_util.cc
index b03c9b32ed0..58533861763 100644
--- a/chromium/net/ssl/openssl_ssl_util.cc
+++ b/chromium/net/ssl/openssl_ssl_util.cc
@@ -91,8 +91,8 @@ int MapOpenSSLErrorSSL(uint32_t error_code) {
case SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED:
case SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN:
case SSL_R_TLSV1_ALERT_ACCESS_DENIED:
+ case SSL_R_TLSV1_ALERT_CERTIFICATE_REQUIRED:
case SSL_R_TLSV1_ALERT_UNKNOWN_CA:
- case SSL_R_TLSV1_CERTIFICATE_REQUIRED:
return ERR_BAD_SSL_CLIENT_AUTH_CERT;
case SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE:
return ERR_SSL_DECOMPRESSION_FAILURE_ALERT;
diff --git a/chromium/net/ssl/ssl_info.cc b/chromium/net/ssl/ssl_info.cc
index 0ca220aee65..744b285f934 100644
--- a/chromium/net/ssl/ssl_info.cc
+++ b/chromium/net/ssl/ssl_info.cc
@@ -20,14 +20,4 @@ void SSLInfo::Reset() {
*this = SSLInfo();
}
-void SSLInfo::UpdateCertificateTransparencyInfo(
- const ct::CTVerifyResult& ct_verify_result) {
- signed_certificate_timestamps.insert(signed_certificate_timestamps.end(),
- ct_verify_result.scts.begin(),
- ct_verify_result.scts.end());
-
- ct_policy_compliance = ct_verify_result.policy_compliance;
- ct_policy_compliance_required = ct_verify_result.policy_compliance_required;
-}
-
} // namespace net
diff --git a/chromium/net/ssl/ssl_info.h b/chromium/net/ssl/ssl_info.h
index b8fe946de96..e7e14ec69cc 100644
--- a/chromium/net/ssl/ssl_info.h
+++ b/chromium/net/ssl/ssl_info.h
@@ -13,7 +13,6 @@
#include "net/base/net_export.h"
#include "net/cert/cert_status_flags.h"
#include "net/cert/ct_policy_status.h"
-#include "net/cert/ct_verify_result.h"
#include "net/cert/ocsp_verify_result.h"
#include "net/cert/sct_status_flags.h"
#include "net/cert/signed_certificate_timestamp_and_status.h"
@@ -45,16 +44,6 @@ class NET_EXPORT SSLInfo {
bool is_valid() const { return cert.get() != nullptr; }
- // Adds the SignedCertificateTimestamps and policy compliance details
- // from ct_verify_result to |signed_certificate_timestamps| and
- // |ct_policy_compliance_details|. SCTs are held in three separate
- // vectors in ct_verify_result, each vetor representing a particular
- // verification state, this method associates each of the SCTs with
- // the corresponding SCTVerifyStatus as it adds it to the
- // |signed_certificate_timestamps| list.
- void UpdateCertificateTransparencyInfo(
- const ct::CTVerifyResult& ct_verify_result);
-
// The SSL certificate.
scoped_refptr<X509Certificate> cert;
@@ -119,11 +108,6 @@ class NET_EXPORT SSLInfo {
ct::CTPolicyCompliance ct_policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_COMPLIANCE_DETAILS_NOT_AVAILABLE;
- // True if the connection was required to comply with the CT cert policy. Only
- // meaningful if |ct_policy_compliance| is not
- // COMPLIANCE_DETAILS_NOT_AVAILABLE.
- bool ct_policy_compliance_required = false;
-
// OCSP stapling details.
OCSPVerifyResult ocsp_result;
diff --git a/chromium/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java b/chromium/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java
index b47c142e044..79595faa9e5 100644
--- a/chromium/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java
+++ b/chromium/net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java
@@ -416,13 +416,13 @@ public class TestWebServer extends WebServer {
copyHeadersToResponse = false;
}
} else if (response.mIsNoContent) {
- stream.println("HTTP/1.0 200 OK");
+ stream.println("HTTP/1.0 204 No Content");
copyHeadersToResponse = false;
} else if (response.mIsRedirect) {
stream.println("HTTP/1.0 302 Found");
textBody.append(String.format(bodyTemplate, "Found", "Found"));
} else if (response.mIsEmptyResponse) {
- stream.println("HTTP/1.0 403 Forbidden");
+ stream.println("HTTP/1.0 200 OK");
copyHeadersToResponse = false;
} else {
if (response.mResponseAction != null) response.mResponseAction.run();
diff --git a/chromium/net/test/ct_test_util.cc b/chromium/net/test/ct_test_util.cc
index d01b59ca19a..3ca286b5ce0 100644
--- a/chromium/net/test/ct_test_util.cc
+++ b/chromium/net/test/ct_test_util.cc
@@ -15,7 +15,6 @@
#include "base/strings/stringprintf.h"
#include "net/base/hex_utils.h"
#include "net/cert/ct_serialization.h"
-#include "net/cert/ct_verify_result.h"
#include "net/cert/merkle_tree_leaf.h"
#include "net/cert/signed_tree_head.h"
#include "net/cert/x509_certificate.h"
diff --git a/chromium/net/test/embedded_test_server/default_handlers.cc b/chromium/net/test/embedded_test_server/default_handlers.cc
index aa9d86e9166..a429df27d11 100644
--- a/chromium/net/test/embedded_test_server/default_handlers.cc
+++ b/chromium/net/test/embedded_test_server/default_handlers.cc
@@ -14,15 +14,19 @@
#include "base/base64.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/hash/md5.h"
+#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
+#include "base/threading/sequenced_task_runner_handle.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "base/unguessable_token.h"
@@ -104,6 +108,25 @@ std::unique_ptr<HttpResponse> HandleEchoHeader(const std::string& url,
return http_response;
}
+// TODO(https://crbug.com/1138913): Remove when request handlers are
+// implementable in Android's embedded test server implementation
+std::unique_ptr<HttpResponse> HandleEchoCriticalHeader(
+ const HttpRequest& request) {
+ auto http_response = std::make_unique<BasicHttpResponse>();
+
+ http_response->set_content_type("text/plain");
+ http_response->AddCustomHeader("Access-Control-Allow-Origin", "*");
+
+ http_response->AddCustomHeader("Accept-CH", "UA-Platform");
+ http_response->AddCustomHeader("Critical-CH", "UA-Platform");
+
+ http_response->set_content(
+ request.headers.find("Sec-CH-UA-Mobile")->second +
+ request.headers.find("Sec-CH-UA-Platform")->second);
+
+ return http_response;
+}
+
// /echo?status=STATUS
// Responds with the request body as the response body and
// a status code of STATUS.
@@ -775,6 +798,132 @@ std::unique_ptr<HttpResponse> HandleSelfPac(const HttpRequest& request) {
return http_response;
}
+// A chunked HTTP response, with optional delays between chunks. See
+// HandleChunks() for argument details.
+class DelayedChunkedHttpResponse : public HttpResponse {
+ public:
+ DelayedChunkedHttpResponse(base::TimeDelta delay_before_headers,
+ base::TimeDelta delay_between_chunks,
+ int chunk_size,
+ int num_chunks)
+ : delay_before_headers_(delay_before_headers),
+ delay_between_chunks_(delay_between_chunks),
+ chunk_size_(chunk_size),
+ remaining_chunks_(num_chunks) {}
+
+ ~DelayedChunkedHttpResponse() override = default;
+
+ DelayedChunkedHttpResponse(const DelayedChunkedHttpResponse&) = delete;
+ DelayedChunkedHttpResponse& operator=(const DelayedChunkedHttpResponse&) =
+ delete;
+
+ void SendResponse(const SendBytesCallback& send,
+ SendCompleteCallback done) override {
+ send_bytes_callback_ = send;
+ send_complete_callback_ = std::move(done);
+
+ base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE,
+ base::BindOnce(&DelayedChunkedHttpResponse::SendHeaders,
+ weak_ptr_factory_.GetWeakPtr()),
+ delay_before_headers_);
+ }
+
+ private:
+ void SendHeaders() {
+ send_bytes_callback_.Run(
+ "HTTP/1.1 200 OK\r\n"
+ "Content-Type: text/plain\r\n"
+ "Connection: close\r\n"
+ "Transfer-Encoding: chunked\r\n\r\n",
+ base::BindOnce(&DelayedChunkedHttpResponse::PrepateToSendNextChunk,
+ weak_ptr_factory_.GetWeakPtr()));
+ }
+
+ void PrepateToSendNextChunk() {
+ if (remaining_chunks_ == 0) {
+ send_bytes_callback_.Run(CreateChunk(0 /* chunk_size */),
+ std::move(send_complete_callback_));
+ return;
+ }
+
+ base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE,
+ base::BindOnce(&DelayedChunkedHttpResponse::SendNextChunk,
+ weak_ptr_factory_.GetWeakPtr()),
+ delay_between_chunks_);
+ }
+
+ void SendNextChunk() {
+ DCHECK_GT(remaining_chunks_, 0);
+ remaining_chunks_--;
+ send_bytes_callback_.Run(
+ CreateChunk(chunk_size_),
+ base::BindOnce(&DelayedChunkedHttpResponse::PrepateToSendNextChunk,
+ weak_ptr_factory_.GetWeakPtr()));
+ }
+
+ static std::string CreateChunk(int chunk_size) {
+ return base::StringPrintf(
+ "%x\r\n"
+ "%s"
+ "\r\n",
+ chunk_size, std::string(chunk_size, '*').c_str());
+ }
+
+ base::TimeDelta delay_before_headers_;
+ base::TimeDelta delay_between_chunks_;
+ int chunk_size_;
+ int remaining_chunks_;
+
+ SendBytesCallback send_bytes_callback_;
+ SendCompleteCallback send_complete_callback_;
+
+ base::WeakPtrFactory<DelayedChunkedHttpResponse> weak_ptr_factory_{this};
+};
+
+// /chunked
+// Returns a chunked response.
+//
+// Optional query parameters:
+// * waitBeforeHeaders: Delays the specified number milliseconds before sending
+// a response header. Defaults to 0.
+// * waitBetweenChunks: Delays the specified number milliseconds before sending
+// each chunk, except the last. Defaults to 0.
+// * chunkSize: Size of each chunk, in bytes. Defaults to 5.
+// * chunksNumber: Number of non-empty chunks. Defaults to 5.
+std::unique_ptr<HttpResponse> HandleChunked(const HttpRequest& request) {
+ GURL request_url = request.GetURL();
+
+ RequestQuery query = ParseQuery(request_url);
+ base::TimeDelta delay_before_headers;
+ base::TimeDelta delay_between_chunks;
+ int chunk_size = 5;
+ int num_chunks = 5;
+
+ for (QueryIterator query(request_url); !query.IsAtEnd(); query.Advance()) {
+ int value;
+ CHECK(base::StringToInt(query.GetValue(), &value));
+ CHECK_GE(value, 0);
+ if (query.GetKey() == "waitBeforeHeaders") {
+ delay_before_headers = base::TimeDelta::FromMilliseconds(value);
+ } else if (query.GetKey() == "waitBetweenChunks") {
+ delay_between_chunks = base::TimeDelta::FromMilliseconds(value);
+ } else if (query.GetKey() == "chunkSize") {
+ // A 0-size chunk indicates completion.
+ CHECK_LT(0, value);
+ chunk_size = value;
+ } else if (query.GetKey() == "chunksNumber") {
+ num_chunks = value;
+ } else {
+ NOTREACHED() << query.GetKey() << "Is not a valid argument of /chunked";
+ }
+ }
+
+ return std::make_unique<DelayedChunkedHttpResponse>(
+ delay_before_headers, delay_between_chunks, chunk_size, num_chunks);
+}
+
} // anonymous namespace
#define PREFIXED_HANDLER(prefix, handler) \
@@ -799,6 +948,8 @@ void RegisterDefaultHandlers(EmbeddedTestServer* server) {
server->RegisterDefaultHandler(PREFIXED_HANDLER("/echoall", &HandleEchoAll));
server->RegisterDefaultHandler(PREFIXED_HANDLER("/echo-raw", &HandleEchoRaw));
server->RegisterDefaultHandler(
+ PREFIXED_HANDLER("/echocriticalheader", &HandleEchoCriticalHeader));
+ server->RegisterDefaultHandler(
PREFIXED_HANDLER("/set-cookie", &HandleSetCookie));
server->RegisterDefaultHandler(
PREFIXED_HANDLER("/set-invalid-cookie", &HandleSetInvalidCookie));
@@ -852,12 +1003,12 @@ void RegisterDefaultHandlers(EmbeddedTestServer* server) {
server->RegisterDefaultHandler(
PREFIXED_HANDLER("/gzip-body", &HandleGzipBody));
server->RegisterDefaultHandler(PREFIXED_HANDLER("/self.pac", &HandleSelfPac));
+ server->RegisterDefaultHandler(PREFIXED_HANDLER("/chunked", &HandleChunked));
// TODO(svaldez): HandleDownload
// TODO(svaldez): HandleDownloadFinish
// TODO(svaldez): HandleZipFile
// TODO(svaldez): HandleSSLManySmallRecords
- // TODO(svaldez): HandleChunkedServer
// TODO(svaldez): HandleGetSSLSessionCache
// TODO(svaldez): HandleGetChannelID
// TODO(svaldez): HandleGetClientCert
diff --git a/chromium/net/test/embedded_test_server/embedded_test_server.cc b/chromium/net/test/embedded_test_server/embedded_test_server.cc
index 48e12cc46de..17994acf67e 100644
--- a/chromium/net/test/embedded_test_server/embedded_test_server.cc
+++ b/chromium/net/test/embedded_test_server/embedded_test_server.cc
@@ -21,7 +21,7 @@
#include "base/task/current_thread.h"
#include "base/task/single_thread_task_executor.h"
#include "base/task_runner_util.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "crypto/rsa_private_key.h"
@@ -675,7 +675,8 @@ void EmbeddedTestServer::HandleRequest(HttpConnection* connection,
base::BindRepeating(&HttpConnection::SendResponseBytes,
connection->GetWeakPtr()),
base::BindOnce(&EmbeddedTestServer::OnResponseCompleted,
- weak_factory_.GetWeakPtr(), connection));
+ weak_factory_.GetWeakPtr(), connection,
+ std::move(response)));
}
GURL EmbeddedTestServer::GetURL(const std::string& relative_url) const {
@@ -818,16 +819,25 @@ void EmbeddedTestServer::ServeFilesFromSourceDirectory(
void EmbeddedTestServer::ServeFilesFromSourceDirectory(
const base::FilePath& relative) {
- base::FilePath test_data_dir;
- CHECK(base::PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir));
- ServeFilesFromDirectory(test_data_dir.Append(relative));
+ ServeFilesFromDirectory(GetFullPathFromSourceDirectory(relative));
}
void EmbeddedTestServer::AddDefaultHandlers(const base::FilePath& directory) {
ServeFilesFromSourceDirectory(directory);
+ AddDefaultHandlers();
+}
+
+void EmbeddedTestServer::AddDefaultHandlers() {
RegisterDefaultHandlers(this);
}
+base::FilePath EmbeddedTestServer::GetFullPathFromSourceDirectory(
+ const base::FilePath& relative) {
+ base::FilePath test_data_dir;
+ CHECK(base::PathService::Get(base::DIR_SOURCE_ROOT, &test_data_dir));
+ return test_data_dir.Append(relative);
+}
+
void EmbeddedTestServer::RegisterRequestHandler(
const HandleRequestCallback& callback) {
DCHECK(!io_thread_)
@@ -953,7 +963,9 @@ bool EmbeddedTestServer::HandleReadResult(HttpConnection* connection, int rv) {
return true;
}
-void EmbeddedTestServer::OnResponseCompleted(HttpConnection* connection) {
+void EmbeddedTestServer::OnResponseCompleted(
+ HttpConnection* connection,
+ std::unique_ptr<HttpResponse> response) {
DCHECK(io_thread_->task_runner()->BelongsToCurrentThread());
DCHECK(connection);
DCHECK_EQ(1u, connections_.count(connection->socket_.get()));
diff --git a/chromium/net/test/embedded_test_server/embedded_test_server.h b/chromium/net/test/embedded_test_server/embedded_test_server.h
index 428c13063f8..396f3b1f02a 100644
--- a/chromium/net/test/embedded_test_server/embedded_test_server.h
+++ b/chromium/net/test/embedded_test_server/embedded_test_server.h
@@ -425,6 +425,15 @@ class EmbeddedTestServer {
// |directory| directory, relative to DIR_SOURCE_ROOT.
void AddDefaultHandlers(const base::FilePath& directory);
+ // Returns the directory that files will be served from if |relative| is
+ // passed to ServeFilesFromSourceDirectory().
+ static base::FilePath GetFullPathFromSourceDirectory(
+ const base::FilePath& relative);
+
+ // Adds all default handlers except, without serving additional files from any
+ // directory.
+ void AddDefaultHandlers();
+
// Adds a request handler that can perform any general-purpose processing.
// |callback| will be invoked on the server's IO thread. Note that:
// 1. All handlers must be registered before the server is Start()ed.
@@ -490,7 +499,8 @@ class EmbeddedTestServer {
// Called when |connection| is finished writing the response and the socket
// can be closed, allowing for |connnection_listener_| to take it if the
// socket is still open.
- void OnResponseCompleted(HttpConnection* connection);
+ void OnResponseCompleted(HttpConnection* connection,
+ std::unique_ptr<HttpResponse> response);
// Closes and removes the connection upon error or completion.
void DidClose(HttpConnection* connection);
diff --git a/chromium/net/test/embedded_test_server/embedded_test_server_unittest.cc b/chromium/net/test/embedded_test_server/embedded_test_server_unittest.cc
index 295f8c23128..b950f6a6eeb 100644
--- a/chromium/net/test/embedded_test_server/embedded_test_server_unittest.cc
+++ b/chromium/net/test/embedded_test_server/embedded_test_server_unittest.cc
@@ -8,7 +8,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_pump_type.h"
diff --git a/chromium/net/test/embedded_test_server/http_response.h b/chromium/net/test/embedded_test_server/http_response.h
index e7366f74661..d8a8a284bcd 100644
--- a/chromium/net/test/embedded_test_server/http_response.h
+++ b/chromium/net/test/embedded_test_server/http_response.h
@@ -34,7 +34,7 @@ class HttpResponse{
// |send| will send the specified data to the network socket, and invoke
// |write_done| when complete. When the entire response has been sent,
- // |done| must be called.
+ // |done| must be called. Invoking |done| will delete the HttpResponse object.
virtual void SendResponse(const SendBytesCallback& send,
SendCompleteCallback done) = 0;
};
diff --git a/chromium/net/test/quic_simple_test_server.cc b/chromium/net/test/quic_simple_test_server.cc
index 6fbf709b17d..b4f32f01bda 100644
--- a/chromium/net/test/quic_simple_test_server.cc
+++ b/chromium/net/test/quic_simple_test_server.cc
@@ -138,11 +138,11 @@ const std::string QuicSimpleTestServer::GetSimpleHeaderValue() {
}
void SetupQuicMemoryCacheBackend() {
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers[kHelloHeaderName] = kHelloHeaderValue;
headers[kStatusHeader] = kHelloStatus;
headers[kCombinedHeaderName] = kCombinedHelloHeaderValue;
- spdy::SpdyHeaderBlock trailers;
+ spdy::Http2HeaderBlock trailers;
trailers[kHelloTrailerName] = kHelloTrailerValue;
g_quic_cache_backend = new quic::QuicMemoryCacheBackend();
g_quic_cache_backend->AddResponse(base::StringPrintf("%s", kTestServerHost),
diff --git a/chromium/net/test/spawned_test_server/base_test_server.cc b/chromium/net/test/spawned_test_server/base_test_server.cc
index 9bda291f521..01cd48f4b17 100644
--- a/chromium/net/test/spawned_test_server/base_test_server.cc
+++ b/chromium/net/test/spawned_test_server/base_test_server.cc
@@ -199,8 +199,6 @@ std::string BaseTestServer::GetScheme() const {
return "ws";
case TYPE_WSS:
return "wss";
- case TYPE_TCP_ECHO:
- case TYPE_UDP_ECHO:
default:
NOTREACHED();
}
diff --git a/chromium/net/test/spawned_test_server/base_test_server.h b/chromium/net/test/spawned_test_server/base_test_server.h
index 17f919181cf..8faa27930f2 100644
--- a/chromium/net/test/spawned_test_server/base_test_server.h
+++ b/chromium/net/test/spawned_test_server/base_test_server.h
@@ -46,8 +46,6 @@ class BaseTestServer {
TYPE_HTTPS,
TYPE_WS,
TYPE_WSS,
- TYPE_TCP_ECHO,
- TYPE_UDP_ECHO,
TYPE_PROXY,
};
diff --git a/chromium/net/test/spawned_test_server/local_test_server.cc b/chromium/net/test/spawned_test_server/local_test_server.cc
index 5561321bf3a..4b259ede719 100644
--- a/chromium/net/test/spawned_test_server/local_test_server.cc
+++ b/chromium/net/test/spawned_test_server/local_test_server.cc
@@ -233,12 +233,6 @@ bool LocalTestServer::AddCommandLineArguments(
case TYPE_FTP:
command_line->AppendArg("--ftp");
break;
- case TYPE_TCP_ECHO:
- command_line->AppendArg("--tcp-echo");
- break;
- case TYPE_UDP_ECHO:
- command_line->AppendArg("--udp-echo");
- break;
case TYPE_BASIC_AUTH_PROXY:
command_line->AppendArg("--basic-auth-proxy");
break;
diff --git a/chromium/net/test/spawned_test_server/remote_test_server.cc b/chromium/net/test/spawned_test_server/remote_test_server.cc
index a3294cf86fa..b9b1839dbd5 100644
--- a/chromium/net/test/spawned_test_server/remote_test_server.cc
+++ b/chromium/net/test/spawned_test_server/remote_test_server.cc
@@ -44,10 +44,6 @@ std::string GetServerTypeString(BaseTestServer::Type type) {
case BaseTestServer::TYPE_WS:
case BaseTestServer::TYPE_WSS:
return "ws";
- case BaseTestServer::TYPE_TCP_ECHO:
- return "tcpecho";
- case BaseTestServer::TYPE_UDP_ECHO:
- return "udpecho";
default:
NOTREACHED();
}
diff --git a/chromium/net/third_party/nss/DIR_METADATA b/chromium/net/third_party/nss/DIR_METADATA
new file mode 100644
index 00000000000..b64db52841e
--- /dev/null
+++ b/chromium/net/third_party/nss/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>SSL"
+} \ No newline at end of file
diff --git a/chromium/net/third_party/nss/OWNERS b/chromium/net/third_party/nss/OWNERS
index d3322186508..e6478b3b4fd 100644
--- a/chromium/net/third_party/nss/OWNERS
+++ b/chromium/net/third_party/nss/OWNERS
@@ -2,5 +2,3 @@ agl@chromium.org
davidben@chromium.org
rsleevi@chromium.org
wtc@chromium.org
-
-# COMPONENT: Internals>Network>SSL
diff --git a/chromium/net/third_party/nss/README.chromium b/chromium/net/third_party/nss/README.chromium
index 68395c729e2..87108826e11 100644
--- a/chromium/net/third_party/nss/README.chromium
+++ b/chromium/net/third_party/nss/README.chromium
@@ -4,6 +4,7 @@ Version: 3.23 RTM
Security Critical: Yes
License: MPL 2
License File: LICENSE
+CPEPrefix: cpe:/a:mozilla:nss:3.23
This directory includes a file derived from NSS's libssl, from the hg repo at:
https://hg.mozilla.org/projects/nss
diff --git a/chromium/net/third_party/quiche/BUILD.gn b/chromium/net/third_party/quiche/BUILD.gn
index ffab81e2122..4ee51a779e3 100644
--- a/chromium/net/third_party/quiche/BUILD.gn
+++ b/chromium/net/third_party/quiche/BUILD.gn
@@ -23,12 +23,8 @@ source_set("quiche") {
if (!is_nacl) {
sources += [
- "src/common/platform/api/quiche_arraysize.h",
- "src/common/platform/api/quiche_endian.h",
"src/common/platform/api/quiche_export.h",
"src/common/platform/api/quiche_logging.h",
- "src/common/platform/api/quiche_optional.h",
- "src/common/platform/api/quiche_ptr_util.h",
"src/common/platform/api/quiche_str_cat.h",
"src/common/platform/api/quiche_string_piece.h",
"src/common/platform/api/quiche_text_utils.h",
@@ -38,6 +34,7 @@ source_set("quiche") {
"src/common/quiche_data_reader.h",
"src/common/quiche_data_writer.cc",
"src/common/quiche_data_writer.h",
+ "src/common/quiche_endian.h",
"src/common/simple_linked_hash_map.h",
"src/http2/decoder/decode_buffer.cc",
"src/http2/decoder/decode_buffer.h",
@@ -458,6 +455,7 @@ source_set("quiche") {
"src/quic/core/quic_packet_writer.h",
"src/quic/core/quic_packets.cc",
"src/quic/core/quic_packets.h",
+ "src/quic/core/quic_protocol_flags_list.h",
"src/quic/core/quic_received_packet_manager.cc",
"src/quic/core/quic_received_packet_manager.h",
"src/quic/core/quic_sent_packet_manager.cc",
@@ -514,7 +512,6 @@ source_set("quiche") {
"src/quic/core/uber_quic_stream_id_manager.h",
"src/quic/core/uber_received_packet_manager.cc",
"src/quic/core/uber_received_packet_manager.h",
- "src/quic/platform/api/quic_aligned.h",
"src/quic/platform/api/quic_bug_tracker.h",
"src/quic/platform/api/quic_cert_utils.h",
"src/quic/platform/api/quic_client_stats.h",
@@ -523,7 +520,6 @@ source_set("quiche") {
"src/quic/platform/api/quic_estimate_memory_usage.h",
"src/quic/platform/api/quic_export.h",
"src/quic/platform/api/quic_exported_stats.h",
- "src/quic/platform/api/quic_fallthrough.h",
"src/quic/platform/api/quic_file_utils.cc",
"src/quic/platform/api/quic_file_utils.h",
"src/quic/platform/api/quic_flag_utils.h",
@@ -535,7 +531,6 @@ source_set("quiche") {
"src/quic/platform/api/quic_ip_address.h",
"src/quic/platform/api/quic_ip_address_family.h",
"src/quic/platform/api/quic_logging.h",
- "src/quic/platform/api/quic_macros.h",
"src/quic/platform/api/quic_map_util.h",
"src/quic/platform/api/quic_mem_slice.h",
"src/quic/platform/api/quic_mem_slice_span.h",
@@ -586,6 +581,8 @@ source_set("quiche") {
"src/spdy/core/http2_priority_write_scheduler.h",
"src/spdy/core/lifo_write_scheduler.h",
"src/spdy/core/priority_write_scheduler.h",
+ "src/spdy/core/recording_headers_handler.cc",
+ "src/spdy/core/recording_headers_handler.h",
"src/spdy/core/spdy_alt_svc_wire_format.cc",
"src/spdy/core/spdy_alt_svc_wire_format.h",
"src/spdy/core/spdy_bitmasks.h",
@@ -613,7 +610,6 @@ source_set("quiche") {
"src/spdy/core/zero_copy_output_buffer.h",
"src/spdy/platform/api/spdy_bug_tracker.h",
"src/spdy/platform/api/spdy_containers.h",
- "src/spdy/platform/api/spdy_endianness_util.h",
"src/spdy/platform/api/spdy_estimate_memory_usage.h",
"src/spdy/platform/api/spdy_flags.h",
"src/spdy/platform/api/spdy_logging.h",
@@ -1243,10 +1239,10 @@ source_set("quiche_tests") {
# TODO(rch): Re-enable once the SLOW_TEST annotation is added.
# "src/quic/core/congestion_control/bbr2_simulator_test.cc",
- "src/common/platform/api/quiche_endian_test.cc",
"src/common/platform/api/quiche_str_cat_test.cc",
"src/common/platform/api/quiche_text_utils_test.cc",
"src/common/platform/api/quiche_time_utils_test.cc",
+ "src/common/quiche_endian_test.cc",
"src/quic/core/congestion_control/bbr_sender_test.cc",
"src/quic/core/congestion_control/cubic_bytes_test.cc",
"src/quic/core/congestion_control/general_loss_algorithm_test.cc",
@@ -1455,7 +1451,7 @@ source_set("quiche_tests") {
]
public_deps = []
- if (is_desktop_linux) {
+ if (is_linux) {
public_deps += [ "//net:epoll_quic_tools" ]
}
if (is_linux || is_chromeos) {
diff --git a/chromium/net/third_party/quiche/DIR_METADATA b/chromium/net/third_party/quiche/DIR_METADATA
new file mode 100644
index 00000000000..123352d107a
--- /dev/null
+++ b/chromium/net/third_party/quiche/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>QUIC"
+} \ No newline at end of file
diff --git a/chromium/net/third_party/quiche/OWNERS b/chromium/net/third_party/quiche/OWNERS
index e001b80c961..f1264ac8371 100644
--- a/chromium/net/third_party/quiche/OWNERS
+++ b/chromium/net/third_party/quiche/OWNERS
@@ -1,4 +1,2 @@
file://net/quic/OWNERS
-# COMPONENT: Internals>Network>QUIC
-
diff --git a/chromium/net/third_party/quiche/src/README.md b/chromium/net/third_party/quiche/src/README.md
index 51b6acc89b2..53707ec949f 100644
--- a/chromium/net/third_party/quiche/src/README.md
+++ b/chromium/net/third_party/quiche/src/README.md
@@ -2,4 +2,4 @@
QUICHE (QUIC, Http/2, Etc) is Google's implementation of QUIC and related
protocols. It powers Chromium as well as Google's QUIC servers and some other
-projects.
+projects. QUICHE is only supported on little-endian platforms.
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_arraysize.h b/chromium/net/third_party/quiche/src/common/platform/api/quiche_arraysize.h
deleted file mode 100644
index 9e50d17d825..00000000000
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_arraysize.h
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_ARRAYSIZE_H_
-#define QUICHE_COMMON_PLATFORM_API_QUICHE_ARRAYSIZE_H_
-
-#include "net/quiche/common/platform/impl/quiche_arraysize_impl.h"
-
-#define QUICHE_ARRAYSIZE(array) QUICHE_ARRAYSIZE_IMPL(array)
-
-#endif // QUICHE_COMMON_PLATFORM_API_QUICHE_ARRAYSIZE_H_
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_optional.h b/chromium/net/third_party/quiche/src/common/platform/api/quiche_optional.h
deleted file mode 100644
index d5d3dac3538..00000000000
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_optional.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_OPTIONAL_H_
-#define QUICHE_COMMON_PLATFORM_API_QUICHE_OPTIONAL_H_
-
-#include <utility>
-
-#include "net/quiche/common/platform/impl/quiche_optional_impl.h"
-
-namespace quiche {
-
-template <typename T>
-using QuicheOptional = QuicheOptionalImpl<T>;
-
-#define QUICHE_NULLOPT QUICHE_NULLOPT_IMPL
-
-} // namespace quiche
-
-#endif // QUICHE_COMMON_PLATFORM_API_QUICHE_OPTIONAL_H_
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_ptr_util.h b/chromium/net/third_party/quiche/src/common/platform/api/quiche_ptr_util.h
deleted file mode 100644
index a59a595813c..00000000000
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_ptr_util.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_PTR_UTIL_H_
-#define QUICHE_COMMON_PLATFORM_API_QUICHE_PTR_UTIL_H_
-
-#include <memory>
-
-#include "absl/memory/memory.h"
-#include "net/quiche/common/platform/impl/quiche_ptr_util_impl.h"
-
-namespace quiche {
-
-template <typename T>
-std::unique_ptr<T> QuicheWrapUnique(T* ptr) {
- // TODO(b/166325009): replace this in code with absl::WrapUnique and delete
- // this function.
- return absl::WrapUnique<T>(ptr);
-}
-
-} // namespace quiche
-
-#endif // QUICHE_COMMON_PLATFORM_API_QUICHE_PTR_UTIL_H_
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_str_cat_test.cc b/chromium/net/third_party/quiche/src/common/platform/api/quiche_str_cat_test.cc
index 7085b8a3c6e..c9a5bfc7512 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_str_cat_test.cc
+++ b/chromium/net/third_party/quiche/src/common/platform/api/quiche_str_cat_test.cc
@@ -6,7 +6,7 @@
#include <string>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace quiche {
@@ -46,7 +46,7 @@ TEST_F(QuicheStrCatTest, Basics) {
std::string strs[] = {"Hello", "Cruel", "World"};
- QuicheStringPiece pieces[] = {"Hello", "Cruel", "World"};
+ absl::string_view pieces[] = {"Hello", "Cruel", "World"};
const char* c_strs[] = {"Hello", "Cruel", "World"};
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_string_piece.h b/chromium/net/third_party/quiche/src/common/platform/api/quiche_string_piece.h
index 35d50216edb..ca58aae6d68 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_string_piece.h
+++ b/chromium/net/third_party/quiche/src/common/platform/api/quiche_string_piece.h
@@ -5,15 +5,12 @@
#ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_STRING_PIECE_H_
#define QUICHE_COMMON_PLATFORM_API_QUICHE_STRING_PIECE_H_
+#include "absl/strings/string_view.h"
#include "net/quiche/common/platform/impl/quiche_string_piece_impl.h"
namespace quiche {
-using QuicheStringPiece = QuicheStringPieceImpl;
-
-using QuicheStringPieceHash = QuicheStringPieceHashImpl;
-
-inline size_t QuicheHashStringPair(QuicheStringPiece a, QuicheStringPiece b) {
+inline size_t QuicheHashStringPair(absl::string_view a, absl::string_view b) {
return QuicheHashStringPairImpl(a, b);
}
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils.h b/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils.h
index 2cf920f2c2a..44a8a05b685 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils.h
+++ b/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils.h
@@ -7,9 +7,10 @@
#include <string>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/quiche/common/platform/impl/quiche_text_utils_impl.h"
namespace quiche {
@@ -17,90 +18,27 @@ namespace quiche {
// Various utilities for manipulating text.
class QUICHE_EXPORT QuicheTextUtils {
public:
- // Returns true if |data| starts with |prefix|, case sensitively.
- static bool StartsWith(quiche::QuicheStringPiece data,
- quiche::QuicheStringPiece prefix) {
- return quiche::QuicheTextUtilsImpl::StartsWith(data, prefix);
- }
-
- // Returns true if |data| ends with |suffix|, case sensitively.
- static bool EndsWith(quiche::QuicheStringPiece data,
- quiche::QuicheStringPiece suffix) {
- return quiche::QuicheTextUtilsImpl::EndsWith(data, suffix);
- }
-
- // Returns true if |data| ends with |suffix|, case insensitively.
- static bool EndsWithIgnoreCase(quiche::QuicheStringPiece data,
- quiche::QuicheStringPiece suffix) {
- return quiche::QuicheTextUtilsImpl::EndsWithIgnoreCase(data, suffix);
- }
-
// Returns a new string in which |data| has been converted to lower case.
- static std::string ToLower(quiche::QuicheStringPiece data) {
+ static std::string ToLower(absl::string_view data) {
return quiche::QuicheTextUtilsImpl::ToLower(data);
}
// Removes leading and trailing whitespace from |data|.
- static void RemoveLeadingAndTrailingWhitespace(
- quiche::QuicheStringPiece* data) {
+ static void RemoveLeadingAndTrailingWhitespace(absl::string_view* data) {
quiche::QuicheTextUtilsImpl::RemoveLeadingAndTrailingWhitespace(data);
}
- // Returns true if |in| represents a valid uint64, and stores that value in
- // |out|.
- static bool StringToUint64(quiche::QuicheStringPiece in, uint64_t* out) {
- return quiche::QuicheTextUtilsImpl::StringToUint64(in, out);
- }
-
- // Returns true if |in| represents a valid int, and stores that value in
- // |out|.
- static bool StringToInt(quiche::QuicheStringPiece in, int* out) {
- return quiche::QuicheTextUtilsImpl::StringToInt(in, out);
- }
-
- // Returns true if |in| represents a valid uint32, and stores that value in
- // |out|.
- static bool StringToUint32(quiche::QuicheStringPiece in, uint32_t* out) {
- return quiche::QuicheTextUtilsImpl::StringToUint32(in, out);
- }
-
- // Returns true if |in| represents a valid size_t, and stores that value in
- // |out|.
- static bool StringToSizeT(quiche::QuicheStringPiece in, size_t* out) {
- return quiche::QuicheTextUtilsImpl::StringToSizeT(in, out);
- }
-
// Returns a new string representing |in|.
static std::string Uint64ToString(uint64_t in) {
return quiche::QuicheTextUtilsImpl::Uint64ToString(in);
}
- // This converts |length| bytes of binary to a 2*|length|-character
- // hexadecimal representation.
- // Return value: 2*|length| characters of ASCII string.
- static std::string HexEncode(const char* data, size_t length) {
- return HexEncode(quiche::QuicheStringPiece(data, length));
- }
-
- // This converts |data.length()| bytes of binary to a
- // 2*|data.length()|-character hexadecimal representation.
- // Return value: 2*|data.length()| characters of ASCII string.
- static std::string HexEncode(quiche::QuicheStringPiece data) {
- return quiche::QuicheTextUtilsImpl::HexEncode(data);
- }
-
// This converts a uint32 into an 8-character hexidecimal
// representation. Return value: 8 characters of ASCII string.
static std::string Hex(uint32_t v) {
return quiche::QuicheTextUtilsImpl::Hex(v);
}
- // Converts |data| from a hexadecimal ASCII string to a binary string
- // that is |data.length()/2| bytes long.
- static std::string HexDecode(quiche::QuicheStringPiece data) {
- return quiche::QuicheTextUtilsImpl::HexDecode(data);
- }
-
// Base64 encodes with no padding |data_len| bytes of |data| into |output|.
static void Base64Encode(const uint8_t* data,
size_t data_len,
@@ -110,7 +48,7 @@ class QUICHE_EXPORT QuicheTextUtils {
// Decodes a base64-encoded |input|. Returns nullopt when the input is
// invalid.
- static QuicheOptional<std::string> Base64Decode(QuicheStringPiece input) {
+ static absl::optional<std::string> Base64Decode(absl::string_view input) {
return quiche::QuicheTextUtilsImpl::Base64Decode(input);
}
@@ -119,26 +57,19 @@ class QUICHE_EXPORT QuicheTextUtils {
// printed as '.' in the ASCII output.
// For example, given the input "Hello, QUIC!\01\02\03\04", returns:
// "0x0000: 4865 6c6c 6f2c 2051 5549 4321 0102 0304 Hello,.QUIC!...."
- static std::string HexDump(quiche::QuicheStringPiece binary_data) {
+ static std::string HexDump(absl::string_view binary_data) {
return quiche::QuicheTextUtilsImpl::HexDump(binary_data);
}
// Returns true if |data| contains any uppercase characters.
- static bool ContainsUpperCase(quiche::QuicheStringPiece data) {
+ static bool ContainsUpperCase(absl::string_view data) {
return quiche::QuicheTextUtilsImpl::ContainsUpperCase(data);
}
// Returns true if |data| contains only decimal digits.
- static bool IsAllDigits(quiche::QuicheStringPiece data) {
+ static bool IsAllDigits(absl::string_view data) {
return quiche::QuicheTextUtilsImpl::IsAllDigits(data);
}
-
- // Splits |data| into a vector of pieces delimited by |delim|.
- static std::vector<quiche::QuicheStringPiece> Split(
- quiche::QuicheStringPiece data,
- char delim) {
- return quiche::QuicheTextUtilsImpl::Split(data, delim);
- }
};
} // namespace quiche
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils_test.cc b/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils_test.cc
index 1ca75d2d3d5..9d2c4fb2d0f 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/common/platform/api/quiche_text_utils_test.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace quiche {
@@ -13,28 +14,6 @@ namespace test {
class QuicheTextUtilsTest : public QuicheTest {};
-TEST_F(QuicheTextUtilsTest, StartsWith) {
- EXPECT_TRUE(quiche::QuicheTextUtils::StartsWith("hello world", "hello"));
- EXPECT_TRUE(
- quiche::QuicheTextUtils::StartsWith("hello world", "hello world"));
- EXPECT_TRUE(quiche::QuicheTextUtils::StartsWith("hello world", ""));
- EXPECT_FALSE(quiche::QuicheTextUtils::StartsWith("hello world", "Hello"));
- EXPECT_FALSE(quiche::QuicheTextUtils::StartsWith("hello world", "world"));
- EXPECT_FALSE(quiche::QuicheTextUtils::StartsWith("hello world", "bar"));
-}
-
-TEST_F(QuicheTextUtilsTest, EndsWithIgnoreCase) {
- EXPECT_TRUE(
- quiche::QuicheTextUtils::EndsWithIgnoreCase("hello world", "world"));
- EXPECT_TRUE(quiche::QuicheTextUtils::EndsWithIgnoreCase("hello world",
- "hello world"));
- EXPECT_TRUE(quiche::QuicheTextUtils::EndsWithIgnoreCase("hello world", ""));
- EXPECT_TRUE(
- quiche::QuicheTextUtils::EndsWithIgnoreCase("hello world", "WORLD"));
- EXPECT_FALSE(
- quiche::QuicheTextUtils::EndsWithIgnoreCase("hello world", "hello"));
-}
-
TEST_F(QuicheTextUtilsTest, ToLower) {
EXPECT_EQ("lower", quiche::QuicheTextUtils::ToLower("LOWER"));
EXPECT_EQ("lower", quiche::QuicheTextUtils::ToLower("lower"));
@@ -48,115 +27,17 @@ TEST_F(QuicheTextUtilsTest, RemoveLeadingAndTrailingWhitespace) {
for (auto* input : {"text", " text", " text", "text ", "text ", " text ",
" text ", "\r\n\ttext", "text\n\r\t"}) {
- quiche::QuicheStringPiece piece(input);
+ absl::string_view piece(input);
quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&piece);
EXPECT_EQ("text", piece);
}
}
-TEST_F(QuicheTextUtilsTest, StringToNumbers) {
- const std::string kMaxInt32Plus1 = "2147483648";
- const std::string kMinInt32Minus1 = "-2147483649";
- const std::string kMaxUint32Plus1 = "4294967296";
-
- {
- // StringToUint64
- uint64_t uint64_val = 0;
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToUint64("123", &uint64_val));
- EXPECT_EQ(123u, uint64_val);
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToUint64("1234", &uint64_val));
- EXPECT_EQ(1234u, uint64_val);
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToUint64("", &uint64_val));
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToUint64("-123", &uint64_val));
- EXPECT_FALSE(
- quiche::QuicheTextUtils::StringToUint64("-123.0", &uint64_val));
- EXPECT_TRUE(
- quiche::QuicheTextUtils::StringToUint64(kMaxUint32Plus1, &uint64_val));
- EXPECT_EQ(4294967296u, uint64_val);
- }
-
- {
- // StringToint
- int int_val = 0;
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToInt("123", &int_val));
- EXPECT_EQ(123, int_val);
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToInt("1234", &int_val));
- EXPECT_EQ(1234, int_val);
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToInt("", &int_val));
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToInt("-123", &int_val));
- EXPECT_EQ(-123, int_val);
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToInt("-123.0", &int_val));
- if (sizeof(int) > 4) {
- EXPECT_TRUE(
- quiche::QuicheTextUtils::StringToInt(kMinInt32Minus1, &int_val));
- EXPECT_EQ(-2147483649ll, int_val);
- EXPECT_TRUE(
- quiche::QuicheTextUtils::StringToInt(kMaxInt32Plus1, &int_val));
- EXPECT_EQ(2147483648ll, int_val);
- } else {
- EXPECT_FALSE(
- quiche::QuicheTextUtils::StringToInt(kMinInt32Minus1, &int_val));
- EXPECT_FALSE(
- quiche::QuicheTextUtils::StringToInt(kMaxInt32Plus1, &int_val));
- }
- }
-
- {
- // StringToUint32
- uint32_t uint32_val = 0;
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToUint32("123", &uint32_val));
- EXPECT_EQ(123u, uint32_val);
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToUint32("1234", &uint32_val));
- EXPECT_EQ(1234u, uint32_val);
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToUint32("", &uint32_val));
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToUint32("-123", &uint32_val));
- EXPECT_FALSE(
- quiche::QuicheTextUtils::StringToUint32("-123.0", &uint32_val));
- EXPECT_FALSE(
- quiche::QuicheTextUtils::StringToUint32(kMaxUint32Plus1, &uint32_val));
- }
-
- {
- // StringToSizeT
- size_t size_t_val = 0;
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToSizeT("123", &size_t_val));
- EXPECT_EQ(123u, size_t_val);
- EXPECT_TRUE(quiche::QuicheTextUtils::StringToSizeT("1234", &size_t_val));
- EXPECT_EQ(1234u, size_t_val);
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToSizeT("", &size_t_val));
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToSizeT("-123", &size_t_val));
- EXPECT_FALSE(quiche::QuicheTextUtils::StringToSizeT("-123.0", &size_t_val));
- if (sizeof(size_t) > 4) {
- EXPECT_TRUE(
- quiche::QuicheTextUtils::StringToSizeT(kMaxUint32Plus1, &size_t_val));
- EXPECT_EQ(4294967296ull, size_t_val);
- } else {
- EXPECT_FALSE(
- quiche::QuicheTextUtils::StringToSizeT(kMaxUint32Plus1, &size_t_val));
- }
- }
-}
-
TEST_F(QuicheTextUtilsTest, Uint64ToString) {
EXPECT_EQ("123", quiche::QuicheTextUtils::Uint64ToString(123));
EXPECT_EQ("1234", quiche::QuicheTextUtils::Uint64ToString(1234));
}
-TEST_F(QuicheTextUtilsTest, HexEncode) {
- EXPECT_EQ("48656c6c6f", quiche::QuicheTextUtils::HexEncode("Hello", 5));
- EXPECT_EQ("48656c6c6f", quiche::QuicheTextUtils::HexEncode("Hello World", 5));
- EXPECT_EQ("48656c6c6f", quiche::QuicheTextUtils::HexEncode("Hello"));
- EXPECT_EQ("0102779cfa",
- quiche::QuicheTextUtils::HexEncode("\x01\x02\x77\x9c\xfa"));
-}
-
-TEST_F(QuicheTextUtilsTest, HexDecode) {
- EXPECT_EQ("Hello", quiche::QuicheTextUtils::HexDecode("48656c6c6f"));
- EXPECT_EQ("", quiche::QuicheTextUtils::HexDecode(""));
- EXPECT_EQ("\x01\x02\x77\x9c\xfa",
- quiche::QuicheTextUtils::HexDecode("0102779cfa"));
-}
-
TEST_F(QuicheTextUtilsTest, HexDump) {
// Verify output of the HexDump method is as expected.
char packet[] = {
@@ -177,14 +58,13 @@ TEST_F(QuicheTextUtilsTest, HexDump) {
"0x0040: 6c69 6e65 7320 6f66 206f 7574 7075 742e lines.of.output.\n"
"0x0050: 0102 03 ...\n");
// Verify that 0x21 and 0x7e are printable, 0x20 and 0x7f are not.
- EXPECT_EQ("0x0000: 2021 7e7f .!~.\n",
- quiche::QuicheTextUtils::HexDump(
- quiche::QuicheTextUtils::HexDecode("20217e7f")));
+ EXPECT_EQ(
+ "0x0000: 2021 7e7f .!~.\n",
+ quiche::QuicheTextUtils::HexDump(absl::HexStringToBytes("20217e7f")));
// Verify that values above numeric_limits<unsigned char>::max() are formatted
// properly on platforms where char is unsigned.
EXPECT_EQ("0x0000: 90aa ff ...\n",
- quiche::QuicheTextUtils::HexDump(
- quiche::QuicheTextUtils::HexDecode("90aaff")));
+ quiche::QuicheTextUtils::HexDump(absl::HexStringToBytes("90aaff")));
}
TEST_F(QuicheTextUtilsTest, Base64Encode) {
@@ -213,19 +93,5 @@ TEST_F(QuicheTextUtilsTest, ContainsUpperCase) {
EXPECT_TRUE(quiche::QuicheTextUtils::ContainsUpperCase("aBc"));
}
-TEST_F(QuicheTextUtilsTest, Split) {
- EXPECT_EQ(std::vector<quiche::QuicheStringPiece>({"a", "b", "c"}),
- quiche::QuicheTextUtils::Split("a,b,c", ','));
- EXPECT_EQ(std::vector<quiche::QuicheStringPiece>({"a", "b", "c"}),
- quiche::QuicheTextUtils::Split("a:b:c", ':'));
- EXPECT_EQ(std::vector<quiche::QuicheStringPiece>({"a:b:c"}),
- quiche::QuicheTextUtils::Split("a:b:c", ','));
- // Leading and trailing whitespace is preserved.
- EXPECT_EQ(std::vector<quiche::QuicheStringPiece>({"a", "b", "c"}),
- quiche::QuicheTextUtils::Split("a,b,c", ','));
- EXPECT_EQ(std::vector<quiche::QuicheStringPiece>({" a", "b ", " c "}),
- quiche::QuicheTextUtils::Split(" a:b : c ", ':'));
-}
-
} // namespace test
} // namespace quiche
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils.h b/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils.h
index 7319568172b..e1e59f0c158 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils.h
+++ b/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils.h
@@ -16,7 +16,7 @@ namespace quiche {
// instance, it will reject February 29 on non-leap years, or 25 hours in a day.
// As a notable exception, 60 seconds is accepted to deal with potential leap
// seconds. If the date predates Unix epoch, nullopt will be returned.
-inline QuicheOptional<int64_t> QuicheUtcDateTimeToUnixSeconds(int year,
+inline absl::optional<int64_t> QuicheUtcDateTimeToUnixSeconds(int year,
int month,
int day,
int hour,
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils_test.cc b/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils_test.cc
index 3ae296dbd81..e32b8b253f1 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/common/platform/api/quiche_time_utils_test.cc
@@ -4,7 +4,7 @@
#include "net/third_party/quiche/src/common/platform/api/quiche_time_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace quiche {
@@ -19,26 +19,24 @@ TEST(QuicheTimeUtilsTest, Basic) {
QuicheUtcDateTimeToUnixSeconds(2006, 7, 15, 12, 34, 56));
EXPECT_EQ(1591130001, QuicheUtcDateTimeToUnixSeconds(2020, 6, 2, 20, 33, 21));
- EXPECT_EQ(QUICHE_NULLOPT,
+ EXPECT_EQ(absl::nullopt,
QuicheUtcDateTimeToUnixSeconds(1970, 2, 29, 0, 0, 1));
- EXPECT_NE(QUICHE_NULLOPT,
+ EXPECT_NE(absl::nullopt,
QuicheUtcDateTimeToUnixSeconds(1972, 2, 29, 0, 0, 1));
}
TEST(QuicheTimeUtilsTest, Bounds) {
- EXPECT_EQ(QUICHE_NULLOPT,
+ EXPECT_EQ(absl::nullopt,
QuicheUtcDateTimeToUnixSeconds(1970, 1, 32, 0, 0, 1));
- EXPECT_EQ(QUICHE_NULLOPT,
+ EXPECT_EQ(absl::nullopt,
QuicheUtcDateTimeToUnixSeconds(1970, 4, 31, 0, 0, 1));
- EXPECT_EQ(QUICHE_NULLOPT,
- QuicheUtcDateTimeToUnixSeconds(1970, 1, 0, 0, 0, 1));
- EXPECT_EQ(QUICHE_NULLOPT,
+ EXPECT_EQ(absl::nullopt, QuicheUtcDateTimeToUnixSeconds(1970, 1, 0, 0, 0, 1));
+ EXPECT_EQ(absl::nullopt,
QuicheUtcDateTimeToUnixSeconds(1970, 13, 1, 0, 0, 1));
- EXPECT_EQ(QUICHE_NULLOPT,
- QuicheUtcDateTimeToUnixSeconds(1970, 0, 1, 0, 0, 1));
- EXPECT_EQ(QUICHE_NULLOPT,
+ EXPECT_EQ(absl::nullopt, QuicheUtcDateTimeToUnixSeconds(1970, 0, 1, 0, 0, 1));
+ EXPECT_EQ(absl::nullopt,
QuicheUtcDateTimeToUnixSeconds(1970, 1, 1, 24, 0, 0));
- EXPECT_EQ(QUICHE_NULLOPT,
+ EXPECT_EQ(absl::nullopt,
QuicheUtcDateTimeToUnixSeconds(1970, 1, 1, 0, 60, 0));
}
@@ -46,7 +44,7 @@ TEST(QuicheTimeUtilsTest, LeapSecond) {
EXPECT_EQ(QuicheUtcDateTimeToUnixSeconds(2015, 6, 30, 23, 59, 60),
QuicheUtcDateTimeToUnixSeconds(2015, 7, 1, 0, 0, 0));
EXPECT_EQ(QuicheUtcDateTimeToUnixSeconds(2015, 6, 30, 25, 59, 60),
- QUICHE_NULLOPT);
+ absl::nullopt);
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/common/quiche_data_reader.cc b/chromium/net/third_party/quiche/src/common/quiche_data_reader.cc
index 2242fea6437..bbb4b87e484 100644
--- a/chromium/net/third_party/quiche/src/common/quiche_data_reader.cc
+++ b/chromium/net/third_party/quiche/src/common/quiche_data_reader.cc
@@ -6,15 +6,16 @@
#include <cstring>
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_logging.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quiche {
-QuicheDataReader::QuicheDataReader(quiche::QuicheStringPiece data)
+QuicheDataReader::QuicheDataReader(absl::string_view data)
: QuicheDataReader(data.data(), data.length(), quiche::NETWORK_BYTE_ORDER) {
}
@@ -77,7 +78,7 @@ bool QuicheDataReader::ReadBytesToUInt64(size_t num_bytes, uint64_t* result) {
return true;
}
-bool QuicheDataReader::ReadStringPiece16(quiche::QuicheStringPiece* result) {
+bool QuicheDataReader::ReadStringPiece16(absl::string_view* result) {
// Read resultant length.
uint16_t result_len;
if (!ReadUInt16(&result_len)) {
@@ -88,7 +89,7 @@ bool QuicheDataReader::ReadStringPiece16(quiche::QuicheStringPiece* result) {
return ReadStringPiece(result, result_len);
}
-bool QuicheDataReader::ReadStringPiece8(quiche::QuicheStringPiece* result) {
+bool QuicheDataReader::ReadStringPiece8(absl::string_view* result) {
// Read resultant length.
uint8_t result_len;
if (!ReadUInt8(&result_len)) {
@@ -99,8 +100,7 @@ bool QuicheDataReader::ReadStringPiece8(quiche::QuicheStringPiece* result) {
return ReadStringPiece(result, result_len);
}
-bool QuicheDataReader::ReadStringPiece(quiche::QuicheStringPiece* result,
- size_t size) {
+bool QuicheDataReader::ReadStringPiece(absl::string_view* result, size_t size) {
// Make sure that we have enough data to read.
if (!CanRead(size)) {
OnFailure();
@@ -108,7 +108,7 @@ bool QuicheDataReader::ReadStringPiece(quiche::QuicheStringPiece* result,
}
// Set result.
- *result = quiche::QuicheStringPiece(data_ + pos_, size);
+ *result = absl::string_view(data_ + pos_, size);
// Iterate.
pos_ += size;
@@ -121,30 +121,30 @@ bool QuicheDataReader::ReadTag(uint32_t* tag) {
}
bool QuicheDataReader::ReadDecimal64(size_t num_digits, uint64_t* result) {
- quiche::QuicheStringPiece digits;
+ absl::string_view digits;
if (!ReadStringPiece(&digits, num_digits)) {
return false;
}
- return QuicheTextUtils::StringToUint64(digits, result);
+ return absl::SimpleAtoi(digits, result);
}
-quiche::QuicheStringPiece QuicheDataReader::ReadRemainingPayload() {
- quiche::QuicheStringPiece payload = PeekRemainingPayload();
+absl::string_view QuicheDataReader::ReadRemainingPayload() {
+ absl::string_view payload = PeekRemainingPayload();
pos_ = len_;
return payload;
}
-quiche::QuicheStringPiece QuicheDataReader::PeekRemainingPayload() const {
- return quiche::QuicheStringPiece(data_ + pos_, len_ - pos_);
+absl::string_view QuicheDataReader::PeekRemainingPayload() const {
+ return absl::string_view(data_ + pos_, len_ - pos_);
}
-quiche::QuicheStringPiece QuicheDataReader::FullPayload() const {
- return quiche::QuicheStringPiece(data_, len_);
+absl::string_view QuicheDataReader::FullPayload() const {
+ return absl::string_view(data_, len_);
}
-quiche::QuicheStringPiece QuicheDataReader::PreviouslyReadPayload() const {
- return quiche::QuicheStringPiece(data_, pos_);
+absl::string_view QuicheDataReader::PreviouslyReadPayload() const {
+ return absl::string_view(data_, pos_);
}
bool QuicheDataReader::ReadBytes(void* result, size_t size) {
diff --git a/chromium/net/third_party/quiche/src/common/quiche_data_reader.h b/chromium/net/third_party/quiche/src/common/quiche_data_reader.h
index f74f90d19e2..ddd825ceb79 100644
--- a/chromium/net/third_party/quiche/src/common/quiche_data_reader.h
+++ b/chromium/net/third_party/quiche/src/common/quiche_data_reader.h
@@ -9,10 +9,10 @@
#include <cstdint>
#include <limits>
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quiche {
@@ -30,7 +30,7 @@ class QUICHE_EXPORT_PRIVATE QuicheDataReader {
public:
// Constructs a reader using NETWORK_BYTE_ORDER endianness.
// Caller must provide an underlying buffer to work on.
- explicit QuicheDataReader(quiche::QuicheStringPiece data);
+ explicit QuicheDataReader(absl::string_view data);
// Constructs a reader using NETWORK_BYTE_ORDER endianness.
// Caller must provide an underlying buffer to work on.
QuicheDataReader(const char* data, const size_t len);
@@ -64,7 +64,7 @@ class QUICHE_EXPORT_PRIVATE QuicheDataReader {
//
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadStringPiece16(quiche::QuicheStringPiece* result);
+ bool ReadStringPiece16(absl::string_view* result);
// Reads a string prefixed with 8-bit length into the given output parameter.
//
@@ -73,13 +73,13 @@ class QUICHE_EXPORT_PRIVATE QuicheDataReader {
//
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadStringPiece8(quiche::QuicheStringPiece* result);
+ bool ReadStringPiece8(absl::string_view* result);
// Reads a given number of bytes into the given buffer. The buffer
// must be of adequate size.
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadStringPiece(quiche::QuicheStringPiece* result, size_t size);
+ bool ReadStringPiece(absl::string_view* result, size_t size);
// Reads tag represented as 32-bit unsigned integer into given output
// parameter. Tags are in big endian on the wire (e.g., CHLO is
@@ -92,38 +92,38 @@ class QUICHE_EXPORT_PRIVATE QuicheDataReader {
// iterator on success, may forward it even in case of failure.
bool ReadDecimal64(size_t num_digits, uint64_t* result);
- // Returns the remaining payload as a quiche::QuicheStringPiece.
+ // Returns the remaining payload as a absl::string_view.
//
// NOTE: Does not copy but rather references strings in the underlying buffer.
// This should be kept in mind when handling memory management!
//
// Forwards the internal iterator.
- quiche::QuicheStringPiece ReadRemainingPayload();
+ absl::string_view ReadRemainingPayload();
- // Returns the remaining payload as a quiche::QuicheStringPiece.
+ // Returns the remaining payload as a absl::string_view.
//
// NOTE: Does not copy but rather references strings in the underlying buffer.
// This should be kept in mind when handling memory management!
//
// DOES NOT forward the internal iterator.
- quiche::QuicheStringPiece PeekRemainingPayload() const;
+ absl::string_view PeekRemainingPayload() const;
- // Returns the entire payload as a quiche::QuicheStringPiece.
+ // Returns the entire payload as a absl::string_view.
//
// NOTE: Does not copy but rather references strings in the underlying buffer.
// This should be kept in mind when handling memory management!
//
// DOES NOT forward the internal iterator.
- quiche::QuicheStringPiece FullPayload() const;
+ absl::string_view FullPayload() const;
// Returns the part of the payload that has been already read as a
- // quiche::QuicheStringPiece.
+ // absl::string_view.
//
// NOTE: Does not copy but rather references strings in the underlying buffer.
// This should be kept in mind when handling memory management!
//
// DOES NOT forward the internal iterator.
- quiche::QuicheStringPiece PreviouslyReadPayload() const;
+ absl::string_view PreviouslyReadPayload() const;
// Reads a given number of bytes into the given buffer. The buffer
// must be of adequate size.
diff --git a/chromium/net/third_party/quiche/src/common/quiche_data_writer.cc b/chromium/net/third_party/quiche/src/common/quiche_data_writer.cc
index 4488f722ec5..5d80933661c 100644
--- a/chromium/net/third_party/quiche/src/common/quiche_data_writer.cc
+++ b/chromium/net/third_party/quiche/src/common/quiche_data_writer.cc
@@ -7,9 +7,9 @@
#include <algorithm>
#include <limits>
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quiche {
@@ -65,7 +65,7 @@ bool QuicheDataWriter::WriteBytesToUInt64(size_t num_bytes, uint64_t value) {
num_bytes);
}
-bool QuicheDataWriter::WriteStringPiece16(quiche::QuicheStringPiece val) {
+bool QuicheDataWriter::WriteStringPiece16(absl::string_view val) {
if (val.size() > std::numeric_limits<uint16_t>::max()) {
return false;
}
@@ -75,7 +75,7 @@ bool QuicheDataWriter::WriteStringPiece16(quiche::QuicheStringPiece val) {
return WriteBytes(val.data(), val.size());
}
-bool QuicheDataWriter::WriteStringPiece(quiche::QuicheStringPiece val) {
+bool QuicheDataWriter::WriteStringPiece(absl::string_view val) {
return WriteBytes(val.data(), val.size());
}
diff --git a/chromium/net/third_party/quiche/src/common/quiche_data_writer.h b/chromium/net/third_party/quiche/src/common/quiche_data_writer.h
index cded0fa16c8..ffa1ea6f9dc 100644
--- a/chromium/net/third_party/quiche/src/common/quiche_data_writer.h
+++ b/chromium/net/third_party/quiche/src/common/quiche_data_writer.h
@@ -10,10 +10,10 @@
#include <cstring>
#include <limits>
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quiche {
@@ -54,8 +54,8 @@ class QUICHE_EXPORT_PRIVATE QuicheDataWriter {
// correct byte order.
bool WriteBytesToUInt64(size_t num_bytes, uint64_t value);
- bool WriteStringPiece(quiche::QuicheStringPiece val);
- bool WriteStringPiece16(quiche::QuicheStringPiece val);
+ bool WriteStringPiece(absl::string_view val);
+ bool WriteStringPiece16(absl::string_view val);
bool WriteBytes(const void* data, size_t data_len);
bool WriteRepeatedByte(uint8_t byte, size_t count);
// Fills the remaining buffer with null characters.
diff --git a/chromium/net/third_party/quiche/src/common/quiche_data_writer_test.cc b/chromium/net/third_party/quiche/src/common/quiche_data_writer_test.cc
index 343e6eaa702..22e8c08dfe4 100644
--- a/chromium/net/third_party/quiche/src/common/quiche_data_writer_test.cc
+++ b/chromium/net/third_party/quiche/src/common/quiche_data_writer_test.cc
@@ -7,12 +7,12 @@
#include <cstdint>
#include <cstring>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/common/quiche_data_reader.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
namespace quiche {
@@ -332,24 +332,24 @@ TEST_P(QuicheDataWriterTest, WriteIntegers) {
TEST_P(QuicheDataWriterTest, WriteBytes) {
char bytes[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
- char buf[QUICHE_ARRAYSIZE(bytes)];
- QuicheDataWriter writer(QUICHE_ARRAYSIZE(buf), buf, GetParam().endianness);
- EXPECT_TRUE(writer.WriteBytes(bytes, QUICHE_ARRAYSIZE(bytes)));
- for (unsigned int i = 0; i < QUICHE_ARRAYSIZE(bytes); ++i) {
+ char buf[ABSL_ARRAYSIZE(bytes)];
+ QuicheDataWriter writer(ABSL_ARRAYSIZE(buf), buf, GetParam().endianness);
+ EXPECT_TRUE(writer.WriteBytes(bytes, ABSL_ARRAYSIZE(bytes)));
+ for (unsigned int i = 0; i < ABSL_ARRAYSIZE(bytes); ++i) {
EXPECT_EQ(bytes[i], buf[i]);
}
}
TEST_P(QuicheDataWriterTest, Seek) {
char buffer[3] = {};
- QuicheDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
+ QuicheDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer,
GetParam().endianness);
EXPECT_TRUE(writer.WriteUInt8(42));
EXPECT_TRUE(writer.Seek(1));
EXPECT_TRUE(writer.WriteUInt8(3));
char expected[] = {42, 0, 3};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(expected); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(expected); ++i) {
EXPECT_EQ(buffer[i], expected[i]);
}
}
@@ -359,7 +359,7 @@ TEST_P(QuicheDataWriterTest, SeekTooFarFails) {
// Check that one can seek to the end of the writer, but not past.
{
- QuicheDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
+ QuicheDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer,
GetParam().endianness);
EXPECT_TRUE(writer.Seek(20));
EXPECT_FALSE(writer.Seek(1));
@@ -367,14 +367,14 @@ TEST_P(QuicheDataWriterTest, SeekTooFarFails) {
// Seeking several bytes past the end fails.
{
- QuicheDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
+ QuicheDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer,
GetParam().endianness);
EXPECT_FALSE(writer.Seek(100));
}
// Seeking so far that arithmetic overflow could occur also fails.
{
- QuicheDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
+ QuicheDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer,
GetParam().endianness);
EXPECT_TRUE(writer.Seek(10));
EXPECT_FALSE(writer.Seek(std::numeric_limits<size_t>::max()));
@@ -386,43 +386,38 @@ TEST_P(QuicheDataWriterTest, PayloadReads) {
char expected_first_read[4] = {1, 2, 3, 4};
char expected_remaining[12] = {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
QuicheDataReader reader(buffer, sizeof(buffer));
- quiche::QuicheStringPiece previously_read_payload1 =
- reader.PreviouslyReadPayload();
+ absl::string_view previously_read_payload1 = reader.PreviouslyReadPayload();
EXPECT_TRUE(previously_read_payload1.empty());
char first_read_buffer[4] = {};
EXPECT_TRUE(reader.ReadBytes(first_read_buffer, sizeof(first_read_buffer)));
test::CompareCharArraysWithHexError(
"first read", first_read_buffer, sizeof(first_read_buffer),
expected_first_read, sizeof(expected_first_read));
- quiche::QuicheStringPiece peeked_remaining_payload =
- reader.PeekRemainingPayload();
+ absl::string_view peeked_remaining_payload = reader.PeekRemainingPayload();
test::CompareCharArraysWithHexError(
"peeked_remaining_payload", peeked_remaining_payload.data(),
peeked_remaining_payload.length(), expected_remaining,
sizeof(expected_remaining));
- quiche::QuicheStringPiece full_payload = reader.FullPayload();
+ absl::string_view full_payload = reader.FullPayload();
test::CompareCharArraysWithHexError("full_payload", full_payload.data(),
full_payload.length(), buffer,
sizeof(buffer));
- quiche::QuicheStringPiece previously_read_payload2 =
- reader.PreviouslyReadPayload();
+ absl::string_view previously_read_payload2 = reader.PreviouslyReadPayload();
test::CompareCharArraysWithHexError(
"previously_read_payload2", previously_read_payload2.data(),
previously_read_payload2.length(), first_read_buffer,
sizeof(first_read_buffer));
- quiche::QuicheStringPiece read_remaining_payload =
- reader.ReadRemainingPayload();
+ absl::string_view read_remaining_payload = reader.ReadRemainingPayload();
test::CompareCharArraysWithHexError(
"read_remaining_payload", read_remaining_payload.data(),
read_remaining_payload.length(), expected_remaining,
sizeof(expected_remaining));
EXPECT_TRUE(reader.IsDoneReading());
- quiche::QuicheStringPiece full_payload2 = reader.FullPayload();
+ absl::string_view full_payload2 = reader.FullPayload();
test::CompareCharArraysWithHexError("full_payload2", full_payload2.data(),
full_payload2.length(), buffer,
sizeof(buffer));
- quiche::QuicheStringPiece previously_read_payload3 =
- reader.PreviouslyReadPayload();
+ absl::string_view previously_read_payload3 = reader.PreviouslyReadPayload();
test::CompareCharArraysWithHexError(
"previously_read_payload3", previously_read_payload3.data(),
previously_read_payload3.length(), buffer, sizeof(buffer));
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_endian.h b/chromium/net/third_party/quiche/src/common/quiche_endian.h
index 69bdc5bf029..9928ff5aa7a 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_endian.h
+++ b/chromium/net/third_party/quiche/src/common/quiche_endian.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef QUICHE_COMMON_PLATFORM_API_QUICHE_ENDIAN_H_
-#define QUICHE_COMMON_PLATFORM_API_QUICHE_ENDIAN_H_
+#ifndef QUICHE_COMMON_QUICHE_ENDIAN_H_
+#define QUICHE_COMMON_QUICHE_ENDIAN_H_
#include <algorithm>
#include <cstdint>
@@ -60,4 +60,4 @@ class QUICHE_EXPORT_PRIVATE QuicheEndian {
} // namespace quiche
-#endif // QUICHE_COMMON_PLATFORM_API_QUICHE_ENDIAN_H_
+#endif // QUICHE_COMMON_QUICHE_ENDIAN_H_
diff --git a/chromium/net/third_party/quiche/src/common/platform/api/quiche_endian_test.cc b/chromium/net/third_party/quiche/src/common/quiche_endian_test.cc
index 2f21938b087..81945ffd41b 100644
--- a/chromium/net/third_party/quiche/src/common/platform/api/quiche_endian_test.cc
+++ b/chromium/net/third_party/quiche/src/common/quiche_endian_test.cc
@@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
+
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace quiche {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer.h b/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer.h
index 241c55356d9..2bf8243d62f 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer.h
+++ b/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer.h
@@ -17,9 +17,9 @@
#include <algorithm>
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
class DecodeBufferSubset;
@@ -35,7 +35,7 @@ class QUICHE_EXPORT_PRIVATE DecodeBuffer {
const size_t kMaxDecodeBufferLength = 1 << 25;
DCHECK_LE(len, kMaxDecodeBufferLength);
}
- explicit DecodeBuffer(quiche::QuicheStringPiece s)
+ explicit DecodeBuffer(absl::string_view s)
: DecodeBuffer(s.data(), s.size()) {}
// Constructor for character arrays, typically in tests. For example:
// const char input[] = { 0x11 };
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer_test.cc
index 24953ef5591..908442ef0da 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/decode_buffer_test.cc
@@ -9,6 +9,7 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -43,7 +44,7 @@ struct TestStruct {
TestEnum8 f8;
};
-class DecodeBufferTest : public ::testing::Test {
+class DecodeBufferTest : public QuicheTest {
protected:
Http2Random random_;
uint32_t decode_offset_;
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/decode_http2_structures_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/decode_http2_structures_test.cc
index 7ef145d87d9..58736dc6e2d 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/decode_http2_structures_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/decode_http2_structures_test.cc
@@ -11,6 +11,7 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -19,7 +20,7 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
@@ -28,9 +29,8 @@ namespace test {
namespace {
template <typename T, size_t N>
-quiche::QuicheStringPiece ToStringPiece(T (&data)[N]) {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(data),
- N * sizeof(T));
+absl::string_view ToStringPiece(T (&data)[N]) {
+ return absl::string_view(reinterpret_cast<const char*>(data), N * sizeof(T));
}
template <class S>
@@ -42,7 +42,7 @@ std::string SerializeStructure(const S& s) {
}
template <class S>
-class StructureDecoderTest : public ::testing::Test {
+class StructureDecoderTest : public QuicheTest {
protected:
typedef S Structure;
@@ -53,8 +53,7 @@ class StructureDecoderTest : public ::testing::Test {
// Fully decodes the Structure at the start of data, and confirms it matches
// *expected (if provided).
- void DecodeLeadingStructure(const S* expected,
- quiche::QuicheStringPiece data) {
+ void DecodeLeadingStructure(const S* expected, absl::string_view data) {
ASSERT_LE(S::EncodedSize(), data.size());
DecodeBuffer db(data);
Randomize(&structure_);
@@ -67,7 +66,7 @@ class StructureDecoderTest : public ::testing::Test {
template <size_t N>
void DecodeLeadingStructure(const char (&data)[N]) {
- DecodeLeadingStructure(nullptr, quiche::QuicheStringPiece(data, N));
+ DecodeLeadingStructure(nullptr, absl::string_view(data, N));
}
// Encode the structure |in_s| into bytes, then decode the bytes
@@ -293,7 +292,7 @@ TEST_F(PingFieldsDecoderTest, DecodesLiteral) {
};
DecodeLeadingStructure(kData);
if (!HasFailure()) {
- EXPECT_EQ(quiche::QuicheStringPiece(kData, 8),
+ EXPECT_EQ(absl::string_view(kData, 8),
ToStringPiece(structure_.opaque_bytes));
}
}
@@ -304,7 +303,7 @@ TEST_F(PingFieldsDecoderTest, DecodesLiteral) {
};
DecodeLeadingStructure(kData);
if (!HasFailure()) {
- EXPECT_EQ(quiche::QuicheStringPiece(kData, 8),
+ EXPECT_EQ(absl::string_view(kData, 8),
ToStringPiece(structure_.opaque_bytes));
}
}
@@ -314,7 +313,7 @@ TEST_F(PingFieldsDecoderTest, DecodesLiteral) {
};
DecodeLeadingStructure(kData);
if (!HasFailure()) {
- EXPECT_EQ(quiche::QuicheStringPiece(kData, 8),
+ EXPECT_EQ(absl::string_view(kData, 8),
ToStringPiece(structure_.opaque_bytes));
}
}
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener_test_util.cc b/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener_test_util.cc
index dd2e7b0ea45..aca1cc306c3 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener_test_util.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener_test_util.cc
@@ -4,11 +4,11 @@
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener_test_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_test.cc
index 9ed3138822e..cf0015d987b 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/http2_frame_decoder_test.cc
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
@@ -16,7 +17,6 @@
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
@@ -114,9 +114,8 @@ class Http2FrameDecoderTest : public RandomDecoderTest {
VERIFY_AND_RETURN_SUCCESS(expected.VerifyEquals(*collector_.frame(0)));
}
- AssertionResult DecodePayloadAndValidateSeveralWays(
- quiche::QuicheStringPiece payload,
- Validator validator) {
+ AssertionResult DecodePayloadAndValidateSeveralWays(absl::string_view payload,
+ Validator validator) {
DecodeBuffer db(payload);
bool start_decoding_requires_non_empty = false;
return DecodeAndValidateSeveralWays(&db, start_decoding_requires_non_empty,
@@ -128,7 +127,7 @@ class Http2FrameDecoderTest : public RandomDecoderTest {
// payload will be decoded several times with different partitionings
// of the payload, and after each the validator will be called.
AssertionResult DecodePayloadAndValidateSeveralWays(
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
const FrameParts& expected) {
auto validator = [&expected, this](const DecodeBuffer& /*input*/,
DecodeStatus status) -> AssertionResult {
@@ -159,16 +158,16 @@ class Http2FrameDecoderTest : public RandomDecoderTest {
AssertionResult DecodePayloadAndValidateSeveralWays(
const char (&buf)[N],
const FrameParts& expected) {
- return DecodePayloadAndValidateSeveralWays(
- quiche::QuicheStringPiece(buf, N), expected);
+ return DecodePayloadAndValidateSeveralWays(absl::string_view(buf, N),
+ expected);
}
template <size_t N>
AssertionResult DecodePayloadAndValidateSeveralWays(
const char (&buf)[N],
const Http2FrameHeader& header) {
- return DecodePayloadAndValidateSeveralWays(
- quiche::QuicheStringPiece(buf, N), FrameParts(header));
+ return DecodePayloadAndValidateSeveralWays(absl::string_view(buf, N),
+ FrameParts(header));
}
template <size_t N>
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/http2_structure_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/http2_structure_decoder_test.cc
index dc7f3dedb24..0242061377f 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/http2_structure_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/http2_structure_decoder_test.cc
@@ -23,6 +23,7 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -31,7 +32,6 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using ::testing::AssertionFailure;
using ::testing::AssertionResult;
@@ -93,7 +93,7 @@ class Http2StructureDecoderTest : public RandomDecoderTest {
// Fully decodes the Structure at the start of data, and confirms it matches
// *expected (if provided).
AssertionResult DecodeLeadingStructure(const S* expected,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
VERIFY_LE(S::EncodedSize(), data.size());
DecodeBuffer original(data);
@@ -145,7 +145,7 @@ class Http2StructureDecoderTest : public RandomDecoderTest {
template <size_t N>
AssertionResult DecodeLeadingStructure(const char (&data)[N]) {
VERIFY_AND_RETURN_SUCCESS(
- DecodeLeadingStructure(nullptr, quiche::QuicheStringPiece(data, N)));
+ DecodeLeadingStructure(nullptr, absl::string_view(data, N)));
}
template <size_t N>
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc
index 354fdae0621..59cc6efc10b 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/altsvc_payload_decoder_test.cc
@@ -8,7 +8,6 @@
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -19,6 +18,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc
index 125e16fc7c9..0873fd04185 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/continuation_payload_decoder_test.cc
@@ -9,7 +9,6 @@
#include <string>
#include <type_traits>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -18,6 +17,7 @@
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/data_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/data_payload_decoder_test.cc
index f1dc017c9da..b30eb9823d8 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/data_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/data_payload_decoder_test.cc
@@ -8,7 +8,6 @@
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -21,6 +20,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc
index b2d96fb2d71..21a0459eb52 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/goaway_payload_decoder_test.cc
@@ -8,7 +8,6 @@
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -19,6 +18,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/headers_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
index 4e0f2e307bb..65ff074db25 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/headers_payload_decoder_test.cc
@@ -8,7 +8,6 @@
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -19,6 +18,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc
index 32969efbf85..12dc5770d20 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/frame_decoder_state_test_util.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -76,7 +76,7 @@ DecodeStatus PayloadDecoderBaseTest::ResumeDecoding(DecodeBuffer* db) {
::testing::AssertionResult
PayloadDecoderBaseTest::DecodePayloadAndValidateSeveralWays(
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
Validator validator) {
VERIFY_TRUE(frame_header_is_set_);
// Cap the payload to be decoded at the declared payload length. This is
@@ -86,8 +86,7 @@ PayloadDecoderBaseTest::DecodePayloadAndValidateSeveralWays(
// Note that it is OK if the payload is too short; the validator may be
// designed to check for that.
if (payload.size() > frame_header_.payload_length) {
- payload =
- quiche::QuicheStringPiece(payload.data(), frame_header_.payload_length);
+ payload = absl::string_view(payload.data(), frame_header_.payload_length);
}
DecodeBuffer db(payload);
ResetDecodeSpeedCounters();
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h
index c5a97a5b37c..c907714089a 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h
@@ -11,7 +11,7 @@
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/decoder/frame_decoder_state.h"
@@ -23,7 +23,6 @@
#include "net/third_party/quiche/src/http2/test_tools/frame_parts.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -81,7 +80,7 @@ class PayloadDecoderBaseTest : public RandomDecoderTest {
// Given the specified payload (without the common frame header), decode
// it with several partitionings of the payload.
::testing::AssertionResult DecodePayloadAndValidateSeveralWays(
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
Validator validator);
// TODO(jamessynge): Add helper method for verifying these are both non-zero,
@@ -190,7 +189,7 @@ class AbstractPayloadDecoderTest : public PayloadDecoderBaseTest {
// will be decoded several times with different partitionings of the payload,
// and after each the validator will be called.
AssertionResult DecodePayloadAndValidateSeveralWays(
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
const FrameParts& expected) {
auto validator = [&expected, this]() -> AssertionResult {
VERIFY_FALSE(listener_.IsInProgress());
@@ -209,7 +208,7 @@ class AbstractPayloadDecoderTest : public PayloadDecoderBaseTest {
// std::nullptr_t (not extra validation).
template <typename WrappedValidator>
::testing::AssertionResult VerifyDetectsFrameSizeError(
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
const Http2FrameHeader& header,
WrappedValidator wrapped_validator) {
set_frame_header(header);
@@ -248,7 +247,7 @@ class AbstractPayloadDecoderTest : public PayloadDecoderBaseTest {
// randomly selected flag bits not excluded by FlagsAffectingPayloadDecoding.
::testing::AssertionResult VerifyDetectsMultipleFrameSizeErrors(
uint8_t required_flags,
- quiche::QuicheStringPiece unpadded_payload,
+ absl::string_view unpadded_payload,
ApproveSize approve_size,
int total_pad_length) {
// required_flags should come from those that are defined for the frame
@@ -306,7 +305,7 @@ class AbstractPayloadDecoderTest : public PayloadDecoderBaseTest {
// As above, but for frames without padding.
::testing::AssertionResult VerifyDetectsFrameSizeError(
uint8_t required_flags,
- quiche::QuicheStringPiece unpadded_payload,
+ absl::string_view unpadded_payload,
const ApproveSize& approve_size) {
Http2FrameType frame_type = DecoderPeer::FrameType();
uint8_t known_flags = KnownFlagsMaskForFrameType(frame_type);
@@ -379,7 +378,7 @@ class AbstractPaddablePayloadDecoderTest
// amount of missing padding is as specified. header.IsPadded must be true,
// and the payload must be empty or the PadLength field must be too large.
::testing::AssertionResult VerifyDetectsPaddingTooLong(
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
const Http2FrameHeader& header,
size_t expected_missing_length) {
set_frame_header(header);
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/ping_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/ping_payload_decoder_test.cc
index 932149f0da0..a80df798e40 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/ping_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/ping_payload_decoder_test.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -17,6 +16,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/priority_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/priority_payload_decoder_test.cc
index 3b0ac156637..97551c8eb1e 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/priority_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/priority_payload_decoder_test.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -17,6 +16,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
index 0561aa4b96b..3022f59b761 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/push_promise_payload_decoder_test.cc
@@ -8,7 +8,6 @@
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -19,6 +18,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
index 6e00e804bcb..105fbe1c81a 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/rst_stream_payload_decoder_test.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -18,6 +17,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/settings_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/settings_payload_decoder_test.cc
index d3f116b8006..6cc908b762e 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/settings_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/settings_payload_decoder_test.cc
@@ -8,7 +8,6 @@
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -20,6 +19,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc
index 10759329c0f..e0fb1003c2e 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/unknown_payload_decoder_test.cc
@@ -9,7 +9,6 @@
#include <string>
#include <type_traits>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -19,6 +18,7 @@
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc
index 66d7d7eb05d..279d893677b 100644
--- a/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/decoder/payload_decoders/window_update_payload_decoder_test.cc
@@ -6,7 +6,6 @@
#include <stddef.h>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
@@ -17,6 +16,7 @@
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/http2_frame_builder.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.cc
index 325a60c0067..88e0a9a9882 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.cc
@@ -112,7 +112,7 @@ AssertionResult HpackBlockCollector::ValidateSoleLiteralValueHeader(
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view expected_value) const {
VERIFY_TRUE(pending_entry_.IsClear());
VERIFY_EQ(1u, entries_.size());
VERIFY_TRUE(entries_.front().ValidateLiteralValueHeader(
@@ -122,9 +122,9 @@ AssertionResult HpackBlockCollector::ValidateSoleLiteralValueHeader(
AssertionResult HpackBlockCollector::ValidateSoleLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view expected_value) const {
VERIFY_TRUE(pending_entry_.IsClear());
VERIFY_EQ(1u, entries_.size());
VERIFY_TRUE(entries_.front().ValidateLiteralNameValueHeader(
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.h
index 8246de45a68..55d9449642c 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.h
@@ -18,13 +18,12 @@
#include <string>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -97,16 +96,16 @@ class HpackBlockCollector : public HpackEntryDecoderListener {
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view expected_value) const;
// Return AssertionSuccess if there is just one entry, and it is a Header
// with a literal name and literal value.
::testing::AssertionResult ValidateSoleLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view expected_value) const;
bool IsNotPending() const { return pending_entry_.IsClear(); }
bool IsClear() const { return IsNotPending() && entries_.empty(); }
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_decoder_test.cc
index aeb6c48caca..e392ffa4e42 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_block_decoder_test.cc
@@ -9,7 +9,7 @@
#include <cstdint>
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_block_collector.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
@@ -18,7 +18,7 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionSuccess;
@@ -66,7 +66,7 @@ class HpackBlockDecoderTest : public RandomDecoderTest {
}
AssertionResult DecodeHpackExampleAndValidateSeveralWays(
- quiche::QuicheStringPiece hpack_example,
+ absl::string_view hpack_example,
Validator validator) {
std::string input = HpackExampleToStringOrDie(hpack_example);
DecodeBuffer db(input);
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.cc
index c1f7c8e248c..c2c8308c153 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.cc
@@ -17,7 +17,7 @@ void HpackDecoderNoOpListener::OnHeader(const HpackString& /*name*/,
const HpackString& /*value*/) {}
void HpackDecoderNoOpListener::OnHeaderListEnd() {}
void HpackDecoderNoOpListener::OnHeaderErrorDetected(
- quiche::QuicheStringPiece /*error_message*/) {}
+ absl::string_view /*error_message*/) {}
// static
HpackDecoderNoOpListener* HpackDecoderNoOpListener::NoOpListener() {
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h
index f1b76db3678..9b67012c70d 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h
@@ -8,10 +8,10 @@
#ifndef QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODER_LISTENER_H_
#define QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODER_LISTENER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/hpack_string.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -37,8 +37,7 @@ class QUICHE_EXPORT_PRIVATE HpackDecoderListener {
// OnHeaderErrorDetected is called if an error is detected while decoding.
// error_message may be used in a GOAWAY frame as the Opaque Data.
- virtual void OnHeaderErrorDetected(
- quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnHeaderErrorDetected(absl::string_view error_message) = 0;
};
// A no-op implementation of HpackDecoderListener, useful for ignoring
@@ -52,7 +51,7 @@ class QUICHE_EXPORT_PRIVATE HpackDecoderNoOpListener
void OnHeaderListStart() override;
void OnHeader(const HpackString& name, const HpackString& value) override;
void OnHeaderListEnd() override;
- void OnHeaderErrorDetected(quiche::QuicheStringPiece error_message) override;
+ void OnHeaderErrorDetected(absl::string_view error_message) override;
// Returns a listener that ignores all the calls.
static HpackDecoderNoOpListener* NoOpListener();
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h
index 3854a6c362e..6478a463d17 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h
@@ -16,6 +16,7 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
@@ -23,7 +24,6 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state_test.cc
index eff1420f4ff..3ceaea2b432 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state_test.cc
@@ -9,14 +9,13 @@
#include <utility>
#include <vector>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/hpack_string.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
@@ -41,13 +40,15 @@ class MockHpackDecoderListener : public HpackDecoderListener {
MOCK_METHOD2(OnHeader,
void(const HpackString& name, const HpackString& value));
MOCK_METHOD0(OnHeaderListEnd, void());
- MOCK_METHOD1(OnHeaderErrorDetected,
- void(quiche::QuicheStringPiece error_message));
+ MOCK_METHOD(void,
+ OnHeaderErrorDetected,
+ (absl::string_view error_message),
+ (override));
};
enum StringBacking { STATIC, UNBUFFERED, BUFFERED };
-class HpackDecoderStateTest : public ::testing::Test {
+class HpackDecoderStateTest : public QuicheTest {
protected:
HpackDecoderStateTest() : decoder_state_(&listener_) {}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.cc
index f461c1e1625..2e476b0ffa2 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.cc
@@ -60,8 +60,7 @@ void HpackDecoderStringBuffer::Reset() {
state_ = State::RESET;
}
-void HpackDecoderStringBuffer::Set(quiche::QuicheStringPiece value,
- bool is_static) {
+void HpackDecoderStringBuffer::Set(absl::string_view value, bool is_static) {
HTTP2_DVLOG(2) << "HpackDecoderStringBuffer::Set";
DCHECK_EQ(state_, State::RESET);
value_ = value;
@@ -101,7 +100,7 @@ void HpackDecoderStringBuffer::OnStart(bool huffman_encoded, size_t len) {
backing_ = Backing::RESET;
// OnData is not called for empty (zero length) strings, so make sure that
// value_ is cleared.
- value_ = quiche::QuicheStringPiece();
+ value_ = absl::string_view();
}
}
@@ -114,7 +113,7 @@ bool HpackDecoderStringBuffer::OnData(const char* data, size_t len) {
if (is_huffman_encoded_) {
DCHECK_EQ(backing_, Backing::BUFFERED);
- return decoder_.Decode(quiche::QuicheStringPiece(data, len), &buffer_);
+ return decoder_.Decode(absl::string_view(data, len), &buffer_);
}
if (backing_ == Backing::RESET) {
@@ -122,7 +121,7 @@ bool HpackDecoderStringBuffer::OnData(const char* data, size_t len) {
// don't copy the string. If we later find that the HPACK entry is split
// across input buffers, then we'll copy the string into buffer_.
if (remaining_len_ == 0) {
- value_ = quiche::QuicheStringPiece(data, len);
+ value_ = absl::string_view(data, len);
backing_ = Backing::UNBUFFERED;
return true;
}
@@ -188,14 +187,13 @@ size_t HpackDecoderStringBuffer::BufferedLength() const {
return IsBuffered() ? buffer_.size() : 0;
}
-quiche::QuicheStringPiece HpackDecoderStringBuffer::str() const {
+absl::string_view HpackDecoderStringBuffer::str() const {
HTTP2_DVLOG(3) << "HpackDecoderStringBuffer::str";
DCHECK_EQ(state_, State::COMPLETE);
return value_;
}
-quiche::QuicheStringPiece HpackDecoderStringBuffer::GetStringIfComplete()
- const {
+absl::string_view HpackDecoderStringBuffer::GetStringIfComplete() const {
if (state_ != State::COMPLETE) {
return {};
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h
index 1341e79161e..b11d50fe472 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h
@@ -14,9 +14,9 @@
#include <ostream>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -32,7 +32,7 @@ class QUICHE_EXPORT_PRIVATE HpackDecoderStringBuffer {
HpackDecoderStringBuffer& operator=(const HpackDecoderStringBuffer&) = delete;
void Reset();
- void Set(quiche::QuicheStringPiece value, bool is_static);
+ void Set(absl::string_view value, bool is_static);
// Note that for Huffman encoded strings the length of the string after
// decoding may be larger (expected), the same or even smaller; the latter
@@ -47,14 +47,14 @@ class QUICHE_EXPORT_PRIVATE HpackDecoderStringBuffer {
// Accessors for the completely collected string (i.e. Set or OnEnd has just
// been called, and no reset of the state has occurred).
- // Returns a QuicheStringPiece pointing to the backing store for the string,
+ // Returns a string_view pointing to the backing store for the string,
// either the internal buffer or the original transport buffer (e.g. for a
// literal value that wasn't Huffman encoded, and that wasn't split across
// transport buffers).
- quiche::QuicheStringPiece str() const;
+ absl::string_view str() const;
// Same as str() if state_ is COMPLETE. Otherwise, returns empty string piece.
- quiche::QuicheStringPiece GetStringIfComplete() const;
+ absl::string_view GetStringIfComplete() const;
// Returns the completely collected string by value, using std::move in an
// effort to avoid unnecessary copies. ReleaseString() must not be called
@@ -75,10 +75,10 @@ class QUICHE_EXPORT_PRIVATE HpackDecoderStringBuffer {
// (e.g. if Huffman encoded, buffer_ is storage for the decoded string).
std::string buffer_;
- // The QuicheStringPiece to be returned by HpackDecoderStringBuffer::str(). If
+ // The string_view to be returned by HpackDecoderStringBuffer::str(). If
// a string has been collected, but not buffered, value_ points to that
// string.
- quiche::QuicheStringPiece value_;
+ absl::string_view value_;
// The decoder to use if the string is Huffman encoded.
HpackHuffmanDecoder decoder_;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
index 9f3e2d3a368..51747e7cdf4 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer_test.cc
@@ -11,6 +11,7 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
@@ -20,7 +21,7 @@ namespace http2 {
namespace test {
namespace {
-class HpackDecoderStringBufferTest : public ::testing::Test {
+class HpackDecoderStringBufferTest : public QuicheTest {
protected:
typedef HpackDecoderStringBuffer::State State;
typedef HpackDecoderStringBuffer::Backing Backing;
@@ -45,7 +46,7 @@ class HpackDecoderStringBufferTest : public ::testing::Test {
};
TEST_F(HpackDecoderStringBufferTest, SetStatic) {
- quiche::QuicheStringPiece data("static string");
+ absl::string_view data("static string");
EXPECT_EQ(state(), State::RESET);
EXPECT_TRUE(VerifyLogHasSubstrs({"state=RESET"}));
@@ -70,7 +71,7 @@ TEST_F(HpackDecoderStringBufferTest, SetStatic) {
}
TEST_F(HpackDecoderStringBufferTest, PlainWhole) {
- quiche::QuicheStringPiece data("some text.");
+ absl::string_view data("some text.");
HTTP2_LOG(INFO) << buf_;
EXPECT_EQ(state(), State::RESET);
@@ -92,7 +93,7 @@ TEST_F(HpackDecoderStringBufferTest, PlainWhole) {
{"state=COMPLETE", "backing=UNBUFFERED", "value: some text."}));
// We expect that the string buffer points to the passed in
- // QuicheStringPiece's backing store.
+ // string_view's backing store.
EXPECT_EQ(data.data(), buf_.str().data());
// Now force it to buffer the string, after which it will still have the same
@@ -108,9 +109,9 @@ TEST_F(HpackDecoderStringBufferTest, PlainWhole) {
}
TEST_F(HpackDecoderStringBufferTest, PlainSplit) {
- quiche::QuicheStringPiece data("some text.");
- quiche::QuicheStringPiece part1 = data.substr(0, 1);
- quiche::QuicheStringPiece part2 = data.substr(1);
+ absl::string_view data("some text.");
+ absl::string_view part1 = data.substr(0, 1);
+ absl::string_view part2 = data.substr(1);
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ false, data.size());
@@ -136,7 +137,7 @@ TEST_F(HpackDecoderStringBufferTest, PlainSplit) {
EXPECT_EQ(buf_.BufferedLength(), data.size());
HTTP2_LOG(INFO) << buf_;
- quiche::QuicheStringPiece buffered = buf_.str();
+ absl::string_view buffered = buf_.str();
EXPECT_EQ(data, buffered);
EXPECT_NE(data.data(), buffered.data());
@@ -151,7 +152,7 @@ TEST_F(HpackDecoderStringBufferTest, PlainSplit) {
TEST_F(HpackDecoderStringBufferTest, HuffmanWhole) {
std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
- quiche::QuicheStringPiece decoded("www.example.com");
+ absl::string_view decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
@@ -178,7 +179,7 @@ TEST_F(HpackDecoderStringBufferTest, HuffmanSplit) {
std::string encoded = Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff");
std::string part1 = encoded.substr(0, 5);
std::string part2 = encoded.substr(5);
- quiche::QuicheStringPiece decoded("www.example.com");
+ absl::string_view decoded("www.example.com");
EXPECT_EQ(state(), State::RESET);
buf_.OnStart(/*huffman_encoded*/ true, encoded.size());
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables_test.cc
index 5722c707235..610c74af0e0 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables_test.cc
@@ -9,13 +9,12 @@
#include <tuple>
#include <vector>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_util.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
@@ -55,7 +54,7 @@ void ShuffleCollection(C* collection, Http2Random* r) {
std::shuffle(collection->begin(), collection->end(), *r);
}
-class HpackDecoderStaticTableTest : public ::testing::Test {
+class HpackDecoderStaticTableTest : public QuicheTest {
protected:
HpackDecoderStaticTableTest() = default;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_test.cc
index 7d6242d588f..eb142767fd1 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_test.cc
@@ -11,8 +11,6 @@
#include <utility>
#include <vector>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h"
@@ -26,6 +24,7 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_util.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionFailure;
using ::testing::AssertionResult;
@@ -68,11 +67,13 @@ class MockHpackDecoderListener : public HpackDecoderListener {
MOCK_METHOD2(OnHeader,
void(const HpackString& name, const HpackString& value));
MOCK_METHOD0(OnHeaderListEnd, void());
- MOCK_METHOD1(OnHeaderErrorDetected,
- void(quiche::QuicheStringPiece error_message));
+ MOCK_METHOD(void,
+ OnHeaderErrorDetected,
+ (absl::string_view error_message),
+ (override));
};
-class HpackDecoderTest : public ::testing::TestWithParam<bool>,
+class HpackDecoderTest : public QuicheTestWithParam<bool>,
public HpackDecoderListener {
protected:
// Note that we initialize the random number generator with the same seed
@@ -114,7 +115,7 @@ class HpackDecoderTest : public ::testing::TestWithParam<bool>,
// OnHeaderErrorDetected is called if an error is detected while decoding.
// error_message may be used in a GOAWAY frame as the Opaque Data.
- void OnHeaderErrorDetected(quiche::QuicheStringPiece error_message) override {
+ void OnHeaderErrorDetected(absl::string_view error_message) override {
ASSERT_TRUE(saw_start_);
error_messages_.push_back(std::string(error_message));
// No further callbacks should be made at this point, so replace 'this' as
@@ -124,7 +125,7 @@ class HpackDecoderTest : public ::testing::TestWithParam<bool>,
HpackDecoderPeer::GetDecoderState(&decoder_), &mock_listener_);
}
- AssertionResult DecodeBlock(quiche::QuicheStringPiece block) {
+ AssertionResult DecodeBlock(absl::string_view block) {
HTTP2_VLOG(1) << "HpackDecoderTest::DecodeBlock";
VERIFY_FALSE(decoder_.DetectError());
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.cc
index 3e231b5ae52..4b106a9edbd 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.cc
@@ -7,7 +7,7 @@
namespace http2 {
// static
-quiche::QuicheStringPiece HpackDecodingErrorToString(HpackDecodingError error) {
+absl::string_view HpackDecodingErrorToString(HpackDecodingError error) {
switch (error) {
case HpackDecodingError::kOk:
return "No error detected";
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h
index e3465499ce2..3536b971728 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODING_ERROR_H_
#define QUICHE_HTTP2_HPACK_DECODER_HPACK_DECODING_ERROR_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -43,7 +43,7 @@ enum class HpackDecodingError {
kCompressedHeaderSizeExceedsLimit,
};
-QUICHE_EXPORT_PRIVATE quiche::QuicheStringPiece HpackDecodingErrorToString(
+QUICHE_EXPORT_PRIVATE absl::string_view HpackDecodingErrorToString(
HpackDecodingError error);
} // namespace http2
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.cc
index 80d4f9295c2..b39382881e0 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.cc
@@ -4,12 +4,12 @@
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
@@ -166,7 +166,7 @@ AssertionResult HpackEntryCollector::ValidateLiteralValueHeader(
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view expected_value) const {
VERIFY_TRUE(started_);
VERIFY_TRUE(ended_);
VERIFY_EQ(expected_type, header_type_);
@@ -179,9 +179,9 @@ AssertionResult HpackEntryCollector::ValidateLiteralValueHeader(
AssertionResult HpackEntryCollector::ValidateLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view expected_value) const {
VERIFY_TRUE(started_);
VERIFY_TRUE(ended_);
VERIFY_EQ(expected_type, header_type_);
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h
index abf9d97ec1c..e333789ebe4 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h
@@ -15,12 +15,12 @@
#include <iosfwd>
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -85,16 +85,16 @@ class HpackEntryCollector : public HpackEntryDecoderListener {
HpackEntryType expected_type,
size_t expected_index,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view expected_value) const;
// Returns success if collected a Header with an literal name and literal
// value.
::testing::AssertionResult ValidateLiteralNameValueHeader(
HpackEntryType expected_type,
bool expected_name_huffman,
- quiche::QuicheStringPiece expected_name,
+ absl::string_view expected_name,
bool expected_value_huffman,
- quiche::QuicheStringPiece expected_value) const;
+ absl::string_view expected_value) const;
// Returns success if collected a Dynamic Table Size Update,
// with the specified size.
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_test.cc
index d4113f8004e..415511e2d12 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_test.cc
@@ -8,12 +8,12 @@
#include <cstdint>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_collector.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_type_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
index 60248f3326f..c5c7f521bda 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_type_decoder_test.cc
@@ -6,11 +6,11 @@
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionFailure;
using ::testing::AssertionResult;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.cc
index 0b18178d167..8300d57680d 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.cc
@@ -9,9 +9,9 @@
#include <iosfwd>
#include <ostream>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -66,7 +66,7 @@ void HpackStringCollector::OnStringStart(bool huffman, size_t length) {
}
void HpackStringCollector::OnStringData(const char* data, size_t length) {
- quiche::QuicheStringPiece sp(data, length);
+ absl::string_view sp(data, length);
EXPECT_TRUE(IsInProgress()) << ToString();
EXPECT_LE(sp.size(), len) << ToString();
Http2StrAppend(&s, sp);
@@ -80,7 +80,7 @@ void HpackStringCollector::OnStringEnd() {
}
::testing::AssertionResult HpackStringCollector::Collected(
- quiche::QuicheStringPiece str,
+ absl::string_view str,
bool is_huffman_encoded) const {
VERIFY_TRUE(HasEnded());
VERIFY_EQ(str.size(), len);
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h
index 8326a57851d..9ba65c46ea7 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h
@@ -12,9 +12,9 @@
#include <iosfwd>
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_listener.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -40,7 +40,7 @@ struct HpackStringCollector : public HpackStringDecoderListener {
void OnStringData(const char* data, size_t length) override;
void OnStringEnd() override;
- ::testing::AssertionResult Collected(quiche::QuicheStringPiece str,
+ ::testing::AssertionResult Collected(absl::string_view str,
bool is_huffman_encoded) const;
std::string ToString() const;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_test.cc
index a5f6166a161..bc6137c5b88 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_test.cc
@@ -6,14 +6,14 @@
// Tests of HpackStringDecoder.
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_collector.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_string_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
@@ -43,13 +43,13 @@ class HpackStringDecoderTest : public RandomDecoderTest {
return decoder_.Resume(b, &listener_);
}
- AssertionResult Collected(quiche::QuicheStringPiece s, bool huffman_encoded) {
+ AssertionResult Collected(absl::string_view s, bool huffman_encoded) {
HTTP2_VLOG(1) << collector_;
return collector_.Collected(s, huffman_encoded);
}
// expected_str is a std::string rather than a const std::string& or
- // QuicheStringPiece so that the lambda makes a copy of the string, and thus
+ // absl::string_view so that the lambda makes a copy of the string, and thus
// the string to be passed to Collected outlives the call to MakeValidator.
Validator MakeValidator(const std::string& expected_str,
bool expected_huffman) {
@@ -112,7 +112,7 @@ TEST_F(HpackStringDecoderTest, DecodeShortString) {
{
Validator validator =
ValidateDoneAndOffset(11, MakeValidator("start end.", kUncompressed));
- quiche::QuicheStringPiece data("\x0astart end.");
+ absl::string_view data("\x0astart end.");
DecodeBuffer b(data);
EXPECT_TRUE(
DecodeAndValidateSeveralWays(&b, kMayReturnZeroOnFirst, validator));
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.cc
index f8d5e9dc47d..ecdcdc90cee 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.cc
@@ -70,7 +70,7 @@ void HpackWholeEntryBuffer::OnNameStart(bool huffman_encoded, size_t len) {
void HpackWholeEntryBuffer::OnNameData(const char* data, size_t len) {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnNameData: len=" << len
<< " data:\n"
- << Http2HexDump(quiche::QuicheStringPiece(data, len));
+ << Http2HexDump(absl::string_view(data, len));
DCHECK_EQ(maybe_name_index_, 0u);
if (!error_detected_ && !name_.OnData(data, len)) {
ReportError(HpackDecodingError::kNameHuffmanError, "");
@@ -107,7 +107,7 @@ void HpackWholeEntryBuffer::OnValueStart(bool huffman_encoded, size_t len) {
void HpackWholeEntryBuffer::OnValueData(const char* data, size_t len) {
HTTP2_DVLOG(2) << "HpackWholeEntryBuffer::OnValueData: len=" << len
<< " data:\n"
- << Http2HexDump(quiche::QuicheStringPiece(data, len));
+ << Http2HexDump(absl::string_view(data, len));
if (!error_detected_ && !value_.OnData(data, len)) {
ReportError(HpackDecodingError::kValueHuffmanError, "");
HTTP2_CODE_COUNT_N(decompress_failure_3, 22, 23);
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h
index afca3b83812..f7b81c589d2 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer.h
@@ -12,13 +12,13 @@
#include <stddef.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_entry_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
index 70e13501f2c..c3a005a98af 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_buffer_test.cc
@@ -7,9 +7,8 @@
// Tests of HpackWholeEntryBuffer: does it buffer correctly, and does it
// detect Huffman decoding errors and oversize string errors?
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::_;
using ::testing::AllOf;
@@ -47,7 +46,7 @@ class MockHpackWholeEntryListener : public HpackWholeEntryListener {
(override));
};
-class HpackWholeEntryBufferTest : public ::testing::Test {
+class HpackWholeEntryBufferTest : public QuicheTest {
protected:
HpackWholeEntryBufferTest() : entry_buffer_(&listener_, kMaxStringSize) {}
~HpackWholeEntryBufferTest() override = default;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h
index ec2ae524656..92135f9c2c0 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/decoder/hpack_whole_entry_listener.h
@@ -11,11 +11,11 @@
#include <stddef.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_string_buffer.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoding_error.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.cc b/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.cc
index cb22f51528b..a68bd8b88b5 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.cc
@@ -12,33 +12,32 @@
namespace http2 {
HpackString::HpackString(const char* data) : str_(data) {}
-HpackString::HpackString(quiche::QuicheStringPiece str)
- : str_(std::string(str)) {}
+HpackString::HpackString(absl::string_view str) : str_(std::string(str)) {}
HpackString::HpackString(std::string str) : str_(std::move(str)) {}
HpackString::HpackString(const HpackString& other) = default;
HpackString::~HpackString() = default;
-quiche::QuicheStringPiece HpackString::ToStringPiece() const {
+absl::string_view HpackString::ToStringPiece() const {
return str_;
}
bool HpackString::operator==(const HpackString& other) const {
return str_ == other.str_;
}
-bool HpackString::operator==(quiche::QuicheStringPiece str) const {
+bool HpackString::operator==(absl::string_view str) const {
return str == str_;
}
-bool operator==(quiche::QuicheStringPiece a, const HpackString& b) {
+bool operator==(absl::string_view a, const HpackString& b) {
return b == a;
}
-bool operator!=(quiche::QuicheStringPiece a, const HpackString& b) {
+bool operator!=(absl::string_view a, const HpackString& b) {
return !(b == a);
}
bool operator!=(const HpackString& a, const HpackString& b) {
return !(a == b);
}
-bool operator!=(const HpackString& a, quiche::QuicheStringPiece b) {
+bool operator!=(const HpackString& a, absl::string_view b) {
return !(a == b);
}
std::ostream& operator<<(std::ostream& out, const HpackString& v) {
@@ -51,8 +50,8 @@ HpackStringPair::HpackStringPair(const HpackString& name,
HTTP2_DVLOG(3) << DebugString() << " ctor";
}
-HpackStringPair::HpackStringPair(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value)
+HpackStringPair::HpackStringPair(absl::string_view name,
+ absl::string_view value)
: name(name), value(value) {
HTTP2_DVLOG(3) << DebugString() << " ctor";
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.h b/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.h
index 678918713e7..3af2348e66c 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/hpack_string.h
@@ -15,15 +15,15 @@
#include <iosfwd>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
class QUICHE_EXPORT_PRIVATE HpackString {
public:
explicit HpackString(const char* data);
- explicit HpackString(quiche::QuicheStringPiece str);
+ explicit HpackString(absl::string_view str);
explicit HpackString(std::string str);
HpackString(const HpackString& other);
@@ -34,31 +34,30 @@ class QUICHE_EXPORT_PRIVATE HpackString {
size_t size() const { return str_.size(); }
const std::string& ToString() const { return str_; }
- quiche::QuicheStringPiece ToStringPiece() const;
+ absl::string_view ToStringPiece() const;
bool operator==(const HpackString& other) const;
- bool operator==(quiche::QuicheStringPiece str) const;
+ bool operator==(absl::string_view str) const;
private:
std::string str_;
};
-QUICHE_EXPORT_PRIVATE bool operator==(quiche::QuicheStringPiece a,
+QUICHE_EXPORT_PRIVATE bool operator==(absl::string_view a,
const HpackString& b);
-QUICHE_EXPORT_PRIVATE bool operator!=(quiche::QuicheStringPiece a,
+QUICHE_EXPORT_PRIVATE bool operator!=(absl::string_view a,
const HpackString& b);
QUICHE_EXPORT_PRIVATE bool operator!=(const HpackString& a,
const HpackString& b);
QUICHE_EXPORT_PRIVATE bool operator!=(const HpackString& a,
- quiche::QuicheStringPiece b);
+ absl::string_view b);
QUICHE_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& out,
const HpackString& v);
struct QUICHE_EXPORT_PRIVATE HpackStringPair {
HpackStringPair(const HpackString& name, const HpackString& value);
- HpackStringPair(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ HpackStringPair(absl::string_view name, absl::string_view value);
~HpackStringPair();
// Returns the size of a header entry with this name and value, per the RFC:
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/hpack_string_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/hpack_string_test.cc
index 399d09fbb17..ee24115e626 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/hpack_string_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/hpack_string_test.cc
@@ -10,6 +10,7 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionFailure;
using ::testing::AssertionResult;
@@ -22,12 +23,12 @@ namespace {
const char kStr0[] = "s0: Some string to be copied into another string.";
const char kStr1[] = "S1 - some string to be copied into yet another string.";
-class HpackStringTest : public ::testing::Test {
+class HpackStringTest : public QuicheTest {
protected:
AssertionResult VerifyNotEqual(HpackString* actual,
const std::string& not_expected_str) {
const char* not_expected_ptr = not_expected_str.c_str();
- quiche::QuicheStringPiece not_expected_sp(not_expected_str);
+ absl::string_view not_expected_sp(not_expected_str);
VERIFY_NE(*actual, not_expected_ptr);
VERIFY_NE(*actual, not_expected_sp);
@@ -55,7 +56,7 @@ class HpackStringTest : public ::testing::Test {
VERIFY_EQ(actual->size(), expected_str.size());
const char* expected_ptr = expected_str.c_str();
- const quiche::QuicheStringPiece expected_sp(expected_str);
+ const absl::string_view expected_sp(expected_str);
VERIFY_EQ(*actual, expected_ptr);
VERIFY_EQ(*actual, expected_sp);
@@ -90,12 +91,12 @@ TEST_F(HpackStringTest, CharArrayConstructor) {
}
TEST_F(HpackStringTest, StringPieceConstructor) {
- quiche::QuicheStringPiece sp0(kStr0);
+ absl::string_view sp0(kStr0);
HpackString hs0(sp0);
EXPECT_TRUE(VerifyEqual(&hs0, kStr0));
EXPECT_TRUE(VerifyNotEqual(&hs0, kStr1));
- quiche::QuicheStringPiece sp1(kStr1);
+ absl::string_view sp1(kStr1);
HpackString hs1(sp1);
EXPECT_TRUE(VerifyEqual(&hs1, kStr1));
EXPECT_TRUE(VerifyNotEqual(&hs1, kStr0));
@@ -114,7 +115,7 @@ TEST_F(HpackStringTest, MoveStringConstructor) {
}
TEST_F(HpackStringTest, CopyConstructor) {
- quiche::QuicheStringPiece sp0(kStr0);
+ absl::string_view sp0(kStr0);
HpackString hs0(sp0);
HpackString hs1(hs0);
EXPECT_EQ(hs0, hs1);
@@ -127,7 +128,7 @@ TEST_F(HpackStringTest, CopyConstructor) {
}
TEST_F(HpackStringTest, MoveConstructor) {
- quiche::QuicheStringPiece sp0(kStr0);
+ absl::string_view sp0(kStr0);
HpackString hs0(sp0);
EXPECT_TRUE(VerifyEqual(&hs0, kStr0));
EXPECT_TRUE(VerifyNotEqual(&hs0, ""));
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.cc
index 18bff72d2b0..d21624cf6d7 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.cc
@@ -26,8 +26,6 @@
// is 5 bits long, and the last canonical is EOS, which is the last
// of the symbols whose code is 30 bits long.
-// TODO(jamessynge): Remove use of binary literals, that is a C++ 14 feature.
-
namespace http2 {
namespace {
@@ -356,7 +354,7 @@ void HuffmanBitBuffer::Reset() {
count_ = 0;
}
-size_t HuffmanBitBuffer::AppendBytes(quiche::QuicheStringPiece input) {
+size_t HuffmanBitBuffer::AppendBytes(absl::string_view input) {
HuffmanAccumulatorBitCount free_cnt = free_count();
size_t bytes_available = input.size();
if (free_cnt < 8 || bytes_available == 0) {
@@ -414,8 +412,7 @@ HpackHuffmanDecoder::HpackHuffmanDecoder() = default;
HpackHuffmanDecoder::~HpackHuffmanDecoder() = default;
-bool HpackHuffmanDecoder::Decode(quiche::QuicheStringPiece input,
- std::string* output) {
+bool HpackHuffmanDecoder::Decode(absl::string_view input, std::string* output) {
HTTP2_DVLOG(1) << "HpackHuffmanDecoder::Decode";
// Fill bit_buffer_ from input.
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h
index 229bb586f3a..fe312d83c84 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h
@@ -18,8 +18,8 @@
#include <iosfwd>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -47,7 +47,7 @@ class QUICHE_EXPORT_PRIVATE HuffmanBitBuffer {
// Add as many whole bytes to the accumulator (accumulator_) as possible,
// returning the number of bytes added.
- size_t AppendBytes(quiche::QuicheStringPiece input);
+ size_t AppendBytes(absl::string_view input);
// Get the bits of the accumulator.
HuffmanAccumulator value() const { return accumulator_; }
@@ -109,7 +109,7 @@ class QUICHE_EXPORT_PRIVATE HpackHuffmanDecoder {
// will contain the leading bits of the code for that symbol, but not the
// final bits of that code.
// Note that output should be empty, but that it is not cleared by Decode().
- bool Decode(quiche::QuicheStringPiece input, std::string* output);
+ bool Decode(absl::string_view input, std::string* output);
// Is what remains in the bit_buffer_ valid at the end of an encoded string?
// Call after passing the the final portion of a Huffman string to Decode,
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc
index 482d39c4c8b..0ff34132f69 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder_test.cc
@@ -8,13 +8,13 @@
#include <iostream>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
@@ -36,7 +36,7 @@ TEST(HuffmanBitBufferTest, AppendBytesAligned) {
s.push_back('\x11');
s.push_back('\x22');
s.push_back('\x33');
- quiche::QuicheStringPiece sp(s);
+ absl::string_view sp(s);
HuffmanBitBuffer bb;
sp.remove_prefix(bb.AppendBytes(sp));
@@ -85,7 +85,7 @@ TEST(HuffmanBitBufferTest, ConsumeBits) {
s.push_back('\x11');
s.push_back('\x22');
s.push_back('\x33');
- quiche::QuicheStringPiece sp(s);
+ absl::string_view sp(s);
HuffmanBitBuffer bb;
sp.remove_prefix(bb.AppendBytes(sp));
@@ -117,7 +117,7 @@ TEST(HuffmanBitBufferTest, AppendBytesUnaligned) {
s.push_back('\xbb');
s.push_back('\xcc');
s.push_back('\xdd');
- quiche::QuicheStringPiece sp(s);
+ absl::string_view sp(s);
HuffmanBitBuffer bb;
sp.remove_prefix(bb.AppendBytes(sp));
@@ -161,10 +161,10 @@ class HpackHuffmanDecoderTest : public RandomDecoderTest {
DecodeStatus ResumeDecoding(DecodeBuffer* b) override {
input_bytes_seen_ += b->Remaining();
- quiche::QuicheStringPiece sp(b->cursor(), b->Remaining());
+ absl::string_view sp(b->cursor(), b->Remaining());
if (decoder_.Decode(sp, &output_buffer_)) {
b->AdvanceCursor(b->Remaining());
- // Successfully decoded (or buffered) the bytes in QuicheStringPiece.
+ // Successfully decoded (or buffered) the bytes in absl::string_view.
EXPECT_LE(input_bytes_seen_, input_bytes_expected_);
// Have we reached the end of the encoded string?
if (input_bytes_expected_ == input_bytes_seen_) {
@@ -197,7 +197,7 @@ TEST_F(HpackHuffmanDecoderTest, SpecRequestExamples) {
Http2HexDecode("25a849e95bb8e8b4bf"),
"custom-value",
};
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& huffman_encoded(test_table[i]);
const std::string& plain_string(test_table[i + 1]);
std::string buffer;
@@ -228,7 +228,7 @@ TEST_F(HpackHuffmanDecoderTest, SpecResponseExamples) {
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1",
};
// clang-format on
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& huffman_encoded(test_table[i]);
const std::string& plain_string(test_table[i + 1]);
std::string buffer;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.cc
index 8b3f29fc69a..c4492df0aec 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.cc
@@ -7,11 +7,9 @@
#include "net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-// TODO(jamessynge): Remove use of binary literals, that is a C++ 14 feature.
-
namespace http2 {
-size_t ExactHuffmanSize(quiche::QuicheStringPiece plain) {
+size_t HuffmanSize(absl::string_view plain) {
size_t bits = 0;
for (const uint8_t c : plain) {
bits += HuffmanSpecTables::kCodeLengths[c];
@@ -19,51 +17,11 @@ size_t ExactHuffmanSize(quiche::QuicheStringPiece plain) {
return (bits + 7) / 8;
}
-size_t BoundedHuffmanSize(quiche::QuicheStringPiece plain) {
- // TODO(jamessynge): Determine whether we should set the min size for Huffman
- // encoding much higher (i.e. if less than N, then the savings isn't worth
- // the cost of encoding and decoding). Of course, we need to decide on a
- // value function, which might be throughput on a full load test, or a
- // microbenchmark of the time to encode and then decode a HEADERS frame,
- // possibly with the cost of crypto included (i.e. crypto is going to have
- // a fairly constant per-byte cost, so reducing the number of bytes in-transit
- // reduces the number that must be encrypted and later decrypted).
- if (plain.size() < 3) {
- // Huffman encoded string can't be smaller than the plain size for very
- // short strings.
- return plain.size();
- }
- // TODO(jamessynge): Measure whether this can be done more efficiently with
- // nested loops (e.g. make exact measurement of 8 bytes, then check if min
- // remaining is too long).
- // Compute the number of bits in an encoding that is shorter than the plain
- // string (i.e. the number of bits in a string 1 byte shorter than plain),
- // and use this as the limit of the size of the encoding.
- const size_t limit_bits = (plain.size() - 1) * 8;
- // The shortest code length in the Huffman table of the HPACK spec has 5 bits
- // (e.g. for 0, 1, a and e).
- const size_t min_code_length = 5;
- // We can therefore say that all plain text bytes whose code length we've not
- // yet looked up will take at least 5 bits.
- size_t min_bits_remaining = plain.size() * min_code_length;
- size_t bits = 0;
- for (const uint8_t c : plain) {
- bits += HuffmanSpecTables::kCodeLengths[c];
- min_bits_remaining -= min_code_length;
- // If our minimum estimate of the total number of bits won't yield an
- // encoding shorter the plain text, let's bail.
- const size_t minimum_bits_total = bits + min_bits_remaining;
- if (minimum_bits_total > limit_bits) {
- bits += min_bits_remaining;
- break;
- }
- }
- return (bits + 7) / 8;
-}
-
-void HuffmanEncode(quiche::QuicheStringPiece plain, std::string* huffman) {
+void HuffmanEncode(absl::string_view plain,
+ size_t encoded_size,
+ std::string* huffman) {
DCHECK(huffman != nullptr);
- huffman->clear(); // Note that this doesn't release memory.
+ huffman->reserve(huffman->size() + encoded_size);
uint64_t bit_buffer = 0; // High-bit is next bit to output. Not clear if that
// is more performant than having the low-bit be the
// last to be output.
@@ -107,4 +65,65 @@ void HuffmanEncode(quiche::QuicheStringPiece plain, std::string* huffman) {
}
}
+void HuffmanEncodeFast(absl::string_view input,
+ size_t encoded_size,
+ std::string* output) {
+ const size_t original_size = output->size();
+ const size_t final_size = original_size + encoded_size;
+ // Reserve an extra four bytes to avoid accessing unallocated memory (even
+ // though it would only be OR'd with zeros and thus not modified).
+ output->resize(final_size + 4, 0);
+
+ // Pointer to first appended byte.
+ char* const first = &*output->begin() + original_size;
+ size_t bit_counter = 0;
+ for (uint8_t c : input) {
+ // Align the Huffman code to byte boundaries as it needs to be written.
+ // The longest Huffman code is 30 bits long, and it can be shifted by up to
+ // 7 bits, requiring 37 bits in total. The most significant 25 bits and
+ // least significant 2 bits of |code| are always zero.
+ uint64_t code = static_cast<uint64_t>(HuffmanSpecTables::kLeftCodes[c])
+ << (8 - (bit_counter % 8));
+ // The byte where the first bit of |code| needs to be written.
+ char* const current = first + (bit_counter / 8);
+
+ bit_counter += HuffmanSpecTables::kCodeLengths[c];
+
+ *current |= code >> 32;
+
+ // Do not check if this write is zero before executing it, because with
+ // uniformly random shifts and an ideal random input distribution
+ // corresponding to the Huffman tree it would only be zero in 29% of the
+ // cases.
+ *(current + 1) |= (code >> 24) & 0xff;
+
+ // Continue to next input character if there is nothing else to write.
+ // (If next byte is zero, then rest must also be zero.)
+ if ((code & 0xff0000) == 0) {
+ continue;
+ }
+ *(current + 2) |= (code >> 16) & 0xff;
+
+ // Continue to next input character if there is nothing else to write.
+ // (If next byte is zero, then rest must also be zero.)
+ if ((code & 0xff00) == 0) {
+ continue;
+ }
+ *(current + 3) |= (code >> 8) & 0xff;
+
+ // Do not check if this write is zero, because the check would probably be
+ // as expensive as the write.
+ *(current + 4) |= code & 0xff;
+ }
+
+ DCHECK_EQ(encoded_size, (bit_counter + 7) / 8);
+
+ // EOF
+ if (bit_counter % 8 != 0) {
+ *(first + encoded_size - 1) |= 0xff >> (bit_counter & 7);
+ }
+
+ output->resize(final_size);
+}
+
} // namespace http2
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h
index 2ee4de21a70..fb79fb19a8a 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h
@@ -11,31 +11,30 @@
#include <cstddef> // For size_t
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
// Returns the size of the Huffman encoding of |plain|, which may be greater
-// than plain.size(). Mostly present for testing.
-QUICHE_EXPORT_PRIVATE size_t ExactHuffmanSize(quiche::QuicheStringPiece plain);
-
-// Returns the size of the Huffman encoding of |plain|, unless it is greater
-// than or equal to plain.size(), in which case a value greater than or equal to
-// plain.size() is returned. The advantage of this over ExactHuffmanSize is that
-// it doesn't read as much of the input string in the event that the string is
-// not compressible by HuffmanEncode (i.e. when the encoding is longer than the
-// original string, it stops reading the input string as soon as it knows that).
-QUICHE_EXPORT_PRIVATE size_t
-BoundedHuffmanSize(quiche::QuicheStringPiece plain);
-
-// Encode the plain text string |plain| with the Huffman encoding defined in
-// the HPACK RFC, 7541. |*huffman| does not have to be empty, it is cleared at
-// the beginning of this function. This allows reusing the same string object
-// across multiple invocations.
-QUICHE_EXPORT_PRIVATE void HuffmanEncode(quiche::QuicheStringPiece plain,
+// than plain.size().
+QUICHE_EXPORT_PRIVATE size_t HuffmanSize(absl::string_view plain);
+
+// Encode the plain text string |plain| with the Huffman encoding defined in the
+// HPACK RFC, 7541. |encoded_size| is used to pre-allocate storage and it
+// should be the value returned by HuffmanSize(). Appends the result to
+// |*huffman|.
+QUICHE_EXPORT_PRIVATE void HuffmanEncode(absl::string_view plain,
+ size_t encoded_size,
std::string* huffman);
+// Encode |input| with the Huffman encoding defined RFC7541, used in HPACK and
+// QPACK. |encoded_size| must be the value returned by HuffmanSize().
+// Appends the result to the end of |*output|.
+QUICHE_EXPORT_PRIVATE void HuffmanEncodeFast(absl::string_view input,
+ size_t encoded_size,
+ std::string* output);
+
} // namespace http2
#endif // QUICHE_HTTP2_HPACK_HUFFMAN_HPACK_HUFFMAN_ENCODER_H_
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_benchmark.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_benchmark.cc
deleted file mode 100644
index 1f365c6b0da..00000000000
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_benchmark.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-//
-// $ blaze run -c opt --dynamic_mode=off \
-// -- //net/third_party/quiche/src/http2/hpack/huffman:hpack_huffman_encoder_benchmark \
-// --benchmarks=all --benchmark_memory_usage --benchmark_repetitions=1
-//
-// Benchmark Time(ns) CPU(ns) Allocs Iterations
-// -----------------------------------------------------------------------------
-// BM_EncodeSmallStrings 239 239 0 2456085 0.000B peak-mem
-// BM_EncodeLargeString/1k 4560 4561 5 153325 1.125kB peak-mem
-// BM_EncodeLargeString/4k 18787 18788 7 38430 4.500kB peak-mem
-// BM_EncodeLargeString/32k 147680 147657 10 4664 36.000kB peak-mem
-// BM_EncodeLargeString/256k 1161688 1161511 13 601 288.000kB peak-mem
-// BM_EncodeLargeString/2M 10042722 10036764 16 75 2.250MB peak-mem
-// BM_EncodeLargeString/16M 76127338 76138839 19 9 18.000MB peak-mem
-// BM_EncodeLargeString/128M 640008098 640154859 22 1 144.000MB peak-mem
-//
-
-#include <string>
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Weverything"
-// This header has multiple DCHECK_* macros with signed-unsigned comparison.
-#include "testing/base/public/benchmark.h"
-#pragma clang diagnostic pop
-
-#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
-
-namespace http2 {
-namespace {
-
-void BM_EncodeSmallStrings(benchmark::State& state) {
- const std::vector<const std::string> inputs{
- ":method", ":path", "cookie", "set-cookie", "vary", "accept-encoding"};
- for (auto s : state) {
- for (const auto& input : inputs) {
- std::string result;
- ExactHuffmanSize(input);
- HuffmanEncode(input, &result);
- }
- }
-}
-
-void BM_EncodeLargeString(benchmark::State& state) {
- const std::string input(state.range(0), 'a');
- for (auto s : state) {
- std::string result;
- ExactHuffmanSize(input);
- HuffmanEncode(input, &result);
- }
-}
-
-BENCHMARK(BM_EncodeSmallStrings);
-BENCHMARK(BM_EncodeLargeString)->Range(1024, 128 * 1024 * 1024);
-
-} // namespace
-} // namespace http2
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc
index d729d0ec138..c9743f5f270 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder_test.cc
@@ -4,14 +4,41 @@
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace {
-TEST(HuffmanEncoderTest, SpecRequestExamples) {
+class HuffmanEncoderTest : public ::testing::TestWithParam<bool> {
+ protected:
+ HuffmanEncoderTest() : use_fast_encoder_(GetParam()) {}
+ virtual ~HuffmanEncoderTest() = default;
+
+ void Encode(absl::string_view input,
+ size_t encoded_size,
+ std::string* output) {
+ use_fast_encoder_ ? HuffmanEncodeFast(input, encoded_size, output)
+ : HuffmanEncode(input, encoded_size, output);
+ }
+
+ const bool use_fast_encoder_;
+};
+
+INSTANTIATE_TEST_SUITE_P(TwoEncoders, HuffmanEncoderTest, ::testing::Bool());
+
+TEST_P(HuffmanEncoderTest, Empty) {
+ std::string empty("");
+ size_t encoded_size = HuffmanSize(empty);
+ EXPECT_EQ(0u, encoded_size);
+
+ std::string buffer;
+ Encode(empty, encoded_size, &buffer);
+ EXPECT_EQ("", buffer);
+}
+
+TEST_P(HuffmanEncoderTest, SpecRequestExamples) {
std::string test_table[] = {
Http2HexDecode("f1e3c2e5f23a6ba0ab90f4ff"),
"www.example.com",
@@ -22,19 +49,19 @@ TEST(HuffmanEncoderTest, SpecRequestExamples) {
Http2HexDecode("25a849e95bb8e8b4bf"),
"custom-value",
};
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& huffman_encoded(test_table[i]);
const std::string& plain_string(test_table[i + 1]);
- EXPECT_EQ(ExactHuffmanSize(plain_string), huffman_encoded.size());
- EXPECT_EQ(BoundedHuffmanSize(plain_string), huffman_encoded.size());
+ size_t encoded_size = HuffmanSize(plain_string);
+ EXPECT_EQ(huffman_encoded.size(), encoded_size);
std::string buffer;
buffer.reserve();
- HuffmanEncode(plain_string, &buffer);
+ Encode(plain_string, encoded_size, &buffer);
EXPECT_EQ(buffer, huffman_encoded) << "Error encoding " << plain_string;
}
}
-TEST(HuffmanEncoderTest, SpecResponseExamples) {
+TEST_P(HuffmanEncoderTest, SpecResponseExamples) {
// clang-format off
std::string test_table[] = {
Http2HexDecode("6402"),
@@ -53,21 +80,18 @@ TEST(HuffmanEncoderTest, SpecResponseExamples) {
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1",
};
// clang-format on
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& huffman_encoded(test_table[i]);
const std::string& plain_string(test_table[i + 1]);
- EXPECT_EQ(ExactHuffmanSize(plain_string), huffman_encoded.size());
- EXPECT_EQ(BoundedHuffmanSize(plain_string), huffman_encoded.size());
+ size_t encoded_size = HuffmanSize(plain_string);
+ EXPECT_EQ(huffman_encoded.size(), encoded_size);
std::string buffer;
- buffer.reserve(huffman_encoded.size());
- const size_t capacity = buffer.capacity();
- HuffmanEncode(plain_string, &buffer);
+ Encode(plain_string, encoded_size, &buffer);
EXPECT_EQ(buffer, huffman_encoded) << "Error encoding " << plain_string;
- EXPECT_EQ(capacity, buffer.capacity());
}
}
-TEST(HuffmanEncoderTest, EncodedSizeAgreesWithEncodeString) {
+TEST_P(HuffmanEncoderTest, EncodedSizeAgreesWithEncodeString) {
std::string test_table[] = {
"",
"Mon, 21 Oct 2013 20:13:21 GMT",
@@ -79,18 +103,29 @@ TEST(HuffmanEncoderTest, EncodedSizeAgreesWithEncodeString) {
};
// Modify last |test_table| entry to cover all codes.
for (size_t i = 0; i != 256; ++i) {
- test_table[QUICHE_ARRAYSIZE(test_table) - 1][i] = static_cast<char>(i);
+ test_table[ABSL_ARRAYSIZE(test_table) - 1][i] = static_cast<char>(i);
}
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); ++i) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); ++i) {
const std::string& plain_string = test_table[i];
+ size_t encoded_size = HuffmanSize(plain_string);
std::string huffman_encoded;
- HuffmanEncode(plain_string, &huffman_encoded);
- EXPECT_EQ(huffman_encoded.size(), ExactHuffmanSize(plain_string));
- EXPECT_LE(BoundedHuffmanSize(plain_string), plain_string.size());
- EXPECT_LE(BoundedHuffmanSize(plain_string), ExactHuffmanSize(plain_string));
+ Encode(plain_string, encoded_size, &huffman_encoded);
+ EXPECT_EQ(encoded_size, huffman_encoded.size());
}
}
+// Test that encoding appends to output without overwriting it.
+TEST_P(HuffmanEncoderTest, AppendToOutput) {
+ size_t encoded_size = HuffmanSize("foo");
+ std::string buffer;
+ Encode("foo", encoded_size, &buffer);
+ EXPECT_EQ(Http2HexDecode("94e7"), buffer);
+
+ encoded_size = HuffmanSize("bar");
+ Encode("bar", encoded_size, &buffer);
+ EXPECT_EQ(Http2HexDecode("94e78c767f"), buffer);
+}
+
} // namespace
} // namespace http2
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_transcoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_transcoder_test.cc
index b7407a3ed17..087f3740bdc 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_transcoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_transcoder_test.cc
@@ -6,14 +6,14 @@
#include <stddef.h>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
@@ -52,10 +52,10 @@ class HpackHuffmanTranscoderTest : public RandomDecoderTest {
DecodeStatus ResumeDecoding(DecodeBuffer* b) override {
input_bytes_seen_ += b->Remaining();
- quiche::QuicheStringPiece sp(b->cursor(), b->Remaining());
+ absl::string_view sp(b->cursor(), b->Remaining());
if (decoder_.Decode(sp, &output_buffer_)) {
b->AdvanceCursor(b->Remaining());
- // Successfully decoded (or buffered) the bytes in QuicheStringPiece.
+ // Successfully decoded (or buffered) the bytes in absl::string_view.
EXPECT_LE(input_bytes_seen_, input_bytes_expected_);
// Have we reached the end of the encoded string?
if (input_bytes_expected_ == input_bytes_seen_) {
@@ -71,10 +71,12 @@ class HpackHuffmanTranscoderTest : public RandomDecoderTest {
}
AssertionResult TranscodeAndValidateSeveralWays(
- quiche::QuicheStringPiece plain,
- quiche::QuicheStringPiece expected_huffman) {
+ absl::string_view plain,
+ absl::string_view expected_huffman) {
+ size_t encoded_size = HuffmanSize(plain);
std::string encoded;
- HuffmanEncode(plain, &encoded);
+ HuffmanEncode(plain, encoded_size, &encoded);
+ VERIFY_EQ(encoded_size, encoded.size());
if (expected_huffman.size() > 0 || plain.empty()) {
VERIFY_EQ(encoded, expected_huffman);
}
@@ -90,8 +92,7 @@ class HpackHuffmanTranscoderTest : public RandomDecoderTest {
ValidateDoneAndEmpty(validator));
}
- AssertionResult TranscodeAndValidateSeveralWays(
- quiche::QuicheStringPiece plain) {
+ AssertionResult TranscodeAndValidateSeveralWays(absl::string_view plain) {
return TranscodeAndValidateSeveralWays(plain, "");
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.cc b/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.cc
index 27707b98120..f93d9a56dad 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.cc
@@ -44,11 +44,6 @@ const uint8_t HuffmanSpecTables::kCodeLengths[] = {
30, // 256
};
-// TODO(jamessynge): Remove use of binary literals, that is a C++ 14 feature.
-
-// Uncomment these codes if needed for generating Huffman output, as opposed
-// to decoding Huffman input.
-/*
// The encoding of each symbol, left justified (as printed), which means that
// the first bit of the encoding is the high-order bit of the uint32.
// static
@@ -311,7 +306,6 @@ const uint32_t HuffmanSpecTables::kLeftCodes[] = {
0b11111111111111111111101110000000, // 0xff
0b11111111111111111111111111111100, // 0x100
};
-*/
// static
const uint32_t HuffmanSpecTables::kRightCodes[] = {
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.h b/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.h
index 6cd8726d7b4..d1b144b1358 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/huffman/huffman_spec_tables.h
@@ -18,6 +18,10 @@ struct HuffmanSpecTables {
// The encoding of each symbol, right justified (as printed), which means that
// the last bit of the encoding is the low-order bit of the uint32.
static const uint32_t kRightCodes[257];
+
+ // The encoding of each symbol, left justified (as printed), which means that
+ // the first bit of the encoding is the high-order bit of the uint32.
+ static const uint32_t kLeftCodes[257];
};
} // namespace http2
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.cc b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.cc
index 3175c1d4bb2..fa0ec4d3cc0 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_bug_tracker.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -55,7 +55,7 @@ void HpackBlockBuilder::AppendEntryTypeAndVarint(HpackEntryType entry_type,
}
void HpackBlockBuilder::AppendString(bool is_huffman_encoded,
- quiche::QuicheStringPiece str) {
+ absl::string_view str) {
uint8_t high_bits = is_huffman_encoded ? 0x80 : 0;
uint8_t prefix_length = 7;
AppendHighBitsAndVarint(high_bits, prefix_length, str.size());
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h
index b96d262ee32..46da803f871 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h
@@ -20,16 +20,16 @@
#include <cstdint>
#include <string>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
class HpackBlockBuilder {
public:
- explicit HpackBlockBuilder(quiche::QuicheStringPiece initial_contents)
+ explicit HpackBlockBuilder(absl::string_view initial_contents)
: buffer_(initial_contents.data(), initial_contents.size()) {}
HpackBlockBuilder() {}
~HpackBlockBuilder() {}
@@ -51,7 +51,7 @@ class HpackBlockBuilder {
void AppendNameIndexAndLiteralValue(HpackEntryType entry_type,
uint64_t name_index,
bool value_is_huffman_encoded,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
// name_index==0 would indicate that the entry includes a literal name.
// Call AppendLiteralNameAndValue in that case.
EXPECT_NE(0u, name_index);
@@ -61,9 +61,9 @@ class HpackBlockBuilder {
void AppendLiteralNameAndValue(HpackEntryType entry_type,
bool name_is_huffman_encoded,
- quiche::QuicheStringPiece name,
+ absl::string_view name,
bool value_is_huffman_encoded,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
AppendEntryTypeAndVarint(entry_type, 0);
AppendString(name_is_huffman_encoded, name);
AppendString(value_is_huffman_encoded, value);
@@ -84,7 +84,7 @@ class HpackBlockBuilder {
// Append a header string (i.e. a header name or value) in HPACK format.
// Does NOT perform Huffman encoding.
- void AppendString(bool is_huffman_encoded, quiche::QuicheStringPiece str);
+ void AppendString(bool is_huffman_encoded, absl::string_view str);
private:
std::string buffer_;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc
index 21f161e5335..d162fba6530 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder_test.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -120,8 +120,7 @@ TEST(HpackBlockBuilderTest, ExamplesFromSpecC4) {
'\xab', '\x90', '\xf4', '\xff'};
b.AppendNameIndexAndLiteralValue(
HpackEntryType::kIndexedLiteralHeader, 1, kCompressed,
- quiche::QuicheStringPiece(kHuffmanWwwExampleCom,
- sizeof kHuffmanWwwExampleCom));
+ absl::string_view(kHuffmanWwwExampleCom, sizeof kHuffmanWwwExampleCom));
EXPECT_EQ(17u, b.size());
// Hex dump of encoded data (copied from RFC):
@@ -141,7 +140,7 @@ TEST(HpackBlockBuilderTest, DynamicTableSizeUpdate) {
EXPECT_EQ(1u, b.size());
const char kData[] = {'\x20'};
- quiche::QuicheStringPiece expected(kData, sizeof kData);
+ absl::string_view expected(kData, sizeof kData);
EXPECT_EQ(expected, b.buffer());
}
{
@@ -150,7 +149,7 @@ TEST(HpackBlockBuilderTest, DynamicTableSizeUpdate) {
EXPECT_EQ(3u, b.size());
const char kData[] = {'\x3f', '\xe1', '\x1f'};
- quiche::QuicheStringPiece expected(kData, sizeof kData);
+ absl::string_view expected(kData, sizeof kData);
EXPECT_EQ(expected, b.buffer());
}
{
@@ -160,7 +159,7 @@ TEST(HpackBlockBuilderTest, DynamicTableSizeUpdate) {
const char kData[] = {'\x3f', '\xe1', '\x9f', '\x94',
'\xa5', '\x8d', '\x1d'};
- quiche::QuicheStringPiece expected(kData, sizeof kData);
+ absl::string_view expected(kData, sizeof kData);
EXPECT_EQ(expected, b.buffer());
}
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc
index 31de86ddc95..1087875d0ff 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.cc
@@ -15,8 +15,7 @@ namespace http2 {
namespace test {
namespace {
-void HpackExampleToStringOrDie(quiche::QuicheStringPiece example,
- std::string* output) {
+void HpackExampleToStringOrDie(absl::string_view example, std::string* output) {
while (!example.empty()) {
const char c0 = example[0];
if (isxdigit(c0)) {
@@ -34,7 +33,7 @@ void HpackExampleToStringOrDie(quiche::QuicheStringPiece example,
if (!example.empty() && example[0] == '|') {
// Start of a comment. Skip to end of line or of input.
auto pos = example.find('\n');
- if (pos == quiche::QuicheStringPiece::npos) {
+ if (pos == absl::string_view::npos) {
// End of input.
break;
}
@@ -50,7 +49,7 @@ void HpackExampleToStringOrDie(quiche::QuicheStringPiece example,
} // namespace
-std::string HpackExampleToStringOrDie(quiche::QuicheStringPiece example) {
+std::string HpackExampleToStringOrDie(absl::string_view example) {
std::string output;
HpackExampleToStringOrDie(example, &output);
return output;
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.h b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.h
index e86c11692c4..de203cccbde 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.h
+++ b/chromium/net/third_party/quiche/src/http2/hpack/tools/hpack_example.h
@@ -7,7 +7,7 @@
#include <string>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
// Parses HPACK examples in the format seen in the HPACK specification,
// RFC 7541. For example:
@@ -24,7 +24,7 @@
namespace http2 {
namespace test {
-std::string HpackExampleToStringOrDie(quiche::QuicheStringPiece example);
+std::string HpackExampleToStringOrDie(absl::string_view example);
} // namespace test
} // namespace http2
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc
index 450751fdfc4..7be271000e8 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder_test.cc
@@ -8,12 +8,12 @@
#include <stddef.h>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionFailure;
using ::testing::AssertionSuccess;
@@ -31,7 +31,7 @@ class HpackVarintDecoderTest : public RandomDecoderTest,
suffix_(Http2HexDecode(::testing::get<1>(GetParam()))),
prefix_length_(0) {}
- void DecodeExpectSuccess(quiche::QuicheStringPiece data,
+ void DecodeExpectSuccess(absl::string_view data,
uint32_t prefix_length,
uint64_t expected_value) {
Validator validator = [expected_value, this](
@@ -52,8 +52,7 @@ class HpackVarintDecoderTest : public RandomDecoderTest,
EXPECT_EQ(expected_value, decoder_.value());
}
- void DecodeExpectError(quiche::QuicheStringPiece data,
- uint32_t prefix_length) {
+ void DecodeExpectError(absl::string_view data, uint32_t prefix_length) {
Validator validator = [](const DecodeBuffer& /*db*/,
DecodeStatus status) -> AssertionResult {
VERIFY_EQ(DecodeStatus::kDecodeError, status);
@@ -64,7 +63,7 @@ class HpackVarintDecoderTest : public RandomDecoderTest,
}
private:
- AssertionResult Decode(quiche::QuicheStringPiece data,
+ AssertionResult Decode(absl::string_view data,
uint32_t prefix_length,
const Validator validator) {
prefix_length_ = prefix_length;
@@ -261,7 +260,7 @@ struct {
};
TEST_P(HpackVarintDecoderTest, Success) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kSuccessTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kSuccessTestData); ++i) {
DecodeExpectSuccess(Http2HexDecode(kSuccessTestData[i].data),
kSuccessTestData[i].prefix_length,
kSuccessTestData[i].expected_value);
@@ -302,7 +301,7 @@ struct {
{"ff80feffffffffffffff8100", 8}};
TEST_P(HpackVarintDecoderTest, Error) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kErrorTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kErrorTestData); ++i) {
DecodeExpectError(Http2HexDecode(kErrorTestData[i].data),
kErrorTestData[i].prefix_length);
}
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc
index 22de704c55f..979ffc56658 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder_test.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -30,7 +30,7 @@ struct {
// Encode integers that fit in the prefix.
TEST(HpackVarintEncoderTest, Short) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kShortTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kShortTestData); ++i) {
std::string output;
HpackVarintEncoder::Encode(kShortTestData[i].high_bits,
kShortTestData[i].prefix_length,
@@ -103,7 +103,7 @@ struct {
TEST(HpackVarintEncoderTest, Long) {
// Test encoding byte by byte, also test encoding in
// a single ResumeEncoding() call.
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kLongTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kLongTestData); ++i) {
std::string expected_encoding =
Http2HexDecode(kLongTestData[i].expected_encoding);
@@ -130,7 +130,7 @@ struct {
// Make sure that the encoder outputs the last byte even when it is zero. This
// happens exactly when encoding the value 2^prefix_length - 1.
TEST(HpackVarintEncoderTest, LastByteIsZero) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kLastByteIsZeroTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kLastByteIsZeroTestData); ++i) {
std::string output;
HpackVarintEncoder::Encode(kLastByteIsZeroTestData[i].high_bits,
kLastByteIsZeroTestData[i].prefix_length,
diff --git a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc
index 77e5fe8e451..957683f5b3c 100644
--- a/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/hpack/varint/hpack_varint_round_trip_test.cc
@@ -13,13 +13,13 @@
#include <set>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/tools/random_decoder_test.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionFailure;
using ::testing::AssertionSuccess;
@@ -292,7 +292,7 @@ TEST_F(HpackVarintRoundTripTest, Encode) {
}
TEST_F(HpackVarintRoundTripTest, FromSpec1337) {
- DecodeBuffer b(quiche::QuicheStringPiece("\x1f\x9a\x0a"));
+ DecodeBuffer b(absl::string_view("\x1f\x9a\x0a"));
uint32_t prefix_length = 5;
uint8_t p = b.DecodeUInt8();
EXPECT_EQ(1u, b.Offset());
diff --git a/chromium/net/third_party/quiche/src/http2/http2_constants.cc b/chromium/net/third_party/quiche/src/http2/http2_constants.cc
index daed778e718..08351c44b24 100644
--- a/chromium/net/third_party/quiche/src/http2/http2_constants.cc
+++ b/chromium/net/third_party/quiche/src/http2/http2_constants.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/http2/http2_constants.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -47,8 +47,7 @@ std::string Http2FrameFlagsToString(Http2FrameType type, uint8_t flags) {
std::string s;
// Closure to append flag name |v| to the std::string |s|,
// and to clear |bit| from |flags|.
- auto append_and_clear = [&s, &flags](quiche::QuicheStringPiece v,
- uint8_t bit) {
+ auto append_and_clear = [&s, &flags](absl::string_view v, uint8_t bit) {
if (!s.empty()) {
s.push_back('|');
}
diff --git a/chromium/net/third_party/quiche/src/http2/http2_constants_test.cc b/chromium/net/third_party/quiche/src/http2/http2_constants_test.cc
index 389c698ba31..807854e4a21 100644
--- a/chromium/net/third_party/quiche/src/http2/http2_constants_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/http2_constants_test.cc
@@ -5,12 +5,13 @@
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
namespace {
-class Http2ConstantsTest : public testing::Test {};
+class Http2ConstantsTest : public QuicheTest {};
TEST(Http2ConstantsTest, Http2FrameType) {
EXPECT_EQ(Http2FrameType::DATA, static_cast<Http2FrameType>(0));
diff --git a/chromium/net/third_party/quiche/src/http2/http2_structures_test.cc b/chromium/net/third_party/quiche/src/http2/http2_structures_test.cc
index 20dd0ec1cdc..6b060cf6e77 100644
--- a/chromium/net/third_party/quiche/src/http2/http2_structures_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/http2_structures_test.cc
@@ -24,6 +24,7 @@
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionResult;
using ::testing::AssertionSuccess;
@@ -151,8 +152,7 @@ TEST(Http2FrameHeaderTest, Eq) {
// The tests of the valid frame types include EXPECT_DEBUG_DEATH, which is
// quite slow, so using value parameterized tests in order to allow sharding.
class Http2FrameHeaderTypeAndFlagTest
- : public ::testing::TestWithParam<
- std::tuple<Http2FrameType, Http2FrameFlag>> {
+ : public QuicheTestWithParam<std::tuple<Http2FrameType, Http2FrameFlag>> {
protected:
Http2FrameHeaderTypeAndFlagTest()
: type_(std::get<0>(GetParam())), flags_(std::get<1>(GetParam())) {
diff --git a/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils.h b/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils.h
index f14d93ae87f..ec421b7efb9 100644
--- a/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils.h
+++ b/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils.h
@@ -9,8 +9,8 @@
#include <type_traits>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/http2/platform/impl/http2_string_utils_impl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
@@ -28,15 +28,15 @@ inline std::string Http2HexEncode(const void* bytes, size_t size) {
return Http2HexEncodeImpl(bytes, size);
}
-inline std::string Http2HexDecode(quiche::QuicheStringPiece data) {
+inline std::string Http2HexDecode(absl::string_view data) {
return Http2HexDecodeImpl(data);
}
-inline std::string Http2HexDump(quiche::QuicheStringPiece data) {
+inline std::string Http2HexDump(absl::string_view data) {
return Http2HexDumpImpl(data);
}
-inline std::string Http2HexEscape(quiche::QuicheStringPiece data) {
+inline std::string Http2HexEscape(absl::string_view data) {
return Http2HexEscapeImpl(data);
}
diff --git a/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils_test.cc b/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils_test.cc
index bff55ccd541..5cb019d2637 100644
--- a/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/platform/api/http2_string_utils_test.cc
@@ -6,9 +6,9 @@
#include <cstdint>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -23,7 +23,7 @@ TEST(Http2StringUtilsTest, Http2StrAppend) {
// Single string-like argument.
const char kFoo[] = "foo";
const std::string string_foo(kFoo);
- const quiche::QuicheStringPiece stringpiece_foo(string_foo);
+ const absl::string_view stringpiece_foo(string_foo);
Http2StrAppend(&output, kFoo);
EXPECT_EQ("foo", output);
Http2StrAppend(&output, string_foo);
@@ -39,7 +39,7 @@ TEST(Http2StringUtilsTest, Http2StrAppend) {
// Two string-like arguments.
const char kBar[] = "bar";
- const quiche::QuicheStringPiece stringpiece_bar(kBar);
+ const absl::string_view stringpiece_bar(kBar);
const std::string string_bar(kBar);
Http2StrAppend(&output, kFoo, kBar);
EXPECT_EQ("foobar", output);
diff --git a/chromium/net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h b/chromium/net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h
index 4a616f7f6ab..107b49b1170 100644
--- a/chromium/net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h
+++ b/chromium/net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h
@@ -5,13 +5,7 @@
// an AssertionResult if the condition is not satisfied.
#include "net/http2/platform/impl/http2_test_helpers_impl.h"
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Weverything"
-
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h" // For AssertionSuccess
-
-#pragma clang diagnostic pop
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#define VERIFY_AND_RETURN_SUCCESS(expression) \
{ \
diff --git a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.cc b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.cc
index 7d5c2180b23..bb975e26d89 100644
--- a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.cc
+++ b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.cc
@@ -6,12 +6,11 @@
#include <type_traits>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionFailure;
using ::testing::AssertionResult;
@@ -52,14 +51,14 @@ FrameParts::FrameParts(const Http2FrameHeader& header) : frame_header_(header) {
}
FrameParts::FrameParts(const Http2FrameHeader& header,
- quiche::QuicheStringPiece payload)
+ absl::string_view payload)
: FrameParts(header) {
HTTP2_VLOG(1) << "FrameParts with payload.size() = " << payload.size();
this->payload_.append(payload.data(), payload.size());
opt_payload_length_ = payload.size();
}
FrameParts::FrameParts(const Http2FrameHeader& header,
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
size_t total_pad_length)
: FrameParts(header, payload) {
HTTP2_VLOG(1) << "FrameParts with total_pad_length=" << total_pad_length;
@@ -118,8 +117,8 @@ void FrameParts::SetTotalPadLength(size_t total_pad_length) {
}
}
-void FrameParts::SetAltSvcExpected(quiche::QuicheStringPiece origin,
- quiche::QuicheStringPiece value) {
+void FrameParts::SetAltSvcExpected(absl::string_view origin,
+ absl::string_view value) {
altsvc_origin_.append(origin.data(), origin.size());
altsvc_value_.append(value.data(), value.size());
opt_altsvc_origin_length_ = origin.size();
@@ -141,7 +140,7 @@ void FrameParts::OnDataPayload(const char* data, size_t len) {
HTTP2_VLOG(1) << "OnDataPayload: len=" << len
<< "; frame_header_: " << frame_header_;
ASSERT_TRUE(InFrameOfType(Http2FrameType::DATA)) << *this;
- ASSERT_TRUE(AppendString(quiche::QuicheStringPiece(data, len), &payload_,
+ ASSERT_TRUE(AppendString(absl::string_view(data, len), &payload_,
&opt_payload_length_));
}
@@ -173,7 +172,7 @@ void FrameParts::OnHpackFragment(const char* data, size_t len) {
ASSERT_TRUE(got_start_callback_);
ASSERT_FALSE(got_end_callback_);
ASSERT_TRUE(FrameCanHaveHpackPayload(frame_header_)) << *this;
- ASSERT_TRUE(AppendString(quiche::QuicheStringPiece(data, len), &payload_,
+ ASSERT_TRUE(AppendString(absl::string_view(data, len), &payload_,
&opt_payload_length_));
}
@@ -217,8 +216,8 @@ void FrameParts::OnPadding(const char* pad, size_t skipped_length) {
HTTP2_VLOG(1) << "OnPadding: skipped_length=" << skipped_length;
ASSERT_TRUE(InPaddedFrame()) << *this;
ASSERT_TRUE(opt_pad_length_);
- ASSERT_TRUE(AppendString(quiche::QuicheStringPiece(pad, skipped_length),
- &padding_, &opt_pad_length_));
+ ASSERT_TRUE(AppendString(absl::string_view(pad, skipped_length), &padding_,
+ &opt_pad_length_));
}
void FrameParts::OnRstStream(const Http2FrameHeader& header,
@@ -314,7 +313,7 @@ void FrameParts::OnGoAwayStart(const Http2FrameHeader& header,
void FrameParts::OnGoAwayOpaqueData(const char* data, size_t len) {
HTTP2_VLOG(1) << "OnGoAwayOpaqueData: len=" << len;
ASSERT_TRUE(InFrameOfType(Http2FrameType::GOAWAY)) << *this;
- ASSERT_TRUE(AppendString(quiche::QuicheStringPiece(data, len), &payload_,
+ ASSERT_TRUE(AppendString(absl::string_view(data, len), &payload_,
&opt_payload_length_));
}
@@ -349,14 +348,14 @@ void FrameParts::OnAltSvcStart(const Http2FrameHeader& header,
void FrameParts::OnAltSvcOriginData(const char* data, size_t len) {
HTTP2_VLOG(1) << "OnAltSvcOriginData: len=" << len;
ASSERT_TRUE(InFrameOfType(Http2FrameType::ALTSVC)) << *this;
- ASSERT_TRUE(AppendString(quiche::QuicheStringPiece(data, len),
- &altsvc_origin_, &opt_altsvc_origin_length_));
+ ASSERT_TRUE(AppendString(absl::string_view(data, len), &altsvc_origin_,
+ &opt_altsvc_origin_length_));
}
void FrameParts::OnAltSvcValueData(const char* data, size_t len) {
HTTP2_VLOG(1) << "OnAltSvcValueData: len=" << len;
ASSERT_TRUE(InFrameOfType(Http2FrameType::ALTSVC)) << *this;
- ASSERT_TRUE(AppendString(quiche::QuicheStringPiece(data, len), &altsvc_value_,
+ ASSERT_TRUE(AppendString(absl::string_view(data, len), &altsvc_value_,
&opt_altsvc_value_length_));
}
@@ -379,7 +378,7 @@ void FrameParts::OnUnknownPayload(const char* data, size_t len) {
ASSERT_FALSE(IsSupportedHttp2FrameType(frame_header_.type)) << *this;
ASSERT_TRUE(got_start_callback_);
ASSERT_FALSE(got_end_callback_);
- ASSERT_TRUE(AppendString(quiche::QuicheStringPiece(data, len), &payload_,
+ ASSERT_TRUE(AppendString(absl::string_view(data, len), &payload_,
&opt_payload_length_));
}
@@ -507,10 +506,9 @@ AssertionResult FrameParts::InPaddedFrame() {
return AssertionSuccess();
}
-AssertionResult FrameParts::AppendString(
- quiche::QuicheStringPiece source,
- std::string* target,
- quiche::QuicheOptional<size_t>* opt_length) {
+AssertionResult FrameParts::AppendString(absl::string_view source,
+ std::string* target,
+ absl::optional<size_t>* opt_length) {
target->append(source.data(), source.size());
if (opt_length != nullptr) {
VERIFY_TRUE(*opt_length) << "Length is not set yet\n" << *this;
diff --git a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.h b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.h
index bd6d939a57a..349d499cbc9 100644
--- a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.h
+++ b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts.h
@@ -16,13 +16,13 @@
#include <string>
#include <vector>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -34,12 +34,12 @@ class FrameParts : public Http2FrameDecoderListener {
explicit FrameParts(const Http2FrameHeader& header);
// For use in tests where the expected frame has a variable size payload.
- FrameParts(const Http2FrameHeader& header, quiche::QuicheStringPiece payload);
+ FrameParts(const Http2FrameHeader& header, absl::string_view payload);
// For use in tests where the expected frame has a variable size payload
// and may be padded.
FrameParts(const Http2FrameHeader& header,
- quiche::QuicheStringPiece payload,
+ absl::string_view payload,
size_t total_pad_length);
// Copy constructor.
@@ -58,8 +58,7 @@ class FrameParts : public Http2FrameDecoderListener {
void SetTotalPadLength(size_t total_pad_length);
// Set the origin and value expected in an ALTSVC frame.
- void SetAltSvcExpected(quiche::QuicheStringPiece origin,
- quiche::QuicheStringPiece value);
+ void SetAltSvcExpected(absl::string_view origin, absl::string_view value);
// Http2FrameDecoderListener methods:
bool OnFrameHeader(const Http2FrameHeader& header) override;
@@ -115,78 +114,70 @@ class FrameParts : public Http2FrameDecoderListener {
const Http2FrameHeader& GetFrameHeader() const { return frame_header_; }
- quiche::QuicheOptional<Http2PriorityFields> GetOptPriority() const {
+ absl::optional<Http2PriorityFields> GetOptPriority() const {
return opt_priority_;
}
- quiche::QuicheOptional<Http2ErrorCode> GetOptRstStreamErrorCode() const {
+ absl::optional<Http2ErrorCode> GetOptRstStreamErrorCode() const {
return opt_rst_stream_error_code_;
}
- quiche::QuicheOptional<Http2PushPromiseFields> GetOptPushPromise() const {
+ absl::optional<Http2PushPromiseFields> GetOptPushPromise() const {
return opt_push_promise_;
}
- quiche::QuicheOptional<Http2PingFields> GetOptPing() const {
- return opt_ping_;
- }
- quiche::QuicheOptional<Http2GoAwayFields> GetOptGoaway() const {
- return opt_goaway_;
- }
- quiche::QuicheOptional<size_t> GetOptPadLength() const {
- return opt_pad_length_;
- }
- quiche::QuicheOptional<size_t> GetOptPayloadLength() const {
+ absl::optional<Http2PingFields> GetOptPing() const { return opt_ping_; }
+ absl::optional<Http2GoAwayFields> GetOptGoaway() const { return opt_goaway_; }
+ absl::optional<size_t> GetOptPadLength() const { return opt_pad_length_; }
+ absl::optional<size_t> GetOptPayloadLength() const {
return opt_payload_length_;
}
- quiche::QuicheOptional<size_t> GetOptMissingLength() const {
+ absl::optional<size_t> GetOptMissingLength() const {
return opt_missing_length_;
}
- quiche::QuicheOptional<size_t> GetOptAltsvcOriginLength() const {
+ absl::optional<size_t> GetOptAltsvcOriginLength() const {
return opt_altsvc_origin_length_;
}
- quiche::QuicheOptional<size_t> GetOptAltsvcValueLength() const {
+ absl::optional<size_t> GetOptAltsvcValueLength() const {
return opt_altsvc_value_length_;
}
- quiche::QuicheOptional<size_t> GetOptWindowUpdateIncrement() const {
+ absl::optional<size_t> GetOptWindowUpdateIncrement() const {
return opt_window_update_increment_;
}
bool GetHasFrameSizeError() const { return has_frame_size_error_; }
- void SetOptPriority(
- quiche::QuicheOptional<Http2PriorityFields> opt_priority) {
+ void SetOptPriority(absl::optional<Http2PriorityFields> opt_priority) {
opt_priority_ = opt_priority;
}
void SetOptRstStreamErrorCode(
- quiche::QuicheOptional<Http2ErrorCode> opt_rst_stream_error_code) {
+ absl::optional<Http2ErrorCode> opt_rst_stream_error_code) {
opt_rst_stream_error_code_ = opt_rst_stream_error_code;
}
void SetOptPushPromise(
- quiche::QuicheOptional<Http2PushPromiseFields> opt_push_promise) {
+ absl::optional<Http2PushPromiseFields> opt_push_promise) {
opt_push_promise_ = opt_push_promise;
}
- void SetOptPing(quiche::QuicheOptional<Http2PingFields> opt_ping) {
+ void SetOptPing(absl::optional<Http2PingFields> opt_ping) {
opt_ping_ = opt_ping;
}
- void SetOptGoaway(quiche::QuicheOptional<Http2GoAwayFields> opt_goaway) {
+ void SetOptGoaway(absl::optional<Http2GoAwayFields> opt_goaway) {
opt_goaway_ = opt_goaway;
}
- void SetOptPadLength(quiche::QuicheOptional<size_t> opt_pad_length) {
+ void SetOptPadLength(absl::optional<size_t> opt_pad_length) {
opt_pad_length_ = opt_pad_length;
}
- void SetOptPayloadLength(quiche::QuicheOptional<size_t> opt_payload_length) {
+ void SetOptPayloadLength(absl::optional<size_t> opt_payload_length) {
opt_payload_length_ = opt_payload_length;
}
- void SetOptMissingLength(quiche::QuicheOptional<size_t> opt_missing_length) {
+ void SetOptMissingLength(absl::optional<size_t> opt_missing_length) {
opt_missing_length_ = opt_missing_length;
}
void SetOptAltsvcOriginLength(
- quiche::QuicheOptional<size_t> opt_altsvc_origin_length) {
+ absl::optional<size_t> opt_altsvc_origin_length) {
opt_altsvc_origin_length_ = opt_altsvc_origin_length;
}
- void SetOptAltsvcValueLength(
- quiche::QuicheOptional<size_t> opt_altsvc_value_length) {
+ void SetOptAltsvcValueLength(absl::optional<size_t> opt_altsvc_value_length) {
opt_altsvc_value_length_ = opt_altsvc_value_length;
}
void SetOptWindowUpdateIncrement(
- quiche::QuicheOptional<size_t> opt_window_update_increment) {
+ absl::optional<size_t> opt_window_update_increment) {
opt_window_update_increment_ = opt_window_update_increment;
}
@@ -216,10 +207,9 @@ class FrameParts : public Http2FrameDecoderListener {
// Append source to target. If opt_length is not nullptr, then verifies that
// the optional has a value (i.e. that the necessary On*Start method has been
// called), and that target is not longer than opt_length->value().
- ::testing::AssertionResult AppendString(
- quiche::QuicheStringPiece source,
- std::string* target,
- quiche::QuicheOptional<size_t>* opt_length);
+ ::testing::AssertionResult AppendString(absl::string_view source,
+ std::string* target,
+ absl::optional<size_t>* opt_length);
const Http2FrameHeader frame_header_;
@@ -228,19 +218,19 @@ class FrameParts : public Http2FrameDecoderListener {
std::string altsvc_origin_;
std::string altsvc_value_;
- quiche::QuicheOptional<Http2PriorityFields> opt_priority_;
- quiche::QuicheOptional<Http2ErrorCode> opt_rst_stream_error_code_;
- quiche::QuicheOptional<Http2PushPromiseFields> opt_push_promise_;
- quiche::QuicheOptional<Http2PingFields> opt_ping_;
- quiche::QuicheOptional<Http2GoAwayFields> opt_goaway_;
+ absl::optional<Http2PriorityFields> opt_priority_;
+ absl::optional<Http2ErrorCode> opt_rst_stream_error_code_;
+ absl::optional<Http2PushPromiseFields> opt_push_promise_;
+ absl::optional<Http2PingFields> opt_ping_;
+ absl::optional<Http2GoAwayFields> opt_goaway_;
- quiche::QuicheOptional<size_t> opt_pad_length_;
- quiche::QuicheOptional<size_t> opt_payload_length_;
- quiche::QuicheOptional<size_t> opt_missing_length_;
- quiche::QuicheOptional<size_t> opt_altsvc_origin_length_;
- quiche::QuicheOptional<size_t> opt_altsvc_value_length_;
+ absl::optional<size_t> opt_pad_length_;
+ absl::optional<size_t> opt_payload_length_;
+ absl::optional<size_t> opt_missing_length_;
+ absl::optional<size_t> opt_altsvc_origin_length_;
+ absl::optional<size_t> opt_altsvc_value_length_;
- quiche::QuicheOptional<size_t> opt_window_update_increment_;
+ absl::optional<size_t> opt_window_update_increment_;
bool has_frame_size_error_ = false;
diff --git a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector.cc b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector.cc
index 083bbe1bc6b..b5fdcb79c18 100644
--- a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector.cc
+++ b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector.cc
@@ -6,9 +6,9 @@
#include <utility>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/http2_structures_test_util.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.cc b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.cc
index a7c3eccb171..3969b5b24e6 100644
--- a/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.cc
+++ b/chromium/net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/http2/test_tools/frame_parts_collector_listener.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.cc b/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.cc
index df2036475ec..5fb2f7d3b5d 100644
--- a/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.cc
+++ b/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.cc
@@ -16,7 +16,7 @@ Http2Random::Http2Random() {
HTTP2_LOG(INFO) << "Initialized test RNG with the following key: " << Key();
}
-Http2Random::Http2Random(quiche::QuicheStringPiece key) {
+Http2Random::Http2Random(absl::string_view key) {
std::string decoded_key = Http2HexDecode(key);
CHECK_EQ(sizeof(key_), decoded_key.size());
memcpy(key_, decoded_key.data(), sizeof(key_));
@@ -58,9 +58,8 @@ double Http2Random::RandDouble() {
return value.f - 1.0;
}
-std::string Http2Random::RandStringWithAlphabet(
- int length,
- quiche::QuicheStringPiece alphabet) {
+std::string Http2Random::RandStringWithAlphabet(int length,
+ absl::string_view alphabet) {
std::string result;
result.resize(length);
for (int i = 0; i < length; i++) {
diff --git a/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.h b/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.h
index 9f046a1c300..4fe2a51fd49 100644
--- a/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.h
+++ b/chromium/net/third_party/quiche/src/http2/test_tools/http2_random.h
@@ -11,7 +11,7 @@
#include <random>
#include <string>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
namespace http2 {
namespace test {
@@ -28,7 +28,7 @@ class Http2Random {
// Reproducible random number generation: by using the same key, the same
// sequence of results is obtained.
- explicit Http2Random(quiche::QuicheStringPiece key);
+ explicit Http2Random(absl::string_view key);
std::string Key() const;
void FillRandom(void* buffer, size_t buffer_size);
@@ -67,8 +67,7 @@ class Http2Random {
// Return a random string consisting of the characters from the specified
// alphabet.
- std::string RandStringWithAlphabet(int length,
- quiche::QuicheStringPiece alphabet);
+ std::string RandStringWithAlphabet(int length, absl::string_view alphabet);
// STL UniformRandomNumberGenerator implementation.
using result_type = uint64_t;
diff --git a/chromium/net/third_party/quiche/src/http2/test_tools/http2_random_test.cc b/chromium/net/third_party/quiche/src/http2/test_tools/http2_random_test.cc
index c9490bdb2ba..55d627fb517 100644
--- a/chromium/net/third_party/quiche/src/http2/test_tools/http2_random_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/test_tools/http2_random_test.cc
@@ -2,8 +2,7 @@
#include <set>
-#include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.cc b/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.cc
index 1f1af169551..2ba87788989 100644
--- a/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.cc
+++ b/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.cc
@@ -11,8 +11,8 @@
#include <netinet/in.h> // for htonl, htons
#endif
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_string_utils.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -30,12 +30,12 @@ Http2FrameBuilder::Http2FrameBuilder(const Http2FrameHeader& v) {
Append(v);
}
-void Http2FrameBuilder::Append(quiche::QuicheStringPiece s) {
+void Http2FrameBuilder::Append(absl::string_view s) {
Http2StrAppend(&buffer_, s);
}
void Http2FrameBuilder::AppendBytes(const void* data, uint32_t num_bytes) {
- Append(quiche::QuicheStringPiece(static_cast<const char*>(data), num_bytes));
+ Append(absl::string_view(static_cast<const char*>(data), num_bytes));
}
void Http2FrameBuilder::AppendZeroes(size_t num_zero_bytes) {
@@ -143,7 +143,7 @@ void Http2FrameBuilder::Append(const Http2AltSvcFields& v) {
// Methods for changing existing buffer contents.
-void Http2FrameBuilder::WriteAt(quiche::QuicheStringPiece s, size_t offset) {
+void Http2FrameBuilder::WriteAt(absl::string_view s, size_t offset) {
ASSERT_LE(offset, buffer_.size());
size_t len = offset + s.size();
if (len > buffer_.size()) {
@@ -157,8 +157,7 @@ void Http2FrameBuilder::WriteAt(quiche::QuicheStringPiece s, size_t offset) {
void Http2FrameBuilder::WriteBytesAt(const void* data,
uint32_t num_bytes,
size_t offset) {
- WriteAt(quiche::QuicheStringPiece(static_cast<const char*>(data), num_bytes),
- offset);
+ WriteAt(absl::string_view(static_cast<const char*>(data), num_bytes), offset);
}
void Http2FrameBuilder::WriteUInt24At(uint32_t value, size_t offset) {
diff --git a/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.h b/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.h
index 724c2b2e15e..a4062ded488 100644
--- a/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.h
+++ b/chromium/net/third_party/quiche/src/http2/tools/http2_frame_builder.h
@@ -18,9 +18,9 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace http2 {
namespace test {
@@ -39,7 +39,7 @@ class Http2FrameBuilder {
// Methods for appending to the end of the buffer.
// Append a sequence of bytes from various sources.
- void Append(quiche::QuicheStringPiece s);
+ void Append(absl::string_view s);
void AppendBytes(const void* data, uint32_t num_bytes);
// Append an array of type T[N] to the string. Intended for tests with arrays
@@ -80,7 +80,7 @@ class Http2FrameBuilder {
// Methods for changing existing buffer contents (mostly focused on updating
// the payload length).
- void WriteAt(quiche::QuicheStringPiece s, size_t offset);
+ void WriteAt(absl::string_view s, size_t offset);
void WriteBytesAt(const void* data, uint32_t num_bytes, size_t offset);
void WriteUInt24At(uint32_t value, size_t offset);
diff --git a/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.cc b/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.cc
index 5842bd089e7..4c7d71ab5d6 100644
--- a/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.cc
@@ -9,12 +9,12 @@
#include <algorithm>
#include <memory>
-#include "testing/gtest/include/gtest/gtest.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
using ::testing::AssertionFailure;
using ::testing::AssertionResult;
diff --git a/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.h b/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.h
index 60a9081f3da..4e87c49ea1b 100644
--- a/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.h
+++ b/chromium/net/third_party/quiche/src/http2/tools/random_decoder_test.h
@@ -17,13 +17,13 @@
#include <memory>
#include <type_traits>
-#include "testing/gtest/include/gtest/gtest.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_logging.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_test_helpers.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace http2 {
namespace test {
@@ -31,9 +31,8 @@ namespace test {
// Some helpers.
template <typename T, size_t N>
-quiche::QuicheStringPiece ToStringPiece(T (&data)[N]) {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(data),
- N * sizeof(T));
+absl::string_view ToStringPiece(T (&data)[N]) {
+ return absl::string_view(reinterpret_cast<const char*>(data), N * sizeof(T));
}
// Overwrite the enum with some random value, probably not a valid value for
@@ -55,7 +54,7 @@ void CorruptEnum(T* out, Http2Random* rng) {
// Base class for tests of the ability to decode a sequence of bytes with
// various boundaries between the DecodeBuffers provided to the decoder.
-class RandomDecoderTest : public ::testing::Test {
+class RandomDecoderTest : public QuicheTest {
public:
// SelectSize returns the size of the next DecodeBuffer to be passed to the
// decoder. Note that RandomDecoderTest allows that size to be zero, though
diff --git a/chromium/net/third_party/quiche/src/http2/tools/random_util.cc b/chromium/net/third_party/quiche/src/http2/tools/random_util.cc
index a0af07a4eae..01571ed2780 100644
--- a/chromium/net/third_party/quiche/src/http2/tools/random_util.cc
+++ b/chromium/net/third_party/quiche/src/http2/tools/random_util.cc
@@ -12,7 +12,7 @@ namespace test {
// Here "word" means something that starts with a lower-case letter, and has
// zero or more additional characters that are numbers or lower-case letters.
std::string GenerateHttp2HeaderName(size_t len, Http2Random* rng) {
- quiche::QuicheStringPiece alpha_lc = "abcdefghijklmnopqrstuvwxyz";
+ absl::string_view alpha_lc = "abcdefghijklmnopqrstuvwxyz";
// If the name is short, just make it one word.
if (len < 8) {
return rng->RandStringWithAlphabet(len, alpha_lc);
@@ -20,8 +20,7 @@ std::string GenerateHttp2HeaderName(size_t len, Http2Random* rng) {
// If the name is longer, ensure it starts with a word, and after that may
// have any character in alphanumdash_lc. 4 is arbitrary, could be as low
// as 1.
- quiche::QuicheStringPiece alphanumdash_lc =
- "abcdefghijklmnopqrstuvwxyz0123456789-";
+ absl::string_view alphanumdash_lc = "abcdefghijklmnopqrstuvwxyz0123456789-";
return rng->RandStringWithAlphabet(4, alpha_lc) +
rng->RandStringWithAlphabet(len - 4, alphanumdash_lc);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_batch_writer_buffer.h b/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_batch_writer_buffer.h
index b55e63c1147..88183f366b3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_batch_writer_buffer.h
+++ b/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_batch_writer_buffer.h
@@ -5,10 +5,10 @@
#ifndef QUICHE_QUIC_PLATFORM_IMPL_BATCH_WRITER_QUIC_BATCH_WRITER_BUFFER_H_
#define QUICHE_QUIC_PLATFORM_IMPL_BATCH_WRITER_QUIC_BATCH_WRITER_BUFFER_H_
+#include "absl/base/optimization.h"
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_linux_socket_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_packet_writer.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_aligned.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
@@ -86,7 +86,7 @@ class QUIC_EXPORT_PRIVATE QuicBatchWriterBuffer {
// Whether the invariants of the buffer are upheld. For debug & test only.
bool Invariants() const;
const char* buffer_end() const { return buffer_ + sizeof(buffer_); }
- QUIC_CACHELINE_ALIGNED char buffer_[kBufferSize];
+ ABSL_CACHELINE_ALIGNED char buffer_[kBufferSize];
QuicCircularDeque<BufferedWrite> buffered_writes_;
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_sendmmsg_batch_writer.h b/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_sendmmsg_batch_writer.h
index 26a728e676a..3b80395412a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_sendmmsg_batch_writer.h
+++ b/chromium/net/third_party/quiche/src/quic/core/batch_writer/quic_sendmmsg_batch_writer.h
@@ -25,7 +25,7 @@ class QUIC_EXPORT_PRIVATE QuicSendmmsgBatchWriter : public QuicUdpBatchWriter {
FlushImplResult FlushImpl() override;
protected:
- typedef QuicMMsgHdr::ControlBufferInitializer CmsgBuilder;
+ using CmsgBuilder = QuicMMsgHdr::ControlBufferInitializer;
FlushImplResult InternalFlushImpl(size_t cmsg_space,
const CmsgBuilder& cmsg_builder);
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/chlo_extractor.cc b/chromium/net/third_party/quiche/src/quic/core/chlo_extractor.cc
index 1605b264c63..851967a977f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/chlo_extractor.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/chlo_extractor.cc
@@ -4,6 +4,8 @@
#include "net/third_party/quiche/src/quic/core/chlo_extractor.h"
+#include "absl/strings/match.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
@@ -14,7 +16,6 @@
#include "net/third_party/quiche/src/quic/core/frames/quic_ack_frequency_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -39,10 +40,9 @@ class ChloFramerVisitor : public QuicFramerVisitorInterface,
const QuicVersionNegotiationPacket& /*packet*/) override {}
void OnRetryPacket(QuicConnectionId /*original_connection_id*/,
QuicConnectionId /*new_connection_id*/,
- quiche::QuicheStringPiece /*retry_token*/,
- quiche::QuicheStringPiece /*retry_integrity_tag*/,
- quiche::QuicheStringPiece /*retry_without_tag*/) override {
- }
+ absl::string_view /*retry_token*/,
+ absl::string_view /*retry_integrity_tag*/,
+ absl::string_view /*retry_without_tag*/) override {}
bool OnUnauthenticatedPublicHeader(const QuicPacketHeader& header) override;
bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
void OnDecryptedPacket(EncryptionLevel /*level*/) override {}
@@ -83,13 +83,18 @@ class ChloFramerVisitor : public QuicFramerVisitorInterface,
bool IsValidStatelessResetToken(QuicUint128 token) const override;
void OnAuthenticatedIetfStatelessResetPacket(
const QuicIetfStatelessResetPacket& /*packet*/) override {}
+ void OnKeyUpdate(KeyUpdateReason /*reason*/) override;
+ void OnDecryptedFirstPacketInKeyPhase() override;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
// CryptoFramerVisitorInterface implementation.
void OnError(CryptoFramer* framer) override;
void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
// Shared implementation between OnStreamFrame and OnCryptoFrame.
- bool OnHandshakeData(quiche::QuicheStringPiece data);
+ bool OnHandshakeData(absl::string_view data);
bool found_chlo() { return found_chlo_; }
bool chlo_contains_tags() { return chlo_contains_tags_; }
@@ -153,10 +158,10 @@ bool ChloFramerVisitor::OnStreamFrame(const QuicStreamFrame& frame) {
// CHLO will be sent in CRYPTO frames in v47 and above.
return false;
}
- quiche::QuicheStringPiece data(frame.data_buffer, frame.data_length);
+ absl::string_view data(frame.data_buffer, frame.data_length);
if (QuicUtils::IsCryptoStreamId(framer_->transport_version(),
frame.stream_id) &&
- frame.offset == 0 && quiche::QuicheTextUtils::StartsWith(data, "CHLO")) {
+ frame.offset == 0 && absl::StartsWith(data, "CHLO")) {
return OnHandshakeData(data);
}
return true;
@@ -167,14 +172,14 @@ bool ChloFramerVisitor::OnCryptoFrame(const QuicCryptoFrame& frame) {
// CHLO will be in stream frames before v47.
return false;
}
- quiche::QuicheStringPiece data(frame.data_buffer, frame.data_length);
- if (frame.offset == 0 && quiche::QuicheTextUtils::StartsWith(data, "CHLO")) {
+ absl::string_view data(frame.data_buffer, frame.data_length);
+ if (frame.offset == 0 && absl::StartsWith(data, "CHLO")) {
return OnHandshakeData(data);
}
return true;
}
-bool ChloFramerVisitor::OnHandshakeData(quiche::QuicheStringPiece data) {
+bool ChloFramerVisitor::OnHandshakeData(absl::string_view data) {
CryptoFramer crypto_framer;
crypto_framer.set_visitor(this);
if (!crypto_framer.ProcessInput(data)) {
@@ -311,6 +316,20 @@ bool ChloFramerVisitor::OnStreamsBlockedFrame(
return true;
}
+void ChloFramerVisitor::OnKeyUpdate(KeyUpdateReason /*reason*/) {}
+
+void ChloFramerVisitor::OnDecryptedFirstPacketInKeyPhase() {}
+
+std::unique_ptr<QuicDecrypter>
+ChloFramerVisitor::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ return nullptr;
+}
+
+std::unique_ptr<QuicEncrypter>
+ChloFramerVisitor::CreateCurrentOneRttEncrypter() {
+ return nullptr;
+}
+
void ChloFramerVisitor::OnError(CryptoFramer* /*framer*/) {}
void ChloFramerVisitor::OnHandshakeMessage(
diff --git a/chromium/net/third_party/quiche/src/quic/core/chlo_extractor_test.cc b/chromium/net/third_party/quiche/src/quic/core/chlo_extractor_test.cc
index 1b6a6164234..f051b9a821f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/chlo_extractor_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/chlo_extractor_test.cc
@@ -8,14 +8,14 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/first_flight.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -33,7 +33,7 @@ class TestDelegate : public ChloExtractor::Delegate {
version_ = version;
connection_id_ = connection_id;
chlo_ = chlo.DebugString();
- quiche::QuicheStringPiece alpn_value;
+ absl::string_view alpn_value;
if (chlo.GetStringPiece(kALPN, &alpn_value)) {
alpn_ = std::string(alpn_value);
}
@@ -55,7 +55,7 @@ class ChloExtractorTest : public QuicTestWithParam<ParsedQuicVersion> {
public:
ChloExtractorTest() : version_(GetParam()) {}
- void MakePacket(quiche::QuicheStringPiece data,
+ void MakePacket(absl::string_view data,
bool munge_offset,
bool munge_stream_id) {
QuicPacketHeader header;
@@ -95,7 +95,7 @@ class ChloExtractorTest : public QuicTestWithParam<ParsedQuicVersion> {
EXPECT_TRUE(packet != nullptr);
size_t encrypted_length =
framer.EncryptPayload(ENCRYPTION_INITIAL, header.packet_number, *packet,
- buffer_, QUICHE_ARRAYSIZE(buffer_));
+ buffer_, ABSL_ARRAYSIZE(buffer_));
ASSERT_NE(0u, encrypted_length);
packet_ = std::make_unique<QuicEncryptedPacket>(buffer_, encrypted_length);
EXPECT_TRUE(packet_ != nullptr);
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bandwidth_sampler.h b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bandwidth_sampler.h
index f32eabf0694..2d06560f2bc 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bandwidth_sampler.h
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bandwidth_sampler.h
@@ -129,11 +129,10 @@ class QUIC_EXPORT_PRIVATE MaxAckHeightTracker {
private:
// Tracks the maximum number of bytes acked faster than the estimated
// bandwidth.
- typedef WindowedFilter<QuicByteCount,
- MaxFilter<QuicByteCount>,
- QuicRoundTripCount,
- QuicRoundTripCount>
- MaxAckHeightFilter;
+ using MaxAckHeightFilter = WindowedFilter<QuicByteCount,
+ MaxFilter<QuicByteCount>,
+ QuicRoundTripCount,
+ QuicRoundTripCount>;
MaxAckHeightFilter max_ack_height_filter_;
// The time this aggregation started and the number of bytes acked during it.
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.cc
index 605318589e3..3e3937a4e52 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.cc
@@ -148,6 +148,18 @@ void Bbr2NetworkModel::OnCongestionEventStart(
loss_events_in_round_++;
}
+ if (GetQuicReloadableFlag(quic_bbr2_startup_loss_exit_use_max_delivered) &&
+ congestion_event->bytes_acked > 0 &&
+ congestion_event->last_packet_send_state.is_valid &&
+ total_bytes_acked() >
+ congestion_event->last_packet_send_state.total_bytes_acked) {
+ QuicByteCount bytes_delivered =
+ total_bytes_acked() -
+ congestion_event->last_packet_send_state.total_bytes_acked;
+ max_bytes_delivered_in_round_ =
+ std::max(max_bytes_delivered_in_round_, bytes_delivered);
+ }
+
// |bandwidth_latest_| and |inflight_latest_| only increased within a round.
if (sample.sample_max_bandwidth > bandwidth_latest_) {
bandwidth_latest_ = sample.sample_max_bandwidth;
@@ -243,21 +255,29 @@ bool Bbr2NetworkModel::IsCongestionWindowLimited(
}
bool Bbr2NetworkModel::IsInflightTooHigh(
- const Bbr2CongestionEvent& congestion_event) const {
+ const Bbr2CongestionEvent& congestion_event,
+ int64_t max_loss_events) const {
const SendTimeState& send_state = congestion_event.last_packet_send_state;
if (!send_state.is_valid) {
// Not enough information.
return false;
}
+ if (loss_events_in_round() < max_loss_events) {
+ return false;
+ }
+
const QuicByteCount inflight_at_send = BytesInFlight(send_state);
// TODO(wub): Consider total_bytes_lost() - send_state.total_bytes_lost, which
// is the total bytes lost when the largest numbered packet was inflight.
// bytes_lost_in_round_, OTOH, is the total bytes lost in the "current" round.
const QuicByteCount bytes_lost_in_round = bytes_lost_in_round_;
- QUIC_DVLOG(3) << "IsInflightTooHigh: bytes_lost_in_round:"
- << bytes_lost_in_round << ", lost_in_round_threshold:"
+ QUIC_DVLOG(3) << "IsInflightTooHigh: loss_events_in_round:"
+ << loss_events_in_round()
+
+ << " bytes_lost_in_round:" << bytes_lost_in_round
+ << ", lost_in_round_threshold:"
<< inflight_at_send * Params().loss_threshold;
if (inflight_at_send > 0 && bytes_lost_in_round > 0) {
@@ -274,6 +294,9 @@ bool Bbr2NetworkModel::IsInflightTooHigh(
void Bbr2NetworkModel::RestartRound() {
bytes_lost_in_round_ = 0;
loss_events_in_round_ = 0;
+ if (GetQuicReloadableFlag(quic_bbr2_startup_loss_exit_use_max_delivered)) {
+ max_bytes_delivered_in_round_ = 0;
+ }
round_trip_counter_.RestartRound();
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.h b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.h
index 8732118049e..1109e08c673 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.h
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.h
@@ -76,8 +76,8 @@ struct QUIC_EXPORT_PRIVATE Bbr2Params {
*/
// The gain for both CWND and PacingRate at startup.
+ float startup_cwnd_gain = 2.0;
// TODO(wub): Maybe change to the newly derived value of 2.773 (4 * ln(2)).
- float startup_cwnd_gain = 2.885;
float startup_pacing_gain = 2.885;
// Full bandwidth is declared if the total bandwidth growth is less than
@@ -91,10 +91,14 @@ struct QUIC_EXPORT_PRIVATE Bbr2Params {
int64_t startup_full_loss_count =
GetQuicFlag(FLAGS_quic_bbr2_default_startup_full_loss_count);
+ // If true, always exit STARTUP on loss, even if bandwidth exceeds threshold.
+ // If false, exit STARTUP on loss only if bandwidth is below threshold.
+ bool always_exit_startup_on_excess_loss = true;
+
/*
* DRAIN parameters.
*/
- float drain_cwnd_gain = 2.885;
+ float drain_cwnd_gain = 2.0;
float drain_pacing_gain = 1.0 / 2.885;
/*
@@ -167,10 +171,6 @@ struct QUIC_EXPORT_PRIVATE Bbr2Params {
* Experimental flags from QuicConfig.
*/
- // Indicates app-limited calls should be ignored as long as there's
- // enough data inflight to see more bandwidth when necessary.
- bool flexible_app_limited = false;
-
// Can be disabled by connection option 'B2NA'.
bool add_ack_height_to_queueing_threshold = true;
@@ -184,8 +184,11 @@ struct QUIC_EXPORT_PRIVATE Bbr2Params {
// Can be enabled by connection option 'B2LO'.
bool ignore_inflight_lo = false;
- // Can be enabled by connection optoin 'B2HI'.
- bool limit_inflight_hi_by_cwnd = false;
+ // Can be enabled by connection option 'B2H2'.
+ bool limit_inflight_hi_by_max_delivered = false;
+
+ // Can be enabled by connection option 'B2SL'.
+ bool startup_loss_exit_use_max_delivered_for_inflight_hi = false;
};
class QUIC_EXPORT_PRIVATE RoundTripCounter {
@@ -392,9 +395,10 @@ class QUIC_EXPORT_PRIVATE Bbr2NetworkModel {
bool IsCongestionWindowLimited(
const Bbr2CongestionEvent& congestion_event) const;
- // TODO(wub): Replace this by a new version which takes two thresholds, one
- // is the number of loss events, the other is the percentage of bytes lost.
- bool IsInflightTooHigh(const Bbr2CongestionEvent& congestion_event) const;
+ // Return true if the number of loss events exceeds max_loss_events and
+ // fraction of bytes lost exceed the loss threshold.
+ bool IsInflightTooHigh(const Bbr2CongestionEvent& congestion_event,
+ int64_t max_loss_events) const;
QuicPacketNumber last_sent_packet() const {
return round_trip_counter_.last_sent_packet();
@@ -414,6 +418,10 @@ class QUIC_EXPORT_PRIVATE Bbr2NetworkModel {
int64_t loss_events_in_round() const { return loss_events_in_round_; }
+ QuicByteCount max_bytes_delivered_in_round() const {
+ return max_bytes_delivered_in_round_;
+ }
+
QuicPacketNumber end_of_app_limited_phase() const {
return bandwidth_sampler_.end_of_app_limited_phase();
}
@@ -466,6 +474,12 @@ class QUIC_EXPORT_PRIVATE Bbr2NetworkModel {
// Number of loss marking events in the current round.
int64_t loss_events_in_round_ = 0;
+ // A max of bytes delivered among all congestion events in the current round.
+ // A congestions event's bytes delivered is the total bytes acked between time
+ // Ts and Ta, which is the time when the largest acked packet(within the
+ // congestion event) was sent and acked, respectively.
+ QuicByteCount max_bytes_delivered_in_round_ = 0;
+
// Max bandwidth in the current round. Updated once per congestion event.
QuicBandwidth bandwidth_latest_ = QuicBandwidth::Zero();
// Max bandwidth of recent rounds. Updated once per round.
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_probe_bw.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_probe_bw.cc
index 172911817aa..0b8991cb86b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_probe_bw.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_probe_bw.cc
@@ -199,10 +199,8 @@ Bbr2ProbeBwMode::AdaptUpperBoundsResult Bbr2ProbeBwMode::MaybeAdaptUpperBounds(
return NOT_ADAPTED_INVALID_SAMPLE;
}
- const bool has_enough_loss_events =
- model_->loss_events_in_round() >= Params().probe_bw_full_loss_count;
-
- if (has_enough_loss_events && model_->IsInflightTooHigh(congestion_event)) {
+ if (model_->IsInflightTooHigh(congestion_event,
+ Params().probe_bw_full_loss_count)) {
if (cycle_.is_sample_from_probing) {
cycle_.is_sample_from_probing = false;
@@ -218,17 +216,24 @@ Bbr2ProbeBwMode::AdaptUpperBoundsResult Bbr2ProbeBwMode::MaybeAdaptUpperBounds(
// The new code actually cuts inflight_hi slower than before.
QUIC_CODE_COUNT(quic_bbr2_cut_inflight_hi_gradually_in_effect);
}
- if (Params().limit_inflight_hi_by_cwnd) {
- const QuicByteCount cwnd_target =
- sender_->GetCongestionWindow() * (1.0 - Params().beta);
- if (inflight_at_send >= cwnd_target) {
- // The new code does not change behavior.
- QUIC_CODE_COUNT(quic_bbr2_cut_inflight_hi_cwnd_noop);
+ if (Params().limit_inflight_hi_by_max_delivered) {
+ QuicByteCount new_inflight_hi =
+ std::max(inflight_at_send, inflight_target);
+ if (new_inflight_hi >= model_->max_bytes_delivered_in_round()) {
+ QUIC_CODE_COUNT(quic_bbr2_cut_inflight_hi_max_delivered_noop);
} else {
- // The new code actually cuts inflight_hi slower than before.
- QUIC_CODE_COUNT(quic_bbr2_cut_inflight_hi_cwnd_in_effect);
+ QUIC_CODE_COUNT(quic_bbr2_cut_inflight_hi_max_delivered_in_effect);
+ new_inflight_hi = model_->max_bytes_delivered_in_round();
}
- model_->set_inflight_hi(std::max(inflight_at_send, cwnd_target));
+ QUIC_DVLOG(3) << sender_
+ << " Setting inflight_hi due to loss. new_inflight_hi:"
+ << new_inflight_hi
+ << ", inflight_at_send:" << inflight_at_send
+ << ", inflight_target:" << inflight_target
+ << ", max_bytes_delivered_in_round:"
+ << model_->max_bytes_delivered_in_round() << " @ "
+ << congestion_event.event_time;
+ model_->set_inflight_hi(new_inflight_hi);
} else {
model_->set_inflight_hi(std::max(inflight_at_send, inflight_target));
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.cc
index fe32835fb8f..c3abffec147 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.cc
@@ -11,6 +11,7 @@
#include "net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_bandwidth.h"
+#include "net/third_party/quiche/src/quic/core/quic_tag.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
@@ -99,9 +100,6 @@ Bbr2Sender::Bbr2Sender(QuicTime now,
void Bbr2Sender::SetFromConfig(const QuicConfig& config,
Perspective perspective) {
- if (config.HasClientRequestedIndependentOption(kBBR9, perspective)) {
- params_.flexible_app_limited = true;
- }
if (config.HasClientRequestedIndependentOption(kB2NA, perspective)) {
params_.add_ack_height_to_queueing_threshold = false;
}
@@ -125,16 +123,16 @@ void Bbr2Sender::SetFromConfig(const QuicConfig& config,
if (config.HasClientRequestedIndependentOption(kB2LO, perspective)) {
params_.ignore_inflight_lo = true;
}
- if (GetQuicReloadableFlag(quic_bbr2_limit_inflight_hi) &&
- config.HasClientRequestedIndependentOption(kB2HI, perspective)) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_bbr2_limit_inflight_hi);
- params_.limit_inflight_hi_by_cwnd = true;
- }
if (GetQuicReloadableFlag(quic_bbr2_use_tcp_inflight_hi_headroom) &&
config.HasClientRequestedIndependentOption(kB2HR, perspective)) {
QUIC_RELOADABLE_FLAG_COUNT(quic_bbr2_use_tcp_inflight_hi_headroom);
params_.inflight_hi_headroom = 0.15;
}
+ if (GetQuicReloadableFlag(quic_bbr2_support_max_bootstrap_cwnd) &&
+ config.HasClientRequestedIndependentOption(kICW1, perspective)) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_bbr2_support_max_bootstrap_cwnd, 1, 4);
+ max_cwnd_when_network_parameters_adjusted_ = 100 * kDefaultTCPMSS;
+ }
ApplyConnectionOptions(config.ClientRequestedIndependentOptions(perspective));
}
@@ -142,9 +140,22 @@ void Bbr2Sender::SetFromConfig(const QuicConfig& config,
void Bbr2Sender::ApplyConnectionOptions(
const QuicTagVector& connection_options) {
if (ContainsQuicTag(connection_options, kBBQ2)) {
- // 2 is the lower, derived gain for CWND.
- params_.startup_cwnd_gain = 2;
- params_.drain_cwnd_gain = 2;
+ params_.startup_cwnd_gain = 2.885;
+ params_.drain_cwnd_gain = 2.885;
+ }
+ if (GetQuicReloadableFlag(quic_bbr2_no_exit_startup_on_loss_with_bw_growth) &&
+ ContainsQuicTag(connection_options, kB2NE)) {
+ QUIC_RELOADABLE_FLAG_COUNT(
+ quic_bbr2_no_exit_startup_on_loss_with_bw_growth);
+ params_.always_exit_startup_on_excess_loss = false;
+ }
+ if (GetQuicReloadableFlag(quic_bbr2_startup_loss_exit_use_max_delivered) &&
+ ContainsQuicTag(connection_options, kB2SL)) {
+ params_.startup_loss_exit_use_max_delivered_for_inflight_hi = true;
+ }
+ if (GetQuicReloadableFlag(quic_bbr2_startup_loss_exit_use_max_delivered) &&
+ ContainsQuicTag(connection_options, kB2H2)) {
+ params_.limit_inflight_hi_by_max_delivered = true;
}
if (ContainsQuicTag(connection_options, kBSAO)) {
model_.EnableOverestimateAvoidance();
@@ -179,7 +190,24 @@ void Bbr2Sender::AdjustNetworkParameters(const NetworkParams& params) {
QuicBandwidth effective_bandwidth =
std::max(params.bandwidth, model_.BandwidthEstimate());
- cwnd_ = cwnd_limits().ApplyLimits(model_.BDP(effective_bandwidth));
+ connection_stats_->cwnd_bootstrapping_rtt_us =
+ model_.MinRtt().ToMicroseconds();
+ if (GetQuicReloadableFlag(quic_bbr2_support_max_bootstrap_cwnd)) {
+ if (params.max_initial_congestion_window > 0) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_bbr2_support_max_bootstrap_cwnd, 2,
+ 4);
+ max_cwnd_when_network_parameters_adjusted_ =
+ params.max_initial_congestion_window * kDefaultTCPMSS;
+ } else {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_bbr2_support_max_bootstrap_cwnd, 3,
+ 4);
+ }
+ cwnd_ = cwnd_limits().ApplyLimits(
+ std::min(max_cwnd_when_network_parameters_adjusted_,
+ model_.BDP(effective_bandwidth)));
+ } else {
+ cwnd_ = cwnd_limits().ApplyLimits(model_.BDP(effective_bandwidth));
+ }
if (!params.allow_cwnd_to_decrease) {
cwnd_ = std::max(cwnd_, prior_cwnd);
@@ -371,9 +399,6 @@ void Bbr2Sender::OnApplicationLimited(QuicByteCount bytes_in_flight) {
if (bytes_in_flight >= GetCongestionWindow()) {
return;
}
- if (params().flexible_app_limited && IsPipeSufficientlyFull()) {
- return;
- }
model_.OnApplicationLimited();
QUIC_DVLOG(2) << this << " Becoming application limited. Last sent packet: "
@@ -409,41 +434,7 @@ void Bbr2Sender::OnExitQuiescence(QuicTime now) {
bool Bbr2Sender::ShouldSendProbingPacket() const {
// TODO(wub): Implement ShouldSendProbingPacket properly.
- if (!BBR2_MODE_DISPATCH(IsProbingForBandwidth())) {
- return false;
- }
-
- // TODO(b/77975811): If the pipe is highly under-utilized, consider not
- // sending a probing transmission, because the extra bandwidth is not needed.
- // If flexible_app_limited is enabled, check if the pipe is sufficiently full.
- if (params().flexible_app_limited) {
- const bool is_pipe_sufficiently_full = IsPipeSufficientlyFull();
- QUIC_DVLOG(3) << this << " CWND: " << GetCongestionWindow()
- << ", inflight: " << unacked_packets_->bytes_in_flight()
- << ", pacing_rate: " << PacingRate(0)
- << ", flexible_app_limited: true, ShouldSendProbingPacket: "
- << !is_pipe_sufficiently_full;
- return !is_pipe_sufficiently_full;
- } else {
- return true;
- }
-}
-
-bool Bbr2Sender::IsPipeSufficientlyFull() const {
- QuicByteCount bytes_in_flight = unacked_packets_->bytes_in_flight();
- // See if we need more bytes in flight to see more bandwidth.
- if (mode_ == Bbr2Mode::STARTUP) {
- // STARTUP exits if it doesn't observe a 25% bandwidth increase, so the CWND
- // must be more than 25% above the target.
- return bytes_in_flight >= GetTargetCongestionWindow(1.5);
- }
- if (model_.pacing_gain() > 1) {
- // Super-unity PROBE_BW doesn't exit until 1.25 * BDP is achieved.
- return bytes_in_flight >= GetTargetCongestionWindow(model_.pacing_gain());
- }
- // If bytes_in_flight are above the target congestion window, it should be
- // possible to observe the same or more bandwidth if it's available.
- return bytes_in_flight >= GetTargetCongestionWindow(1.1);
+ return BBR2_MODE_DISPATCH(IsProbingForBandwidth());
}
std::string Bbr2Sender::GetDebugState() const {
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.h b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.h
index 39964a0ab00..6a83184cc93 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.h
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.h
@@ -160,10 +160,6 @@ class QUIC_EXPORT_PRIVATE Bbr2Sender final : public SendAlgorithmInterface {
return random_->RandUint64() % max;
}
- // Returns true if there are enough bytes in flight to ensure more bandwidth
- // will be observed if present.
- bool IsPipeSufficientlyFull() const;
-
// Cwnd limits imposed by the current Bbr2 mode.
Limits<QuicByteCount> GetCwndLimitsByMode() const;
@@ -183,6 +179,10 @@ class QUIC_EXPORT_PRIVATE Bbr2Sender final : public SendAlgorithmInterface {
// Instead, use params() to get read-only access.
Bbr2Params params_;
+ // Max congestion window when adjusting network parameters.
+ QuicByteCount max_cwnd_when_network_parameters_adjusted_ =
+ kMaxInitialCongestionWindow * kDefaultTCPMSS;
+
Bbr2NetworkModel model_;
const QuicByteCount initial_cwnd_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_simulator_test.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_simulator_test.cc
index 1f5db20c892..f446ab577df 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_simulator_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_simulator_test.cc
@@ -6,6 +6,7 @@
#include <sstream>
#include <utility>
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/bbr2_misc.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h"
@@ -27,7 +28,6 @@
#include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h"
#include "net/third_party/quiche/src/quic/test_tools/simulator/switch.h"
#include "net/third_party/quiche/src/quic/test_tools/simulator/traffic_policer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
using testing::AllOf;
@@ -91,7 +91,7 @@ class DefaultTopologyParams {
// Network switch queue capacity, in number of BDPs.
float switch_queue_capacity_in_bdp = 2;
- quiche::QuicheOptional<TrafficPolicerParams> sender_policer_params;
+ absl::optional<TrafficPolicerParams> sender_policer_params;
QuicBandwidth BottleneckBandwidth() const {
return std::min(local_link.bandwidth, test_link.bandwidth);
@@ -413,6 +413,25 @@ TEST_F(Bbr2DefaultTopologyTest, SimpleTransfer) {
EXPECT_APPROX_EQ(params.RTT(), rtt_stats()->smoothed_rtt(), 1.0f);
}
+TEST_F(Bbr2DefaultTopologyTest, SimpleTransferB2NE) {
+ SetConnectionOption(kB2NE);
+ DefaultTopologyParams params;
+ CreateNetwork(params);
+
+ // Transfer 12MB.
+ DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35));
+ EXPECT_TRUE(Bbr2ModeIsOneOf({Bbr2Mode::PROBE_BW, Bbr2Mode::PROBE_RTT}));
+
+ EXPECT_APPROX_EQ(params.BottleneckBandwidth(),
+ sender_->ExportDebugState().bandwidth_hi, 0.01f);
+
+ EXPECT_LE(sender_loss_rate_in_packets(), 0.05);
+ // The margin here is high, because the aggregation greatly increases
+ // smoothed rtt.
+ EXPECT_GE(params.RTT() * 4, rtt_stats()->smoothed_rtt());
+ EXPECT_APPROX_EQ(params.RTT(), rtt_stats()->min_rtt(), 0.2f);
+}
+
TEST_F(Bbr2DefaultTopologyTest, SimpleTransferSmallBuffer) {
DefaultTopologyParams params;
params.switch_queue_capacity_in_bdp = 0.5;
@@ -426,6 +445,20 @@ TEST_F(Bbr2DefaultTopologyTest, SimpleTransferSmallBuffer) {
EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
}
+TEST_F(Bbr2DefaultTopologyTest, SimpleTransferSmallBufferB2H2) {
+ SetConnectionOption(kB2H2);
+ DefaultTopologyParams params;
+ params.switch_queue_capacity_in_bdp = 0.5;
+ CreateNetwork(params);
+
+ DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(30));
+ EXPECT_TRUE(Bbr2ModeIsOneOf({Bbr2Mode::PROBE_BW, Bbr2Mode::PROBE_RTT}));
+ EXPECT_APPROX_EQ(params.BottleneckBandwidth(),
+ sender_->ExportDebugState().bandwidth_hi, 0.02f);
+ EXPECT_GE(sender_connection_stats().packets_lost, 0u);
+ EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
+}
+
TEST_F(Bbr2DefaultTopologyTest, SimpleTransfer2RTTAggregationBytes) {
SetConnectionOption(kBSAO);
DefaultTopologyParams params;
@@ -441,9 +474,9 @@ TEST_F(Bbr2DefaultTopologyTest, SimpleTransfer2RTTAggregationBytes) {
sender_->ExportDebugState().bandwidth_hi, 0.01f);
EXPECT_LE(sender_loss_rate_in_packets(), 0.05);
- // The margin here is high, because the aggregation greatly increases
- // smoothed rtt.
- EXPECT_GE(params.RTT() * 4, rtt_stats()->smoothed_rtt());
+ // The margin here is high, because both link level aggregation and ack
+ // decimation can greatly increase smoothed rtt.
+ EXPECT_GE(params.RTT() * 5, rtt_stats()->smoothed_rtt());
EXPECT_APPROX_EQ(params.RTT(), rtt_stats()->min_rtt(), 0.2f);
}
@@ -589,10 +622,10 @@ TEST_F(Bbr2DefaultTopologyTest, Drain) {
ASSERT_EQ(Bbr2Mode::DRAIN, sender_->ExportDebugState().mode);
EXPECT_APPROX_EQ(sender_->BandwidthEstimate() * (1 / 2.885f),
sender_->PacingRate(0), 0.01f);
- // BBR uses CWND gain of 2.88 during STARTUP, hence it will fill the buffer
- // with approximately 1.88 BDPs. Here, we use 1.5 to give some margin for
- // error.
- EXPECT_GE(queue->bytes_queued(), 1.5 * params.BDP());
+
+ // BBR uses CWND gain of 2 during STARTUP, hence it will fill the buffer with
+ // approximately 1 BDP. Here, we use 0.95 to give some margin for error.
+ EXPECT_GE(queue->bytes_queued(), 0.95 * params.BDP());
// Observe increased RTT due to bufferbloat.
const QuicTime::Delta queueing_delay =
@@ -707,6 +740,44 @@ TEST_F(Bbr2DefaultTopologyTest, ExitStartupDueToLoss) {
EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
}
+// Test exiting STARTUP earlier upon loss due to loss when connection option
+// B2SL is used.
+TEST_F(Bbr2DefaultTopologyTest, ExitStartupDueToLossB2SL) {
+ SetConnectionOption(kB2SL);
+ DefaultTopologyParams params;
+ params.switch_queue_capacity_in_bdp = 0.5;
+ CreateNetwork(params);
+
+ // Run until the full bandwidth is reached and check how many rounds it was.
+ sender_endpoint_.AddBytesToTransfer(12 * 1024 * 1024);
+ QuicRoundTripCount max_bw_round = 0;
+ QuicBandwidth max_bw(QuicBandwidth::Zero());
+ bool simulator_result = simulator_.RunUntilOrTimeout(
+ [this, &max_bw, &max_bw_round]() {
+ if (max_bw < sender_->ExportDebugState().bandwidth_hi) {
+ max_bw = sender_->ExportDebugState().bandwidth_hi;
+ max_bw_round = sender_->ExportDebugState().round_trip_count;
+ }
+ return sender_->ExportDebugState().startup.full_bandwidth_reached;
+ },
+ QuicTime::Delta::FromSeconds(5));
+ ASSERT_TRUE(simulator_result);
+ EXPECT_EQ(Bbr2Mode::DRAIN, sender_->ExportDebugState().mode);
+ EXPECT_GE(2u, sender_->ExportDebugState().round_trip_count - max_bw_round);
+ EXPECT_EQ(
+ 1u,
+ sender_->ExportDebugState().startup.round_trips_without_bandwidth_growth);
+ EXPECT_NE(0u, sender_connection_stats().packets_lost);
+ EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited);
+
+ if (GetQuicReloadableFlag(quic_bbr2_startup_loss_exit_use_max_delivered)) {
+ EXPECT_GT(sender_->ExportDebugState().inflight_hi, 1.2f * params.BDP());
+ } else {
+ EXPECT_APPROX_EQ(sender_->ExportDebugState().inflight_hi, params.BDP(),
+ 0.1f);
+ }
+}
+
TEST_F(Bbr2DefaultTopologyTest, SenderPoliced) {
DefaultTopologyParams params;
params.sender_policer_params = TrafficPolicerParams();
@@ -906,7 +977,7 @@ TEST_F(Bbr2DefaultTopologyTest, ProbeBwAfterQuiescencePostponeMinRttTimestamp) {
min_rtt_timestamp_after_idle);
}
-// Regression test for http://shortn/_Jt1QWtshAM.
+// Regression test for http://go/switchtobbr2midconnection.
TEST_F(Bbr2DefaultTopologyTest, SwitchToBbr2MidConnection) {
QuicTime now = QuicTime::Zero();
BbrSender old_sender(sender_connection()->clock()->Now(),
@@ -1017,6 +1088,87 @@ TEST_F(Bbr2DefaultTopologyTest, AdjustNetworkParameters) {
DriveOutOfStartup(params);
}
+TEST_F(Bbr2DefaultTopologyTest,
+ 200InitialCongestionWindowWithNetworkParameterAdjusted) {
+ DefaultTopologyParams params;
+ CreateNetwork(params);
+
+ sender_endpoint_.AddBytesToTransfer(1 * 1024 * 1024);
+
+ // Wait until an ACK comes back.
+ const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(5);
+ bool simulator_result = simulator_.RunUntilOrTimeout(
+ [this]() { return !sender_->ExportDebugState().min_rtt.IsZero(); },
+ timeout);
+ ASSERT_TRUE(simulator_result);
+
+ // Bootstrap cwnd by a overly large bandwidth sample.
+ sender_connection()->AdjustNetworkParameters(
+ SendAlgorithmInterface::NetworkParams(1024 * params.BottleneckBandwidth(),
+ QuicTime::Delta::Zero(), false));
+
+ if (GetQuicReloadableFlag(quic_bbr2_support_max_bootstrap_cwnd)) {
+ // Verify cwnd is capped at 200.
+ EXPECT_EQ(200 * kDefaultTCPMSS,
+ sender_->ExportDebugState().congestion_window);
+ EXPECT_GT(1024 * params.BottleneckBandwidth(), sender_->PacingRate(0));
+ }
+}
+
+TEST_F(Bbr2DefaultTopologyTest,
+ 100InitialCongestionWindowFromNetworkParameter) {
+ DefaultTopologyParams params;
+ CreateNetwork(params);
+
+ sender_endpoint_.AddBytesToTransfer(1 * 1024 * 1024);
+ // Wait until an ACK comes back.
+ const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(5);
+ bool simulator_result = simulator_.RunUntilOrTimeout(
+ [this]() { return !sender_->ExportDebugState().min_rtt.IsZero(); },
+ timeout);
+ ASSERT_TRUE(simulator_result);
+
+ // Bootstrap cwnd by a overly large bandwidth sample.
+ SendAlgorithmInterface::NetworkParams network_params(
+ 1024 * params.BottleneckBandwidth(), QuicTime::Delta::Zero(), false);
+ network_params.max_initial_congestion_window = 100;
+ sender_connection()->AdjustNetworkParameters(network_params);
+
+ if (GetQuicReloadableFlag(quic_bbr2_support_max_bootstrap_cwnd)) {
+ // Verify cwnd is capped at 100.
+ EXPECT_EQ(100 * kDefaultTCPMSS,
+ sender_->ExportDebugState().congestion_window);
+ EXPECT_GT(1024 * params.BottleneckBandwidth(), sender_->PacingRate(0));
+ }
+}
+
+TEST_F(Bbr2DefaultTopologyTest,
+ 100InitialCongestionWindowWithNetworkParameterAdjusted) {
+ SetConnectionOption(kICW1);
+ DefaultTopologyParams params;
+ CreateNetwork(params);
+
+ sender_endpoint_.AddBytesToTransfer(1 * 1024 * 1024);
+ // Wait until an ACK comes back.
+ const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(5);
+ bool simulator_result = simulator_.RunUntilOrTimeout(
+ [this]() { return !sender_->ExportDebugState().min_rtt.IsZero(); },
+ timeout);
+ ASSERT_TRUE(simulator_result);
+
+ // Bootstrap cwnd by a overly large bandwidth sample.
+ sender_connection()->AdjustNetworkParameters(
+ SendAlgorithmInterface::NetworkParams(1024 * params.BottleneckBandwidth(),
+ QuicTime::Delta::Zero(), false));
+
+ if (GetQuicReloadableFlag(quic_bbr2_support_max_bootstrap_cwnd)) {
+ // Verify cwnd is capped at 100.
+ EXPECT_EQ(100 * kDefaultTCPMSS,
+ sender_->ExportDebugState().congestion_window);
+ EXPECT_GT(1024 * params.BottleneckBandwidth(), sender_->PacingRate(0));
+ }
+}
+
// All Bbr2MultiSenderTests uses the following network topology:
//
// Sender 0 (A Bbr2Sender)
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.cc
index 1141ca09e05..5c47adb8426 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.cc
@@ -43,9 +43,15 @@ Bbr2Mode Bbr2StartupMode::OnCongestionEvent(
const AckedPacketVector& /*acked_packets*/,
const LostPacketVector& /*lost_packets*/,
const Bbr2CongestionEvent& congestion_event) {
- CheckFullBandwidthReached(congestion_event);
-
- CheckExcessiveLosses(congestion_event);
+ if (!full_bandwidth_reached_ && congestion_event.end_of_round_trip) {
+ // TCP BBR always exits upon excessive losses. QUIC BBRv1 does not exits
+ // upon excessive losses, if enough bandwidth growth is observed.
+ bool has_enough_bw_growth = CheckBandwidthGrowth(congestion_event);
+
+ if (Params().always_exit_startup_on_excess_loss || !has_enough_bw_growth) {
+ CheckExcessiveLosses(congestion_event);
+ }
+ }
model_->set_pacing_gain(Params().startup_pacing_gain);
model_->set_cwnd_gain(Params().startup_cwnd_gain);
@@ -54,68 +60,68 @@ Bbr2Mode Bbr2StartupMode::OnCongestionEvent(
return full_bandwidth_reached_ ? Bbr2Mode::DRAIN : Bbr2Mode::STARTUP;
}
-void Bbr2StartupMode::CheckFullBandwidthReached(
+bool Bbr2StartupMode::CheckBandwidthGrowth(
const Bbr2CongestionEvent& congestion_event) {
DCHECK(!full_bandwidth_reached_);
- if (full_bandwidth_reached_ || !congestion_event.end_of_round_trip ||
- congestion_event.last_sample_is_app_limited) {
- return;
+ DCHECK(congestion_event.end_of_round_trip);
+ if (congestion_event.last_sample_is_app_limited) {
+ // Return true such that when Params().always_exit_startup_on_excess_loss is
+ // false, we'll not check excess loss, which is the behavior of QUIC BBRv1.
+ return true;
}
QuicBandwidth threshold =
full_bandwidth_baseline_ * Params().startup_full_bw_threshold;
if (model_->MaxBandwidth() >= threshold) {
- QUIC_DVLOG(3)
- << sender_
- << " CheckFullBandwidthReached at end of round. max_bandwidth:"
- << model_->MaxBandwidth() << ", threshold:" << threshold
- << " (Still growing) @ " << congestion_event.event_time;
+ QUIC_DVLOG(3) << sender_
+ << " CheckBandwidthGrowth at end of round. max_bandwidth:"
+ << model_->MaxBandwidth() << ", threshold:" << threshold
+ << " (Still growing) @ " << congestion_event.event_time;
full_bandwidth_baseline_ = model_->MaxBandwidth();
rounds_without_bandwidth_growth_ = 0;
- return;
+ return true;
}
++rounds_without_bandwidth_growth_;
full_bandwidth_reached_ =
rounds_without_bandwidth_growth_ >= Params().startup_full_bw_rounds;
QUIC_DVLOG(3) << sender_
- << " CheckFullBandwidthReached at end of round. max_bandwidth:"
+ << " CheckBandwidthGrowth at end of round. max_bandwidth:"
<< model_->MaxBandwidth() << ", threshold:" << threshold
<< " rounds_without_growth:" << rounds_without_bandwidth_growth_
<< " full_bw_reached:" << full_bandwidth_reached_ << " @ "
<< congestion_event.event_time;
+
+ return false;
}
void Bbr2StartupMode::CheckExcessiveLosses(
const Bbr2CongestionEvent& congestion_event) {
- if (full_bandwidth_reached_) {
- return;
- }
-
- const int64_t loss_events_in_round = model_->loss_events_in_round();
+ DCHECK(congestion_event.end_of_round_trip);
- // TODO(wub): In TCP, loss based exit only happens at end of a loss round, in
- // QUIC we use the end of the normal round here. It is possible to exit after
- // any congestion event, using information of the "rolling round".
- if (!congestion_event.end_of_round_trip) {
+ if (full_bandwidth_reached_) {
return;
}
- QUIC_DVLOG(3)
- << sender_
- << " CheckExcessiveLosses at end of round. loss_events_in_round:"
- << loss_events_in_round
- << ", threshold:" << Params().startup_full_loss_count << " @ "
- << congestion_event.event_time;
-
// At the end of a round trip. Check if loss is too high in this round.
- if (loss_events_in_round >= Params().startup_full_loss_count &&
- model_->IsInflightTooHigh(congestion_event)) {
- const QuicByteCount bdp = model_->BDP(model_->MaxBandwidth());
- QUIC_DVLOG(3) << sender_
- << " Exiting STARTUP due to loss. inflight_hi:" << bdp;
- model_->set_inflight_hi(bdp);
+ if (model_->IsInflightTooHigh(congestion_event,
+ Params().startup_full_loss_count)) {
+ QuicByteCount new_inflight_hi = model_->BDP(model_->MaxBandwidth());
+ if (Params().startup_loss_exit_use_max_delivered_for_inflight_hi) {
+ if (new_inflight_hi < model_->max_bytes_delivered_in_round()) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(
+ quic_bbr2_startup_loss_exit_use_max_delivered, 1, 2);
+ new_inflight_hi = model_->max_bytes_delivered_in_round();
+ } else {
+ QUIC_RELOADABLE_FLAG_COUNT_N(
+ quic_bbr2_startup_loss_exit_use_max_delivered, 2, 2);
+ }
+ }
+ QUIC_DVLOG(3) << sender_ << " Exiting STARTUP due to loss. inflight_hi:"
+ << new_inflight_hi;
+ // TODO(ianswett): Add a shared method to set inflight_hi in the model.
+ model_->set_inflight_hi(new_inflight_hi);
full_bandwidth_reached_ = true;
sender_->connection_stats_->bbr_exit_startup_due_to_loss = true;
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.h b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.h
index 378a4fd83fd..75ec71ecd25 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.h
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr2_startup.h
@@ -58,7 +58,12 @@ class QUIC_EXPORT_PRIVATE Bbr2StartupMode final : public Bbr2ModeBase {
private:
const Bbr2Params& Params() const;
- void CheckFullBandwidthReached(const Bbr2CongestionEvent& congestion_event);
+ // Check bandwidth growth in the past round. Must be called at the end of a
+ // round.
+ // Return true if the bandwidth growed as expected.
+ // Return false otherwise, if enough rounds have elapsed without expected
+ // growth, also sets |full_bandwidth_reached_| to true.
+ bool CheckBandwidthGrowth(const Bbr2CongestionEvent& congestion_event);
void CheckExcessiveLosses(const Bbr2CongestionEvent& congestion_event);
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.cc
index 2948272d737..7ce3ab586af 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.cc
@@ -8,12 +8,12 @@
#include <sstream>
#include <string>
+#include "absl/base/attributes.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/rtt_stats.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/core/quic_time_accumulator.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
@@ -221,24 +221,6 @@ bool BbrSender::ShouldSendProbingPacket() const {
return true;
}
-bool BbrSender::IsPipeSufficientlyFull() const {
- // See if we need more bytes in flight to see more bandwidth.
- if (mode_ == STARTUP) {
- // STARTUP exits if it doesn't observe a 25% bandwidth increase, so the CWND
- // must be more than 25% above the target.
- return unacked_packets_->bytes_in_flight() >=
- GetTargetCongestionWindow(1.5);
- }
- if (pacing_gain_ > 1) {
- // Super-unity PROBE_BW doesn't exit until 1.25 * BDP is achieved.
- return unacked_packets_->bytes_in_flight() >=
- GetTargetCongestionWindow(pacing_gain_);
- }
- // If bytes_in_flight are above the target congestion window, it should be
- // possible to observe the same or more bandwidth if it's available.
- return unacked_packets_->bytes_in_flight() >= GetTargetCongestionWindow(1.1);
-}
-
void BbrSender::SetFromConfig(const QuicConfig& config,
Perspective perspective) {
if (config.HasClientRequestedIndependentOption(k1RTT, perspective)) {
@@ -734,7 +716,7 @@ void BbrSender::UpdateRecoveryState(QuicPacketNumber last_acked_packet,
if (is_round_start) {
recovery_state_ = GROWTH;
}
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case GROWTH:
// Exit recovery if appropriate.
@@ -814,15 +796,11 @@ void BbrSender::CalculateCongestionWindow(QuicByteCount bytes_acked,
// Instead of immediately setting the target CWND as the new one, BBR grows
// the CWND towards |target_window| by only increasing it |bytes_acked| at a
// time.
- const bool add_bytes_acked =
- !GetQuicReloadableFlag(quic_bbr_no_bytes_acked_in_startup_recovery) ||
- !InRecovery();
if (is_at_full_bandwidth_) {
congestion_window_ =
std::min(target_window, congestion_window_ + bytes_acked);
- } else if (add_bytes_acked &&
- (congestion_window_ < target_window ||
- sampler_.total_bytes_acked() < initial_congestion_window_)) {
+ } else if (congestion_window_ < target_window ||
+ sampler_.total_bytes_acked() < initial_congestion_window_) {
// If the connection is not yet out of startup phase, do not decrease the
// window.
congestion_window_ = congestion_window_ + bytes_acked;
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h
index ae6cce9a393..586ef1afc2e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h
@@ -175,17 +175,15 @@ class QUIC_EXPORT_PRIVATE BbrSender : public SendAlgorithmInterface {
// For switching send algorithm mid connection.
friend class Bbr2Sender;
- typedef WindowedFilter<QuicBandwidth,
- MaxFilter<QuicBandwidth>,
- QuicRoundTripCount,
- QuicRoundTripCount>
- MaxBandwidthFilter;
-
- typedef WindowedFilter<QuicByteCount,
- MaxFilter<QuicByteCount>,
- QuicRoundTripCount,
- QuicRoundTripCount>
- MaxAckHeightFilter;
+ using MaxBandwidthFilter = WindowedFilter<QuicBandwidth,
+ MaxFilter<QuicBandwidth>,
+ QuicRoundTripCount,
+ QuicRoundTripCount>;
+
+ using MaxAckHeightFilter = WindowedFilter<QuicByteCount,
+ MaxFilter<QuicByteCount>,
+ QuicRoundTripCount,
+ QuicRoundTripCount>;
// Returns whether the connection has achieved full bandwidth required to exit
// the slow start.
@@ -244,10 +242,6 @@ class QUIC_EXPORT_PRIVATE BbrSender : public SendAlgorithmInterface {
void CalculateRecoveryWindow(QuicByteCount bytes_acked,
QuicByteCount bytes_lost);
- // Returns true if there are enough bytes in flight to ensure more bandwidth
- // will be observed if present.
- bool IsPipeSufficientlyFull() const;
-
// Called right before exiting STARTUP.
void OnExitStartup(QuicTime now);
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender_test.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender_test.cc
index b476b557a47..c0000e78699 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender_test.cc
@@ -436,7 +436,10 @@ TEST_F(BbrSenderTest, SimpleTransferAckDecimation) {
}
// Test a simple long data transfer with 2 rtts of aggregation.
-TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes20RTTWindow) {
+// TODO(b/172302465) Re-enable this test.
+TEST_F(BbrSenderTest,
+ QUIC_TEST_DISABLED_IN_CHROME(
+ SimpleTransfer2RTTAggregationBytes20RTTWindow)) {
SetConnectionOption(kBSAO);
CreateDefaultSetup();
SetConnectionOption(kBBR4);
@@ -728,7 +731,8 @@ TEST_F(BbrSenderTest, ProbeRtt) {
// Ensure that a connection that is app-limited and is at sufficiently low
// bandwidth will not exit high gain phase, and similarly ensure that the
// connection will exit low gain early if the number of bytes in flight is low.
-TEST_F(BbrSenderTest, InFlightAwareGainCycling) {
+// TODO(crbug.com/1145095): Re-enable this test.
+TEST_F(BbrSenderTest, QUIC_TEST_DISABLED_IN_CHROME(InFlightAwareGainCycling)) {
CreateDefaultSetup();
DriveOutOfStartup();
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/general_loss_algorithm_test.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/general_loss_algorithm_test.cc
index 42b97bf89f8..6d89cb93f06 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/general_loss_algorithm_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/general_loss_algorithm_test.cc
@@ -62,16 +62,15 @@ class GeneralLossAlgorithmTest : public QuicTest {
const AckedPacketVector& packets_acked,
const std::vector<uint64_t>& losses_expected) {
return VerifyLosses(largest_newly_acked, packets_acked, losses_expected,
- quiche::QuicheOptional<QuicPacketCount>(),
- quiche::QuicheOptional<QuicPacketCount>());
+ absl::nullopt, absl::nullopt);
}
void VerifyLosses(
uint64_t largest_newly_acked,
const AckedPacketVector& packets_acked,
const std::vector<uint64_t>& losses_expected,
- quiche::QuicheOptional<QuicPacketCount> max_sequence_reordering_expected,
- quiche::QuicheOptional<QuicPacketCount>
+ absl::optional<QuicPacketCount> max_sequence_reordering_expected,
+ absl::optional<QuicPacketCount>
num_borderline_time_reorderings_expected) {
unacked_packets_.MaybeUpdateLargestAckedOfPacketNumberSpace(
APPLICATION_DATA, QuicPacketNumber(largest_newly_acked));
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.cc
index 9d003c59a66..4b36e4a378e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.cc
@@ -4,12 +4,12 @@
#include "net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h"
+#include "absl/base/attributes.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/bbr2_sender.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/tcp_cubic_sender_bytes.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_pcc_sender.h"
@@ -46,7 +46,7 @@ SendAlgorithmInterface* SendAlgorithmInterface::Create(
: nullptr);
case kPCC:
// PCC is work has stalled, fall back to CUBIC instead.
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case kCubicBytes:
return new TcpCubicSenderBytes(
clock, rtt_stats, false /* don't use Reno */,
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h b/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h
index e3fc5e6b3f6..533bf4cc14d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h
@@ -24,7 +24,7 @@
namespace quic {
-typedef uint64_t QuicRoundTripCount;
+using QuicRoundTripCount = uint64_t;
class CachedNetworkParameters;
class RttStats;
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm.h b/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm.h
index c20cb78a5f1..169972e1439 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm.h
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm.h
@@ -5,10 +5,10 @@
#ifndef QUICHE_QUIC_CORE_CONGESTION_CONTROL_UBER_LOSS_ALGORITHM_H_
#define QUICHE_QUIC_CORE_CONGESTION_CONTROL_UBER_LOSS_ALGORITHM_H_
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/general_loss_algorithm.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
namespace quic {
@@ -20,8 +20,8 @@ class QuicSentPacketManagerPeer;
struct QUIC_EXPORT_PRIVATE LossDetectionParameters {
// See GeneralLossAlgorithm for the meaning of reordering_(shift|threshold).
- quiche::QuicheOptional<int> reordering_shift;
- quiche::QuicheOptional<QuicPacketCount> reordering_threshold;
+ absl::optional<int> reordering_shift;
+ absl::optional<QuicPacketCount> reordering_threshold;
};
class QUIC_EXPORT_PRIVATE LossDetectionTunerInterface {
diff --git a/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm_test.cc b/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm_test.cc
index 7a9d37ee107..788d1013439 100644
--- a/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/congestion_control/uber_loss_algorithm_test.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <utility>
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/rtt_stats.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -14,7 +15,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
namespace quic {
namespace test {
@@ -69,14 +69,14 @@ class UberLossAlgorithmTest : public QuicTest {
const AckedPacketVector& packets_acked,
const std::vector<uint64_t>& losses_expected) {
return VerifyLosses(largest_newly_acked, packets_acked, losses_expected,
- quiche::QuicheOptional<QuicPacketCount>());
+ absl::nullopt);
}
- void VerifyLosses(uint64_t largest_newly_acked,
- const AckedPacketVector& packets_acked,
- const std::vector<uint64_t>& losses_expected,
- quiche::QuicheOptional<QuicPacketCount>
- max_sequence_reordering_expected) {
+ void VerifyLosses(
+ uint64_t largest_newly_acked,
+ const AckedPacketVector& packets_acked,
+ const std::vector<uint64_t>& losses_expected,
+ absl::optional<QuicPacketCount> max_sequence_reordering_expected) {
LostPacketVector lost_packets;
LossDetectionInterface::DetectionStats stats = loss_algorithm_.DetectLosses(
*unacked_packets_, clock_.Now(), rtt_stats_,
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.cc
index f3be16e1d18..f31720a82a8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.cc
@@ -7,14 +7,14 @@
#include <cstdint>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/crypto.h"
#include "third_party/boringssl/src/include/openssl/err.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -34,7 +34,7 @@ void DLogOpenSslErrors() {
#else
while (uint32_t error = ERR_get_error()) {
char buf[120];
- ERR_error_string_n(error, buf, QUICHE_ARRAYSIZE(buf));
+ ERR_error_string_n(error, buf, ABSL_ARRAYSIZE(buf));
QUIC_DLOG(ERROR) << "OpenSSL error: " << buf;
}
#endif
@@ -69,7 +69,7 @@ AeadBaseDecrypter::AeadBaseDecrypter(const EVP_AEAD* (*aead_getter)(),
AeadBaseDecrypter::~AeadBaseDecrypter() {}
-bool AeadBaseDecrypter::SetKey(quiche::QuicheStringPiece key) {
+bool AeadBaseDecrypter::SetKey(absl::string_view key) {
DCHECK_EQ(key.size(), key_size_);
if (key.size() != key_size_) {
return false;
@@ -86,7 +86,7 @@ bool AeadBaseDecrypter::SetKey(quiche::QuicheStringPiece key) {
return true;
}
-bool AeadBaseDecrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
+bool AeadBaseDecrypter::SetNoncePrefix(absl::string_view nonce_prefix) {
if (use_ietf_nonce_construction_) {
QUIC_BUG << "Attempted to set nonce prefix on IETF QUIC crypter";
return false;
@@ -99,7 +99,7 @@ bool AeadBaseDecrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
return true;
}
-bool AeadBaseDecrypter::SetIV(quiche::QuicheStringPiece iv) {
+bool AeadBaseDecrypter::SetIV(absl::string_view iv) {
if (!use_ietf_nonce_construction_) {
QUIC_BUG << "Attempted to set IV on Google QUIC crypter";
return false;
@@ -112,7 +112,7 @@ bool AeadBaseDecrypter::SetIV(quiche::QuicheStringPiece iv) {
return true;
}
-bool AeadBaseDecrypter::SetPreliminaryKey(quiche::QuicheStringPiece key) {
+bool AeadBaseDecrypter::SetPreliminaryKey(absl::string_view key) {
DCHECK(!have_preliminary_key_);
SetKey(key);
have_preliminary_key_ = true;
@@ -132,10 +132,9 @@ bool AeadBaseDecrypter::SetDiversificationNonce(
prefix_size -= sizeof(QuicPacketNumber);
}
DiversifyPreliminaryKey(
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(key_), key_size_),
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(iv_),
- prefix_size),
- nonce, key_size_, prefix_size, &key, &nonce_prefix);
+ absl::string_view(reinterpret_cast<const char*>(key_), key_size_),
+ absl::string_view(reinterpret_cast<const char*>(iv_), prefix_size), nonce,
+ key_size_, prefix_size, &key, &nonce_prefix);
if (!SetKey(key) ||
(!use_ietf_nonce_construction_ && !SetNoncePrefix(nonce_prefix)) ||
@@ -149,8 +148,8 @@ bool AeadBaseDecrypter::SetDiversificationNonce(
}
bool AeadBaseDecrypter::DecryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) {
@@ -201,14 +200,13 @@ size_t AeadBaseDecrypter::GetIVSize() const {
return nonce_size_;
}
-quiche::QuicheStringPiece AeadBaseDecrypter::GetKey() const {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(key_),
- key_size_);
+absl::string_view AeadBaseDecrypter::GetKey() const {
+ return absl::string_view(reinterpret_cast<const char*>(key_), key_size_);
}
-quiche::QuicheStringPiece AeadBaseDecrypter::GetNoncePrefix() const {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(iv_),
- nonce_size_ - sizeof(QuicPacketNumber));
+absl::string_view AeadBaseDecrypter::GetNoncePrefix() const {
+ return absl::string_view(reinterpret_cast<const char*>(iv_),
+ nonce_size_ - sizeof(QuicPacketNumber));
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h
index e69b0edddc8..c4c04fe8f1b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h
@@ -7,10 +7,10 @@
#include <cstddef>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/aead.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -29,22 +29,22 @@ class QUIC_EXPORT_PRIVATE AeadBaseDecrypter : public QuicDecrypter {
~AeadBaseDecrypter() override;
// QuicDecrypter implementation
- bool SetKey(quiche::QuicheStringPiece key) override;
- bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
- bool SetIV(quiche::QuicheStringPiece iv) override;
- bool SetPreliminaryKey(quiche::QuicheStringPiece key) override;
+ bool SetKey(absl::string_view key) override;
+ bool SetNoncePrefix(absl::string_view nonce_prefix) override;
+ bool SetIV(absl::string_view iv) override;
+ bool SetPreliminaryKey(absl::string_view key) override;
bool SetDiversificationNonce(const DiversificationNonce& nonce) override;
bool DecryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) override;
size_t GetKeySize() const override;
size_t GetNoncePrefixSize() const override;
size_t GetIVSize() const override;
- quiche::QuicheStringPiece GetKey() const override;
- quiche::QuicheStringPiece GetNoncePrefix() const override;
+ absl::string_view GetKey() const override;
+ absl::string_view GetNoncePrefix() const override;
protected:
// Make these constants available to the subclasses so that the subclasses
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.cc
index 14aca267927..b87ea50aede 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.cc
@@ -4,15 +4,14 @@
#include "net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h"
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/crypto.h"
#include "third_party/boringssl/src/include/openssl/err.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_aligned.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -27,7 +26,7 @@ void DLogOpenSslErrors() {
#else
while (unsigned long error = ERR_get_error()) {
char buf[120];
- ERR_error_string_n(error, buf, QUICHE_ARRAYSIZE(buf));
+ ERR_error_string_n(error, buf, ABSL_ARRAYSIZE(buf));
QUIC_DLOG(ERROR) << "OpenSSL error: " << buf;
}
#endif
@@ -59,7 +58,7 @@ AeadBaseEncrypter::AeadBaseEncrypter(const EVP_AEAD* (*aead_getter)(),
AeadBaseEncrypter::~AeadBaseEncrypter() {}
-bool AeadBaseEncrypter::SetKey(quiche::QuicheStringPiece key) {
+bool AeadBaseEncrypter::SetKey(absl::string_view key) {
DCHECK_EQ(key.size(), key_size_);
if (key.size() != key_size_) {
return false;
@@ -77,7 +76,7 @@ bool AeadBaseEncrypter::SetKey(quiche::QuicheStringPiece key) {
return true;
}
-bool AeadBaseEncrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
+bool AeadBaseEncrypter::SetNoncePrefix(absl::string_view nonce_prefix) {
if (use_ietf_nonce_construction_) {
QUIC_BUG << "Attempted to set nonce prefix on IETF QUIC crypter";
return false;
@@ -90,7 +89,7 @@ bool AeadBaseEncrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
return true;
}
-bool AeadBaseEncrypter::SetIV(quiche::QuicheStringPiece iv) {
+bool AeadBaseEncrypter::SetIV(absl::string_view iv) {
if (!use_ietf_nonce_construction_) {
QUIC_BUG << "Attempted to set IV on Google QUIC crypter";
return false;
@@ -103,9 +102,9 @@ bool AeadBaseEncrypter::SetIV(quiche::QuicheStringPiece iv) {
return true;
}
-bool AeadBaseEncrypter::Encrypt(quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+bool AeadBaseEncrypter::Encrypt(absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
unsigned char* output) {
DCHECK_EQ(nonce.size(), nonce_size_);
@@ -125,8 +124,8 @@ bool AeadBaseEncrypter::Encrypt(quiche::QuicheStringPiece nonce,
}
bool AeadBaseEncrypter::EncryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) {
@@ -136,7 +135,7 @@ bool AeadBaseEncrypter::EncryptPacket(uint64_t packet_number,
}
// TODO(ianswett): Introduce a check to ensure that we don't encrypt with the
// same packet number twice.
- QUIC_ALIGNED(4) char nonce_buffer[kMaxNonceSize];
+ alignas(4) char nonce_buffer[kMaxNonceSize];
memcpy(nonce_buffer, iv_, nonce_size_);
size_t prefix_len = nonce_size_ - sizeof(packet_number);
if (use_ietf_nonce_construction_) {
@@ -148,9 +147,8 @@ bool AeadBaseEncrypter::EncryptPacket(uint64_t packet_number,
memcpy(nonce_buffer + prefix_len, &packet_number, sizeof(packet_number));
}
- if (!Encrypt(quiche::QuicheStringPiece(nonce_buffer, nonce_size_),
- associated_data, plaintext,
- reinterpret_cast<unsigned char*>(output))) {
+ if (!Encrypt(absl::string_view(nonce_buffer, nonce_size_), associated_data,
+ plaintext, reinterpret_cast<unsigned char*>(output))) {
return false;
}
*output_length = ciphertext_size;
@@ -177,14 +175,13 @@ size_t AeadBaseEncrypter::GetCiphertextSize(size_t plaintext_size) const {
return plaintext_size + auth_tag_size_;
}
-quiche::QuicheStringPiece AeadBaseEncrypter::GetKey() const {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(key_),
- key_size_);
+absl::string_view AeadBaseEncrypter::GetKey() const {
+ return absl::string_view(reinterpret_cast<const char*>(key_), key_size_);
}
-quiche::QuicheStringPiece AeadBaseEncrypter::GetNoncePrefix() const {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(iv_),
- GetNoncePrefixSize());
+absl::string_view AeadBaseEncrypter::GetNoncePrefix() const {
+ return absl::string_view(reinterpret_cast<const char*>(iv_),
+ GetNoncePrefixSize());
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h
index 5209a023caa..5ef8b96d11a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h
@@ -7,10 +7,10 @@
#include <cstddef>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/aead.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -29,12 +29,12 @@ class QUIC_EXPORT_PRIVATE AeadBaseEncrypter : public QuicEncrypter {
~AeadBaseEncrypter() override;
// QuicEncrypter implementation
- bool SetKey(quiche::QuicheStringPiece key) override;
- bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
- bool SetIV(quiche::QuicheStringPiece iv) override;
+ bool SetKey(absl::string_view key) override;
+ bool SetNoncePrefix(absl::string_view nonce_prefix) override;
+ bool SetIV(absl::string_view iv) override;
bool EncryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) override;
@@ -43,14 +43,14 @@ class QUIC_EXPORT_PRIVATE AeadBaseEncrypter : public QuicEncrypter {
size_t GetIVSize() const override;
size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
size_t GetCiphertextSize(size_t plaintext_size) const override;
- quiche::QuicheStringPiece GetKey() const override;
- quiche::QuicheStringPiece GetNoncePrefix() const override;
+ absl::string_view GetKey() const override;
+ absl::string_view GetNoncePrefix() const override;
// Necessary so unit tests can explicitly specify a nonce, instead of an IV
// (or nonce prefix) and packet number.
- bool Encrypt(quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ bool Encrypt(absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
unsigned char* output);
protected:
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
index 0319d4280f0..aba1001b6ea 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_decrypter_test.cc
@@ -7,11 +7,12 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -202,12 +203,12 @@ namespace test {
// DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the plaintext.
QuicData* DecryptWithNonce(Aes128Gcm12Decrypter* decrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view ciphertext) {
uint64_t packet_number;
- quiche::QuicheStringPiece nonce_prefix(nonce.data(),
- nonce.size() - sizeof(packet_number));
+ absl::string_view nonce_prefix(nonce.data(),
+ nonce.size() - sizeof(packet_number));
decrypter->SetNoncePrefix(nonce_prefix);
memcpy(&packet_number, nonce.data() + nonce_prefix.size(),
sizeof(packet_number));
@@ -225,7 +226,7 @@ QuicData* DecryptWithNonce(Aes128Gcm12Decrypter* decrypter,
class Aes128Gcm12DecrypterTest : public QuicTest {};
TEST_F(Aes128Gcm12DecrypterTest, Decrypt) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_group_array); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_group_array); i++) {
SCOPED_TRACE(i);
const TestVector* test_vectors = test_group_array[i];
const TestGroupInfo& test_info = test_group_info[i];
@@ -234,14 +235,14 @@ TEST_F(Aes128Gcm12DecrypterTest, Decrypt) {
bool has_pt = test_vectors[j].pt;
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
- std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
+ std::string key = absl::HexStringToBytes(test_vectors[j].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[j].iv);
+ std::string ct = absl::HexStringToBytes(test_vectors[j].ct);
+ std::string aad = absl::HexStringToBytes(test_vectors[j].aad);
+ std::string tag = absl::HexStringToBytes(test_vectors[j].tag);
std::string pt;
if (has_pt) {
- pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
+ pt = absl::HexStringToBytes(test_vectors[j].pt);
}
// The test vector's lengths should look sane. Note that the lengths
@@ -270,7 +271,7 @@ TEST_F(Aes128Gcm12DecrypterTest, Decrypt) {
// This deliberately tests that the decrypter can
// handle an AAD that is set to nullptr, as opposed
// to a zero-length, non-nullptr pointer.
- aad.length() ? aad : quiche::QuicheStringPiece(), ciphertext));
+ aad.length() ? aad : absl::string_view(), ciphertext));
if (!decrypted) {
EXPECT_FALSE(has_pt);
continue;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc
index bc3f6112867..1495fd08be1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter_test.cc
@@ -7,11 +7,12 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -160,9 +161,9 @@ namespace test {
// EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the ciphertext.
QuicData* EncryptWithNonce(Aes128Gcm12Encrypter* encrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view plaintext) {
size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
@@ -177,18 +178,18 @@ QuicData* EncryptWithNonce(Aes128Gcm12Encrypter* encrypter,
class Aes128Gcm12EncrypterTest : public QuicTest {};
TEST_F(Aes128Gcm12EncrypterTest, Encrypt) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_group_array); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_group_array); i++) {
SCOPED_TRACE(i);
const TestVector* test_vectors = test_group_array[i];
const TestGroupInfo& test_info = test_group_info[i];
for (size_t j = 0; test_vectors[j].key != nullptr; j++) {
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
- std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
- std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
+ std::string key = absl::HexStringToBytes(test_vectors[j].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[j].iv);
+ std::string pt = absl::HexStringToBytes(test_vectors[j].pt);
+ std::string aad = absl::HexStringToBytes(test_vectors[j].aad);
+ std::string ct = absl::HexStringToBytes(test_vectors[j].ct);
+ std::string tag = absl::HexStringToBytes(test_vectors[j].tag);
// The test vector's lengths should look sane. Note that the lengths
// in |test_info| are in bits.
@@ -201,12 +202,12 @@ TEST_F(Aes128Gcm12EncrypterTest, Encrypt) {
Aes128Gcm12Encrypter encrypter;
ASSERT_TRUE(encrypter.SetKey(key));
- std::unique_ptr<QuicData> encrypted(EncryptWithNonce(
- &encrypter, iv,
- // This deliberately tests that the encrypter can
- // handle an AAD that is set to nullptr, as opposed
- // to a zero-length, non-nullptr pointer.
- aad.length() ? aad : quiche::QuicheStringPiece(), pt));
+ std::unique_ptr<QuicData> encrypted(
+ EncryptWithNonce(&encrypter, iv,
+ // This deliberately tests that the encrypter can
+ // handle an AAD that is set to nullptr, as opposed
+ // to a zero-length, non-nullptr pointer.
+ aad.length() ? aad : absl::string_view(), pt));
ASSERT_TRUE(encrypted.get());
// The test vectors have 16 byte authenticators but this code only uses
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_decrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_decrypter_test.cc
index a444284618f..d4f38b90019 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_decrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_decrypter_test.cc
@@ -7,10 +7,11 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -201,9 +202,9 @@ namespace test {
// DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the plaintext.
QuicData* DecryptWithNonce(Aes128GcmDecrypter* decrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view ciphertext) {
decrypter->SetIV(nonce);
std::unique_ptr<char[]> output(new char[ciphertext.length()]);
size_t output_length = 0;
@@ -219,7 +220,7 @@ QuicData* DecryptWithNonce(Aes128GcmDecrypter* decrypter,
class Aes128GcmDecrypterTest : public QuicTest {};
TEST_F(Aes128GcmDecrypterTest, Decrypt) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_group_array); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_group_array); i++) {
SCOPED_TRACE(i);
const TestVector* test_vectors = test_group_array[i];
const TestGroupInfo& test_info = test_group_info[i];
@@ -228,14 +229,14 @@ TEST_F(Aes128GcmDecrypterTest, Decrypt) {
bool has_pt = test_vectors[j].pt;
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
- std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
+ std::string key = absl::HexStringToBytes(test_vectors[j].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[j].iv);
+ std::string ct = absl::HexStringToBytes(test_vectors[j].ct);
+ std::string aad = absl::HexStringToBytes(test_vectors[j].aad);
+ std::string tag = absl::HexStringToBytes(test_vectors[j].tag);
std::string pt;
if (has_pt) {
- pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
+ pt = absl::HexStringToBytes(test_vectors[j].pt);
}
// The test vector's lengths should look sane. Note that the lengths
@@ -258,7 +259,7 @@ TEST_F(Aes128GcmDecrypterTest, Decrypt) {
// This deliberately tests that the decrypter can
// handle an AAD that is set to nullptr, as opposed
// to a zero-length, non-nullptr pointer.
- aad.length() ? aad : quiche::QuicheStringPiece(), ciphertext));
+ aad.length() ? aad : absl::string_view(), ciphertext));
if (!decrypted) {
EXPECT_FALSE(has_pt);
continue;
@@ -274,15 +275,14 @@ TEST_F(Aes128GcmDecrypterTest, Decrypt) {
TEST_F(Aes128GcmDecrypterTest, GenerateHeaderProtectionMask) {
Aes128GcmDecrypter decrypter;
- std::string key =
- quiche::QuicheTextUtils::HexDecode("d9132370cb18476ab833649cf080d970");
+ std::string key = absl::HexStringToBytes("d9132370cb18476ab833649cf080d970");
std::string sample =
- quiche::QuicheTextUtils::HexDecode("d1d7998068517adb769b48b924a32c47");
+ absl::HexStringToBytes("d1d7998068517adb769b48b924a32c47");
QuicDataReader sample_reader(sample.data(), sample.size());
ASSERT_TRUE(decrypter.SetHeaderProtectionKey(key));
std::string mask = decrypter.GenerateHeaderProtectionMask(&sample_reader);
std::string expected_mask =
- quiche::QuicheTextUtils::HexDecode("b132c37d6164da4ea4dc9b763aceec27");
+ absl::HexStringToBytes("b132c37d6164da4ea4dc9b763aceec27");
quiche::test::CompareCharArraysWithHexError(
"header protection mask", mask.data(), mask.size(), expected_mask.data(),
expected_mask.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_encrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_encrypter_test.cc
index 69f8c4d0f3e..c7c096f2b88 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_encrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_encrypter_test.cc
@@ -7,10 +7,11 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -159,9 +160,9 @@ namespace test {
// EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the ciphertext.
QuicData* EncryptWithNonce(Aes128GcmEncrypter* encrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view plaintext) {
size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
@@ -176,18 +177,18 @@ QuicData* EncryptWithNonce(Aes128GcmEncrypter* encrypter,
class Aes128GcmEncrypterTest : public QuicTest {};
TEST_F(Aes128GcmEncrypterTest, Encrypt) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_group_array); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_group_array); i++) {
SCOPED_TRACE(i);
const TestVector* test_vectors = test_group_array[i];
const TestGroupInfo& test_info = test_group_info[i];
for (size_t j = 0; test_vectors[j].key != nullptr; j++) {
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
- std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
- std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
+ std::string key = absl::HexStringToBytes(test_vectors[j].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[j].iv);
+ std::string pt = absl::HexStringToBytes(test_vectors[j].pt);
+ std::string aad = absl::HexStringToBytes(test_vectors[j].aad);
+ std::string ct = absl::HexStringToBytes(test_vectors[j].ct);
+ std::string tag = absl::HexStringToBytes(test_vectors[j].tag);
// The test vector's lengths should look sane. Note that the lengths
// in |test_info| are in bits.
@@ -200,12 +201,12 @@ TEST_F(Aes128GcmEncrypterTest, Encrypt) {
Aes128GcmEncrypter encrypter;
ASSERT_TRUE(encrypter.SetKey(key));
- std::unique_ptr<QuicData> encrypted(EncryptWithNonce(
- &encrypter, iv,
- // This deliberately tests that the encrypter can
- // handle an AAD that is set to nullptr, as opposed
- // to a zero-length, non-nullptr pointer.
- aad.length() ? aad : quiche::QuicheStringPiece(), pt));
+ std::unique_ptr<QuicData> encrypted(
+ EncryptWithNonce(&encrypter, iv,
+ // This deliberately tests that the encrypter can
+ // handle an AAD that is set to nullptr, as opposed
+ // to a zero-length, non-nullptr pointer.
+ aad.length() ? aad : absl::string_view(), pt));
ASSERT_TRUE(encrypted.get());
ASSERT_EQ(ct.length() + tag.length(), encrypted->length());
@@ -219,16 +220,13 @@ TEST_F(Aes128GcmEncrypterTest, Encrypt) {
}
TEST_F(Aes128GcmEncrypterTest, EncryptPacket) {
- std::string key =
- quiche::QuicheTextUtils::HexDecode("d95a145250826c25a77b6a84fd4d34fc");
- std::string iv =
- quiche::QuicheTextUtils::HexDecode("50c4431ebb18283448e276e2");
+ std::string key = absl::HexStringToBytes("d95a145250826c25a77b6a84fd4d34fc");
+ std::string iv = absl::HexStringToBytes("50c4431ebb18283448e276e2");
uint64_t packet_num = 0x13278f44;
std::string aad =
- quiche::QuicheTextUtils::HexDecode("875d49f64a70c9cbe713278f44ff000005");
- std::string pt =
- quiche::QuicheTextUtils::HexDecode("aa0003a250bd000000000001");
- std::string ct = quiche::QuicheTextUtils::HexDecode(
+ absl::HexStringToBytes("875d49f64a70c9cbe713278f44ff000005");
+ std::string pt = absl::HexStringToBytes("aa0003a250bd000000000001");
+ std::string ct = absl::HexStringToBytes(
"7dd4708b989ee7d38a013e3656e9b37beefd05808fe1ab41e3b4f2c0");
std::vector<char> out(ct.size());
@@ -260,14 +258,13 @@ TEST_F(Aes128GcmEncrypterTest, GetCiphertextSize) {
TEST_F(Aes128GcmEncrypterTest, GenerateHeaderProtectionMask) {
Aes128GcmEncrypter encrypter;
- std::string key =
- quiche::QuicheTextUtils::HexDecode("d9132370cb18476ab833649cf080d970");
+ std::string key = absl::HexStringToBytes("d9132370cb18476ab833649cf080d970");
std::string sample =
- quiche::QuicheTextUtils::HexDecode("d1d7998068517adb769b48b924a32c47");
+ absl::HexStringToBytes("d1d7998068517adb769b48b924a32c47");
ASSERT_TRUE(encrypter.SetHeaderProtectionKey(key));
std::string mask = encrypter.GenerateHeaderProtectionMask(sample);
std::string expected_mask =
- quiche::QuicheTextUtils::HexDecode("b132c37d6164da4ea4dc9b763aceec27");
+ absl::HexStringToBytes("b132c37d6164da4ea4dc9b763aceec27");
quiche::test::CompareCharArraysWithHexError(
"header protection mask", mask.data(), mask.size(), expected_mask.data(),
expected_mask.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_decrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_decrypter_test.cc
index 7c6972489e4..c688ce45ca8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_decrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_decrypter_test.cc
@@ -7,11 +7,12 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -206,9 +207,9 @@ namespace test {
// DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the plaintext.
QuicData* DecryptWithNonce(Aes256GcmDecrypter* decrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view ciphertext) {
decrypter->SetIV(nonce);
std::unique_ptr<char[]> output(new char[ciphertext.length()]);
size_t output_length = 0;
@@ -224,7 +225,7 @@ QuicData* DecryptWithNonce(Aes256GcmDecrypter* decrypter,
class Aes256GcmDecrypterTest : public QuicTest {};
TEST_F(Aes256GcmDecrypterTest, Decrypt) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_group_array); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_group_array); i++) {
SCOPED_TRACE(i);
const TestVector* test_vectors = test_group_array[i];
const TestGroupInfo& test_info = test_group_info[i];
@@ -233,14 +234,14 @@ TEST_F(Aes256GcmDecrypterTest, Decrypt) {
bool has_pt = test_vectors[j].pt;
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
- std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
+ std::string key = absl::HexStringToBytes(test_vectors[j].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[j].iv);
+ std::string ct = absl::HexStringToBytes(test_vectors[j].ct);
+ std::string aad = absl::HexStringToBytes(test_vectors[j].aad);
+ std::string tag = absl::HexStringToBytes(test_vectors[j].tag);
std::string pt;
if (has_pt) {
- pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
+ pt = absl::HexStringToBytes(test_vectors[j].pt);
}
// The test vector's lengths should look sane. Note that the lengths
@@ -263,7 +264,7 @@ TEST_F(Aes256GcmDecrypterTest, Decrypt) {
// This deliberately tests that the decrypter can
// handle an AAD that is set to nullptr, as opposed
// to a zero-length, non-nullptr pointer.
- aad.length() ? aad : quiche::QuicheStringPiece(), ciphertext));
+ aad.length() ? aad : absl::string_view(), ciphertext));
if (!decrypted) {
EXPECT_FALSE(has_pt);
continue;
@@ -279,15 +280,15 @@ TEST_F(Aes256GcmDecrypterTest, Decrypt) {
TEST_F(Aes256GcmDecrypterTest, GenerateHeaderProtectionMask) {
Aes256GcmDecrypter decrypter;
- std::string key = quiche::QuicheTextUtils::HexDecode(
+ std::string key = absl::HexStringToBytes(
"ed23ecbf54d426def5c52c3dcfc84434e62e57781d3125bb21ed91b7d3e07788");
std::string sample =
- quiche::QuicheTextUtils::HexDecode("4d190c474be2b8babafb49ec4e38e810");
+ absl::HexStringToBytes("4d190c474be2b8babafb49ec4e38e810");
QuicDataReader sample_reader(sample.data(), sample.size());
ASSERT_TRUE(decrypter.SetHeaderProtectionKey(key));
std::string mask = decrypter.GenerateHeaderProtectionMask(&sample_reader);
std::string expected_mask =
- quiche::QuicheTextUtils::HexDecode("db9ed4e6ccd033af2eae01407199c56e");
+ absl::HexStringToBytes("db9ed4e6ccd033af2eae01407199c56e");
quiche::test::CompareCharArraysWithHexError(
"header protection mask", mask.data(), mask.size(), expected_mask.data(),
expected_mask.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_encrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_encrypter_test.cc
index 089926261d8..c09f8a84638 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_encrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_encrypter_test.cc
@@ -7,11 +7,12 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -167,9 +168,9 @@ namespace test {
// EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the ciphertext.
QuicData* EncryptWithNonce(Aes256GcmEncrypter* encrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view plaintext) {
size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
@@ -184,18 +185,18 @@ QuicData* EncryptWithNonce(Aes256GcmEncrypter* encrypter,
class Aes256GcmEncrypterTest : public QuicTest {};
TEST_F(Aes256GcmEncrypterTest, Encrypt) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_group_array); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_group_array); i++) {
SCOPED_TRACE(i);
const TestVector* test_vectors = test_group_array[i];
const TestGroupInfo& test_info = test_group_info[i];
for (size_t j = 0; test_vectors[j].key != nullptr; j++) {
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[j].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[j].iv);
- std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[j].pt);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[j].aad);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[j].ct);
- std::string tag = quiche::QuicheTextUtils::HexDecode(test_vectors[j].tag);
+ std::string key = absl::HexStringToBytes(test_vectors[j].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[j].iv);
+ std::string pt = absl::HexStringToBytes(test_vectors[j].pt);
+ std::string aad = absl::HexStringToBytes(test_vectors[j].aad);
+ std::string ct = absl::HexStringToBytes(test_vectors[j].ct);
+ std::string tag = absl::HexStringToBytes(test_vectors[j].tag);
// The test vector's lengths should look sane. Note that the lengths
// in |test_info| are in bits.
@@ -208,12 +209,12 @@ TEST_F(Aes256GcmEncrypterTest, Encrypt) {
Aes256GcmEncrypter encrypter;
ASSERT_TRUE(encrypter.SetKey(key));
- std::unique_ptr<QuicData> encrypted(EncryptWithNonce(
- &encrypter, iv,
- // This deliberately tests that the encrypter can
- // handle an AAD that is set to nullptr, as opposed
- // to a zero-length, non-nullptr pointer.
- aad.length() ? aad : quiche::QuicheStringPiece(), pt));
+ std::unique_ptr<QuicData> encrypted(
+ EncryptWithNonce(&encrypter, iv,
+ // This deliberately tests that the encrypter can
+ // handle an AAD that is set to nullptr, as opposed
+ // to a zero-length, non-nullptr pointer.
+ aad.length() ? aad : absl::string_view(), pt));
ASSERT_TRUE(encrypted.get());
ASSERT_EQ(ct.length() + tag.length(), encrypted->length());
@@ -242,14 +243,14 @@ TEST_F(Aes256GcmEncrypterTest, GetCiphertextSize) {
TEST_F(Aes256GcmEncrypterTest, GenerateHeaderProtectionMask) {
Aes256GcmEncrypter encrypter;
- std::string key = quiche::QuicheTextUtils::HexDecode(
+ std::string key = absl::HexStringToBytes(
"ed23ecbf54d426def5c52c3dcfc84434e62e57781d3125bb21ed91b7d3e07788");
std::string sample =
- quiche::QuicheTextUtils::HexDecode("4d190c474be2b8babafb49ec4e38e810");
+ absl::HexStringToBytes("4d190c474be2b8babafb49ec4e38e810");
ASSERT_TRUE(encrypter.SetHeaderProtectionKey(key));
std::string mask = encrypter.GenerateHeaderProtectionMask(sample);
std::string expected_mask =
- quiche::QuicheTextUtils::HexDecode("db9ed4e6ccd033af2eae01407199c56e");
+ absl::HexStringToBytes("db9ed4e6ccd033af2eae01407199c56e");
quiche::test::CompareCharArraysWithHexError(
"header protection mask", mask.data(), mask.size(), expected_mask.data(),
expected_mask.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.cc
index f8c83f3118a..464e7656783 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.cc
@@ -4,13 +4,13 @@
#include "net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
-bool AesBaseDecrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
+bool AesBaseDecrypter::SetHeaderProtectionKey(absl::string_view key) {
if (key.size() != GetKeySize()) {
QUIC_BUG << "Invalid key size for header protection";
return false;
@@ -25,7 +25,7 @@ bool AesBaseDecrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
std::string AesBaseDecrypter::GenerateHeaderProtectionMask(
QuicDataReader* sample_reader) {
- quiche::QuicheStringPiece sample;
+ absl::string_view sample;
if (!sample_reader->ReadStringPiece(&sample, AES_BLOCK_SIZE)) {
return std::string();
}
@@ -36,4 +36,17 @@ std::string AesBaseDecrypter::GenerateHeaderProtectionMask(
return out;
}
+QuicPacketCount AesBaseDecrypter::GetIntegrityLimit() const {
+ // For AEAD_AES_128_GCM ... endpoints that do not attempt to remove
+ // protection from packets larger than 2^11 bytes can attempt to remove
+ // protection from at most 2^57 packets.
+ // For AEAD_AES_256_GCM [the limit] is substantially larger than the limit for
+ // AEAD_AES_128_GCM. However, this document recommends that the same limit be
+ // applied to both functions as either limit is acceptably large.
+ // https://quicwg.org/base-drafts/draft-ietf-quic-tls.html#name-integrity-limit
+ static_assert(kMaxIncomingPacketSize <= 2048,
+ "This key limit requires limits on decryption payload sizes");
+ return 144115188075855872U;
+}
+
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.h
index 2ff63a7ab2c..ced98103b90 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.h
@@ -7,10 +7,10 @@
#include <cstddef>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -18,9 +18,10 @@ class QUIC_EXPORT_PRIVATE AesBaseDecrypter : public AeadBaseDecrypter {
public:
using AeadBaseDecrypter::AeadBaseDecrypter;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
std::string GenerateHeaderProtectionMask(
QuicDataReader* sample_reader) override;
+ QuicPacketCount GetIntegrityLimit() const override;
private:
// The key used for packet number encryption.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.cc
index c620329e226..6e998f8451e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.cc
@@ -4,13 +4,13 @@
#include "net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
-bool AesBaseEncrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
+bool AesBaseEncrypter::SetHeaderProtectionKey(absl::string_view key) {
if (key.size() != GetKeySize()) {
QUIC_BUG << "Invalid key size for header protection: " << key.size();
return false;
@@ -24,7 +24,7 @@ bool AesBaseEncrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
}
std::string AesBaseEncrypter::GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) {
+ absl::string_view sample) {
if (sample.size() != AES_BLOCK_SIZE) {
return std::string();
}
@@ -35,4 +35,13 @@ std::string AesBaseEncrypter::GenerateHeaderProtectionMask(
return out;
}
+QuicPacketCount AesBaseEncrypter::GetConfidentialityLimit() const {
+ // For AEAD_AES_128_GCM and AEAD_AES_256_GCM ... endpoints that do not send
+ // packets larger than 2^11 bytes cannot protect more than 2^28 packets.
+ // https://quicwg.org/base-drafts/draft-ietf-quic-tls.html#name-confidentiality-limit
+ static_assert(kMaxOutgoingPacketSize <= 2048,
+ "This key limit requires limits on encryption payload sizes");
+ return 268435456U;
+}
+
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.h
index ba518fe5593..6b1c98c7566 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.h
@@ -7,10 +7,10 @@
#include <cstddef>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/aes.h"
#include "net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -18,9 +18,9 @@ class QUIC_EXPORT_PRIVATE AesBaseEncrypter : public AeadBaseEncrypter {
public:
using AeadBaseEncrypter::AeadBaseEncrypter;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
- std::string GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
+ std::string GenerateHeaderProtectionMask(absl::string_view sample) override;
+ QuicPacketCount GetConfidentialityLimit() const override;
private:
// The key used for packet number encryption.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/boring_utils.h b/chromium/net/third_party/quiche/src/quic/core/crypto/boring_utils.h
index 5af87ae2c5c..9de61f4d896 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/boring_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/boring_utils.h
@@ -5,19 +5,18 @@
#ifndef QUICHE_QUIC_CORE_CRYPTO_BORING_UTILS_H_
#define QUICHE_QUIC_CORE_CRYPTO_BORING_UTILS_H_
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
-inline QUIC_EXPORT_PRIVATE quiche::QuicheStringPiece CbsToStringPiece(CBS cbs) {
- return quiche::QuicheStringPiece(
- reinterpret_cast<const char*>(CBS_data(&cbs)), CBS_len(&cbs));
+inline QUIC_EXPORT_PRIVATE absl::string_view CbsToStringPiece(CBS cbs) {
+ return absl::string_view(reinterpret_cast<const char*>(CBS_data(&cbs)),
+ CBS_len(&cbs));
}
-inline QUIC_EXPORT_PRIVATE CBS
-StringPieceToCbs(quiche::QuicheStringPiece piece) {
+inline QUIC_EXPORT_PRIVATE CBS StringPieceToCbs(absl::string_view piece) {
CBS result;
CBS_init(&result, reinterpret_cast<const uint8_t*>(piece.data()),
piece.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.cc
index a1ba748730e..ec5ebacbb08 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.cc
@@ -9,8 +9,8 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "third_party/zlib/zlib.h"
namespace quic {
@@ -175,11 +175,10 @@ struct CertEntry {
// efficiently represent |certs| to a peer who has the common sets identified
// by |client_common_set_hashes| and who has cached the certificates with the
// 64-bit, FNV-1a hashes in |client_cached_cert_hashes|.
-std::vector<CertEntry> MatchCerts(
- const std::vector<std::string>& certs,
- quiche::QuicheStringPiece client_common_set_hashes,
- quiche::QuicheStringPiece client_cached_cert_hashes,
- const CommonCertSets* common_sets) {
+std::vector<CertEntry> MatchCerts(const std::vector<std::string>& certs,
+ absl::string_view client_common_set_hashes,
+ absl::string_view client_cached_cert_hashes,
+ const CommonCertSets* common_sets) {
std::vector<CertEntry> entries;
entries.reserve(certs.size());
@@ -330,12 +329,12 @@ std::vector<uint64_t> HashCerts(const std::vector<std::string>& certs) {
// |in_out| and writes them to |out_entries|. CACHED and COMMON entries are
// resolved using |cached_certs| and |common_sets| and written to |out_certs|.
// |in_out| is updated to contain the trailing data.
-bool ParseEntries(quiche::QuicheStringPiece* in_out,
+bool ParseEntries(absl::string_view* in_out,
const std::vector<std::string>& cached_certs,
const CommonCertSets* common_sets,
std::vector<CertEntry>* out_entries,
std::vector<std::string>* out_certs) {
- quiche::QuicheStringPiece in = *in_out;
+ absl::string_view in = *in_out;
std::vector<uint64_t> cached_hashes;
out_entries->clear();
@@ -394,7 +393,7 @@ bool ParseEntries(quiche::QuicheStringPiece* in_out,
memcpy(&entry.index, in.data(), sizeof(uint32_t));
in.remove_prefix(sizeof(uint32_t));
- quiche::QuicheStringPiece cert =
+ absl::string_view cert =
common_sets->GetCert(entry.set_hash, entry.index);
if (cert.empty()) {
return false;
@@ -452,8 +451,8 @@ class ScopedZLib {
// static
std::string CertCompressor::CompressChain(
const std::vector<std::string>& certs,
- quiche::QuicheStringPiece client_common_set_hashes,
- quiche::QuicheStringPiece client_cached_cert_hashes,
+ absl::string_view client_common_set_hashes,
+ absl::string_view client_cached_cert_hashes,
const CommonCertSets* common_sets) {
const std::vector<CertEntry> entries = MatchCerts(
certs, client_common_set_hashes, client_cached_cert_hashes, common_sets);
@@ -553,7 +552,7 @@ std::string CertCompressor::CompressChain(
// static
bool CertCompressor::DecompressChain(
- quiche::QuicheStringPiece in,
+ absl::string_view in,
const std::vector<std::string>& cached_certs,
const CommonCertSets* common_sets,
std::vector<std::string>* out_certs) {
@@ -564,7 +563,7 @@ bool CertCompressor::DecompressChain(
DCHECK_EQ(entries.size(), out_certs->size());
std::unique_ptr<uint8_t[]> uncompressed_data;
- quiche::QuicheStringPiece uncompressed;
+ absl::string_view uncompressed;
if (!in.empty()) {
if (in.size() < sizeof(uint32_t)) {
@@ -609,7 +608,7 @@ bool CertCompressor::DecompressChain(
return false;
}
- uncompressed = quiche::QuicheStringPiece(
+ uncompressed = absl::string_view(
reinterpret_cast<char*>(uncompressed_data.get()), uncompressed_size);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.h b/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.h
index dfb4d21c916..a9e9ec90520 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor.h
@@ -8,10 +8,10 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/common_cert_set.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,17 +36,16 @@ class QUIC_EXPORT_PRIVATE CertCompressor {
// sets known locally and |client_common_set_hashes| contains the hashes of
// the common sets known to the peer. |client_cached_cert_hashes| contains
// 64-bit, FNV-1a hashes of certificates that the peer already possesses.
- static std::string CompressChain(
- const std::vector<std::string>& certs,
- quiche::QuicheStringPiece client_common_set_hashes,
- quiche::QuicheStringPiece client_cached_cert_hashes,
- const CommonCertSets* common_sets);
+ static std::string CompressChain(const std::vector<std::string>& certs,
+ absl::string_view client_common_set_hashes,
+ absl::string_view client_cached_cert_hashes,
+ const CommonCertSets* common_sets);
// DecompressChain decompresses the result of |CompressChain|, given in |in|,
// into a series of certificates that are written to |out_certs|.
// |cached_certs| contains certificates that the peer may have omitted and
// |common_sets| contains the common certificate sets known locally.
- static bool DecompressChain(quiche::QuicheStringPiece in,
+ static bool DecompressChain(absl::string_view in,
const std::vector<std::string>& cached_certs,
const CommonCertSets* common_sets,
std::vector<std::string>* out_certs);
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor_test.cc
index a7517f4c180..87446acf86a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/cert_compressor_test.cc
@@ -7,10 +7,11 @@
#include <memory>
#include <string>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -21,8 +22,8 @@ class CertCompressorTest : public QuicTest {};
TEST_F(CertCompressorTest, EmptyChain) {
std::vector<std::string> chain;
const std::string compressed = CertCompressor::CompressChain(
- chain, quiche::QuicheStringPiece(), quiche::QuicheStringPiece(), nullptr);
- EXPECT_EQ("00", quiche::QuicheTextUtils::HexEncode(compressed));
+ chain, absl::string_view(), absl::string_view(), nullptr);
+ EXPECT_EQ("00", absl::BytesToHexString(compressed));
std::vector<std::string> chain2, cached_certs;
ASSERT_TRUE(CertCompressor::DecompressChain(compressed, cached_certs, nullptr,
@@ -34,10 +35,9 @@ TEST_F(CertCompressorTest, Compressed) {
std::vector<std::string> chain;
chain.push_back("testcert");
const std::string compressed = CertCompressor::CompressChain(
- chain, quiche::QuicheStringPiece(), quiche::QuicheStringPiece(), nullptr);
+ chain, absl::string_view(), absl::string_view(), nullptr);
ASSERT_GE(compressed.size(), 2u);
- EXPECT_EQ("0100",
- quiche::QuicheTextUtils::HexEncode(compressed.substr(0, 2)));
+ EXPECT_EQ("0100", absl::BytesToHexString(compressed.substr(0, 2)));
std::vector<std::string> chain2, cached_certs;
ASSERT_TRUE(CertCompressor::DecompressChain(compressed, cached_certs, nullptr,
@@ -54,15 +54,15 @@ TEST_F(CertCompressorTest, Common) {
crypto_test_utils::MockCommonCertSets(chain[0], set_hash, 1));
const std::string compressed = CertCompressor::CompressChain(
chain,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(&set_hash),
- sizeof(set_hash)),
- quiche::QuicheStringPiece(), common_sets.get());
+ absl::string_view(reinterpret_cast<const char*>(&set_hash),
+ sizeof(set_hash)),
+ absl::string_view(), common_sets.get());
EXPECT_EQ(
"03" /* common */
"2a00000000000000" /* set hash 42 */
"01000000" /* index 1 */
"00" /* end of list */,
- quiche::QuicheTextUtils::HexEncode(compressed));
+ absl::BytesToHexString(compressed));
std::vector<std::string> chain2, cached_certs;
ASSERT_TRUE(CertCompressor::DecompressChain(compressed, cached_certs,
@@ -75,14 +75,13 @@ TEST_F(CertCompressorTest, Cached) {
std::vector<std::string> chain;
chain.push_back("testcert");
uint64_t hash = QuicUtils::FNV1a_64_Hash(chain[0]);
- quiche::QuicheStringPiece hash_bytes(reinterpret_cast<char*>(&hash),
- sizeof(hash));
+ absl::string_view hash_bytes(reinterpret_cast<char*>(&hash), sizeof(hash));
const std::string compressed = CertCompressor::CompressChain(
- chain, quiche::QuicheStringPiece(), hash_bytes, nullptr);
+ chain, absl::string_view(), hash_bytes, nullptr);
- EXPECT_EQ("02" /* cached */ + quiche::QuicheTextUtils::HexEncode(hash_bytes) +
+ EXPECT_EQ("02" /* cached */ + absl::BytesToHexString(hash_bytes) +
"00" /* end of list */,
- quiche::QuicheTextUtils::HexEncode(compressed));
+ absl::BytesToHexString(compressed));
std::vector<std::string> cached_certs, chain2;
cached_certs.push_back(chain[0]);
@@ -96,37 +95,37 @@ TEST_F(CertCompressorTest, BadInputs) {
std::vector<std::string> cached_certs, chain;
EXPECT_FALSE(CertCompressor::DecompressChain(
- quiche::QuicheTextUtils::HexEncode("04") /* bad entry type */,
- cached_certs, nullptr, &chain));
+ absl::BytesToHexString("04") /* bad entry type */, cached_certs, nullptr,
+ &chain));
EXPECT_FALSE(CertCompressor::DecompressChain(
- quiche::QuicheTextUtils::HexEncode("01") /* no terminator */,
- cached_certs, nullptr, &chain));
+ absl::BytesToHexString("01") /* no terminator */, cached_certs, nullptr,
+ &chain));
EXPECT_FALSE(CertCompressor::DecompressChain(
- quiche::QuicheTextUtils::HexEncode("0200") /* hash truncated */,
- cached_certs, nullptr, &chain));
+ absl::BytesToHexString("0200") /* hash truncated */, cached_certs,
+ nullptr, &chain));
EXPECT_FALSE(CertCompressor::DecompressChain(
- quiche::QuicheTextUtils::HexEncode("0300") /* hash and index truncated */,
+ absl::BytesToHexString("0300") /* hash and index truncated */,
cached_certs, nullptr, &chain));
/* without a CommonCertSets */
- EXPECT_FALSE(CertCompressor::DecompressChain(
- quiche::QuicheTextUtils::HexEncode("03"
- "0000000000000000"
- "00000000"),
- cached_certs, nullptr, &chain));
+ EXPECT_FALSE(
+ CertCompressor::DecompressChain(absl::BytesToHexString("03"
+ "0000000000000000"
+ "00000000"),
+ cached_certs, nullptr, &chain));
std::unique_ptr<CommonCertSets> common_sets(
crypto_test_utils::MockCommonCertSets("foo", 42, 1));
/* incorrect hash and index */
- EXPECT_FALSE(CertCompressor::DecompressChain(
- quiche::QuicheTextUtils::HexEncode("03"
- "a200000000000000"
- "00000000"),
- cached_certs, nullptr, &chain));
+ EXPECT_FALSE(
+ CertCompressor::DecompressChain(absl::BytesToHexString("03"
+ "a200000000000000"
+ "00000000"),
+ cached_certs, nullptr, &chain));
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.cc
index 36b6d3f693e..6042b9e7cc4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.cc
@@ -9,6 +9,11 @@
#include <memory>
#include <string>
+#include "absl/strings/escaping.h"
+#include "absl/strings/match.h"
+#include "absl/strings/str_join.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
@@ -24,17 +29,14 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_time_utils.h"
#include "net/third_party/quiche/src/common/quiche_data_reader.h"
+namespace quic {
namespace {
-using ::quiche::QuicheOptional;
-using ::quiche::QuicheStringPiece;
using ::quiche::QuicheTextUtils;
// The literals below were encoded using `ascii2der | xxd -i`. The comments
@@ -101,15 +103,84 @@ PublicKeyType PublicKeyTypeFromSignatureAlgorithm(
}
}
+std::string AttributeNameToString(const CBS& oid_cbs) {
+ absl::string_view oid = CbsToStringPiece(oid_cbs);
+
+ // We only handle OIDs of form 2.5.4.N, which have binary encoding of
+ // "55 04 0N".
+ if (oid.length() == 3 && absl::StartsWith(oid, "\x55\x04")) {
+ // clang-format off
+ switch (oid[2]) {
+ case '\x3': return "CN";
+ case '\x7': return "L";
+ case '\x8': return "ST";
+ case '\xa': return "O";
+ case '\xb': return "OU";
+ case '\x6': return "C";
+ }
+ // clang-format on
+ }
+
+ bssl::UniquePtr<char> oid_representation(CBS_asn1_oid_to_text(&oid_cbs));
+ if (oid_representation == nullptr) {
+ return quiche::QuicheStrCat("(", absl::BytesToHexString(oid), ")");
+ }
+ return std::string(oid_representation.get());
+}
+
} // namespace
-namespace quic {
+absl::optional<std::string> X509NameAttributeToString(CBS input) {
+ CBS name, value;
+ unsigned value_tag;
+ if (!CBS_get_asn1(&input, &name, CBS_ASN1_OBJECT) ||
+ !CBS_get_any_asn1(&input, &value, &value_tag) || CBS_len(&input) != 0) {
+ return absl::nullopt;
+ }
+ // Note that this does not process encoding of |input| in any way. This works
+ // fine for the most cases.
+ return quiche::QuicheStrCat(AttributeNameToString(name), "=",
+ absl::CHexEscape(CbsToStringPiece(value)));
+}
+
+namespace {
+
+template <unsigned inner_tag,
+ char separator,
+ absl::optional<std::string> (*parser)(CBS)>
+absl::optional<std::string> ParseAndJoin(CBS input) {
+ std::vector<std::string> pieces;
+ while (CBS_len(&input) != 0) {
+ CBS attribute;
+ if (!CBS_get_asn1(&input, &attribute, inner_tag)) {
+ return absl::nullopt;
+ }
+ absl::optional<std::string> formatted = parser(attribute);
+ if (!formatted.has_value()) {
+ return absl::nullopt;
+ }
+ pieces.push_back(*formatted);
+ }
+
+ return absl::StrJoin(pieces, std::string({separator}));
+}
-QuicheOptional<quic::QuicWallTime> ParseDerTime(unsigned tag,
- QuicheStringPiece payload) {
+absl::optional<std::string> RelativeDistinguishedNameToString(CBS input) {
+ return ParseAndJoin<CBS_ASN1_SEQUENCE, '+', X509NameAttributeToString>(input);
+}
+
+absl::optional<std::string> DistinguishedNameToString(CBS input) {
+ return ParseAndJoin<CBS_ASN1_SET, ',', RelativeDistinguishedNameToString>(
+ input);
+}
+
+} // namespace
+
+absl::optional<quic::QuicWallTime> ParseDerTime(unsigned tag,
+ absl::string_view payload) {
if (tag != CBS_ASN1_GENERALIZEDTIME && tag != CBS_ASN1_UTCTIME) {
- QUIC_BUG << "Invalid tag supplied for a DER timestamp";
- return QUICHE_NULLOPT;
+ QUIC_DLOG(WARNING) << "Invalid tag supplied for a DER timestamp";
+ return absl::nullopt;
}
const size_t year_length = tag == CBS_ASN1_GENERALIZEDTIME ? 4 : 2;
@@ -121,7 +192,7 @@ QuicheOptional<quic::QuicWallTime> ParseDerTime(unsigned tag,
!reader.ReadDecimal64(2, &second) ||
reader.ReadRemainingPayload() != "Z") {
QUIC_DLOG(WARNING) << "Failed to parse the DER timestamp";
- return QUICHE_NULLOPT;
+ return absl::nullopt;
}
if (tag == CBS_ASN1_UTCTIME) {
@@ -129,30 +200,30 @@ QuicheOptional<quic::QuicWallTime> ParseDerTime(unsigned tag,
year += (year >= 50) ? 1900 : 2000;
}
- const QuicheOptional<int64_t> unix_time =
+ const absl::optional<int64_t> unix_time =
quiche::QuicheUtcDateTimeToUnixSeconds(year, month, day, hour, minute,
second);
if (!unix_time.has_value() || *unix_time < 0) {
- return QUICHE_NULLOPT;
+ return absl::nullopt;
}
return QuicWallTime::FromUNIXSeconds(*unix_time);
}
PemReadResult ReadNextPemMessage(std::istream* input) {
- constexpr QuicheStringPiece kPemBegin = "-----BEGIN ";
- constexpr QuicheStringPiece kPemEnd = "-----END ";
- constexpr QuicheStringPiece kPemDashes = "-----";
+ constexpr absl::string_view kPemBegin = "-----BEGIN ";
+ constexpr absl::string_view kPemEnd = "-----END ";
+ constexpr absl::string_view kPemDashes = "-----";
std::string line_buffer, encoded_message_contents, expected_end;
bool pending_message = false;
PemReadResult result;
while (std::getline(*input, line_buffer)) {
- QuicheStringPiece line(line_buffer);
+ absl::string_view line(line_buffer);
QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&line);
// Handle BEGIN lines.
- if (!pending_message && QuicheTextUtils::StartsWith(line, kPemBegin) &&
- QuicheTextUtils::EndsWith(line, kPemDashes)) {
+ if (!pending_message && absl::StartsWith(line, kPemBegin) &&
+ absl::EndsWith(line, kPemDashes)) {
result.type = std::string(
line.substr(kPemBegin.size(),
line.size() - kPemDashes.size() - kPemBegin.size()));
@@ -163,7 +234,7 @@ PemReadResult ReadNextPemMessage(std::istream* input) {
// Handle END lines.
if (pending_message && line == expected_end) {
- QuicheOptional<std::string> data =
+ absl::optional<std::string> data =
QuicheTextUtils::Base64Decode(encoded_message_contents);
if (data.has_value()) {
result.status = PemReadResult::kOk;
@@ -184,7 +255,7 @@ PemReadResult ReadNextPemMessage(std::istream* input) {
}
std::unique_ptr<CertificateView> CertificateView::ParseSingleCertificate(
- QuicheStringPiece certificate) {
+ absl::string_view certificate) {
std::unique_ptr<CertificateView> result(new CertificateView());
CBS top = StringPieceToCbs(certificate);
@@ -258,6 +329,8 @@ std::unique_ptr<CertificateView> CertificateView::ParseSingleCertificate(
return nullptr;
}
+ result->subject_der_ = CbsToStringPiece(subject);
+
unsigned not_before_tag, not_after_tag;
CBS not_before, not_after;
if (!CBS_get_any_asn1(&validity, &not_before, &not_before_tag) ||
@@ -266,9 +339,9 @@ std::unique_ptr<CertificateView> CertificateView::ParseSingleCertificate(
QUIC_DLOG(WARNING) << "Failed to extract the validity dates";
return nullptr;
}
- QuicheOptional<QuicWallTime> not_before_parsed =
+ absl::optional<QuicWallTime> not_before_parsed =
ParseDerTime(not_before_tag, CbsToStringPiece(not_before));
- QuicheOptional<QuicWallTime> not_after_parsed =
+ absl::optional<QuicWallTime> not_after_parsed =
ParseDerTime(not_after_tag, CbsToStringPiece(not_after));
if (!not_before_parsed.has_value() || !not_after_parsed.has_value()) {
QUIC_DLOG(WARNING) << "Failed to parse validity dates";
@@ -348,7 +421,7 @@ bool CertificateView::ParseExtensions(CBS extensions) {
return false;
}
- QuicheStringPiece alt_name = CbsToStringPiece(alt_name_cbs);
+ absl::string_view alt_name = CbsToStringPiece(alt_name_cbs);
QuicIpAddress ip_address;
// GeneralName ::= CHOICE {
switch (alt_name_tag) {
@@ -417,8 +490,8 @@ bool CertificateView::ValidatePublicKeyParameters() {
}
}
-bool CertificateView::VerifySignature(QuicheStringPiece data,
- QuicheStringPiece signature,
+bool CertificateView::VerifySignature(absl::string_view data,
+ absl::string_view signature,
uint16_t signature_algorithm) const {
if (PublicKeyTypeFromSignatureAlgorithm(signature_algorithm) !=
PublicKeyTypeFromKey(public_key_.get())) {
@@ -447,8 +520,13 @@ bool CertificateView::VerifySignature(QuicheStringPiece data,
data.size());
}
+absl::optional<std::string> CertificateView::GetHumanReadableSubject() const {
+ CBS input = StringPieceToCbs(subject_der_);
+ return DistinguishedNameToString(input);
+}
+
std::unique_ptr<CertificatePrivateKey> CertificatePrivateKey::LoadFromDer(
- QuicheStringPiece private_key) {
+ absl::string_view private_key) {
std::unique_ptr<CertificatePrivateKey> result(new CertificatePrivateKey());
CBS private_key_cbs = StringPieceToCbs(private_key);
result->private_key_.reset(EVP_parse_private_key(&private_key_cbs));
@@ -506,7 +584,7 @@ skip:
return nullptr;
}
-std::string CertificatePrivateKey::Sign(QuicheStringPiece input,
+std::string CertificatePrivateKey::Sign(absl::string_view input,
uint16_t signature_algorithm) {
if (!ValidForSignatureAlgorithm(signature_algorithm)) {
QUIC_BUG << "Mismatch between the requested signature algorithm and the "
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.h b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.h
index d06ff78530a..7439ee64401 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view.h
@@ -9,6 +9,8 @@
#include <memory>
#include <vector>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
@@ -17,8 +19,6 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -43,7 +43,7 @@ class QUIC_EXPORT_PRIVATE CertificateView {
// Parses a single DER-encoded X.509 certificate. Returns nullptr on parse
// error.
static std::unique_ptr<CertificateView> ParseSingleCertificate(
- quiche::QuicheStringPiece certificate);
+ absl::string_view certificate);
// Loads all PEM-encoded X.509 certificates found in the |input| stream
// without parsing them. Returns an empty vector if any parsing error occurs.
@@ -53,17 +53,20 @@ class QUIC_EXPORT_PRIVATE CertificateView {
QuicWallTime validity_end() const { return validity_end_; }
const EVP_PKEY* public_key() const { return public_key_.get(); }
- const std::vector<quiche::QuicheStringPiece>& subject_alt_name_domains()
- const {
+ const std::vector<absl::string_view>& subject_alt_name_domains() const {
return subject_alt_name_domains_;
}
const std::vector<QuicIpAddress>& subject_alt_name_ips() const {
return subject_alt_name_ips_;
}
+ // Returns a human-readable representation of the Subject field. The format
+ // is similar to RFC 2253, but does not match it exactly.
+ absl::optional<std::string> GetHumanReadableSubject() const;
+
// |signature_algorithm| is a TLS signature algorithm ID.
- bool VerifySignature(quiche::QuicheStringPiece data,
- quiche::QuicheStringPiece signature,
+ bool VerifySignature(absl::string_view data,
+ absl::string_view signature,
uint16_t signature_algorithm) const;
private:
@@ -71,12 +74,13 @@ class QUIC_EXPORT_PRIVATE CertificateView {
QuicWallTime validity_start_ = QuicWallTime::Zero();
QuicWallTime validity_end_ = QuicWallTime::Zero();
+ absl::string_view subject_der_;
// Public key parsed from SPKI.
bssl::UniquePtr<EVP_PKEY> public_key_;
// SubjectAltName, https://tools.ietf.org/html/rfc5280#section-4.2.1.6
- std::vector<quiche::QuicheStringPiece> subject_alt_name_domains_;
+ std::vector<absl::string_view> subject_alt_name_domains_;
std::vector<QuicIpAddress> subject_alt_name_ips_;
// Called from ParseSingleCertificate().
@@ -93,7 +97,7 @@ class QUIC_EXPORT_PRIVATE CertificatePrivateKey {
// Loads a DER-encoded PrivateKeyInfo structure (RFC 5958) as a private key.
static std::unique_ptr<CertificatePrivateKey> LoadFromDer(
- quiche::QuicheStringPiece private_key);
+ absl::string_view private_key);
// Loads a private key from a PEM file formatted according to RFC 7468. Also
// supports legacy OpenSSL RSA key format ("BEGIN RSA PRIVATE KEY").
@@ -101,8 +105,7 @@ class QUIC_EXPORT_PRIVATE CertificatePrivateKey {
std::istream* input);
// |signature_algorithm| is a TLS signature algorithm ID.
- std::string Sign(quiche::QuicheStringPiece input,
- uint16_t signature_algorithm);
+ std::string Sign(absl::string_view input, uint16_t signature_algorithm);
// Verifies that the private key in question matches the public key of the
// certificate |view|.
@@ -120,11 +123,15 @@ class QUIC_EXPORT_PRIVATE CertificatePrivateKey {
bssl::UniquePtr<EVP_PKEY> private_key_;
};
+// Parses a DER-encoded X.509 NameAttribute. Exposed primarily for testing.
+QUIC_EXPORT_PRIVATE absl::optional<std::string> X509NameAttributeToString(
+ CBS input);
+
// Parses a DER time based on the specified ASN.1 tag. Exposed primarily for
// testing.
-QUIC_EXPORT_PRIVATE quiche::QuicheOptional<quic::QuicWallTime> ParseDerTime(
+QUIC_EXPORT_PRIVATE absl::optional<quic::QuicWallTime> ParseDerTime(
unsigned tag,
- quiche::QuicheStringPiece payload);
+ absl::string_view payload);
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_der_fuzzer.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_der_fuzzer.cc
index e2de1ba7efe..e66f4f917bc 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_der_fuzzer.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_der_fuzzer.cc
@@ -9,7 +9,11 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
std::string input(reinterpret_cast<const char*>(data), size);
- quic::CertificateView::ParseSingleCertificate(input);
+ std::unique_ptr<quic::CertificateView> view =
+ quic::CertificateView::ParseSingleCertificate(input);
+ if (view != nullptr) {
+ view->GetHumanReadableSubject();
+ }
quic::CertificatePrivateKey::LoadFromDer(input);
return 0;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_test.cc
index e7ce0cea5a0..46e30f1285f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/certificate_view_test.cc
@@ -7,15 +7,17 @@
#include <memory>
#include <sstream>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
+#include "net/third_party/quiche/src/quic/core/crypto/boring_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/test_certificates.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_time_utils.h"
namespace quic {
@@ -43,9 +45,9 @@ TEST(CertificateViewTest, Parse) {
ASSERT_TRUE(view != nullptr);
EXPECT_THAT(view->subject_alt_name_domains(),
- ElementsAre(quiche::QuicheStringPiece("www.example.org"),
- quiche::QuicheStringPiece("mail.example.org"),
- quiche::QuicheStringPiece("mail.example.com")));
+ ElementsAre(absl::string_view("www.example.org"),
+ absl::string_view("mail.example.org"),
+ absl::string_view("mail.example.com")));
EXPECT_THAT(view->subject_alt_name_ips(),
ElementsAre(QuicIpAddress::Loopback4()));
EXPECT_EQ(EVP_PKEY_id(view->public_key()), EVP_PKEY_RSA);
@@ -56,6 +58,9 @@ TEST(CertificateViewTest, Parse) {
const QuicWallTime validity_end = QuicWallTime::FromUNIXSeconds(
*quiche::QuicheUtcDateTimeToUnixSeconds(2020, 2, 2, 18, 13, 59));
EXPECT_EQ(view->validity_end(), validity_end);
+
+ EXPECT_EQ("C=US,ST=California,L=Mountain View,O=QUIC Server,CN=127.0.0.1",
+ view->GetHumanReadableSubject());
}
TEST(CertificateViewTest, ParseCertWithUnknownSanType) {
@@ -148,27 +153,27 @@ TEST(CertificateViewTest, DerTime) {
Optional(QuicWallTime::FromUNIXSeconds(24)));
EXPECT_TRUE(ParseDerTime(CBS_ASN1_UTCTIME, "200101000024Z").has_value());
- EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, ""), QUICHE_NULLOPT);
+ EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, ""), absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101000024.001Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101000024Q"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101000024-0500"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "700101000024ZZ"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101000024.00Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101000024.Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "197O0101000024Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101000024.0O1Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "-9700101000024Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "1970-101000024Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
EXPECT_TRUE(ParseDerTime(CBS_ASN1_UTCTIME, "490101000024Z").has_value());
// This should parse as 1950, which predates UNIX epoch.
@@ -177,7 +182,29 @@ TEST(CertificateViewTest, DerTime) {
EXPECT_THAT(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101230000Z"),
Optional(QuicWallTime::FromUNIXSeconds(23 * 3600)));
EXPECT_EQ(ParseDerTime(CBS_ASN1_GENERALIZEDTIME, "19700101240000Z"),
- QUICHE_NULLOPT);
+ absl::nullopt);
+}
+
+TEST(CertificateViewTest, NameAttribute) {
+ // OBJECT_IDENTIFIER { 1.2.840.113554.4.1.112411 }
+ // UTF8String { "Test" }
+ std::string unknown_oid =
+ absl::HexStringToBytes("060b2a864886f712040186ee1b0c0454657374");
+ EXPECT_EQ("1.2.840.113554.4.1.112411=Test",
+ X509NameAttributeToString(StringPieceToCbs(unknown_oid)));
+
+ // OBJECT_IDENTIFIER { 2.5.4.3 }
+ // UTF8String { "Bell: \x07" }
+ std::string non_printable =
+ absl::HexStringToBytes("06035504030c0742656c6c3a2007");
+ EXPECT_EQ(R"(CN=Bell: \x07)",
+ X509NameAttributeToString(StringPieceToCbs(non_printable)));
+
+ // OBJECT_IDENTIFIER { "\x55\x80" }
+ // UTF8String { "Test" }
+ std::string invalid_oid = absl::HexStringToBytes("060255800c0454657374");
+ EXPECT_EQ("(5580)=Test",
+ X509NameAttributeToString(StringPieceToCbs(invalid_oid)));
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.cc
index e2f55aa32ab..b860348b13f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.cc
@@ -32,4 +32,12 @@ uint32_t ChaCha20Poly1305Decrypter::cipher_id() const {
return TLS1_CK_CHACHA20_POLY1305_SHA256;
}
+QuicPacketCount ChaCha20Poly1305Decrypter::GetIntegrityLimit() const {
+ // For AEAD_CHACHA20_POLY1305, the integrity limit is 2^36 invalid packets.
+ // https://quicwg.org/base-drafts/draft-ietf-quic-tls.html#name-limits-on-aead-usage
+ static_assert(kMaxIncomingPacketSize < 16384,
+ "This key limit requires limits on decryption payload sizes");
+ return 68719476736U;
+}
+
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.h
index 50bb348e98c..2e4b32b36f4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.h
@@ -33,6 +33,7 @@ class QUIC_EXPORT_PRIVATE ChaCha20Poly1305Decrypter
~ChaCha20Poly1305Decrypter() override;
uint32_t cipher_id() const override;
+ QuicPacketCount GetIntegrityLimit() const override;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter_test.cc
index 83e52b10e2c..3711104fc4f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter_test.cc
@@ -7,10 +7,11 @@
#include <memory>
#include <string>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -115,12 +116,12 @@ namespace test {
// DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the plaintext.
QuicData* DecryptWithNonce(ChaCha20Poly1305Decrypter* decrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view ciphertext) {
uint64_t packet_number;
- quiche::QuicheStringPiece nonce_prefix(nonce.data(),
- nonce.size() - sizeof(packet_number));
+ absl::string_view nonce_prefix(nonce.data(),
+ nonce.size() - sizeof(packet_number));
decrypter->SetNoncePrefix(nonce_prefix);
memcpy(&packet_number, nonce.data() + nonce_prefix.size(),
sizeof(packet_number));
@@ -143,15 +144,14 @@ TEST_F(ChaCha20Poly1305DecrypterTest, Decrypt) {
bool has_pt = test_vectors[i].pt;
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
- std::string fixed =
- quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
+ std::string key = absl::HexStringToBytes(test_vectors[i].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[i].iv);
+ std::string fixed = absl::HexStringToBytes(test_vectors[i].fixed);
+ std::string aad = absl::HexStringToBytes(test_vectors[i].aad);
+ std::string ct = absl::HexStringToBytes(test_vectors[i].ct);
std::string pt;
if (has_pt) {
- pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
+ pt = absl::HexStringToBytes(test_vectors[i].pt);
}
ChaCha20Poly1305Decrypter decrypter;
@@ -160,8 +160,7 @@ TEST_F(ChaCha20Poly1305DecrypterTest, Decrypt) {
&decrypter, fixed + iv,
// This deliberately tests that the decrypter can handle an AAD that
// is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
- quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
- aad.length()),
+ absl::string_view(aad.length() ? aad.data() : nullptr, aad.length()),
ct));
if (!decrypted) {
EXPECT_FALSE(has_pt);
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.cc
index 37b899f90f6..f66f31c46b5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.cc
@@ -27,4 +27,11 @@ ChaCha20Poly1305Encrypter::ChaCha20Poly1305Encrypter()
ChaCha20Poly1305Encrypter::~ChaCha20Poly1305Encrypter() {}
+QuicPacketCount ChaCha20Poly1305Encrypter::GetConfidentialityLimit() const {
+ // For AEAD_CHACHA20_POLY1305, the confidentiality limit is greater than the
+ // number of possible packets (2^62) and so can be disregarded.
+ // https://quicwg.org/base-drafts/draft-ietf-quic-tls.html#name-limits-on-aead-usage
+ return std::numeric_limits<QuicPacketCount>::max();
+}
+
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h
index 72007883ffd..98f6ff042bd 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h
@@ -29,6 +29,8 @@ class QUIC_EXPORT_PRIVATE ChaCha20Poly1305Encrypter
ChaCha20Poly1305Encrypter& operator=(const ChaCha20Poly1305Encrypter&) =
delete;
~ChaCha20Poly1305Encrypter() override;
+
+ QuicPacketCount GetConfidentialityLimit() const override;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
index 47ee3d03a06..91b32ef5c3c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
@@ -7,12 +7,12 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_decrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -72,9 +72,9 @@ namespace test {
// EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the ciphertext.
QuicData* EncryptWithNonce(ChaCha20Poly1305Encrypter* encrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view plaintext) {
size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
@@ -92,7 +92,7 @@ TEST_F(ChaCha20Poly1305EncrypterTest, EncryptThenDecrypt) {
ChaCha20Poly1305Encrypter encrypter;
ChaCha20Poly1305Decrypter decrypter;
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[0].key);
+ std::string key = absl::HexStringToBytes(test_vectors[0].key);
ASSERT_TRUE(encrypter.SetKey(key));
ASSERT_TRUE(decrypter.SetKey(key));
ASSERT_TRUE(encrypter.SetNoncePrefix("abcd"));
@@ -105,24 +105,23 @@ TEST_F(ChaCha20Poly1305EncrypterTest, EncryptThenDecrypt) {
size_t len;
ASSERT_TRUE(encrypter.EncryptPacket(packet_number, associated_data, plaintext,
encrypted, &len,
- QUICHE_ARRAYSIZE(encrypted)));
- quiche::QuicheStringPiece ciphertext(encrypted, len);
+ ABSL_ARRAYSIZE(encrypted)));
+ absl::string_view ciphertext(encrypted, len);
char decrypted[1024];
ASSERT_TRUE(decrypter.DecryptPacket(packet_number, associated_data,
ciphertext, decrypted, &len,
- QUICHE_ARRAYSIZE(decrypted)));
+ ABSL_ARRAYSIZE(decrypted)));
}
TEST_F(ChaCha20Poly1305EncrypterTest, Encrypt) {
for (size_t i = 0; test_vectors[i].key != nullptr; i++) {
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
- std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
- std::string fixed =
- quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
+ std::string key = absl::HexStringToBytes(test_vectors[i].key);
+ std::string pt = absl::HexStringToBytes(test_vectors[i].pt);
+ std::string iv = absl::HexStringToBytes(test_vectors[i].iv);
+ std::string fixed = absl::HexStringToBytes(test_vectors[i].fixed);
+ std::string aad = absl::HexStringToBytes(test_vectors[i].aad);
+ std::string ct = absl::HexStringToBytes(test_vectors[i].ct);
ChaCha20Poly1305Encrypter encrypter;
ASSERT_TRUE(encrypter.SetKey(key));
@@ -130,8 +129,7 @@ TEST_F(ChaCha20Poly1305EncrypterTest, Encrypt) {
&encrypter, fixed + iv,
// This deliberately tests that the encrypter can handle an AAD that
// is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
- quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
- aad.length()),
+ absl::string_view(aad.length() ? aad.data() : nullptr, aad.length()),
pt));
ASSERT_TRUE(encrypted.get());
EXPECT_EQ(12u, ct.size() - pt.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc
index 8d98da89bf1..7bf84785127 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.cc
@@ -34,4 +34,12 @@ uint32_t ChaCha20Poly1305TlsDecrypter::cipher_id() const {
return TLS1_CK_CHACHA20_POLY1305_SHA256;
}
+QuicPacketCount ChaCha20Poly1305TlsDecrypter::GetIntegrityLimit() const {
+ // For AEAD_CHACHA20_POLY1305, the integrity limit is 2^36 invalid packets.
+ // https://quicwg.org/base-drafts/draft-ietf-quic-tls.html#name-limits-on-aead-usage
+ static_assert(kMaxIncomingPacketSize < 16384,
+ "This key limit requires limits on decryption payload sizes");
+ return 68719476736U;
+}
+
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.h
index 702fb8c7bcf..04ee5b8b865 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.h
@@ -31,6 +31,7 @@ class QUIC_EXPORT_PRIVATE ChaCha20Poly1305TlsDecrypter
~ChaCha20Poly1305TlsDecrypter() override;
uint32_t cipher_id() const override;
+ QuicPacketCount GetIntegrityLimit() const override;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc
index 9127cd4634a..431f0121c7d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter_test.cc
@@ -7,10 +7,11 @@
#include <memory>
#include <string>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -115,9 +116,9 @@ namespace test {
// DecryptWithNonce wraps the |Decrypt| method of |decrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the plaintext.
QuicData* DecryptWithNonce(ChaCha20Poly1305TlsDecrypter* decrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view ciphertext) {
decrypter->SetIV(nonce);
std::unique_ptr<char[]> output(new char[ciphertext.length()]);
size_t output_length = 0;
@@ -138,15 +139,14 @@ TEST_F(ChaCha20Poly1305TlsDecrypterTest, Decrypt) {
bool has_pt = test_vectors[i].pt;
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
- std::string fixed =
- quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
+ std::string key = absl::HexStringToBytes(test_vectors[i].key);
+ std::string iv = absl::HexStringToBytes(test_vectors[i].iv);
+ std::string fixed = absl::HexStringToBytes(test_vectors[i].fixed);
+ std::string aad = absl::HexStringToBytes(test_vectors[i].aad);
+ std::string ct = absl::HexStringToBytes(test_vectors[i].ct);
std::string pt;
if (has_pt) {
- pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
+ pt = absl::HexStringToBytes(test_vectors[i].pt);
}
ChaCha20Poly1305TlsDecrypter decrypter;
@@ -155,8 +155,7 @@ TEST_F(ChaCha20Poly1305TlsDecrypterTest, Decrypt) {
&decrypter, fixed + iv,
// This deliberately tests that the decrypter can handle an AAD that
// is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
- quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
- aad.length()),
+ absl::string_view(aad.length() ? aad.data() : nullptr, aad.length()),
ct));
if (!decrypted) {
EXPECT_FALSE(has_pt);
@@ -173,14 +172,14 @@ TEST_F(ChaCha20Poly1305TlsDecrypterTest, Decrypt) {
TEST_F(ChaCha20Poly1305TlsDecrypterTest, GenerateHeaderProtectionMask) {
ChaCha20Poly1305TlsDecrypter decrypter;
- std::string key = quiche::QuicheTextUtils::HexDecode(
+ std::string key = absl::HexStringToBytes(
"6a067f432787bd6034dd3f08f07fc9703a27e58c70e2d88d948b7f6489923cc7");
std::string sample =
- quiche::QuicheTextUtils::HexDecode("1210d91cceb45c716b023f492c29e612");
+ absl::HexStringToBytes("1210d91cceb45c716b023f492c29e612");
QuicDataReader sample_reader(sample.data(), sample.size());
ASSERT_TRUE(decrypter.SetHeaderProtectionKey(key));
std::string mask = decrypter.GenerateHeaderProtectionMask(&sample_reader);
- std::string expected_mask = quiche::QuicheTextUtils::HexDecode("1cc2cd98dc");
+ std::string expected_mask = absl::HexStringToBytes("1cc2cd98dc");
quiche::test::CompareCharArraysWithHexError(
"header protection mask", mask.data(), mask.size(), expected_mask.data(),
expected_mask.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc
index c650b27f40e..a03a14c065e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.cc
@@ -27,4 +27,11 @@ ChaCha20Poly1305TlsEncrypter::ChaCha20Poly1305TlsEncrypter()
ChaCha20Poly1305TlsEncrypter::~ChaCha20Poly1305TlsEncrypter() {}
+QuicPacketCount ChaCha20Poly1305TlsEncrypter::GetConfidentialityLimit() const {
+ // For AEAD_CHACHA20_POLY1305, the confidentiality limit is greater than the
+ // number of possible packets (2^62) and so can be disregarded.
+ // https://quicwg.org/base-drafts/draft-ietf-quic-tls.html#name-limits-on-aead-usage
+ return std::numeric_limits<QuicPacketCount>::max();
+}
+
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.h
index 0ef7ae8e21a..f83141fd626 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter.h
@@ -27,6 +27,8 @@ class QUIC_EXPORT_PRIVATE ChaCha20Poly1305TlsEncrypter
ChaCha20Poly1305TlsEncrypter& operator=(const ChaCha20Poly1305TlsEncrypter&) =
delete;
~ChaCha20Poly1305TlsEncrypter() override;
+
+ QuicPacketCount GetConfidentialityLimit() const override;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc
index dd642a323a8..1918d2ab878 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_encrypter_test.cc
@@ -7,12 +7,13 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_tls_decrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -72,9 +73,9 @@ namespace test {
// EncryptWithNonce wraps the |Encrypt| method of |encrypter| to allow passing
// in an nonce and also to allocate the buffer needed for the ciphertext.
QuicData* EncryptWithNonce(ChaCha20Poly1305TlsEncrypter* encrypter,
- quiche::QuicheStringPiece nonce,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext) {
+ absl::string_view nonce,
+ absl::string_view associated_data,
+ absl::string_view plaintext) {
size_t ciphertext_size = encrypter->GetCiphertextSize(plaintext.length());
std::unique_ptr<char[]> ciphertext(new char[ciphertext_size]);
@@ -92,7 +93,7 @@ TEST_F(ChaCha20Poly1305TlsEncrypterTest, EncryptThenDecrypt) {
ChaCha20Poly1305TlsEncrypter encrypter;
ChaCha20Poly1305TlsDecrypter decrypter;
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[0].key);
+ std::string key = absl::HexStringToBytes(test_vectors[0].key);
ASSERT_TRUE(encrypter.SetKey(key));
ASSERT_TRUE(decrypter.SetKey(key));
ASSERT_TRUE(encrypter.SetIV("abcdefghijkl"));
@@ -105,24 +106,23 @@ TEST_F(ChaCha20Poly1305TlsEncrypterTest, EncryptThenDecrypt) {
size_t len;
ASSERT_TRUE(encrypter.EncryptPacket(packet_number, associated_data, plaintext,
encrypted, &len,
- QUICHE_ARRAYSIZE(encrypted)));
- quiche::QuicheStringPiece ciphertext(encrypted, len);
+ ABSL_ARRAYSIZE(encrypted)));
+ absl::string_view ciphertext(encrypted, len);
char decrypted[1024];
ASSERT_TRUE(decrypter.DecryptPacket(packet_number, associated_data,
ciphertext, decrypted, &len,
- QUICHE_ARRAYSIZE(decrypted)));
+ ABSL_ARRAYSIZE(decrypted)));
}
TEST_F(ChaCha20Poly1305TlsEncrypterTest, Encrypt) {
for (size_t i = 0; test_vectors[i].key != nullptr; i++) {
// Decode the test vector.
- std::string key = quiche::QuicheTextUtils::HexDecode(test_vectors[i].key);
- std::string pt = quiche::QuicheTextUtils::HexDecode(test_vectors[i].pt);
- std::string iv = quiche::QuicheTextUtils::HexDecode(test_vectors[i].iv);
- std::string fixed =
- quiche::QuicheTextUtils::HexDecode(test_vectors[i].fixed);
- std::string aad = quiche::QuicheTextUtils::HexDecode(test_vectors[i].aad);
- std::string ct = quiche::QuicheTextUtils::HexDecode(test_vectors[i].ct);
+ std::string key = absl::HexStringToBytes(test_vectors[i].key);
+ std::string pt = absl::HexStringToBytes(test_vectors[i].pt);
+ std::string iv = absl::HexStringToBytes(test_vectors[i].iv);
+ std::string fixed = absl::HexStringToBytes(test_vectors[i].fixed);
+ std::string aad = absl::HexStringToBytes(test_vectors[i].aad);
+ std::string ct = absl::HexStringToBytes(test_vectors[i].ct);
ChaCha20Poly1305TlsEncrypter encrypter;
ASSERT_TRUE(encrypter.SetKey(key));
@@ -130,8 +130,7 @@ TEST_F(ChaCha20Poly1305TlsEncrypterTest, Encrypt) {
&encrypter, fixed + iv,
// This deliberately tests that the encrypter can handle an AAD that
// is set to nullptr, as opposed to a zero-length, non-nullptr pointer.
- quiche::QuicheStringPiece(aad.length() ? aad.data() : nullptr,
- aad.length()),
+ absl::string_view(aad.length() ? aad.data() : nullptr, aad.length()),
pt));
ASSERT_TRUE(encrypted.get());
EXPECT_EQ(16u, ct.size() - pt.size());
@@ -159,13 +158,13 @@ TEST_F(ChaCha20Poly1305TlsEncrypterTest, GetCiphertextSize) {
TEST_F(ChaCha20Poly1305TlsEncrypterTest, GenerateHeaderProtectionMask) {
ChaCha20Poly1305TlsEncrypter encrypter;
- std::string key = quiche::QuicheTextUtils::HexDecode(
+ std::string key = absl::HexStringToBytes(
"6a067f432787bd6034dd3f08f07fc9703a27e58c70e2d88d948b7f6489923cc7");
std::string sample =
- quiche::QuicheTextUtils::HexDecode("1210d91cceb45c716b023f492c29e612");
+ absl::HexStringToBytes("1210d91cceb45c716b023f492c29e612");
ASSERT_TRUE(encrypter.SetHeaderProtectionKey(key));
std::string mask = encrypter.GenerateHeaderProtectionMask(sample);
- std::string expected_mask = quiche::QuicheTextUtils::HexDecode("1cc2cd98dc");
+ std::string expected_mask = absl::HexStringToBytes("1cc2cd98dc");
quiche::test::CompareCharArraysWithHexError(
"header protection mask", mask.data(), mask.size(), expected_mask.data(),
expected_mask.size());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.cc
index bc09b667d5e..1fccc5d1b9d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.cc
@@ -6,17 +6,16 @@
#include <cstdint>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/chacha.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
-bool ChaChaBaseDecrypter::SetHeaderProtectionKey(
- quiche::QuicheStringPiece key) {
+bool ChaChaBaseDecrypter::SetHeaderProtectionKey(absl::string_view key) {
if (key.size() != GetKeySize()) {
QUIC_BUG << "Invalid key size for header protection";
return false;
@@ -27,7 +26,7 @@ bool ChaChaBaseDecrypter::SetHeaderProtectionKey(
std::string ChaChaBaseDecrypter::GenerateHeaderProtectionMask(
QuicDataReader* sample_reader) {
- quiche::QuicheStringPiece sample;
+ absl::string_view sample;
if (!sample_reader->ReadStringPiece(&sample, 16)) {
return std::string();
}
@@ -36,9 +35,9 @@ std::string ChaChaBaseDecrypter::GenerateHeaderProtectionMask(
QuicDataReader(sample.data(), 4, quiche::HOST_BYTE_ORDER)
.ReadUInt32(&counter);
const uint8_t zeroes[] = {0, 0, 0, 0, 0};
- std::string out(QUICHE_ARRAYSIZE(zeroes), 0);
+ std::string out(ABSL_ARRAYSIZE(zeroes), 0);
CRYPTO_chacha_20(reinterpret_cast<uint8_t*>(const_cast<char*>(out.data())),
- zeroes, QUICHE_ARRAYSIZE(zeroes), pne_key_, nonce, counter);
+ zeroes, ABSL_ARRAYSIZE(zeroes), pne_key_, nonce, counter);
return out;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.h
index 24ca820a9ec..610bc594b77 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_decrypter.h
@@ -7,9 +7,9 @@
#include <cstddef>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/aead_base_decrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -17,7 +17,7 @@ class QUIC_EXPORT_PRIVATE ChaChaBaseDecrypter : public AeadBaseDecrypter {
public:
using AeadBaseDecrypter::AeadBaseDecrypter;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
std::string GenerateHeaderProtectionMask(
QuicDataReader* sample_reader) override;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.cc
index 7fdc019e70c..0b9d3444d2b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.cc
@@ -4,17 +4,16 @@
#include "net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.h"
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/chacha.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
-bool ChaChaBaseEncrypter::SetHeaderProtectionKey(
- quiche::QuicheStringPiece key) {
+bool ChaChaBaseEncrypter::SetHeaderProtectionKey(absl::string_view key) {
if (key.size() != GetKeySize()) {
QUIC_BUG << "Invalid key size for header protection";
return false;
@@ -24,7 +23,7 @@ bool ChaChaBaseEncrypter::SetHeaderProtectionKey(
}
std::string ChaChaBaseEncrypter::GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) {
+ absl::string_view sample) {
if (sample.size() != 16) {
return std::string();
}
@@ -33,9 +32,9 @@ std::string ChaChaBaseEncrypter::GenerateHeaderProtectionMask(
QuicDataReader(sample.data(), 4, quiche::HOST_BYTE_ORDER)
.ReadUInt32(&counter);
const uint8_t zeroes[] = {0, 0, 0, 0, 0};
- std::string out(QUICHE_ARRAYSIZE(zeroes), 0);
+ std::string out(ABSL_ARRAYSIZE(zeroes), 0);
CRYPTO_chacha_20(reinterpret_cast<uint8_t*>(const_cast<char*>(out.data())),
- zeroes, QUICHE_ARRAYSIZE(zeroes), pne_key_, nonce, counter);
+ zeroes, ABSL_ARRAYSIZE(zeroes), pne_key_, nonce, counter);
return out;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.h
index 16d1df1020b..97385c31364 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.h
@@ -7,9 +7,9 @@
#include <cstddef>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -17,9 +17,8 @@ class QUIC_EXPORT_PRIVATE ChaChaBaseEncrypter : public AeadBaseEncrypter {
public:
using AeadBaseEncrypter::AeadBaseEncrypter;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
- std::string GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
+ std::string GenerateHeaderProtectionMask(absl::string_view sample) override;
private:
// The key used for packet number encryption.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.cc
index facd552772b..2d30147ef82 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.cc
@@ -6,12 +6,12 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/bn.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ecdsa.h"
#include "third_party/boringssl/src/include/openssl/nid.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -21,16 +21,16 @@ const char ChannelIDVerifier::kContextStr[] = "QUIC ChannelID";
const char ChannelIDVerifier::kClientToServerStr[] = "client -> server";
// static
-bool ChannelIDVerifier::Verify(quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece signed_data,
- quiche::QuicheStringPiece signature) {
+bool ChannelIDVerifier::Verify(absl::string_view key,
+ absl::string_view signed_data,
+ absl::string_view signature) {
return VerifyRaw(key, signed_data, signature, true);
}
// static
-bool ChannelIDVerifier::VerifyRaw(quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece signed_data,
- quiche::QuicheStringPiece signature,
+bool ChannelIDVerifier::VerifyRaw(absl::string_view key,
+ absl::string_view signed_data,
+ absl::string_view signature,
bool is_channel_id_signature) {
if (key.size() != 32 * 2 || signature.size() != 32 * 2) {
return false;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.h b/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.h
index c04aac33c06..e176cdb0676 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id.h
@@ -8,9 +8,9 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -30,17 +30,17 @@ class QUIC_EXPORT_PRIVATE ChannelIDVerifier {
// Verify returns true iff |signature| is a valid signature of |signed_data|
// by |key|.
- static bool Verify(quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece signed_data,
- quiche::QuicheStringPiece signature);
+ static bool Verify(absl::string_view key,
+ absl::string_view signed_data,
+ absl::string_view signature);
// FOR TESTING ONLY: VerifyRaw returns true iff |signature| is a valid
// signature of |signed_data| by |key|. |is_channel_id_signature| indicates
// whether |signature| is a ChannelID signature (with kContextStr prepended
// to the data to be signed).
- static bool VerifyRaw(quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece signed_data,
- quiche::QuicheStringPiece signature,
+ static bool VerifyRaw(absl::string_view key,
+ absl::string_view signed_data,
+ absl::string_view signature,
bool is_channel_id_signature);
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id_test.cc
index d4a14cd88a4..cd95539d541 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/channel_id_test.cc
@@ -7,9 +7,9 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -275,12 +275,11 @@ TEST_F(ChannelIDTest, VerifyKnownAnswerTest) {
EXPECT_EQ(sizeof(signature) / 2, r_len);
EXPECT_EQ(sizeof(signature) / 2, s_len);
- EXPECT_EQ(
- test_vector[i].result,
- ChannelIDVerifier::VerifyRaw(
- quiche::QuicheStringPiece(key, sizeof(key)),
- quiche::QuicheStringPiece(msg, msg_len),
- quiche::QuicheStringPiece(signature, sizeof(signature)), false));
+ EXPECT_EQ(test_vector[i].result,
+ ChannelIDVerifier::VerifyRaw(
+ absl::string_view(key, sizeof(key)),
+ absl::string_view(msg, msg_len),
+ absl::string_view(signature, sizeof(signature)), false));
}
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.cc
index 0ccbf2d3d0c..fa66c7292cb 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.cc
@@ -6,9 +6,9 @@
#include <cstddef>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -56,7 +56,7 @@ const uint64_t kSetHashes[] = {
// Compare returns a value less than, equal to or greater than zero if |a| is
// lexicographically less than, equal to or greater than |b|, respectively.
-int Compare(quiche::QuicheStringPiece a, const unsigned char* b, size_t b_len) {
+int Compare(absl::string_view a, const unsigned char* b, size_t b_len) {
size_t len = a.size();
if (len > b_len) {
len = b_len;
@@ -79,18 +79,16 @@ int Compare(quiche::QuicheStringPiece a, const unsigned char* b, size_t b_len) {
class CommonCertSetsQUIC : public CommonCertSets {
public:
// CommonCertSets interface.
- quiche::QuicheStringPiece GetCommonHashes() const override {
- return quiche::QuicheStringPiece(
- reinterpret_cast<const char*>(kSetHashes),
- sizeof(uint64_t) * QUICHE_ARRAYSIZE(kSetHashes));
+ absl::string_view GetCommonHashes() const override {
+ return absl::string_view(reinterpret_cast<const char*>(kSetHashes),
+ sizeof(uint64_t) * ABSL_ARRAYSIZE(kSetHashes));
}
- quiche::QuicheStringPiece GetCert(uint64_t hash,
- uint32_t index) const override {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kSets); i++) {
+ absl::string_view GetCert(uint64_t hash, uint32_t index) const override {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kSets); i++) {
if (kSets[i].hash == hash) {
if (index < kSets[i].num_certs) {
- return quiche::QuicheStringPiece(
+ return absl::string_view(
reinterpret_cast<const char*>(kSets[i].certs[index]),
kSets[i].lens[index]);
}
@@ -98,11 +96,11 @@ class CommonCertSetsQUIC : public CommonCertSets {
}
}
- return quiche::QuicheStringPiece();
+ return absl::string_view();
}
- bool MatchCert(quiche::QuicheStringPiece cert,
- quiche::QuicheStringPiece common_set_hashes,
+ bool MatchCert(absl::string_view cert,
+ absl::string_view common_set_hashes,
uint64_t* out_hash,
uint32_t* out_index) const override {
if (common_set_hashes.size() % sizeof(uint64_t) != 0) {
@@ -114,7 +112,7 @@ class CommonCertSetsQUIC : public CommonCertSets {
memcpy(&hash, common_set_hashes.data() + i * sizeof(uint64_t),
sizeof(uint64_t));
- for (size_t j = 0; j < QUICHE_ARRAYSIZE(kSets); j++) {
+ for (size_t j = 0; j < ABSL_ARRAYSIZE(kSets); j++) {
if (kSets[j].hash != hash) {
continue;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.h b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.h
index af211ad79ff..ae83e1ddbf5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set.h
@@ -7,9 +7,9 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -22,23 +22,22 @@ class QUIC_EXPORT_PRIVATE CommonCertSets {
// GetInstanceQUIC returns the standard QUIC common certificate sets.
static const CommonCertSets* GetInstanceQUIC();
- // GetCommonHashes returns a quiche::QuicheStringPiece containing the hashes
+ // GetCommonHashes returns a absl::string_view containing the hashes
// of common sets supported by this object. The 64-bit hashes are concatenated
- // in the quiche::QuicheStringPiece.
- virtual quiche::QuicheStringPiece GetCommonHashes() const = 0;
+ // in the absl::string_view.
+ virtual absl::string_view GetCommonHashes() const = 0;
// GetCert returns a specific certificate (at index |index|) in the common
// set identified by |hash|. If no such certificate is known, an empty
- // quiche::QuicheStringPiece is returned.
- virtual quiche::QuicheStringPiece GetCert(uint64_t hash,
- uint32_t index) const = 0;
+ // absl::string_view is returned.
+ virtual absl::string_view GetCert(uint64_t hash, uint32_t index) const = 0;
// MatchCert tries to find |cert| in one of the common certificate sets
// identified by |common_set_hashes|. On success it puts the hash of the
// set in |out_hash|, the index of |cert| in the set in |out_index| and
// returns true. Otherwise it returns false.
- virtual bool MatchCert(quiche::QuicheStringPiece cert,
- quiche::QuicheStringPiece common_set_hashes,
+ virtual bool MatchCert(absl::string_view cert,
+ absl::string_view common_set_hashes,
uint64_t* out_hash,
uint32_t* out_index) const = 0;
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_empty.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_empty.cc
index 537bab970a6..8c9a67bafe8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_empty.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_empty.cc
@@ -6,9 +6,9 @@
#include <cstddef>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -17,17 +17,17 @@ namespace {
class CommonCertSetsEmpty : public CommonCertSets {
public:
// CommonCertSets interface.
- quiche::QuicheStringPiece GetCommonHashes() const override {
- return quiche::QuicheStringPiece();
+ absl::string_view GetCommonHashes() const override {
+ return absl::string_view();
}
- quiche::QuicheStringPiece GetCert(uint64_t /* hash */,
- uint32_t /* index */) const override {
- return quiche::QuicheStringPiece();
+ absl::string_view GetCert(uint64_t /* hash */,
+ uint32_t /* index */) const override {
+ return absl::string_view();
}
- bool MatchCert(quiche::QuicheStringPiece /* cert */,
- quiche::QuicheStringPiece /* common_set_hashes */,
+ bool MatchCert(absl::string_view /* cert */,
+ absl::string_view /* common_set_hashes */,
uint64_t* /* out_hash */,
uint32_t* /* out_index */) const override {
return false;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_test.cc
index 148914d02e0..01996c33e15 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/common_cert_set_test.cc
@@ -6,8 +6,8 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -193,44 +193,44 @@ static const unsigned char kGIACertificate3[] = {
class CommonCertSetsTest : public QuicTest {};
TEST_F(CommonCertSetsTest, FindGIA_2) {
- quiche::QuicheStringPiece gia(reinterpret_cast<const char*>(kGIACertificate2),
- sizeof(kGIACertificate2));
+ absl::string_view gia(reinterpret_cast<const char*>(kGIACertificate2),
+ sizeof(kGIACertificate2));
const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
// Common Cert Set 2's hash.
const uint64_t in_hash = UINT64_C(0xe81a92926081e801);
uint64_t hash;
uint32_t index;
- ASSERT_TRUE(sets->MatchCert(
- gia,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(&in_hash),
- sizeof(in_hash)),
- &hash, &index));
+ ASSERT_TRUE(
+ sets->MatchCert(gia,
+ absl::string_view(reinterpret_cast<const char*>(&in_hash),
+ sizeof(in_hash)),
+ &hash, &index));
EXPECT_EQ(in_hash, hash);
- quiche::QuicheStringPiece gia_copy = sets->GetCert(hash, index);
+ absl::string_view gia_copy = sets->GetCert(hash, index);
EXPECT_FALSE(gia_copy.empty());
ASSERT_EQ(gia.size(), gia_copy.size());
EXPECT_EQ(0, memcmp(gia.data(), gia_copy.data(), gia.size()));
}
TEST_F(CommonCertSetsTest, FindGIA_3) {
- quiche::QuicheStringPiece gia(reinterpret_cast<const char*>(kGIACertificate3),
- sizeof(kGIACertificate3));
+ absl::string_view gia(reinterpret_cast<const char*>(kGIACertificate3),
+ sizeof(kGIACertificate3));
const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
// Common Cert Set 3's hash.
const uint64_t in_hash = UINT64_C(0x918215a28680ed7e);
uint64_t hash;
uint32_t index;
- ASSERT_TRUE(sets->MatchCert(
- gia,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(&in_hash),
- sizeof(in_hash)),
- &hash, &index));
+ ASSERT_TRUE(
+ sets->MatchCert(gia,
+ absl::string_view(reinterpret_cast<const char*>(&in_hash),
+ sizeof(in_hash)),
+ &hash, &index));
EXPECT_EQ(in_hash, hash);
- quiche::QuicheStringPiece gia_copy = sets->GetCert(hash, index);
+ absl::string_view gia_copy = sets->GetCert(hash, index);
EXPECT_FALSE(gia_copy.empty());
ASSERT_EQ(gia.size(), gia_copy.size());
EXPECT_EQ(0, memcmp(gia.data(), gia_copy.data(), gia.size()));
@@ -238,15 +238,15 @@ TEST_F(CommonCertSetsTest, FindGIA_3) {
TEST_F(CommonCertSetsTest, NonMatch) {
const CommonCertSets* sets(CommonCertSets::GetInstanceQUIC());
- quiche::QuicheStringPiece not_a_cert("hello");
+ absl::string_view not_a_cert("hello");
const uint64_t in_hash = UINT64_C(0xc9fef74053f99f39);
uint64_t hash;
uint32_t index;
- EXPECT_FALSE(sets->MatchCert(
- not_a_cert,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(&in_hash),
- sizeof(in_hash)),
- &hash, &index));
+ EXPECT_FALSE(
+ sets->MatchCert(not_a_cert,
+ absl::string_view(reinterpret_cast<const char*>(&in_hash),
+ sizeof(in_hash)),
+ &hash, &index));
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.cc
index 6a18884f6bd..2a3f7958034 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.cc
@@ -7,15 +7,15 @@
#include <string>
#include <utility>
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -60,7 +60,7 @@ CryptoFramer::~CryptoFramer() {}
// static
std::unique_ptr<CryptoHandshakeMessage> CryptoFramer::ParseMessage(
- quiche::QuicheStringPiece in) {
+ absl::string_view in) {
OneShotVisitor visitor;
CryptoFramer framer;
@@ -81,12 +81,12 @@ const std::string& CryptoFramer::error_detail() const {
return error_detail_;
}
-bool CryptoFramer::ProcessInput(quiche::QuicheStringPiece input,
+bool CryptoFramer::ProcessInput(absl::string_view input,
EncryptionLevel /*level*/) {
return ProcessInput(input);
}
-bool CryptoFramer::ProcessInput(quiche::QuicheStringPiece input) {
+bool CryptoFramer::ProcessInput(absl::string_view input) {
DCHECK_EQ(QUIC_NO_ERROR, error_);
if (error_ != QUIC_NO_ERROR) {
return false;
@@ -121,7 +121,7 @@ void CryptoFramer::ForceHandshake() {
QuicDataReader reader(buffer_.data(), buffer_.length(),
quiche::HOST_BYTE_ORDER);
for (const std::pair<QuicTag, size_t>& item : tags_and_lengths_) {
- quiche::QuicheStringPiece value;
+ absl::string_view value;
if (reader.BytesRemaining() < item.second) {
break;
}
@@ -243,7 +243,7 @@ void CryptoFramer::Clear() {
state_ = STATE_READING_TAG;
}
-QuicErrorCode CryptoFramer::Process(quiche::QuicheStringPiece input) {
+QuicErrorCode CryptoFramer::Process(absl::string_view input) {
// Add this data to the buffer.
buffer_.append(input.data(), input.length());
QuicDataReader reader(buffer_.data(), buffer_.length(),
@@ -258,7 +258,7 @@ QuicErrorCode CryptoFramer::Process(quiche::QuicheStringPiece input) {
reader.ReadTag(&message_tag);
message_.set_tag(message_tag);
state_ = STATE_READING_NUM_ENTRIES;
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case STATE_READING_NUM_ENTRIES:
if (reader.BytesRemaining() < kNumEntriesSize + sizeof(uint16_t)) {
break;
@@ -274,7 +274,7 @@ QuicErrorCode CryptoFramer::Process(quiche::QuicheStringPiece input) {
tags_and_lengths_.reserve(num_entries_);
state_ = STATE_READING_TAGS_AND_LENGTHS;
values_len_ = 0;
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case STATE_READING_TAGS_AND_LENGTHS: {
if (reader.BytesRemaining() <
num_entries_ * (kQuicTagSize + kCryptoEndOffsetSize)) {
@@ -308,7 +308,7 @@ QuicErrorCode CryptoFramer::Process(quiche::QuicheStringPiece input) {
}
values_len_ = last_end_offset;
state_ = STATE_READING_VALUES;
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
}
case STATE_READING_VALUES:
if (reader.BytesRemaining() < values_len_) {
@@ -319,7 +319,7 @@ QuicErrorCode CryptoFramer::Process(quiche::QuicheStringPiece input) {
<< values_len_ - reader.BytesRemaining() << " bytes.";
}
for (const std::pair<QuicTag, size_t>& item : tags_and_lengths_) {
- quiche::QuicheStringPiece value;
+ absl::string_view value;
if (!reader.ReadStringPiece(&value, item.second)) {
DCHECK(process_truncated_messages_);
// Store an empty value.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.h b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.h
index 8dc0d96eba1..e7289ebed2f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer.h
@@ -12,10 +12,10 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -43,10 +43,10 @@ class QUIC_EXPORT_PRIVATE CryptoFramer : public CryptoMessageParser {
~CryptoFramer() override;
// ParseMessage parses exactly one message from the given
- // quiche::QuicheStringPiece. If there is an error, the message is truncated,
+ // absl::string_view. If there is an error, the message is truncated,
// or the message has trailing garbage then nullptr will be returned.
static std::unique_ptr<CryptoHandshakeMessage> ParseMessage(
- quiche::QuicheStringPiece in);
+ absl::string_view in);
// Set callbacks to be called from the framer. A visitor must be set, or
// else the framer will crash. It is acceptable for the visitor to do
@@ -63,9 +63,8 @@ class QUIC_EXPORT_PRIVATE CryptoFramer : public CryptoMessageParser {
// false if there was an error, and true otherwise. ProcessInput optionally
// takes an EncryptionLevel, but it is ignored. The variant with the
// EncryptionLevel is provided to match the CryptoMessageParser interface.
- bool ProcessInput(quiche::QuicheStringPiece input,
- EncryptionLevel level) override;
- bool ProcessInput(quiche::QuicheStringPiece input);
+ bool ProcessInput(absl::string_view input, EncryptionLevel level) override;
+ bool ProcessInput(absl::string_view input);
// Returns the number of bytes of buffered input data remaining to be
// parsed.
@@ -96,7 +95,7 @@ class QUIC_EXPORT_PRIVATE CryptoFramer : public CryptoMessageParser {
// Process does does the work of |ProcessInput|, but returns an error code,
// doesn't set error_ and doesn't call |visitor_->OnError()|.
- QuicErrorCode Process(quiche::QuicheStringPiece input);
+ QuicErrorCode Process(absl::string_view input);
static bool WritePadTag(QuicDataWriter* writer,
size_t pad_length,
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer_test.cc
index d598c4956d1..033e6248b90 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_framer_test.cc
@@ -8,6 +8,8 @@
#include <memory>
#include <vector>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
@@ -15,8 +17,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
namespace quic {
@@ -85,7 +85,7 @@ TEST(CryptoFramerTest, ConstructHandshakeMessage) {
ASSERT_TRUE(data != nullptr);
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST(CryptoFramerTest, ConstructHandshakeMessageWithTwoKeys) {
@@ -121,7 +121,7 @@ TEST(CryptoFramerTest, ConstructHandshakeMessageWithTwoKeys) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST(CryptoFramerTest, ConstructHandshakeMessageZeroLength) {
@@ -148,7 +148,7 @@ TEST(CryptoFramerTest, ConstructHandshakeMessageZeroLength) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST(CryptoFramerTest, ConstructHandshakeMessageTooManyEntries) {
@@ -198,7 +198,7 @@ TEST(CryptoFramerTest, ConstructHandshakeMessageMinimumSize) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST(CryptoFramerTest, ConstructHandshakeMessageMinimumSizePadLast) {
@@ -234,7 +234,7 @@ TEST(CryptoFramerTest, ConstructHandshakeMessageMinimumSizePadLast) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST(CryptoFramerTest, ProcessInput) {
@@ -264,7 +264,7 @@ TEST(CryptoFramerTest, ProcessInput) {
};
EXPECT_TRUE(framer.ProcessInput(
- quiche::QuicheStringPiece(AsChars(input), QUICHE_ARRAYSIZE(input))));
+ absl::string_view(AsChars(input), ABSL_ARRAYSIZE(input))));
EXPECT_EQ(0u, framer.InputBytesRemaining());
EXPECT_EQ(0, visitor.error_count_);
ASSERT_EQ(1u, visitor.messages_.size());
@@ -308,7 +308,7 @@ TEST(CryptoFramerTest, ProcessInputWithThreeKeys) {
};
EXPECT_TRUE(framer.ProcessInput(
- quiche::QuicheStringPiece(AsChars(input), QUICHE_ARRAYSIZE(input))));
+ absl::string_view(AsChars(input), ABSL_ARRAYSIZE(input))));
EXPECT_EQ(0u, framer.InputBytesRemaining());
EXPECT_EQ(0, visitor.error_count_);
ASSERT_EQ(1u, visitor.messages_.size());
@@ -346,9 +346,8 @@ TEST(CryptoFramerTest, ProcessInputIncrementally) {
'g', 'h', 'i', 'j', 'k',
};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(input); i++) {
- EXPECT_TRUE(
- framer.ProcessInput(quiche::QuicheStringPiece(AsChars(input) + i, 1)));
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(input); i++) {
+ EXPECT_TRUE(framer.ProcessInput(absl::string_view(AsChars(input) + i, 1)));
}
EXPECT_EQ(0u, framer.InputBytesRemaining());
ASSERT_EQ(1u, visitor.messages_.size());
@@ -382,7 +381,7 @@ TEST(CryptoFramerTest, ProcessInputTagsOutOfOrder) {
};
EXPECT_FALSE(framer.ProcessInput(
- quiche::QuicheStringPiece(AsChars(input), QUICHE_ARRAYSIZE(input))));
+ absl::string_view(AsChars(input), ABSL_ARRAYSIZE(input))));
EXPECT_THAT(framer.error(), IsError(QUIC_CRYPTO_TAGS_OUT_OF_ORDER));
EXPECT_EQ(1, visitor.error_count_);
}
@@ -410,7 +409,7 @@ TEST(CryptoFramerTest, ProcessEndOffsetsOutOfOrder) {
};
EXPECT_FALSE(framer.ProcessInput(
- quiche::QuicheStringPiece(AsChars(input), QUICHE_ARRAYSIZE(input))));
+ absl::string_view(AsChars(input), ABSL_ARRAYSIZE(input))));
EXPECT_THAT(framer.error(), IsError(QUIC_CRYPTO_TAGS_OUT_OF_ORDER));
EXPECT_EQ(1, visitor.error_count_);
}
@@ -430,7 +429,7 @@ TEST(CryptoFramerTest, ProcessInputTooManyEntries) {
};
EXPECT_FALSE(framer.ProcessInput(
- quiche::QuicheStringPiece(AsChars(input), QUICHE_ARRAYSIZE(input))));
+ absl::string_view(AsChars(input), ABSL_ARRAYSIZE(input))));
EXPECT_THAT(framer.error(), IsError(QUIC_CRYPTO_TOO_MANY_ENTRIES));
EXPECT_EQ(1, visitor.error_count_);
}
@@ -458,7 +457,7 @@ TEST(CryptoFramerTest, ProcessInputZeroLength) {
};
EXPECT_TRUE(framer.ProcessInput(
- quiche::QuicheStringPiece(AsChars(input), QUICHE_ARRAYSIZE(input))));
+ absl::string_view(AsChars(input), ABSL_ARRAYSIZE(input))));
EXPECT_EQ(0, visitor.error_count_);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.cc
index 3df9f12a033..75bd3feac4f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.cc
@@ -7,16 +7,17 @@
#include <memory>
#include <string>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_socket_address_coder.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -97,7 +98,7 @@ void CryptoHandshakeMessage::SetVersion(QuicTag tag,
}
void CryptoHandshakeMessage::SetStringPiece(QuicTag tag,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
tag_value_map_[tag] = std::string(value);
}
@@ -159,9 +160,8 @@ QuicErrorCode CryptoHandshakeMessage::GetVersionLabel(
return QUIC_NO_ERROR;
}
-bool CryptoHandshakeMessage::GetStringPiece(
- QuicTag tag,
- quiche::QuicheStringPiece* out) const {
+bool CryptoHandshakeMessage::GetStringPiece(QuicTag tag,
+ absl::string_view* out) const {
auto it = tag_value_map_.find(tag);
if (it == tag_value_map_.end()) {
return false;
@@ -177,8 +177,8 @@ bool CryptoHandshakeMessage::HasStringPiece(QuicTag tag) const {
QuicErrorCode CryptoHandshakeMessage::GetNthValue24(
QuicTag tag,
unsigned index,
- quiche::QuicheStringPiece* out) const {
- quiche::QuicheStringPiece value;
+ absl::string_view* out) const {
+ absl::string_view value;
if (!GetStringPiece(tag, &value)) {
return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
}
@@ -203,7 +203,7 @@ QuicErrorCode CryptoHandshakeMessage::GetNthValue24(
}
if (i == index) {
- *out = quiche::QuicheStringPiece(value.data(), size);
+ *out = absl::string_view(value.data(), size);
return QUIC_NO_ERROR;
}
@@ -371,7 +371,7 @@ std::string CryptoHandshakeMessage::DebugStringInternal(size_t indent) const {
if (!done) {
// If there's no specific format for this tag, or the value is invalid,
// then just use hex.
- ret += "0x" + quiche::QuicheTextUtils::HexEncode(it->second);
+ ret += "0x" + absl::BytesToHexString(it->second);
}
ret += "\n";
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h
index 95390507a6a..5c501277112 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h
@@ -11,10 +11,10 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -78,7 +78,7 @@ class QUIC_EXPORT_PRIVATE CryptoHandshakeMessage {
const QuicTagValueMap& tag_value_map() const { return tag_value_map_; }
- void SetStringPiece(QuicTag tag, quiche::QuicheStringPiece value);
+ void SetStringPiece(QuicTag tag, absl::string_view value);
// Erase removes a tag/value, if present, from the message.
void Erase(QuicTag tag);
@@ -99,7 +99,7 @@ class QUIC_EXPORT_PRIVATE CryptoHandshakeMessage {
// Otherwise it populates |out| with the label and returns QUIC_NO_ERROR.
QuicErrorCode GetVersionLabel(QuicTag tag, QuicVersionLabel* out) const;
- bool GetStringPiece(QuicTag tag, quiche::QuicheStringPiece* out) const;
+ bool GetStringPiece(QuicTag tag, absl::string_view* out) const;
bool HasStringPiece(QuicTag tag) const;
// GetNthValue24 interprets the value with the given tag to be a series of
@@ -107,7 +107,7 @@ class QUIC_EXPORT_PRIVATE CryptoHandshakeMessage {
// index.
QuicErrorCode GetNthValue24(QuicTag tag,
unsigned index,
- quiche::QuicheStringPiece* out) const;
+ absl::string_view* out) const;
QuicErrorCode GetUint32(QuicTag tag, uint32_t* out) const;
QuicErrorCode GetUint64(QuicTag tag, uint64_t* out) const;
QuicErrorCode GetUint128(QuicTag tag, QuicUint128* out) const;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message_test.cc
index b6dfdd4cdaa..b006572238b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message_test.cc
@@ -7,7 +7,7 @@
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
namespace test {
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h
index 80386646368..b5e6a9d4764 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h
@@ -7,9 +7,9 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -23,8 +23,7 @@ class QUIC_EXPORT_PRIVATE CryptoMessageParser {
// Processes input data, which must be delivered in order. The input data
// being processed was received at encryption level |level|. Returns
// false if there was an error, and true otherwise.
- virtual bool ProcessInput(quiche::QuicheStringPiece input,
- EncryptionLevel level) = 0;
+ virtual bool ProcessInput(absl::string_view input, EncryptionLevel level) = 0;
// Returns the number of bytes of buffered input data remaining to be
// parsed.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_printer_bin.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_printer_bin.cc
index f5584adad55..9a4e223fae9 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_printer_bin.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_message_printer_bin.cc
@@ -10,6 +10,7 @@
#include <iostream>
#include <string>
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
@@ -47,7 +48,7 @@ int main(int argc, char* argv[]) {
quic::CryptoFramer framer;
framer.set_visitor(&printer);
framer.set_process_truncated_messages(true);
- std::string input = quiche::QuicheTextUtils::HexDecode(messages[0]);
+ std::string input = absl::HexStringToBytes(messages[0]);
if (!framer.ProcessInput(input)) {
return 1;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h
index bf3a97ca891..5372f3fdb50 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h
@@ -24,10 +24,11 @@
namespace quic {
-typedef std::string ServerConfigID;
+using ServerConfigID = std::string;
// The following tags have been deprecated and should not be reused:
-// "1CON", "BBQ4", "NCON", "RCID", "SREJ", "TBKP", "TB10", "SCLS", "SMHL"
+// "1CON", "BBQ4", "NCON", "RCID", "SREJ", "TBKP", "TB10", "SCLS", "SMHL",
+// "QNZR", "B2HI"
// clang-format off
const QuicTag kCHLO = TAG('C', 'H', 'L', 'O'); // Client hello
@@ -100,8 +101,8 @@ const QuicTag kBBR9 = TAG('B', 'B', 'R', '9'); // DEPRECATED
const QuicTag kBBRS = TAG('B', 'B', 'R', 'S'); // DEPRECATED
const QuicTag kBBQ1 = TAG('B', 'B', 'Q', '1'); // BBR with lower 2.77 STARTUP
// pacing and CWND gain.
-const QuicTag kBBQ2 = TAG('B', 'B', 'Q', '2'); // BBR with lower 2.0 STARTUP
- // CWND gain.
+const QuicTag kBBQ2 = TAG('B', 'B', 'Q', '2'); // BBRv2 with 2.885 STARTUP and
+ // DRAIN CWND gain.
const QuicTag kBBQ3 = TAG('B', 'B', 'Q', '3'); // BBR with ack aggregation
// compensation in STARTUP.
const QuicTag kBBQ5 = TAG('B', 'B', 'Q', '5'); // Expire ack aggregation upon
@@ -118,15 +119,24 @@ const QuicTag kIW50 = TAG('I', 'W', '5', '0'); // Force ICWND to 50
const QuicTag kB2ON = TAG('B', '2', 'O', 'N'); // Enable BBRv2
const QuicTag kB2NA = TAG('B', '2', 'N', 'A'); // For BBRv2, do not add ack
// height to queueing threshold
+const QuicTag kB2NE = TAG('B', '2', 'N', 'E'); // For BBRv2, do not exit
+ // STARTUP if there's enough
+ // bandwidth growth
const QuicTag kB2RP = TAG('B', '2', 'R', 'P'); // For BBRv2, run PROBE_RTT on
// the regular schedule
const QuicTag kB2CL = TAG('B', '2', 'C', 'L'); // For BBRv2, allow PROBE_BW
// cwnd to be below BDP + ack
// height.
const QuicTag kB2LO = TAG('B', '2', 'L', 'O'); // Ignore inflight_lo in BBR2
-const QuicTag kB2HI = TAG('B', '2', 'H', 'I'); // Limit inflight_hi reduction
- // based on CWND.
const QuicTag kB2HR = TAG('B', '2', 'H', 'R'); // 15% inflight_hi headroom.
+const QuicTag kB2SL = TAG('B', '2', 'S', 'L'); // When exiting STARTUP due to
+ // loss, set inflight_hi to the
+ // max of bdp and max bytes
+ // delivered in round.
+const QuicTag kB2H2 = TAG('B', '2', 'H', '2'); // When exiting PROBE_UP due to
+ // loss, set inflight_hi to the
+ // max of inflight@send and max
+ // bytes delivered in round.
const QuicTag kBSAO = TAG('B', 'S', 'A', 'O'); // Avoid Overestimation in
// Bandwidth Sampler with ack
// aggregation
@@ -160,7 +170,12 @@ const QuicTag kAKDU = TAG('A', 'K', 'D', 'U'); // Unlimited number of packets
// received before acking
const QuicTag kACKQ = TAG('A', 'C', 'K', 'Q'); // Send an immediate ack after
// 1 RTT of not receiving.
-const QuicTag kAFFE = TAG('A', 'F', 'F', 'E'); // AckFrequencyFrame Enabled.
+const QuicTag kAFFE = TAG('A', 'F', 'F', 'E'); // Enable client receiving
+ // AckFrequencyFrame.
+const QuicTag kAFF1 = TAG('A', 'F', 'F', '1'); // Use SRTT in building
+ // AckFrequencyFrame.
+const QuicTag kAFF2 = TAG('A', 'F', 'F', '2'); // Send AckFrequencyFrame upon
+ // handshake completion.
const QuicTag kSSLR = TAG('S', 'S', 'L', 'R'); // Slow Start Large Reduction.
const QuicTag kNPRR = TAG('N', 'P', 'R', 'R'); // Pace at unity instead of PRR
const QuicTag k2RTO = TAG('2', 'R', 'T', 'O'); // Close connection on 2 RTOs
@@ -361,7 +376,8 @@ const QuicTag kUAID = TAG('U', 'A', 'I', 'D'); // Client's User Agent ID.
const QuicTag kXLCT = TAG('X', 'L', 'C', 'T'); // Expected leaf certificate.
const QuicTag kQLVE = TAG('Q', 'L', 'V', 'E'); // Legacy Version
// Encapsulation.
-const QuicTag kQNZR = TAG('Q', 'N', 'Z', 'R'); // Turn off QUIC crypto 0-RTT.
+
+const QuicTag kQNZ2 = TAG('Q', 'N', 'Z', '2'); // Turn off QUIC crypto 0-RTT.
const QuicTag kQNSP = TAG('Q', 'N', 'S', 'P'); // Turn off server push in
// gQUIC.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.cc
index 78cf768dcc6..1f75e0c7157 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.cc
@@ -7,11 +7,11 @@
#include "net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/aead.h"
#include "third_party/boringssl/src/include/openssl/err.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -68,7 +68,7 @@ void CryptoSecretBoxer::SetKeys(const std::vector<std::string>& keys) {
}
std::string CryptoSecretBoxer::Box(QuicRandom* rand,
- quiche::QuicheStringPiece plaintext) const {
+ absl::string_view plaintext) const {
// The box is formatted as:
// 12 bytes of random nonce
// n bytes of ciphertext
@@ -104,9 +104,9 @@ std::string CryptoSecretBoxer::Box(QuicRandom* rand,
return ret;
}
-bool CryptoSecretBoxer::Unbox(quiche::QuicheStringPiece in_ciphertext,
+bool CryptoSecretBoxer::Unbox(absl::string_view in_ciphertext,
std::string* out_storage,
- quiche::QuicheStringPiece* out) const {
+ absl::string_view* out) const {
if (in_ciphertext.size() < kSIVNonceSize) {
return false;
}
@@ -130,7 +130,7 @@ bool CryptoSecretBoxer::Unbox(quiche::QuicheStringPiece in_ciphertext,
kSIVNonceSize, ciphertext, ciphertext_len, nullptr,
0)) {
ok = true;
- *out = quiche::QuicheStringPiece(out_storage->data(), bytes_written);
+ *out = absl::string_view(out_storage->data(), bytes_written);
break;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.h b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.h
index dc4e0b14cb8..6cf61b41c8d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer.h
@@ -10,9 +10,9 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mutex.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -41,16 +41,16 @@ class QUIC_EXPORT_PRIVATE CryptoSecretBoxer {
// returns the resulting ciphertext. Since an authenticator and nonce are
// included, the result will be slightly larger than |plaintext|. The first
// key in the vector supplied to |SetKeys| will be used.
- std::string Box(QuicRandom* rand, quiche::QuicheStringPiece plaintext) const;
+ std::string Box(QuicRandom* rand, absl::string_view plaintext) const;
// Unbox takes the result of a previous call to |Box| in |ciphertext| and
// authenticates+decrypts it. If |ciphertext| cannot be decrypted with any of
// the supplied keys, the function returns false. Otherwise, |out_storage| is
// used to store the result and |out| is set to point into |out_storage| and
// contains the original plaintext.
- bool Unbox(quiche::QuicheStringPiece ciphertext,
+ bool Unbox(absl::string_view ciphertext,
std::string* out_storage,
- quiche::QuicheStringPiece* out) const;
+ absl::string_view* out) const;
private:
struct State;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer_test.cc
index 57a5712f07b..b63d081031f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_secret_boxer_test.cc
@@ -6,9 +6,9 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -16,7 +16,7 @@ namespace test {
class CryptoSecretBoxerTest : public QuicTest {};
TEST_F(CryptoSecretBoxerTest, BoxAndUnbox) {
- quiche::QuicheStringPiece message("hello world");
+ absl::string_view message("hello world");
CryptoSecretBoxer boxer;
boxer.SetKeys({std::string(CryptoSecretBoxer::GetKeySize(), 0x11)});
@@ -24,7 +24,7 @@ TEST_F(CryptoSecretBoxerTest, BoxAndUnbox) {
const std::string box = boxer.Box(QuicRandom::GetInstance(), message);
std::string storage;
- quiche::QuicheStringPiece result;
+ absl::string_view result;
EXPECT_TRUE(boxer.Unbox(box, &storage, &result));
EXPECT_EQ(result, message);
@@ -40,10 +40,10 @@ TEST_F(CryptoSecretBoxerTest, BoxAndUnbox) {
// Helper function to test whether one boxer can decode the output of another.
static bool CanDecode(const CryptoSecretBoxer& decoder,
const CryptoSecretBoxer& encoder) {
- quiche::QuicheStringPiece message("hello world");
+ absl::string_view message("hello world");
const std::string boxed = encoder.Box(QuicRandom::GetInstance(), message);
std::string storage;
- quiche::QuicheStringPiece result;
+ absl::string_view result;
bool ok = decoder.Unbox(boxed, &storage, &result);
if (ok) {
EXPECT_EQ(result, message);
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_server_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_server_test.cc
index 17ab10b0717..51dc4181002 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_server_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_server_test.cc
@@ -10,6 +10,9 @@
#include <utility>
#include <vector>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
#include "net/third_party/quiche/src/quic/core/crypto/cert_compressor.h"
#include "net/third_party/quiche/src/quic/core/crypto/common_cert_set.h"
@@ -29,10 +32,8 @@
#include "net/third_party/quiche/src/quic/test_tools/mock_random.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
namespace test {
@@ -127,7 +128,7 @@ class CryptoServerTest : public QuicTestWithParam<TestParams> {
std::unique_ptr<CryptoHandshakeMessage> msg(
config_.AddConfig(primary_config, clock_.WallNow()));
- quiche::QuicheStringPiece orbit;
+ absl::string_view orbit;
CHECK(msg->GetStringPiece(kORBT, &orbit));
CHECK_EQ(sizeof(orbit_), orbit.size());
memcpy(orbit_, orbit.data(), orbit.size());
@@ -135,9 +136,9 @@ class CryptoServerTest : public QuicTestWithParam<TestParams> {
char public_value[32];
memset(public_value, 42, sizeof(public_value));
- nonce_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(GenerateNonce());
- pub_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(public_value,
- sizeof(public_value));
+ nonce_hex_ = "#" + absl::BytesToHexString(GenerateNonce());
+ pub_hex_ = "#" + absl::BytesToHexString(
+ absl::string_view(public_value, sizeof(public_value)));
CryptoHandshakeMessage client_hello =
crypto_test_utils::CreateCHLO({{"PDMD", "X509"},
@@ -154,19 +155,19 @@ class CryptoServerTest : public QuicTestWithParam<TestParams> {
CheckRejectTag();
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
- quiche::QuicheStringPiece srct;
+ absl::string_view srct;
ASSERT_TRUE(out_.GetStringPiece(kSourceAddressTokenTag, &srct));
- srct_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(srct);
+ srct_hex_ = "#" + absl::BytesToHexString(srct);
- quiche::QuicheStringPiece scfg;
+ absl::string_view scfg;
ASSERT_TRUE(out_.GetStringPiece(kSCFG, &scfg));
server_config_ = CryptoFramer::ParseMessage(scfg);
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
ASSERT_TRUE(server_config_->GetStringPiece(kSCID, &scid));
- scid_hex_ = "#" + quiche::QuicheTextUtils::HexEncode(scid);
+ scid_hex_ = "#" + absl::BytesToHexString(scid);
signed_config_ = QuicReferenceCountedPointer<QuicSignedServerConfig>(
new QuicSignedServerConfig());
@@ -211,7 +212,7 @@ class CryptoServerTest : public QuicTestWithParam<TestParams> {
EXPECT_EQ(CreateQuicVersionLabel(supported_versions_[i]), versions[i]);
}
- quiche::QuicheStringPiece address;
+ absl::string_view address;
ASSERT_TRUE(server_hello.GetStringPiece(kCADR, &address));
QuicSocketAddressCoder decoder;
ASSERT_TRUE(decoder.Decode(address.data(), address.size()));
@@ -313,8 +314,8 @@ class CryptoServerTest : public QuicTestWithParam<TestParams> {
std::string nonce;
CryptoUtils::GenerateNonce(
clock_.WallNow(), rand_,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(orbit_),
- sizeof(orbit_)),
+ absl::string_view(reinterpret_cast<const char*>(orbit_),
+ sizeof(orbit_)),
&nonce);
return nonce;
}
@@ -340,8 +341,8 @@ class CryptoServerTest : public QuicTestWithParam<TestParams> {
std::string XlctHexString() {
uint64_t xlct = crypto_test_utils::LeafCertHashForTesting();
- return "#" + quiche::QuicheTextUtils::HexEncode(
- reinterpret_cast<char*>(&xlct), sizeof(xlct));
+ return "#" + absl::BytesToHexString(absl::string_view(
+ reinterpret_cast<char*>(&xlct), sizeof(xlct)));
}
protected:
@@ -386,7 +387,7 @@ TEST_P(CryptoServerTest, BadSNI) {
};
// clang-format on
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kBadSNIs); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kBadSNIs); i++) {
CryptoHandshakeMessage msg =
crypto_test_utils::CreateCHLO({{"PDMD", "X509"},
{"SNI", kBadSNIs[i]},
@@ -395,7 +396,7 @@ TEST_P(CryptoServerTest, BadSNI) {
ShouldFailMentioning("SNI", msg);
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
}
@@ -413,7 +414,7 @@ TEST_P(CryptoServerTest, DefaultCert) {
kClientHelloMinimumSize);
ShouldSucceed(msg);
- quiche::QuicheStringPiece cert, proof, cert_sct;
+ absl::string_view cert, proof, cert_sct;
EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
EXPECT_TRUE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
@@ -421,7 +422,7 @@ TEST_P(CryptoServerTest, DefaultCert) {
EXPECT_NE(0u, proof.size());
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
EXPECT_LT(0u, cert_sct.size());
}
@@ -442,13 +443,13 @@ TEST_P(CryptoServerTest, RejectTooLarge) {
config_.set_chlo_multiplier(1);
ShouldSucceed(msg);
- quiche::QuicheStringPiece cert, proof, cert_sct;
+ absl::string_view cert, proof, cert_sct;
EXPECT_FALSE(out_.GetStringPiece(kCertificateTag, &cert));
EXPECT_FALSE(out_.GetStringPiece(kPROF, &proof));
EXPECT_FALSE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, RejectNotTooLarge) {
@@ -469,13 +470,13 @@ TEST_P(CryptoServerTest, RejectNotTooLarge) {
config_.set_chlo_multiplier(1);
ShouldSucceed(msg);
- quiche::QuicheStringPiece cert, proof, cert_sct;
+ absl::string_view cert, proof, cert_sct;
EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
EXPECT_TRUE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, RejectTooLargeButValidSTK) {
@@ -496,7 +497,7 @@ TEST_P(CryptoServerTest, RejectTooLargeButValidSTK) {
config_.set_chlo_multiplier(1);
ShouldSucceed(msg);
- quiche::QuicheStringPiece cert, proof, cert_sct;
+ absl::string_view cert, proof, cert_sct;
EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
EXPECT_TRUE(out_.GetStringPiece(kCertificateSCTTag, &cert_sct));
@@ -504,7 +505,7 @@ TEST_P(CryptoServerTest, RejectTooLargeButValidSTK) {
EXPECT_NE(0u, proof.size());
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, BadSourceAddressToken) {
@@ -518,7 +519,7 @@ TEST_P(CryptoServerTest, BadSourceAddressToken) {
};
// clang-format on
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kBadSourceAddressTokens); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kBadSourceAddressTokens); i++) {
CryptoHandshakeMessage msg =
crypto_test_utils::CreateCHLO({{"PDMD", "X509"},
{"STK", kBadSourceAddressTokens[i]},
@@ -527,7 +528,7 @@ TEST_P(CryptoServerTest, BadSourceAddressToken) {
ShouldSucceed(msg);
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
}
@@ -540,7 +541,7 @@ TEST_P(CryptoServerTest, BadClientNonce) {
};
// clang-format on
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kBadNonces); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kBadNonces); i++) {
// Invalid nonces should be ignored, in an inchoate CHLO.
CryptoHandshakeMessage msg =
@@ -552,7 +553,7 @@ TEST_P(CryptoServerTest, BadClientNonce) {
ShouldSucceed(msg);
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
// Invalid nonces should result in CLIENT_NONCE_INVALID_FAILURE.
CryptoHandshakeMessage msg1 =
@@ -573,7 +574,7 @@ TEST_P(CryptoServerTest, BadClientNonce) {
CheckRejectTag();
const HandshakeFailureReason kRejectReasons1[] = {
CLIENT_NONCE_INVALID_FAILURE};
- CheckRejectReasons(kRejectReasons1, QUICHE_ARRAYSIZE(kRejectReasons1));
+ CheckRejectReasons(kRejectReasons1, ABSL_ARRAYSIZE(kRejectReasons1));
}
}
@@ -587,7 +588,7 @@ TEST_P(CryptoServerTest, NoClientNonce) {
ShouldSucceed(msg);
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
CryptoHandshakeMessage msg1 =
crypto_test_utils::CreateCHLO({{"PDMD", "X509"},
@@ -604,7 +605,7 @@ TEST_P(CryptoServerTest, NoClientNonce) {
CheckRejectTag();
const HandshakeFailureReason kRejectReasons1[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons1, QUICHE_ARRAYSIZE(kRejectReasons1));
+ CheckRejectReasons(kRejectReasons1, ABSL_ARRAYSIZE(kRejectReasons1));
}
TEST_P(CryptoServerTest, DowngradeAttack) {
@@ -623,7 +624,7 @@ TEST_P(CryptoServerTest, DowngradeAttack) {
ShouldFailMentioning("Downgrade", msg);
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, CorruptServerConfig) {
@@ -643,7 +644,7 @@ TEST_P(CryptoServerTest, CorruptServerConfig) {
CheckRejectTag();
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, CorruptSourceAddressToken) {
@@ -664,7 +665,7 @@ TEST_P(CryptoServerTest, CorruptSourceAddressToken) {
CheckRejectTag();
const HandshakeFailureReason kRejectReasons[] = {
SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, CorruptSourceAddressTokenIsStillAccepted) {
@@ -705,7 +706,7 @@ TEST_P(CryptoServerTest, CorruptClientNonceAndSourceAddressToken) {
CheckRejectTag();
const HandshakeFailureReason kRejectReasons[] = {
SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE, CLIENT_NONCE_INVALID_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, CorruptMultipleTags) {
@@ -729,7 +730,7 @@ TEST_P(CryptoServerTest, CorruptMultipleTags) {
const HandshakeFailureReason kRejectReasons[] = {
SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE, CLIENT_NONCE_INVALID_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, NoServerNonce) {
@@ -778,15 +779,15 @@ TEST_P(CryptoServerTest, ProofForSuppliedServerConfig) {
CheckRejectTag();
const HandshakeFailureReason kRejectReasons[] = {
SOURCE_ADDRESS_TOKEN_DIFFERENT_IP_ADDRESS_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
- quiche::QuicheStringPiece cert, proof, scfg_str;
+ absl::string_view cert, proof, scfg_str;
EXPECT_TRUE(out_.GetStringPiece(kCertificateTag, &cert));
EXPECT_TRUE(out_.GetStringPiece(kPROF, &proof));
EXPECT_TRUE(out_.GetStringPiece(kSCFG, &scfg_str));
std::unique_ptr<CryptoHandshakeMessage> scfg(
CryptoFramer::ParseMessage(scfg_str));
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
EXPECT_TRUE(scfg->GetStringPiece(kSCID, &scid));
EXPECT_NE(scid, kOldConfigId);
@@ -840,7 +841,7 @@ TEST_P(CryptoServerTest, RejectInvalidXlct) {
const HandshakeFailureReason kRejectReasons[] = {
INVALID_EXPECTED_LEAF_CERTIFICATE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
TEST_P(CryptoServerTest, ValidXlct) {
@@ -886,7 +887,7 @@ TEST_P(CryptoServerTest, NonceInSHLO) {
ShouldSucceed(msg);
EXPECT_EQ(kSHLO, out_.tag());
- quiche::QuicheStringPiece nonce;
+ absl::string_view nonce;
EXPECT_TRUE(out_.GetStringPiece(kServerNonceTag, &nonce));
}
@@ -922,7 +923,7 @@ TEST_P(CryptoServerTest, TwoRttServerDropCachedCerts) {
ShouldSucceed(msg);
// Decompress cert chain from server to individual certs.
- quiche::QuicheStringPiece certs_compressed;
+ absl::string_view certs_compressed;
ASSERT_TRUE(out_.GetStringPiece(kCertificateTag, &certs_compressed));
ASSERT_NE(0u, certs_compressed.size());
std::vector<std::string> certs;
@@ -942,7 +943,7 @@ TEST_P(CryptoServerTest, TwoRttServerDropCachedCerts) {
ShouldSucceed(msg);
// Server responds with inchoate REJ containing valid source-address token.
- quiche::QuicheStringPiece srct;
+ absl::string_view srct;
ASSERT_TRUE(out_.GetStringPiece(kSourceAddressTokenTag, &srct));
// Client now drops cached certs; sends CHLO with updated source-address
@@ -1003,7 +1004,7 @@ TEST_F(CryptoServerConfigGenerationTest, SCIDVaries) {
std::unique_ptr<CryptoHandshakeMessage> scfg_b(
b.AddDefaultConfig(&rand_b, &clock, options));
- quiche::QuicheStringPiece scid_a, scid_b;
+ absl::string_view scid_a, scid_b;
EXPECT_TRUE(scfg_a->GetStringPiece(kSCID, &scid_a));
EXPECT_TRUE(scfg_b->GetStringPiece(kSCID, &scid_b));
@@ -1021,7 +1022,7 @@ TEST_F(CryptoServerConfigGenerationTest, SCIDIsHashOfServerConfig) {
std::unique_ptr<CryptoHandshakeMessage> scfg(
a.AddDefaultConfig(&rand_a, &clock, options));
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
EXPECT_TRUE(scfg->GetStringPiece(kSCID, &scid));
// Need to take a copy of |scid| has we're about to call |Erase|.
const std::string scid_str(scid);
@@ -1064,7 +1065,7 @@ TEST_P(CryptoServerTestNoConfig, DontCrash) {
const HandshakeFailureReason kRejectReasons[] = {
SERVER_CONFIG_INCHOATE_HELLO_FAILURE};
- CheckRejectReasons(kRejectReasons, QUICHE_ARRAYSIZE(kRejectReasons));
+ CheckRejectReasons(kRejectReasons, ABSL_ARRAYSIZE(kRejectReasons));
}
class CryptoServerTestOldVersion : public CryptoServerTest {
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.cc
index 365fb120d19..efb7b665744 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.cc
@@ -8,6 +8,8 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/hkdf.h"
#include "third_party/boringssl/src/include/openssl/mem.h"
@@ -32,10 +34,8 @@
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -74,7 +74,7 @@ std::vector<uint8_t> HkdfExpandLabel(const EVP_MD* prf,
!CBB_add_u8_length_prefixed(quic_hkdf_label.get(), &inner_label) ||
!CBB_add_bytes(&inner_label,
reinterpret_cast<const uint8_t*>(label_prefix),
- QUICHE_ARRAYSIZE(label_prefix) - 1) ||
+ ABSL_ARRAYSIZE(label_prefix) - 1) ||
!CBB_add_bytes(&inner_label,
reinterpret_cast<const uint8_t*>(label.data()),
label.size()) ||
@@ -96,6 +96,18 @@ std::vector<uint8_t> HkdfExpandLabel(const EVP_MD* prf,
} // namespace
+void CryptoUtils::InitializeCrypterSecrets(
+ const EVP_MD* prf,
+ const std::vector<uint8_t>& pp_secret,
+ QuicCrypter* crypter) {
+ SetKeyAndIV(prf, pp_secret, crypter);
+ std::vector<uint8_t> header_protection_key =
+ GenerateHeaderProtectionKey(prf, pp_secret, crypter->GetKeySize());
+ crypter->SetHeaderProtectionKey(
+ absl::string_view(reinterpret_cast<char*>(header_protection_key.data()),
+ header_protection_key.size()));
+}
+
void CryptoUtils::SetKeyAndIV(const EVP_MD* prf,
const std::vector<uint8_t>& pp_secret,
QuicCrypter* crypter) {
@@ -103,14 +115,23 @@ void CryptoUtils::SetKeyAndIV(const EVP_MD* prf,
HkdfExpandLabel(prf, pp_secret, "quic key", crypter->GetKeySize());
std::vector<uint8_t> iv =
HkdfExpandLabel(prf, pp_secret, "quic iv", crypter->GetIVSize());
- std::vector<uint8_t> pn =
- HkdfExpandLabel(prf, pp_secret, "quic hp", crypter->GetKeySize());
- crypter->SetKey(quiche::QuicheStringPiece(reinterpret_cast<char*>(key.data()),
- key.size()));
+ crypter->SetKey(
+ absl::string_view(reinterpret_cast<char*>(key.data()), key.size()));
crypter->SetIV(
- quiche::QuicheStringPiece(reinterpret_cast<char*>(iv.data()), iv.size()));
- crypter->SetHeaderProtectionKey(
- quiche::QuicheStringPiece(reinterpret_cast<char*>(pn.data()), pn.size()));
+ absl::string_view(reinterpret_cast<char*>(iv.data()), iv.size()));
+}
+
+std::vector<uint8_t> CryptoUtils::GenerateHeaderProtectionKey(
+ const EVP_MD* prf,
+ const std::vector<uint8_t>& pp_secret,
+ size_t out_len) {
+ return HkdfExpandLabel(prf, pp_secret, "quic hp", out_len);
+}
+
+std::vector<uint8_t> CryptoUtils::GenerateNextKeyPhaseSecret(
+ const EVP_MD* prf,
+ const std::vector<uint8_t>& current_secret) {
+ return HkdfExpandLabel(prf, current_secret, "quic ku", current_secret.size());
}
namespace {
@@ -140,30 +161,37 @@ const uint8_t kT050Salt[] = {0x7f, 0xf5, 0x79, 0xe5, 0xac, 0xd0, 0x72,
const uint8_t kT051Salt[] = {0x7a, 0x4e, 0xde, 0xf4, 0xe7, 0xcc, 0xee,
0x5f, 0xa4, 0x50, 0x6c, 0x19, 0x12, 0x4f,
0xc8, 0xcc, 0xda, 0x6e, 0x03, 0x3d};
+// Salt to use for initial obfuscators in
+// ParsedQuicVersion::ReservedForNegotiation().
+const uint8_t kReservedForNegotiationSalt[] = {
+ 0xf9, 0x64, 0xbf, 0x45, 0x3a, 0x1f, 0x1b, 0x80, 0xa5, 0xf8,
+ 0x82, 0x03, 0x77, 0xd4, 0xaf, 0xca, 0x58, 0x0e, 0xe7, 0x43};
const uint8_t* InitialSaltForVersion(const ParsedQuicVersion& version,
size_t* out_len) {
static_assert(SupportedVersions().size() == 7u,
"Supported versions out of sync with initial encryption salts");
if (version == ParsedQuicVersion::Draft29()) {
- *out_len = QUICHE_ARRAYSIZE(kDraft29InitialSalt);
+ *out_len = ABSL_ARRAYSIZE(kDraft29InitialSalt);
return kDraft29InitialSalt;
- } else if (version == ParsedQuicVersion::Draft27() ||
- version == ParsedQuicVersion::ReservedForNegotiation()) {
- *out_len = QUICHE_ARRAYSIZE(kDraft27InitialSalt);
+ } else if (version == ParsedQuicVersion::Draft27()) {
+ *out_len = ABSL_ARRAYSIZE(kDraft27InitialSalt);
return kDraft27InitialSalt;
} else if (version == ParsedQuicVersion::T051()) {
- *out_len = QUICHE_ARRAYSIZE(kT051Salt);
+ *out_len = ABSL_ARRAYSIZE(kT051Salt);
return kT051Salt;
} else if (version == ParsedQuicVersion::T050()) {
- *out_len = QUICHE_ARRAYSIZE(kT050Salt);
+ *out_len = ABSL_ARRAYSIZE(kT050Salt);
return kT050Salt;
} else if (version == ParsedQuicVersion::Q050()) {
- *out_len = QUICHE_ARRAYSIZE(kQ050Salt);
+ *out_len = ABSL_ARRAYSIZE(kQ050Salt);
return kQ050Salt;
+ } else if (version == ParsedQuicVersion::ReservedForNegotiation()) {
+ *out_len = ABSL_ARRAYSIZE(kReservedForNegotiationSalt);
+ return kReservedForNegotiationSalt;
}
QUIC_BUG << "No initial obfuscation salt for version " << version;
- *out_len = QUICHE_ARRAYSIZE(kDraft27InitialSalt);
+ *out_len = ABSL_ARRAYSIZE(kDraft27InitialSalt);
return kDraft27InitialSalt;
}
@@ -192,16 +220,23 @@ const uint8_t kT050RetryIntegrityKey[] = {0xc9, 0x2d, 0x32, 0x3d, 0x9c, 0xe3,
const uint8_t kT051RetryIntegrityKey[] = {0x2e, 0xb9, 0x61, 0xa6, 0x79, 0x56,
0xf8, 0x79, 0x53, 0x14, 0xda, 0xfb,
0x2e, 0xbc, 0x83, 0xd7};
+// Retry integrity key used by ParsedQuicVersion::ReservedForNegotiation().
+const uint8_t kReservedForNegotiationRetryIntegrityKey[] = {
+ 0xf2, 0xcd, 0x8f, 0xe0, 0x36, 0xd0, 0x25, 0x35,
+ 0x03, 0xe6, 0x7c, 0x7b, 0xd2, 0x44, 0xca, 0xd9};
// Nonces used by Google versions of QUIC. When introducing a new version,
// generate a new nonce by running `openssl rand -hex 12`.
const uint8_t kT050RetryIntegrityNonce[] = {0x26, 0xe4, 0xd6, 0x23, 0x83, 0xd5,
0xc7, 0x60, 0xea, 0x02, 0xb4, 0x1f};
const uint8_t kT051RetryIntegrityNonce[] = {0xb5, 0x0e, 0x4e, 0x53, 0x4c, 0xfc,
0x0b, 0xbb, 0x85, 0xf2, 0xf9, 0xca};
+// Retry integrity nonce used by ParsedQuicVersion::ReservedForNegotiation().
+const uint8_t kReservedForNegotiationRetryIntegrityNonce[] = {
+ 0x35, 0x9f, 0x16, 0xd1, 0xed, 0x80, 0x90, 0x8e, 0xec, 0x85, 0xc4, 0xd6};
bool RetryIntegrityKeysForVersion(const ParsedQuicVersion& version,
- quiche::QuicheStringPiece* key,
- quiche::QuicheStringPiece* nonce) {
+ absl::string_view* key,
+ absl::string_view* nonce) {
static_assert(SupportedVersions().size() == 7u,
"Supported versions out of sync with retry integrity keys");
if (!version.HasRetryIntegrityTag()) {
@@ -209,36 +244,45 @@ bool RetryIntegrityKeysForVersion(const ParsedQuicVersion& version,
<< version;
return false;
} else if (version == ParsedQuicVersion::Draft29()) {
- *key = quiche::QuicheStringPiece(
+ *key = absl::string_view(
reinterpret_cast<const char*>(kDraft29RetryIntegrityKey),
- QUICHE_ARRAYSIZE(kDraft29RetryIntegrityKey));
- *nonce = quiche::QuicheStringPiece(
+ ABSL_ARRAYSIZE(kDraft29RetryIntegrityKey));
+ *nonce = absl::string_view(
reinterpret_cast<const char*>(kDraft29RetryIntegrityNonce),
- QUICHE_ARRAYSIZE(kDraft29RetryIntegrityNonce));
+ ABSL_ARRAYSIZE(kDraft29RetryIntegrityNonce));
return true;
} else if (version == ParsedQuicVersion::Draft27()) {
- *key = quiche::QuicheStringPiece(
+ *key = absl::string_view(
reinterpret_cast<const char*>(kDraft27RetryIntegrityKey),
- QUICHE_ARRAYSIZE(kDraft27RetryIntegrityKey));
- *nonce = quiche::QuicheStringPiece(
+ ABSL_ARRAYSIZE(kDraft27RetryIntegrityKey));
+ *nonce = absl::string_view(
reinterpret_cast<const char*>(kDraft27RetryIntegrityNonce),
- QUICHE_ARRAYSIZE(kDraft27RetryIntegrityNonce));
+ ABSL_ARRAYSIZE(kDraft27RetryIntegrityNonce));
return true;
} else if (version == ParsedQuicVersion::T051()) {
- *key = quiche::QuicheStringPiece(
- reinterpret_cast<const char*>(kT051RetryIntegrityKey),
- QUICHE_ARRAYSIZE(kT051RetryIntegrityKey));
- *nonce = quiche::QuicheStringPiece(
+ *key =
+ absl::string_view(reinterpret_cast<const char*>(kT051RetryIntegrityKey),
+ ABSL_ARRAYSIZE(kT051RetryIntegrityKey));
+ *nonce = absl::string_view(
reinterpret_cast<const char*>(kT051RetryIntegrityNonce),
- QUICHE_ARRAYSIZE(kT051RetryIntegrityNonce));
+ ABSL_ARRAYSIZE(kT051RetryIntegrityNonce));
return true;
} else if (version == ParsedQuicVersion::T050()) {
- *key = quiche::QuicheStringPiece(
- reinterpret_cast<const char*>(kT050RetryIntegrityKey),
- QUICHE_ARRAYSIZE(kT050RetryIntegrityKey));
- *nonce = quiche::QuicheStringPiece(
+ *key =
+ absl::string_view(reinterpret_cast<const char*>(kT050RetryIntegrityKey),
+ ABSL_ARRAYSIZE(kT050RetryIntegrityKey));
+ *nonce = absl::string_view(
reinterpret_cast<const char*>(kT050RetryIntegrityNonce),
- QUICHE_ARRAYSIZE(kT050RetryIntegrityNonce));
+ ABSL_ARRAYSIZE(kT050RetryIntegrityNonce));
+ return true;
+ } else if (version == ParsedQuicVersion::ReservedForNegotiation()) {
+ *key = absl::string_view(
+ reinterpret_cast<const char*>(kReservedForNegotiationRetryIntegrityKey),
+ ABSL_ARRAYSIZE(kReservedForNegotiationRetryIntegrityKey));
+ *nonce = absl::string_view(
+ reinterpret_cast<const char*>(
+ kReservedForNegotiationRetryIntegrityNonce),
+ ABSL_ARRAYSIZE(kReservedForNegotiationRetryIntegrityNonce));
return true;
}
QUIC_BUG << "Attempted to get retry integrity keys for version " << version;
@@ -294,27 +338,27 @@ void CryptoUtils::CreateInitialObfuscators(Perspective perspective,
std::vector<uint8_t> encryption_secret = HkdfExpandLabel(
hash, handshake_secret, encryption_label, EVP_MD_size(hash));
crypters->encrypter = std::make_unique<Aes128GcmEncrypter>();
- SetKeyAndIV(hash, encryption_secret, crypters->encrypter.get());
+ InitializeCrypterSecrets(hash, encryption_secret, crypters->encrypter.get());
std::vector<uint8_t> decryption_secret = HkdfExpandLabel(
hash, handshake_secret, decryption_label, EVP_MD_size(hash));
crypters->decrypter = std::make_unique<Aes128GcmDecrypter>();
- SetKeyAndIV(hash, decryption_secret, crypters->decrypter.get());
+ InitializeCrypterSecrets(hash, decryption_secret, crypters->decrypter.get());
}
// static
bool CryptoUtils::ValidateRetryIntegrityTag(
ParsedQuicVersion version,
QuicConnectionId original_connection_id,
- quiche::QuicheStringPiece retry_without_tag,
- quiche::QuicheStringPiece integrity_tag) {
+ absl::string_view retry_without_tag,
+ absl::string_view integrity_tag) {
unsigned char computed_integrity_tag[kRetryIntegrityTagLength];
- if (integrity_tag.length() != QUICHE_ARRAYSIZE(computed_integrity_tag)) {
+ if (integrity_tag.length() != ABSL_ARRAYSIZE(computed_integrity_tag)) {
QUIC_BUG << "Invalid retry integrity tag length " << integrity_tag.length();
return false;
}
char retry_pseudo_packet[kMaxIncomingPacketSize + 256];
- QuicDataWriter writer(QUICHE_ARRAYSIZE(retry_pseudo_packet),
+ QuicDataWriter writer(ABSL_ARRAYSIZE(retry_pseudo_packet),
retry_pseudo_packet);
if (!writer.WriteLengthPrefixedConnectionId(original_connection_id)) {
QUIC_BUG << "Failed to write original connection ID in retry pseudo packet";
@@ -324,23 +368,23 @@ bool CryptoUtils::ValidateRetryIntegrityTag(
QUIC_BUG << "Failed to write retry without tag in retry pseudo packet";
return false;
}
- quiche::QuicheStringPiece key;
- quiche::QuicheStringPiece nonce;
+ absl::string_view key;
+ absl::string_view nonce;
if (!RetryIntegrityKeysForVersion(version, &key, &nonce)) {
// RetryIntegrityKeysForVersion already logs failures.
return false;
}
Aes128GcmEncrypter crypter;
crypter.SetKey(key);
- quiche::QuicheStringPiece associated_data(writer.data(), writer.length());
- quiche::QuicheStringPiece plaintext; // Plaintext is empty.
+ absl::string_view associated_data(writer.data(), writer.length());
+ absl::string_view plaintext; // Plaintext is empty.
if (!crypter.Encrypt(nonce, associated_data, plaintext,
computed_integrity_tag)) {
QUIC_BUG << "Failed to compute retry integrity tag";
return false;
}
if (CRYPTO_memcmp(computed_integrity_tag, integrity_tag.data(),
- QUICHE_ARRAYSIZE(computed_integrity_tag)) != 0) {
+ ABSL_ARRAYSIZE(computed_integrity_tag)) != 0) {
QUIC_DLOG(ERROR) << "Failed to validate retry integrity tag";
return false;
}
@@ -350,7 +394,7 @@ bool CryptoUtils::ValidateRetryIntegrityTag(
// static
void CryptoUtils::GenerateNonce(QuicWallTime now,
QuicRandom* random_generator,
- quiche::QuicheStringPiece orbit,
+ absl::string_view orbit,
std::string* nonce) {
// a 4-byte timestamp + 28 random bytes.
nonce->reserve(kNonceSize);
@@ -376,11 +420,11 @@ void CryptoUtils::GenerateNonce(QuicWallTime now,
// static
bool CryptoUtils::DeriveKeys(const ParsedQuicVersion& version,
- quiche::QuicheStringPiece premaster_secret,
+ absl::string_view premaster_secret,
QuicTag aead,
- quiche::QuicheStringPiece client_nonce,
- quiche::QuicheStringPiece server_nonce,
- quiche::QuicheStringPiece pre_shared_key,
+ absl::string_view client_nonce,
+ absl::string_view server_nonce,
+ absl::string_view pre_shared_key,
const std::string& hkdf_input,
Perspective perspective,
Diversification diversification,
@@ -389,7 +433,7 @@ bool CryptoUtils::DeriveKeys(const ParsedQuicVersion& version,
// If the connection is using PSK, concatenate it with the pre-master secret.
std::unique_ptr<char[]> psk_premaster_secret;
if (!pre_shared_key.empty()) {
- const quiche::QuicheStringPiece label(kPreSharedKeyLabel);
+ const absl::string_view label(kPreSharedKeyLabel);
const size_t psk_premaster_secret_size = label.size() + 1 +
pre_shared_key.size() + 8 +
premaster_secret.size() + 8;
@@ -407,8 +451,8 @@ bool CryptoUtils::DeriveKeys(const ParsedQuicVersion& version,
return false;
}
- premaster_secret = quiche::QuicheStringPiece(psk_premaster_secret.get(),
- psk_premaster_secret_size);
+ premaster_secret = absl::string_view(psk_premaster_secret.get(),
+ psk_premaster_secret_size);
}
crypters->encrypter = QuicEncrypter::Create(version, aead);
@@ -422,7 +466,7 @@ bool CryptoUtils::DeriveKeys(const ParsedQuicVersion& version,
size_t subkey_secret_bytes =
subkey_secret == nullptr ? 0 : premaster_secret.length();
- quiche::QuicheStringPiece nonce = client_nonce;
+ absl::string_view nonce = client_nonce;
std::string nonce_storage;
if (!server_nonce.empty()) {
nonce_storage = std::string(client_nonce) + std::string(server_nonce);
@@ -519,9 +563,9 @@ bool CryptoUtils::DeriveKeys(const ParsedQuicVersion& version,
}
// static
-bool CryptoUtils::ExportKeyingMaterial(quiche::QuicheStringPiece subkey_secret,
- quiche::QuicheStringPiece label,
- quiche::QuicheStringPiece context,
+bool CryptoUtils::ExportKeyingMaterial(absl::string_view subkey_secret,
+ absl::string_view label,
+ absl::string_view context,
size_t result_len,
std::string* result) {
for (size_t i = 0; i < label.length(); i++) {
@@ -541,14 +585,14 @@ bool CryptoUtils::ExportKeyingMaterial(quiche::QuicheStringPiece subkey_secret,
info.append(reinterpret_cast<char*>(&context_length), sizeof(context_length));
info.append(context.data(), context.length());
- QuicHKDF hkdf(subkey_secret, quiche::QuicheStringPiece() /* no salt */, info,
+ QuicHKDF hkdf(subkey_secret, absl::string_view() /* no salt */, info,
result_len, 0 /* no fixed IV */, 0 /* no subkey secret */);
*result = std::string(hkdf.client_write_key());
return true;
}
// static
-uint64_t CryptoUtils::ComputeLeafCertHash(quiche::QuicheStringPiece cert) {
+uint64_t CryptoUtils::ComputeLeafCertHash(absl::string_view cert) {
return QuicUtils::FNV1a_64_Hash(cert);
}
@@ -691,8 +735,17 @@ const char* CryptoUtils::HandshakeFailureReasonToString(
}
// static
-const char* CryptoUtils::EarlyDataReasonToString(
+std::string CryptoUtils::EarlyDataReasonToString(
ssl_early_data_reason_t reason) {
+#if BORINGSSL_API_VERSION >= 12
+ const char* reason_string = SSL_early_data_reason_string(reason);
+ if (reason_string != nullptr) {
+ return std::string("ssl_early_data_") + reason_string;
+ }
+#else
+ // TODO(davidben): Remove this logic once
+ // https://boringssl-review.googlesource.com/c/boringssl/+/43724 has landed in
+ // downstream repositories.
switch (reason) {
RETURN_STRING_LITERAL(ssl_early_data_unknown);
RETURN_STRING_LITERAL(ssl_early_data_disabled);
@@ -709,6 +762,7 @@ const char* CryptoUtils::EarlyDataReasonToString(
RETURN_STRING_LITERAL(ssl_early_data_ticket_age_skew);
RETURN_STRING_LITERAL(ssl_early_data_quic_parameter_mismatch);
}
+#endif
QUIC_BUG_IF(reason < 0 || reason > ssl_early_data_reason_max_value)
<< "Unknown ssl_early_data_reason_t " << reason;
return "unknown ssl_early_data_reason_t";
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.h b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.h
index 964f81fdf69..9195e3add82 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils.h
@@ -11,6 +11,7 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -74,15 +74,35 @@ class QUIC_EXPORT_PRIVATE CryptoUtils {
DiversificationNonce* nonce_;
};
- // SetKeyAndIV derives the key and IV from the given packet protection secret
- // |pp_secret| and sets those fields on the given QuicCrypter |*crypter|.
+ // InitializeCrypterSecrets derives the key and IV and header protection key
+ // from the given packet protection secret |pp_secret| and sets those fields
+ // on the given QuicCrypter |*crypter|.
// This follows the derivation described in section 7.3 of RFC 8446, except
// with the label prefix in HKDF-Expand-Label changed from "tls13 " to "quic "
// as described in draft-ietf-quic-tls-14, section 5.1.
+ static void InitializeCrypterSecrets(const EVP_MD* prf,
+ const std::vector<uint8_t>& pp_secret,
+ QuicCrypter* crypter);
+
+ // Derives the key and IV from the packet protection secret and sets those
+ // fields on the given QuicCrypter |*crypter|, but does not set the header
+ // protection key. GenerateHeaderProtectionKey/SetHeaderProtectionKey must be
+ // called before using |crypter|.
static void SetKeyAndIV(const EVP_MD* prf,
const std::vector<uint8_t>& pp_secret,
QuicCrypter* crypter);
+ // Derives the header protection key from the packet protection secret.
+ static std::vector<uint8_t> GenerateHeaderProtectionKey(
+ const EVP_MD* prf,
+ const std::vector<uint8_t>& pp_secret,
+ size_t out_len);
+
+ // Given a secret for key phase n, return the secret for phase n+1.
+ static std::vector<uint8_t> GenerateNextKeyPhaseSecret(
+ const EVP_MD* prf,
+ const std::vector<uint8_t>& current_secret);
+
// IETF QUIC encrypts ENCRYPTION_INITIAL messages with a version-specific key
// (to prevent network observers that are not aware of that QUIC version from
// making decisions based on the TLS handshake). This packet protection secret
@@ -101,11 +121,10 @@ class QUIC_EXPORT_PRIVATE CryptoUtils {
// IETF QUIC Retry packets carry a retry integrity tag to detect packet
// corruption and make it harder for an attacker to spoof. This function
// checks whether a given retry packet is valid.
- static bool ValidateRetryIntegrityTag(
- ParsedQuicVersion version,
- QuicConnectionId original_connection_id,
- quiche::QuicheStringPiece retry_without_tag,
- quiche::QuicheStringPiece integrity_tag);
+ static bool ValidateRetryIntegrityTag(ParsedQuicVersion version,
+ QuicConnectionId original_connection_id,
+ absl::string_view retry_without_tag,
+ absl::string_view integrity_tag);
// Generates the connection nonce. The nonce is formed as:
// <4 bytes> current time
@@ -113,7 +132,7 @@ class QUIC_EXPORT_PRIVATE CryptoUtils {
// <20 bytes> random
static void GenerateNonce(QuicWallTime now,
QuicRandom* random_generator,
- quiche::QuicheStringPiece orbit,
+ absl::string_view orbit,
std::string* nonce);
// DeriveKeys populates |crypters->encrypter|, |crypters->decrypter|, and
@@ -136,11 +155,11 @@ class QUIC_EXPORT_PRIVATE CryptoUtils {
// |SetDiversificationNonce| with a diversification nonce will be needed to
// complete keying.
static bool DeriveKeys(const ParsedQuicVersion& version,
- quiche::QuicheStringPiece premaster_secret,
+ absl::string_view premaster_secret,
QuicTag aead,
- quiche::QuicheStringPiece client_nonce,
- quiche::QuicheStringPiece server_nonce,
- quiche::QuicheStringPiece pre_shared_key,
+ absl::string_view client_nonce,
+ absl::string_view server_nonce,
+ absl::string_view pre_shared_key,
const std::string& hkdf_input,
Perspective perspective,
Diversification diversification,
@@ -151,15 +170,15 @@ class QUIC_EXPORT_PRIVATE CryptoUtils {
// dependent on |subkey_secret|, |label|, and |context|. Returns false if the
// parameters are invalid (e.g. |label| contains null bytes); returns true on
// success.
- static bool ExportKeyingMaterial(quiche::QuicheStringPiece subkey_secret,
- quiche::QuicheStringPiece label,
- quiche::QuicheStringPiece context,
+ static bool ExportKeyingMaterial(absl::string_view subkey_secret,
+ absl::string_view label,
+ absl::string_view context,
size_t result_len,
std::string* result);
// Computes the FNV-1a hash of the provided DER-encoded cert for use in the
// XLCT tag.
- static uint64_t ComputeLeafCertHash(quiche::QuicheStringPiece cert);
+ static uint64_t ComputeLeafCertHash(absl::string_view cert);
// Validates that |server_hello| is actually an SHLO message and that it is
// not part of a downgrade attack.
@@ -213,7 +232,7 @@ class QUIC_EXPORT_PRIVATE CryptoUtils {
HandshakeFailureReason reason);
// Returns the name of an ssl_early_data_reason_t as a char*
- static const char* EarlyDataReasonToString(ssl_early_data_reason_t reason);
+ static std::string EarlyDataReasonToString(ssl_early_data_reason_t reason);
// Returns a hash of the serialized |message|.
static std::string HashHandshakeMessage(const CryptoHandshakeMessage& message,
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils_test.cc
index edf80515a75..e0d1165ff5f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/crypto_utils_test.cc
@@ -6,10 +6,11 @@
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -50,19 +51,17 @@ TEST_F(CryptoUtilsTest, TestExportKeyingMaterial) {
"c9a46ed0757bd1812f1f21b4d41e62125fec8364a21db7"},
};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_vector); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_vector); i++) {
// Decode the test vector.
std::string subkey_secret =
- quiche::QuicheTextUtils::HexDecode(test_vector[i].subkey_secret);
- std::string label =
- quiche::QuicheTextUtils::HexDecode(test_vector[i].label);
- std::string context =
- quiche::QuicheTextUtils::HexDecode(test_vector[i].context);
+ absl::HexStringToBytes(test_vector[i].subkey_secret);
+ std::string label = absl::HexStringToBytes(test_vector[i].label);
+ std::string context = absl::HexStringToBytes(test_vector[i].context);
size_t result_len = test_vector[i].result_len;
bool expect_ok = test_vector[i].expected != nullptr;
std::string expected;
if (expect_ok) {
- expected = quiche::QuicheTextUtils::HexDecode(test_vector[i].expected);
+ expected = absl::HexStringToBytes(test_vector[i].expected);
}
std::string result;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.cc
index 2f19e9d486c..acdf9a8394b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.cc
@@ -8,11 +8,11 @@
#include <cstring>
#include <string>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/curve25519.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -31,7 +31,7 @@ std::unique_ptr<Curve25519KeyExchange> Curve25519KeyExchange::New(
// static
std::unique_ptr<Curve25519KeyExchange> Curve25519KeyExchange::New(
- quiche::QuicheStringPiece private_key) {
+ absl::string_view private_key) {
// We don't want to #include the BoringSSL headers in the public header file,
// so we use literals for the sizes of private_key_ and public_key_. Here we
// assert that those values are equal to the values from the BoringSSL
@@ -61,7 +61,7 @@ std::string Curve25519KeyExchange::NewPrivateKey(QuicRandom* rand) {
}
bool Curve25519KeyExchange::CalculateSharedKeySync(
- quiche::QuicheStringPiece peer_public_value,
+ absl::string_view peer_public_value,
std::string* shared_key) const {
if (peer_public_value.size() != X25519_PUBLIC_VALUE_LEN) {
return false;
@@ -77,9 +77,9 @@ bool Curve25519KeyExchange::CalculateSharedKeySync(
return true;
}
-quiche::QuicheStringPiece Curve25519KeyExchange::public_value() const {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(public_key_),
- sizeof(public_key_));
+absl::string_view Curve25519KeyExchange::public_value() const {
+ return absl::string_view(reinterpret_cast<const char*>(public_key_),
+ sizeof(public_key_));
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.h b/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.h
index 76fd23ff242..e6703ec2056 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.h
@@ -8,9 +8,9 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/key_exchange.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -29,16 +29,16 @@ class QUIC_EXPORT_PRIVATE Curve25519KeyExchange
// New creates a new key-exchange object from a private key. If |private_key|
// is invalid, nullptr is returned.
static std::unique_ptr<Curve25519KeyExchange> New(
- quiche::QuicheStringPiece private_key);
+ absl::string_view private_key);
// NewPrivateKey returns a private key, generated from |rand|, suitable for
// passing to |New|.
static std::string NewPrivateKey(QuicRandom* rand);
// SynchronousKeyExchange interface.
- bool CalculateSharedKeySync(quiche::QuicheStringPiece peer_public_value,
+ bool CalculateSharedKeySync(absl::string_view peer_public_value,
std::string* shared_key) const override;
- quiche::QuicheStringPiece public_value() const override;
+ absl::string_view public_value() const override;
QuicTag type() const override { return kC255; }
private:
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange_test.cc
index 2e5dfb4edc1..f100df58ae4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange_test.cc
@@ -8,9 +8,9 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -55,8 +55,8 @@ TEST_F(Curve25519KeyExchangeTest, SharedKey) {
std::unique_ptr<Curve25519KeyExchange> bob(
Curve25519KeyExchange::New(bob_key));
- const quiche::QuicheStringPiece alice_public(alice->public_value());
- const quiche::QuicheStringPiece bob_public(bob->public_value());
+ const absl::string_view alice_public(alice->public_value());
+ const absl::string_view bob_public(bob->public_value());
std::string alice_shared, bob_shared;
ASSERT_TRUE(alice->CalculateSharedKeySync(bob_public, &alice_shared));
@@ -79,8 +79,8 @@ TEST_F(Curve25519KeyExchangeTest, SharedKeyAsync) {
std::unique_ptr<Curve25519KeyExchange> bob(
Curve25519KeyExchange::New(bob_key));
- const quiche::QuicheStringPiece alice_public(alice->public_value());
- const quiche::QuicheStringPiece bob_public(bob->public_value());
+ const absl::string_view alice_public(alice->public_value());
+ const absl::string_view bob_public(bob->public_value());
std::string alice_shared, bob_shared;
TestCallbackResult alice_result;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.cc
index 84f9c86802c..d7c01052f9c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.cc
@@ -3,16 +3,16 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/crypto/key_exchange.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/curve25519_key_exchange.h"
#include "net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
std::unique_ptr<SynchronousKeyExchange> CreateLocalSynchronousKeyExchange(
QuicTag type,
- quiche::QuicheStringPiece private_key) {
+ absl::string_view private_key) {
switch (type) {
case kC255:
return Curve25519KeyExchange::New(private_key);
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.h b/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.h
index cb6fdbc8705..e4288d75ffb 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/key_exchange.h
@@ -8,9 +8,9 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -48,7 +48,7 @@ class QUIC_EXPORT_PRIVATE AsynchronousKeyExchange {
// that |callback| might be invoked synchronously. Results will be written
// into |*shared_key|.
virtual void CalculateSharedKeyAsync(
- quiche::QuicheStringPiece peer_public_value,
+ absl::string_view peer_public_value,
std::string* shared_key,
std::unique_ptr<Callback> callback) const = 0;
@@ -66,7 +66,7 @@ class QUIC_EXPORT_PRIVATE SynchronousKeyExchange
// AyncKeyExchange API. Note that this method is marked 'final.' Subclasses
// should implement CalculateSharedKeySync only.
- void CalculateSharedKeyAsync(quiche::QuicheStringPiece peer_public_value,
+ void CalculateSharedKeyAsync(absl::string_view peer_public_value,
std::string* shared_key,
std::unique_ptr<Callback> callback) const final {
const bool ok = CalculateSharedKeySync(peer_public_value, shared_key);
@@ -75,15 +75,14 @@ class QUIC_EXPORT_PRIVATE SynchronousKeyExchange
// CalculateSharedKey computes the shared key between a local private key and
// a public value from the peer. Results will be written into |*shared_key|.
- virtual bool CalculateSharedKeySync(
- quiche::QuicheStringPiece peer_public_value,
- std::string* shared_key) const = 0;
+ virtual bool CalculateSharedKeySync(absl::string_view peer_public_value,
+ std::string* shared_key) const = 0;
// public_value returns the local public key which can be sent to a peer in
- // order to complete a key exchange. The returned quiche::QuicheStringPiece is
+ // order to complete a key exchange. The returned absl::string_view is
// a reference to a member of this object and is only valid for as long as it
// exists.
- virtual quiche::QuicheStringPiece public_value() const = 0;
+ virtual absl::string_view public_value() const = 0;
};
// Create a SynchronousKeyExchange object which will use a keypair generated
@@ -92,7 +91,7 @@ class QUIC_EXPORT_PRIVATE SynchronousKeyExchange
// invalid.
std::unique_ptr<SynchronousKeyExchange> CreateLocalSynchronousKeyExchange(
QuicTag type,
- quiche::QuicheStringPiece private_key);
+ absl::string_view private_key);
// Create a SynchronousKeyExchange object which will use a keypair generated
// from |rand|, and a key-exchange algorithm specified by |type|, which must be
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.cc
index d453a359ea6..2fc1acee1fc 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.cc
@@ -6,35 +6,35 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
NullDecrypter::NullDecrypter(Perspective perspective)
: perspective_(perspective) {}
-bool NullDecrypter::SetKey(quiche::QuicheStringPiece key) {
+bool NullDecrypter::SetKey(absl::string_view key) {
return key.empty();
}
-bool NullDecrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
+bool NullDecrypter::SetNoncePrefix(absl::string_view nonce_prefix) {
return nonce_prefix.empty();
}
-bool NullDecrypter::SetIV(quiche::QuicheStringPiece iv) {
+bool NullDecrypter::SetIV(absl::string_view iv) {
return iv.empty();
}
-bool NullDecrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
+bool NullDecrypter::SetHeaderProtectionKey(absl::string_view key) {
return key.empty();
}
-bool NullDecrypter::SetPreliminaryKey(quiche::QuicheStringPiece /*key*/) {
+bool NullDecrypter::SetPreliminaryKey(absl::string_view /*key*/) {
QUIC_BUG << "Should not be called";
return false;
}
@@ -46,8 +46,8 @@ bool NullDecrypter::SetDiversificationNonce(
}
bool NullDecrypter::DecryptPacket(uint64_t /*packet_number*/,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) {
@@ -59,7 +59,7 @@ bool NullDecrypter::DecryptPacket(uint64_t /*packet_number*/,
return false;
}
- quiche::QuicheStringPiece plaintext = reader.ReadRemainingPayload();
+ absl::string_view plaintext = reader.ReadRemainingPayload();
if (plaintext.length() > max_output_length) {
QUIC_BUG << "Output buffer must be larger than the plaintext.";
return false;
@@ -90,18 +90,22 @@ size_t NullDecrypter::GetIVSize() const {
return 0;
}
-quiche::QuicheStringPiece NullDecrypter::GetKey() const {
- return quiche::QuicheStringPiece();
+absl::string_view NullDecrypter::GetKey() const {
+ return absl::string_view();
}
-quiche::QuicheStringPiece NullDecrypter::GetNoncePrefix() const {
- return quiche::QuicheStringPiece();
+absl::string_view NullDecrypter::GetNoncePrefix() const {
+ return absl::string_view();
}
uint32_t NullDecrypter::cipher_id() const {
return 0;
}
+QuicPacketCount NullDecrypter::GetIntegrityLimit() const {
+ return std::numeric_limits<QuicPacketCount>::max();
+}
+
bool NullDecrypter::ReadHash(QuicDataReader* reader, QuicUint128* hash) {
uint64_t lo;
uint32_t hi;
@@ -112,9 +116,8 @@ bool NullDecrypter::ReadHash(QuicDataReader* reader, QuicUint128* hash) {
return true;
}
-QuicUint128 NullDecrypter::ComputeHash(
- const quiche::QuicheStringPiece data1,
- const quiche::QuicheStringPiece data2) const {
+QuicUint128 NullDecrypter::ComputeHash(const absl::string_view data1,
+ const absl::string_view data2) const {
QuicUint128 correct_hash;
if (perspective_ == Perspective::IS_CLIENT) {
// Peer is a server.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.h
index c3bd203f5d5..3c856f44397 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter.h
@@ -8,11 +8,11 @@
#include <cstddef>
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -29,15 +29,15 @@ class QUIC_EXPORT_PRIVATE NullDecrypter : public QuicDecrypter {
~NullDecrypter() override {}
// QuicDecrypter implementation
- bool SetKey(quiche::QuicheStringPiece key) override;
- bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
- bool SetIV(quiche::QuicheStringPiece iv) override;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
- bool SetPreliminaryKey(quiche::QuicheStringPiece key) override;
+ bool SetKey(absl::string_view key) override;
+ bool SetNoncePrefix(absl::string_view nonce_prefix) override;
+ bool SetIV(absl::string_view iv) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
+ bool SetPreliminaryKey(absl::string_view key) override;
bool SetDiversificationNonce(const DiversificationNonce& nonce) override;
bool DecryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) override;
@@ -46,15 +46,16 @@ class QUIC_EXPORT_PRIVATE NullDecrypter : public QuicDecrypter {
size_t GetKeySize() const override;
size_t GetNoncePrefixSize() const override;
size_t GetIVSize() const override;
- quiche::QuicheStringPiece GetKey() const override;
- quiche::QuicheStringPiece GetNoncePrefix() const override;
+ absl::string_view GetKey() const override;
+ absl::string_view GetNoncePrefix() const override;
uint32_t cipher_id() const override;
+ QuicPacketCount GetIntegrityLimit() const override;
private:
bool ReadHash(QuicDataReader* reader, QuicUint128* hash);
- QuicUint128 ComputeHash(quiche::QuicheStringPiece data1,
- quiche::QuicheStringPiece data2) const;
+ QuicUint128 ComputeHash(absl::string_view data1,
+ absl::string_view data2) const;
Perspective perspective_;
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter_test.cc
index 1baecad227e..b8b7268e3ea 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/null_decrypter_test.cc
@@ -3,9 +3,9 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -38,15 +38,14 @@ TEST_F(NullDecrypterTest, DecryptClient) {
'!',
};
const char* data = reinterpret_cast<const char*>(expected);
- size_t len = QUICHE_ARRAYSIZE(expected);
+ size_t len = ABSL_ARRAYSIZE(expected);
NullDecrypter decrypter(Perspective::IS_SERVER);
char buffer[256];
size_t length = 0;
- ASSERT_TRUE(decrypter.DecryptPacket(0, "hello world!",
- quiche::QuicheStringPiece(data, len),
- buffer, &length, 256));
+ ASSERT_TRUE(decrypter.DecryptPacket(
+ 0, "hello world!", absl::string_view(data, len), buffer, &length, 256));
EXPECT_LT(0u, length);
- EXPECT_EQ("goodbye!", quiche::QuicheStringPiece(buffer, length));
+ EXPECT_EQ("goodbye!", absl::string_view(buffer, length));
}
TEST_F(NullDecrypterTest, DecryptServer) {
@@ -75,15 +74,14 @@ TEST_F(NullDecrypterTest, DecryptServer) {
'!',
};
const char* data = reinterpret_cast<const char*>(expected);
- size_t len = QUICHE_ARRAYSIZE(expected);
+ size_t len = ABSL_ARRAYSIZE(expected);
NullDecrypter decrypter(Perspective::IS_CLIENT);
char buffer[256];
size_t length = 0;
- ASSERT_TRUE(decrypter.DecryptPacket(0, "hello world!",
- quiche::QuicheStringPiece(data, len),
- buffer, &length, 256));
+ ASSERT_TRUE(decrypter.DecryptPacket(
+ 0, "hello world!", absl::string_view(data, len), buffer, &length, 256));
EXPECT_LT(0u, length);
- EXPECT_EQ("goodbye!", quiche::QuicheStringPiece(buffer, length));
+ EXPECT_EQ("goodbye!", absl::string_view(buffer, length));
}
TEST_F(NullDecrypterTest, BadHash) {
@@ -112,13 +110,12 @@ TEST_F(NullDecrypterTest, BadHash) {
'!',
};
const char* data = reinterpret_cast<const char*>(expected);
- size_t len = QUICHE_ARRAYSIZE(expected);
+ size_t len = ABSL_ARRAYSIZE(expected);
NullDecrypter decrypter(Perspective::IS_CLIENT);
char buffer[256];
size_t length = 0;
- ASSERT_FALSE(decrypter.DecryptPacket(0, "hello world!",
- quiche::QuicheStringPiece(data, len),
- buffer, &length, 256));
+ ASSERT_FALSE(decrypter.DecryptPacket(
+ 0, "hello world!", absl::string_view(data, len), buffer, &length, 256));
}
TEST_F(NullDecrypterTest, ShortInput) {
@@ -127,13 +124,12 @@ TEST_F(NullDecrypterTest, ShortInput) {
0x46, 0x11, 0xea, 0x5f, 0xcf, 0x1d, 0x66, 0x5b, 0xba, 0xf0, 0xbc,
};
const char* data = reinterpret_cast<const char*>(expected);
- size_t len = QUICHE_ARRAYSIZE(expected);
+ size_t len = ABSL_ARRAYSIZE(expected);
NullDecrypter decrypter(Perspective::IS_CLIENT);
char buffer[256];
size_t length = 0;
- ASSERT_FALSE(decrypter.DecryptPacket(0, "hello world!",
- quiche::QuicheStringPiece(data, len),
- buffer, &length, 256));
+ ASSERT_FALSE(decrypter.DecryptPacket(
+ 0, "hello world!", absl::string_view(data, len), buffer, &length, 256));
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.cc
index 4de151023af..f379ff23b69 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -15,25 +15,25 @@ const size_t kHashSizeShort = 12; // size of uint128 serialized short
NullEncrypter::NullEncrypter(Perspective perspective)
: perspective_(perspective) {}
-bool NullEncrypter::SetKey(quiche::QuicheStringPiece key) {
+bool NullEncrypter::SetKey(absl::string_view key) {
return key.empty();
}
-bool NullEncrypter::SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) {
+bool NullEncrypter::SetNoncePrefix(absl::string_view nonce_prefix) {
return nonce_prefix.empty();
}
-bool NullEncrypter::SetIV(quiche::QuicheStringPiece iv) {
+bool NullEncrypter::SetIV(absl::string_view iv) {
return iv.empty();
}
-bool NullEncrypter::SetHeaderProtectionKey(quiche::QuicheStringPiece key) {
+bool NullEncrypter::SetHeaderProtectionKey(absl::string_view key) {
return key.empty();
}
bool NullEncrypter::EncryptPacket(uint64_t /*packet_number*/,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) {
@@ -59,7 +59,7 @@ bool NullEncrypter::EncryptPacket(uint64_t /*packet_number*/,
}
std::string NullEncrypter::GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece /*sample*/) {
+ absl::string_view /*sample*/) {
return std::string(5, 0);
}
@@ -83,12 +83,16 @@ size_t NullEncrypter::GetCiphertextSize(size_t plaintext_size) const {
return plaintext_size + GetHashLength();
}
-quiche::QuicheStringPiece NullEncrypter::GetKey() const {
- return quiche::QuicheStringPiece();
+QuicPacketCount NullEncrypter::GetConfidentialityLimit() const {
+ return std::numeric_limits<QuicPacketCount>::max();
}
-quiche::QuicheStringPiece NullEncrypter::GetNoncePrefix() const {
- return quiche::QuicheStringPiece();
+absl::string_view NullEncrypter::GetKey() const {
+ return absl::string_view();
+}
+
+absl::string_view NullEncrypter::GetNoncePrefix() const {
+ return absl::string_view();
}
size_t NullEncrypter::GetHashLength() const {
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.h
index bda73dc0ad8..82cb2c12f6e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter.h
@@ -7,10 +7,10 @@
#include <cstddef>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -25,25 +25,25 @@ class QUIC_EXPORT_PRIVATE NullEncrypter : public QuicEncrypter {
~NullEncrypter() override {}
// QuicEncrypter implementation
- bool SetKey(quiche::QuicheStringPiece key) override;
- bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) override;
- bool SetIV(quiche::QuicheStringPiece iv) override;
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
+ bool SetKey(absl::string_view key) override;
+ bool SetNoncePrefix(absl::string_view nonce_prefix) override;
+ bool SetIV(absl::string_view iv) override;
+ bool SetHeaderProtectionKey(absl::string_view key) override;
bool EncryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) override;
- std::string GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) override;
+ std::string GenerateHeaderProtectionMask(absl::string_view sample) override;
size_t GetKeySize() const override;
size_t GetNoncePrefixSize() const override;
size_t GetIVSize() const override;
size_t GetMaxPlaintextSize(size_t ciphertext_size) const override;
size_t GetCiphertextSize(size_t plaintext_size) const override;
- quiche::QuicheStringPiece GetKey() const override;
- quiche::QuicheStringPiece GetNoncePrefix() const override;
+ QuicPacketCount GetConfidentialityLimit() const override;
+ absl::string_view GetKey() const override;
+ absl::string_view GetNoncePrefix() const override;
private:
size_t GetHashLength() const;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter_test.cc
index c9b00d4c171..1bc5932ec4f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/null_encrypter_test.cc
@@ -3,9 +3,9 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
namespace quic {
@@ -45,7 +45,7 @@ TEST_F(NullEncrypterTest, EncryptClient) {
&encrypted_len, 256));
quiche::test::CompareCharArraysWithHexError(
"encrypted data", encrypted, encrypted_len,
- reinterpret_cast<const char*>(expected), QUICHE_ARRAYSIZE(expected));
+ reinterpret_cast<const char*>(expected), ABSL_ARRAYSIZE(expected));
}
TEST_F(NullEncrypterTest, EncryptServer) {
@@ -80,7 +80,7 @@ TEST_F(NullEncrypterTest, EncryptServer) {
&encrypted_len, 256));
quiche::test::CompareCharArraysWithHexError(
"encrypted data", encrypted, encrypted_len,
- reinterpret_cast<const char*>(expected), QUICHE_ARRAYSIZE(expected));
+ reinterpret_cast<const char*>(expected), ABSL_ARRAYSIZE(expected));
}
TEST_F(NullEncrypterTest, GetMaxPlaintextSize) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.cc
index 01f345de824..7a543b90e24 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.cc
@@ -10,13 +10,13 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ecdh.h"
#include "third_party/boringssl/src/include/openssl/err.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -34,8 +34,7 @@ std::unique_ptr<P256KeyExchange> P256KeyExchange::New() {
}
// static
-std::unique_ptr<P256KeyExchange> P256KeyExchange::New(
- quiche::QuicheStringPiece key) {
+std::unique_ptr<P256KeyExchange> P256KeyExchange::New(absl::string_view key) {
if (key.empty()) {
QUIC_DLOG(INFO) << "Private key is empty";
return nullptr;
@@ -85,7 +84,7 @@ std::string P256KeyExchange::NewPrivateKey() {
}
bool P256KeyExchange::CalculateSharedKeySync(
- quiche::QuicheStringPiece peer_public_value,
+ absl::string_view peer_public_value,
std::string* shared_key) const {
if (peer_public_value.size() != kUncompressedP256PointBytes) {
QUIC_DLOG(INFO) << "Peer public value is invalid";
@@ -115,9 +114,9 @@ bool P256KeyExchange::CalculateSharedKeySync(
return true;
}
-quiche::QuicheStringPiece P256KeyExchange::public_value() const {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(public_key_),
- sizeof(public_key_));
+absl::string_view P256KeyExchange::public_value() const {
+ return absl::string_view(reinterpret_cast<const char*>(public_key_),
+ sizeof(public_key_));
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.h b/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.h
index 10cc542597e..2b6f9b87b47 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange.h
@@ -8,10 +8,10 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "net/third_party/quiche/src/quic/core/crypto/key_exchange.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -26,8 +26,7 @@ class QUIC_EXPORT_PRIVATE P256KeyExchange : public SynchronousKeyExchange {
// New creates a new key-exchange object from a private key. If |private_key|
// is invalid, nullptr is returned.
- static std::unique_ptr<P256KeyExchange> New(
- quiche::QuicheStringPiece private_key);
+ static std::unique_ptr<P256KeyExchange> New(absl::string_view private_key);
// NewPrivateKey returns a private key, suitable for passing to |New|.
// If |NewPrivateKey| can't generate a private key, it returns an empty
@@ -35,9 +34,9 @@ class QUIC_EXPORT_PRIVATE P256KeyExchange : public SynchronousKeyExchange {
static std::string NewPrivateKey();
// SynchronousKeyExchange interface.
- bool CalculateSharedKeySync(quiche::QuicheStringPiece peer_public_value,
+ bool CalculateSharedKeySync(absl::string_view peer_public_value,
std::string* shared_key) const override;
- quiche::QuicheStringPiece public_value() const override;
+ absl::string_view public_value() const override;
QuicTag type() const override { return kP256; }
private:
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange_test.cc
index 7e7dcd77a60..9419dcb5783 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/p256_key_exchange_test.cc
@@ -8,8 +8,8 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -57,8 +57,8 @@ TEST_F(P256KeyExchangeTest, SharedKey) {
ASSERT_TRUE(alice != nullptr);
ASSERT_TRUE(bob != nullptr);
- const quiche::QuicheStringPiece alice_public(alice->public_value());
- const quiche::QuicheStringPiece bob_public(bob->public_value());
+ const absl::string_view alice_public(alice->public_value());
+ const absl::string_view bob_public(bob->public_value());
std::string alice_shared, bob_shared;
ASSERT_TRUE(alice->CalculateSharedKeySync(bob_public, &alice_shared));
@@ -84,8 +84,8 @@ TEST_F(P256KeyExchangeTest, AsyncSharedKey) {
ASSERT_TRUE(alice != nullptr);
ASSERT_TRUE(bob != nullptr);
- const quiche::QuicheStringPiece alice_public(alice->public_value());
- const quiche::QuicheStringPiece bob_public(bob->public_value());
+ const absl::string_view alice_public(alice->public_value());
+ const absl::string_view bob_public(bob->public_value());
std::string alice_shared, bob_shared;
TestCallbackResult alice_result;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source.h b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source.h
index 637dd0c33c5..e9358d50b85 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source.h
@@ -9,13 +9,13 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_proof.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_reference_counted.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -137,7 +137,7 @@ class QUIC_EXPORT_PRIVATE ProofSource {
const std::string& hostname,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<Callback> callback) = 0;
// Returns the certificate chain for |hostname| in leaf-first order.
@@ -159,7 +159,7 @@ class QUIC_EXPORT_PRIVATE ProofSource {
const QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<SignatureCallback> callback) = 0;
class QUIC_EXPORT_PRIVATE DecryptCallback {
@@ -193,13 +193,13 @@ class QUIC_EXPORT_PRIVATE ProofSource {
// returns the encrypted ticket. The resulting value must not be larger than
// MaxOverhead bytes larger than |in|. If encryption fails, this method
// returns an empty vector.
- virtual std::vector<uint8_t> Encrypt(quiche::QuicheStringPiece in) = 0;
+ virtual std::vector<uint8_t> Encrypt(absl::string_view in) = 0;
// Decrypt takes an encrypted ticket |in|, decrypts it, and calls
// |callback->Run| with the decrypted ticket, which must not be larger than
// |in|. If decryption fails, the callback is invoked with an empty
// vector.
- virtual void Decrypt(quiche::QuicheStringPiece in,
+ virtual void Decrypt(absl::string_view in,
std::unique_ptr<DecryptCallback> callback) = 0;
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.cc
index e432682bddd..530f9d52ae1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.cc
@@ -6,14 +6,14 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/certificate_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -34,7 +34,7 @@ void ProofSourceX509::GetProof(
const std::string& hostname,
const std::string& server_config,
QuicTransportVersion /*transport_version*/,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<ProofSource::Callback> callback) {
QuicCryptoProof proof;
@@ -54,9 +54,9 @@ void ProofSourceX509::GetProof(
}
Certificate* certificate = GetCertificate(hostname);
- proof.signature = certificate->key.Sign(
- quiche::QuicheStringPiece(payload.get(), payload_size),
- SSL_SIGN_RSA_PSS_RSAE_SHA256);
+ proof.signature =
+ certificate->key.Sign(absl::string_view(payload.get(), payload_size),
+ SSL_SIGN_RSA_PSS_RSAE_SHA256);
callback->Run(/*ok=*/!proof.signature.empty(), certificate->chain, proof,
nullptr);
}
@@ -73,7 +73,7 @@ void ProofSourceX509::ComputeTlsSignature(
const QuicSocketAddress& /*client_address*/,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<ProofSource::SignatureCallback> callback) {
std::string signature =
GetCertificate(hostname)->key.Sign(in, signature_algorithm);
@@ -109,7 +109,7 @@ bool ProofSourceX509::AddCertificateChain(
});
Certificate* certificate = &certificates_.front();
- for (quiche::QuicheStringPiece host : leaf->subject_alt_name_domains()) {
+ for (absl::string_view host : leaf->subject_alt_name_domains()) {
certificate_map_[std::string(host)] = certificate;
}
return true;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.h b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.h
index 8632d4bfe95..bc6baaad77b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509.h
@@ -8,11 +8,11 @@
#include <forward_list>
#include <memory>
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/certificate_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -32,7 +32,7 @@ class QUIC_EXPORT_PRIVATE ProofSourceX509 : public ProofSource {
const std::string& hostname,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<Callback> callback) override;
QuicReferenceCountedPointer<Chain> GetCertChain(
const QuicSocketAddress& server_address,
@@ -43,14 +43,14 @@ class QUIC_EXPORT_PRIVATE ProofSourceX509 : public ProofSource {
const QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<SignatureCallback> callback) override;
TicketCrypter* GetTicketCrypter() override;
// Adds a certificate chain to the verifier. Returns false if the chain is
// not valid. Newer certificates will override older certificates with the
// same SubjectAltName value.
- QUIC_MUST_USE_RESULT bool AddCertificateChain(
+ ABSL_MUST_USE_RESULT bool AddCertificateChain(
QuicReferenceCountedPointer<Chain> chain,
CertificatePrivateKey key);
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509_test.cc
index 23311d08232..e0b45c6bd5d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_source_x509_test.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/certificate_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h"
@@ -15,14 +16,13 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/test_certificates.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
namespace {
QuicReferenceCountedPointer<ProofSource::Chain> MakeChain(
- quiche::QuicheStringPiece cert) {
+ absl::string_view cert) {
return QuicReferenceCountedPointer<ProofSource::Chain>(
new ProofSource::Chain(std::vector<std::string>{std::string(cert)}));
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_verifier.h b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_verifier.h
index 0380b8a87d8..ab09811c1c8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/proof_verifier.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/proof_verifier.h
@@ -9,10 +9,10 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -79,7 +79,7 @@ class QUIC_EXPORT_PRIVATE ProofVerifier {
const uint16_t port,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -97,6 +97,11 @@ class QUIC_EXPORT_PRIVATE ProofVerifier {
// for some implementations) that provides useful information for the
// verifier, e.g. logging handles.
//
+ // If certificate verification fails, a TLS alert will be sent when closing
+ // the connection. This alert defaults to certificate_unknown. By setting
+ // |*out_alert|, a different alert can be sent to provide a more specific
+ // reason why verification failed.
+ //
// This function may also return QUIC_PENDING, in which case the ProofVerifier
// will call back, on the original thread, via |callback| when complete.
// In this case, the ProofVerifier will take ownership of |callback|.
@@ -109,6 +114,7 @@ class QUIC_EXPORT_PRIVATE ProofVerifier {
const ProofVerifyContext* context,
std::string* error_details,
std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
std::unique_ptr<ProofVerifierCallback> callback) = 0;
// Returns a ProofVerifyContext instance which can be use for subsequent
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.cc
index d8e7f2d1c92..036f694699b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.cc
@@ -3,13 +3,12 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypter.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
namespace quic {
-bool QuicCrypter::SetNoncePrefixOrIV(
- const ParsedQuicVersion& version,
- quiche::QuicheStringPiece nonce_prefix_or_iv) {
+bool QuicCrypter::SetNoncePrefixOrIV(const ParsedQuicVersion& version,
+ absl::string_view nonce_prefix_or_iv) {
if (version.UsesInitialObfuscators()) {
return SetIV(nonce_prefix_or_iv);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.h
index a12cd6f9eb2..348a3fbe56e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypter.h
@@ -5,9 +5,9 @@
#ifndef QUICHE_QUIC_CORE_CRYPTO_QUIC_CRYPTER_H_
#define QUICHE_QUIC_CORE_CRYPTO_QUIC_CRYPTER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -24,7 +24,7 @@ class QUIC_EXPORT_PRIVATE QuicCrypter {
//
// NOTE: The key is the client_write_key or server_write_key derived from
// the master secret.
- virtual bool SetKey(quiche::QuicheStringPiece key) = 0;
+ virtual bool SetKey(absl::string_view key) = 0;
// Sets the fixed initial bytes of the nonce. Returns true on success,
// false on failure. This method must only be used with Google QUIC crypters.
@@ -41,7 +41,7 @@ class QUIC_EXPORT_PRIVATE QuicCrypter {
//
// The security of the nonce format requires that QUIC never reuse a
// packet number, even when retransmitting a lost packet.
- virtual bool SetNoncePrefix(quiche::QuicheStringPiece nonce_prefix) = 0;
+ virtual bool SetNoncePrefix(absl::string_view nonce_prefix) = 0;
// Sets |iv| as the initialization vector to use when constructing the nonce.
// Returns true on success, false on failure. This method must only be used
@@ -68,15 +68,15 @@ class QUIC_EXPORT_PRIVATE QuicCrypter {
//
// The security of the nonce format requires that QUIC never reuse a
// packet number, even when retransmitting a lost packet.
- virtual bool SetIV(quiche::QuicheStringPiece iv) = 0;
+ virtual bool SetIV(absl::string_view iv) = 0;
// Calls SetNoncePrefix or SetIV depending on whether |version| uses the
// Google QUIC crypto or IETF QUIC nonce construction.
virtual bool SetNoncePrefixOrIV(const ParsedQuicVersion& version,
- quiche::QuicheStringPiece nonce_prefix_or_iv);
+ absl::string_view nonce_prefix_or_iv);
// Sets the key to use for header protection.
- virtual bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) = 0;
+ virtual bool SetHeaderProtectionKey(absl::string_view key) = 0;
// GetKeySize, GetIVSize, and GetNoncePrefixSize are used to know how many
// bytes of key material needs to be derived from the master secret.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.cc
index c110f8ec1c3..102678105dd 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.cc
@@ -8,6 +8,9 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/match.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/cert_compressor.h"
#include "net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h"
@@ -31,8 +34,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -68,7 +69,7 @@ QuicCryptoClientConfig::QuicCryptoClientConfig(
: proof_verifier_(std::move(proof_verifier)),
session_cache_(std::move(session_cache)),
ssl_ctx_(TlsClientConnection::CreateSslCtx(
- GetQuicRestartFlag(quic_enable_zero_rtt_for_tls_v2))) {
+ !GetQuicFlag(FLAGS_quic_disable_client_tls_zero_rtt))) {
DCHECK(proof_verifier_.get());
SetDefaults();
}
@@ -144,7 +145,7 @@ bool QuicCryptoClientConfig::CachedState::has_server_nonce() const {
QuicCryptoClientConfig::CachedState::ServerConfigState
QuicCryptoClientConfig::CachedState::SetServerConfig(
- quiche::QuicheStringPiece server_config,
+ absl::string_view server_config,
QuicWallTime now,
QuicWallTime expiry_time,
std::string* error_details) {
@@ -199,9 +200,9 @@ void QuicCryptoClientConfig::CachedState::InvalidateServerConfig() {
void QuicCryptoClientConfig::CachedState::SetProof(
const std::vector<std::string>& certs,
- quiche::QuicheStringPiece cert_sct,
- quiche::QuicheStringPiece chlo_hash,
- quiche::QuicheStringPiece signature) {
+ absl::string_view cert_sct,
+ absl::string_view chlo_hash,
+ absl::string_view signature) {
bool has_changed = signature != server_config_sig_ ||
chlo_hash != chlo_hash_ || certs_.size() != certs.size();
@@ -257,12 +258,12 @@ void QuicCryptoClientConfig::CachedState::SetProofInvalid() {
}
bool QuicCryptoClientConfig::CachedState::Initialize(
- quiche::QuicheStringPiece server_config,
- quiche::QuicheStringPiece source_address_token,
+ absl::string_view server_config,
+ absl::string_view source_address_token,
const std::vector<std::string>& certs,
const std::string& cert_sct,
- quiche::QuicheStringPiece chlo_hash,
- quiche::QuicheStringPiece signature,
+ absl::string_view chlo_hash,
+ absl::string_view signature,
QuicWallTime now,
QuicWallTime expiration_time) {
DCHECK(server_config_.empty());
@@ -330,12 +331,12 @@ QuicCryptoClientConfig::CachedState::proof_verify_details() const {
}
void QuicCryptoClientConfig::CachedState::set_source_address_token(
- quiche::QuicheStringPiece token) {
+ absl::string_view token) {
source_address_token_ = std::string(token);
}
void QuicCryptoClientConfig::CachedState::set_cert_sct(
- quiche::QuicheStringPiece cert_sct) {
+ absl::string_view cert_sct) {
cert_sct_ = std::string(cert_sct);
}
@@ -439,7 +440,7 @@ void QuicCryptoClientConfig::FillInchoateClientHello(
// the STK can be validated by the server.
const CryptoHandshakeMessage* scfg = cached->GetServerConfig();
if (scfg != nullptr) {
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
if (scfg->GetStringPiece(kSCID, &scid)) {
out->SetStringPiece(kSCID, scid);
}
@@ -454,9 +455,9 @@ void QuicCryptoClientConfig::FillInchoateClientHello(
}
char proof_nonce[32];
- rand->RandBytes(proof_nonce, QUICHE_ARRAYSIZE(proof_nonce));
- out->SetStringPiece(kNONP, quiche::QuicheStringPiece(
- proof_nonce, QUICHE_ARRAYSIZE(proof_nonce)));
+ rand->RandBytes(proof_nonce, ABSL_ARRAYSIZE(proof_nonce));
+ out->SetStringPiece(
+ kNONP, absl::string_view(proof_nonce, ABSL_ARRAYSIZE(proof_nonce)));
out->SetVector(kPDMD, QuicTagVector{kX509});
@@ -513,7 +514,7 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
return QUIC_CRYPTO_INTERNAL_ERROR;
}
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
if (!scfg->GetStringPiece(kSCID, &scid)) {
*error_details = "SCFG missing SCID";
return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
@@ -545,14 +546,14 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
out->SetVector(kAEAD, QuicTagVector{out_params->aead});
out->SetVector(kKEXS, QuicTagVector{out_params->key_exchange});
- quiche::QuicheStringPiece public_value;
+ absl::string_view public_value;
if (scfg->GetNthValue24(kPUBS, key_exchange_index, &public_value) !=
QUIC_NO_ERROR) {
*error_details = "Missing public value";
return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
}
- quiche::QuicheStringPiece orbit;
+ absl::string_view orbit;
if (!scfg->GetStringPiece(kORBT, &orbit) || orbit.size() != kOrbitSize) {
*error_details = "SCFG missing OBIT";
return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
@@ -635,13 +636,13 @@ QuicErrorCode QuicCryptoClientConfig::CacheNewServerConfig(
const CryptoHandshakeMessage& message,
QuicWallTime now,
QuicTransportVersion /*version*/,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& cached_certs,
CachedState* cached,
std::string* error_details) {
DCHECK(error_details != nullptr);
- quiche::QuicheStringPiece scfg;
+ absl::string_view scfg;
if (!message.GetStringPiece(kSCFG, &scfg)) {
*error_details = "Missing SCFG";
return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
@@ -666,12 +667,12 @@ QuicErrorCode QuicCryptoClientConfig::CacheNewServerConfig(
return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
}
- quiche::QuicheStringPiece token;
+ absl::string_view token;
if (message.GetStringPiece(kSourceAddressTokenTag, &token)) {
cached->set_source_address_token(token);
}
- quiche::QuicheStringPiece proof, cert_bytes, cert_sct;
+ absl::string_view proof, cert_bytes, cert_sct;
bool has_proof = message.GetStringPiece(kPROF, &proof);
bool has_cert = message.GetStringPiece(kCertificateTag, &cert_bytes);
if (has_proof && has_cert) {
@@ -707,7 +708,7 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
const CryptoHandshakeMessage& rej,
QuicWallTime now,
const QuicTransportVersion version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
CachedState* cached,
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
std::string* error_details) {
@@ -725,7 +726,7 @@ QuicErrorCode QuicCryptoClientConfig::ProcessRejection(
return error;
}
- quiche::QuicheStringPiece nonce;
+ absl::string_view nonce;
if (rej.GetStringPiece(kServerNonceTag, &nonce)) {
out_params->server_nonce = std::string(nonce);
}
@@ -750,12 +751,12 @@ QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
}
// Learn about updated source address tokens.
- quiche::QuicheStringPiece token;
+ absl::string_view token;
if (server_hello.GetStringPiece(kSourceAddressTokenTag, &token)) {
cached->set_source_address_token(token);
}
- quiche::QuicheStringPiece shlo_nonce;
+ absl::string_view shlo_nonce;
if (!server_hello.GetStringPiece(kServerNonceTag, &shlo_nonce)) {
*error_details = "server hello missing server nonce";
return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
@@ -764,7 +765,7 @@ QuicErrorCode QuicCryptoClientConfig::ProcessServerHello(
// TODO(agl):
// learn about updated SCFGs.
- quiche::QuicheStringPiece public_value;
+ absl::string_view public_value;
if (!server_hello.GetStringPiece(kPUBS, &public_value)) {
*error_details = "server hello missing forward secure public value";
return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
@@ -800,7 +801,7 @@ QuicErrorCode QuicCryptoClientConfig::ProcessServerConfigUpdate(
const CryptoHandshakeMessage& server_config_update,
QuicWallTime now,
const QuicTransportVersion version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
CachedState* cached,
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
std::string* error_details) {
@@ -858,8 +859,7 @@ bool QuicCryptoClientConfig::PopulateFromCanonicalConfig(
DCHECK(server_state->IsEmpty());
size_t i = 0;
for (; i < canonical_suffixes_.size(); ++i) {
- if (quiche::QuicheTextUtils::EndsWithIgnoreCase(server_id.host(),
- canonical_suffixes_[i])) {
+ if (absl::EndsWithIgnoreCase(server_id.host(), canonical_suffixes_[i])) {
break;
}
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h
index 701b7ffef66..913ddf94d23 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h
@@ -11,6 +11,7 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
@@ -21,7 +22,6 @@
#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_reference_counted.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -131,7 +131,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
// SetServerConfig checks that |server_config| parses correctly and stores
// it in |server_config_|. |now| is used to judge whether |server_config|
// has expired.
- ServerConfigState SetServerConfig(quiche::QuicheStringPiece server_config,
+ ServerConfigState SetServerConfig(absl::string_view server_config,
QuicWallTime now,
QuicWallTime expiry_time,
std::string* error_details);
@@ -141,9 +141,9 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
// SetProof stores a cert chain, cert signed timestamp and signature.
void SetProof(const std::vector<std::string>& certs,
- quiche::QuicheStringPiece cert_sct,
- quiche::QuicheStringPiece chlo_hash,
- quiche::QuicheStringPiece signature);
+ absl::string_view cert_sct,
+ absl::string_view chlo_hash,
+ absl::string_view signature);
// Clears all the data.
void Clear();
@@ -171,9 +171,9 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
uint64_t generation_counter() const;
const ProofVerifyDetails* proof_verify_details() const;
- void set_source_address_token(quiche::QuicheStringPiece token);
+ void set_source_address_token(absl::string_view token);
- void set_cert_sct(quiche::QuicheStringPiece cert_sct);
+ void set_cert_sct(absl::string_view cert_sct);
// Adds the servernonce to the queue of server nonces.
void add_server_nonce(const std::string& server_nonce);
@@ -198,12 +198,12 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
// Initializes this cached state based on the arguments provided.
// Returns false if there is a problem parsing the server config.
- bool Initialize(quiche::QuicheStringPiece server_config,
- quiche::QuicheStringPiece source_address_token,
+ bool Initialize(absl::string_view server_config,
+ absl::string_view source_address_token,
const std::vector<std::string>& certs,
const std::string& cert_sct,
- quiche::QuicheStringPiece chlo_hash,
- quiche::QuicheStringPiece signature,
+ absl::string_view chlo_hash,
+ absl::string_view signature,
QuicWallTime now,
QuicWallTime expiration_time);
@@ -311,7 +311,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
const CryptoHandshakeMessage& rej,
QuicWallTime now,
QuicTransportVersion version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
CachedState* cached,
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
std::string* error_details);
@@ -343,7 +343,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
const CryptoHandshakeMessage& server_update,
QuicWallTime now,
const QuicTransportVersion version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
CachedState* cached,
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> out_params,
std::string* error_details);
@@ -380,7 +380,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
void set_alpn(const std::string& alpn) { alpn_ = alpn; }
// Saves the pre-shared key used during the handshake.
- void set_pre_shared_key(quiche::QuicheStringPiece psk) {
+ void set_pre_shared_key(absl::string_view psk) {
pre_shared_key_ = std::string(psk);
}
@@ -407,7 +407,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig {
const CryptoHandshakeMessage& message,
QuicWallTime now,
QuicTransportVersion version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& cached_certs,
CachedState* cached,
std::string* error_details);
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config_test.cc
index 88b3eb68f14..d7625cd4e09 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config_test.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h"
#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -15,7 +16,6 @@
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_random.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using testing::StartsWith;
@@ -149,13 +149,13 @@ TEST_F(QuicCryptoClientConfigTest, InchoateChlo) {
QuicVersionLabel cver;
EXPECT_THAT(msg.GetVersionLabel(kVER, &cver), IsQuicNoError());
EXPECT_EQ(CreateQuicVersionLabel(QuicVersionMax()), cver);
- quiche::QuicheStringPiece proof_nonce;
+ absl::string_view proof_nonce;
EXPECT_TRUE(msg.GetStringPiece(kNONP, &proof_nonce));
EXPECT_EQ(std::string(32, 'r'), proof_nonce);
- quiche::QuicheStringPiece user_agent_id;
+ absl::string_view user_agent_id;
EXPECT_TRUE(msg.GetStringPiece(kUAID, &user_agent_id));
EXPECT_EQ("quic-tester", user_agent_id);
- quiche::QuicheStringPiece alpn;
+ absl::string_view alpn;
EXPECT_TRUE(msg.GetStringPiece(kALPN, &alpn));
EXPECT_EQ("hq", alpn);
EXPECT_EQ(msg.minimum_size(), 1u);
@@ -203,7 +203,7 @@ TEST_F(QuicCryptoClientConfigTest, InchoateChloSecure) {
QuicTag pdmd;
EXPECT_THAT(msg.GetUint32(kPDMD, &pdmd), IsQuicNoError());
EXPECT_EQ(kX509, pdmd);
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
EXPECT_FALSE(msg.GetStringPiece(kSCID, &scid));
}
@@ -229,7 +229,7 @@ TEST_F(QuicCryptoClientConfigTest, InchoateChloSecureWithSCIDNoEXPY) {
config.FillInchoateClientHello(server_id, QuicVersionMax(), &state, &rand,
/* demand_x509_proof= */ true, params, &msg);
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
EXPECT_TRUE(msg.GetStringPiece(kSCID, &scid));
EXPECT_EQ("12345678", scid);
}
@@ -255,7 +255,7 @@ TEST_F(QuicCryptoClientConfigTest, InchoateChloSecureWithSCID) {
config.FillInchoateClientHello(server_id, QuicVersionMax(), &state, &rand,
/* demand_x509_proof= */ true, params, &msg);
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
EXPECT_TRUE(msg.GetStringPiece(kSCID, &scid));
EXPECT_EQ("12345678", scid);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.cc
index ec535cfa7c6..b929dcc11b9 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.cc
@@ -10,11 +10,16 @@
#include <string>
#include <utility>
+#include "absl/base/attributes.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/cert_compressor.h"
+#include "net/third_party/quiche/src/quic/core/crypto/certificate_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/channel_id.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
@@ -40,7 +45,6 @@
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_cert_utils.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h"
@@ -48,7 +52,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_reference_counted.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_testvalue.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -64,11 +67,11 @@ const size_t kMultiplier = 3;
const int kMaxTokenAddresses = 4;
std::string DeriveSourceAddressTokenKey(
- quiche::QuicheStringPiece source_address_token_secret) {
- QuicHKDF hkdf(
- source_address_token_secret, quiche::QuicheStringPiece() /* no salt */,
- "QUIC source address token key", CryptoSecretBoxer::GetKeySize(),
- 0 /* no fixed IV needed */, 0 /* no subkey secret */);
+ absl::string_view source_address_token_secret) {
+ QuicHKDF hkdf(source_address_token_secret, absl::string_view() /* no salt */,
+ "QUIC source address token key",
+ CryptoSecretBoxer::GetKeySize(), 0 /* no fixed IV needed */,
+ 0 /* no subkey secret */);
return std::string(hkdf.server_write_key());
}
@@ -82,7 +85,7 @@ class DefaultKeyExchangeSource : public KeyExchangeSource {
std::string /*server_config_id*/,
bool /* is_fallback */,
QuicTag type,
- quiche::QuicheStringPiece private_key) override {
+ absl::string_view private_key) override {
if (private_key.empty()) {
QUIC_LOG(WARNING) << "Server config contains key exchange method without "
"corresponding private key of type "
@@ -232,7 +235,7 @@ void QuicCryptoServerConfig::ProcessClientHelloContext::Succeed(
}
QuicCryptoServerConfig::QuicCryptoServerConfig(
- quiche::QuicheStringPiece source_address_token_secret,
+ absl::string_view source_address_token_secret,
QuicRandom* server_nonce_entropy,
std::unique_ptr<ProofSource> proof_source,
std::unique_ptr<KeyExchangeSource> key_exchange_source)
@@ -281,8 +284,7 @@ QuicServerConfigProtobuf QuicCryptoServerConfig::GenerateConfig(
Curve25519KeyExchange::NewPrivateKey(rand);
std::unique_ptr<Curve25519KeyExchange> curve25519 =
Curve25519KeyExchange::New(curve25519_private_key);
- quiche::QuicheStringPiece curve25519_public_value =
- curve25519->public_value();
+ absl::string_view curve25519_public_value = curve25519->public_value();
std::string encoded_public_values;
// First three bytes encode the length of the public value.
@@ -301,7 +303,7 @@ QuicServerConfigProtobuf QuicCryptoServerConfig::GenerateConfig(
p256_private_key = P256KeyExchange::NewPrivateKey();
std::unique_ptr<P256KeyExchange> p256(
P256KeyExchange::New(p256_private_key));
- quiche::QuicheStringPiece p256_public_value = p256->public_value();
+ absl::string_view p256_public_value = p256->public_value();
DCHECK_LT(p256_public_value.size(), (1U << 24));
encoded_public_values.push_back(
@@ -340,8 +342,8 @@ QuicServerConfigProtobuf QuicCryptoServerConfig::GenerateConfig(
DCHECK(options.orbit.empty());
rand->RandBytes(orbit_bytes, sizeof(orbit_bytes));
}
- msg.SetStringPiece(
- kORBT, quiche::QuicheStringPiece(orbit_bytes, sizeof(orbit_bytes)));
+ msg.SetStringPiece(kORBT,
+ absl::string_view(orbit_bytes, sizeof(orbit_bytes)));
if (options.channel_id_enabled) {
msg.SetVector(kPDMD, QuicTagVector{kCHID});
@@ -358,9 +360,9 @@ QuicServerConfigProtobuf QuicCryptoServerConfig::GenerateConfig(
serialized->length(), scid_bytes);
// The SCID is a truncated SHA-256 digest.
static_assert(16 <= SHA256_DIGEST_LENGTH, "SCID length too high.");
- msg.SetStringPiece(kSCID,
- quiche::QuicheStringPiece(
- reinterpret_cast<const char*>(scid_bytes), 16));
+ msg.SetStringPiece(
+ kSCID,
+ absl::string_view(reinterpret_cast<const char*>(scid_bytes), 16));
} else {
msg.SetStringPiece(kSCID, options.id);
}
@@ -409,7 +411,7 @@ std::unique_ptr<CryptoHandshakeMessage> QuicCryptoServerConfig::AddConfig(
if (configs_.find(config->id) != configs_.end()) {
QUIC_LOG(WARNING) << "Failed to add config because another with the same "
"server config id already exists: "
- << quiche::QuicheTextUtils::HexEncode(config->id);
+ << absl::BytesToHexString(config->id);
return nullptr;
}
@@ -455,7 +457,7 @@ bool QuicCryptoServerConfig::SetConfigs(
return false;
}
QUIC_LOG(INFO) << "Fallback config has scid "
- << quiche::QuicheTextUtils::HexEncode(fallback_config->id);
+ << absl::BytesToHexString(fallback_config->id);
parsed_configs.push_back(fallback_config);
} else {
QUIC_LOG(INFO) << "No fallback config provided";
@@ -475,26 +477,27 @@ bool QuicCryptoServerConfig::SetConfigs(
for (const QuicReferenceCountedPointer<Config>& config : parsed_configs) {
auto it = configs_.find(config->id);
if (it != configs_.end()) {
- QUIC_LOG(INFO)
- << "Keeping scid: " << quiche::QuicheTextUtils::HexEncode(config->id)
- << " orbit: "
- << quiche::QuicheTextUtils::HexEncode(
- reinterpret_cast<const char*>(config->orbit), kOrbitSize)
- << " new primary_time " << config->primary_time.ToUNIXSeconds()
- << " old primary_time " << it->second->primary_time.ToUNIXSeconds()
- << " new priority " << config->priority << " old priority "
- << it->second->priority;
+ QUIC_LOG(INFO) << "Keeping scid: " << absl::BytesToHexString(config->id)
+ << " orbit: "
+ << absl::BytesToHexString(absl::string_view(
+ reinterpret_cast<const char*>(config->orbit),
+ kOrbitSize))
+ << " new primary_time "
+ << config->primary_time.ToUNIXSeconds()
+ << " old primary_time "
+ << it->second->primary_time.ToUNIXSeconds()
+ << " new priority " << config->priority << " old priority "
+ << it->second->priority;
// Update primary_time and priority.
it->second->primary_time = config->primary_time;
it->second->priority = config->priority;
new_configs.insert(*it);
} else {
- QUIC_LOG(INFO) << "Adding scid: "
- << quiche::QuicheTextUtils::HexEncode(config->id)
+ QUIC_LOG(INFO) << "Adding scid: " << absl::BytesToHexString(config->id)
<< " orbit: "
- << quiche::QuicheTextUtils::HexEncode(
+ << absl::BytesToHexString(absl::string_view(
reinterpret_cast<const char*>(config->orbit),
- kOrbitSize)
+ kOrbitSize))
<< " primary_time " << config->primary_time.ToUNIXSeconds()
<< " priority " << config->priority;
new_configs.emplace(config->id, config);
@@ -538,7 +541,7 @@ void QuicCryptoServerConfig::ValidateClientHello(
new ValidateClientHelloResultCallback::Result(
client_hello, client_address.host(), now));
- quiche::QuicheStringPiece requested_scid;
+ absl::string_view requested_scid;
client_hello.GetStringPiece(kSCID, &requested_scid);
Configs configs;
if (!GetCurrentConfigs(now, requested_scid,
@@ -594,7 +597,7 @@ class QuicCryptoServerConfig::ProcessClientHelloAfterGetProofCallback
std::unique_ptr<ProofSource::Details> proof_source_details,
QuicTag key_exchange_type,
std::unique_ptr<CryptoHandshakeMessage> out,
- quiche::QuicheStringPiece public_value,
+ absl::string_view public_value,
std::unique_ptr<ProcessClientHelloContext> context,
const Configs& configs)
: config_(config),
@@ -687,7 +690,7 @@ void QuicCryptoServerConfig::ProcessClientHello(
return;
}
- quiche::QuicheStringPiece requested_scid;
+ absl::string_view requested_scid;
context->client_hello().GetStringPiece(kSCID, &requested_scid);
Configs configs;
if (!GetCurrentConfigs(context->clock()->WallNow(), requested_scid,
@@ -748,7 +751,7 @@ void QuicCryptoServerConfig::ProcessClientHelloAfterGetProof(
auto out_diversification_nonce = std::make_unique<DiversificationNonce>();
- quiche::QuicheStringPiece cert_sct;
+ absl::string_view cert_sct;
if (context->client_hello().GetStringPiece(kCertificateSCTTag, &cert_sct) &&
cert_sct.empty()) {
context->params()->sct_supported_by_client = true;
@@ -791,7 +794,7 @@ void QuicCryptoServerConfig::ProcessClientHelloAfterGetProof(
return;
}
- quiche::QuicheStringPiece public_value;
+ absl::string_view public_value;
if (!context->client_hello().GetStringPiece(kPUBS, &public_value)) {
context->Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
"Missing public value");
@@ -819,7 +822,7 @@ void QuicCryptoServerConfig::ProcessClientHelloAfterCalculateSharedKeys(
std::unique_ptr<ProofSource::Details> proof_source_details,
QuicTag key_exchange_type,
std::unique_ptr<CryptoHandshakeMessage> out,
- quiche::QuicheStringPiece public_value,
+ absl::string_view public_value,
std::unique_ptr<ProcessClientHelloContext> context,
const Configs& configs) const {
QUIC_BUG_IF(!QuicUtils::IsConnectionIdValidForVersion(
@@ -832,8 +835,7 @@ void QuicCryptoServerConfig::ProcessClientHelloAfterCalculateSharedKeys(
if (found_error) {
// If we are already using the fallback config, or there is no fallback
// config to use, just bail out of the handshake.
- if ((GetQuicReloadableFlag(quic_check_fallback_null) &&
- configs.fallback == nullptr) ||
+ if (configs.fallback == nullptr ||
context->signed_config()->config == configs.fallback ||
!GetQuicReloadableFlag(
send_quic_fallback_server_config_on_leto_error)) {
@@ -868,7 +870,7 @@ void QuicCryptoServerConfig::ProcessClientHelloAfterCalculateSharedKeys(
}
hkdf_suffix.append(context->signed_config()->chain->certs.at(0));
- quiche::QuicheStringPiece cetv_ciphertext;
+ absl::string_view cetv_ciphertext;
if (configs.requested->channel_id_enabled &&
context->client_hello().GetStringPiece(kCETV, &cetv_ciphertext)) {
CryptoHandshakeMessage client_hello_copy(context->client_hello());
@@ -901,22 +903,21 @@ void QuicCryptoServerConfig::ProcessClientHelloAfterCalculateSharedKeys(
char plaintext[kMaxOutgoingPacketSize];
size_t plaintext_length = 0;
const bool success = crypters.decrypter->DecryptPacket(
- 0 /* packet number */,
- quiche::QuicheStringPiece() /* associated data */, cetv_ciphertext,
- plaintext, &plaintext_length, kMaxOutgoingPacketSize);
+ 0 /* packet number */, absl::string_view() /* associated data */,
+ cetv_ciphertext, plaintext, &plaintext_length, kMaxOutgoingPacketSize);
if (!success) {
context->Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER,
"CETV decryption failure");
return;
}
std::unique_ptr<CryptoHandshakeMessage> cetv(CryptoFramer::ParseMessage(
- quiche::QuicheStringPiece(plaintext, plaintext_length)));
+ absl::string_view(plaintext, plaintext_length)));
if (!cetv) {
context->Fail(QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER, "CETV parse error");
return;
}
- quiche::QuicheStringPiece key, signature;
+ absl::string_view key, signature;
if (cetv->GetStringPiece(kCIDK, &key) &&
cetv->GetStringPiece(kCIDS, &signature)) {
if (!ChannelIDVerifier::Verify(key, hkdf_input, signature)) {
@@ -1055,7 +1056,7 @@ void QuicCryptoServerConfig::SendRejectWithFallbackConfigAfterGetProof(
QuicReferenceCountedPointer<QuicCryptoServerConfig::Config>
QuicCryptoServerConfig::GetConfigWithScid(
- quiche::QuicheStringPiece requested_scid) const {
+ absl::string_view requested_scid) const {
configs_lock_.AssertReaderHeld();
if (!requested_scid.empty()) {
@@ -1072,7 +1073,7 @@ QuicCryptoServerConfig::GetConfigWithScid(
bool QuicCryptoServerConfig::GetCurrentConfigs(
const QuicWallTime& now,
- quiche::QuicheStringPiece requested_scid,
+ absl::string_view requested_scid,
QuicReferenceCountedPointer<Config> old_primary_config,
Configs* configs) const {
QuicReaderMutexLock locked(&configs_lock_);
@@ -1175,10 +1176,10 @@ void QuicCryptoServerConfig::SelectNewPrimaryConfig(
primary_config_ = new_primary;
new_primary->is_primary = true;
QUIC_DLOG(INFO) << "New primary config. orbit: "
- << quiche::QuicheTextUtils::HexEncode(
- reinterpret_cast<const char*>(
- primary_config_->orbit),
- kOrbitSize);
+ << absl::BytesToHexString(
+ absl::string_view(reinterpret_cast<const char*>(
+ primary_config_->orbit),
+ kOrbitSize));
if (primary_config_changed_cb_ != nullptr) {
primary_config_changed_cb_->Run(primary_config_->id);
}
@@ -1195,11 +1196,10 @@ void QuicCryptoServerConfig::SelectNewPrimaryConfig(
primary_config_ = new_primary;
new_primary->is_primary = true;
QUIC_DLOG(INFO) << "New primary config. orbit: "
- << quiche::QuicheTextUtils::HexEncode(
+ << absl::BytesToHexString(absl::string_view(
reinterpret_cast<const char*>(primary_config_->orbit),
- kOrbitSize)
- << " scid: "
- << quiche::QuicheTextUtils::HexEncode(primary_config_->id);
+ kOrbitSize))
+ << " scid: " << absl::BytesToHexString(primary_config_->id);
next_config_promotion_time_ = QuicWallTime::Zero();
if (primary_config_changed_cb_ != nullptr) {
primary_config_changed_cb_->Run(primary_config_->id);
@@ -1230,7 +1230,7 @@ void QuicCryptoServerConfig::EvaluateClientHello(
HandshakeFailureReason source_address_token_error = MAX_FAILURE_REASON;
if (validate_source_address_token_) {
- quiche::QuicheStringPiece srct;
+ absl::string_view srct;
if (client_hello.GetStringPiece(kSourceAddressTokenTag, &srct)) {
Config& config =
configs.requested != nullptr ? *configs.requested : *configs.primary;
@@ -1253,7 +1253,7 @@ void QuicCryptoServerConfig::EvaluateClientHello(
}
if (!configs.requested) {
- quiche::QuicheStringPiece requested_scid;
+ absl::string_view requested_scid;
if (client_hello.GetStringPiece(kSCID, &requested_scid)) {
info->reject_reasons.push_back(SERVER_CONFIG_UNKNOWN_CONFIG_FAILURE);
} else {
@@ -1308,7 +1308,7 @@ void QuicCryptoServerConfig::EvaluateClientHello(
void QuicCryptoServerConfig::BuildServerConfigUpdateMessage(
QuicTransportVersion version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const SourceAddressTokens& previous_source_address_tokens,
const QuicSocketAddress& server_address,
const QuicSocketAddress& client_address,
@@ -1457,13 +1457,13 @@ void QuicCryptoServerConfig::BuildRejection(
return;
}
- quiche::QuicheStringPiece client_common_set_hashes;
+ absl::string_view client_common_set_hashes;
if (context.client_hello().GetStringPiece(kCCS, &client_common_set_hashes)) {
context.params()->client_common_set_hashes =
std::string(client_common_set_hashes);
}
- quiche::QuicheStringPiece client_cached_cert_hashes;
+ absl::string_view client_cached_cert_hashes;
if (context.client_hello().GetStringPiece(kCCRT,
&client_cached_cert_hashes)) {
context.params()->client_cached_cert_hashes =
@@ -1511,9 +1511,29 @@ void QuicCryptoServerConfig::BuildRejection(
// This is for debugging b/28342827.
const std::vector<std::string>& certs =
context.signed_config()->chain->certs;
- quiche::QuicheStringPiece ca_subject;
+ std::string ca_subject;
if (!certs.empty()) {
- QuicCertUtils::ExtractSubjectNameFromDERCert(certs[0], &ca_subject);
+ if (GetQuicReloadableFlag(
+ quic_extract_x509_subject_using_certificate_view)) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(
+ quic_extract_x509_subject_using_certificate_view, 1, 2);
+ std::unique_ptr<CertificateView> view =
+ CertificateView::ParseSingleCertificate(certs[0]);
+ if (view != nullptr) {
+ absl::optional<std::string> maybe_ca_subject =
+ view->GetHumanReadableSubject();
+ if (maybe_ca_subject.has_value()) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(
+ quic_extract_x509_subject_using_certificate_view, 2, 2);
+ ca_subject = *maybe_ca_subject;
+ }
+ }
+ } else {
+ absl::string_view ca_subject_view;
+ QuicCertUtils::ExtractSubjectNameFromDERCert(certs[0],
+ &ca_subject_view);
+ ca_subject = std::string(ca_subject_view);
+ }
}
QUIC_LOG_EVERY_N_SEC(WARNING, 60)
<< "SCT is expected but it is empty. sni: '"
@@ -1578,7 +1598,7 @@ QuicCryptoServerConfig::ParseConfigProtobuf(
config->priority = protobuf.priority();
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
if (!msg->GetStringPiece(kSCID, &scid)) {
QUIC_LOG(WARNING) << "Server config message is missing SCID";
return nullptr;
@@ -1596,7 +1616,7 @@ QuicCryptoServerConfig::ParseConfigProtobuf(
return nullptr;
}
- quiche::QuicheStringPiece orbit;
+ absl::string_view orbit;
if (!msg->GetStringPiece(kORBT, &orbit)) {
QUIC_LOG(WARNING) << "Server config message is missing ORBT";
return nullptr;
@@ -1767,10 +1787,10 @@ SSL_CTX* QuicCryptoServerConfig::ssl_ctx() const {
HandshakeFailureReason QuicCryptoServerConfig::ParseSourceAddressToken(
const Config& config,
- quiche::QuicheStringPiece token,
+ absl::string_view token,
SourceAddressTokens* tokens) const {
std::string storage;
- quiche::QuicheStringPiece plaintext;
+ absl::string_view plaintext;
if (!config.source_address_token_boxer->Unbox(token, &storage, &plaintext)) {
return SOURCE_ADDRESS_TOKEN_DECRYPTION_FAILURE;
}
@@ -1860,8 +1880,8 @@ std::string QuicCryptoServerConfig::NewServerNonce(QuicRandom* rand,
sizeof(server_nonce) - sizeof(timestamp));
return server_nonce_boxer_.Box(
- rand, quiche::QuicheStringPiece(reinterpret_cast<char*>(server_nonce),
- sizeof(server_nonce)));
+ rand, absl::string_view(reinterpret_cast<char*>(server_nonce),
+ sizeof(server_nonce)));
}
bool QuicCryptoServerConfig::ValidateExpectedLeafCertificate(
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h
index 9f2db603416..7fae412bce2 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h
@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
@@ -30,7 +31,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_mutex.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_reference_counted.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -54,10 +54,10 @@ struct QUIC_EXPORT_PRIVATE ClientHelloInfo {
// Outputs from EvaluateClientHello.
bool valid_source_address_token;
- quiche::QuicheStringPiece sni;
- quiche::QuicheStringPiece client_nonce;
- quiche::QuicheStringPiece server_nonce;
- quiche::QuicheStringPiece user_agent_id;
+ absl::string_view sni;
+ absl::string_view client_nonce;
+ absl::string_view server_nonce;
+ absl::string_view user_agent_id;
SourceAddressTokens source_address_tokens;
// Errors from EvaluateClientHello.
@@ -171,7 +171,7 @@ class QUIC_EXPORT_PRIVATE KeyExchangeSource {
std::string server_config_id,
bool is_fallback,
QuicTag type,
- quiche::QuicheStringPiece private_key) = 0;
+ absl::string_view private_key) = 0;
};
// QuicCryptoServerConfig contains the crypto configuration of a QUIC server.
@@ -215,7 +215,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
// |proof_source|: provides certificate chains and signatures.
// |key_exchange_source|: provides key-exchange functionality.
QuicCryptoServerConfig(
- quiche::QuicheStringPiece source_address_token_secret,
+ absl::string_view source_address_token_secret,
QuicRandom* server_nonce_entropy,
std::unique_ptr<ProofSource> proof_source,
std::unique_ptr<KeyExchangeSource> key_exchange_source);
@@ -357,7 +357,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
// |cached_network_params| is optional, and can be nullptr.
void BuildServerConfigUpdateMessage(
QuicTransportVersion version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const SourceAddressTokens& previous_source_address_tokens,
const QuicSocketAddress& server_address,
const QuicSocketAddress& client_address,
@@ -434,7 +434,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
// Pre-shared key used during the handshake.
const std::string& pre_shared_key() const { return pre_shared_key_; }
- void set_pre_shared_key(quiche::QuicheStringPiece psk) {
+ void set_pre_shared_key(absl::string_view psk) {
pre_shared_key_ = std::string(psk);
}
@@ -511,12 +511,12 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
~Config() override;
};
- typedef std::map<ServerConfigID, QuicReferenceCountedPointer<Config>>
- ConfigMap;
+ using ConfigMap =
+ std::map<ServerConfigID, QuicReferenceCountedPointer<Config>>;
// Get a ref to the config with a given server config id.
QuicReferenceCountedPointer<Config> GetConfigWithScid(
- quiche::QuicheStringPiece requested_scid) const
+ absl::string_view requested_scid) const
QUIC_SHARED_LOCKS_REQUIRED(configs_lock_);
// A snapshot of the configs associated with an in-progress handshake.
@@ -533,7 +533,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
// Returns true if any configs are loaded. If false is returned, |configs| is
// not modified.
bool GetCurrentConfigs(const QuicWallTime& now,
- quiche::QuicheStringPiece requested_scid,
+ absl::string_view requested_scid,
QuicReferenceCountedPointer<Config> old_primary_config,
Configs* configs) const;
@@ -687,7 +687,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
std::unique_ptr<ProofSource::Details> proof_source_details,
QuicTag key_exchange_type,
std::unique_ptr<CryptoHandshakeMessage> out,
- quiche::QuicheStringPiece public_value,
+ absl::string_view public_value,
std::unique_ptr<ProcessClientHelloContext> context,
const Configs& configs) const;
@@ -761,7 +761,7 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerConfig {
// failure.
HandshakeFailureReason ParseSourceAddressToken(
const Config& config,
- quiche::QuicheStringPiece token,
+ absl::string_view token,
SourceAddressTokens* tokens) const;
// ValidateSourceAddressTokens returns HANDSHAKE_OK if the source address
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config_test.cc
index 6f0c047b95b..e612a33b6d5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config_test.cc
@@ -9,6 +9,8 @@
#include <memory>
#include <string>
+#include "absl/strings/match.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/cert_compressor.h"
#include "net/third_party/quiche/src/quic/core/crypto/chacha20_poly1305_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
@@ -23,7 +25,6 @@
#include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -142,7 +143,7 @@ TEST_F(QuicCryptoServerConfigTest, CompressDifferentCerts) {
static const uint64_t set_hash = 42;
std::unique_ptr<CommonCertSets> common_sets(
crypto_test_utils::MockCommonCertSets(certs[0], set_hash, 1));
- quiche::QuicheStringPiece different_common_certs(
+ absl::string_view different_common_certs(
reinterpret_cast<const char*>(&set_hash), sizeof(set_hash));
std::string compressed3 = QuicCryptoServerConfigPeer::CompressChain(
&compressed_certs_cache, chain, std::string(different_common_certs),
@@ -193,16 +194,15 @@ class SourceAddressTokenTest : public QuicTest {
clock_.WallNow(), cached_network_params);
}
- HandshakeFailureReason ValidateSourceAddressTokens(
- std::string config_id,
- quiche::QuicheStringPiece srct,
- const QuicIpAddress& ip) {
+ HandshakeFailureReason ValidateSourceAddressTokens(std::string config_id,
+ absl::string_view srct,
+ const QuicIpAddress& ip) {
return ValidateSourceAddressTokens(config_id, srct, ip, nullptr);
}
HandshakeFailureReason ValidateSourceAddressTokens(
std::string config_id,
- quiche::QuicheStringPiece srct,
+ absl::string_view srct,
const QuicIpAddress& ip,
CachedNetworkParameters* cached_network_params) {
return peer_.ValidateSourceAddressTokens(
@@ -356,8 +356,7 @@ class CryptoServerConfigsTest : public QuicTest {
QuicCryptoServerConfig::GenerateConfig(rand_, &clock_, options);
protobuf.set_primary_time(primary_time);
protobuf.set_priority(priority);
- if (quiche::QuicheTextUtils::StartsWith(std::string(server_config_id),
- "INVALID")) {
+ if (absl::StartsWith(std::string(server_config_id), "INVALID")) {
protobuf.clear_key();
has_invalid = true;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.cc
index c4249017cae..29e1e18c967 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.cc
@@ -7,6 +7,7 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/tls1.h"
#include "net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_decrypter.h"
@@ -18,7 +19,6 @@
#include "net/third_party/quiche/src/quic/core/crypto/quic_hkdf.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -62,16 +62,15 @@ std::unique_ptr<QuicDecrypter> QuicDecrypter::CreateFromCipherSuite(
}
// static
-void QuicDecrypter::DiversifyPreliminaryKey(
- quiche::QuicheStringPiece preliminary_key,
- quiche::QuicheStringPiece nonce_prefix,
- const DiversificationNonce& nonce,
- size_t key_size,
- size_t nonce_prefix_size,
- std::string* out_key,
- std::string* out_nonce_prefix) {
+void QuicDecrypter::DiversifyPreliminaryKey(absl::string_view preliminary_key,
+ absl::string_view nonce_prefix,
+ const DiversificationNonce& nonce,
+ size_t key_size,
+ size_t nonce_prefix_size,
+ std::string* out_key,
+ std::string* out_nonce_prefix) {
QuicHKDF hkdf((std::string(preliminary_key)) + (std::string(nonce_prefix)),
- quiche::QuicheStringPiece(nonce.data(), nonce.size()),
+ absl::string_view(nonce.data(), nonce.size()),
"QUIC key diversification", 0, key_size, 0, nonce_prefix_size,
0);
*out_key = std::string(hkdf.server_write_key());
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h
index 7f4d93d323a..4a6cc59d0ab 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h
@@ -10,11 +10,11 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypter.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -38,7 +38,7 @@ class QUIC_EXPORT_PRIVATE QuicDecrypter : public QuicCrypter {
//
// If this function is called, neither |SetKey| nor |SetNoncePrefix| may be
// called.
- virtual bool SetPreliminaryKey(quiche::QuicheStringPiece key) = 0;
+ virtual bool SetPreliminaryKey(absl::string_view key) = 0;
// SetDiversificationNonce uses |nonce| to derive final keys based on the
// input keying material given by calling |SetPreliminaryKey|.
@@ -56,8 +56,8 @@ class QUIC_EXPORT_PRIVATE QuicDecrypter : public QuicCrypter {
// TODO(wtc): add a way for DecryptPacket to report decryption failure due
// to non-authentic inputs, as opposed to other reasons for failure.
virtual bool DecryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) = 0;
@@ -73,12 +73,16 @@ class QUIC_EXPORT_PRIVATE QuicDecrypter : public QuicCrypter {
// selector'.
virtual uint32_t cipher_id() const = 0;
+ // Returns the maximum number of packets that can safely fail decryption with
+ // this decrypter.
+ virtual QuicPacketCount GetIntegrityLimit() const = 0;
+
// For use by unit tests only.
- virtual quiche::QuicheStringPiece GetKey() const = 0;
- virtual quiche::QuicheStringPiece GetNoncePrefix() const = 0;
+ virtual absl::string_view GetKey() const = 0;
+ virtual absl::string_view GetNoncePrefix() const = 0;
- static void DiversifyPreliminaryKey(quiche::QuicheStringPiece preliminary_key,
- quiche::QuicheStringPiece nonce_prefix,
+ static void DiversifyPreliminaryKey(absl::string_view preliminary_key,
+ absl::string_view nonce_prefix,
const DiversificationNonce& nonce,
size_t key_size,
size_t nonce_prefix_size,
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h
index 6fe552d1778..b454997f397 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h
@@ -8,10 +8,10 @@
#include <cstddef>
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypter.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,8 +36,8 @@ class QUIC_EXPORT_PRIVATE QuicEncrypter : public QuicCrypter {
// |associated_data|. If |output| overlaps with |plaintext| then
// |plaintext| must be <= |output|.
virtual bool EncryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) = 0;
@@ -47,7 +47,7 @@ class QUIC_EXPORT_PRIVATE QuicEncrypter : public QuicCrypter {
// success, the mask will be at least 5 bytes long; on failure the string will
// be empty.
virtual std::string GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece sample) = 0;
+ absl::string_view sample) = 0;
// Returns the maximum length of plaintext that can be encrypted
// to ciphertext no larger than |ciphertext_size|.
@@ -57,9 +57,13 @@ class QUIC_EXPORT_PRIVATE QuicEncrypter : public QuicCrypter {
// to plaintext of size |plaintext_size|.
virtual size_t GetCiphertextSize(size_t plaintext_size) const = 0;
+ // Returns the maximum number of packets that can be safely encrypted with
+ // this encrypter.
+ virtual QuicPacketCount GetConfidentialityLimit() const = 0;
+
// For use by unit tests only.
- virtual quiche::QuicheStringPiece GetKey() const = 0;
- virtual quiche::QuicheStringPiece GetNoncePrefix() const = 0;
+ virtual absl::string_view GetKey() const = 0;
+ virtual absl::string_view GetNoncePrefix() const = 0;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.cc
index 28cf4a93a18..59c3eb0fb9d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.cc
@@ -6,19 +6,19 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
#include "third_party/boringssl/src/include/openssl/hkdf.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
const size_t kSHA256HashLength = 32;
const size_t kMaxKeyMaterialSize = kSHA256HashLength * 256;
-QuicHKDF::QuicHKDF(quiche::QuicheStringPiece secret,
- quiche::QuicheStringPiece salt,
- quiche::QuicheStringPiece info,
+QuicHKDF::QuicHKDF(absl::string_view secret,
+ absl::string_view salt,
+ absl::string_view info,
size_t key_bytes_to_generate,
size_t iv_bytes_to_generate,
size_t subkey_secret_bytes_to_generate)
@@ -31,9 +31,9 @@ QuicHKDF::QuicHKDF(quiche::QuicheStringPiece secret,
iv_bytes_to_generate,
subkey_secret_bytes_to_generate) {}
-QuicHKDF::QuicHKDF(quiche::QuicheStringPiece secret,
- quiche::QuicheStringPiece salt,
- quiche::QuicheStringPiece info,
+QuicHKDF::QuicHKDF(absl::string_view secret,
+ absl::string_view salt,
+ absl::string_view info,
size_t client_key_bytes_to_generate,
size_t server_key_bytes_to_generate,
size_t client_iv_bytes_to_generate,
@@ -60,44 +60,44 @@ QuicHKDF::QuicHKDF(quiche::QuicheStringPiece secret,
size_t j = 0;
if (client_key_bytes_to_generate) {
- client_write_key_ = quiche::QuicheStringPiece(
- reinterpret_cast<char*>(&output_[j]), client_key_bytes_to_generate);
+ client_write_key_ = absl::string_view(reinterpret_cast<char*>(&output_[j]),
+ client_key_bytes_to_generate);
j += client_key_bytes_to_generate;
}
if (server_key_bytes_to_generate) {
- server_write_key_ = quiche::QuicheStringPiece(
- reinterpret_cast<char*>(&output_[j]), server_key_bytes_to_generate);
+ server_write_key_ = absl::string_view(reinterpret_cast<char*>(&output_[j]),
+ server_key_bytes_to_generate);
j += server_key_bytes_to_generate;
}
if (client_iv_bytes_to_generate) {
- client_write_iv_ = quiche::QuicheStringPiece(
- reinterpret_cast<char*>(&output_[j]), client_iv_bytes_to_generate);
+ client_write_iv_ = absl::string_view(reinterpret_cast<char*>(&output_[j]),
+ client_iv_bytes_to_generate);
j += client_iv_bytes_to_generate;
}
if (server_iv_bytes_to_generate) {
- server_write_iv_ = quiche::QuicheStringPiece(
- reinterpret_cast<char*>(&output_[j]), server_iv_bytes_to_generate);
+ server_write_iv_ = absl::string_view(reinterpret_cast<char*>(&output_[j]),
+ server_iv_bytes_to_generate);
j += server_iv_bytes_to_generate;
}
if (subkey_secret_bytes_to_generate) {
- subkey_secret_ = quiche::QuicheStringPiece(
- reinterpret_cast<char*>(&output_[j]), subkey_secret_bytes_to_generate);
+ subkey_secret_ = absl::string_view(reinterpret_cast<char*>(&output_[j]),
+ subkey_secret_bytes_to_generate);
j += subkey_secret_bytes_to_generate;
}
// Repeat client and server key bytes for header protection keys.
if (client_key_bytes_to_generate) {
- client_hp_key_ = quiche::QuicheStringPiece(
- reinterpret_cast<char*>(&output_[j]), client_key_bytes_to_generate);
+ client_hp_key_ = absl::string_view(reinterpret_cast<char*>(&output_[j]),
+ client_key_bytes_to_generate);
j += client_key_bytes_to_generate;
}
if (server_key_bytes_to_generate) {
- server_hp_key_ = quiche::QuicheStringPiece(
- reinterpret_cast<char*>(&output_[j]), server_key_bytes_to_generate);
+ server_hp_key_ = absl::string_view(reinterpret_cast<char*>(&output_[j]),
+ server_key_bytes_to_generate);
j += server_key_bytes_to_generate;
}
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.h b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.h
index 2945173f421..63018b4443a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf.h
@@ -7,8 +7,8 @@
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -31,18 +31,18 @@ class QUIC_EXPORT_PRIVATE QuicHKDF {
// client and server.
// |subkey_secret_bytes_to_generate|: the number of bytes of subkey secret to
// generate, shared between client and server.
- QuicHKDF(quiche::QuicheStringPiece secret,
- quiche::QuicheStringPiece salt,
- quiche::QuicheStringPiece info,
+ QuicHKDF(absl::string_view secret,
+ absl::string_view salt,
+ absl::string_view info,
size_t key_bytes_to_generate,
size_t iv_bytes_to_generate,
size_t subkey_secret_bytes_to_generate);
// An alternative constructor that allows the client and server key/IV
// lengths to be different.
- QuicHKDF(quiche::QuicheStringPiece secret,
- quiche::QuicheStringPiece salt,
- quiche::QuicheStringPiece info,
+ QuicHKDF(absl::string_view secret,
+ absl::string_view salt,
+ absl::string_view info,
size_t client_key_bytes_to_generate,
size_t server_key_bytes_to_generate,
size_t client_iv_bytes_to_generate,
@@ -51,28 +51,24 @@ class QUIC_EXPORT_PRIVATE QuicHKDF {
~QuicHKDF();
- quiche::QuicheStringPiece client_write_key() const {
- return client_write_key_;
- }
- quiche::QuicheStringPiece client_write_iv() const { return client_write_iv_; }
- quiche::QuicheStringPiece server_write_key() const {
- return server_write_key_;
- }
- quiche::QuicheStringPiece server_write_iv() const { return server_write_iv_; }
- quiche::QuicheStringPiece subkey_secret() const { return subkey_secret_; }
- quiche::QuicheStringPiece client_hp_key() const { return client_hp_key_; }
- quiche::QuicheStringPiece server_hp_key() const { return server_hp_key_; }
+ absl::string_view client_write_key() const { return client_write_key_; }
+ absl::string_view client_write_iv() const { return client_write_iv_; }
+ absl::string_view server_write_key() const { return server_write_key_; }
+ absl::string_view server_write_iv() const { return server_write_iv_; }
+ absl::string_view subkey_secret() const { return subkey_secret_; }
+ absl::string_view client_hp_key() const { return client_hp_key_; }
+ absl::string_view server_hp_key() const { return server_hp_key_; }
private:
std::vector<uint8_t> output_;
- quiche::QuicheStringPiece client_write_key_;
- quiche::QuicheStringPiece server_write_key_;
- quiche::QuicheStringPiece client_write_iv_;
- quiche::QuicheStringPiece server_write_iv_;
- quiche::QuicheStringPiece subkey_secret_;
- quiche::QuicheStringPiece client_hp_key_;
- quiche::QuicheStringPiece server_hp_key_;
+ absl::string_view client_write_key_;
+ absl::string_view server_write_key_;
+ absl::string_view client_write_iv_;
+ absl::string_view server_write_iv_;
+ absl::string_view subkey_secret_;
+ absl::string_view client_hp_key_;
+ absl::string_view server_hp_key_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf_test.cc
index 8b74f633d02..48e089f7bc4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/quic_hkdf_test.cc
@@ -6,8 +6,9 @@
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -67,15 +68,14 @@ static const HKDFInput kHKDFInputs[] = {
class QuicHKDFTest : public QuicTest {};
TEST_F(QuicHKDFTest, HKDF) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kHKDFInputs); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kHKDFInputs); i++) {
const HKDFInput& test(kHKDFInputs[i]);
SCOPED_TRACE(i);
- const std::string key = quiche::QuicheTextUtils::HexDecode(test.key_hex);
- const std::string salt = quiche::QuicheTextUtils::HexDecode(test.salt_hex);
- const std::string info = quiche::QuicheTextUtils::HexDecode(test.info_hex);
- const std::string expected =
- quiche::QuicheTextUtils::HexDecode(test.output_hex);
+ const std::string key = absl::HexStringToBytes(test.key_hex);
+ const std::string salt = absl::HexStringToBytes(test.salt_hex);
+ const std::string info = absl::HexStringToBytes(test.info_hex);
+ const std::string expected = absl::HexStringToBytes(test.output_hex);
// We set the key_length to the length of the expected output and then take
// the result from the first key, which is the client write key.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.cc
index 79088473bbc..0591571ae39 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.cc
@@ -13,9 +13,9 @@ TlsClientConnection::TlsClientConnection(SSL_CTX* ssl_ctx, Delegate* delegate)
// static
bssl::UniquePtr<SSL_CTX> TlsClientConnection::CreateSslCtx(
bool enable_early_data) {
- bssl::UniquePtr<SSL_CTX> ssl_ctx = TlsConnection::CreateSslCtx();
+ bssl::UniquePtr<SSL_CTX> ssl_ctx =
+ TlsConnection::CreateSslCtx(SSL_VERIFY_PEER);
// Configure certificate verification.
- SSL_CTX_set_custom_verify(ssl_ctx.get(), SSL_VERIFY_PEER, &VerifyCallback);
int reverify_on_resume_enabled = 1;
SSL_CTX_set_reverify_on_resume(ssl_ctx.get(), reverify_on_resume_enabled);
@@ -29,14 +29,6 @@ bssl::UniquePtr<SSL_CTX> TlsClientConnection::CreateSslCtx(
}
// static
-enum ssl_verify_result_t TlsClientConnection::VerifyCallback(
- SSL* ssl,
- uint8_t* out_alert) {
- return static_cast<TlsClientConnection*>(ConnectionFromSsl(ssl))
- ->delegate_->VerifyCert(out_alert);
-}
-
-// static
int TlsClientConnection::NewSessionCallback(SSL* ssl, SSL_SESSION* session) {
static_cast<TlsClientConnection*>(ConnectionFromSsl(ssl))
->delegate_->InsertSession(bssl::UniquePtr<SSL_SESSION>(session));
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.h b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.h
index a7ef209792f..6bea641be84 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_client_connection.h
@@ -20,12 +20,6 @@ class QUIC_EXPORT_PRIVATE TlsClientConnection : public TlsConnection {
virtual ~Delegate() {}
protected:
- // Verifies the peer's certificate chain. It may use
- // SSL_get0_peer_certificates to get the cert chain. This method returns
- // ssl_verify_ok if the cert is valid, ssl_verify_invalid if it is invalid,
- // or ssl_verify_retry if verification is happening asynchronously.
- virtual enum ssl_verify_result_t VerifyCert(uint8_t* out_alert) = 0;
-
// Called when a NewSessionTicket is received from the server.
virtual void InsertSession(bssl::UniquePtr<SSL_SESSION> session) = 0;
@@ -42,10 +36,6 @@ class QUIC_EXPORT_PRIVATE TlsClientConnection : public TlsConnection {
static bssl::UniquePtr<SSL_CTX> CreateSslCtx(bool enable_early_data);
private:
- // Registered as the callback for SSL_CTX_set_custom_verify. The
- // implementation is delegated to Delegate::VerifyCert.
- static enum ssl_verify_result_t VerifyCallback(SSL* ssl, uint8_t* out_alert);
-
// Registered as the callback for SSL_CTX_sess_set_new_cb, which calls
// Delegate::InsertSession.
static int NewSessionCallback(SSL* ssl, SSL_SESSION* session);
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.cc
index 8e4d391db4b..be274e2cb2a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/core/crypto/tls_connection.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -93,12 +93,15 @@ TlsConnection::TlsConnection(SSL_CTX* ssl_ctx,
this);
}
// static
-bssl::UniquePtr<SSL_CTX> TlsConnection::CreateSslCtx() {
+bssl::UniquePtr<SSL_CTX> TlsConnection::CreateSslCtx(int cert_verify_mode) {
CRYPTO_library_init();
bssl::UniquePtr<SSL_CTX> ssl_ctx(SSL_CTX_new(TLS_with_buffers_method()));
SSL_CTX_set_min_proto_version(ssl_ctx.get(), TLS1_3_VERSION);
SSL_CTX_set_max_proto_version(ssl_ctx.get(), TLS1_3_VERSION);
SSL_CTX_set_quic_method(ssl_ctx.get(), &kSslQuicMethod);
+ if (cert_verify_mode != SSL_VERIFY_NONE) {
+ SSL_CTX_set_custom_verify(ssl_ctx.get(), cert_verify_mode, &VerifyCallback);
+ }
return ssl_ctx;
}
@@ -108,6 +111,12 @@ TlsConnection* TlsConnection::ConnectionFromSsl(const SSL* ssl) {
ssl, SslIndexSingleton::GetInstance()->ssl_ex_data_index_connection()));
}
+// static
+enum ssl_verify_result_t TlsConnection::VerifyCallback(SSL* ssl,
+ uint8_t* out_alert) {
+ return ConnectionFromSsl(ssl)->delegate_->VerifyCert(out_alert);
+}
+
const SSL_QUIC_METHOD TlsConnection::kSslQuicMethod{
TlsConnection::SetReadSecretCallback, TlsConnection::SetWriteSecretCallback,
TlsConnection::WriteMessageCallback, TlsConnection::FlushFlightCallback,
@@ -151,7 +160,7 @@ int TlsConnection::WriteMessageCallback(SSL* ssl,
size_t len) {
ConnectionFromSsl(ssl)->delegate_->WriteMessage(
QuicEncryptionLevel(level),
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(data), len));
+ absl::string_view(reinterpret_cast<const char*>(data), len));
return 1;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.h b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.h
index 15a4f4f9a3a..037e4b03f1e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_connection.h
@@ -7,9 +7,9 @@
#include <vector>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -31,6 +31,16 @@ class QUIC_EXPORT_PRIVATE TlsConnection {
virtual ~Delegate() {}
protected:
+ // Certificate management functions:
+
+ // Verifies the peer's certificate chain. It may use
+ // SSL_get0_peer_certificates to get the cert chain. This method returns
+ // ssl_verify_ok if the cert is valid, ssl_verify_invalid if it is invalid,
+ // or ssl_verify_retry if verification is happening asynchronously.
+ virtual enum ssl_verify_result_t VerifyCert(uint8_t* out_alert) = 0;
+
+ // QUIC-TLS interface functions:
+
// SetWriteSecret provides the encryption secret used to encrypt messages at
// encryption level |level|. The secret provided here is the one from the
// TLS 1.3 key schedule (RFC 8446 section 7.1), in particular the handshake
@@ -53,7 +63,7 @@ class QUIC_EXPORT_PRIVATE TlsConnection {
// the QUIC stack to write in a crypto frame. The data must be transmitted
// at encryption level |level|.
virtual void WriteMessage(EncryptionLevel level,
- quiche::QuicheStringPiece data) = 0;
+ absl::string_view data) = 0;
// FlushFlight is called to signal that the current flight of messages have
// all been written (via calls to WriteMessage) and can be flushed to the
@@ -87,7 +97,12 @@ class QUIC_EXPORT_PRIVATE TlsConnection {
// Creates an SSL_CTX and configures it with the options that are appropriate
// for both client and server. The caller is responsible for ownership of the
// newly created struct.
- static bssl::UniquePtr<SSL_CTX> CreateSslCtx();
+ //
+ // The provided |cert_verify_mode| is passed in as the |mode| argument for
+ // |SSL_CTX_set_verify|. See
+ // https://commondatastorage.googleapis.com/chromium-boringssl-docs/ssl.h.html#SSL_VERIFY_NONE
+ // for a description of possible values.
+ static bssl::UniquePtr<SSL_CTX> CreateSslCtx(int cert_verify_mode);
// From a given SSL* |ssl|, returns a pointer to the TlsConnection that it
// belongs to. This helper method allows the callbacks set in BoringSSL to be
@@ -96,6 +111,10 @@ class QUIC_EXPORT_PRIVATE TlsConnection {
static TlsConnection* ConnectionFromSsl(const SSL* ssl);
private:
+ // Registered as the callback for SSL_CTX_set_custom_verify. The
+ // implementation is delegated to Delegate::VerifyCert.
+ static enum ssl_verify_result_t VerifyCallback(SSL* ssl, uint8_t* out_alert);
+
// TlsConnection implements SSL_QUIC_METHOD, which provides the interface
// between BoringSSL's TLS stack and a QUIC implementation.
static const SSL_QUIC_METHOD kSslQuicMethod;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.cc
index c821a388748..f47e5ad7258 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/quic/core/crypto/tls_server_connection.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -18,20 +18,27 @@ TlsServerConnection::TlsServerConnection(SSL_CTX* ssl_ctx, Delegate* delegate)
// static
bssl::UniquePtr<SSL_CTX> TlsServerConnection::CreateSslCtx(
ProofSource* proof_source) {
- bssl::UniquePtr<SSL_CTX> ssl_ctx = TlsConnection::CreateSslCtx();
+ bssl::UniquePtr<SSL_CTX> ssl_ctx =
+ TlsConnection::CreateSslCtx(SSL_VERIFY_NONE);
SSL_CTX_set_tlsext_servername_callback(ssl_ctx.get(),
&SelectCertificateCallback);
SSL_CTX_set_alpn_select_cb(ssl_ctx.get(), &SelectAlpnCallback, nullptr);
// We don't actually need the TicketCrypter here, but we need to know
// whether it's set.
if (proof_source->GetTicketCrypter()) {
+ QUIC_RESTART_FLAG_COUNT_N(quic_session_tickets_always_enabled, 1, 3);
SSL_CTX_set_ticket_aead_method(ssl_ctx.get(),
&TlsServerConnection::kSessionTicketMethod);
- if (GetQuicRestartFlag(quic_enable_zero_rtt_for_tls_v2)) {
- SSL_CTX_set_early_data_enabled(ssl_ctx.get(), 1);
- }
- } else {
+ } else if (!GetQuicRestartFlag(quic_session_tickets_always_enabled)) {
+ QUIC_RESTART_FLAG_COUNT_N(quic_session_tickets_always_enabled, 2, 3);
SSL_CTX_set_options(ssl_ctx.get(), SSL_OP_NO_TICKET);
+ } else {
+ QUIC_RESTART_FLAG_COUNT_N(quic_session_tickets_always_enabled, 3, 3);
+ }
+ if (GetQuicRestartFlag(quic_enable_zero_rtt_for_tls_v2) &&
+ (proof_source->GetTicketCrypter() ||
+ GetQuicRestartFlag(quic_session_tickets_always_enabled))) {
+ SSL_CTX_set_early_data_enabled(ssl_ctx.get(), 1);
}
return ssl_ctx;
}
@@ -82,7 +89,7 @@ ssl_private_key_result_t TlsServerConnection::PrivateKeySign(SSL* ssl,
size_t in_len) {
return ConnectionFromSsl(ssl)->delegate_->PrivateKeySign(
out, out_len, max_out, sig_alg,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(in), in_len));
+ absl::string_view(reinterpret_cast<const char*>(in), in_len));
}
// static
@@ -116,7 +123,7 @@ int TlsServerConnection::SessionTicketSeal(SSL* ssl,
size_t in_len) {
return ConnectionFromSsl(ssl)->delegate_->SessionTicketSeal(
out, out_len, max_out_len,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(in), in_len));
+ absl::string_view(reinterpret_cast<const char*>(in), in_len));
}
// static
@@ -129,7 +136,7 @@ enum ssl_ticket_aead_result_t TlsServerConnection::SessionTicketOpen(
size_t in_len) {
return ConnectionFromSsl(ssl)->delegate_->SessionTicketOpen(
out, out_len, max_out_len,
- quiche::QuicheStringPiece(reinterpret_cast<const char*>(in), in_len));
+ absl::string_view(reinterpret_cast<const char*>(in), in_len));
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.h b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.h
index 6da81141335..954f8303163 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/tls_server_connection.h
@@ -5,9 +5,9 @@
#ifndef QUICHE_QUIC_CORE_CRYPTO_TLS_SERVER_CONNECTION_H_
#define QUICHE_QUIC_CORE_CRYPTO_TLS_SERVER_CONNECTION_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h"
#include "net/third_party/quiche/src/quic/core/crypto/tls_connection.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -43,12 +43,11 @@ class QUIC_EXPORT_PRIVATE TlsServerConnection : public TlsConnection {
// ssl_private_key_failure is returned. Otherwise, ssl_private_key_success
// is returned with the signature put in |*out| and the length in
// |*out_len|.
- virtual ssl_private_key_result_t PrivateKeySign(
- uint8_t* out,
- size_t* out_len,
- size_t max_out,
- uint16_t sig_alg,
- quiche::QuicheStringPiece in) = 0;
+ virtual ssl_private_key_result_t PrivateKeySign(uint8_t* out,
+ size_t* out_len,
+ size_t max_out,
+ uint16_t sig_alg,
+ absl::string_view in) = 0;
// When PrivateKeySign returns ssl_private_key_retry, PrivateKeyComplete
// will be called after the async sign operation has completed.
@@ -76,7 +75,7 @@ class QUIC_EXPORT_PRIVATE TlsServerConnection : public TlsConnection {
virtual int SessionTicketSeal(uint8_t* out,
size_t* out_len,
size_t max_out_len,
- quiche::QuicheStringPiece in) = 0;
+ absl::string_view in) = 0;
// SessionTicketOpen is called when BoringSSL has an encrypted session
// ticket |in| and wants the ticket decrypted. This decryption operation can
@@ -102,7 +101,7 @@ class QUIC_EXPORT_PRIVATE TlsServerConnection : public TlsConnection {
uint8_t* out,
size_t* out_len,
size_t max_out_len,
- quiche::QuicheStringPiece in) = 0;
+ absl::string_view in) = 0;
// Provides the delegate for callbacks that are shared between client and
// server.
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc
index 71a9dfb8bad..c047e0ff143 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.cc
@@ -10,6 +10,8 @@
#include <memory>
#include <utility>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/digest.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
@@ -20,7 +22,6 @@
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -210,7 +211,7 @@ bool WriteTransportParameterLength(QuicDataWriter* writer,
}
bool WriteTransportParameterStringPiece(QuicDataWriter* writer,
- quiche::QuicheStringPiece value,
+ absl::string_view value,
ParsedQuicVersion version) {
if (version.HasVarIntTransportParams()) {
return writer->WriteStringPieceVarInt62(value);
@@ -240,10 +241,9 @@ bool ReadTransportParameterId(
return true;
}
-bool ReadTransportParameterLengthAndValue(
- QuicDataReader* reader,
- ParsedQuicVersion version,
- quiche::QuicheStringPiece* out_value) {
+bool ReadTransportParameterLengthAndValue(QuicDataReader* reader,
+ ParsedQuicVersion version,
+ absl::string_view* out_value) {
if (version.HasVarIntTransportParams()) {
return reader->ReadStringPieceVarInt62(out_value);
}
@@ -395,9 +395,9 @@ std::string TransportParameters::PreferredAddress::ToString() const {
return "[" + ipv4_socket_address.ToString() + " " +
ipv6_socket_address.ToString() + " connection_id " +
connection_id.ToString() + " stateless_reset_token " +
- quiche::QuicheTextUtils::HexEncode(
+ absl::BytesToHexString(absl::string_view(
reinterpret_cast<const char*>(stateless_reset_token.data()),
- stateless_reset_token.size()) +
+ stateless_reset_token.size())) +
"]";
}
@@ -427,9 +427,9 @@ std::string TransportParameters::ToString() const {
rv += max_idle_timeout_ms.ToString(/*for_use_in_list=*/true);
if (!stateless_reset_token.empty()) {
rv += " " + TransportParameterIdToString(kStatelessResetToken) + " " +
- quiche::QuicheTextUtils::HexEncode(
+ absl::BytesToHexString(absl::string_view(
reinterpret_cast<const char*>(stateless_reset_token.data()),
- stateless_reset_token.size());
+ stateless_reset_token.size()));
}
rv += max_udp_payload_size.ToString(/*for_use_in_list=*/true);
rv += initial_max_data.ToString(/*for_use_in_list=*/true);
@@ -486,11 +486,10 @@ std::string TransportParameters::ToString() const {
rv += "=";
static constexpr size_t kMaxPrintableLength = 32;
if (kv.second.length() <= kMaxPrintableLength) {
- rv += quiche::QuicheTextUtils::HexEncode(kv.second);
+ rv += absl::BytesToHexString(kv.second);
} else {
- quiche::QuicheStringPiece truncated(kv.second.data(),
- kMaxPrintableLength);
- rv += quiche::QuicheStrCat(quiche::QuicheTextUtils::HexEncode(truncated),
+ absl::string_view truncated(kv.second.data(), kMaxPrintableLength);
+ rv += quiche::QuicheStrCat(absl::BytesToHexString(truncated),
"...(length ", kv.second.length(), ")");
}
}
@@ -813,9 +812,8 @@ bool SerializeTransportParameters(ParsedQuicVersion version,
version) ||
!WriteTransportParameterStringPiece(
&writer,
- quiche::QuicheStringPiece(
- original_destination_connection_id.data(),
- original_destination_connection_id.length()),
+ absl::string_view(original_destination_connection_id.data(),
+ original_destination_connection_id.length()),
version)) {
QUIC_BUG << "Failed to write original_destination_connection_id "
<< original_destination_connection_id << " for " << in;
@@ -836,7 +834,7 @@ bool SerializeTransportParameters(ParsedQuicVersion version,
&writer, TransportParameters::kStatelessResetToken, version) ||
!WriteTransportParameterStringPiece(
&writer,
- quiche::QuicheStringPiece(
+ absl::string_view(
reinterpret_cast<const char*>(in.stateless_reset_token.data()),
in.stateless_reset_token.size()),
version)) {
@@ -919,8 +917,8 @@ bool SerializeTransportParameters(ParsedQuicVersion version,
version) ||
!WriteTransportParameterStringPiece(
&writer,
- quiche::QuicheStringPiece(initial_source_connection_id.data(),
- initial_source_connection_id.length()),
+ absl::string_view(initial_source_connection_id.data(),
+ initial_source_connection_id.length()),
version)) {
QUIC_BUG << "Failed to write initial_source_connection_id "
<< initial_source_connection_id << " for " << in;
@@ -937,8 +935,8 @@ bool SerializeTransportParameters(ParsedQuicVersion version,
&writer, TransportParameters::kRetrySourceConnectionId, version) ||
!WriteTransportParameterStringPiece(
&writer,
- quiche::QuicheStringPiece(retry_source_connection_id.data(),
- retry_source_connection_id.length()),
+ absl::string_view(retry_source_connection_id.data(),
+ retry_source_connection_id.length()),
version)) {
QUIC_BUG << "Failed to write retry_source_connection_id "
<< retry_source_connection_id << " for " << in;
@@ -1079,7 +1077,7 @@ bool SerializeTransportParameters(ParsedQuicVersion version,
random->RandBytes(grease_contents, grease_length);
if (!WriteTransportParameterId(&writer, grease_id, version) ||
!WriteTransportParameterStringPiece(
- &writer, quiche::QuicheStringPiece(grease_contents, grease_length),
+ &writer, absl::string_view(grease_contents, grease_length),
version)) {
QUIC_BUG << "Failed to write GREASE parameter "
<< TransportParameterIdToString(grease_id);
@@ -1141,7 +1139,7 @@ bool ParseTransportParameters(ParsedQuicVersion version,
*error_details = "Failed to parse transport parameter ID";
return false;
}
- quiche::QuicheStringPiece value;
+ absl::string_view value;
if (!ReadTransportParameterLengthAndValue(&reader, version, &value)) {
*error_details =
"Failed to read length and value of transport parameter " +
@@ -1183,7 +1181,7 @@ bool ParseTransportParameters(ParsedQuicVersion version,
*error_details = "Received a second stateless_reset_token";
return false;
}
- quiche::QuicheStringPiece stateless_reset_token =
+ absl::string_view stateless_reset_token =
value_reader.ReadRemainingPayload();
if (stateless_reset_token.length() != kStatelessResetTokenLength) {
*error_details = quiche::QuicheStrCat(
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.h b/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.h
index bf8c6076b81..8c7970c29d5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.h
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters.h
@@ -8,6 +8,8 @@
#include <memory>
#include <vector>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
@@ -16,8 +18,6 @@
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -133,7 +133,7 @@ struct QUIC_EXPORT_PRIVATE TransportParameters {
// The value of the Destination Connection ID field from the first
// Initial packet sent by the client.
- quiche::QuicheOptional<QuicConnectionId> original_destination_connection_id;
+ absl::optional<QuicConnectionId> original_destination_connection_id;
// Maximum idle timeout expressed in milliseconds.
IntegerParameter max_idle_timeout_ms;
@@ -187,11 +187,11 @@ struct QUIC_EXPORT_PRIVATE TransportParameters {
// The value that the endpoint included in the Source Connection ID field of
// the first Initial packet it sent.
- quiche::QuicheOptional<QuicConnectionId> initial_source_connection_id;
+ absl::optional<QuicConnectionId> initial_source_connection_id;
// The value that the server included in the Source Connection ID field of a
// Retry packet it sent.
- quiche::QuicheOptional<QuicConnectionId> retry_source_connection_id;
+ absl::optional<QuicConnectionId> retry_source_connection_id;
// Indicates support for the DATAGRAM frame and the maximum frame size that
// the sender accepts. See draft-ietf-quic-datagram.
@@ -202,10 +202,10 @@ struct QUIC_EXPORT_PRIVATE TransportParameters {
IntegerParameter initial_round_trip_time_us;
// Google-specific connection options.
- quiche::QuicheOptional<QuicTagVector> google_connection_options;
+ absl::optional<QuicTagVector> google_connection_options;
// Google-specific user agent identifier.
- quiche::QuicheOptional<std::string> user_agent_id;
+ absl::optional<std::string> user_agent_id;
// Google-specific handshake done support. This is only used for T050.
bool support_handshake_done;
diff --git a/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters_test.cc b/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters_test.cc
index 0578e290de1..ab8360eabca 100644
--- a/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/crypto/transport_parameters_test.cc
@@ -7,6 +7,8 @@
#include <cstring>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_tag.h"
@@ -16,8 +18,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -202,7 +202,7 @@ TEST_P(TransportParametersTest, Comparator) {
// Test comparison on connection IDs.
orig_params.initial_source_connection_id =
CreateFakeInitialSourceConnectionId();
- new_params.initial_source_connection_id = QUICHE_NULLOPT;
+ new_params.initial_source_connection_id = absl::nullopt;
EXPECT_NE(orig_params, new_params);
EXPECT_FALSE(orig_params == new_params);
EXPECT_TRUE(orig_params != new_params);
@@ -627,10 +627,10 @@ TEST_P(TransportParametersTest, ParseClientParams) {
// clang-format on
const uint8_t* client_params =
reinterpret_cast<const uint8_t*>(kClientParams);
- size_t client_params_length = QUICHE_ARRAYSIZE(kClientParams);
+ size_t client_params_length = ABSL_ARRAYSIZE(kClientParams);
if (!version_.HasVarIntTransportParams()) {
client_params = reinterpret_cast<const uint8_t*>(kClientParamsOld);
- client_params_length = QUICHE_ARRAYSIZE(kClientParamsOld);
+ client_params_length = ABSL_ARRAYSIZE(kClientParamsOld);
}
TransportParameters new_params;
std::string error_details;
@@ -724,11 +724,11 @@ TEST_P(TransportParametersTest,
// clang-format on
const uint8_t* client_params =
reinterpret_cast<const uint8_t*>(kClientParamsWithFullToken);
- size_t client_params_length = QUICHE_ARRAYSIZE(kClientParamsWithFullToken);
+ size_t client_params_length = ABSL_ARRAYSIZE(kClientParamsWithFullToken);
if (!version_.HasVarIntTransportParams()) {
client_params =
reinterpret_cast<const uint8_t*>(kClientParamsWithFullTokenOld);
- client_params_length = QUICHE_ARRAYSIZE(kClientParamsWithFullTokenOld);
+ client_params_length = ABSL_ARRAYSIZE(kClientParamsWithFullTokenOld);
}
TransportParameters out_params;
std::string error_details;
@@ -779,11 +779,11 @@ TEST_P(TransportParametersTest,
// clang-format on
const uint8_t* client_params =
reinterpret_cast<const uint8_t*>(kClientParamsWithEmptyToken);
- size_t client_params_length = QUICHE_ARRAYSIZE(kClientParamsWithEmptyToken);
+ size_t client_params_length = ABSL_ARRAYSIZE(kClientParamsWithEmptyToken);
if (!version_.HasVarIntTransportParams()) {
client_params =
reinterpret_cast<const uint8_t*>(kClientParamsWithEmptyTokenOld);
- client_params_length = QUICHE_ARRAYSIZE(kClientParamsWithEmptyTokenOld);
+ client_params_length = ABSL_ARRAYSIZE(kClientParamsWithEmptyTokenOld);
}
TransportParameters out_params;
std::string error_details;
@@ -828,10 +828,10 @@ TEST_P(TransportParametersTest, ParseClientParametersRepeated) {
// clang-format on
const uint8_t* client_params =
reinterpret_cast<const uint8_t*>(kClientParamsRepeated);
- size_t client_params_length = QUICHE_ARRAYSIZE(kClientParamsRepeated);
+ size_t client_params_length = ABSL_ARRAYSIZE(kClientParamsRepeated);
if (!version_.HasVarIntTransportParams()) {
client_params = reinterpret_cast<const uint8_t*>(kClientParamsRepeatedOld);
- client_params_length = QUICHE_ARRAYSIZE(kClientParamsRepeatedOld);
+ client_params_length = ABSL_ARRAYSIZE(kClientParamsRepeatedOld);
}
TransportParameters out_params;
std::string error_details;
@@ -1049,10 +1049,10 @@ TEST_P(TransportParametersTest, ParseServerParams) {
// clang-format on
const uint8_t* server_params =
reinterpret_cast<const uint8_t*>(kServerParams);
- size_t server_params_length = QUICHE_ARRAYSIZE(kServerParams);
+ size_t server_params_length = ABSL_ARRAYSIZE(kServerParams);
if (!version_.HasVarIntTransportParams()) {
server_params = reinterpret_cast<const uint8_t*>(kServerParamsOld);
- server_params_length = QUICHE_ARRAYSIZE(kServerParamsOld);
+ server_params_length = ABSL_ARRAYSIZE(kServerParamsOld);
}
TransportParameters new_params;
std::string error_details;
@@ -1158,10 +1158,10 @@ TEST_P(TransportParametersTest, ParseServerParametersRepeated) {
// clang-format on
const uint8_t* server_params =
reinterpret_cast<const uint8_t*>(kServerParamsRepeated);
- size_t server_params_length = QUICHE_ARRAYSIZE(kServerParamsRepeated);
+ size_t server_params_length = ABSL_ARRAYSIZE(kServerParamsRepeated);
if (!version_.HasVarIntTransportParams()) {
server_params = reinterpret_cast<const uint8_t*>(kServerParamsRepeatedOld);
- server_params_length = QUICHE_ARRAYSIZE(kServerParamsRepeatedOld);
+ server_params_length = ABSL_ARRAYSIZE(kServerParamsRepeatedOld);
}
TransportParameters out_params;
std::string error_details;
@@ -1207,12 +1207,12 @@ TEST_P(TransportParametersTest,
const uint8_t* server_params =
reinterpret_cast<const uint8_t*>(kServerParamsEmptyOriginalConnectionId);
size_t server_params_length =
- QUICHE_ARRAYSIZE(kServerParamsEmptyOriginalConnectionId);
+ ABSL_ARRAYSIZE(kServerParamsEmptyOriginalConnectionId);
if (!version_.HasVarIntTransportParams()) {
server_params = reinterpret_cast<const uint8_t*>(
kServerParamsEmptyOriginalConnectionIdOld);
server_params_length =
- QUICHE_ARRAYSIZE(kServerParamsEmptyOriginalConnectionIdOld);
+ ABSL_ARRAYSIZE(kServerParamsEmptyOriginalConnectionIdOld);
}
TransportParameters out_params;
std::string error_details;
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_ack_frame.h b/chromium/net/third_party/quiche/src/quic/core/frames/quic_ack_frame.h
index 69023404db3..e69cbbed9a0 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_ack_frame.h
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_ack_frame.h
@@ -29,9 +29,9 @@ class QUIC_EXPORT_PRIVATE PacketNumberQueue {
PacketNumberQueue& operator=(const PacketNumberQueue& other);
PacketNumberQueue& operator=(PacketNumberQueue&& other);
- typedef QuicIntervalSet<QuicPacketNumber>::const_iterator const_iterator;
- typedef QuicIntervalSet<QuicPacketNumber>::const_reverse_iterator
- const_reverse_iterator;
+ using const_iterator = QuicIntervalSet<QuicPacketNumber>::const_iterator;
+ using const_reverse_iterator =
+ QuicIntervalSet<QuicPacketNumber>::const_reverse_iterator;
// Adds |packet_number| to the set of packets in the queue.
void Add(QuicPacketNumber packet_number);
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.cc b/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.cc
index bef5f286d23..e804f273521 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -16,7 +16,7 @@ QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
QuicStreamOffset offset,
- quiche::QuicheStringPiece data)
+ absl::string_view data)
: QuicCryptoFrame(level, offset, data.data(), data.length()) {}
QuicCryptoFrame::QuicCryptoFrame(EncryptionLevel level,
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h b/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h
index 2bb7a08d68a..a8f0fe3733f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h
@@ -8,10 +8,10 @@
#include <memory>
#include <ostream>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -22,7 +22,7 @@ struct QUIC_EXPORT_PRIVATE QuicCryptoFrame {
QuicPacketLength data_length);
QuicCryptoFrame(EncryptionLevel level,
QuicStreamOffset offset,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
~QuicCryptoFrame();
friend QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_frame.h b/chromium/net/third_party/quiche/src/quic/core/frames/quic_frame.h
index 6e096e3d91c..505f562b7c8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_frame.h
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_frame.h
@@ -133,7 +133,7 @@ static_assert(offsetof(QuicStreamFrame, type) == offsetof(QuicFrame, type),
// A inline size of 1 is chosen to optimize the typical use case of
// 1-stream-frame in QuicTransmissionInfo.retransmittable_frames.
-typedef QuicInlinedVector<QuicFrame, 1> QuicFrames;
+using QuicFrames = QuicInlinedVector<QuicFrame, 1>;
// Deletes all the sub-frames contained in |frames|.
QUIC_EXPORT_PRIVATE void DeleteFrames(QuicFrames* frames);
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_message_frame.h b/chromium/net/third_party/quiche/src/quic/core/frames/quic_message_frame.h
index 7f0179c95a9..68fbf2201ad 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_message_frame.h
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_message_frame.h
@@ -13,7 +13,7 @@
namespace quic {
-typedef QuicInlinedVector<QuicMemSlice, 1> QuicMessageData;
+using QuicMessageData = QuicInlinedVector<QuicMemSlice, 1>;
struct QUIC_EXPORT_PRIVATE QuicMessageFrame {
QuicMessageFrame() = default;
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_new_token_frame.cc b/chromium/net/third_party/quiche/src/quic/core/frames/quic_new_token_frame.cc
index 0178422526c..6806cda221f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_new_token_frame.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_new_token_frame.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/core/frames/quic_new_token_frame.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
@@ -15,7 +16,7 @@ QuicNewTokenFrame::QuicNewTokenFrame(QuicControlFrameId control_frame_id,
std::ostream& operator<<(std::ostream& os, const QuicNewTokenFrame& s) {
os << "{ control_frame_id: " << s.control_frame_id
- << ", token: " << quiche::QuicheTextUtils::HexEncode(s.token) << " }\n";
+ << ", token: " << absl::BytesToHexString(s.token) << " }\n";
return os;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.cc b/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.cc
index 4a8d1207b73..eb841b26ddc 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
@@ -21,9 +22,9 @@ QuicPathChallengeFrame::~QuicPathChallengeFrame() {}
std::ostream& operator<<(std::ostream& os,
const QuicPathChallengeFrame& frame) {
os << "{ control_frame_id: " << frame.control_frame_id << ", data: "
- << quiche::QuicheTextUtils::HexEncode(
+ << absl::BytesToHexString(absl::string_view(
reinterpret_cast<const char*>(frame.data_buffer.data()),
- frame.data_buffer.size())
+ frame.data_buffer.size()))
<< " }\n";
return os;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_response_frame.cc b/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_response_frame.cc
index 4779c6ad25f..1623777b0e6 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_response_frame.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_path_response_frame.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/core/frames/quic_path_response_frame.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
@@ -20,9 +21,9 @@ QuicPathResponseFrame::~QuicPathResponseFrame() {}
std::ostream& operator<<(std::ostream& os, const QuicPathResponseFrame& frame) {
os << "{ control_frame_id: " << frame.control_frame_id << ", data: "
- << quiche::QuicheTextUtils::HexEncode(
+ << absl::BytesToHexString(absl::string_view(
reinterpret_cast<const char*>(frame.data_buffer.data()),
- frame.data_buffer.size())
+ frame.data_buffer.size()))
<< " }\n";
return os;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.cc b/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.cc
index db199998860..728d320e3ac 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -14,7 +14,7 @@ QuicStreamFrame::QuicStreamFrame() : QuicInlinedFrame(STREAM_FRAME) {}
QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id,
bool fin,
QuicStreamOffset offset,
- quiche::QuicheStringPiece data)
+ absl::string_view data)
: QuicStreamFrame(stream_id, fin, offset, data.data(), data.length()) {}
QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id,
diff --git a/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h b/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h
index 10ad7db1025..32b2c7404bf 100644
--- a/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h
+++ b/chromium/net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h
@@ -8,11 +8,11 @@
#include <memory>
#include <ostream>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_inlined_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -22,7 +22,7 @@ struct QUIC_EXPORT_PRIVATE QuicStreamFrame
QuicStreamFrame(QuicStreamId stream_id,
bool fin,
QuicStreamOffset offset,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
QuicStreamFrame(QuicStreamId stream_id,
bool fin,
QuicStreamOffset offset,
diff --git a/chromium/net/third_party/quiche/src/quic/core/handshaker_delegate_interface.h b/chromium/net/third_party/quiche/src/quic/core/handshaker_delegate_interface.h
index 5103509d06e..a8e5e968ab3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/handshaker_delegate_interface.h
+++ b/chromium/net/third_party/quiche/src/quic/core/handshaker_delegate_interface.h
@@ -71,6 +71,9 @@ class QUIC_EXPORT_PRIVATE HandshakerDelegateInterface {
const TransportParameters& params,
bool is_resumption,
std::string* error_details) = 0;
+
+ // Called at the end of an handshake operation callback.
+ virtual void OnHandshakeCallbackDone() = 0;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/end_to_end_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/end_to_end_test.cc
index 7a0bd9a7823..6b188fcf38d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/end_to_end_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/end_to_end_test.cc
@@ -11,6 +11,7 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h"
@@ -65,7 +66,6 @@
#include "net/third_party/quiche/src/quic/tools/quic_simple_client_stream.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using spdy::kV3LowestPriority;
@@ -465,9 +465,9 @@ class EndToEndTest : public QuicTestWithParam<TestParams> {
}
}
- void AddToCache(quiche::QuicheStringPiece path,
+ void AddToCache(absl::string_view path,
int response_code,
- quiche::QuicheStringPiece body) {
+ absl::string_view body) {
memory_cache_backend_.AddSimpleResponse(server_hostname_, path,
response_code, body);
}
@@ -1498,6 +1498,48 @@ TEST_P(EndToEndTest, LargePostZeroRTTFailure) {
VerifyCleanConnection(false);
}
+// Regression test for b/168020146.
+// TODO(renjietang): Reenable this test in Chrome once the BoringSSL fix is
+// rolled in.
+TEST_P(EndToEndTest, QUIC_TEST_DISABLED_IN_CHROME(MultipleZeroRtt)) {
+ ASSERT_TRUE(Initialize());
+
+ EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
+ QuicSpdyClientSession* client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ EXPECT_FALSE(client_session->ReceivedInchoateReject());
+ EXPECT_FALSE(client_->client()->EarlyDataAccepted());
+ EXPECT_FALSE(client_->client()->ReceivedInchoateReject());
+
+ client_->Disconnect();
+
+ // The 0-RTT handshake should succeed.
+ client_->Connect();
+ EXPECT_TRUE(client_->client()->WaitForOneRttKeysAvailable());
+ ASSERT_TRUE(client_->client()->connected());
+ EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_TRUE(client_session->EarlyDataAccepted());
+ EXPECT_TRUE(client_->client()->EarlyDataAccepted());
+
+ client_->Disconnect();
+
+ client_->Connect();
+ EXPECT_TRUE(client_->client()->WaitForOneRttKeysAvailable());
+ ASSERT_TRUE(client_->client()->connected());
+ EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_TRUE(client_session->EarlyDataAccepted());
+ EXPECT_TRUE(client_->client()->EarlyDataAccepted());
+
+ client_->Disconnect();
+}
+
TEST_P(EndToEndTest, SynchronousRequestZeroRTTFailure) {
// Send a request and then disconnect. This prepares the client to attempt
// a 0-RTT handshake for the next request.
@@ -1998,13 +2040,13 @@ TEST_P(EndToEndTest, SetIndependentMaxDynamicStreamsLimits) {
// count.
size_t client_max_open_outgoing_bidirectional_streams =
version_.HasIetfQuicFrames()
- ? QuicSessionPeer::v99_streamid_manager(client_session)
+ ? QuicSessionPeer::ietf_streamid_manager(client_session)
->max_outgoing_bidirectional_streams()
: QuicSessionPeer::GetStreamIdManager(client_session)
->max_open_outgoing_streams();
size_t client_max_open_outgoing_unidirectional_streams =
version_.HasIetfQuicFrames()
- ? QuicSessionPeer::v99_streamid_manager(client_session)
+ ? QuicSessionPeer::ietf_streamid_manager(client_session)
->max_outgoing_unidirectional_streams() -
kHttp3StaticUnidirectionalStreamCount
: QuicSessionPeer::GetStreamIdManager(client_session)
@@ -2018,13 +2060,13 @@ TEST_P(EndToEndTest, SetIndependentMaxDynamicStreamsLimits) {
if (server_session != nullptr) {
size_t server_max_open_outgoing_bidirectional_streams =
version_.HasIetfQuicFrames()
- ? QuicSessionPeer::v99_streamid_manager(server_session)
+ ? QuicSessionPeer::ietf_streamid_manager(server_session)
->max_outgoing_bidirectional_streams()
: QuicSessionPeer::GetStreamIdManager(server_session)
->max_open_outgoing_streams();
size_t server_max_open_outgoing_unidirectional_streams =
version_.HasIetfQuicFrames()
- ? QuicSessionPeer::v99_streamid_manager(server_session)
+ ? QuicSessionPeer::ietf_streamid_manager(server_session)
->max_outgoing_unidirectional_streams() -
kHttp3StaticUnidirectionalStreamCount
: QuicSessionPeer::GetStreamIdManager(server_session)
@@ -2135,6 +2177,41 @@ TEST_P(EndToEndTest, ClientSuggestsIgnoredRTT) {
server_thread_->Resume();
}
+// Regression test for b/171378845
+TEST_P(EndToEndTest, ClientDisablesGQuicZeroRtt) {
+ if (version_.UsesTls()) {
+ // This feature is gQUIC only.
+ ASSERT_TRUE(Initialize());
+ return;
+ }
+ QuicTagVector options;
+ options.push_back(kQNZ2);
+ client_config_.SetClientConnectionOptions(options);
+
+ ASSERT_TRUE(Initialize());
+
+ EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
+ QuicSpdyClientSession* client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ EXPECT_FALSE(client_session->ReceivedInchoateReject());
+ EXPECT_FALSE(client_->client()->EarlyDataAccepted());
+ EXPECT_FALSE(client_->client()->ReceivedInchoateReject());
+
+ client_->Disconnect();
+
+ // Make sure that the request succeeds but 0-RTT was not used.
+ client_->Connect();
+ EXPECT_TRUE(client_->client()->WaitForOneRttKeysAvailable());
+ ASSERT_TRUE(client_->client()->connected());
+ EXPECT_EQ(kFooResponseBody, client_->SendSynchronousRequest("/foo"));
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ EXPECT_FALSE(client_->client()->EarlyDataAccepted());
+}
+
TEST_P(EndToEndTest, MaxInitialRTT) {
// Client tries to suggest twice the server's max initial rtt and the server
// uses the max.
@@ -2160,17 +2237,10 @@ TEST_P(EndToEndTest, MaxInitialRTT) {
client_sent_packet_manager->GetRttStats()->smoothed_rtt().IsInfinite());
const RttStats* server_rtt_stats =
server_sent_packet_manager->GetRttStats();
- if (GetQuicReloadableFlag(quic_cap_large_client_initial_rtt)) {
- EXPECT_EQ(static_cast<int64_t>(1 * kNumMicrosPerSecond),
- server_rtt_stats->initial_rtt().ToMicroseconds());
- EXPECT_GE(static_cast<int64_t>(1 * kNumMicrosPerSecond),
- server_rtt_stats->smoothed_rtt().ToMicroseconds());
- } else {
- EXPECT_EQ(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
- server_rtt_stats->initial_rtt().ToMicroseconds());
- EXPECT_GE(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
- server_rtt_stats->smoothed_rtt().ToMicroseconds());
- }
+ EXPECT_EQ(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
+ server_rtt_stats->initial_rtt().ToMicroseconds());
+ EXPECT_GE(static_cast<int64_t>(kMaxInitialRoundTripTimeUs),
+ server_rtt_stats->smoothed_rtt().ToMicroseconds());
} else {
ADD_FAILURE() << "Missing sent packet manager";
}
@@ -2311,7 +2381,19 @@ TEST_P(EndToEndTest, StreamCancelErrorTest) {
// Transmit the cancel, and ensure the connection is torn down properly.
SetPacketLossPercentage(0);
QuicStreamId stream_id = GetNthClientInitiatedBidirectionalId(0);
+ QuicConnection* client_connection = GetClientConnection();
+ ASSERT_TRUE(client_connection);
+ const QuicPacketCount packets_sent_before =
+ client_connection->GetStats().packets_sent;
session->ResetStream(stream_id, QUIC_STREAM_CANCELLED);
+ const QuicPacketCount packets_sent_now =
+ client_connection->GetStats().packets_sent;
+
+ if (version_.UsesHttp3() && GetQuicReloadableFlag(quic_split_up_send_rst_2)) {
+ // Make sure 2 packets were sent, one for QPACK instructions, another for
+ // RESET_STREAM and STOP_SENDING.
+ EXPECT_EQ(packets_sent_before + 2, packets_sent_now);
+ }
// WaitForEvents waits 50ms and returns true if there are outstanding
// requests.
@@ -3878,21 +3960,17 @@ TEST_P(EndToEndTest, ReleaseHeadersStreamBufferWhenIdle) {
EXPECT_FALSE(QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
}
+// A single large header value causes a different error than the total size of
+// headers exceeding a smaller limit, tested at EndToEndTest.LargeHeaders.
TEST_P(EndToEndTest, WayTooLongRequestHeaders) {
ASSERT_TRUE(Initialize());
- if (version_.UsesTls() && !version_.UsesHttp3()) {
- // In T050, it took relatively long time for HPACK to compress the header
- // while server will detect blackhole on NST message.
- // TODO(b/157248143): remove this when the HPACK compression issue is
- // understood.
- return;
- }
+
SpdyHeaderBlock headers;
headers[":method"] = "GET";
headers[":path"] = "/foo";
headers[":scheme"] = "https";
headers[":authority"] = server_hostname_;
- headers["key"] = std::string(64 * 1024 * 1024, 'a');
+ headers["key"] = std::string(2 * 1024 * 1024, 'a');
client_->SendMessage(headers, "");
client_->WaitForResponse();
@@ -4248,7 +4326,7 @@ TEST_P(EndToEndTest, SendMessages) {
ASSERT_LT(0, client_session->GetCurrentLargestMessagePayload());
std::string message_string(kMaxOutgoingPacketSize, 'a');
- quiche::QuicheStringPiece message_buffer(message_string);
+ absl::string_view message_buffer(message_string);
QuicRandom* random =
QuicConnectionPeer::GetHelper(client_connection)->GetRandomGenerator();
QuicMemSliceStorage storage(nullptr, 0, nullptr, 0);
@@ -4258,7 +4336,7 @@ TEST_P(EndToEndTest, SendMessages) {
EXPECT_EQ(MessageResult(MESSAGE_STATUS_SUCCESS, 1),
client_session->SendMessage(MakeSpan(
client_connection->helper()->GetStreamSendBufferAllocator(),
- quiche::QuicheStringPiece(
+ absl::string_view(
message_buffer.data(),
client_session->GetCurrentLargestMessagePayload()),
&storage)));
@@ -4272,8 +4350,7 @@ TEST_P(EndToEndTest, SendMessages) {
1;
MessageResult result = client_session->SendMessage(MakeSpan(
client_connection->helper()->GetStreamSendBufferAllocator(),
- quiche::QuicheStringPiece(message_buffer.data(), message_length),
- &storage));
+ absl::string_view(message_buffer.data(), message_length), &storage));
if (result.status == MESSAGE_STATUS_BLOCKED) {
// Connection is write blocked.
break;
@@ -4287,7 +4364,7 @@ TEST_P(EndToEndTest, SendMessages) {
client_session
->SendMessage(MakeSpan(
client_connection->helper()->GetStreamSendBufferAllocator(),
- quiche::QuicheStringPiece(
+ absl::string_view(
message_buffer.data(),
client_session->GetCurrentLargestMessagePayload() + 1),
&storage))
@@ -4602,7 +4679,7 @@ TEST_P(EndToEndTest, TooBigStreamIdClosesConnection) {
QuicSpdySession* client_session = GetClientSession();
ASSERT_TRUE(client_session);
QuicStreamIdManager* stream_id_manager =
- QuicSessionPeer::v99_bidirectional_stream_id_manager(client_session);
+ QuicSessionPeer::ietf_bidirectional_stream_id_manager(client_session);
ASSERT_TRUE(stream_id_manager);
QuicStreamCount max_number_of_streams =
stream_id_manager->outgoing_max_streams();
@@ -4780,6 +4857,349 @@ TEST_P(EndToEndTest, LegacyVersionEncapsulationWithLoss) {
0u);
}
+TEST_P(EndToEndTest, KeyUpdateInitiatedByClient) {
+ SetQuicReloadableFlag(quic_key_update_supported, true);
+
+ if (!version_.UsesTls()) {
+ // Key Update is only supported in TLS handshake.
+ ASSERT_TRUE(Initialize());
+ return;
+ }
+
+ ASSERT_TRUE(Initialize());
+
+ SendSynchronousFooRequestAndCheckResponse();
+ QuicConnection* client_connection = GetClientConnection();
+ ASSERT_TRUE(client_connection);
+ EXPECT_EQ(0u, client_connection->GetStats().key_update_count);
+
+ EXPECT_TRUE(
+ client_connection->InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(1u, client_connection->GetStats().key_update_count);
+
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(1u, client_connection->GetStats().key_update_count);
+
+ EXPECT_TRUE(
+ client_connection->InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(2u, client_connection->GetStats().key_update_count);
+
+ server_thread_->Pause();
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection) {
+ QuicConnectionStats server_stats = server_connection->GetStats();
+ EXPECT_EQ(2u, server_stats.key_update_count);
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ server_thread_->Resume();
+}
+
+TEST_P(EndToEndTest, KeyUpdateInitiatedByServer) {
+ SetQuicReloadableFlag(quic_key_update_supported, true);
+
+ if (!version_.UsesTls()) {
+ // Key Update is only supported in TLS handshake.
+ ASSERT_TRUE(Initialize());
+ return;
+ }
+
+ ASSERT_TRUE(Initialize());
+
+ SendSynchronousFooRequestAndCheckResponse();
+ QuicConnection* client_connection = GetClientConnection();
+ ASSERT_TRUE(client_connection);
+ EXPECT_EQ(0u, client_connection->GetStats().key_update_count);
+
+ // Use WaitUntil to ensure the server had executed the key update predicate
+ // before sending the Foo request, otherwise the test can be flaky if it
+ // receives the Foo request before executing the key update.
+ server_thread_->WaitUntil(
+ [this]() {
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection != nullptr) {
+ if (!server_connection->IsKeyUpdateAllowed()) {
+ // Server may not have received ack from client yet for the current
+ // key phase, wait a bit and try again.
+ return false;
+ }
+ EXPECT_TRUE(server_connection->InitiateKeyUpdate(
+ KeyUpdateReason::kLocalForTests));
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ return true;
+ },
+ QuicTime::Delta::FromSeconds(5));
+
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(1u, client_connection->GetStats().key_update_count);
+
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(1u, client_connection->GetStats().key_update_count);
+
+ server_thread_->WaitUntil(
+ [this]() {
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection != nullptr) {
+ if (!server_connection->IsKeyUpdateAllowed()) {
+ return false;
+ }
+ EXPECT_TRUE(server_connection->InitiateKeyUpdate(
+ KeyUpdateReason::kLocalForTests));
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ return true;
+ },
+ QuicTime::Delta::FromSeconds(5));
+
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(2u, client_connection->GetStats().key_update_count);
+
+ server_thread_->Pause();
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection) {
+ QuicConnectionStats server_stats = server_connection->GetStats();
+ EXPECT_EQ(2u, server_stats.key_update_count);
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ server_thread_->Resume();
+}
+
+TEST_P(EndToEndTest, KeyUpdateInitiatedByBoth) {
+ SetQuicReloadableFlag(quic_key_update_supported, true);
+
+ if (!version_.UsesTls()) {
+ // Key Update is only supported in TLS handshake.
+ ASSERT_TRUE(Initialize());
+ return;
+ }
+
+ ASSERT_TRUE(Initialize());
+
+ SendSynchronousFooRequestAndCheckResponse();
+
+ // Use WaitUntil to ensure the server had executed the key update predicate
+ // before the client sends the Foo request, otherwise the Foo request from
+ // the client could trigger the server key update before the server can
+ // initiate the key update locally. That would mean the test is no longer
+ // hitting the intended test state of both sides locally initiating a key
+ // update before receiving a packet in the new key phase from the other side.
+ // Additionally the test would fail since InitiateKeyUpdate() would not allow
+ // to do another key update yet and return false.
+ server_thread_->WaitUntil(
+ [this]() {
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection != nullptr) {
+ if (!server_connection->IsKeyUpdateAllowed()) {
+ // Server may not have received ack from client yet for the current
+ // key phase, wait a bit and try again.
+ return false;
+ }
+ EXPECT_TRUE(server_connection->InitiateKeyUpdate(
+ KeyUpdateReason::kLocalForTests));
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ return true;
+ },
+ QuicTime::Delta::FromSeconds(5));
+ QuicConnection* client_connection = GetClientConnection();
+ ASSERT_TRUE(client_connection);
+ EXPECT_TRUE(
+ client_connection->InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(1u, client_connection->GetStats().key_update_count);
+
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(1u, client_connection->GetStats().key_update_count);
+
+ server_thread_->WaitUntil(
+ [this]() {
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection != nullptr) {
+ if (!server_connection->IsKeyUpdateAllowed()) {
+ return false;
+ }
+ EXPECT_TRUE(server_connection->InitiateKeyUpdate(
+ KeyUpdateReason::kLocalForTests));
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ return true;
+ },
+ QuicTime::Delta::FromSeconds(5));
+ EXPECT_TRUE(
+ client_connection->InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+
+ SendSynchronousFooRequestAndCheckResponse();
+ EXPECT_EQ(2u, client_connection->GetStats().key_update_count);
+
+ server_thread_->Pause();
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection) {
+ QuicConnectionStats server_stats = server_connection->GetStats();
+ EXPECT_EQ(2u, server_stats.key_update_count);
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ server_thread_->Resume();
+}
+
+TEST_P(EndToEndTest, KeyUpdateInitiatedByConfidentialityLimit) {
+ SetQuicReloadableFlag(quic_enable_aead_limits, true);
+ SetQuicReloadableFlag(quic_key_update_supported, true);
+ SetQuicFlag(FLAGS_quic_key_update_confidentiality_limit, 4U);
+
+ if (!version_.UsesTls()) {
+ // Key Update is only supported in TLS handshake.
+ ASSERT_TRUE(Initialize());
+ return;
+ }
+
+ ASSERT_TRUE(Initialize());
+
+ QuicConnection* client_connection = GetClientConnection();
+ ASSERT_TRUE(client_connection);
+ EXPECT_EQ(0u, client_connection->GetStats().key_update_count);
+
+ server_thread_->WaitUntil(
+ [this]() {
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection != nullptr) {
+ EXPECT_EQ(0u, server_connection->GetStats().key_update_count);
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ return true;
+ },
+ QuicTime::Delta::FromSeconds(5));
+
+ SendSynchronousFooRequestAndCheckResponse();
+ SendSynchronousFooRequestAndCheckResponse();
+ SendSynchronousFooRequestAndCheckResponse();
+ // Don't know exactly how many packets will be sent in each request/response,
+ // so just test that at least one key update occurred.
+ EXPECT_LE(1u, client_connection->GetStats().key_update_count);
+
+ server_thread_->Pause();
+ QuicConnection* server_connection = GetServerConnection();
+ if (server_connection) {
+ QuicConnectionStats server_stats = server_connection->GetStats();
+ EXPECT_LE(1u, server_stats.key_update_count);
+ } else {
+ ADD_FAILURE() << "Missing server connection";
+ }
+ server_thread_->Resume();
+}
+
+TEST_P(EndToEndTest, TlsResumptionEnabledOnTheFly) {
+ SetQuicFlag(FLAGS_quic_disable_server_tls_resumption, true);
+ ASSERT_TRUE(Initialize());
+
+ if (!version_.UsesTls()) {
+ // This test is TLS specific.
+ return;
+ }
+
+ // Send the first request. Client should not have a resumption ticket.
+ SendSynchronousFooRequestAndCheckResponse();
+ QuicSpdyClientSession* client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_EQ(client_session->GetCryptoStream()->EarlyDataReason(),
+ ssl_early_data_no_session_offered);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ client_->Disconnect();
+
+ SetQuicFlag(FLAGS_quic_disable_server_tls_resumption, false);
+
+ // Send the second request. Client should still have no resumption ticket, but
+ // it will receive one which can be used by the next request.
+ client_->Connect();
+ SendSynchronousFooRequestAndCheckResponse();
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_EQ(client_session->GetCryptoStream()->EarlyDataReason(),
+ ssl_early_data_no_session_offered);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ client_->Disconnect();
+
+ // Send the third request in 0RTT.
+ client_->Connect();
+ SendSynchronousFooRequestAndCheckResponse();
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_TRUE(client_session->EarlyDataAccepted());
+ client_->Disconnect();
+}
+
+TEST_P(EndToEndTest, TlsResumptionDisabledOnTheFly) {
+ SetQuicFlag(FLAGS_quic_disable_server_tls_resumption, false);
+ ASSERT_TRUE(Initialize());
+
+ if (!version_.UsesTls()) {
+ // This test is TLS specific.
+ return;
+ }
+
+ // Send the first request and then disconnect.
+ SendSynchronousFooRequestAndCheckResponse();
+ QuicSpdyClientSession* client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ client_->Disconnect();
+
+ // Send the second request in 0RTT.
+ client_->Connect();
+ SendSynchronousFooRequestAndCheckResponse();
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_TRUE(client_session->EarlyDataAccepted());
+ client_->Disconnect();
+
+ SetQuicFlag(FLAGS_quic_disable_server_tls_resumption, true);
+
+ // Send the third request. The client should try resumption but server should
+ // decline it.
+ client_->Connect();
+ SendSynchronousFooRequestAndCheckResponse();
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ EXPECT_EQ(client_session->GetCryptoStream()->EarlyDataReason(),
+ ssl_early_data_session_not_resumed);
+ client_->Disconnect();
+
+ // Keep sending until the client runs out of resumption tickets.
+ for (int i = 0; i < 10; ++i) {
+ client_->Connect();
+ SendSynchronousFooRequestAndCheckResponse();
+
+ client_session = GetClientSession();
+ ASSERT_TRUE(client_session);
+ EXPECT_FALSE(client_session->EarlyDataAccepted());
+ const auto early_data_reason =
+ client_session->GetCryptoStream()->EarlyDataReason();
+ client_->Disconnect();
+
+ if (early_data_reason != ssl_early_data_session_not_resumed) {
+ EXPECT_EQ(early_data_reason, ssl_early_data_no_session_offered);
+ return;
+ }
+ }
+
+ ADD_FAILURE() << "Client should not have 10 resumption tickets.";
+}
+
} // namespace
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.cc b/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.cc
index 3e067036e8d..1a160e9d5f6 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.cc
@@ -6,13 +6,16 @@
#include <cstdint>
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/quic/core/http/http_frames.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -51,7 +54,7 @@ bool HttpDecoder::DecodeSettings(const char* data,
return false;
}
- quiche::QuicheStringPiece frame_contents;
+ absl::string_view frame_contents;
if (!reader.ReadStringPieceVarInt62(&frame_contents)) {
QUIC_DLOG(ERROR) << "Failed to read SETTINGS frame contents";
return false;
@@ -93,7 +96,7 @@ QuicByteCount HttpDecoder::ProcessInput(const char* data, QuicByteCount len) {
switch (state_) {
case STATE_READING_FRAME_TYPE:
- ReadFrameType(&reader);
+ continue_processing = ReadFrameType(&reader);
break;
case STATE_READING_FRAME_LENGTH:
continue_processing = ReadFrameLength(&reader);
@@ -114,7 +117,7 @@ QuicByteCount HttpDecoder::ProcessInput(const char* data, QuicByteCount len) {
return len - reader.BytesRemaining();
}
-void HttpDecoder::ReadFrameType(QuicDataReader* reader) {
+bool HttpDecoder::ReadFrameType(QuicDataReader* reader) {
DCHECK_NE(0u, reader->BytesRemaining());
if (current_type_field_length_ == 0) {
// A new frame is coming.
@@ -124,7 +127,7 @@ void HttpDecoder::ReadFrameType(QuicDataReader* reader) {
// Buffer a new type field.
remaining_type_field_length_ = current_type_field_length_;
BufferFrameType(reader);
- return;
+ return true;
}
// The reader has all type data needed, so no need to buffer.
bool success = reader->ReadVarInt62(&current_frame_type_);
@@ -134,14 +137,34 @@ void HttpDecoder::ReadFrameType(QuicDataReader* reader) {
BufferFrameType(reader);
// The frame is still not buffered completely.
if (remaining_type_field_length_ != 0) {
- return;
+ return true;
}
QuicDataReader type_reader(type_buffer_.data(), current_type_field_length_);
bool success = type_reader.ReadVarInt62(&current_frame_type_);
DCHECK(success);
}
+ if (GetQuicReloadableFlag(quic_reject_spdy_frames)) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_reject_spdy_frames);
+ // https://tools.ietf.org/html/draft-ietf-quic-http-31#section-7.2.8
+ // specifies that the following frames are treated as errors.
+ if (current_frame_type_ ==
+ static_cast<uint64_t>(http2::Http2FrameType::PRIORITY) ||
+ current_frame_type_ ==
+ static_cast<uint64_t>(http2::Http2FrameType::PING) ||
+ current_frame_type_ ==
+ static_cast<uint64_t>(http2::Http2FrameType::WINDOW_UPDATE) ||
+ current_frame_type_ ==
+ static_cast<uint64_t>(http2::Http2FrameType::CONTINUATION)) {
+ RaiseError(
+ QUIC_HTTP_RECEIVE_SPDY_FRAME,
+ quiche::QuicheStrCat("HTTP/2 frame received in a HTTP/3 connection: ",
+ current_frame_type_));
+ return false;
+ }
+ }
state_ = STATE_READING_FRAME_LENGTH;
+ return true;
}
bool HttpDecoder::ReadFrameLength(QuicDataReader* reader) {
@@ -214,6 +237,14 @@ bool HttpDecoder::ReadFrameLength(QuicDataReader* reader) {
case static_cast<uint64_t>(HttpFrameType::PRIORITY_UPDATE):
continue_processing = visitor_->OnPriorityUpdateFrameStart(header_length);
break;
+ case static_cast<uint64_t>(HttpFrameType::PRIORITY_UPDATE_REQUEST_STREAM):
+ if (GetQuicReloadableFlag(quic_new_priority_update_frame)) {
+ QUIC_CODE_COUNT_N(quic_new_priority_update_frame, 2, 2);
+ continue_processing =
+ visitor_->OnPriorityUpdateFrameStart(header_length);
+ break;
+ }
+ ABSL_FALLTHROUGH_INTENDED;
default:
continue_processing = visitor_->OnUnknownFrameStart(
current_frame_type_, header_length, current_frame_length_);
@@ -236,7 +267,7 @@ bool HttpDecoder::ReadFramePayload(QuicDataReader* reader) {
case static_cast<uint64_t>(HttpFrameType::DATA): {
QuicByteCount bytes_to_read = std::min<QuicByteCount>(
remaining_frame_length_, reader->BytesRemaining());
- quiche::QuicheStringPiece payload;
+ absl::string_view payload;
bool success = reader->ReadStringPiece(&payload, bytes_to_read);
DCHECK(success);
DCHECK(!payload.empty());
@@ -247,7 +278,7 @@ bool HttpDecoder::ReadFramePayload(QuicDataReader* reader) {
case static_cast<uint64_t>(HttpFrameType::HEADERS): {
QuicByteCount bytes_to_read = std::min<QuicByteCount>(
remaining_frame_length_, reader->BytesRemaining());
- quiche::QuicheStringPiece payload;
+ absl::string_view payload;
bool success = reader->ReadStringPiece(&payload, bytes_to_read);
DCHECK(success);
DCHECK(!payload.empty());
@@ -320,7 +351,7 @@ bool HttpDecoder::ReadFramePayload(QuicDataReader* reader) {
if (bytes_to_read == 0) {
break;
}
- quiche::QuicheStringPiece payload;
+ absl::string_view payload;
bool success = reader->ReadStringPiece(&payload, bytes_to_read);
DCHECK(success);
DCHECK(!payload.empty());
@@ -342,10 +373,19 @@ bool HttpDecoder::ReadFramePayload(QuicDataReader* reader) {
BufferFramePayload(reader);
break;
}
+ case static_cast<uint64_t>(HttpFrameType::PRIORITY_UPDATE_REQUEST_STREAM): {
+ if (GetQuicReloadableFlag(quic_new_priority_update_frame)) {
+ // TODO(bnc): Avoid buffering if the entire frame is present, and
+ // instead parse directly out of |reader|.
+ BufferFramePayload(reader);
+ break;
+ }
+ ABSL_FALLTHROUGH_INTENDED;
+ }
default: {
QuicByteCount bytes_to_read = std::min<QuicByteCount>(
remaining_frame_length_, reader->BytesRemaining());
- quiche::QuicheStringPiece payload;
+ absl::string_view payload;
bool success = reader->ReadStringPiece(&payload, bytes_to_read);
DCHECK(success);
DCHECK(!payload.empty());
@@ -446,6 +486,20 @@ bool HttpDecoder::FinishParsing() {
continue_processing = visitor_->OnPriorityUpdateFrame(frame);
break;
}
+ case static_cast<uint64_t>(HttpFrameType::PRIORITY_UPDATE_REQUEST_STREAM): {
+ if (GetQuicReloadableFlag(quic_new_priority_update_frame)) {
+ // TODO(bnc): Avoid buffering if the entire frame is present, and
+ // instead parse directly out of |reader|.
+ PriorityUpdateFrame frame;
+ QuicDataReader reader(buffer_.data(), current_frame_length_);
+ if (!ParseNewPriorityUpdateFrame(&reader, &frame)) {
+ return false;
+ }
+ continue_processing = visitor_->OnPriorityUpdateFrame(frame);
+ break;
+ }
+ ABSL_FALLTHROUGH_INTENDED;
+ }
default: {
continue_processing = visitor_->OnUnknownFrameEnd();
break;
@@ -461,7 +515,7 @@ bool HttpDecoder::FinishParsing() {
void HttpDecoder::DiscardFramePayload(QuicDataReader* reader) {
QuicByteCount bytes_to_read = std::min<QuicByteCount>(
remaining_frame_length_, reader->BytesRemaining());
- quiche::QuicheStringPiece payload;
+ absl::string_view payload;
bool success = reader->ReadStringPiece(&payload, bytes_to_read);
DCHECK(success);
remaining_frame_length_ -= payload.length();
@@ -574,8 +628,23 @@ bool HttpDecoder::ParsePriorityUpdateFrame(QuicDataReader* reader,
return false;
}
- quiche::QuicheStringPiece priority_field_value =
- reader->ReadRemainingPayload();
+ absl::string_view priority_field_value = reader->ReadRemainingPayload();
+ frame->priority_field_value =
+ std::string(priority_field_value.data(), priority_field_value.size());
+
+ return true;
+}
+
+bool HttpDecoder::ParseNewPriorityUpdateFrame(QuicDataReader* reader,
+ PriorityUpdateFrame* frame) {
+ frame->prioritized_element_type = REQUEST_STREAM;
+
+ if (!reader->ReadVarInt62(&frame->prioritized_element_id)) {
+ RaiseError(QUIC_HTTP_FRAME_ERROR, "Unable to read prioritized element id.");
+ return false;
+ }
+
+ absl::string_view priority_field_value = reader->ReadRemainingPayload();
frame->priority_field_value =
std::string(priority_field_value.data(), priority_field_value.size());
@@ -596,6 +665,9 @@ QuicByteCount HttpDecoder::MaxFrameLength(uint64_t frame_type) {
case static_cast<uint64_t>(HttpFrameType::PRIORITY_UPDATE):
// This limit is arbitrary.
return 1024 * 1024;
+ case static_cast<uint64_t>(HttpFrameType::PRIORITY_UPDATE_REQUEST_STREAM):
+ // This limit is arbitrary.
+ return 1024 * 1024;
default:
// Other frames require no data buffering, so it's safe to have no limit.
return std::numeric_limits<QuicByteCount>::max();
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.h b/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.h
index 1551aa7d275..479f4448866 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/http_decoder.h
@@ -7,11 +7,11 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_frames.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -62,7 +62,7 @@ class QUIC_EXPORT_PRIVATE HttpDecoder {
// Called when part of the payload of a DATA frame has been read. May be
// called multiple times for a single frame. |payload| is guaranteed to be
// non-empty.
- virtual bool OnDataFramePayload(quiche::QuicheStringPiece payload) = 0;
+ virtual bool OnDataFramePayload(absl::string_view payload) = 0;
// Called when a DATA frame has been completely processed.
virtual bool OnDataFrameEnd() = 0;
@@ -74,7 +74,7 @@ class QUIC_EXPORT_PRIVATE HttpDecoder {
// Called when part of the payload of a HEADERS frame has been read. May be
// called multiple times for a single frame. |payload| is guaranteed to be
// non-empty.
- virtual bool OnHeadersFramePayload(quiche::QuicheStringPiece payload) = 0;
+ virtual bool OnHeadersFramePayload(absl::string_view payload) = 0;
// Called when a HEADERS frame has been completely processed.
virtual bool OnHeadersFrameEnd() = 0;
@@ -91,8 +91,7 @@ class QUIC_EXPORT_PRIVATE HttpDecoder {
// Called when part of the header block of a PUSH_PROMISE frame has been
// read. May be called multiple times for a single frame. |payload| is
// guaranteed to be non-empty.
- virtual bool OnPushPromiseFramePayload(
- quiche::QuicheStringPiece payload) = 0;
+ virtual bool OnPushPromiseFramePayload(absl::string_view payload) = 0;
// Called when a PUSH_PROMISE frame has been completely processed.
virtual bool OnPushPromiseFrameEnd() = 0;
@@ -113,7 +112,7 @@ class QUIC_EXPORT_PRIVATE HttpDecoder {
// Called when part of the payload of the unknown frame has been read. May
// be called multiple times for a single frame. |payload| is guaranteed to
// be non-empty.
- virtual bool OnUnknownFramePayload(quiche::QuicheStringPiece payload) = 0;
+ virtual bool OnUnknownFramePayload(absl::string_view payload) = 0;
// Called when the unknown frame has been completely processed.
virtual bool OnUnknownFrameEnd() = 0;
};
@@ -158,8 +157,9 @@ class QUIC_EXPORT_PRIVATE HttpDecoder {
// Reads the type of a frame from |reader|. Sets error_ and error_detail_
// if there are any errors. Also calls OnDataFrameStart() or
- // OnHeadersFrameStart() for appropriate frame types.
- void ReadFrameType(QuicDataReader* reader);
+ // OnHeadersFrameStart() for appropriate frame types. Returns whether the
+ // processing should continue.
+ bool ReadFrameType(QuicDataReader* reader);
// Reads the length of a frame from |reader|. Sets error_ and error_detail_
// if there are any errors. Returns whether processing should continue.
@@ -197,10 +197,16 @@ class QUIC_EXPORT_PRIVATE HttpDecoder {
// Parses the payload of a SETTINGS frame from |reader| into |frame|.
bool ParseSettingsFrame(QuicDataReader* reader, SettingsFrame* frame);
- // Parses the payload of a PRIORITY_UPDATE frame from |reader| into |frame|.
+ // Parses the payload of a PRIORITY_UPDATE frame (draft-01, type 0x0f)
+ // from |reader| into |frame|.
bool ParsePriorityUpdateFrame(QuicDataReader* reader,
PriorityUpdateFrame* frame);
+ // Parses the payload of a PRIORITY_UPDATE frame (draft-02, type 0xf0700)
+ // from |reader| into |frame|.
+ bool ParseNewPriorityUpdateFrame(QuicDataReader* reader,
+ PriorityUpdateFrame* frame);
+
// Returns the max frame size of a given |frame_type|.
QuicByteCount MaxFrameLength(uint64_t frame_type);
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/http_decoder_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/http_decoder_test.cc
index 01f0a5fbfa9..d56626ffa21 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/http_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/http_decoder_test.cc
@@ -7,15 +7,17 @@
#include <memory>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_encoder.h"
#include "net/third_party/quiche/src/quic/core/http/http_frames.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using ::testing::_;
@@ -62,7 +64,7 @@ class MockVisitor : public HttpDecoder::Visitor {
(override));
MOCK_METHOD(bool,
OnDataFramePayload,
- (quiche::QuicheStringPiece payload),
+ (absl::string_view payload),
(override));
MOCK_METHOD(bool, OnDataFrameEnd, (), (override));
@@ -72,7 +74,7 @@ class MockVisitor : public HttpDecoder::Visitor {
(override));
MOCK_METHOD(bool,
OnHeadersFramePayload,
- (quiche::QuicheStringPiece payload),
+ (absl::string_view payload),
(override));
MOCK_METHOD(bool, OnHeadersFrameEnd, (), (override));
@@ -88,7 +90,7 @@ class MockVisitor : public HttpDecoder::Visitor {
(override));
MOCK_METHOD(bool,
OnPushPromiseFramePayload,
- (quiche::QuicheStringPiece payload),
+ (absl::string_view payload),
(override));
MOCK_METHOD(bool, OnPushPromiseFrameEnd, (), (override));
@@ -109,7 +111,7 @@ class MockVisitor : public HttpDecoder::Visitor {
(override));
MOCK_METHOD(bool,
OnUnknownFramePayload,
- (quiche::QuicheStringPiece payload),
+ (absl::string_view payload),
(override));
MOCK_METHOD(bool, OnUnknownFrameEnd, (), (override));
};
@@ -147,13 +149,13 @@ class HttpDecoderTest : public QuicTest {
}
// Process |input| in a single call to HttpDecoder::ProcessInput().
- QuicByteCount ProcessInput(quiche::QuicheStringPiece input) {
+ QuicByteCount ProcessInput(absl::string_view input) {
return decoder_.ProcessInput(input.data(), input.size());
}
// Feed |input| to |decoder_| one character at a time,
// verifying that each character gets processed.
- void ProcessInputCharByChar(quiche::QuicheStringPiece input) {
+ void ProcessInputCharByChar(absl::string_view input) {
for (char c : input) {
EXPECT_EQ(1u, decoder_.ProcessInput(&c, 1));
}
@@ -161,8 +163,7 @@ class HttpDecoderTest : public QuicTest {
// Append garbage to |input|, then process it in a single call to
// HttpDecoder::ProcessInput(). Verify that garbage is not read.
- QuicByteCount ProcessInputWithGarbageAppended(
- quiche::QuicheStringPiece input) {
+ QuicByteCount ProcessInputWithGarbageAppended(absl::string_view input) {
std::string input_with_garbage_appended =
quiche::QuicheStrCat(input, "blahblah");
QuicByteCount processed_bytes = ProcessInput(input_with_garbage_appended);
@@ -192,7 +193,7 @@ TEST_F(HttpDecoderTest, UnknownFrame) {
const QuicByteCount payload_lengths[] = {0, 14, 100};
const uint64_t frame_types[] = {
0x21, 0x40, 0x5f, 0x7e, 0x9d, // some reserved frame types
- 0x06, 0x6f, 0x14 // some unknown, not reserved frame types
+ 0x6f, 0x14 // some unknown, not reserved frame types
};
for (auto payload_length : payload_lengths) {
@@ -230,7 +231,7 @@ TEST_F(HttpDecoderTest, UnknownFrame) {
TEST_F(HttpDecoderTest, CancelPush) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"03" // type (CANCEL_PUSH)
"01" // length
"01"); // Push Id
@@ -258,16 +259,16 @@ TEST_F(HttpDecoderTest, CancelPush) {
TEST_F(HttpDecoderTest, PushPromiseFrame) {
InSequence s;
std::string input = quiche::QuicheStrCat(
- quiche::QuicheTextUtils::HexDecode("05" // type (PUSH PROMISE)
- "0f" // length
- "C000000000000101"), // push id 257
- "Headers"); // headers
+ absl::HexStringToBytes("05" // type (PUSH PROMISE)
+ "0f" // length
+ "C000000000000101"), // push id 257
+ "Headers"); // headers
// Visitor pauses processing.
EXPECT_CALL(visitor_, OnPushPromiseFrameStart(2)).WillOnce(Return(false));
EXPECT_CALL(visitor_, OnPushPromiseFramePushId(257, 8, 7))
.WillOnce(Return(false));
- quiche::QuicheStringPiece remaining_input(input);
+ absl::string_view remaining_input(input);
QuicByteCount processed_bytes =
ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(2u, processed_bytes);
@@ -276,8 +277,7 @@ TEST_F(HttpDecoderTest, PushPromiseFrame) {
EXPECT_EQ(8u, processed_bytes);
remaining_input = remaining_input.substr(processed_bytes);
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("Headers")))
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("Headers")))
.WillOnce(Return(false));
processed_bytes = ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(remaining_input.size(), processed_bytes);
@@ -291,7 +291,7 @@ TEST_F(HttpDecoderTest, PushPromiseFrame) {
EXPECT_CALL(visitor_, OnPushPromiseFrameStart(2));
EXPECT_CALL(visitor_, OnPushPromiseFramePushId(257, 8, 7));
EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("Headers")));
+ OnPushPromiseFramePayload(absl::string_view("Headers")));
EXPECT_CALL(visitor_, OnPushPromiseFrameEnd());
EXPECT_EQ(input.size(), ProcessInput(input));
EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -300,20 +300,13 @@ TEST_F(HttpDecoderTest, PushPromiseFrame) {
// Process the frame incrementally.
EXPECT_CALL(visitor_, OnPushPromiseFrameStart(2));
EXPECT_CALL(visitor_, OnPushPromiseFramePushId(257, 8, 7));
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("H")));
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("e")));
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("a")));
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("d")));
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("e")));
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("r")));
- EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("s")));
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("H")));
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("e")));
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("a")));
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("d")));
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("e")));
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("r")));
+ EXPECT_CALL(visitor_, OnPushPromiseFramePayload(absl::string_view("s")));
EXPECT_CALL(visitor_, OnPushPromiseFrameEnd());
ProcessInputCharByChar(input);
EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -323,7 +316,7 @@ TEST_F(HttpDecoderTest, PushPromiseFrame) {
EXPECT_CALL(visitor_, OnPushPromiseFrameStart(2));
EXPECT_CALL(visitor_, OnPushPromiseFramePushId(257, 8, 7));
EXPECT_CALL(visitor_,
- OnPushPromiseFramePayload(quiche::QuicheStringPiece("Headers")));
+ OnPushPromiseFramePayload(absl::string_view("Headers")));
EXPECT_CALL(visitor_, OnPushPromiseFrameEnd());
ProcessInputCharByChar(input.substr(0, 9));
EXPECT_EQ(8u, ProcessInput(input.substr(9)));
@@ -334,7 +327,7 @@ TEST_F(HttpDecoderTest, PushPromiseFrame) {
TEST_F(HttpDecoderTest, CorruptPushPromiseFrame) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"05" // type (PUSH_PROMISE)
"01" // length
"40"); // first byte of two-byte varint push id
@@ -365,7 +358,7 @@ TEST_F(HttpDecoderTest, CorruptPushPromiseFrame) {
TEST_F(HttpDecoderTest, MaxPushId) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"0D" // type (MAX_PUSH_ID)
"01" // length
"01"); // Push Id
@@ -392,7 +385,7 @@ TEST_F(HttpDecoderTest, MaxPushId) {
TEST_F(HttpDecoderTest, SettingsFrame) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"04" // type (SETTINGS)
"07" // length
"01" // identifier (SETTINGS_QPACK_MAX_TABLE_CAPACITY)
@@ -408,7 +401,7 @@ TEST_F(HttpDecoderTest, SettingsFrame) {
frame.values[256] = 4;
// Visitor pauses processing.
- quiche::QuicheStringPiece remaining_input(input);
+ absl::string_view remaining_input(input);
EXPECT_CALL(visitor_, OnSettingsFrameStart(2)).WillOnce(Return(false));
QuicByteCount processed_bytes =
ProcessInputWithGarbageAppended(remaining_input);
@@ -472,7 +465,7 @@ TEST_F(HttpDecoderTest, CorruptSettingsFrame) {
}
TEST_F(HttpDecoderTest, DuplicateSettingsIdentifier) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"04" // type (SETTINGS)
"04" // length
"01" // identifier
@@ -492,20 +485,20 @@ TEST_F(HttpDecoderTest, DuplicateSettingsIdentifier) {
TEST_F(HttpDecoderTest, DataFrame) {
InSequence s;
- std::string input = quiche::QuicheStrCat(
- quiche::QuicheTextUtils::HexDecode("00" // type (DATA)
- "05"), // length
- "Data!"); // data
+ std::string input =
+ quiche::QuicheStrCat(absl::HexStringToBytes("00" // type (DATA)
+ "05"), // length
+ "Data!"); // data
// Visitor pauses processing.
EXPECT_CALL(visitor_, OnDataFrameStart(2, 5)).WillOnce(Return(false));
- quiche::QuicheStringPiece remaining_input(input);
+ absl::string_view remaining_input(input);
QuicByteCount processed_bytes =
ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(2u, processed_bytes);
remaining_input = remaining_input.substr(processed_bytes);
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("Data!")))
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("Data!")))
.WillOnce(Return(false));
processed_bytes = ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(remaining_input.size(), processed_bytes);
@@ -517,7 +510,7 @@ TEST_F(HttpDecoderTest, DataFrame) {
// Process the full frame.
EXPECT_CALL(visitor_, OnDataFrameStart(2, 5));
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("Data!")));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("Data!")));
EXPECT_CALL(visitor_, OnDataFrameEnd());
EXPECT_EQ(input.size(), ProcessInput(input));
EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -525,11 +518,11 @@ TEST_F(HttpDecoderTest, DataFrame) {
// Process the frame incrementally.
EXPECT_CALL(visitor_, OnDataFrameStart(2, 5));
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("D")));
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("a")));
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("t")));
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("a")));
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("!")));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("D")));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("a")));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("t")));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("a")));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("!")));
EXPECT_CALL(visitor_, OnDataFrameEnd());
ProcessInputCharByChar(input);
EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -557,7 +550,7 @@ TEST_F(HttpDecoderTest, FrameHeaderPartialDelivery) {
EXPECT_EQ("", decoder_.error_detail());
// Send data.
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece(input)));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view(input)));
EXPECT_CALL(visitor_, OnDataFrameEnd());
EXPECT_EQ(2048u, decoder_.ProcessInput(input.data(), 2048));
EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -594,7 +587,7 @@ TEST_F(HttpDecoderTest, PartialDeliveryOfLargeFrameType) {
TEST_F(HttpDecoderTest, GoAway) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"07" // type (GOAWAY)
"01" // length
"01"); // ID
@@ -621,21 +614,20 @@ TEST_F(HttpDecoderTest, GoAway) {
TEST_F(HttpDecoderTest, HeadersFrame) {
InSequence s;
- std::string input = quiche::QuicheStrCat(
- quiche::QuicheTextUtils::HexDecode("01" // type (HEADERS)
- "07"), // length
- "Headers"); // headers
+ std::string input =
+ quiche::QuicheStrCat(absl::HexStringToBytes("01" // type (HEADERS)
+ "07"), // length
+ "Headers"); // headers
// Visitor pauses processing.
EXPECT_CALL(visitor_, OnHeadersFrameStart(2, 7)).WillOnce(Return(false));
- quiche::QuicheStringPiece remaining_input(input);
+ absl::string_view remaining_input(input);
QuicByteCount processed_bytes =
ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(2u, processed_bytes);
remaining_input = remaining_input.substr(processed_bytes);
- EXPECT_CALL(visitor_,
- OnHeadersFramePayload(quiche::QuicheStringPiece("Headers")))
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("Headers")))
.WillOnce(Return(false));
processed_bytes = ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(remaining_input.size(), processed_bytes);
@@ -647,8 +639,7 @@ TEST_F(HttpDecoderTest, HeadersFrame) {
// Process the full frame.
EXPECT_CALL(visitor_, OnHeadersFrameStart(2, 7));
- EXPECT_CALL(visitor_,
- OnHeadersFramePayload(quiche::QuicheStringPiece("Headers")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("Headers")));
EXPECT_CALL(visitor_, OnHeadersFrameEnd());
EXPECT_EQ(input.size(), ProcessInput(input));
EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -656,13 +647,13 @@ TEST_F(HttpDecoderTest, HeadersFrame) {
// Process the frame incrementally.
EXPECT_CALL(visitor_, OnHeadersFrameStart(2, 7));
- EXPECT_CALL(visitor_, OnHeadersFramePayload(quiche::QuicheStringPiece("H")));
- EXPECT_CALL(visitor_, OnHeadersFramePayload(quiche::QuicheStringPiece("e")));
- EXPECT_CALL(visitor_, OnHeadersFramePayload(quiche::QuicheStringPiece("a")));
- EXPECT_CALL(visitor_, OnHeadersFramePayload(quiche::QuicheStringPiece("d")));
- EXPECT_CALL(visitor_, OnHeadersFramePayload(quiche::QuicheStringPiece("e")));
- EXPECT_CALL(visitor_, OnHeadersFramePayload(quiche::QuicheStringPiece("r")));
- EXPECT_CALL(visitor_, OnHeadersFramePayload(quiche::QuicheStringPiece("s")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("H")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("e")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("a")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("d")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("e")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("r")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("s")));
EXPECT_CALL(visitor_, OnHeadersFrameEnd());
ProcessInputCharByChar(input);
EXPECT_THAT(decoder_.error(), IsQuicNoError());
@@ -671,7 +662,7 @@ TEST_F(HttpDecoderTest, HeadersFrame) {
TEST_F(HttpDecoderTest, EmptyDataFrame) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"00" // type (DATA)
"00"); // length
@@ -701,7 +692,7 @@ TEST_F(HttpDecoderTest, EmptyDataFrame) {
TEST_F(HttpDecoderTest, EmptyHeadersFrame) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"01" // type (HEADERS)
"00"); // length
@@ -731,7 +722,7 @@ TEST_F(HttpDecoderTest, EmptyHeadersFrame) {
TEST_F(HttpDecoderTest, PushPromiseFrameNoHeaders) {
InSequence s;
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"05" // type (PUSH_PROMISE)
"01" // length
"01"); // Push Id
@@ -765,7 +756,7 @@ TEST_F(HttpDecoderTest, PushPromiseFrameNoHeaders) {
}
TEST_F(HttpDecoderTest, MalformedFrameWithOverlyLargePayload) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"03" // type (CANCEL_PUSH)
"10" // length
"15"); // malformed payload
@@ -786,27 +777,41 @@ TEST_F(HttpDecoderTest, MalformedSettingsFrame) {
writer.WriteStringPiece("Malformed payload");
EXPECT_CALL(visitor_, OnError(&decoder_));
- EXPECT_EQ(5u, decoder_.ProcessInput(input, QUICHE_ARRAYSIZE(input)));
+ EXPECT_EQ(5u, decoder_.ProcessInput(input, ABSL_ARRAYSIZE(input)));
EXPECT_THAT(decoder_.error(), IsError(QUIC_HTTP_FRAME_TOO_LARGE));
EXPECT_EQ("Frame is too large.", decoder_.error_detail());
}
+TEST_F(HttpDecoderTest, Http2Frame) {
+ SetQuicReloadableFlag(quic_reject_spdy_frames, true);
+ std::string input = absl::HexStringToBytes(
+ "06" // PING in HTTP/2 but not supported in HTTP/3.
+ "05" // length
+ "15"); // random payload
+
+ // Process the full frame.
+ EXPECT_CALL(visitor_, OnError(&decoder_));
+ EXPECT_EQ(1u, ProcessInput(input));
+ EXPECT_THAT(decoder_.error(), IsError(QUIC_HTTP_RECEIVE_SPDY_FRAME));
+ EXPECT_EQ("HTTP/2 frame received in a HTTP/3 connection: 6",
+ decoder_.error_detail());
+}
+
TEST_F(HttpDecoderTest, HeadersPausedThenData) {
InSequence s;
- std::string input = quiche::QuicheStrCat(
- quiche::QuicheTextUtils::HexDecode("01" // type (HEADERS)
- "07"), // length
- "Headers", // headers
- quiche::QuicheTextUtils::HexDecode("00" // type (DATA)
- "05"), // length
- "Data!"); // data
+ std::string input =
+ quiche::QuicheStrCat(absl::HexStringToBytes("01" // type (HEADERS)
+ "07"), // length
+ "Headers", // headers
+ absl::HexStringToBytes("00" // type (DATA)
+ "05"), // length
+ "Data!"); // data
// Visitor pauses processing, maybe because header decompression is blocked.
EXPECT_CALL(visitor_, OnHeadersFrameStart(2, 7));
- EXPECT_CALL(visitor_,
- OnHeadersFramePayload(quiche::QuicheStringPiece("Headers")));
+ EXPECT_CALL(visitor_, OnHeadersFramePayload(absl::string_view("Headers")));
EXPECT_CALL(visitor_, OnHeadersFrameEnd()).WillOnce(Return(false));
- quiche::QuicheStringPiece remaining_input(input);
+ absl::string_view remaining_input(input);
QuicByteCount processed_bytes =
ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(9u, processed_bytes);
@@ -814,7 +819,7 @@ TEST_F(HttpDecoderTest, HeadersPausedThenData) {
// Process DATA frame.
EXPECT_CALL(visitor_, OnDataFrameStart(2, 5));
- EXPECT_CALL(visitor_, OnDataFramePayload(quiche::QuicheStringPiece("Data!")));
+ EXPECT_CALL(visitor_, OnDataFramePayload(absl::string_view("Data!")));
EXPECT_CALL(visitor_, OnDataFrameEnd());
processed_bytes = ProcessInput(remaining_input);
@@ -863,7 +868,7 @@ TEST_F(HttpDecoderTest, CorruptFrame) {
HttpDecoder decoder(&visitor_);
EXPECT_CALL(visitor_, OnError(&decoder));
- quiche::QuicheStringPiece input(test_data.input);
+ absl::string_view input(test_data.input);
decoder.ProcessInput(input.data(), input.size());
EXPECT_THAT(decoder.error(), IsError(QUIC_HTTP_FRAME_ERROR));
EXPECT_EQ(test_data.error_message, decoder.error_detail());
@@ -872,7 +877,7 @@ TEST_F(HttpDecoderTest, CorruptFrame) {
HttpDecoder decoder(&visitor_);
EXPECT_CALL(visitor_, OnError(&decoder));
- quiche::QuicheStringPiece input(test_data.input);
+ absl::string_view input(test_data.input);
for (auto c : input) {
decoder.ProcessInput(&c, 1);
}
@@ -883,7 +888,7 @@ TEST_F(HttpDecoderTest, CorruptFrame) {
}
TEST_F(HttpDecoderTest, EmptyCancelPushFrame) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"03" // type (CANCEL_PUSH)
"00"); // frame length
@@ -894,7 +899,7 @@ TEST_F(HttpDecoderTest, EmptyCancelPushFrame) {
}
TEST_F(HttpDecoderTest, EmptySettingsFrame) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"04" // type (SETTINGS)
"00"); // frame length
@@ -910,7 +915,7 @@ TEST_F(HttpDecoderTest, EmptySettingsFrame) {
// Regression test for https://crbug.com/1001823.
TEST_F(HttpDecoderTest, EmptyPushPromiseFrame) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"05" // type (PUSH_PROMISE)
"00"); // frame length
@@ -921,7 +926,7 @@ TEST_F(HttpDecoderTest, EmptyPushPromiseFrame) {
}
TEST_F(HttpDecoderTest, EmptyGoAwayFrame) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"07" // type (GOAWAY)
"00"); // frame length
@@ -932,7 +937,7 @@ TEST_F(HttpDecoderTest, EmptyGoAwayFrame) {
}
TEST_F(HttpDecoderTest, EmptyMaxPushIdFrame) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"0d" // type (MAX_PUSH_ID)
"00"); // frame length
@@ -956,7 +961,7 @@ TEST_F(HttpDecoderTest, LargeStreamIdInGoAway) {
TEST_F(HttpDecoderTest, PriorityUpdateFrame) {
InSequence s;
- std::string input1 = quiche::QuicheTextUtils::HexDecode(
+ std::string input1 = absl::HexStringToBytes(
"0f" // type (PRIORITY_UPDATE)
"02" // length
"00" // prioritized element type: REQUEST_STREAM
@@ -968,7 +973,7 @@ TEST_F(HttpDecoderTest, PriorityUpdateFrame) {
// Visitor pauses processing.
EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(2)).WillOnce(Return(false));
- quiche::QuicheStringPiece remaining_input(input1);
+ absl::string_view remaining_input(input1);
QuicByteCount processed_bytes =
ProcessInputWithGarbageAppended(remaining_input);
EXPECT_EQ(2u, processed_bytes);
@@ -995,8 +1000,8 @@ TEST_F(HttpDecoderTest, PriorityUpdateFrame) {
EXPECT_THAT(decoder_.error(), IsQuicNoError());
EXPECT_EQ("", decoder_.error_detail());
- std::string input2 = quiche::QuicheTextUtils::HexDecode(
- "0f" // type (PRIORIRTY)
+ std::string input2 = absl::HexStringToBytes(
+ "0f" // type (PRIORITY_UPDATE)
"05" // length
"80" // prioritized element type: PUSH_STREAM
"05" // prioritized element id
@@ -1036,12 +1041,96 @@ TEST_F(HttpDecoderTest, PriorityUpdateFrame) {
EXPECT_EQ("", decoder_.error_detail());
}
+TEST_F(HttpDecoderTest, NewPriorityUpdateFrame) {
+ if (!GetQuicReloadableFlag(quic_new_priority_update_frame)) {
+ return;
+ }
+
+ InSequence s;
+ std::string input1 = absl::HexStringToBytes(
+ "800f0700" // type (PRIORITY_UPDATE)
+ "01" // length
+ "03"); // prioritized element id
+
+ PriorityUpdateFrame priority_update1;
+ priority_update1.prioritized_element_type = REQUEST_STREAM;
+ priority_update1.prioritized_element_id = 0x03;
+
+ // Visitor pauses processing.
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(5)).WillOnce(Return(false));
+ absl::string_view remaining_input(input1);
+ QuicByteCount processed_bytes =
+ ProcessInputWithGarbageAppended(remaining_input);
+ EXPECT_EQ(5u, processed_bytes);
+ remaining_input = remaining_input.substr(processed_bytes);
+
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrame(priority_update1))
+ .WillOnce(Return(false));
+ processed_bytes = ProcessInputWithGarbageAppended(remaining_input);
+ EXPECT_EQ(remaining_input.size(), processed_bytes);
+ EXPECT_THAT(decoder_.error(), IsQuicNoError());
+ EXPECT_EQ("", decoder_.error_detail());
+
+ // Process the full frame.
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(5));
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrame(priority_update1));
+ EXPECT_EQ(input1.size(), ProcessInput(input1));
+ EXPECT_THAT(decoder_.error(), IsQuicNoError());
+ EXPECT_EQ("", decoder_.error_detail());
+
+ // Process the frame incrementally.
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(5));
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrame(priority_update1));
+ ProcessInputCharByChar(input1);
+ EXPECT_THAT(decoder_.error(), IsQuicNoError());
+ EXPECT_EQ("", decoder_.error_detail());
+
+ std::string input2 = absl::HexStringToBytes(
+ "800f0700" // type (PRIORITY_UPDATE)
+ "04" // length
+ "05" // prioritized element id
+ "666f6f"); // priority field value: "foo"
+
+ PriorityUpdateFrame priority_update2;
+ priority_update2.prioritized_element_type = REQUEST_STREAM;
+ priority_update2.prioritized_element_id = 0x05;
+ priority_update2.priority_field_value = "foo";
+
+ // Visitor pauses processing.
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(5)).WillOnce(Return(false));
+ remaining_input = input2;
+ processed_bytes = ProcessInputWithGarbageAppended(remaining_input);
+ EXPECT_EQ(5u, processed_bytes);
+ remaining_input = remaining_input.substr(processed_bytes);
+
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrame(priority_update2))
+ .WillOnce(Return(false));
+ processed_bytes = ProcessInputWithGarbageAppended(remaining_input);
+ EXPECT_EQ(remaining_input.size(), processed_bytes);
+ EXPECT_THAT(decoder_.error(), IsQuicNoError());
+ EXPECT_EQ("", decoder_.error_detail());
+
+ // Process the full frame.
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(5));
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrame(priority_update2));
+ EXPECT_EQ(input2.size(), ProcessInput(input2));
+ EXPECT_THAT(decoder_.error(), IsQuicNoError());
+ EXPECT_EQ("", decoder_.error_detail());
+
+ // Process the frame incrementally.
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(5));
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrame(priority_update2));
+ ProcessInputCharByChar(input2);
+ EXPECT_THAT(decoder_.error(), IsQuicNoError());
+ EXPECT_EQ("", decoder_.error_detail());
+}
+
TEST_F(HttpDecoderTest, CorruptPriorityUpdateFrame) {
- std::string payload1 = quiche::QuicheTextUtils::HexDecode(
+ std::string payload1 = absl::HexStringToBytes(
"80" // prioritized element type: PUSH_STREAM
"4005"); // prioritized element id
- std::string payload2 = quiche::QuicheTextUtils::HexDecode(
- "42"); // invalid prioritized element type
+ std::string payload2 =
+ absl::HexStringToBytes("42"); // invalid prioritized element type
struct {
const char* const payload;
size_t payload_length;
@@ -1072,8 +1161,42 @@ TEST_F(HttpDecoderTest, CorruptPriorityUpdateFrame) {
}
}
+TEST_F(HttpDecoderTest, CorruptNewPriorityUpdateFrame) {
+ if (!GetQuicReloadableFlag(quic_new_priority_update_frame)) {
+ return;
+ }
+
+ std::string payload =
+ absl::HexStringToBytes("4005"); // prioritized element id
+ struct {
+ size_t payload_length;
+ const char* const error_message;
+ } kTestData[] = {
+ {0, "Unable to read prioritized element id."},
+ {1, "Unable to read prioritized element id."},
+ };
+
+ for (const auto& test_data : kTestData) {
+ std::string input =
+ absl::HexStringToBytes("800f0700"); // type PRIORITY_UPDATE
+ input.push_back(test_data.payload_length);
+ size_t header_length = input.size();
+ input.append(payload.data(), test_data.payload_length);
+
+ HttpDecoder decoder(&visitor_);
+ EXPECT_CALL(visitor_, OnPriorityUpdateFrameStart(header_length));
+ EXPECT_CALL(visitor_, OnError(&decoder));
+
+ QuicByteCount processed_bytes =
+ decoder.ProcessInput(input.data(), input.size());
+ EXPECT_EQ(input.size(), processed_bytes);
+ EXPECT_THAT(decoder.error(), IsError(QUIC_HTTP_FRAME_ERROR));
+ EXPECT_EQ(test_data.error_message, decoder.error_detail());
+ }
+}
+
TEST_F(HttpDecoderTest, DecodeSettings) {
- std::string input = quiche::QuicheTextUtils::HexDecode(
+ std::string input = absl::HexStringToBytes(
"04" // type (SETTINGS)
"07" // length
"01" // identifier (SETTINGS_QPACK_MAX_TABLE_CAPACITY)
@@ -1093,7 +1216,7 @@ TEST_F(HttpDecoderTest, DecodeSettings) {
EXPECT_EQ(frame, out);
// non-settings frame.
- input = quiche::QuicheTextUtils::HexDecode(
+ input = absl::HexStringToBytes(
"0D" // type (MAX_PUSH_ID)
"01" // length
"01"); // Push Id
@@ -1101,7 +1224,7 @@ TEST_F(HttpDecoderTest, DecodeSettings) {
EXPECT_FALSE(HttpDecoder::DecodeSettings(input.data(), input.size(), &out));
// Corrupt SETTINGS.
- input = quiche::QuicheTextUtils::HexDecode(
+ input = absl::HexStringToBytes(
"04" // type (SETTINGS)
"01" // length
"42"); // First byte of setting identifier, indicating a 2-byte varint62.
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/http_encoder.cc b/chromium/net/third_party/quiche/src/quic/core/http/http_encoder.cc
index 770770561f7..4f86d45b7b7 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/http_encoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/http_encoder.cc
@@ -202,6 +202,37 @@ QuicByteCount HttpEncoder::SerializeMaxPushIdFrame(
QuicByteCount HttpEncoder::SerializePriorityUpdateFrame(
const PriorityUpdateFrame& priority_update,
std::unique_ptr<char[]>* output) {
+ if (GetQuicReloadableFlag(quic_new_priority_update_frame)) {
+ QUIC_CODE_COUNT_N(quic_new_priority_update_frame, 1, 2);
+
+ if (priority_update.prioritized_element_type != REQUEST_STREAM) {
+ QUIC_BUG << "PRIORITY_UPDATE for push streams not implemented";
+ return 0;
+ }
+
+ QuicByteCount payload_length =
+ QuicDataWriter::GetVarInt62Len(priority_update.prioritized_element_id) +
+ priority_update.priority_field_value.size();
+ QuicByteCount total_length = GetTotalLength(
+ payload_length, HttpFrameType::PRIORITY_UPDATE_REQUEST_STREAM);
+
+ output->reset(new char[total_length]);
+ QuicDataWriter writer(total_length, output->get());
+
+ if (WriteFrameHeader(payload_length,
+ HttpFrameType::PRIORITY_UPDATE_REQUEST_STREAM,
+ &writer) &&
+ writer.WriteVarInt62(priority_update.prioritized_element_id) &&
+ writer.WriteBytes(priority_update.priority_field_value.data(),
+ priority_update.priority_field_value.size())) {
+ return total_length;
+ }
+
+ QUIC_DLOG(ERROR) << "Http encoder failed when attempting to serialize "
+ "PRIORITY_UPDATE frame.";
+ return 0;
+ }
+
QuicByteCount payload_length =
kPriorityFirstByteLength +
QuicDataWriter::GetVarInt62Len(priority_update.prioritized_element_id) +
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/http_encoder_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/http_encoder_test.cc
index f6c04449a39..2466326586c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/http_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/http_encoder_test.cc
@@ -4,9 +4,10 @@
#include "net/third_party/quiche/src/quic/core/http/http_encoder.h"
+#include "absl/base/macros.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
namespace quic {
@@ -20,9 +21,9 @@ TEST(HttpEncoderTest, SerializeDataFrameHeader) {
0x00,
// length
0x05};
- EXPECT_EQ(QUICHE_ARRAYSIZE(output), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output), length);
quiche::test::CompareCharArraysWithHexError("DATA", buffer.get(), length,
- output, QUICHE_ARRAYSIZE(output));
+ output, ABSL_ARRAYSIZE(output));
}
TEST(HttpEncoderTest, SerializeHeadersFrameHeader) {
@@ -33,9 +34,9 @@ TEST(HttpEncoderTest, SerializeHeadersFrameHeader) {
0x01,
// length
0x07};
- EXPECT_EQ(QUICHE_ARRAYSIZE(output), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output), length);
quiche::test::CompareCharArraysWithHexError("HEADERS", buffer.get(), length,
- output, QUICHE_ARRAYSIZE(output));
+ output, ABSL_ARRAYSIZE(output));
}
TEST(HttpEncoderTest, SerializeCancelPushFrame) {
@@ -49,9 +50,9 @@ TEST(HttpEncoderTest, SerializeCancelPushFrame) {
0x01};
std::unique_ptr<char[]> buffer;
uint64_t length = HttpEncoder::SerializeCancelPushFrame(cancel_push, &buffer);
- EXPECT_EQ(QUICHE_ARRAYSIZE(output), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output), length);
quiche::test::CompareCharArraysWithHexError(
- "CANCEL_PUSH", buffer.get(), length, output, QUICHE_ARRAYSIZE(output));
+ "CANCEL_PUSH", buffer.get(), length, output, ABSL_ARRAYSIZE(output));
}
TEST(HttpEncoderTest, SerializeSettingsFrame) {
@@ -77,9 +78,9 @@ TEST(HttpEncoderTest, SerializeSettingsFrame) {
0x04};
std::unique_ptr<char[]> buffer;
uint64_t length = HttpEncoder::SerializeSettingsFrame(settings, &buffer);
- EXPECT_EQ(QUICHE_ARRAYSIZE(output), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output), length);
quiche::test::CompareCharArraysWithHexError("SETTINGS", buffer.get(), length,
- output, QUICHE_ARRAYSIZE(output));
+ output, ABSL_ARRAYSIZE(output));
}
TEST(HttpEncoderTest, SerializePushPromiseFrameWithOnlyPushId) {
@@ -95,9 +96,9 @@ TEST(HttpEncoderTest, SerializePushPromiseFrameWithOnlyPushId) {
std::unique_ptr<char[]> buffer;
uint64_t length = HttpEncoder::SerializePushPromiseFrameWithOnlyPushId(
push_promise, &buffer);
- EXPECT_EQ(QUICHE_ARRAYSIZE(output), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output), length);
quiche::test::CompareCharArraysWithHexError(
- "PUSH_PROMISE", buffer.get(), length, output, QUICHE_ARRAYSIZE(output));
+ "PUSH_PROMISE", buffer.get(), length, output, ABSL_ARRAYSIZE(output));
}
TEST(HttpEncoderTest, SerializeGoAwayFrame) {
@@ -111,9 +112,9 @@ TEST(HttpEncoderTest, SerializeGoAwayFrame) {
0x01};
std::unique_ptr<char[]> buffer;
uint64_t length = HttpEncoder::SerializeGoAwayFrame(goaway, &buffer);
- EXPECT_EQ(QUICHE_ARRAYSIZE(output), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output), length);
quiche::test::CompareCharArraysWithHexError("GOAWAY", buffer.get(), length,
- output, QUICHE_ARRAYSIZE(output));
+ output, ABSL_ARRAYSIZE(output));
}
TEST(HttpEncoderTest, SerializeMaxPushIdFrame) {
@@ -127,12 +128,30 @@ TEST(HttpEncoderTest, SerializeMaxPushIdFrame) {
0x01};
std::unique_ptr<char[]> buffer;
uint64_t length = HttpEncoder::SerializeMaxPushIdFrame(max_push_id, &buffer);
- EXPECT_EQ(QUICHE_ARRAYSIZE(output), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output), length);
quiche::test::CompareCharArraysWithHexError(
- "MAX_PUSH_ID", buffer.get(), length, output, QUICHE_ARRAYSIZE(output));
+ "MAX_PUSH_ID", buffer.get(), length, output, ABSL_ARRAYSIZE(output));
}
TEST(HttpEncoderTest, SerializePriorityUpdateFrame) {
+ if (GetQuicReloadableFlag(quic_new_priority_update_frame)) {
+ PriorityUpdateFrame priority_update1;
+ priority_update1.prioritized_element_type = REQUEST_STREAM;
+ priority_update1.prioritized_element_id = 0x03;
+ char output1[] = {0x80, 0x0f, 0x07, 0x00, // type (PRIORITY_UPDATE)
+ 0x01, // length
+ 0x03}; // prioritized element id
+
+ std::unique_ptr<char[]> buffer;
+ uint64_t length =
+ HttpEncoder::SerializePriorityUpdateFrame(priority_update1, &buffer);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output1), length);
+ quiche::test::CompareCharArraysWithHexError("PRIORITY_UPDATE", buffer.get(),
+ length, output1,
+ ABSL_ARRAYSIZE(output1));
+ return;
+ }
+
PriorityUpdateFrame priority_update1;
priority_update1.prioritized_element_type = REQUEST_STREAM;
priority_update1.prioritized_element_id = 0x03;
@@ -144,10 +163,10 @@ TEST(HttpEncoderTest, SerializePriorityUpdateFrame) {
std::unique_ptr<char[]> buffer;
uint64_t length =
HttpEncoder::SerializePriorityUpdateFrame(priority_update1, &buffer);
- EXPECT_EQ(QUICHE_ARRAYSIZE(output1), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output1), length);
quiche::test::CompareCharArraysWithHexError("PRIORITY_UPDATE", buffer.get(),
length, output1,
- QUICHE_ARRAYSIZE(output1));
+ ABSL_ARRAYSIZE(output1));
PriorityUpdateFrame priority_update2;
priority_update2.prioritized_element_type = PUSH_STREAM;
@@ -159,10 +178,10 @@ TEST(HttpEncoderTest, SerializePriorityUpdateFrame) {
0x05, // prioritized element id
'f', 'o', 'o'}; // priority field value
length = HttpEncoder::SerializePriorityUpdateFrame(priority_update2, &buffer);
- EXPECT_EQ(QUICHE_ARRAYSIZE(output2), length);
+ EXPECT_EQ(ABSL_ARRAYSIZE(output2), length);
quiche::test::CompareCharArraysWithHexError("PRIORITY_UPDATE", buffer.get(),
length, output2,
- QUICHE_ARRAYSIZE(output2));
+ ABSL_ARRAYSIZE(output2));
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/http_frames.h b/chromium/net/third_party/quiche/src/quic/core/http/http_frames.h
index 159b250088e..ed7ad2c2d24 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/http_frames.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/http_frames.h
@@ -9,16 +9,16 @@
#include <map>
#include <ostream>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
namespace quic {
-enum class HttpFrameType : uint8_t {
+enum class HttpFrameType {
DATA = 0x0,
HEADERS = 0x1,
CANCEL_PUSH = 0X3,
@@ -26,7 +26,10 @@ enum class HttpFrameType : uint8_t {
PUSH_PROMISE = 0x5,
GOAWAY = 0x7,
MAX_PUSH_ID = 0xD,
+ // https://tools.ietf.org/html/draft-ietf-httpbis-priority-01
PRIORITY_UPDATE = 0XF,
+ // https://tools.ietf.org/html/draft-ietf-httpbis-priority-02
+ PRIORITY_UPDATE_REQUEST_STREAM = 0xF0700,
};
// 7.2.1. DATA
@@ -34,7 +37,7 @@ enum class HttpFrameType : uint8_t {
// DATA frames (type=0x0) convey arbitrary, variable-length sequences of
// octets associated with an HTTP request or response payload.
struct QUIC_EXPORT_PRIVATE DataFrame {
- quiche::QuicheStringPiece data;
+ absl::string_view data;
};
// 7.2.2. HEADERS
@@ -42,7 +45,7 @@ struct QUIC_EXPORT_PRIVATE DataFrame {
// The HEADERS frame (type=0x1) is used to carry a header block,
// compressed using QPACK.
struct QUIC_EXPORT_PRIVATE HeadersFrame {
- quiche::QuicheStringPiece headers;
+ absl::string_view headers;
};
// 7.2.3. CANCEL_PUSH
@@ -98,7 +101,7 @@ struct QUIC_EXPORT_PRIVATE SettingsFrame {
// set from server to client, as in HTTP/2.
struct QUIC_EXPORT_PRIVATE PushPromiseFrame {
PushId push_id;
- quiche::QuicheStringPiece headers;
+ absl::string_view headers;
bool operator==(const PushPromiseFrame& rhs) const {
return push_id == rhs.push_id && headers == rhs.headers;
@@ -132,8 +135,11 @@ struct QUIC_EXPORT_PRIVATE MaxPushIdFrame {
// https://httpwg.org/http-extensions/draft-ietf-httpbis-priority.html
//
-// The PRIORITY_UPDATE (type=0x0f) frame specifies the sender-advised priority
-// of a stream
+// The PRIORITY_UPDATE frame specifies the sender-advised priority of a stream.
+// https://tools.ietf.org/html/draft-ietf-httpbis-priority-01 uses frame type
+// 0x0f, both for request streams and push streams.
+// https://tools.ietf.org/html/draft-ietf-httpbis-priority-02 uses frame types
+// 0xf0700 for request streams and 0xf0701 for push streams (not implemented).
// Length of a priority frame's first byte.
const QuicByteCount kPriorityFirstByteLength = 1;
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_client_promised_info_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_client_promised_info_test.cc
index 1a1ec691251..9e21f41c50c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_client_promised_info_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_client_promised_info_test.cc
@@ -8,6 +8,7 @@
#include <string>
#include <utility>
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_session.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -52,6 +53,11 @@ class MockQuicSpdyClientSession : public QuicSpdyClientSession {
void set_authorized(bool authorized) { authorized_ = authorized; }
+ MOCK_METHOD(bool,
+ WriteControlFrame,
+ (const QuicFrame& frame, TransmissionType type),
+ (override));
+
private:
QuicCryptoClientConfig crypto_config_;
@@ -73,6 +79,9 @@ class QuicClientPromisedInfoTest : public QuicTest {
promise_id_(
QuicUtils::GetInvalidStreamId(connection_->transport_version())) {
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
session_.Initialize();
headers_[":status"] = "200";
@@ -142,7 +151,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseCleanupAlarm) {
ASSERT_NE(promised, nullptr);
// Fire the alarm that will cancel the promised stream.
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(promise_id_, QUIC_PUSH_STREAM_TIMED_OUT));
alarm_factory_.FireAlarm(QuicClientPromisedInfoPeer::GetAlarm(promised));
@@ -156,7 +165,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseInvalidMethod) {
// Promise with an unsafe method
push_promise_[":method"] = "PUT";
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(promise_id_, QUIC_INVALID_PROMISE_METHOD));
ReceivePromise(promise_id_);
@@ -170,7 +179,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseMissingMethod) {
// Promise with a missing method
push_promise_.erase(":method");
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(promise_id_, QUIC_INVALID_PROMISE_METHOD));
ReceivePromise(promise_id_);
@@ -184,7 +193,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseInvalidUrl) {
// Remove required header field to make URL invalid
push_promise_.erase(":authority");
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(promise_id_, QUIC_INVALID_PROMISE_URL));
ReceivePromise(promise_id_);
@@ -197,7 +206,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseInvalidUrl) {
TEST_F(QuicClientPromisedInfoTest, PushPromiseUnauthorizedUrl) {
session_.set_authorized(false);
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(promise_id_, QUIC_UNAUTHORIZED_PROMISE_URL));
@@ -222,7 +231,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseMismatch) {
headers);
TestPushPromiseDelegate delegate(/*match=*/false);
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(promise_id_, QUIC_PROMISE_VARY_MISMATCH));
@@ -300,7 +309,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseWaitCancels) {
session_.GetOrCreateStream(promise_id_);
// Cancel the promised stream.
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_, OnStreamReset(promise_id_, QUIC_STREAM_CANCELLED));
promised->Cancel();
@@ -323,7 +332,7 @@ TEST_F(QuicClientPromisedInfoTest, PushPromiseDataClosed) {
promise_stream->OnStreamHeaderList(false, headers.uncompressed_header_bytes(),
headers);
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(promise_id_, QUIC_STREAM_PEER_GOING_AWAY));
session_.ResetStream(promise_id_, QUIC_STREAM_PEER_GOING_AWAY);
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.cc
index cbfc2e9f73b..5282f2d852e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.cc
@@ -7,10 +7,10 @@
#include <limits>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,8 +36,7 @@ void QuicHeaderList::OnHeaderBlockStart() {
<< "OnHeaderBlockStart called more than once!";
}
-void QuicHeaderList::OnHeader(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+void QuicHeaderList::OnHeader(absl::string_view name, absl::string_view value) {
// Avoid infinite buffering of headers. No longer store headers
// once the current headers are over the limit.
if (current_header_list_size_ < max_header_list_size_) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.h b/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.h
index 0ed8ae8c4a9..bc3a73bcf41 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_header_list.h
@@ -10,10 +10,10 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
#include "net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h"
@@ -36,8 +36,7 @@ class QUIC_EXPORT_PRIVATE QuicHeaderList
// From SpdyHeadersHandlerInteface.
void OnHeaderBlockStart() override;
- void OnHeader(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) override;
+ void OnHeader(absl::string_view name, absl::string_view value) override;
void OnHeaderBlockEnd(size_t uncompressed_header_bytes,
size_t compressed_header_bytes) override;
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream.cc
index 8157daec788..1cce85f7271 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream.cc
@@ -4,11 +4,11 @@
#include "net/third_party/quiche/src/quic/core/http/quic_headers_stream.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_session.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream_test.cc
index 9e1b08a486b..8f604b37dd4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_headers_stream_test.cc
@@ -11,6 +11,8 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -23,15 +25,16 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
+#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
#include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
using spdy::ERROR_CODE_PROTOCOL_ERROR;
+using spdy::RecordingHeadersHandler;
using spdy::SETTINGS_ENABLE_PUSH;
using spdy::SETTINGS_HEADER_TABLE_SIZE;
using spdy::SETTINGS_INITIAL_WINDOW_SIZE;
@@ -59,7 +62,6 @@ using spdy::SpdySettingsId;
using spdy::SpdySettingsIR;
using spdy::SpdyStreamId;
using spdy::SpdyWindowUpdateIR;
-using spdy::test::TestHeadersHandler;
using testing::_;
using testing::AnyNumber;
using testing::AtLeast;
@@ -150,7 +152,7 @@ class MockVisitor : public SpdyFramerVisitorInterface {
void,
OnAltSvc,
(SpdyStreamId stream_id,
- quiche::QuicheStringPiece origin,
+ absl::string_view origin,
const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector),
(override));
MOCK_METHOD(void,
@@ -226,6 +228,9 @@ class QuicHeadersStreamTest : public QuicTestWithParam<TestParams> {
QuicSpdySessionPeer::SetMaxInboundHeaderListSize(&session_, 256 * 1024);
EXPECT_CALL(session_, OnCongestionWindowChange(_)).Times(AnyNumber());
session_.Initialize();
+ connection_->SetEncrypter(
+ quic::ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<quic::NullEncrypter>(connection_->perspective()));
headers_stream_ = QuicSpdySessionPeer::GetHeadersStream(&session_);
headers_[":status"] = "200 Ok";
headers_["content-length"] = "11";
@@ -271,7 +276,7 @@ class QuicHeadersStreamTest : public QuicTestWithParam<TestParams> {
return true;
}
- void SaveHeaderDataStringPiece(quiche::QuicheStringPiece data) {
+ void SaveHeaderDataStringPiece(absl::string_view data) {
saved_header_data_.append(data.data(), data.length());
}
@@ -290,7 +295,7 @@ class QuicHeadersStreamTest : public QuicTestWithParam<TestParams> {
}
void SaveToHandler(size_t size, const QuicHeaderList& header_list) {
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
headers_handler_->OnHeaderBlockStart();
for (const auto& p : header_list) {
headers_handler_->OnHeader(p.first, p.second);
@@ -335,7 +340,7 @@ class QuicHeadersStreamTest : public QuicTestWithParam<TestParams> {
/*parent_stream_id=*/0,
/*exclusive=*/false, fin, kFrameComplete));
}
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id))
.WillOnce(Return(headers_handler_.get()));
EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id)).Times(1);
@@ -386,7 +391,7 @@ class QuicHeadersStreamTest : public QuicTestWithParam<TestParams> {
StrictMock<MockQuicSpdySession> session_;
QuicHeadersStream* headers_stream_;
SpdyHeaderBlock headers_;
- std::unique_ptr<TestHeadersHandler> headers_handler_;
+ std::unique_ptr<RecordingHeadersHandler> headers_handler_;
std::string body_;
std::string saved_data_;
std::string saved_header_data_;
@@ -445,7 +450,7 @@ TEST_P(QuicHeadersStreamTest, WritePushPromises) {
// Parse the outgoing data and check that it matches was was written.
EXPECT_CALL(visitor_,
OnPushPromise(stream_id, promised_stream_id, kFrameComplete));
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
EXPECT_CALL(visitor_, OnHeaderFrameStart(stream_id))
.WillOnce(Return(headers_handler_.get()));
EXPECT_CALL(visitor_, OnHeaderFrameEnd(stream_id)).Times(1);
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.cc
index 1367a953272..4f5f1cf186c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.cc
@@ -6,13 +6,15 @@
#include <utility>
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_split.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/http/http_decoder.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_session.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -142,7 +144,7 @@ bool QuicReceiveControlStream::OnDataFrameStart(QuicByteCount /*header_length*/,
}
bool QuicReceiveControlStream::OnDataFramePayload(
- quiche::QuicheStringPiece /*payload*/) {
+ absl::string_view /*payload*/) {
OnWrongFrame("Data");
return false;
}
@@ -161,7 +163,7 @@ bool QuicReceiveControlStream::OnHeadersFrameStart(
}
bool QuicReceiveControlStream::OnHeadersFramePayload(
- quiche::QuicheStringPiece /*payload*/) {
+ absl::string_view /*payload*/) {
OnWrongFrame("Headers");
return false;
}
@@ -186,7 +188,7 @@ bool QuicReceiveControlStream::OnPushPromiseFramePushId(
}
bool QuicReceiveControlStream::OnPushPromiseFramePayload(
- quiche::QuicheStringPiece /*payload*/) {
+ absl::string_view /*payload*/) {
OnWrongFrame("Push Promise");
return false;
}
@@ -214,23 +216,23 @@ bool QuicReceiveControlStream::OnPriorityUpdateFrame(
}
// TODO(b/147306124): Use a proper structured headers parser instead.
- for (auto key_value :
- quiche::QuicheTextUtils::Split(frame.priority_field_value, ',')) {
- auto key_and_value = quiche::QuicheTextUtils::Split(key_value, '=');
+ for (absl::string_view key_value :
+ absl::StrSplit(frame.priority_field_value, ',')) {
+ std::vector<absl::string_view> key_and_value =
+ absl::StrSplit(key_value, '=');
if (key_and_value.size() != 2) {
continue;
}
- quiche::QuicheStringPiece key = key_and_value[0];
+ absl::string_view key = key_and_value[0];
quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&key);
if (key != "u") {
continue;
}
- quiche::QuicheStringPiece value = key_and_value[1];
+ absl::string_view value = key_and_value[1];
int urgency;
- if (!quiche::QuicheTextUtils::StringToInt(value, &urgency) || urgency < 0 ||
- urgency > 7) {
+ if (!absl::SimpleAtoi(value, &urgency) || urgency < 0 || urgency > 7) {
stream_delegate()->OnStreamError(
QUIC_INVALID_STREAM_ID,
"Invalid value for PRIORITY_UPDATE urgency parameter.");
@@ -269,7 +271,7 @@ bool QuicReceiveControlStream::OnUnknownFrameStart(
}
bool QuicReceiveControlStream::OnUnknownFramePayload(
- quiche::QuicheStringPiece /*payload*/) {
+ absl::string_view /*payload*/) {
// Ignore unknown frame types.
return true;
}
@@ -279,8 +281,7 @@ bool QuicReceiveControlStream::OnUnknownFrameEnd() {
return true;
}
-void QuicReceiveControlStream::OnWrongFrame(
- quiche::QuicheStringPiece frame_type) {
+void QuicReceiveControlStream::OnWrongFrame(absl::string_view frame_type) {
OnUnrecoverableError(
QUIC_HTTP_FRAME_UNEXPECTED_ON_CONTROL_STREAM,
quiche::QuicheStrCat(frame_type, " frame received on control stream"));
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h b/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h
index 7fd02b495f6..2654bb8e549 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h
@@ -42,24 +42,24 @@ class QUIC_EXPORT_PRIVATE QuicReceiveControlStream
bool OnSettingsFrame(const SettingsFrame& frame) override;
bool OnDataFrameStart(QuicByteCount header_length,
QuicByteCount payload_length) override;
- bool OnDataFramePayload(quiche::QuicheStringPiece payload) override;
+ bool OnDataFramePayload(absl::string_view payload) override;
bool OnDataFrameEnd() override;
bool OnHeadersFrameStart(QuicByteCount header_length,
QuicByteCount payload_length) override;
- bool OnHeadersFramePayload(quiche::QuicheStringPiece payload) override;
+ bool OnHeadersFramePayload(absl::string_view payload) override;
bool OnHeadersFrameEnd() override;
bool OnPushPromiseFrameStart(QuicByteCount header_length) override;
bool OnPushPromiseFramePushId(PushId push_id,
QuicByteCount push_id_length,
QuicByteCount header_block_length) override;
- bool OnPushPromiseFramePayload(quiche::QuicheStringPiece payload) override;
+ bool OnPushPromiseFramePayload(absl::string_view payload) override;
bool OnPushPromiseFrameEnd() override;
bool OnPriorityUpdateFrameStart(QuicByteCount header_length) override;
bool OnPriorityUpdateFrame(const PriorityUpdateFrame& frame) override;
bool OnUnknownFrameStart(uint64_t frame_type,
QuicByteCount header_length,
QuicByteCount payload_length) override;
- bool OnUnknownFramePayload(quiche::QuicheStringPiece payload) override;
+ bool OnUnknownFramePayload(absl::string_view payload) override;
bool OnUnknownFrameEnd() override;
void SetUnblocked() { sequencer()->SetUnblocked(); }
@@ -67,7 +67,7 @@ class QUIC_EXPORT_PRIVATE QuicReceiveControlStream
QuicSpdySession* spdy_session() { return spdy_session_; }
private:
- void OnWrongFrame(quiche::QuicheStringPiece frame_type);
+ void OnWrongFrame(absl::string_view frame_type);
// False until a SETTINGS frame is received.
bool settings_frame_received_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream_test.cc
index 5ee5f50e785..5a401b68019 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_receive_control_stream_test.cc
@@ -4,6 +4,8 @@
#include "net/third_party/quiche/src/quic/core/http/quic_receive_control_stream.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -13,7 +15,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -96,7 +97,7 @@ class QuicReceiveControlStreamTest : public QuicTestWithParam<TestParams> {
session_.transport_version(), 3);
char type[] = {kControlStream};
- QuicStreamFrame data1(id, false, 0, quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(id, false, 0, absl::string_view(type, 1));
session_.OnStreamFrame(data1);
receive_control_stream_ =
@@ -336,7 +337,7 @@ TEST_P(QuicReceiveControlStreamTest, ConsumeUnknownFrame) {
EXPECT_EQ(offset, NumBytesConsumed());
// Receive unknown frame.
- std::string unknown_frame = quiche::QuicheTextUtils::HexDecode(
+ std::string unknown_frame = absl::HexStringToBytes(
"21" // reserved frame type
"03" // payload length
"666f6f"); // payload "foo"
@@ -365,7 +366,7 @@ TEST_P(QuicReceiveControlStreamTest, ReceiveUnknownFrame) {
offset += settings_frame.length();
// Receive unknown frame.
- std::string unknown_frame = quiche::QuicheTextUtils::HexDecode(
+ std::string unknown_frame = absl::HexStringToBytes(
"21" // reserved frame type
"03" // payload length
"666f6f"); // payload "foo"
@@ -377,7 +378,7 @@ TEST_P(QuicReceiveControlStreamTest, ReceiveUnknownFrame) {
}
TEST_P(QuicReceiveControlStreamTest, CancelPushFrameBeforeSettings) {
- std::string cancel_push_frame = quiche::QuicheTextUtils::HexDecode(
+ std::string cancel_push_frame = absl::HexStringToBytes(
"03" // type CANCEL_PUSH
"01" // payload length
"01"); // push ID
@@ -396,7 +397,7 @@ TEST_P(QuicReceiveControlStreamTest, CancelPushFrameBeforeSettings) {
}
TEST_P(QuicReceiveControlStreamTest, UnknownFrameBeforeSettings) {
- std::string unknown_frame = quiche::QuicheTextUtils::HexDecode(
+ std::string unknown_frame = absl::HexStringToBytes(
"21" // reserved frame type
"03" // payload length
"666f6f"); // payload "foo"
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream.cc
index c7f1b381799..939c32724db 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream.cc
@@ -6,6 +6,8 @@
#include <cstdint>
#include <memory>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_session.h"
@@ -13,8 +15,6 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -45,10 +45,10 @@ void QuicSendControlStream::MaybeSendSettingsFrame() {
QuicConnection::ScopedPacketFlusher flusher(session()->connection());
// Send the stream type on so the peer knows about this stream.
char data[sizeof(kControlStream)];
- QuicDataWriter writer(QUICHE_ARRAYSIZE(data), data);
+ QuicDataWriter writer(ABSL_ARRAYSIZE(data), data);
writer.WriteVarInt62(kControlStream);
- WriteOrBufferData(quiche::QuicheStringPiece(writer.data(), writer.length()),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(writer.data(), writer.length()), false,
+ nullptr);
SettingsFrame settings = settings_;
// https://tools.ietf.org/html/draft-ietf-quic-http-25#section-7.2.4.1
@@ -72,7 +72,7 @@ void QuicSendControlStream::MaybeSendSettingsFrame() {
if (spdy_session_->debug_visitor()) {
spdy_session_->debug_visitor()->OnSettingsFrameSent(settings);
}
- WriteOrBufferData(quiche::QuicheStringPiece(buffer.get(), frame_length),
+ WriteOrBufferData(absl::string_view(buffer.get(), frame_length),
/*fin = */ false, nullptr);
settings_sent_ = true;
@@ -81,7 +81,7 @@ void QuicSendControlStream::MaybeSendSettingsFrame() {
// discarded. A greasing frame is added here.
std::unique_ptr<char[]> grease;
QuicByteCount grease_length = HttpEncoder::SerializeGreasingFrame(&grease);
- WriteOrBufferData(quiche::QuicheStringPiece(grease.get(), grease_length),
+ WriteOrBufferData(absl::string_view(grease.get(), grease_length),
/*fin = */ false, nullptr);
}
@@ -99,8 +99,8 @@ void QuicSendControlStream::WritePriorityUpdate(
HttpEncoder::SerializePriorityUpdateFrame(priority_update, &buffer);
QUIC_DVLOG(1) << "Control Stream " << id() << " is writing "
<< priority_update;
- WriteOrBufferData(quiche::QuicheStringPiece(buffer.get(), frame_length),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(buffer.get(), frame_length), false,
+ nullptr);
}
void QuicSendControlStream::SendMaxPushIdFrame(PushId max_push_id) {
@@ -117,7 +117,7 @@ void QuicSendControlStream::SendMaxPushIdFrame(PushId max_push_id) {
std::unique_ptr<char[]> buffer;
QuicByteCount frame_length =
HttpEncoder::SerializeMaxPushIdFrame(frame, &buffer);
- WriteOrBufferData(quiche::QuicheStringPiece(buffer.get(), frame_length),
+ WriteOrBufferData(absl::string_view(buffer.get(), frame_length),
/*fin = */ false, nullptr);
}
@@ -140,8 +140,8 @@ void QuicSendControlStream::SendGoAway(QuicStreamId id) {
std::unique_ptr<char[]> buffer;
QuicByteCount frame_length =
HttpEncoder::SerializeGoAwayFrame(frame, &buffer);
- WriteOrBufferData(quiche::QuicheStringPiece(buffer.get(), frame_length),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(buffer.get(), frame_length), false,
+ nullptr);
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream_test.cc
index 284708de0a0..4f1b461d0f5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_send_control_stream_test.cc
@@ -6,11 +6,13 @@
#include <utility>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_config_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -81,6 +83,9 @@ class QuicSendControlStreamTest : public QuicTestWithParam<TestParams> {
void Initialize() {
EXPECT_CALL(session_, OnCongestionWindowChange(_)).Times(AnyNumber());
session_.Initialize();
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
send_control_stream_ = QuicSpdySessionPeer::GetSendControlStream(&session_);
QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(
session_.config(), kMinimumFlowControlSendWindow);
@@ -113,7 +118,7 @@ TEST_P(QuicSendControlStreamTest, WriteSettings) {
Initialize();
testing::InSequence s;
- std::string expected_write_data = quiche::QuicheTextUtils::HexDecode(
+ std::string expected_write_data = absl::HexStringToBytes(
"00" // stream type: control stream
"04" // frame type: SETTINGS frame
"0b" // frame length
@@ -138,7 +143,7 @@ TEST_P(QuicSendControlStreamTest, WriteSettings) {
[&writer, this](QuicStreamId /*id*/, size_t write_length,
QuicStreamOffset offset, StreamSendingState /*state*/,
TransmissionType /*type*/,
- quiche::QuicheOptional<EncryptionLevel> /*level*/) {
+ absl::optional<EncryptionLevel> /*level*/) {
send_control_stream_->WriteStreamData(offset, write_length, &writer);
return QuicConsumedData(/* bytes_consumed = */ write_length,
/* fin_consumed = */ false);
@@ -154,7 +159,7 @@ TEST_P(QuicSendControlStreamTest, WriteSettings) {
send_control_stream_->MaybeSendSettingsFrame();
EXPECT_EQ(expected_write_data,
- quiche::QuicheStringPiece(writer.data(), writer.length()));
+ absl::string_view(writer.data(), writer.length()));
}
TEST_P(QuicSendControlStreamTest, WriteSettingsOnlyOnce) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_server_session_base_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_server_session_base_test.cc
index 61303de9fce..4abde4262ac 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_server_session_base_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_server_session_base_test.cc
@@ -9,6 +9,7 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
@@ -39,7 +40,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using testing::_;
using testing::StrictMock;
@@ -71,6 +71,11 @@ class TestServerSession : public QuicServerSessionBase {
~TestServerSession() override { DeleteConnection(); }
+ MOCK_METHOD(bool,
+ WriteControlFrame,
+ (const QuicFrame& frame, TransmissionType type),
+ (override));
+
protected:
QuicSpdyStream* CreateIncomingStream(QuicStreamId id) override {
if (!ShouldCreateIncomingStream(id)) {
@@ -147,6 +152,9 @@ class QuicServerSessionBaseTest : public QuicTestWithParam<ParsedQuicVersion> {
connection_ = new StrictMock<MockQuicConnection>(
&helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions);
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
session_ = std::make_unique<TestServerSession>(
config_, connection_, &owner_, &stream_helper_, &crypto_config_,
&compressed_certs_cache_, &memory_cache_backend_);
@@ -193,7 +201,7 @@ class QuicServerSessionBaseTest : public QuicTestWithParam<ParsedQuicVersion> {
EXPECT_CALL(owner_, OnStopSendingReceived(_)).Times(1);
// Expect the RESET_STREAM that is generated in response to receiving a
// STOP_SENDING.
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(stream_id, QUIC_ERROR_PROCESSING_STREAM));
session_->OnStopSendingFrame(stop_sending);
@@ -237,7 +245,7 @@ TEST_P(QuicServerSessionBaseTest, CloseStreamDueToReset) {
// Open a stream, then reset it.
// Send two bytes of payload to open it.
QuicStreamFrame data1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
session_->OnStreamFrame(data1);
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
@@ -249,7 +257,7 @@ TEST_P(QuicServerSessionBaseTest, CloseStreamDueToReset) {
if (!VersionHasIetfQuicFrames(transport_version())) {
// For non-version 99, the RESET_STREAM will do the full close.
// Set up expects accordingly.
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(GetNthClientInitiatedBidirectionalId(0),
QUIC_RST_ACKNOWLEDGEMENT));
@@ -278,7 +286,7 @@ TEST_P(QuicServerSessionBaseTest, NeverOpenStreamDueToReset) {
if (!VersionHasIetfQuicFrames(transport_version())) {
// For non-version 99, the RESET_STREAM will do the full close.
// Set up expects accordingly.
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(GetNthClientInitiatedBidirectionalId(0),
QUIC_RST_ACKNOWLEDGEMENT));
@@ -292,7 +300,7 @@ TEST_P(QuicServerSessionBaseTest, NeverOpenStreamDueToReset) {
EXPECT_EQ(0u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
// Send two bytes of payload.
QuicStreamFrame data1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
session_->OnStreamFrame(data1);
// The stream should never be opened, now that the reset is received.
@@ -303,9 +311,9 @@ TEST_P(QuicServerSessionBaseTest, NeverOpenStreamDueToReset) {
TEST_P(QuicServerSessionBaseTest, AcceptClosedStream) {
// Send (empty) compressed headers followed by two bytes of data.
QuicStreamFrame frame1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("\1\0\0\0\0\0\0\0HT"));
+ absl::string_view("\1\0\0\0\0\0\0\0HT"));
QuicStreamFrame frame2(GetNthClientInitiatedBidirectionalId(1), false, 0,
- quiche::QuicheStringPiece("\2\0\0\0\0\0\0\0HT"));
+ absl::string_view("\3\0\0\0\0\0\0\0HT"));
session_->OnStreamFrame(frame1);
session_->OnStreamFrame(frame2);
EXPECT_EQ(2u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
@@ -318,7 +326,7 @@ TEST_P(QuicServerSessionBaseTest, AcceptClosedStream) {
if (!VersionHasIetfQuicFrames(transport_version())) {
// For non-version 99, the RESET_STREAM will do the full close.
// Set up expects accordingly.
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(GetNthClientInitiatedBidirectionalId(0),
QUIC_RST_ACKNOWLEDGEMENT));
@@ -333,9 +341,9 @@ TEST_P(QuicServerSessionBaseTest, AcceptClosedStream) {
// past the reset point of stream 3. As it's a closed stream we just drop the
// data on the floor, but accept the packet because it has data for stream 5.
QuicStreamFrame frame3(GetNthClientInitiatedBidirectionalId(0), false, 2,
- quiche::QuicheStringPiece("TP"));
+ absl::string_view("TP"));
QuicStreamFrame frame4(GetNthClientInitiatedBidirectionalId(1), false, 2,
- quiche::QuicheStringPiece("TP"));
+ absl::string_view("TP"));
session_->OnStreamFrame(frame3);
session_->OnStreamFrame(frame4);
// The stream should never be opened, now that the reset is received.
@@ -348,9 +356,6 @@ TEST_P(QuicServerSessionBaseTest, MaxOpenStreams) {
// streams. For versions other than version 99, the server accepts slightly
// more than the negotiated stream limit to deal with rare cases where a
// client FIN/RST is lost.
- connection_->SetEncrypter(
- ENCRYPTION_FORWARD_SECURE,
- std::make_unique<NullEncrypter>(session_->perspective()));
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
session_->OnConfigNegotiated();
if (!VersionHasIetfQuicFrames(transport_version())) {
@@ -387,7 +392,7 @@ TEST_P(QuicServerSessionBaseTest, MaxOpenStreams) {
// For non-version 99, QUIC responds to an attempt to exceed the stream
// limit by resetting the stream.
EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0);
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_, OnStreamReset(stream_id, QUIC_REFUSED_STREAM));
} else {
// In version 99 QUIC responds to an attempt to exceed the stream limit by
@@ -403,9 +408,6 @@ TEST_P(QuicServerSessionBaseTest, MaxAvailableBidirectionalStreams) {
// Test that the server closes the connection if a client makes too many data
// streams available. The server accepts slightly more than the negotiated
// stream limit to deal with rare cases where a client FIN/RST is lost.
- connection_->SetEncrypter(
- ENCRYPTION_FORWARD_SECURE,
- std::make_unique<NullEncrypter>(session_->perspective()));
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
session_->OnConfigNegotiated();
const size_t kAvailableStreamLimit =
@@ -512,9 +514,6 @@ TEST_P(QuicServerSessionBaseTest, BandwidthEstimates) {
QuicTagVector copt;
copt.push_back(kBWRE);
QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt);
- connection_->SetEncrypter(
- ENCRYPTION_FORWARD_SECURE,
- std::make_unique<NullEncrypter>(session_->perspective()));
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
session_->OnConfigNegotiated();
EXPECT_TRUE(
@@ -706,9 +705,6 @@ TEST_P(QuicServerSessionBaseTest, BandwidthMaxEnablesResumption) {
QuicTagVector copt;
copt.push_back(kBWMX);
QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt);
- connection_->SetEncrypter(
- ENCRYPTION_FORWARD_SECURE,
- std::make_unique<NullEncrypter>(session_->perspective()));
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
session_->OnConfigNegotiated();
EXPECT_TRUE(
@@ -718,9 +714,6 @@ TEST_P(QuicServerSessionBaseTest, BandwidthMaxEnablesResumption) {
TEST_P(QuicServerSessionBaseTest, NoBandwidthResumptionByDefault) {
EXPECT_FALSE(
QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get()));
- connection_->SetEncrypter(
- ENCRYPTION_FORWARD_SECURE,
- std::make_unique<NullEncrypter>(session_->perspective()));
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
session_->OnConfigNegotiated();
EXPECT_FALSE(
@@ -736,9 +729,6 @@ TEST_P(QuicServerSessionBaseTest, TurnOffServerPush) {
QuicTagVector copt;
copt.push_back(kQNSP);
QuicConfigPeer::SetReceivedConnectionOptions(session_->config(), copt);
- connection_->SetEncrypter(
- ENCRYPTION_FORWARD_SECURE,
- std::make_unique<NullEncrypter>(session_->perspective()));
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
session_->OnConfigNegotiated();
EXPECT_FALSE(session_->server_push_enabled());
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_session_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_session_test.cc
index c3fc0e0ff76..5444c9d9d55 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_session_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_session_test.cc
@@ -9,6 +9,8 @@
#include <utility>
#include <vector>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
@@ -36,9 +38,7 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_session_cache.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using spdy::SpdyHeaderBlock;
using ::testing::_;
@@ -121,6 +121,9 @@ class QuicSpdyClientSessionTest : public QuicTestWithParam<ParsedQuicVersion> {
QuicServerId(kServerHostname, kPort, false),
client_crypto_config_.get(), &push_promise_index_);
session_->Initialize();
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
crypto_stream_ = static_cast<QuicCryptoClientStream*>(
session_->GetMutableCryptoStream());
push_promise_[":path"] = "/bar";
@@ -280,8 +283,8 @@ TEST_P(QuicSpdyClientSessionTest, NoEncryptionAfterInitialEncryption) {
// Verify that no data may be send on existing streams.
char data[] = "hello world";
EXPECT_QUIC_BUG(
- session_->WritevData(stream->id(), QUICHE_ARRAYSIZE(data), 0, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT),
+ session_->WritevData(stream->id(), ABSL_ARRAYSIZE(data), 0, NO_FIN,
+ NOT_RETRANSMISSION, ENCRYPTION_INITIAL),
"Client: Try to send data of stream");
}
@@ -294,7 +297,7 @@ TEST_P(QuicSpdyClientSessionTest, MaxNumStreamsWithNoFinOrRst) {
EXPECT_FALSE(session_->CreateOutgoingBidirectionalStream());
// Close the stream, but without having received a FIN or a RST_STREAM
- // or MAX_STREAMS (V99) and check that a new one can not be created.
+ // or MAX_STREAMS (IETF QUIC) and check that a new one can not be created.
session_->ResetStream(stream->id(), QUIC_STREAM_CANCELLED);
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
@@ -317,7 +320,7 @@ TEST_P(QuicSpdyClientSessionTest, MaxNumStreamsWithRst) {
// Check that a new one can be created.
EXPECT_EQ(0u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
- // In V99 the stream limit increases only if we get a MAX_STREAMS
+ // In IETF QUIC the stream limit increases only if we get a MAX_STREAMS
// frame; pretend we got one.
QuicMaxStreamsFrame frame(0, 2,
@@ -330,7 +333,7 @@ TEST_P(QuicSpdyClientSessionTest, MaxNumStreamsWithRst) {
// Ensure that we have 2 total streams, 1 open and 1 closed.
QuicStreamCount expected_stream_count = 2;
EXPECT_EQ(expected_stream_count,
- QuicSessionPeer::v99_bidirectional_stream_id_manager(&*session_)
+ QuicSessionPeer::ietf_bidirectional_stream_id_manager(&*session_)
->outgoing_stream_count());
}
}
@@ -347,7 +350,7 @@ TEST_P(QuicSpdyClientSessionTest, ResetAndTrailers) {
ASSERT_NE(nullptr, stream);
if (VersionHasIetfQuicFrames(GetParam().transport_version)) {
- // For v99, trying to open a stream and failing due to lack
+ // For IETF QUIC, trying to open a stream and failing due to lack
// of stream ids will result in a STREAMS_BLOCKED. Make
// sure we get one. Also clear out the frame because if it's
// left sitting, the later SendRstStream will not actually
@@ -399,7 +402,7 @@ TEST_P(QuicSpdyClientSessionTest, ResetAndTrailers) {
// Ensure that we have 2 open streams.
QuicStreamCount expected_stream_count = 2;
EXPECT_EQ(expected_stream_count,
- QuicSessionPeer::v99_bidirectional_stream_id_manager(&*session_)
+ QuicSessionPeer::ietf_bidirectional_stream_id_manager(&*session_)
->outgoing_stream_count());
}
}
@@ -448,7 +451,7 @@ TEST_P(QuicSpdyClientSessionTest, OnStreamHeaderListWithStaticStream) {
connection_->transport_version(), 3);
char type[] = {0x00};
- QuicStreamFrame data1(id, false, 0, quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(id, false, 0, absl::string_view(type, 1));
session_->OnStreamFrame(data1);
} else {
id = QuicUtils::GetHeadersStreamId(connection_->transport_version());
@@ -478,7 +481,7 @@ TEST_P(QuicSpdyClientSessionTest, OnPromiseHeaderListWithStaticStream) {
connection_->transport_version(), 3);
char type[] = {0x00};
- QuicStreamFrame data1(id, false, 0, quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(id, false, 0, absl::string_view(type, 1));
session_->OnStreamFrame(data1);
} else {
id = QuicUtils::GetHeadersStreamId(connection_->transport_version());
@@ -766,6 +769,7 @@ TEST_P(QuicSpdyClientSessionTest, PushPromiseDuplicateUrl) {
}
TEST_P(QuicSpdyClientSessionTest, ReceivingPromiseEnhanceYourCalm) {
+ CompleteCryptoHandshake();
for (size_t i = 0u; i < session_->get_max_promises(); i++) {
push_promise_[":path"] = quiche::QuicheStringPrintf("/bar%zu", i);
@@ -1022,7 +1026,7 @@ TEST_P(QuicSpdyClientSessionTest, IetfZeroRttSetup) {
EXPECT_EQ(kInitialSessionFlowControlWindowForTest,
session_->flow_controller()->send_window_offset());
if (session_->version().UsesHttp3()) {
- auto* id_manager = QuicSessionPeer::v99_streamid_manager(session_.get());
+ auto* id_manager = QuicSessionPeer::ietf_streamid_manager(session_.get());
EXPECT_EQ(kDefaultMaxStreamsPerConnection,
id_manager->max_outgoing_bidirectional_streams());
EXPECT_EQ(
@@ -1055,7 +1059,7 @@ TEST_P(QuicSpdyClientSessionTest, IetfZeroRttSetup) {
EXPECT_EQ(kInitialSessionFlowControlWindowForTest + 1,
session_->flow_controller()->send_window_offset());
if (session_->version().UsesHttp3()) {
- auto* id_manager = QuicSessionPeer::v99_streamid_manager(session_.get());
+ auto* id_manager = QuicSessionPeer::ietf_streamid_manager(session_.get());
auto* control_stream =
QuicSpdySessionPeer::GetSendControlStream(session_.get());
EXPECT_EQ(kDefaultMaxStreamsPerConnection + 1,
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.cc
index f50e756d1b3..f4bbca55850 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.cc
@@ -6,12 +6,12 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/quic_client_promised_info.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_session.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_alarm.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
using spdy::SpdyHeaderBlock;
@@ -158,7 +158,7 @@ void QuicSpdyClientStream::OnBodyAvailable() {
}
size_t QuicSpdyClientStream::SendRequest(SpdyHeaderBlock headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin) {
QuicConnection::ScopedPacketFlusher flusher(session_->connection());
bool send_fin_with_headers = fin && body.empty();
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h
index dfb9270ae78..e426db7baf4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h
@@ -8,9 +8,9 @@
#include <cstddef>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
namespace quic {
@@ -52,7 +52,7 @@ class QUIC_NO_EXPORT QuicSpdyClientStream : public QuicSpdyStream {
// Serializes the headers and body, sends it to the server, and
// returns the number of bytes sent.
size_t SendRequest(spdy::SpdyHeaderBlock headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin);
// Returns the response data.
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream_test.cc
index c8653ed3129..90d4ee13e9c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream_test.cc
@@ -8,6 +8,7 @@
#include <string>
#include <utility>
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_session.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -46,6 +47,11 @@ class MockQuicSpdyClientSession : public QuicSpdyClientSession {
delete;
~MockQuicSpdyClientSession() override = default;
+ MOCK_METHOD(bool,
+ WriteControlFrame,
+ (const QuicFrame& frame, TransmissionType type),
+ (override));
+
using QuicSession::ActivateStream;
private:
@@ -68,7 +74,9 @@ class QuicSpdyClientStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
body_("hello world") {
session_.Initialize();
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
-
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
headers_[":status"] = "200";
headers_["content-length"] = "11";
@@ -109,7 +117,7 @@ INSTANTIATE_TEST_SUITE_P(Tests,
TEST_P(QuicSpdyClientStreamTest, TestReceivingIllegalResponseStatusCode) {
headers_[":status"] = "200 ok";
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(stream_->id(), QUIC_BAD_APPLICATION_PAYLOAD));
auto headers = AsHeaderList(headers_);
@@ -200,7 +208,7 @@ TEST_P(QuicSpdyClientStreamTest, TestReceiving101) {
// 101 "Switching Protocols" is forbidden in HTTP/3 as per the
// "HTTP Upgrade" section of draft-ietf-quic-http.
headers_[":status"] = "101";
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(stream_->id(), QUIC_BAD_APPLICATION_PAYLOAD));
auto headers = AsHeaderList(headers_);
@@ -246,7 +254,7 @@ TEST_P(QuicSpdyClientStreamTest,
std::string data = VersionUsesHttp3(connection_->transport_version())
? header + large_body
: large_body;
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(session_, WriteControlFrame(_, _));
EXPECT_CALL(*connection_,
OnStreamReset(stream_->id(), QUIC_BAD_APPLICATION_PAYLOAD));
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base.cc
index 2e2e2ec4cda..aee50456d05 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base.cc
@@ -28,7 +28,11 @@ void QuicSpdyServerStreamBase::CloseWriteSide() {
DCHECK(fin_sent() || !session()->connection()->connected());
// Tell the peer to stop sending further data.
QUIC_DVLOG(1) << " Server: Send QUIC_STREAM_NO_ERROR on stream " << id();
- Reset(QUIC_STREAM_NO_ERROR);
+ if (session()->split_up_send_rst()) {
+ MaybeSendStopSending(QUIC_STREAM_NO_ERROR);
+ } else {
+ Reset(QUIC_STREAM_NO_ERROR);
+ }
}
QuicSpdyStream::CloseWriteSide();
@@ -40,7 +44,11 @@ void QuicSpdyServerStreamBase::StopReading() {
DCHECK(fin_sent());
// Tell the peer to stop sending further data.
QUIC_DVLOG(1) << " Server: Send QUIC_STREAM_NO_ERROR on stream " << id();
- Reset(QUIC_STREAM_NO_ERROR);
+ if (session()->split_up_send_rst()) {
+ MaybeSendStopSending(QUIC_STREAM_NO_ERROR);
+ } else {
+ Reset(QUIC_STREAM_NO_ERROR);
+ }
}
QuicSpdyStream::StopReading();
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base_test.cc
index 1d08da3d568..4505cd0ce50 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base_test.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
@@ -33,6 +34,9 @@ class QuicSpdyServerStreamBaseTest : public QuicTest {
&alarm_factory_,
Perspective::IS_SERVER)) {
session_.Initialize();
+ session_.connection()->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(session_.perspective()));
stream_ =
new TestQuicSpdyServerStream(GetNthClientInitiatedBidirectionalStreamId(
session_.transport_version(), 0),
@@ -50,7 +54,19 @@ class QuicSpdyServerStreamBaseTest : public QuicTest {
TEST_F(QuicSpdyServerStreamBaseTest,
SendQuicRstStreamNoErrorWithEarlyResponse) {
stream_->StopReading();
- EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _)).Times(1);
+
+ if (!session_.split_up_send_rst()) {
+ EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _))
+ .Times(1);
+ } else {
+ if (session_.version().UsesHttp3()) {
+ EXPECT_CALL(session_, MaybeSendStopSendingFrame(_, QUIC_STREAM_NO_ERROR))
+ .Times(1);
+ } else {
+ EXPECT_CALL(session_, MaybeSendRstStreamFrame(_, QUIC_STREAM_NO_ERROR, _))
+ .Times(1);
+ }
+ }
QuicStreamPeer::SetFinSent(stream_);
stream_->CloseWriteSide();
}
@@ -61,14 +77,25 @@ TEST_F(QuicSpdyServerStreamBaseTest,
EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _)).Times(0);
- EXPECT_CALL(
- session_,
- SendRstStream(_,
+ if (!session_.split_up_send_rst()) {
+ EXPECT_CALL(
+ session_,
+ SendRstStream(_,
+ VersionHasIetfQuicFrames(session_.transport_version())
+ ? QUIC_STREAM_CANCELLED
+ : QUIC_RST_ACKNOWLEDGEMENT,
+ _, _))
+ .Times(1);
+ } else {
+ EXPECT_CALL(session_,
+ MaybeSendRstStreamFrame(
+ _,
VersionHasIetfQuicFrames(session_.transport_version())
? QUIC_STREAM_CANCELLED
: QUIC_RST_ACKNOWLEDGEMENT,
- _, _))
- .Times(1);
+ _))
+ .Times(1);
+ }
QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
QUIC_STREAM_CANCELLED, 1234);
stream_->OnStreamReset(rst_frame);
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc
index 0f806f70bae..581a4fa79ae 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.cc
@@ -10,6 +10,9 @@
#include <string>
#include <utility>
+#include "absl/base/attributes.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/http/quic_headers_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
@@ -18,13 +21,11 @@
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_exported_stats.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_stack_trace.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
@@ -405,7 +406,12 @@ QuicSpdySession::QuicSpdySession(
ietf_server_push_enabled_(
GetQuicFlag(FLAGS_quic_enable_http3_server_push)),
http3_max_push_id_sent_(false),
- reject_spdy_settings_(GetQuicReloadableFlag(quic_reject_spdy_settings)) {
+ reject_spdy_settings_(GetQuicReloadableFlag(quic_reject_spdy_settings)),
+ goaway_with_max_stream_id_(
+ GetQuicReloadableFlag(quic_goaway_with_max_stream_id)) {
+ if (goaway_with_max_stream_id_) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_goaway_with_max_stream_id, 1, 2);
+ }
h2_deframer_.set_visitor(spdy_framer_visitor_.get());
h2_deframer_.set_debug_visitor(spdy_framer_visitor_.get());
spdy_framer_.set_debug_visitor(spdy_framer_visitor_.get());
@@ -476,21 +482,21 @@ void QuicSpdySession::FillSettingsFrame() {
max_inbound_header_list_size_;
}
-void QuicSpdySession::OnDecoderStreamError(
- quiche::QuicheStringPiece error_message) {
+void QuicSpdySession::OnDecoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) {
DCHECK(VersionUsesHttp3(transport_version()));
CloseConnectionWithDetails(
- QUIC_QPACK_DECODER_STREAM_ERROR,
+ error_code,
quiche::QuicheStrCat("Decoder stream error: ", error_message));
}
-void QuicSpdySession::OnEncoderStreamError(
- quiche::QuicheStringPiece error_message) {
+void QuicSpdySession::OnEncoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) {
DCHECK(VersionUsesHttp3(transport_version()));
CloseConnectionWithDetails(
- QUIC_QPACK_ENCODER_STREAM_ERROR,
+ error_code,
quiche::QuicheStrCat("Encoder stream error: ", error_message));
}
@@ -524,8 +530,7 @@ void QuicSpdySession::OnStreamHeaderList(QuicStreamId stream_id,
const std::string& header_key = header.first;
const std::string& header_value = header.second;
if (header_key == kFinalOffsetHeaderKey) {
- if (!quiche::QuicheTextUtils::StringToSizeT(header_value,
- &final_byte_offset)) {
+ if (!absl::SimpleAtoi(header_value, &final_byte_offset)) {
connection()->CloseConnection(
QUIC_INVALID_HEADERS_STREAM_DATA,
"Trailers are malformed (no final offset)",
@@ -646,7 +651,7 @@ size_t QuicSpdySession::WritePriority(QuicStreamId id,
SpdyPriorityIR priority_frame(id, parent_stream_id, weight, exclusive);
SpdySerializedFrame frame(spdy_framer_.SerializeFrame(priority_frame));
headers_stream()->WriteOrBufferData(
- quiche::QuicheStringPiece(frame.data(), frame.size()), false, nullptr);
+ absl::string_view(frame.data(), frame.size()), false, nullptr);
return frame.size();
}
@@ -714,26 +719,46 @@ void QuicSpdySession::SendHttp3GoAway() {
DCHECK_EQ(perspective(), Perspective::IS_SERVER);
DCHECK(VersionUsesHttp3(transport_version()));
- QuicStreamId stream_id =
- GetLargestPeerCreatedStreamId(/*unidirectional = */ false);
+ QuicStreamId stream_id;
- if (GetQuicReloadableFlag(quic_fix_http3_goaway_stream_id)) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_fix_http3_goaway_stream_id);
- if (stream_id == QuicUtils::GetInvalidStreamId(transport_version())) {
- // No client-initiated bidirectional streams received yet.
- // Send 0 to let client know that all requests can be retried.
- stream_id = 0;
- } else {
- // Tell client that streams starting with the next after the largest
- // received one can be retried.
- stream_id += QuicUtils::StreamIdDelta(transport_version());
+ if (goaway_with_max_stream_id_) {
+ stream_id = QuicUtils::GetMaxClientInitiatedBidirectionalStreamId(
+ transport_version());
+ if (last_sent_http3_goaway_id_.has_value()) {
+ if (last_sent_http3_goaway_id_.value() == stream_id) {
+ // Do not send GOAWAY twice.
+ return;
+ }
+ if (last_sent_http3_goaway_id_.value() < stream_id) {
+ // A previous GOAWAY frame was sent with smaller stream ID. This is not
+ // possible, because the only time a GOAWAY frame with non-maximal
+ // stream ID is sent is right before closing connection.
+ QUIC_BUG << "GOAWAY frame with smaller ID already sent.";
+ return;
+ }
}
- if (last_sent_http3_goaway_id_.has_value() &&
- last_sent_http3_goaway_id_.value() <= stream_id) {
- // MUST not send GOAWAY with identifier larger than previously sent.
- // Do not bother sending one with same identifier as before, since GOAWAY
- // frames on the control stream are guaranteed to be processed in order.
- return;
+ } else {
+ stream_id = GetLargestPeerCreatedStreamId(/*unidirectional = */ false);
+
+ if (GetQuicReloadableFlag(quic_fix_http3_goaway_stream_id)) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_fix_http3_goaway_stream_id);
+ if (stream_id == QuicUtils::GetInvalidStreamId(transport_version())) {
+ // No client-initiated bidirectional streams received yet.
+ // Send 0 to let client know that all requests can be retried.
+ stream_id = 0;
+ } else {
+ // Tell client that streams starting with the next after the largest
+ // received one can be retried.
+ stream_id += QuicUtils::StreamIdDelta(transport_version());
+ }
+ if (last_sent_http3_goaway_id_.has_value() &&
+ last_sent_http3_goaway_id_.value() <= stream_id) {
+ // MUST not send GOAWAY with identifier larger than previously sent.
+ // Do not bother sending one with same identifier as before, since
+ // GOAWAY frames on the control stream are guaranteed to be processed in
+ // order.
+ return;
+ }
}
}
@@ -742,6 +767,11 @@ void QuicSpdySession::SendHttp3GoAway() {
}
void QuicSpdySession::SendHttp3Shutdown() {
+ if (goaway_with_max_stream_id_) {
+ SendHttp3GoAway();
+ return;
+ }
+
DCHECK_EQ(perspective(), Perspective::IS_SERVER);
DCHECK(VersionUsesHttp3(transport_version()));
QuicStreamCount advertised_max_incoming_bidirectional_streams =
@@ -777,7 +807,7 @@ void QuicSpdySession::WritePushPromise(QuicStreamId original_stream_id,
SpdySerializedFrame frame(spdy_framer_.SerializeFrame(push_promise));
headers_stream()->WriteOrBufferData(
- quiche::QuicheStringPiece(frame.data(), frame.size()), false, nullptr);
+ absl::string_view(frame.data(), frame.size()), false, nullptr);
return;
}
@@ -903,7 +933,7 @@ size_t QuicSpdySession::WriteHeadersOnHeadersStreamImpl(
}
SpdySerializedFrame frame(spdy_framer_.SerializeFrame(headers_frame));
headers_stream()->WriteOrBufferData(
- quiche::QuicheStringPiece(frame.data(), frame.size()), false,
+ absl::string_view(frame.data(), frame.size()), false,
std::move(ack_listener));
// Calculate compressed header block size without framing overhead.
@@ -1046,11 +1076,11 @@ bool QuicSpdySession::OnSetting(uint64_t id, uint64_t value) {
break;
}
case spdy::SETTINGS_ENABLE_PUSH:
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case spdy::SETTINGS_MAX_CONCURRENT_STREAMS:
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case spdy::SETTINGS_INITIAL_WINDOW_SIZE:
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case spdy::SETTINGS_MAX_FRAME_SIZE:
if (reject_spdy_settings_) {
CloseConnectionWithDetails(
@@ -1224,9 +1254,7 @@ void QuicSpdySession::CloseConnectionWithDetails(QuicErrorCode error,
}
bool QuicSpdySession::HasActiveRequestStreams() const {
- DCHECK_GE(static_cast<size_t>(stream_map_size()),
- num_static_streams() + num_zombie_streams());
- return stream_map_size() - num_static_streams() - num_zombie_streams() > 0;
+ return GetNumActiveStreams() + num_draining_streams() > 0;
}
bool QuicSpdySession::ProcessPendingStream(PendingStream* pending) {
@@ -1363,6 +1391,50 @@ void QuicSpdySession::MaybeInitializeHttp3UnidirectionalStreams() {
}
}
+void QuicSpdySession::BeforeConnectionCloseSent() {
+ if (!GetQuicReloadableFlag(quic_send_goaway_with_connection_close) ||
+ !VersionUsesHttp3(transport_version()) || !IsEncryptionEstablished()) {
+ return;
+ }
+
+ DCHECK_EQ(perspective(), Perspective::IS_SERVER);
+
+ QUIC_CODE_COUNT(quic_send_goaway_with_connection_close);
+
+ QuicStreamId stream_id =
+ GetLargestPeerCreatedStreamId(/*unidirectional = */ false);
+
+ if (GetQuicReloadableFlag(quic_fix_http3_goaway_stream_id)) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_fix_http3_goaway_stream_id);
+ if (stream_id == QuicUtils::GetInvalidStreamId(transport_version())) {
+ // No client-initiated bidirectional streams received yet.
+ // Send 0 to let client know that all requests can be retried.
+ stream_id = 0;
+ } else {
+ // Tell client that streams starting with the next after the largest
+ // received one can be retried.
+ stream_id += QuicUtils::StreamIdDelta(transport_version());
+ }
+ if (last_sent_http3_goaway_id_.has_value() &&
+ last_sent_http3_goaway_id_.value() <= stream_id) {
+ if (goaway_with_max_stream_id_) {
+ // A previous GOAWAY frame was sent with smaller stream ID. This is not
+ // possible, because this is the only method sending a GOAWAY frame with
+ // non-maximal stream ID, and this must only be called once, right
+ // before closing connection.
+ QUIC_BUG << "GOAWAY frame with smaller ID already sent.";
+ }
+ // MUST not send GOAWAY with identifier larger than previously sent.
+ // Do not bother sending one with same identifier as before, since GOAWAY
+ // frames on the control stream are guaranteed to be processed in order.
+ return;
+ }
+ }
+
+ send_control_stream_->SendGoAway(stream_id);
+ last_sent_http3_goaway_id_ = stream_id;
+}
+
void QuicSpdySession::OnCanCreateNewOutgoingStream(bool unidirectional) {
if (unidirectional && VersionUsesHttp3(transport_version())) {
MaybeInitializeHttp3UnidirectionalStreams();
@@ -1412,7 +1484,7 @@ bool QuicSpdySession::OnMaxPushIdFrame(PushId max_push_id) {
QUIC_DVLOG(1) << "Setting max_push_id to: " << max_push_id
<< " from unset";
}
- quiche::QuicheOptional<PushId> old_max_push_id = max_push_id_;
+ absl::optional<PushId> old_max_push_id = max_push_id_;
max_push_id_ = max_push_id;
if (!old_max_push_id.has_value() || max_push_id > old_max_push_id.value()) {
@@ -1469,7 +1541,7 @@ bool QuicSpdySession::CanCreatePushStreamWithId(PushId push_id) {
}
void QuicSpdySession::CloseConnectionOnDuplicateHttp3UnidirectionalStreams(
- quiche::QuicheStringPiece type) {
+ absl::string_view type) {
QUIC_PEER_BUG << quiche::QuicheStrCat("Received a duplicate ", type,
" stream: Closing connection.");
CloseConnectionWithDetails(
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.h b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.h
index db8fc6b2df2..56719016053 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session.h
@@ -9,6 +9,8 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/http/http_frames.h"
#include "net/third_party/quiche/src/quic/core/http/quic_header_list.h"
#include "net/third_party/quiche/src/quic/core/http/quic_headers_stream.h"
@@ -26,8 +28,6 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
namespace quic {
@@ -154,10 +154,12 @@ class QUIC_EXPORT_PRIVATE QuicSpdySession
void Initialize() override;
// QpackEncoder::DecoderStreamErrorDelegate implementation.
- void OnDecoderStreamError(quiche::QuicheStringPiece error_message) override;
+ void OnDecoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) override;
// QpackDecoder::EncoderStreamErrorDelegate implementation.
- void OnEncoderStreamError(quiche::QuicheStringPiece error_message) override;
+ void OnEncoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) override;
// Called by |headers_stream_| when headers with a priority have been
// received for a stream. This method will only be called for server streams.
@@ -225,15 +227,14 @@ class QUIC_EXPORT_PRIVATE QuicSpdySession
// Send GOAWAY if the peer is blocked on the implementation max.
bool OnStreamsBlockedFrame(const QuicStreamsBlockedFrame& frame) override;
- // Write GOAWAY frame on the control stream to notify the client that every
- // stream that has not reached the server yet can be retried. Do not send a
- // GOAWAY frame if it could not convey new information to the client with
- // respect to the previous GOAWAY frame.
+ // Write GOAWAY frame with maximum stream ID on the control stream. Called to
+ // initite graceful connection shutdown. Do not use smaller stream ID, in
+ // case client does not implement retry on GOAWAY. Do not send GOAWAY if one
+ // has already been sent.
void SendHttp3GoAway();
- // Write advisory GOAWAY frame on the control stream with the max stream ID
- // that the client could send. If GOAWAY has already been sent, the lesser of
- // its max stream ID and the one advertised via MAX_STREAMS is used.
+ // Same as SendHttp3GoAway(). TODO(bnc): remove when
+ // gfe2_reloadable_flag_quic_goaway_with_max_stream_id flag is deprecated.
void SendHttp3Shutdown();
// Write |headers| for |promised_stream_id| on |original_stream_id| in a
@@ -467,6 +468,9 @@ class QUIC_EXPORT_PRIVATE QuicSpdySession
// Initializes HTTP/3 unidirectional streams if not yet initialzed.
virtual void MaybeInitializeHttp3UnidirectionalStreams();
+ // QuicConnectionVisitorInterface method.
+ void BeforeConnectionCloseSent() override;
+
private:
friend class test::QuicSpdySessionPeer;
@@ -485,7 +489,7 @@ class QUIC_EXPORT_PRIVATE QuicSpdySession
const spdy::SpdyStreamPrecedence& precedence);
void CloseConnectionOnDuplicateHttp3UnidirectionalStreams(
- quiche::QuicheStringPiece type);
+ absl::string_view type);
// Sends any data which should be sent at the start of a connection, including
// the initial SETTINGS frame, and (when IETF QUIC is used) also a MAX_PUSH_ID
@@ -564,7 +568,7 @@ class QUIC_EXPORT_PRIVATE QuicSpdySession
// after encryption is established, the push ID in the most recently sent
// MAX_PUSH_ID frame.
// Once set, never goes back to unset.
- quiche::QuicheOptional<PushId> max_push_id_;
+ absl::optional<PushId> max_push_id_;
// Not owned by the session.
Http3DebugVisitor* debug_visitor_;
@@ -589,10 +593,10 @@ class QUIC_EXPORT_PRIVATE QuicSpdySession
// The identifier in the most recently received GOAWAY frame. Unset if no
// GOAWAY frame has been received yet.
- quiche::QuicheOptional<uint64_t> last_received_http3_goaway_id_;
+ absl::optional<uint64_t> last_received_http3_goaway_id_;
// The identifier in the most recently sent GOAWAY frame. Unset if no GOAWAY
// frame has been sent yet.
- quiche::QuicheOptional<uint64_t> last_sent_http3_goaway_id_;
+ absl::optional<uint64_t> last_sent_http3_goaway_id_;
// Only used by a client, only with IETF QUIC. True if a MAX_PUSH_ID frame
// has been sent, in which case |max_push_id_| has the value sent in the most
@@ -601,6 +605,9 @@ class QUIC_EXPORT_PRIVATE QuicSpdySession
// Latched value of reloadable flag quic_reject_spdy_settings.
const bool reject_spdy_settings_;
+
+ // Latched value of reloadable flag quic_goaway_with_max_stream_id.
+ const bool goaway_with_max_stream_id_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session_test.cc
index 6f7d85f68d2..6d93b44db60 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_session_test.cc
@@ -10,6 +10,9 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h"
@@ -22,6 +25,7 @@
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_stream.h"
+#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
@@ -40,11 +44,9 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_send_buffer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
using spdy::kV3HighestPriority;
@@ -83,6 +85,13 @@ class TestCryptoStream : public QuicCryptoStream, public QuicCryptoHandshaker {
params_->cipher_suite = 1;
}
+ void EstablishZeroRttEncryption() {
+ encryption_established_ = true;
+ session()->connection()->SetEncrypter(
+ ENCRYPTION_ZERO_RTT,
+ std::make_unique<NullEncrypter>(session()->perspective()));
+ }
+
void OnHandshakeMessage(const CryptoHandshakeMessage& /*message*/) override {
encryption_established_ = true;
one_rtt_keys_available_ = true;
@@ -145,6 +154,14 @@ class TestCryptoStream : public QuicCryptoStream, public QuicCryptoHandshaker {
}
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> /*application_state*/) override {}
+ bool KeyUpdateSupportedLocally() const override { return false; }
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override {
return *params_;
@@ -287,13 +304,12 @@ class TestSession : public QuicSpdySession {
return QuicSpdySession::GetOrCreateStream(stream_id);
}
- QuicConsumedData WritevData(
- QuicStreamId id,
- size_t write_length,
- QuicStreamOffset offset,
- StreamSendingState state,
- TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level) override {
+ QuicConsumedData WritevData(QuicStreamId id,
+ size_t write_length,
+ QuicStreamOffset offset,
+ StreamSendingState state,
+ TransmissionType type,
+ absl::optional<EncryptionLevel> level) override {
bool fin = state != NO_FIN;
QuicConsumedData consumed(write_length, fin);
if (!writev_consumes_all_data_) {
@@ -319,7 +335,8 @@ class TestSession : public QuicSpdySession {
MakeIOVector("not empty", &iov);
QuicStreamPeer::SendBuffer(stream).SaveStreamData(&iov, 1, 0, 9);
QuicConsumedData consumed =
- WritevData(stream->id(), 9, 0, FIN, NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ WritevData(stream->id(), 9, 0, FIN, NOT_RETRANSMISSION,
+ GetEncryptionLevelToSendApplicationData());
QuicStreamPeer::SendBuffer(stream).OnStreamDataConsumed(
consumed.bytes_consumed);
return consumed;
@@ -328,7 +345,7 @@ class TestSession : public QuicSpdySession {
QuicConsumedData SendLargeFakeData(QuicStream* stream, int bytes) {
DCHECK(writev_consumes_all_data_);
return WritevData(stream->id(), bytes, 0, FIN, NOT_RETRANSMISSION,
- QUICHE_NULLOPT);
+ GetEncryptionLevelToSendApplicationData());
}
using QuicSession::closed_streams;
@@ -405,7 +422,7 @@ class QuicSpdySessionTestBase : public QuicTestWithParam<ParsedQuicVersion> {
EXPECT_CALL(*connection_, SendControlFrame(_))
.WillOnce(Invoke(&ClearControlFrame));
} else {
- // V99 has two frames, RST_STREAM and STOP_SENDING
+ // IETF QUIC has two frames, RST_STREAM and STOP_SENDING
EXPECT_CALL(*connection_, SendControlFrame(_))
.Times(2)
.WillRepeatedly(Invoke(&ClearControlFrame));
@@ -564,6 +581,7 @@ TEST_P(QuicSpdySessionTestServer, AvailableStreams) {
}
TEST_P(QuicSpdySessionTestServer, IsClosedStreamLocallyCreated) {
+ CompleteHandshake();
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
EXPECT_EQ(GetNthServerInitiatedBidirectionalId(0), stream2->id());
QuicSpdyStream* stream4 = session_.CreateOutgoingBidirectionalStream();
@@ -577,6 +595,7 @@ TEST_P(QuicSpdySessionTestServer, IsClosedStreamLocallyCreated) {
}
TEST_P(QuicSpdySessionTestServer, IsClosedStreamPeerCreated) {
+ CompleteHandshake();
QuicStreamId stream_id1 = GetNthClientInitiatedBidirectionalId(0);
QuicStreamId stream_id2 = GetNthClientInitiatedBidirectionalId(1);
session_.GetOrCreateStream(stream_id1);
@@ -601,27 +620,29 @@ TEST_P(QuicSpdySessionTestServer, MaximumAvailableOpenedStreams) {
// is not the number of open streams, we allocate the max and the max+2.
// Get the max allowed stream ID, this should succeed.
QuicStreamId stream_id = StreamCountToId(
- QuicSessionPeer::v99_streamid_manager(&session_)
+ QuicSessionPeer::ietf_streamid_manager(&session_)
->max_incoming_bidirectional_streams(),
Perspective::IS_CLIENT, // Client initates stream, allocs stream id.
/*bidirectional=*/true);
EXPECT_NE(nullptr, session_.GetOrCreateStream(stream_id));
- stream_id = StreamCountToId(QuicSessionPeer::v99_streamid_manager(&session_)
- ->max_incoming_unidirectional_streams(),
- Perspective::IS_CLIENT,
- /*bidirectional=*/false);
+ stream_id =
+ StreamCountToId(QuicSessionPeer::ietf_streamid_manager(&session_)
+ ->max_incoming_unidirectional_streams(),
+ Perspective::IS_CLIENT,
+ /*bidirectional=*/false);
EXPECT_NE(nullptr, session_.GetOrCreateStream(stream_id));
EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(2);
// Get the (max allowed stream ID)++. These should all fail.
- stream_id = StreamCountToId(QuicSessionPeer::v99_streamid_manager(&session_)
- ->max_incoming_bidirectional_streams() +
- 1,
- Perspective::IS_CLIENT,
- /*bidirectional=*/true);
+ stream_id =
+ StreamCountToId(QuicSessionPeer::ietf_streamid_manager(&session_)
+ ->max_incoming_bidirectional_streams() +
+ 1,
+ Perspective::IS_CLIENT,
+ /*bidirectional=*/true);
EXPECT_EQ(nullptr, session_.GetOrCreateStream(stream_id));
stream_id =
- StreamCountToId(QuicSessionPeer::v99_streamid_manager(&session_)
+ StreamCountToId(QuicSessionPeer::ietf_streamid_manager(&session_)
->max_incoming_unidirectional_streams() +
1,
Perspective::IS_CLIENT,
@@ -694,6 +715,7 @@ TEST_P(QuicSpdySessionTestServer,
}
TEST_P(QuicSpdySessionTestServer, OnCanWrite) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
TestStream* stream4 = session_.CreateOutgoingBidirectionalStream();
@@ -851,6 +873,7 @@ TEST_P(QuicSpdySessionTestServer, OnCanWriteBundlesStreams) {
}
TEST_P(QuicSpdySessionTestServer, OnCanWriteCongestionControlBlocks) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
InSequence s;
@@ -898,6 +921,7 @@ TEST_P(QuicSpdySessionTestServer, OnCanWriteCongestionControlBlocks) {
}
TEST_P(QuicSpdySessionTestServer, OnCanWriteWriterBlocks) {
+ CompleteHandshake();
// Drive congestion control manually in order to ensure that
// application-limited signaling is handled correctly.
MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
@@ -974,6 +998,7 @@ TEST_P(QuicSpdySessionTestServer, BufferedHandshake) {
}
TEST_P(QuicSpdySessionTestServer, OnCanWriteWithClosedStream) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
TestStream* stream4 = session_.CreateOutgoingBidirectionalStream();
@@ -999,6 +1024,7 @@ TEST_P(QuicSpdySessionTestServer, OnCanWriteWithClosedStream) {
TEST_P(QuicSpdySessionTestServer,
OnCanWriteLimitsNumWritesIfFlowControlBlocked) {
+ CompleteHandshake();
// Drive congestion control manually in order to ensure that
// application-limited signaling is handled correctly.
MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
@@ -1050,6 +1076,7 @@ TEST_P(QuicSpdySessionTestServer,
}
TEST_P(QuicSpdySessionTestServer, SendGoAway) {
+ CompleteHandshake();
if (VersionHasIetfQuicFrames(transport_version())) {
// HTTP/3 GOAWAY has different semantic and thus has its own test.
return;
@@ -1083,17 +1110,35 @@ TEST_P(QuicSpdySessionTestServer, SendHttp3GoAway) {
EXPECT_CALL(*writer_, WritePacket(_, _, _, _, _))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0)));
- // No client-initiated stream has been received, therefore a GOAWAY frame with
- // stream ID = 0 is sent to notify the client that all requests can be retried
- // on a different connection.
- EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(/* stream_id = */ 0));
+ if (GetQuicReloadableFlag(quic_goaway_with_max_stream_id)) {
+ // Send max stream id (currently 32 bits).
+ EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(/* stream_id = */ 0xfffffffc));
+ } else {
+ // No client-initiated stream has been received, therefore a GOAWAY frame
+ // with stream ID = 0 is sent to notify the client that all requests can be
+ // retried on a different connection.
+ EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(/* stream_id = */ 0));
+ }
session_.SendHttp3GoAway();
EXPECT_TRUE(session_.goaway_sent());
+ // New incoming stream is not reset.
const QuicStreamId kTestStreamId =
GetNthClientInitiatedBidirectionalStreamId(transport_version(), 0);
EXPECT_CALL(*connection_, OnStreamReset(kTestStreamId, _)).Times(0);
EXPECT_TRUE(session_.GetOrCreateStream(kTestStreamId));
+
+ // No more GOAWAY frames are sent because they could not convey new
+ // information to the client.
+ if (!GetQuicReloadableFlag(quic_fix_http3_goaway_stream_id) &&
+ !GetQuicReloadableFlag(quic_goaway_with_max_stream_id)) {
+ // Except when both these flags are false, in which case a second GOAWAY
+ // frame is sent.
+ EXPECT_CALL(*writer_, WritePacket(_, _, _, _, _))
+ .WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0)));
+ EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(/* stream_id = */ 0));
+ }
+ session_.SendHttp3GoAway();
}
TEST_P(QuicSpdySessionTestServer, SendHttp3GoAwayAfterStreamIsCreated) {
@@ -1115,10 +1160,15 @@ TEST_P(QuicSpdySessionTestServer, SendHttp3GoAwayAfterStreamIsCreated) {
EXPECT_CALL(*writer_, WritePacket(_, _, _, _, _))
.WillOnce(Return(WriteResult(WRITE_STATUS_OK, 0)));
- // The first stream, of kTestStreamId = 0, could already have been processed.
- // A GOAWAY frame is sent to notify the client that requests starting with
- // stream ID = 4 can be retried on a different connection.
- EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(/* stream_id = */ 4));
+ if (GetQuicReloadableFlag(quic_goaway_with_max_stream_id)) {
+ // Send max stream id (currently 32 bits).
+ EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(/* stream_id = */ 0xfffffffc));
+ } else {
+ // The first stream, of kTestStreamId = 0, could already have been
+ // processed. A GOAWAY frame is sent to notify the client that requests
+ // starting with stream ID = 4 can be retried on a different connection.
+ EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(/* stream_id = */ 4));
+ }
session_.SendHttp3GoAway();
EXPECT_TRUE(session_.goaway_sent());
@@ -1128,6 +1178,10 @@ TEST_P(QuicSpdySessionTestServer, SendHttp3GoAwayAfterStreamIsCreated) {
}
TEST_P(QuicSpdySessionTestServer, SendHttp3Shutdown) {
+ if (GetQuicReloadableFlag(quic_goaway_with_max_stream_id)) {
+ return;
+ }
+
if (!VersionUsesHttp3(transport_version())) {
return;
}
@@ -1149,6 +1203,10 @@ TEST_P(QuicSpdySessionTestServer, SendHttp3Shutdown) {
}
TEST_P(QuicSpdySessionTestServer, SendHttp3GoAwayAfterShutdownNotice) {
+ if (GetQuicReloadableFlag(quic_goaway_with_max_stream_id)) {
+ return;
+ }
+
if (!VersionUsesHttp3(transport_version())) {
return;
}
@@ -1173,6 +1231,7 @@ TEST_P(QuicSpdySessionTestServer, SendHttp3GoAwayAfterShutdownNotice) {
}
TEST_P(QuicSpdySessionTestServer, DoNotSendGoAwayTwice) {
+ CompleteHandshake();
if (VersionHasIetfQuicFrames(transport_version())) {
// HTTP/3 GOAWAY doesn't have such restriction.
return;
@@ -1256,7 +1315,7 @@ TEST_P(QuicSpdySessionTestServer, RstStreamBeforeHeadersDecompressed) {
CompleteHandshake();
// Send two bytes of payload.
QuicStreamFrame data1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(&session_));
@@ -1307,14 +1366,14 @@ TEST_P(QuicSpdySessionTestServer, OnStreamFrameFinStaticStreamId) {
id = GetNthClientInitiatedUnidirectionalStreamId(transport_version(), 3);
char type[] = {kControlStream};
- QuicStreamFrame data1(id, false, 0, quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(id, false, 0, absl::string_view(type, 1));
session_.OnStreamFrame(data1);
} else {
id = QuicUtils::GetHeadersStreamId(transport_version());
}
// Send two bytes of payload.
- QuicStreamFrame data1(id, true, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(id, true, 0, absl::string_view("HT"));
EXPECT_CALL(*connection_,
CloseConnection(
QUIC_INVALID_STREAM_ID, "Attempt to close a static stream",
@@ -1331,7 +1390,7 @@ TEST_P(QuicSpdySessionTestServer, OnRstStreamStaticStreamId) {
id = GetNthClientInitiatedUnidirectionalStreamId(transport_version(), 3);
char type[] = {kControlStream};
- QuicStreamFrame data1(id, false, 0, quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(id, false, 0, absl::string_view(type, 1));
session_.OnStreamFrame(data1);
expected_error = QUIC_HTTP_CLOSED_CRITICAL_STREAM;
error_message = "RESET_STREAM received for receive control stream";
@@ -1354,7 +1413,7 @@ TEST_P(QuicSpdySessionTestServer, OnRstStreamStaticStreamId) {
TEST_P(QuicSpdySessionTestServer, OnStreamFrameInvalidStreamId) {
// Send two bytes of payload.
QuicStreamFrame data1(QuicUtils::GetInvalidStreamId(transport_version()),
- true, 0, quiche::QuicheStringPiece("HT"));
+ true, 0, absl::string_view("HT"));
EXPECT_CALL(*connection_,
CloseConnection(
QUIC_INVALID_STREAM_ID, "Received data for an invalid stream",
@@ -1385,6 +1444,7 @@ TEST_P(QuicSpdySessionTestServer, HandshakeUnblocksFlowControlBlockedStream) {
// Ensure that Writev consumes all the data it is given (simulate no socket
// blocking).
+ session_.GetMutableCryptoStream()->EstablishZeroRttEncryption();
session_.set_writev_consumes_all_data(true);
// Create a stream, and send enough data to make it flow control blocked.
@@ -1411,9 +1471,12 @@ TEST_P(QuicSpdySessionTestServer, HandshakeUnblocksFlowControlBlockedStream) {
TEST_P(QuicSpdySessionTestServer,
HandshakeUnblocksFlowControlBlockedCryptoStream) {
- if (QuicVersionUsesCryptoFrames(transport_version())) {
+ if (QuicVersionUsesCryptoFrames(transport_version()) ||
+ connection_->encrypted_control_frames()) {
// QUIC version 47 onwards uses CRYPTO frames for the handshake, so this
- // test doesn't make sense for those versions.
+ // test doesn't make sense for those versions. With
+ // use_encryption_level_context, control frames can only be sent when
+ // encryption gets established, do not send BLOCKED for crypto streams.
return;
}
// Test that if the crypto stream is flow control blocked, then if the SHLO
@@ -1438,7 +1501,7 @@ TEST_P(QuicSpdySessionTestServer,
QuicConfig config;
CryptoHandshakeMessage crypto_message;
config.ToHandshakeMessage(&crypto_message, transport_version());
- crypto_stream->SendHandshakeMessage(crypto_message);
+ crypto_stream->SendHandshakeMessage(crypto_message, ENCRYPTION_INITIAL);
char buf[1000];
QuicDataWriter writer(1000, buf, quiche::NETWORK_BYTE_ORDER);
crypto_stream->WriteStreamData(offset, crypto_message.size(), &writer);
@@ -1483,6 +1546,7 @@ TEST_P(QuicSpdySessionTestServer,
// Test that if the header stream is flow control blocked, then if the SHLO
// contains a larger send window offset, the stream becomes unblocked.
+ session_.GetMutableCryptoStream()->EstablishZeroRttEncryption();
session_.set_writev_consumes_all_data(true);
TestCryptoStream* crypto_stream = session_.GetMutableCryptoStream();
EXPECT_FALSE(crypto_stream->IsFlowControlBlocked());
@@ -1599,6 +1663,7 @@ TEST_P(QuicSpdySessionTestServer, TooLowUnidirectionalStreamLimitHttp3) {
if (!VersionUsesHttp3(transport_version())) {
return;
}
+ session_.GetMutableCryptoStream()->EstablishZeroRttEncryption();
QuicConfigPeer::SetReceivedMaxUnidirectionalStreams(session_.config(), 2u);
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
@@ -1614,7 +1679,6 @@ TEST_P(QuicSpdySessionTestServer, CustomFlowControlWindow) {
QuicTagVector copt;
copt.push_back(kIFW7);
QuicConfigPeer::SetReceivedConnectionOptions(session_.config(), copt);
-
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
session_.OnConfigNegotiated();
EXPECT_EQ(192 * 1024u, QuicFlowControllerPeer::ReceiveWindowSize(
@@ -1653,6 +1717,7 @@ TEST_P(QuicSpdySessionTestServer,
// If a buggy/malicious peer creates too many streams that are not ended
// with a FIN or RST then we send an RST to refuse streams for versions other
// than version 99. In version 99 the connection gets closed.
+ CompleteHandshake();
const QuicStreamId kMaxStreams = 5;
if (VersionHasIetfQuicFrames(transport_version())) {
QuicSessionPeer::SetMaxOpenIncomingBidirectionalStreams(&session_,
@@ -1669,7 +1734,7 @@ TEST_P(QuicSpdySessionTestServer,
// However, the stream ID manager does not assume stream 4 is for headers.
// The ID manager would assume that stream#5 is streamid 24.
// In order to make this all work out properly, kFinalStreamId will
- // be set to GetNth...(kMaxStreams-1)... but only for V99
+ // be set to GetNth...(kMaxStreams-1)... but only for IETF QUIC
const QuicStreamId kFirstStreamId = GetNthClientInitiatedBidirectionalId(0);
const QuicStreamId kFinalStreamId =
GetNthClientInitiatedBidirectionalId(kMaxStreams);
@@ -1677,7 +1742,7 @@ TEST_P(QuicSpdySessionTestServer,
// FIN or a RST_STREAM from the client.
const QuicStreamId kNextId = QuicUtils::StreamIdDelta(transport_version());
for (QuicStreamId i = kFirstStreamId; i < kFinalStreamId; i += kNextId) {
- QuicStreamFrame data1(i, false, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(i, false, 0, absl::string_view("HT"));
session_.OnStreamFrame(data1);
CloseStream(i);
}
@@ -1699,8 +1764,7 @@ TEST_P(QuicSpdySessionTestServer,
_));
}
// Create one more data streams to exceed limit of open stream.
- QuicStreamFrame data1(kFinalStreamId, false, 0,
- quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(kFinalStreamId, false, 0, absl::string_view("HT"));
session_.OnStreamFrame(data1);
}
@@ -1708,6 +1772,7 @@ TEST_P(QuicSpdySessionTestServer, DrainingStreamsDoNotCountAsOpened) {
// Verify that a draining stream (which has received a FIN but not consumed
// it) does not count against the open quota (because it is closed from the
// protocol point of view).
+ CompleteHandshake();
if (VersionHasIetfQuicFrames(transport_version())) {
// Simulate receiving a config. so that MAX_STREAMS/etc frames may
// be transmitted
@@ -1735,7 +1800,7 @@ TEST_P(QuicSpdySessionTestServer, DrainingStreamsDoNotCountAsOpened) {
const QuicStreamId kFinalStreamId =
GetNthClientInitiatedBidirectionalId(kMaxStreams + 1);
for (QuicStreamId i = kFirstStreamId; i < kFinalStreamId; i += IdDelta()) {
- QuicStreamFrame data1(i, true, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(i, true, 0, absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(&session_));
session_.StreamDraining(i, /*unidirectional=*/false);
@@ -1755,7 +1820,7 @@ TEST_P(QuicSpdySessionTestServer, ReduceMaxPushId) {
QuicStreamId stream_id =
GetNthClientInitiatedUnidirectionalStreamId(transport_version(), 3);
char type[] = {kControlStream};
- quiche::QuicheStringPiece stream_type(type, 1);
+ absl::string_view stream_type(type, 1);
QuicStreamOffset offset = 0;
QuicStreamFrame data1(stream_id, false, offset, stream_type);
@@ -1893,6 +1958,7 @@ TEST_P(QuicSpdySessionTestClient, RecordFinAfterReadSideClosed) {
// Verify that an incoming FIN is recorded in a stream object even if the read
// side has been closed. This prevents an entry from being made in
// locally_closed_streams_highest_offset_ (which will never be deleted).
+ CompleteHandshake();
TestStream* stream = session_.CreateOutgoingBidirectionalStream();
QuicStreamId stream_id = stream->id();
@@ -1900,7 +1966,7 @@ TEST_P(QuicSpdySessionTestClient, RecordFinAfterReadSideClosed) {
QuicStreamPeer::CloseReadSide(stream);
// Receive a stream data frame with FIN.
- QuicStreamFrame frame(stream_id, true, 0, quiche::QuicheStringPiece());
+ QuicStreamFrame frame(stream_id, true, 0, absl::string_view());
session_.OnStreamFrame(frame);
EXPECT_TRUE(stream->fin_received());
@@ -1954,8 +2020,8 @@ TEST_P(QuicSpdySessionTestClient, WritePriority) {
const QuicMemSlice& slice =
QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer)->slice;
- EXPECT_EQ(quiche::QuicheStringPiece(frame.data(), frame.size()),
- quiche::QuicheStringPiece(slice.data(), slice.length()));
+ EXPECT_EQ(absl::string_view(frame.data(), frame.size()),
+ absl::string_view(slice.data(), slice.length()));
}
TEST_P(QuicSpdySessionTestClient, Http3ServerPush) {
@@ -1966,7 +2032,7 @@ TEST_P(QuicSpdySessionTestClient, Http3ServerPush) {
EXPECT_EQ(0u, QuicSessionPeer::GetNumOpenDynamicStreams(&session_));
// Push unidirectional stream is type 0x01.
- std::string frame_type1 = quiche::QuicheTextUtils::HexDecode("01");
+ std::string frame_type1 = absl::HexStringToBytes("01");
QuicStreamId stream_id1 =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 0);
session_.OnStreamFrame(QuicStreamFrame(stream_id1, /* fin = */ false,
@@ -1978,7 +2044,7 @@ TEST_P(QuicSpdySessionTestClient, Http3ServerPush) {
EXPECT_EQ(1u, session_.flow_controller()->bytes_consumed());
// The same stream type can be encoded differently.
- std::string frame_type2 = quiche::QuicheTextUtils::HexDecode("80000001");
+ std::string frame_type2 = absl::HexStringToBytes("80000001");
QuicStreamId stream_id2 =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 1);
session_.OnStreamFrame(QuicStreamFrame(stream_id2, /* fin = */ false,
@@ -1998,9 +2064,9 @@ TEST_P(QuicSpdySessionTestClient, Http3ServerPushOutofOrderFrame) {
EXPECT_EQ(0u, QuicSessionPeer::GetNumOpenDynamicStreams(&session_));
// Push unidirectional stream is type 0x01.
- std::string frame_type = quiche::QuicheTextUtils::HexDecode("01");
+ std::string frame_type = absl::HexStringToBytes("01");
// The first field of a push stream is the Push ID.
- std::string push_id = quiche::QuicheTextUtils::HexDecode("4000");
+ std::string push_id = absl::HexStringToBytes("4000");
QuicStreamId stream_id =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 0);
@@ -2022,6 +2088,7 @@ TEST_P(QuicSpdySessionTestClient, Http3ServerPushOutofOrderFrame) {
}
TEST_P(QuicSpdySessionTestServer, OnStreamFrameLost) {
+ CompleteHandshake();
InSequence s;
// Drive congestion control manually.
@@ -2096,6 +2163,7 @@ TEST_P(QuicSpdySessionTestServer, OnStreamFrameLost) {
TEST_P(QuicSpdySessionTestServer, DonotRetransmitDataOfClosedStreams) {
// Resetting a stream will send a QPACK Stream Cancellation instruction on the
// decoder stream. For simplicity, ignore writes on this stream.
+ CompleteHandshake();
NoopQpackStreamSenderDelegate qpack_stream_sender_delegate;
if (VersionUsesHttp3(transport_version())) {
session_.qpack_decoder()->set_qpack_stream_sender_delegate(
@@ -2141,6 +2209,7 @@ TEST_P(QuicSpdySessionTestServer, DonotRetransmitDataOfClosedStreams) {
}
TEST_P(QuicSpdySessionTestServer, RetransmitFrames) {
+ CompleteHandshake();
MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm);
InSequence s;
@@ -2196,7 +2265,7 @@ TEST_P(QuicSpdySessionTestServer, OnPriorityUpdateFrame) {
QuicStreamId receive_control_stream_id =
GetNthClientInitiatedUnidirectionalStreamId(transport_version(), 3);
char type[] = {kControlStream};
- quiche::QuicheStringPiece stream_type(type, 1);
+ absl::string_view stream_type(type, 1);
QuicStreamOffset offset = 0;
QuicStreamFrame data1(receive_control_stream_id, false, offset, stream_type);
offset += stream_type.length();
@@ -2228,7 +2297,7 @@ TEST_P(QuicSpdySessionTestServer, OnPriorityUpdateFrame) {
// PRIORITY_UPDATE frame arrives after stream creation.
TestStream* stream1 = session_.CreateIncomingStream(stream_id1);
- EXPECT_EQ(QuicStream::DefaultUrgency(),
+ EXPECT_EQ(QuicStream::kDefaultUrgency,
stream1->precedence().spdy3_priority());
EXPECT_CALL(debug_visitor, OnPriorityUpdateFrameReceived(priority_update1));
session_.OnStreamFrame(data3);
@@ -2259,10 +2328,10 @@ TEST_P(QuicSpdySessionTestServer, SimplePendingStreamType) {
if (!VersionUsesHttp3(transport_version())) {
return;
}
-
+ CompleteHandshake();
char input[] = {0x04, // type
'a', 'b', 'c'}; // data
- quiche::QuicheStringPiece payload(input, QUICHE_ARRAYSIZE(input));
+ absl::string_view payload(input, ABSL_ARRAYSIZE(input));
// This is a server test with a client-initiated unidirectional stream.
QuicStreamId stream_id = QuicUtils::GetFirstUnidirectionalStreamId(
@@ -2311,10 +2380,10 @@ TEST_P(QuicSpdySessionTestServer, SimplePendingStreamTypeOutOfOrderDelivery) {
if (!VersionUsesHttp3(transport_version())) {
return;
}
-
+ CompleteHandshake();
char input[] = {0x04, // type
'a', 'b', 'c'}; // data
- quiche::QuicheStringPiece payload(input, QUICHE_ARRAYSIZE(input));
+ absl::string_view payload(input, ABSL_ARRAYSIZE(input));
// This is a server test with a client-initiated unidirectional stream.
QuicStreamId stream_id = QuicUtils::GetFirstUnidirectionalStreamId(
@@ -2352,10 +2421,10 @@ TEST_P(QuicSpdySessionTestServer,
if (!VersionUsesHttp3(transport_version())) {
return;
}
-
+ CompleteHandshake();
char input[] = {0x41, 0x00, // type (256)
'a', 'b', 'c'}; // data
- quiche::QuicheStringPiece payload(input, QUICHE_ARRAYSIZE(input));
+ absl::string_view payload(input, ABSL_ARRAYSIZE(input));
// This is a server test with a client-initiated unidirectional stream.
QuicStreamId stream_id = QuicUtils::GetFirstUnidirectionalStreamId(
@@ -2406,8 +2475,7 @@ TEST_P(QuicSpdySessionTestServer, ReceiveControlStream) {
GetNthClientInitiatedUnidirectionalStreamId(transport_version(), 3);
char type[] = {kControlStream};
- QuicStreamFrame data1(stream_id, false, 0,
- quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(stream_id, false, 0, absl::string_view(type, 1));
EXPECT_CALL(debug_visitor, OnPeerControlStreamCreated(stream_id));
session_.OnStreamFrame(data1);
EXPECT_EQ(stream_id,
@@ -2418,7 +2486,7 @@ TEST_P(QuicSpdySessionTestServer, ReceiveControlStream) {
settings.values[SETTINGS_MAX_FIELD_SECTION_SIZE] = 5;
settings.values[SETTINGS_QPACK_BLOCKED_STREAMS] = 42;
std::string data = EncodeSettings(settings);
- QuicStreamFrame frame(stream_id, false, 1, quiche::QuicheStringPiece(data));
+ QuicStreamFrame frame(stream_id, false, 1, absl::string_view(data));
QpackEncoder* qpack_encoder = session_.qpack_encoder();
QpackHeaderTable* header_table =
@@ -2451,9 +2519,8 @@ TEST_P(QuicSpdySessionTestServer, ReceiveControlStreamOutOfOrderDelivery) {
settings.values[SETTINGS_MAX_FIELD_SECTION_SIZE] = 5;
std::string data = EncodeSettings(settings);
- QuicStreamFrame data1(stream_id, false, 1, quiche::QuicheStringPiece(data));
- QuicStreamFrame data2(stream_id, false, 0,
- quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(stream_id, false, 1, absl::string_view(data));
+ QuicStreamFrame data2(stream_id, false, 0, absl::string_view(type, 1));
session_.OnStreamFrame(data1);
EXPECT_NE(5u, session_.max_outbound_header_list_size());
@@ -2466,20 +2533,20 @@ TEST_P(QuicSpdySessionTestServer, StreamClosedWhileHeaderDecodingBlocked) {
if (!VersionUsesHttp3(transport_version())) {
return;
}
-
+ CompleteHandshake();
session_.qpack_decoder()->OnSetDynamicTableCapacity(1024);
QuicStreamId stream_id = GetNthClientInitiatedBidirectionalId(0);
TestStream* stream = session_.CreateIncomingStream(stream_id);
// HEADERS frame referencing first dynamic table entry.
- std::string headers_payload = quiche::QuicheTextUtils::HexDecode("020080");
+ std::string headers_payload = absl::HexStringToBytes("020080");
std::unique_ptr<char[]> headers_buffer;
QuicByteCount headers_frame_header_length =
HttpEncoder::SerializeHeadersFrameHeader(headers_payload.length(),
&headers_buffer);
- quiche::QuicheStringPiece headers_frame_header(headers_buffer.get(),
- headers_frame_header_length);
+ absl::string_view headers_frame_header(headers_buffer.get(),
+ headers_frame_header_length);
std::string headers =
quiche::QuicheStrCat(headers_frame_header, headers_payload);
stream->OnStreamFrame(QuicStreamFrame(stream_id, false, 0, headers));
@@ -2508,13 +2575,13 @@ TEST_P(QuicSpdySessionTestServer, SessionDestroyedWhileHeaderDecodingBlocked) {
TestStream* stream = session_.CreateIncomingStream(stream_id);
// HEADERS frame referencing first dynamic table entry.
- std::string headers_payload = quiche::QuicheTextUtils::HexDecode("020080");
+ std::string headers_payload = absl::HexStringToBytes("020080");
std::unique_ptr<char[]> headers_buffer;
QuicByteCount headers_frame_header_length =
HttpEncoder::SerializeHeadersFrameHeader(headers_payload.length(),
&headers_buffer);
- quiche::QuicheStringPiece headers_frame_header(headers_buffer.get(),
- headers_frame_header_length);
+ absl::string_view headers_frame_header(headers_buffer.get(),
+ headers_frame_header_length);
std::string headers =
quiche::QuicheStrCat(headers_frame_header, headers_payload);
stream->OnStreamFrame(QuicStreamFrame(stream_id, false, 0, headers));
@@ -2533,6 +2600,7 @@ TEST_P(QuicSpdySessionTestClient, ResetAfterInvalidIncomingStreamType) {
if (!VersionUsesHttp3(transport_version())) {
return;
}
+ CompleteHandshake();
ASSERT_TRUE(session_.UsesPendingStreams());
const QuicStreamId stream_id =
@@ -2541,7 +2609,7 @@ TEST_P(QuicSpdySessionTestClient, ResetAfterInvalidIncomingStreamType) {
// Payload consists of two bytes. The first byte is an unknown unidirectional
// stream type. The second one would be the type of a push stream, but it
// must not be interpreted as stream type.
- std::string payload = quiche::QuicheTextUtils::HexDecode("3f01");
+ std::string payload = absl::HexStringToBytes("3f01");
QuicStreamFrame frame(stream_id, /* fin = */ false, /* offset = */ 0,
payload);
@@ -2579,6 +2647,7 @@ TEST_P(QuicSpdySessionTestClient, FinAfterInvalidIncomingStreamType) {
if (!VersionUsesHttp3(transport_version())) {
return;
}
+ CompleteHandshake();
ASSERT_TRUE(session_.UsesPendingStreams());
const QuicStreamId stream_id =
@@ -2587,7 +2656,7 @@ TEST_P(QuicSpdySessionTestClient, FinAfterInvalidIncomingStreamType) {
// Payload consists of two bytes. The first byte is an unknown unidirectional
// stream type. The second one would be the type of a push stream, but it
// must not be interpreted as stream type.
- std::string payload = quiche::QuicheTextUtils::HexDecode("3f01");
+ std::string payload = absl::HexStringToBytes("3f01");
QuicStreamFrame frame(stream_id, /* fin = */ false, /* offset = */ 0,
payload);
@@ -2624,7 +2693,7 @@ TEST_P(QuicSpdySessionTestClient, ResetInMiddleOfStreamType) {
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 0);
// Payload is the first byte of a two byte varint encoding.
- std::string payload = quiche::QuicheTextUtils::HexDecode("40");
+ std::string payload = absl::HexStringToBytes("40");
QuicStreamFrame frame(stream_id, /* fin = */ false, /* offset = */ 0,
payload);
@@ -2652,7 +2721,7 @@ TEST_P(QuicSpdySessionTestClient, FinInMiddleOfStreamType) {
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 0);
// Payload is the first byte of a two byte varint encoding with a FIN.
- std::string payload = quiche::QuicheTextUtils::HexDecode("40");
+ std::string payload = absl::HexStringToBytes("40");
QuicStreamFrame frame(stream_id, /* fin = */ true, /* offset = */ 0, payload);
session_.OnStreamFrame(frame);
@@ -2671,12 +2740,12 @@ TEST_P(QuicSpdySessionTestClient, DuplicateHttp3UnidirectionalStreams) {
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 0);
char type1[] = {kControlStream};
- QuicStreamFrame data1(id1, false, 0, quiche::QuicheStringPiece(type1, 1));
+ QuicStreamFrame data1(id1, false, 0, absl::string_view(type1, 1));
EXPECT_CALL(debug_visitor, OnPeerControlStreamCreated(id1));
session_.OnStreamFrame(data1);
QuicStreamId id2 =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 1);
- QuicStreamFrame data2(id2, false, 0, quiche::QuicheStringPiece(type1, 1));
+ QuicStreamFrame data2(id2, false, 0, absl::string_view(type1, 1));
EXPECT_CALL(debug_visitor, OnPeerControlStreamCreated(id2)).Times(0);
EXPECT_CALL(*connection_,
CloseConnection(QUIC_HTTP_DUPLICATE_UNIDIRECTIONAL_STREAM,
@@ -2689,13 +2758,13 @@ TEST_P(QuicSpdySessionTestClient, DuplicateHttp3UnidirectionalStreams) {
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 2);
char type2[]{kQpackEncoderStream};
- QuicStreamFrame data3(id3, false, 0, quiche::QuicheStringPiece(type2, 1));
+ QuicStreamFrame data3(id3, false, 0, absl::string_view(type2, 1));
EXPECT_CALL(debug_visitor, OnPeerQpackEncoderStreamCreated(id3));
session_.OnStreamFrame(data3);
QuicStreamId id4 =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 3);
- QuicStreamFrame data4(id4, false, 0, quiche::QuicheStringPiece(type2, 1));
+ QuicStreamFrame data4(id4, false, 0, absl::string_view(type2, 1));
EXPECT_CALL(debug_visitor, OnPeerQpackEncoderStreamCreated(id4)).Times(0);
EXPECT_CALL(*connection_,
CloseConnection(QUIC_HTTP_DUPLICATE_UNIDIRECTIONAL_STREAM,
@@ -2708,13 +2777,13 @@ TEST_P(QuicSpdySessionTestClient, DuplicateHttp3UnidirectionalStreams) {
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 4);
char type3[]{kQpackDecoderStream};
- QuicStreamFrame data5(id5, false, 0, quiche::QuicheStringPiece(type3, 1));
+ QuicStreamFrame data5(id5, false, 0, absl::string_view(type3, 1));
EXPECT_CALL(debug_visitor, OnPeerQpackDecoderStreamCreated(id5));
session_.OnStreamFrame(data5);
QuicStreamId id6 =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 5);
- QuicStreamFrame data6(id6, false, 0, quiche::QuicheStringPiece(type3, 1));
+ QuicStreamFrame data6(id6, false, 0, absl::string_view(type3, 1));
EXPECT_CALL(debug_visitor, OnPeerQpackDecoderStreamCreated(id6)).Times(0);
EXPECT_CALL(*connection_,
CloseConnection(QUIC_HTTP_DUPLICATE_UNIDIRECTIONAL_STREAM,
@@ -2729,7 +2798,7 @@ TEST_P(QuicSpdySessionTestClient, EncoderStreamError) {
return;
}
- std::string data = quiche::QuicheTextUtils::HexDecode(
+ std::string data = absl::HexStringToBytes(
"02" // Encoder stream.
"00"); // Duplicate entry 0, but no entries exist.
@@ -2740,8 +2809,11 @@ TEST_P(QuicSpdySessionTestClient, EncoderStreamError) {
EXPECT_CALL(
*connection_,
- CloseConnection(QUIC_QPACK_ENCODER_STREAM_ERROR,
- "Encoder stream error: Invalid relative index.", _));
+ CloseConnection(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_ENCODER_STREAM_DUPLICATE_INVALID_RELATIVE_INDEX
+ : QUIC_QPACK_ENCODER_STREAM_ERROR,
+ "Encoder stream error: Invalid relative index.", _));
session_.OnStreamFrame(frame);
}
@@ -2750,7 +2822,7 @@ TEST_P(QuicSpdySessionTestClient, DecoderStreamError) {
return;
}
- std::string data = quiche::QuicheTextUtils::HexDecode(
+ std::string data = absl::HexStringToBytes(
"03" // Decoder stream.
"00"); // Insert Count Increment with forbidden increment value of zero.
@@ -2761,7 +2833,9 @@ TEST_P(QuicSpdySessionTestClient, DecoderStreamError) {
EXPECT_CALL(
*connection_,
- CloseConnection(QUIC_QPACK_DECODER_STREAM_ERROR,
+ CloseConnection(GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_DECODER_STREAM_INVALID_ZERO_INCREMENT
+ : QUIC_QPACK_DECODER_STREAM_ERROR,
"Decoder stream error: Invalid increment value 0.", _));
session_.OnStreamFrame(frame);
}
@@ -2815,7 +2889,7 @@ TEST_P(QuicSpdySessionTestClient, IgnoreCancelPush) {
QuicStreamId receive_control_stream_id =
GetNthServerInitiatedUnidirectionalStreamId(transport_version(), 3);
char type[] = {kControlStream};
- quiche::QuicheStringPiece stream_type(type, 1);
+ absl::string_view stream_type(type, 1);
QuicStreamOffset offset = 0;
QuicStreamFrame data1(receive_control_stream_id, /* fin = */ false, offset,
stream_type);
@@ -2839,7 +2913,7 @@ TEST_P(QuicSpdySessionTestClient, IgnoreCancelPush) {
auto frame_length =
HttpEncoder::SerializeCancelPushFrame(cancel_push, &buffer);
QuicStreamFrame data3(receive_control_stream_id, /* fin = */ false, offset,
- quiche::QuicheStringPiece(buffer.get(), frame_length));
+ absl::string_view(buffer.get(), frame_length));
EXPECT_CALL(debug_visitor, OnCancelPushFrameReceived(_));
session_.OnStreamFrame(data3);
}
@@ -2903,7 +2977,7 @@ TEST_P(QuicSpdySessionTestServer, FineGrainedHpackErrorCodes) {
// Index 126 does not exist (static table has 61 entries and dynamic table is
// empty).
- std::string headers_frame = quiche::QuicheTextUtils::HexDecode(
+ std::string headers_frame = absl::HexStringToBytes(
"000006" // length
"01" // type
"24" // flags: PRIORITY | END_HEADERS
@@ -2936,13 +3010,12 @@ TEST_P(QuicSpdySessionTestServer, PeerClosesCriticalReceiveStream) {
{kQpackEncoderStream, "RESET_STREAM received for QPACK receive stream"},
{kQpackDecoderStream, "RESET_STREAM received for QPACK receive stream"},
};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kTestData); ++i) {
QuicStreamId stream_id =
GetNthClientInitiatedUnidirectionalStreamId(transport_version(), i + 1);
const QuicByteCount data_length = 1;
- QuicStreamFrame data(
- stream_id, false, 0,
- quiche::QuicheStringPiece(&kTestData[i].type, data_length));
+ QuicStreamFrame data(stream_id, false, 0,
+ absl::string_view(&kTestData[i].type, data_length));
session_.OnStreamFrame(data);
EXPECT_CALL(*connection_, CloseConnection(QUIC_HTTP_CLOSED_CRITICAL_STREAM,
@@ -3027,7 +3100,7 @@ TEST_P(QuicSpdySessionTestServer, IgnoreCancelPush) {
QuicStreamId receive_control_stream_id =
GetNthClientInitiatedUnidirectionalStreamId(transport_version(), 3);
char type[] = {kControlStream};
- quiche::QuicheStringPiece stream_type(type, 1);
+ absl::string_view stream_type(type, 1);
QuicStreamOffset offset = 0;
QuicStreamFrame data1(receive_control_stream_id, /* fin = */ false, offset,
stream_type);
@@ -3051,11 +3124,68 @@ TEST_P(QuicSpdySessionTestServer, IgnoreCancelPush) {
auto frame_length =
HttpEncoder::SerializeCancelPushFrame(cancel_push, &buffer);
QuicStreamFrame data3(receive_control_stream_id, /* fin = */ false, offset,
- quiche::QuicheStringPiece(buffer.get(), frame_length));
+ absl::string_view(buffer.get(), frame_length));
EXPECT_CALL(debug_visitor, OnCancelPushFrameReceived(_));
session_.OnStreamFrame(data3);
}
+TEST_P(QuicSpdySessionTestServer, Http3GoAwayWhenClosingConnection) {
+ if (!VersionUsesHttp3(transport_version())) {
+ return;
+ }
+
+ StrictMock<MockHttp3DebugVisitor> debug_visitor;
+ session_.set_debug_visitor(&debug_visitor);
+
+ EXPECT_CALL(debug_visitor, OnSettingsFrameSent(_));
+ CompleteHandshake();
+
+ QuicStreamId stream_id = GetNthClientInitiatedBidirectionalId(0);
+
+ // Create stream by receiving some data (CreateIncomingStream() would not
+ // update the session's largest peer created stream ID).
+ const size_t headers_payload_length = 10;
+ std::unique_ptr<char[]> headers_buffer;
+ QuicByteCount headers_frame_header_length =
+ HttpEncoder::SerializeHeadersFrameHeader(headers_payload_length,
+ &headers_buffer);
+ absl::string_view headers_frame_header(headers_buffer.get(),
+ headers_frame_header_length);
+ EXPECT_CALL(debug_visitor,
+ OnHeadersFrameReceived(stream_id, headers_payload_length));
+ session_.OnStreamFrame(
+ QuicStreamFrame(stream_id, false, 0, headers_frame_header));
+
+ EXPECT_EQ(stream_id, QuicSessionPeer::GetLargestPeerCreatedStreamId(
+ &session_, /*unidirectional = */ false));
+
+ if (GetQuicReloadableFlag(quic_send_goaway_with_connection_close)) {
+ if (GetQuicReloadableFlag(quic_fix_http3_goaway_stream_id)) {
+ // Stream with stream_id is already received and potentially processed,
+ // therefore a GOAWAY frame is sent with the next stream ID.
+ EXPECT_CALL(debug_visitor,
+ OnGoAwayFrameSent(stream_id + QuicUtils::StreamIdDelta(
+ transport_version())));
+ } else {
+ // GOAWAY frame stream id is incorrect, ignore.
+ EXPECT_CALL(debug_visitor, OnGoAwayFrameSent(_));
+ }
+ }
+
+ // Close connection.
+ EXPECT_CALL(*writer_, WritePacket(_, _, _, _, _))
+ .WillRepeatedly(Return(WriteResult(WRITE_STATUS_OK, 0)));
+ EXPECT_CALL(*connection_, CloseConnection(QUIC_NO_ERROR, _, _))
+ .WillOnce(
+ Invoke(connection_, &MockQuicConnection::ReallyCloseConnection));
+ EXPECT_CALL(*connection_, SendConnectionClosePacket(QUIC_NO_ERROR, _))
+ .WillOnce(Invoke(connection_,
+ &MockQuicConnection::ReallySendConnectionClosePacket));
+ connection_->CloseConnection(
+ QUIC_NO_ERROR, "closing connection",
+ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
+}
+
TEST_P(QuicSpdySessionTestClient, SendInitialMaxPushIdIfSet) {
if (!VersionUsesHttp3(transport_version())) {
return;
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.cc
index 1c5f9645822..7059fc0dee7 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.cc
@@ -8,6 +8,9 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/core/http/http_decoder.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_session.h"
@@ -22,8 +25,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice_storage.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
@@ -74,7 +75,7 @@ class QuicSpdyStream::HttpDecoderVisitor : public HttpDecoder::Visitor {
return stream_->OnDataFrameStart(header_length, payload_length);
}
- bool OnDataFramePayload(quiche::QuicheStringPiece payload) override {
+ bool OnDataFramePayload(absl::string_view payload) override {
DCHECK(!payload.empty());
return stream_->OnDataFramePayload(payload);
}
@@ -90,7 +91,7 @@ class QuicSpdyStream::HttpDecoderVisitor : public HttpDecoder::Visitor {
return stream_->OnHeadersFrameStart(header_length, payload_length);
}
- bool OnHeadersFramePayload(quiche::QuicheStringPiece payload) override {
+ bool OnHeadersFramePayload(absl::string_view payload) override {
DCHECK(!payload.empty());
if (!VersionUsesHttp3(stream_->transport_version())) {
CloseConnectionOnWrongFrame("Headers");
@@ -126,7 +127,7 @@ class QuicSpdyStream::HttpDecoderVisitor : public HttpDecoder::Visitor {
header_block_length);
}
- bool OnPushPromiseFramePayload(quiche::QuicheStringPiece payload) override {
+ bool OnPushPromiseFramePayload(absl::string_view payload) override {
DCHECK(!payload.empty());
if (!VersionUsesHttp3(stream_->transport_version())) {
CloseConnectionOnWrongFrame("Push Promise");
@@ -160,14 +161,14 @@ class QuicSpdyStream::HttpDecoderVisitor : public HttpDecoder::Visitor {
payload_length);
}
- bool OnUnknownFramePayload(quiche::QuicheStringPiece payload) override {
+ bool OnUnknownFramePayload(absl::string_view payload) override {
return stream_->OnUnknownFramePayload(payload);
}
bool OnUnknownFrameEnd() override { return stream_->OnUnknownFrameEnd(); }
private:
- void CloseConnectionOnWrongFrame(quiche::QuicheStringPiece frame_type) {
+ void CloseConnectionOnWrongFrame(absl::string_view frame_type) {
stream_->OnUnrecoverableError(
QUIC_HTTP_FRAME_UNEXPECTED_ON_SPDY_STREAM,
quiche::QuicheStrCat(frame_type, " frame received on data stream"));
@@ -199,7 +200,7 @@ QuicSpdyStream::QuicSpdyStream(QuicStreamId id,
sequencer_offset_(0),
is_decoder_processing_input_(false),
ack_listener_(nullptr),
- last_sent_urgency_(DefaultUrgency()) {
+ last_sent_urgency_(kDefaultUrgency) {
DCHECK_EQ(session()->connection(), spdy_session->connection());
DCHECK_EQ(transport_version(), spdy_session->transport_version());
DCHECK(!QuicUtils::IsCryptoStreamId(transport_version(), id));
@@ -235,7 +236,7 @@ QuicSpdyStream::QuicSpdyStream(PendingStream* pending,
sequencer_offset_(sequencer()->NumBytesConsumed()),
is_decoder_processing_input_(false),
ack_listener_(nullptr),
- last_sent_urgency_(DefaultUrgency()) {
+ last_sent_urgency_(kDefaultUrgency) {
DCHECK_EQ(session()->connection(), spdy_session->connection());
DCHECK_EQ(transport_version(), spdy_session->transport_version());
DCHECK(!QuicUtils::IsCryptoStreamId(transport_version(), id()));
@@ -263,7 +264,7 @@ size_t QuicSpdyStream::WriteHeaders(
if (VersionUsesHttp3(transport_version()) && type() == WRITE_UNIDIRECTIONAL &&
send_buffer().stream_offset() == 0) {
char data[sizeof(kServerPushStream)];
- QuicDataWriter writer(QUICHE_ARRAYSIZE(data), data);
+ QuicDataWriter writer(ABSL_ARRAYSIZE(data), data);
writer.WriteVarInt62(kServerPushStream);
// Similar to frame headers, stream type byte shouldn't be exposed to upper
@@ -272,8 +273,8 @@ size_t QuicSpdyStream::WriteHeaders(
QUIC_LOG(INFO) << ENDPOINT << "Stream " << id()
<< " is writing type as server push";
- WriteOrBufferData(quiche::QuicheStringPiece(writer.data(), writer.length()),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(writer.data(), writer.length()), false,
+ nullptr);
}
size_t bytes_written =
@@ -289,8 +290,7 @@ size_t QuicSpdyStream::WriteHeaders(
return bytes_written;
}
-void QuicSpdyStream::WriteOrBufferBody(quiche::QuicheStringPiece data,
- bool fin) {
+void QuicSpdyStream::WriteOrBufferBody(absl::string_view data, bool fin) {
if (!VersionUsesHttp3(transport_version()) || data.length() == 0) {
WriteOrBufferData(data, fin, nullptr);
return;
@@ -311,8 +311,8 @@ void QuicSpdyStream::WriteOrBufferBody(quiche::QuicheStringPiece data,
QUIC_DLOG(INFO) << ENDPOINT << "Stream " << id()
<< " is writing DATA frame header of length "
<< header_length;
- WriteOrBufferData(quiche::QuicheStringPiece(buffer.get(), header_length),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(buffer.get(), header_length), false,
+ nullptr);
// Write body.
QUIC_DLOG(INFO) << ENDPOINT << "Stream " << id()
@@ -379,8 +379,8 @@ void QuicSpdyStream::WritePushPromise(const PushPromiseFrame& frame) {
<< " is writing Push Promise frame header of length "
<< push_promise_frame_length << " , with promised id "
<< frame.push_id;
- WriteOrBufferData(quiche::QuicheStringPiece(push_promise_frame_with_id.get(),
- push_promise_frame_length),
+ WriteOrBufferData(absl::string_view(push_promise_frame_with_id.get(),
+ push_promise_frame_length),
/* fin = */ false, /* ack_listener = */ nullptr);
// Write response headers.
@@ -594,8 +594,7 @@ void QuicSpdyStream::OnHeadersDecoded(QuicHeaderList headers,
}
}
-void QuicSpdyStream::OnHeaderDecodingError(
- quiche::QuicheStringPiece error_message) {
+void QuicSpdyStream::OnHeaderDecodingError(absl::string_view error_message) {
qpack_decoded_headers_accumulator_.reset();
std::string connection_close_error_message = quiche::QuicheStrCat(
@@ -641,14 +640,14 @@ void QuicSpdyStream::OnInitialHeadersComplete(
if (fin) {
OnStreamFrame(QuicStreamFrame(id(), /* fin = */ true,
highest_received_byte_offset(),
- quiche::QuicheStringPiece()));
+ absl::string_view()));
}
return;
}
if (fin && !rst_sent()) {
- OnStreamFrame(QuicStreamFrame(id(), fin, /* offset = */ 0,
- quiche::QuicheStringPiece()));
+ OnStreamFrame(
+ QuicStreamFrame(id(), fin, /* offset = */ 0, absl::string_view()));
}
if (FinishedReadingHeaders()) {
sequencer()->SetUnblocked();
@@ -703,8 +702,7 @@ void QuicSpdyStream::OnTrailingHeadersComplete(
const QuicStreamOffset offset = VersionUsesHttp3(transport_version())
? highest_received_byte_offset()
: final_byte_offset;
- OnStreamFrame(
- QuicStreamFrame(id(), fin, offset, quiche::QuicheStringPiece()));
+ OnStreamFrame(QuicStreamFrame(id(), fin, offset, absl::string_view()));
}
}
@@ -835,7 +833,7 @@ bool QuicSpdyStream::ParseHeaderStatusCode(const SpdyHeaderBlock& header,
if (it == header.end()) {
return false;
}
- const quiche::QuicheStringPiece status(it->second);
+ const absl::string_view status(it->second);
if (status.size() != 3) {
return false;
}
@@ -847,7 +845,7 @@ bool QuicSpdyStream::ParseHeaderStatusCode(const SpdyHeaderBlock& header,
if (!isdigit(status[1]) || !isdigit(status[2])) {
return false;
}
- return quiche::QuicheTextUtils::StringToInt(status, status_code);
+ return absl::SimpleAtoi(status, status_code);
}
bool QuicSpdyStream::FinishedReadingTrailers() const {
@@ -886,7 +884,7 @@ bool QuicSpdyStream::OnDataFrameStart(QuicByteCount header_length,
return true;
}
-bool QuicSpdyStream::OnDataFramePayload(quiche::QuicheStringPiece payload) {
+bool QuicSpdyStream::OnDataFramePayload(absl::string_view payload) {
DCHECK(VersionUsesHttp3(transport_version()));
body_manager_.OnBody(payload);
@@ -981,7 +979,7 @@ bool QuicSpdyStream::OnHeadersFrameStart(QuicByteCount header_length,
return true;
}
-bool QuicSpdyStream::OnHeadersFramePayload(quiche::QuicheStringPiece payload) {
+bool QuicSpdyStream::OnHeadersFramePayload(absl::string_view payload) {
DCHECK(VersionUsesHttp3(transport_version()));
DCHECK(qpack_decoded_headers_accumulator_);
@@ -1045,8 +1043,7 @@ bool QuicSpdyStream::OnPushPromiseFramePushId(
return true;
}
-bool QuicSpdyStream::OnPushPromiseFramePayload(
- quiche::QuicheStringPiece payload) {
+bool QuicSpdyStream::OnPushPromiseFramePayload(absl::string_view payload) {
spdy_session_->OnCompressedFrameSize(payload.length());
return OnHeadersFramePayload(payload);
}
@@ -1073,7 +1070,7 @@ bool QuicSpdyStream::OnUnknownFrameStart(uint64_t frame_type,
return true;
}
-bool QuicSpdyStream::OnUnknownFramePayload(quiche::QuicheStringPiece payload) {
+bool QuicSpdyStream::OnUnknownFramePayload(absl::string_view payload) {
// Ignore unknown frames, but consume frame payload.
QUIC_DVLOG(1) << ENDPOINT << "Discarding " << payload.size()
<< " bytes of payload of frame of unknown type.";
@@ -1117,8 +1114,8 @@ size_t QuicSpdyStream::WriteHeadersImpl(
QUIC_DLOG(INFO) << ENDPOINT << "Stream " << id()
<< " is writing HEADERS frame header of length "
<< headers_frame_header_length;
- WriteOrBufferData(quiche::QuicheStringPiece(headers_frame_header.get(),
- headers_frame_header_length),
+ WriteOrBufferData(absl::string_view(headers_frame_header.get(),
+ headers_frame_header_length),
/* fin = */ false, /* ack_listener = */ nullptr);
QUIC_DLOG(INFO) << ENDPOINT << "Stream " << id()
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h
index 5a58842e1f8..c460b6e5512 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h
@@ -15,6 +15,7 @@
#include <list>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/http_decoder.h"
#include "net/third_party/quiche/src/quic/core/http/http_encoder.h"
#include "net/third_party/quiche/src/quic/core/http/quic_header_list.h"
@@ -26,7 +27,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
namespace quic {
@@ -122,7 +122,7 @@ class QUIC_EXPORT_PRIVATE QuicSpdyStream
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
// Sends |data| to the peer, or buffers if it can't be sent immediately.
- void WriteOrBufferBody(quiche::QuicheStringPiece data, bool fin);
+ void WriteOrBufferBody(absl::string_view data, bool fin);
// Writes the trailers contained in |trailer_block| on the dedicated headers
// stream or on this stream, depending on VersionUsesHttp3(). Trailers will
@@ -220,7 +220,7 @@ class QUIC_EXPORT_PRIVATE QuicSpdyStream
// QpackDecodedHeadersAccumulator::Visitor implementation.
void OnHeadersDecoded(QuicHeaderList headers,
bool header_list_size_limit_exceeded) override;
- void OnHeaderDecodingError(quiche::QuicheStringPiece error_message) override;
+ void OnHeaderDecodingError(absl::string_view error_message) override;
QuicSpdySession* spdy_session() const { return spdy_session_; }
@@ -262,22 +262,22 @@ class QUIC_EXPORT_PRIVATE QuicSpdyStream
// Called by HttpDecoderVisitor.
bool OnDataFrameStart(QuicByteCount header_length,
QuicByteCount payload_length);
- bool OnDataFramePayload(quiche::QuicheStringPiece payload);
+ bool OnDataFramePayload(absl::string_view payload);
bool OnDataFrameEnd();
bool OnHeadersFrameStart(QuicByteCount header_length,
QuicByteCount payload_length);
- bool OnHeadersFramePayload(quiche::QuicheStringPiece payload);
+ bool OnHeadersFramePayload(absl::string_view payload);
bool OnHeadersFrameEnd();
bool OnPushPromiseFrameStart(QuicByteCount header_length);
bool OnPushPromiseFramePushId(PushId push_id,
QuicByteCount push_id_length,
QuicByteCount header_block_length);
- bool OnPushPromiseFramePayload(quiche::QuicheStringPiece payload);
+ bool OnPushPromiseFramePayload(absl::string_view payload);
bool OnPushPromiseFrameEnd();
bool OnUnknownFrameStart(uint64_t frame_type,
QuicByteCount header_length,
QuicByteCount payload_length);
- bool OnUnknownFramePayload(quiche::QuicheStringPiece payload);
+ bool OnUnknownFramePayload(absl::string_view payload);
bool OnUnknownFrameEnd();
// Given the interval marked by [|offset|, |offset| + |data_length|), return
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.cc
index 1e36aa70af9..83af51d0208 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.cc
@@ -6,8 +6,8 @@
#include <algorithm>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -28,7 +28,7 @@ size_t QuicSpdyStreamBodyManager::OnNonBody(QuicByteCount length) {
return 0;
}
-void QuicSpdyStreamBodyManager::OnBody(quiche::QuicheStringPiece body) {
+void QuicSpdyStreamBodyManager::OnBody(absl::string_view body) {
DCHECK(!body.empty());
fragments_.push_back({body, 0});
@@ -46,7 +46,7 @@ size_t QuicSpdyStreamBodyManager::OnBodyConsumed(size_t num_bytes) {
}
Fragment& fragment = fragments_.front();
- const quiche::QuicheStringPiece body = fragment.body;
+ const absl::string_view body = fragment.body;
if (body.length() > remaining_bytes) {
// Consume leading |remaining_bytes| bytes of body.
@@ -78,7 +78,7 @@ int QuicSpdyStreamBodyManager::PeekBody(iovec* iov, size_t iov_len) const {
size_t iov_filled = 0;
while (iov_filled < fragments_.size() && iov_filled < iov_len) {
- quiche::QuicheStringPiece body = fragments_[iov_filled].body;
+ absl::string_view body = fragments_[iov_filled].body;
iov[iov_filled].iov_base = const_cast<char*>(body.data());
iov[iov_filled].iov_len = body.size();
iov_filled++;
@@ -102,7 +102,7 @@ size_t QuicSpdyStreamBodyManager::ReadBody(const struct iovec* iov,
while (!fragments_.empty()) {
Fragment& fragment = fragments_.front();
- const quiche::QuicheStringPiece body = fragment.body;
+ const absl::string_view body = fragment.body;
const size_t bytes_to_copy =
std::min<size_t>(body.length(), dest_remaining);
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.h b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.h
index a5afecaa5e7..5e73ac7829c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager.h
@@ -5,13 +5,13 @@
#ifndef QUICHE_QUIC_CORE_HTTP_QUIC_SPDY_STREAM_BODY_MANAGER_H_
#define QUICHE_QUIC_CORE_HTTP_QUIC_SPDY_STREAM_BODY_MANAGER_H_
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_constants.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_iovec.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -38,18 +38,18 @@ class QUIC_EXPORT_PRIVATE QuicSpdyStreamBodyManager {
// sequencer (provided that all previous body fragments are consumed) is
// received. |length| must be positive. Returns number of bytes the caller
// must mark consumed, which might be zero.
- QUIC_MUST_USE_RESULT size_t OnNonBody(QuicByteCount length);
+ ABSL_MUST_USE_RESULT size_t OnNonBody(QuicByteCount length);
// Called when body is received. |body| is added to |fragments_|. The data
// pointed to by |body| must be kept alive until an OnBodyConsumed() or
// ReadBody() call consumes it. |body| must not be empty.
- void OnBody(quiche::QuicheStringPiece body);
+ void OnBody(absl::string_view body);
// Internally marks |num_bytes| of body consumed. |num_bytes| might be zero.
// Returns the number of bytes that the caller should mark consumed with the
// sequencer, which is the sum of |num_bytes| for body, and the number of any
// interleaving or immediately trailing non-body bytes.
- QUIC_MUST_USE_RESULT size_t OnBodyConsumed(size_t num_bytes);
+ ABSL_MUST_USE_RESULT size_t OnBodyConsumed(size_t num_bytes);
// Set up to |iov_len| elements of iov[] to point to available bodies: each
// iov[i].iov_base will point to a body fragment, and iov[i].iov_len will be
@@ -63,7 +63,7 @@ class QUIC_EXPORT_PRIVATE QuicSpdyStreamBodyManager {
// preassigned and will not be changed. Returns the total number of bytes the
// caller shall mark consumed. Sets |*total_bytes_read| to the total number
// of body bytes read.
- QUIC_MUST_USE_RESULT size_t ReadBody(const struct iovec* iov,
+ ABSL_MUST_USE_RESULT size_t ReadBody(const struct iovec* iov,
size_t iov_len,
size_t* total_bytes_read);
@@ -79,7 +79,7 @@ class QUIC_EXPORT_PRIVATE QuicSpdyStreamBodyManager {
// consumed as soon as all of the body fragment is read.
struct QUIC_EXPORT_PRIVATE Fragment {
// |body| must not be empty.
- quiche::QuicheStringPiece body;
+ absl::string_view body;
// Might be zero.
QuicByteCount trailing_non_body_byte_count;
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager_test.cc
index 0cdc65af3b1..aaa8cce8007 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_body_manager_test.cc
@@ -8,11 +8,11 @@
#include <numeric>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -75,7 +75,7 @@ TEST_F(QuicSpdyStreamBodyManagerTest, OnBodyConsumed) {
};
for (size_t test_case_index = 0;
- test_case_index < QUICHE_ARRAYSIZE(kOnBodyConsumedTestData);
+ test_case_index < ABSL_ARRAYSIZE(kOnBodyConsumedTestData);
++test_case_index) {
const std::vector<QuicByteCount>& frame_header_lengths =
kOnBodyConsumedTestData[test_case_index].frame_header_lengths;
@@ -127,8 +127,7 @@ TEST_F(QuicSpdyStreamBodyManagerTest, PeekBody) {
};
for (size_t test_case_index = 0;
- test_case_index < QUICHE_ARRAYSIZE(kPeekBodyTestData);
- ++test_case_index) {
+ test_case_index < ABSL_ARRAYSIZE(kPeekBodyTestData); ++test_case_index) {
const std::vector<QuicByteCount>& frame_header_lengths =
kPeekBodyTestData[test_case_index].frame_header_lengths;
const std::vector<const char*>& frame_payloads =
@@ -154,7 +153,7 @@ TEST_F(QuicSpdyStreamBodyManagerTest, PeekBody) {
static_cast<size_t>(body_manager.PeekBody(&iovecs[0], iov_len)));
for (size_t iovec_index = 0; iovec_index < iovs_filled; ++iovec_index) {
EXPECT_EQ(frame_payloads[iovec_index],
- quiche::QuicheStringPiece(
+ absl::string_view(
static_cast<const char*>(iovecs[iovec_index].iov_base),
iovecs[iovec_index].iov_len));
}
@@ -221,8 +220,7 @@ TEST_F(QuicSpdyStreamBodyManagerTest, ReadBody) {
};
for (size_t test_case_index = 0;
- test_case_index < QUICHE_ARRAYSIZE(kReadBodyTestData);
- ++test_case_index) {
+ test_case_index < ABSL_ARRAYSIZE(kReadBodyTestData); ++test_case_index) {
const std::vector<QuicByteCount>& frame_header_lengths =
kReadBodyTestData[test_case_index].frame_header_lengths;
const std::vector<const char*>& frame_payloads =
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_test.cc
index 1c55c96af0b..526b987b7ed 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/quic_spdy_stream_test.cc
@@ -9,6 +9,9 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/http_encoder.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
@@ -30,8 +33,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using spdy::kV3HighestPriority;
@@ -133,6 +134,14 @@ class TestCryptoStream : public QuicCryptoStream, public QuicCryptoHandshaker {
}
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> /*application_state*/) override {}
+ bool KeyUpdateSupportedLocally() const override { return true; }
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override {
return *params_;
@@ -182,7 +191,7 @@ class TestStream : public QuicSpdyStream {
char buffer[2048];
struct iovec vec;
vec.iov_base = buffer;
- vec.iov_len = QUICHE_ARRAYSIZE(buffer);
+ vec.iov_len = ABSL_ARRAYSIZE(buffer);
size_t bytes_read = Readv(&vec, 1);
data_ += std::string(buffer, bytes_read);
}
@@ -307,8 +316,7 @@ class QuicSpdyStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
// Return QPACK-encoded header block without using the dynamic table.
std::string EncodeQpackHeaders(
- std::vector<std::pair<quiche::QuicheStringPiece,
- quiche::QuicheStringPiece>> headers) {
+ std::vector<std::pair<absl::string_view, absl::string_view>> headers) {
SpdyHeaderBlock header_block;
for (const auto& header_field : headers) {
header_block.AppendValueOrAddHeader(header_field.first,
@@ -408,8 +416,7 @@ class QuicSpdyStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
// Construct HEADERS frame with QPACK-encoded |headers| without using the
// dynamic table.
std::string HeadersFrame(
- std::vector<std::pair<quiche::QuicheStringPiece,
- quiche::QuicheStringPiece>> headers) {
+ std::vector<std::pair<absl::string_view, absl::string_view>> headers) {
return HeadersFrame(EncodeQpackHeaders(headers));
}
@@ -420,19 +427,19 @@ class QuicSpdyStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
}
// Construct HEADERS frame with given payload.
- std::string HeadersFrame(quiche::QuicheStringPiece payload) {
+ std::string HeadersFrame(absl::string_view payload) {
std::unique_ptr<char[]> headers_buffer;
QuicByteCount headers_frame_header_length =
HttpEncoder::SerializeHeadersFrameHeader(payload.length(),
&headers_buffer);
- quiche::QuicheStringPiece headers_frame_header(headers_buffer.get(),
- headers_frame_header_length);
+ absl::string_view headers_frame_header(headers_buffer.get(),
+ headers_frame_header_length);
return quiche::QuicheStrCat(headers_frame_header, payload);
}
// Construct PUSH_PROMISE frame with given payload.
std::string SerializePushPromiseFrame(PushId push_id,
- quiche::QuicheStringPiece payload) {
+ absl::string_view payload) {
PushPromiseFrame frame;
frame.push_id = push_id;
frame.headers = payload;
@@ -440,22 +447,21 @@ class QuicSpdyStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
QuicByteCount push_promise_frame_header_length =
HttpEncoder::SerializePushPromiseFrameWithOnlyPushId(
frame, &push_promise_buffer);
- quiche::QuicheStringPiece push_promise_frame_header(
+ absl::string_view push_promise_frame_header(
push_promise_buffer.get(), push_promise_frame_header_length);
return quiche::QuicheStrCat(push_promise_frame_header, payload);
}
- std::string DataFrame(quiche::QuicheStringPiece payload) {
+ std::string DataFrame(absl::string_view payload) {
std::unique_ptr<char[]> data_buffer;
QuicByteCount data_frame_header_length =
HttpEncoder::SerializeDataFrameHeader(payload.length(), &data_buffer);
- quiche::QuicheStringPiece data_frame_header(data_buffer.get(),
- data_frame_header_length);
+ absl::string_view data_frame_header(data_buffer.get(),
+ data_frame_header_length);
return quiche::QuicheStrCat(data_frame_header, payload);
}
- std::string UnknownFrame(uint64_t frame_type,
- quiche::QuicheStringPiece payload) {
+ std::string UnknownFrame(uint64_t frame_type, absl::string_view payload) {
std::string frame;
const size_t length = QuicDataWriter::GetVarInt62Len(frame_type) +
QuicDataWriter::GetVarInt62Len(payload.size()) +
@@ -509,8 +515,13 @@ TEST_P(QuicSpdyStreamTest, ProcessTooLargeHeaderList) {
stream_->OnStreamHeadersPriority(
spdy::SpdyStreamPrecedence(kV3HighestPriority));
- EXPECT_CALL(*session_,
- SendRstStream(stream_->id(), QUIC_HEADERS_TOO_LARGE, 0, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(stream_->id(), QUIC_HEADERS_TOO_LARGE, 0, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(
+ stream_->id(), QUIC_HEADERS_TOO_LARGE, 0));
+ }
stream_->OnStreamHeaderList(false, 1 << 20, headers);
EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_HEADERS_TOO_LARGE));
@@ -525,8 +536,15 @@ TEST_P(QuicSpdyStreamTest, ProcessTooLargeHeaderList) {
QuicStreamFrame frame(stream_->id(), false, 0, headers);
- EXPECT_CALL(*session_,
- SendRstStream(stream_->id(), QUIC_HEADERS_TOO_LARGE, 0, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(stream_->id(), QUIC_HEADERS_TOO_LARGE, 0, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendStopSendingFrame(stream_->id(),
+ QUIC_HEADERS_TOO_LARGE));
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(stream_->id(),
+ QUIC_HEADERS_TOO_LARGE, 0));
+ }
auto qpack_decoder_stream =
QuicSpdySessionPeer::GetQpackDecoderSendStream(session_.get());
@@ -646,7 +664,7 @@ TEST_P(QuicSpdyStreamTest, ProcessWrongFramesOnSpdyStream) {
EXPECT_EQ(headers, stream_->header_list());
stream_->ConsumeHeaderList();
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
EXPECT_CALL(*connection_,
CloseConnection(QUIC_HTTP_FRAME_UNEXPECTED_ON_SPDY_STREAM, _, _))
@@ -662,8 +680,11 @@ TEST_P(QuicSpdyStreamTest, ProcessWrongFramesOnSpdyStream) {
ConnectionCloseSource source) {
session_->ReallyOnConnectionClosed(frame, source);
}));
- EXPECT_CALL(*session_, SendRstStream(_, _, _, _));
- EXPECT_CALL(*session_, SendRstStream(_, _, _, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(_, _, _, _)).Times(2);
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(_, _, _)).Times(2);
+ }
stream_->OnStreamFrame(frame);
}
@@ -676,7 +697,7 @@ TEST_P(QuicSpdyStreamTest, Http3FrameError) {
Initialize(kShouldProcessData);
// PUSH_PROMISE frame with empty payload is considered invalid.
- std::string invalid_http3_frame = quiche::QuicheTextUtils::HexDecode("0500");
+ std::string invalid_http3_frame = absl::HexStringToBytes("0500");
QuicStreamFrame stream_frame(stream_->id(), /* fin = */ false,
/* offset = */ 0, invalid_http3_frame);
@@ -692,7 +713,7 @@ TEST_P(QuicSpdyStreamTest, UnexpectedHttp3Frame) {
Initialize(kShouldProcessData);
// SETTINGS frame with empty payload.
- std::string settings = quiche::QuicheTextUtils::HexDecode("0400");
+ std::string settings = absl::HexStringToBytes("0400");
QuicStreamFrame stream_frame(stream_->id(), /* fin = */ false,
/* offset = */ 0, settings);
@@ -712,7 +733,7 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndBody) {
EXPECT_EQ(headers, stream_->header_list());
stream_->ConsumeHeaderList();
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame);
EXPECT_EQ(QuicHeaderList(), stream_->header_list());
EXPECT_EQ(body, stream_->data());
@@ -729,10 +750,10 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndBodyFragments) {
stream_->ConsumeHeaderList();
for (size_t offset = 0; offset < data.size(); offset += fragment_size) {
size_t remaining_data = data.size() - offset;
- quiche::QuicheStringPiece fragment(
- data.data() + offset, std::min(fragment_size, remaining_data));
+ absl::string_view fragment(data.data() + offset,
+ std::min(fragment_size, remaining_data));
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false,
- offset, quiche::QuicheStringPiece(fragment));
+ offset, absl::string_view(fragment));
stream_->OnStreamFrame(frame);
}
ASSERT_EQ(body, stream_->data()) << "fragment_size: " << fragment_size;
@@ -749,15 +770,15 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndBodyFragmentsSplit) {
ASSERT_EQ(headers, stream_->header_list());
stream_->ConsumeHeaderList();
- quiche::QuicheStringPiece fragment1(data.data(), split_point);
+ absl::string_view fragment1(data.data(), split_point);
QuicStreamFrame frame1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(fragment1));
+ absl::string_view(fragment1));
stream_->OnStreamFrame(frame1);
- quiche::QuicheStringPiece fragment2(data.data() + split_point,
- data.size() - split_point);
+ absl::string_view fragment2(data.data() + split_point,
+ data.size() - split_point);
QuicStreamFrame frame2(GetNthClientInitiatedBidirectionalId(0), false,
- split_point, quiche::QuicheStringPiece(fragment2));
+ split_point, absl::string_view(fragment2));
stream_->OnStreamFrame(frame2);
ASSERT_EQ(body, stream_->data()) << "split_point: " << split_point;
@@ -772,15 +793,15 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndBodyReadv) {
ProcessHeaders(false, headers_);
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame);
stream_->ConsumeHeaderList();
char buffer[2048];
- ASSERT_LT(data.length(), QUICHE_ARRAYSIZE(buffer));
+ ASSERT_LT(data.length(), ABSL_ARRAYSIZE(buffer));
struct iovec vec;
vec.iov_base = buffer;
- vec.iov_len = QUICHE_ARRAYSIZE(buffer);
+ vec.iov_len = ABSL_ARRAYSIZE(buffer);
size_t bytes_read = stream_->Readv(&vec, 1);
QuicStreamPeer::CloseReadSide(stream_);
@@ -795,16 +816,16 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndLargeBodySmallReadv) {
ProcessHeaders(false, headers_);
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame);
stream_->ConsumeHeaderList();
char buffer[2048];
char buffer2[2048];
struct iovec vec[2];
vec[0].iov_base = buffer;
- vec[0].iov_len = QUICHE_ARRAYSIZE(buffer);
+ vec[0].iov_len = ABSL_ARRAYSIZE(buffer);
vec[1].iov_base = buffer2;
- vec[1].iov_len = QUICHE_ARRAYSIZE(buffer2);
+ vec[1].iov_len = ABSL_ARRAYSIZE(buffer2);
size_t bytes_read = stream_->Readv(vec, 2);
EXPECT_EQ(2048u * 2, bytes_read);
EXPECT_EQ(body.substr(0, 2048), std::string(buffer, 2048));
@@ -819,7 +840,7 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndBodyMarkConsumed) {
ProcessHeaders(false, headers_);
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame);
stream_->ConsumeHeaderList();
@@ -842,9 +863,9 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndConsumeMultipleBody) {
ProcessHeaders(false, headers_);
QuicStreamFrame frame1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data1));
+ absl::string_view(data1));
QuicStreamFrame frame2(GetNthClientInitiatedBidirectionalId(0), false,
- data1.length(), quiche::QuicheStringPiece(data2));
+ data1.length(), absl::string_view(data2));
stream_->OnStreamFrame(frame1);
stream_->OnStreamFrame(frame2);
stream_->ConsumeHeaderList();
@@ -862,14 +883,14 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersAndBodyIncrementalReadv) {
ProcessHeaders(false, headers_);
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame);
stream_->ConsumeHeaderList();
char buffer[1];
struct iovec vec;
vec.iov_base = buffer;
- vec.iov_len = QUICHE_ARRAYSIZE(buffer);
+ vec.iov_len = ABSL_ARRAYSIZE(buffer);
for (size_t i = 0; i < body.length(); ++i) {
size_t bytes_read = stream_->Readv(&vec, 1);
@@ -886,7 +907,7 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersUsingReadvWithMultipleIovecs) {
ProcessHeaders(false, headers_);
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame);
stream_->ConsumeHeaderList();
@@ -894,9 +915,9 @@ TEST_P(QuicSpdyStreamTest, ProcessHeadersUsingReadvWithMultipleIovecs) {
char buffer2[1];
struct iovec vec[2];
vec[0].iov_base = buffer1;
- vec[0].iov_len = QUICHE_ARRAYSIZE(buffer1);
+ vec[0].iov_len = ABSL_ARRAYSIZE(buffer1);
vec[1].iov_base = buffer2;
- vec[1].iov_len = QUICHE_ARRAYSIZE(buffer2);
+ vec[1].iov_len = ABSL_ARRAYSIZE(buffer2);
for (size_t i = 0; i < body.length(); i += 2) {
size_t bytes_read = stream_->Readv(vec, 2);
@@ -971,7 +992,7 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlNoWindowUpdateIfNotConsumed) {
ProcessHeaders(false, headers_);
QuicStreamFrame frame1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame1);
EXPECT_EQ(kWindow - (kWindow / 3) - header_length,
QuicStreamPeer::ReceiveWindowSize(stream_));
@@ -980,8 +1001,7 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlNoWindowUpdateIfNotConsumed) {
// half full. This should all be buffered, decreasing the receive window but
// not sending WINDOW_UPDATE.
QuicStreamFrame frame2(GetNthClientInitiatedBidirectionalId(0), false,
- kWindow / 3 + header_length,
- quiche::QuicheStringPiece(data));
+ kWindow / 3 + header_length, absl::string_view(data));
stream_->OnStreamFrame(frame2);
EXPECT_EQ(kWindow - (2 * kWindow / 3) - 2 * header_length,
QuicStreamPeer::ReceiveWindowSize(stream_));
@@ -1017,7 +1037,7 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlWindowUpdate) {
stream_->ConsumeHeaderList();
QuicStreamFrame frame1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame1);
EXPECT_EQ(kWindow - (kWindow / 3) - header_length,
QuicStreamPeer::ReceiveWindowSize(stream_));
@@ -1027,8 +1047,7 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlWindowUpdate) {
// offset and send a WINDOW_UPDATE. The result will be again an available
// window of kWindow bytes.
QuicStreamFrame frame2(GetNthClientInitiatedBidirectionalId(0), false,
- kWindow / 3 + header_length,
- quiche::QuicheStringPiece(data));
+ kWindow / 3 + header_length, absl::string_view(data));
EXPECT_CALL(*session_, SendWindowUpdate(_, _));
EXPECT_CALL(*connection_, SendControlFrame(_));
stream_->OnStreamFrame(frame2);
@@ -1088,10 +1107,10 @@ TEST_P(QuicSpdyStreamTest, ConnectionFlowControlWindowUpdate) {
}
QuicStreamFrame frame1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream_->OnStreamFrame(frame1);
QuicStreamFrame frame2(GetNthClientInitiatedBidirectionalId(1), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
stream2_->OnStreamFrame(frame2);
// Now receive a further single byte on one stream - again this does not
@@ -1101,7 +1120,7 @@ TEST_P(QuicSpdyStreamTest, ConnectionFlowControlWindowUpdate) {
EXPECT_CALL(*connection_, SendControlFrame(_));
QuicStreamFrame frame3(GetNthClientInitiatedBidirectionalId(0), false,
body.length() + header_length,
- quiche::QuicheStringPiece(data2));
+ absl::string_view(data2));
stream_->OnStreamFrame(frame3);
}
@@ -1122,7 +1141,7 @@ TEST_P(QuicSpdyStreamTest, StreamFlowControlViolation) {
std::string body(kWindow + 1, 'a');
std::string data = UsesHttp3() ? DataFrame(body) : body;
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
EXPECT_CALL(*connection_,
CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _));
stream_->OnStreamFrame(frame);
@@ -1161,7 +1180,7 @@ TEST_P(QuicSpdyStreamTest, ConnectionFlowControlViolation) {
EXPECT_LT(data.size(), kStreamWindow);
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece(data));
+ absl::string_view(data));
EXPECT_CALL(*connection_,
CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _));
@@ -2049,9 +2068,9 @@ TEST_P(QuicSpdyStreamTest, ProcessBodyAfterTrailers) {
char buffer[2048];
struct iovec vec;
vec.iov_base = buffer;
- vec.iov_len = QUICHE_ARRAYSIZE(buffer);
+ vec.iov_len = ABSL_ARRAYSIZE(buffer);
size_t bytes_read = stream_->Readv(&vec, 1);
- EXPECT_EQ(kDataFramePayload, quiche::QuicheStringPiece(buffer, bytes_read));
+ EXPECT_EQ(kDataFramePayload, absl::string_view(buffer, bytes_read));
EXPECT_FALSE(stream_->HasBytesToRead());
}
@@ -2070,7 +2089,7 @@ TEST_P(QuicSpdyStreamTest, MalformedHeadersStopHttpDecoder) {
// Random bad headers.
std::string headers =
- HeadersFrame(quiche::QuicheTextUtils::HexDecode("00002a94e7036261"));
+ HeadersFrame(absl::HexStringToBytes("00002a94e7036261"));
std::string data = DataFrame(kDataFramePayload);
std::string stream_frame_payload = quiche::QuicheStrCat(headers, data);
@@ -2094,8 +2113,11 @@ TEST_P(QuicSpdyStreamTest, MalformedHeadersStopHttpDecoder) {
ConnectionCloseSource source) {
session_->ReallyOnConnectionClosed(frame, source);
}));
- EXPECT_CALL(*session_, SendRstStream(_, _, _, _));
- EXPECT_CALL(*session_, SendRstStream(_, _, _, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(_, _, _, _)).Times(2);
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(_, _, _)).Times(2);
+ }
stream_->OnStreamFrame(frame);
}
@@ -2133,13 +2155,17 @@ TEST_P(QuicSpdyStreamTest, DoNotMarkConsumedAfterQpackDecodingError) {
session_->ReallyOnConnectionClosed(frame, source);
}));
}
- EXPECT_CALL(*session_, SendRstStream(stream_->id(), _, _, _));
- EXPECT_CALL(*session_, SendRstStream(stream2_->id(), _, _, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(stream_->id(), _, _, _));
+ EXPECT_CALL(*session_, SendRstStream(stream2_->id(), _, _, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(stream_->id(), _, _));
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(stream2_->id(), _, _));
+ }
// Invalid headers: Required Insert Count is zero, but the header block
// contains a dynamic table reference.
- std::string headers =
- HeadersFrame(quiche::QuicheTextUtils::HexDecode("000080"));
+ std::string headers = HeadersFrame(absl::HexStringToBytes("000080"));
QuicStreamFrame frame(stream_->id(), false, 0, headers);
stream_->OnStreamFrame(frame);
}
@@ -2162,7 +2188,7 @@ TEST_P(QuicSpdyStreamTest, ImmediateHeaderDecodingWithDynamicTableEntries) {
session_->qpack_decoder()->OnInsertWithoutNameReference("foo", "bar");
// HEADERS frame referencing first dynamic table entry.
- std::string encoded_headers = quiche::QuicheTextUtils::HexDecode("020080");
+ std::string encoded_headers = absl::HexStringToBytes("020080");
std::string headers = HeadersFrame(encoded_headers);
EXPECT_CALL(debug_visitor,
OnHeadersFrameReceived(stream_->id(), encoded_headers.length()));
@@ -2196,7 +2222,7 @@ TEST_P(QuicSpdyStreamTest, ImmediateHeaderDecodingWithDynamicTableEntries) {
session_->qpack_decoder()->OnInsertWithoutNameReference("trailing", "foobar");
// Trailing HEADERS frame referencing second dynamic table entry.
- std::string encoded_trailers = quiche::QuicheTextUtils::HexDecode("030080");
+ std::string encoded_trailers = absl::HexStringToBytes("030080");
std::string trailers = HeadersFrame(encoded_trailers);
EXPECT_CALL(debug_visitor,
OnHeadersFrameReceived(stream_->id(), encoded_trailers.length()));
@@ -2228,7 +2254,7 @@ TEST_P(QuicSpdyStreamTest, BlockedHeaderDecoding) {
session_->set_debug_visitor(&debug_visitor);
// HEADERS frame referencing first dynamic table entry.
- std::string encoded_headers = quiche::QuicheTextUtils::HexDecode("020080");
+ std::string encoded_headers = absl::HexStringToBytes("020080");
std::string headers = HeadersFrame(encoded_headers);
EXPECT_CALL(debug_visitor,
OnHeadersFrameReceived(stream_->id(), encoded_headers.length()));
@@ -2266,7 +2292,7 @@ TEST_P(QuicSpdyStreamTest, BlockedHeaderDecoding) {
EXPECT_EQ(kDataFramePayload, stream_->data());
// Trailing HEADERS frame referencing second dynamic table entry.
- std::string encoded_trailers = quiche::QuicheTextUtils::HexDecode("030080");
+ std::string encoded_trailers = absl::HexStringToBytes("030080");
std::string trailers = HeadersFrame(encoded_trailers);
EXPECT_CALL(debug_visitor,
OnHeadersFrameReceived(stream_->id(), encoded_trailers.length()));
@@ -2300,8 +2326,7 @@ TEST_P(QuicSpdyStreamTest, AsyncErrorDecodingHeaders) {
// HEADERS frame only referencing entry with absolute index 0 but with
// Required Insert Count = 2, which is incorrect.
- std::string headers =
- HeadersFrame(quiche::QuicheTextUtils::HexDecode("030081"));
+ std::string headers = HeadersFrame(absl::HexStringToBytes("030081"));
stream_->OnStreamFrame(QuicStreamFrame(stream_->id(), false, 0, headers));
// Even though entire header block is received and every referenced entry is
@@ -2333,8 +2358,7 @@ TEST_P(QuicSpdyStreamTest, BlockedHeaderDecodingUnblockedWithBufferedError) {
session_->qpack_decoder()->OnSetDynamicTableCapacity(1024);
// Relative index 2 is invalid because it is larger than or equal to the Base.
- std::string headers =
- HeadersFrame(quiche::QuicheTextUtils::HexDecode("020082"));
+ std::string headers = HeadersFrame(absl::HexStringToBytes("020082"));
stream_->OnStreamFrame(QuicStreamFrame(stream_->id(), false, 0, headers));
// Decoding is blocked.
@@ -2362,8 +2386,7 @@ TEST_P(QuicSpdyStreamTest, AsyncErrorDecodingTrailers) {
session_->qpack_decoder()->OnSetDynamicTableCapacity(1024);
// HEADERS frame referencing first dynamic table entry.
- std::string headers =
- HeadersFrame(quiche::QuicheTextUtils::HexDecode("020080"));
+ std::string headers = HeadersFrame(absl::HexStringToBytes("020080"));
stream_->OnStreamFrame(QuicStreamFrame(stream_->id(), false, 0, headers));
// Decoding is blocked because dynamic table entry has not been received yet.
@@ -2396,8 +2419,7 @@ TEST_P(QuicSpdyStreamTest, AsyncErrorDecodingTrailers) {
// Trailing HEADERS frame only referencing entry with absolute index 0 but
// with Required Insert Count = 2, which is incorrect.
- std::string trailers =
- HeadersFrame(quiche::QuicheTextUtils::HexDecode("030081"));
+ std::string trailers = HeadersFrame(absl::HexStringToBytes("030081"));
stream_->OnStreamFrame(QuicStreamFrame(stream_->id(), true, /* offset = */
headers.length() + data.length(),
trailers));
@@ -2433,7 +2455,7 @@ TEST_P(QuicSpdyStreamTest, HeaderDecodingUnblockedAfterStreamClosed) {
session_->set_debug_visitor(&debug_visitor);
// HEADERS frame referencing first dynamic table entry.
- std::string encoded_headers = quiche::QuicheTextUtils::HexDecode("020080");
+ std::string encoded_headers = absl::HexStringToBytes("020080");
std::string headers = HeadersFrame(encoded_headers);
EXPECT_CALL(debug_visitor,
OnHeadersFrameReceived(stream_->id(), encoded_headers.length()));
@@ -2453,8 +2475,15 @@ TEST_P(QuicSpdyStreamTest, HeaderDecodingUnblockedAfterStreamClosed) {
/* offset = */ 1, _, _, _));
// Reset stream.
- EXPECT_CALL(*session_,
- SendRstStream(stream_->id(), QUIC_STREAM_CANCELLED, _, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(stream_->id(), QUIC_STREAM_CANCELLED, _, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendStopSendingFrame(stream_->id(),
+ QUIC_STREAM_CANCELLED));
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(stream_->id(),
+ QUIC_STREAM_CANCELLED, _));
+ }
stream_->Reset(QUIC_STREAM_CANCELLED);
if (!GetQuicReloadableFlag(quic_abort_qpack_on_stream_close)) {
@@ -2484,7 +2513,7 @@ class QuicSpdyStreamIncrementalConsumptionTest : public QuicSpdyStreamTest {
// Create QuicStreamFrame with |payload|
// and pass it to stream_->OnStreamFrame().
- void OnStreamFrame(quiche::QuicheStringPiece payload) {
+ void OnStreamFrame(absl::string_view payload) {
QuicStreamFrame frame(stream_->id(), /* fin = */ false, offset_, payload);
stream_->OnStreamFrame(frame);
offset_ += payload.size();
@@ -2536,12 +2565,11 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, OnlyKnownFrames) {
// All HEADERS frame bytes are consumed even if the frame is not received
// completely.
- OnStreamFrame(
- quiche::QuicheStringPiece(headers).substr(0, headers.size() - 1));
+ OnStreamFrame(absl::string_view(headers).substr(0, headers.size() - 1));
EXPECT_EQ(headers.size() - 1, NewlyConsumedBytes());
// The rest of the HEADERS frame is also consumed immediately.
- OnStreamFrame(quiche::QuicheStringPiece(headers).substr(headers.size() - 1));
+ OnStreamFrame(absl::string_view(headers).substr(headers.size() - 1));
EXPECT_EQ(1u, NewlyConsumedBytes());
// Verify headers.
@@ -2549,7 +2577,7 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, OnlyKnownFrames) {
stream_->ConsumeHeaderList();
// DATA frame.
- quiche::QuicheStringPiece data_payload(kDataFramePayload);
+ absl::string_view data_payload(kDataFramePayload);
std::string data_frame = DataFrame(data_payload);
QuicByteCount data_frame_header_length =
data_frame.size() - data_payload.size();
@@ -2568,8 +2596,7 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, OnlyKnownFrames) {
HeadersFrame({std::make_pair("custom-key", "custom-value")});
// No bytes are consumed, because last byte of DATA payload is still buffered.
- OnStreamFrame(
- quiche::QuicheStringPiece(trailers).substr(0, trailers.size() - 1));
+ OnStreamFrame(absl::string_view(trailers).substr(0, trailers.size() - 1));
EXPECT_EQ(0u, NewlyConsumedBytes());
// Reading last byte of DATA payload triggers consumption of all data received
@@ -2578,8 +2605,7 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, OnlyKnownFrames) {
EXPECT_EQ(1 + trailers.size() - 1, NewlyConsumedBytes());
// Last byte of trailers is immediately consumed.
- OnStreamFrame(
- quiche::QuicheStringPiece(trailers).substr(trailers.size() - 1));
+ OnStreamFrame(absl::string_view(trailers).substr(trailers.size() - 1));
EXPECT_EQ(1u, NewlyConsumedBytes());
// Verify trailers.
@@ -2619,12 +2645,11 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, UnknownFramesInterleaved) {
// All HEADERS frame bytes are consumed even if the frame is not received
// completely.
- OnStreamFrame(
- quiche::QuicheStringPiece(headers).substr(0, headers.size() - 1));
+ OnStreamFrame(absl::string_view(headers).substr(0, headers.size() - 1));
EXPECT_EQ(headers.size() - 1, NewlyConsumedBytes());
// The rest of the HEADERS frame is also consumed immediately.
- OnStreamFrame(quiche::QuicheStringPiece(headers).substr(headers.size() - 1));
+ OnStreamFrame(absl::string_view(headers).substr(headers.size() - 1));
EXPECT_EQ(1u, NewlyConsumedBytes());
// Verify headers.
@@ -2638,7 +2663,7 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, UnknownFramesInterleaved) {
EXPECT_EQ(unknown_frame2.size(), NewlyConsumedBytes());
// DATA frame.
- quiche::QuicheStringPiece data_payload(kDataFramePayload);
+ absl::string_view data_payload(kDataFramePayload);
std::string data_frame = DataFrame(data_payload);
QuicByteCount data_frame_header_length =
data_frame.size() - data_payload.size();
@@ -2663,8 +2688,7 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, UnknownFramesInterleaved) {
HeadersFrame({std::make_pair("custom-key", "custom-value")});
// No bytes are consumed, because last byte of DATA payload is still buffered.
- OnStreamFrame(
- quiche::QuicheStringPiece(trailers).substr(0, trailers.size() - 1));
+ OnStreamFrame(absl::string_view(trailers).substr(0, trailers.size() - 1));
EXPECT_EQ(0u, NewlyConsumedBytes());
// Reading last byte of DATA payload triggers consumption of all data received
@@ -2674,8 +2698,7 @@ TEST_P(QuicSpdyStreamIncrementalConsumptionTest, UnknownFramesInterleaved) {
NewlyConsumedBytes());
// Last byte of trailers is immediately consumed.
- OnStreamFrame(
- quiche::QuicheStringPiece(trailers).substr(trailers.size() - 1));
+ OnStreamFrame(absl::string_view(trailers).substr(trailers.size() - 1));
EXPECT_EQ(1u, NewlyConsumedBytes());
// Verify trailers.
@@ -2876,7 +2899,7 @@ TEST_P(QuicSpdyStreamTest, StopProcessingIfConnectionClosed) {
Initialize(kShouldProcessData);
// SETTINGS frame with empty payload.
- std::string settings = quiche::QuicheTextUtils::HexDecode("0400");
+ std::string settings = absl::HexStringToBytes("0400");
// HEADERS frame.
// Since it arrives after a SETTINGS frame, it should never be read.
@@ -2920,8 +2943,15 @@ TEST_P(QuicSpdyStreamTest, StreamCancellationWhenStreamReset) {
EXPECT_CALL(*session_,
WritevData(qpack_decoder_stream->id(), /* write_length = */ 1,
/* offset = */ 1, _, _, _));
- EXPECT_CALL(*session_,
- SendRstStream(stream_->id(), QUIC_STREAM_CANCELLED, 0, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(stream_->id(), QUIC_STREAM_CANCELLED, _, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendStopSendingFrame(stream_->id(),
+ QUIC_STREAM_CANCELLED));
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(stream_->id(),
+ QUIC_STREAM_CANCELLED, _));
+ }
stream_->Reset(QUIC_STREAM_CANCELLED);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.cc b/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.cc
index 4ba328943ff..3c89a545801 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.h"
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using spdy::SpdyHeaderBlock;
@@ -40,7 +40,7 @@ std::string SpdyServerPushUtils::GetPromisedUrlFromHeaders(
if (it == headers.end() || it->second.empty()) {
return std::string();
}
- quiche::QuicheStringPiece scheme = it->second;
+ absl::string_view scheme = it->second;
// RFC 7540, Section 8.2: The server MUST include a value in the
// ":authority" pseudo-header field for which the server is authoritative
@@ -49,7 +49,7 @@ std::string SpdyServerPushUtils::GetPromisedUrlFromHeaders(
if (it == headers.end() || it->second.empty()) {
return std::string();
}
- quiche::QuicheStringPiece authority = it->second;
+ absl::string_view authority = it->second;
// RFC 7540, Section 8.1.2.3 requires that the ":path" pseudo-header MUST
// NOT be empty for "http" or "https" URIs;
@@ -60,7 +60,7 @@ std::string SpdyServerPushUtils::GetPromisedUrlFromHeaders(
if (it == headers.end()) {
return std::string();
}
- quiche::QuicheStringPiece path = it->second;
+ absl::string_view path = it->second;
return GetPushPromiseUrl(scheme, authority, path);
}
@@ -80,10 +80,9 @@ bool SpdyServerPushUtils::PromisedUrlIsValid(const SpdyHeaderBlock& headers) {
}
// static
-std::string SpdyServerPushUtils::GetPushPromiseUrl(
- quiche::QuicheStringPiece scheme,
- quiche::QuicheStringPiece authority,
- quiche::QuicheStringPiece path) {
+std::string SpdyServerPushUtils::GetPushPromiseUrl(absl::string_view scheme,
+ absl::string_view authority,
+ absl::string_view path) {
// RFC 7540, Section 8.1.2.3: The ":path" pseudo-header field includes the
// path and query parts of the target URI (the "path-absolute" production
// and optionally a '?' character followed by the "query" production (see
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.h b/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.h
index 16e1ac6db64..99a834bd695 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_CORE_HTTP_SPDY_SERVER_PUSH_UTILS_H_
#define QUICHE_QUIC_CORE_HTTP_SPDY_SERVER_PUSH_UTILS_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace quic {
@@ -33,9 +33,9 @@ class QUIC_EXPORT_PRIVATE SpdyServerPushUtils {
// Returns a canonical, valid URL for a PUSH_PROMISE with the specified
// ":scheme", ":authority", and ":path" header fields, or an empty
// string if the resulting URL is not valid or supported.
- static std::string GetPushPromiseUrl(quiche::QuicheStringPiece scheme,
- quiche::QuicheStringPiece authority,
- quiche::QuicheStringPiece path);
+ static std::string GetPushPromiseUrl(absl::string_view scheme,
+ absl::string_view authority,
+ absl::string_view path);
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils_test.cc
index ed7895e3b0a..fa98f077c6d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/spdy_server_push_utils_test.cc
@@ -7,8 +7,8 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
using spdy::SpdyHeaderBlock;
@@ -157,11 +157,11 @@ TEST_F(PushPromiseUrlTest, GetPushPromiseUrl) {
{"[::ffff:192.168", 0},
{"]/", 0},
{"//", 0}};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(input_headers); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(input_headers); ++i) {
bool should_accept = (input_headers[i].second & SCHEME);
- for (size_t j = 0; j < QUICHE_ARRAYSIZE(input_headers); ++j) {
+ for (size_t j = 0; j < ABSL_ARRAYSIZE(input_headers); ++j) {
bool should_accept_2 = should_accept && (input_headers[j].second & AUTH);
- for (size_t k = 0; k < QUICHE_ARRAYSIZE(input_headers); ++k) {
+ for (size_t k = 0; k < ABSL_ARRAYSIZE(input_headers); ++k) {
// |should_accept_3| indicates whether or not GetPushPromiseUrl() is
// expected to accept this input combination.
bool should_accept_3 =
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils.cc b/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils.cc
index 847408d89cc..2a888fb1af0 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils.cc
@@ -8,12 +8,14 @@
#include <string>
#include <vector>
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_split.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
@@ -29,12 +31,12 @@ bool SpdyUtils::ExtractContentLengthFromHeaders(int64_t* content_length,
return false;
} else {
// Check whether multiple values are consistent.
- quiche::QuicheStringPiece content_length_header = it->second;
- std::vector<quiche::QuicheStringPiece> values =
- quiche::QuicheTextUtils::Split(content_length_header, '\0');
- for (const quiche::QuicheStringPiece& value : values) {
+ absl::string_view content_length_header = it->second;
+ std::vector<absl::string_view> values =
+ absl::StrSplit(content_length_header, '\0');
+ for (const absl::string_view& value : values) {
uint64_t new_value;
- if (!quiche::QuicheTextUtils::StringToUint64(value, &new_value) ||
+ if (!absl::SimpleAtoi(value, &new_value) ||
!quiche::QuicheTextUtils::IsAllDigits(value)) {
QUIC_DLOG(ERROR)
<< "Content length was either unparseable or negative.";
@@ -96,7 +98,7 @@ bool SpdyUtils::CopyAndValidateTrailers(const QuicHeaderList& header_list,
// response body bytes expected.
if (expect_final_byte_offset && !found_final_byte_offset &&
name == kFinalOffsetHeaderKey &&
- quiche::QuicheTextUtils::StringToSizeT(p.second, final_byte_offset)) {
+ absl::SimpleAtoi(p.second, final_byte_offset)) {
found_final_byte_offset = true;
continue;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils_test.cc b/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils_test.cc
index dd8079e6320..9216a538b91 100644
--- a/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/http/spdy_utils_test.cc
@@ -5,10 +5,10 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using spdy::SpdyHeaderBlock;
@@ -66,14 +66,13 @@ TEST_F(CopyAndValidateHeaders, NormalUsage) {
SpdyHeaderBlock block;
ASSERT_TRUE(
SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
- EXPECT_THAT(
- block,
- UnorderedElementsAre(
- Pair("cookie", " part 1; part 2 ; part3; fin!"),
- Pair("passed-through", quiche::QuicheStringPiece("foo\0baz", 7)),
- Pair("joined", quiche::QuicheStringPiece("value 1\0value 2", 15)),
- Pair("empty", ""),
- Pair("empty-joined", quiche::QuicheStringPiece("\0foo\0\0", 6))));
+ EXPECT_THAT(block,
+ UnorderedElementsAre(
+ Pair("cookie", " part 1; part 2 ; part3; fin!"),
+ Pair("passed-through", absl::string_view("foo\0baz", 7)),
+ Pair("joined", absl::string_view("value 1\0value 2", 15)),
+ Pair("empty", ""),
+ Pair("empty-joined", absl::string_view("\0foo\0\0", 6))));
EXPECT_EQ(-1, content_length);
}
@@ -104,11 +103,10 @@ TEST_F(CopyAndValidateHeaders, MultipleContentLengths) {
SpdyHeaderBlock block;
ASSERT_TRUE(
SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
- EXPECT_THAT(block,
- UnorderedElementsAre(
- Pair("foo", "foovalue"), Pair("bar", "barvalue"),
- Pair("content-length", quiche::QuicheStringPiece("9\09", 3)),
- Pair("baz", "")));
+ EXPECT_THAT(block, UnorderedElementsAre(
+ Pair("foo", "foovalue"), Pair("bar", "barvalue"),
+ Pair("content-length", absl::string_view("9\09", 3)),
+ Pair("baz", "")));
EXPECT_EQ(9, content_length);
}
@@ -133,11 +131,11 @@ TEST_F(CopyAndValidateHeaders, LargeContentLength) {
SpdyHeaderBlock block;
ASSERT_TRUE(
SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
- EXPECT_THAT(block, UnorderedElementsAre(
- Pair("foo", "foovalue"), Pair("bar", "barvalue"),
- Pair("content-length",
- quiche::QuicheStringPiece("9000000000")),
- Pair("baz", "")));
+ EXPECT_THAT(block,
+ UnorderedElementsAre(
+ Pair("foo", "foovalue"), Pair("bar", "barvalue"),
+ Pair("content-length", absl::string_view("9000000000")),
+ Pair("baz", "")));
EXPECT_EQ(9000000000, content_length);
}
@@ -165,11 +163,10 @@ TEST_F(CopyAndValidateHeaders, MultipleValues) {
SpdyHeaderBlock block;
ASSERT_TRUE(
SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
- EXPECT_THAT(block,
- UnorderedElementsAre(
- Pair("foo", quiche::QuicheStringPiece("foovalue\0boo", 12)),
- Pair("bar", "barvalue"),
- Pair("baz", quiche::QuicheStringPiece("\0buzz", 5))));
+ EXPECT_THAT(block, UnorderedElementsAre(
+ Pair("foo", absl::string_view("foovalue\0boo", 12)),
+ Pair("bar", "barvalue"),
+ Pair("baz", absl::string_view("\0buzz", 5))));
EXPECT_EQ(-1, content_length);
}
@@ -182,8 +179,8 @@ TEST_F(CopyAndValidateHeaders, MoreThanTwoValues) {
ASSERT_TRUE(
SpdyUtils::CopyAndValidateHeaders(*headers, &content_length, &block));
EXPECT_THAT(block, UnorderedElementsAre(Pair(
- "set-cookie", quiche::QuicheStringPiece(
- "value1\0value2\0value3", 20))));
+ "set-cookie",
+ absl::string_view("value1\0value2\0value3", 20))));
EXPECT_EQ(-1, content_length);
}
@@ -325,7 +322,7 @@ TEST_F(CopyAndValidateTrailers, DuplicateTrailers) {
block,
UnorderedElementsAre(
Pair("key",
- quiche::QuicheStringPiece(
+ absl::string_view(
"value0\0value1\0\0\0value2\0\0non_contiguous_duplicate",
48)),
Pair("other_key", "value")));
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.cc
index 6469dd266b5..1e66346cdb3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -27,9 +27,8 @@ QpackDecodedHeadersAccumulator::QpackDecodedHeadersAccumulator(
quic_header_list_.OnHeaderBlockStart();
}
-void QpackDecodedHeadersAccumulator::OnHeaderDecoded(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+void QpackDecodedHeadersAccumulator::OnHeaderDecoded(absl::string_view name,
+ absl::string_view value) {
DCHECK(!error_detected_);
uncompressed_header_bytes_without_overhead_ += name.size() + value.size();
@@ -64,7 +63,7 @@ void QpackDecodedHeadersAccumulator::OnDecodingCompleted() {
}
void QpackDecodedHeadersAccumulator::OnDecodingErrorDetected(
- quiche::QuicheStringPiece error_message) {
+ absl::string_view error_message) {
DCHECK(!error_detected_);
DCHECK(!headers_decoded_);
@@ -73,7 +72,7 @@ void QpackDecodedHeadersAccumulator::OnDecodingErrorDetected(
visitor_->OnHeaderDecodingError(error_message);
}
-void QpackDecodedHeadersAccumulator::Decode(quiche::QuicheStringPiece data) {
+void QpackDecodedHeadersAccumulator::Decode(absl::string_view data) {
DCHECK(!error_detected_);
compressed_header_bytes_ += data.size();
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.h
index 334fcbda543..e194a98ebc5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator.h
@@ -8,11 +8,11 @@
#include <cstddef>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/quic_header_list.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -45,8 +45,7 @@ class QUIC_EXPORT_PRIVATE QpackDecodedHeadersAccumulator
bool header_list_size_limit_exceeded) = 0;
// Called when an error has occurred.
- virtual void OnHeaderDecodingError(
- quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnHeaderDecodingError(absl::string_view error_message) = 0;
};
QpackDecodedHeadersAccumulator(QuicStreamId id,
@@ -57,16 +56,15 @@ class QUIC_EXPORT_PRIVATE QpackDecodedHeadersAccumulator
// QpackProgressiveDecoder::HeadersHandlerInterface implementation.
// These methods should only be called by |decoder_|.
- void OnHeaderDecoded(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) override;
+ void OnHeaderDecoded(absl::string_view name,
+ absl::string_view value) override;
void OnDecodingCompleted() override;
- void OnDecodingErrorDetected(
- quiche::QuicheStringPiece error_message) override;
+ void OnDecodingErrorDetected(absl::string_view error_message) override;
// Decode payload data.
// Must not be called if an error has been detected.
// Must not be called after EndHeaderBlock().
- void Decode(quiche::QuicheStringPiece data);
+ void Decode(absl::string_view data);
// Signal end of HEADERS frame.
// Must not be called if an error has been detected.
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator_test.cc
index 93e2561f367..2a5b0da86bf 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoded_headers_accumulator_test.cc
@@ -6,11 +6,12 @@
#include <cstring>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using ::testing::_;
@@ -48,7 +49,7 @@ class MockVisitor : public QpackDecodedHeadersAccumulator::Visitor {
(override));
MOCK_METHOD(void,
OnHeaderDecodingError,
- (quiche::QuicheStringPiece error_message),
+ (absl::string_view error_message),
(override));
};
@@ -84,7 +85,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, EmptyPayload) {
// HEADERS frame payload must have a complete Header Block Prefix.
TEST_F(QpackDecodedHeadersAccumulatorTest, TruncatedHeaderBlockPrefix) {
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("00"));
+ accumulator_.Decode(absl::HexStringToBytes("00"));
EXPECT_CALL(visitor_,
OnHeaderDecodingError(Eq("Incomplete header data prefix.")));
@@ -92,7 +93,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, TruncatedHeaderBlockPrefix) {
}
TEST_F(QpackDecodedHeadersAccumulatorTest, EmptyHeaderList) {
- std::string encoded_data(quiche::QuicheTextUtils::HexDecode("0000"));
+ std::string encoded_data(absl::HexStringToBytes("0000"));
accumulator_.Decode(encoded_data);
QuicHeaderList header_list;
@@ -108,7 +109,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, EmptyHeaderList) {
// This payload is the prefix of a valid payload, but EndHeaderBlock() is called
// before it can be completely decoded.
TEST_F(QpackDecodedHeadersAccumulatorTest, TruncatedPayload) {
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("00002366"));
+ accumulator_.Decode(absl::HexStringToBytes("00002366"));
EXPECT_CALL(visitor_, OnHeaderDecodingError(Eq("Incomplete header block.")));
accumulator_.EndHeaderBlock();
@@ -118,12 +119,11 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, TruncatedPayload) {
TEST_F(QpackDecodedHeadersAccumulatorTest, InvalidPayload) {
EXPECT_CALL(visitor_,
OnHeaderDecodingError(Eq("Static table entry not found.")));
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("0000ff23ff24"));
+ accumulator_.Decode(absl::HexStringToBytes("0000ff23ff24"));
}
TEST_F(QpackDecodedHeadersAccumulatorTest, Success) {
- std::string encoded_data(
- quiche::QuicheTextUtils::HexDecode("000023666f6f03626172"));
+ std::string encoded_data(absl::HexStringToBytes("000023666f6f03626172"));
accumulator_.Decode(encoded_data);
QuicHeaderList header_list;
@@ -141,7 +141,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, Success) {
// otherwise decoding could fail with "incomplete header block" error.
TEST_F(QpackDecodedHeadersAccumulatorTest, ExceedLimitThenSplitInstruction) {
// Total length of header list exceeds kMaxHeaderListSize.
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode(
+ accumulator_.Decode(absl::HexStringToBytes(
"0000" // header block prefix
"26666f6f626172" // header key: "foobar"
"7d61616161616161616161616161616161616161" // header value: 'a' 125 times
@@ -149,7 +149,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, ExceedLimitThenSplitInstruction) {
"616161616161616161616161616161616161616161616161616161616161616161616161"
"61616161616161616161616161616161616161616161616161616161616161616161"
"ff")); // first byte of a two-byte long Indexed Header Field instruction
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode(
+ accumulator_.Decode(absl::HexStringToBytes(
"0f" // second byte of a two-byte long Indexed Header Field instruction
));
@@ -160,7 +160,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, ExceedLimitThenSplitInstruction) {
// Test that header list limit enforcement works with blocked encoding.
TEST_F(QpackDecodedHeadersAccumulatorTest, ExceedLimitBlocked) {
// Total length of header list exceeds kMaxHeaderListSize.
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode(
+ accumulator_.Decode(absl::HexStringToBytes(
"0200" // header block prefix
"80" // reference to dynamic table entry not yet received
"26666f6f626172" // header key: "foobar"
@@ -182,7 +182,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, ExceedLimitBlocked) {
TEST_F(QpackDecodedHeadersAccumulatorTest, BlockedDecoding) {
// Reference to dynamic table entry not yet received.
- std::string encoded_data(quiche::QuicheTextUtils::HexDecode("020080"));
+ std::string encoded_data(absl::HexStringToBytes("020080"));
accumulator_.Decode(encoded_data);
accumulator_.EndHeaderBlock();
@@ -206,7 +206,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest, BlockedDecoding) {
TEST_F(QpackDecodedHeadersAccumulatorTest,
BlockedDecodingUnblockedBeforeEndOfHeaderBlock) {
// Reference to dynamic table entry not yet received.
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("020080"));
+ accumulator_.Decode(absl::HexStringToBytes("020080"));
// Set dynamic table capacity.
qpack_decoder_.OnSetDynamicTableCapacity(kMaxDynamicTableCapacity);
@@ -216,7 +216,7 @@ TEST_F(QpackDecodedHeadersAccumulatorTest,
// Rest of header block: same entry again.
EXPECT_CALL(decoder_stream_sender_delegate_,
WriteStreamData(Eq(kHeaderAcknowledgement)));
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("80"));
+ accumulator_.Decode(absl::HexStringToBytes("80"));
QuicHeaderList header_list;
EXPECT_CALL(visitor_, OnHeadersDecoded(_, false))
@@ -231,12 +231,12 @@ TEST_F(QpackDecodedHeadersAccumulatorTest,
BlockedDecodingUnblockedAndErrorBeforeEndOfHeaderBlock) {
// Required Insert Count higher than number of entries causes decoding to be
// blocked.
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("0200"));
+ accumulator_.Decode(absl::HexStringToBytes("0200"));
// Indexed Header Field instruction addressing dynamic table entry with
// relative index 0, absolute index 0.
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("80"));
+ accumulator_.Decode(absl::HexStringToBytes("80"));
// Relative index larger than or equal to Base is invalid.
- accumulator_.Decode(quiche::QuicheTextUtils::HexDecode("81"));
+ accumulator_.Decode(absl::HexStringToBytes("81"));
// Set dynamic table capacity.
qpack_decoder_.OnSetDynamicTableCapacity(kMaxDynamicTableCapacity);
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.cc
index 17790defd5f..86383319c33 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.cc
@@ -6,9 +6,10 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_index_conversions.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -70,19 +71,19 @@ void QpackDecoder::OnDecodingCompleted(QuicStreamId stream_id,
void QpackDecoder::OnInsertWithNameReference(bool is_static,
uint64_t name_index,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
if (is_static) {
auto entry = header_table_.LookupEntry(/* is_static = */ true, name_index);
if (!entry) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Invalid static table entry.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INVALID_STATIC_ENTRY,
+ "Invalid static table entry.");
return;
}
entry = header_table_.InsertEntry(entry->name(), value);
if (!entry) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Error inserting entry with name reference.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_STATIC,
+ "Error inserting entry with name reference.");
}
return;
}
@@ -90,32 +91,31 @@ void QpackDecoder::OnInsertWithNameReference(bool is_static,
uint64_t absolute_index;
if (!QpackEncoderStreamRelativeIndexToAbsoluteIndex(
name_index, header_table_.inserted_entry_count(), &absolute_index)) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Invalid relative index.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INSERTION_INVALID_RELATIVE_INDEX,
+ "Invalid relative index.");
return;
}
const QpackEntry* entry =
header_table_.LookupEntry(/* is_static = */ false, absolute_index);
if (!entry) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Dynamic table entry not found.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INSERTION_DYNAMIC_ENTRY_NOT_FOUND,
+ "Dynamic table entry not found.");
return;
}
entry = header_table_.InsertEntry(entry->name(), value);
if (!entry) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Error inserting entry with name reference.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_DYNAMIC,
+ "Error inserting entry with name reference.");
}
}
-void QpackDecoder::OnInsertWithoutNameReference(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+void QpackDecoder::OnInsertWithoutNameReference(absl::string_view name,
+ absl::string_view value) {
const QpackEntry* entry = header_table_.InsertEntry(name, value);
if (!entry) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Error inserting literal entry.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_LITERAL,
+ "Error inserting literal entry.");
}
}
@@ -123,34 +123,44 @@ void QpackDecoder::OnDuplicate(uint64_t index) {
uint64_t absolute_index;
if (!QpackEncoderStreamRelativeIndexToAbsoluteIndex(
index, header_table_.inserted_entry_count(), &absolute_index)) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Invalid relative index.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_DUPLICATE_INVALID_RELATIVE_INDEX,
+ "Invalid relative index.");
return;
}
const QpackEntry* entry =
header_table_.LookupEntry(/* is_static = */ false, absolute_index);
if (!entry) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Dynamic table entry not found.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_DUPLICATE_DYNAMIC_ENTRY_NOT_FOUND,
+ "Dynamic table entry not found.");
return;
}
entry = header_table_.InsertEntry(entry->name(), entry->value());
if (!entry) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Error inserting duplicate entry.");
+ // InsertEntry() can only fail if entry is larger then dynamic table
+ // capacity, but that is impossible since entry was retrieved from the
+ // dynamic table.
+ OnErrorDetected(QUIC_INTERNAL_ERROR, "Error inserting duplicate entry.");
}
}
void QpackDecoder::OnSetDynamicTableCapacity(uint64_t capacity) {
if (!header_table_.SetDynamicTableCapacity(capacity)) {
- encoder_stream_error_delegate_->OnEncoderStreamError(
- "Error updating dynamic table capacity.");
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_SET_DYNAMIC_TABLE_CAPACITY,
+ "Error updating dynamic table capacity.");
}
}
-void QpackDecoder::OnErrorDetected(quiche::QuicheStringPiece error_message) {
- encoder_stream_error_delegate_->OnEncoderStreamError(error_message);
+void QpackDecoder::OnErrorDetected(QuicErrorCode error_code,
+ absl::string_view error_message) {
+ if (GetQuicReloadableFlag(quic_granular_qpack_error_codes)) {
+ QUIC_CODE_COUNT_N(quic_granular_qpack_error_codes, 2, 2);
+ encoder_stream_error_delegate_->OnEncoderStreamError(error_code,
+ error_message);
+ } else {
+ encoder_stream_error_delegate_->OnEncoderStreamError(
+ QUIC_QPACK_ENCODER_STREAM_ERROR, error_message);
+ }
}
std::unique_ptr<QpackProgressiveDecoder> QpackDecoder::CreateProgressiveDecoder(
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h
index e09b14bef91..6e0c0ab92a1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h
@@ -9,19 +9,24 @@
#include <memory>
#include <set>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
// QPACK decoder class. Exactly one instance should exist per QUIC connection.
// This class vends a new QpackProgressiveDecoder instance for each new header
// list to be encoded.
+// QpackProgressiveDecoder detects and signals errors with header blocks, which
+// are stream errors.
+// The only input of QpackDecoder is the encoder stream. Any error QpackDecoder
+// signals is an encoder stream error, which is fatal to the connection.
class QUIC_EXPORT_PRIVATE QpackDecoder
: public QpackEncoderStreamReceiver::Delegate,
public QpackProgressiveDecoder::BlockedStreamLimitEnforcer,
@@ -34,8 +39,8 @@ class QUIC_EXPORT_PRIVATE QpackDecoder
public:
virtual ~EncoderStreamErrorDelegate() {}
- virtual void OnEncoderStreamError(
- quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnEncoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) = 0;
};
QpackDecoder(uint64_t maximum_dynamic_table_capacity,
@@ -80,12 +85,13 @@ class QUIC_EXPORT_PRIVATE QpackDecoder
// QpackEncoderStreamReceiver::Delegate implementation
void OnInsertWithNameReference(bool is_static,
uint64_t name_index,
- quiche::QuicheStringPiece value) override;
- void OnInsertWithoutNameReference(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) override;
+ absl::string_view value) override;
+ void OnInsertWithoutNameReference(absl::string_view name,
+ absl::string_view value) override;
void OnDuplicate(uint64_t index) override;
void OnSetDynamicTableCapacity(uint64_t capacity) override;
- void OnErrorDetected(quiche::QuicheStringPiece error_message) override;
+ void OnErrorDetected(QuicErrorCode error_code,
+ absl::string_view error_message) override;
// delegate must be set if dynamic table capacity is not zero.
void set_qpack_stream_sender_delegate(QpackStreamSenderDelegate* delegate) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.cc
index 5d6cf837621..e63d853da20 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -18,7 +18,7 @@ QpackDecoderStreamReceiver::QpackDecoderStreamReceiver(Delegate* delegate)
DCHECK(delegate_);
}
-void QpackDecoderStreamReceiver::Decode(quiche::QuicheStringPiece data) {
+void QpackDecoderStreamReceiver::Decode(absl::string_view data) {
if (data.empty() || error_detected_) {
return;
}
@@ -43,12 +43,20 @@ bool QpackDecoderStreamReceiver::OnInstructionDecoded(
return true;
}
-void QpackDecoderStreamReceiver::OnError(
- quiche::QuicheStringPiece error_message) {
+void QpackDecoderStreamReceiver::OnInstructionDecodingError(
+ QpackInstructionDecoder::ErrorCode error_code,
+ absl::string_view error_message) {
DCHECK(!error_detected_);
error_detected_ = true;
- delegate_->OnErrorDetected(error_message);
+
+ // There is no string literals on the decoder stream,
+ // the only possible error is INTEGER_TOO_LARGE.
+ QuicErrorCode quic_error_code =
+ (error_code == QpackInstructionDecoder::ErrorCode::INTEGER_TOO_LARGE)
+ ? QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE
+ : QUIC_INTERNAL_ERROR;
+ delegate_->OnErrorDetected(quic_error_code, error_message);
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h
index 19f51f0d3b4..b3b3d692cbe 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h
@@ -7,11 +7,12 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_stream_receiver.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -34,7 +35,8 @@ class QUIC_EXPORT_PRIVATE QpackDecoderStreamReceiver
// 5.3.3 Stream Cancellation
virtual void OnStreamCancellation(QuicStreamId stream_id) = 0;
// Decoding error
- virtual void OnErrorDetected(quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnErrorDetected(QuicErrorCode error_code,
+ absl::string_view error_message) = 0;
};
explicit QpackDecoderStreamReceiver(Delegate* delegate);
@@ -47,11 +49,12 @@ class QUIC_EXPORT_PRIVATE QpackDecoderStreamReceiver
// Decode data and call appropriate Delegate method after each decoded
// instruction. Once an error occurs, Delegate::OnErrorDetected() is called,
// and all further data is ignored.
- void Decode(quiche::QuicheStringPiece data) override;
+ void Decode(absl::string_view data) override;
// QpackInstructionDecoder::Delegate implementation.
bool OnInstructionDecoded(const QpackInstruction* instruction) override;
- void OnError(quiche::QuicheStringPiece error_message) override;
+ void OnInstructionDecodingError(QpackInstructionDecoder::ErrorCode error_code,
+ absl::string_view error_message) override;
private:
QpackInstructionDecoder instruction_decoder_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver_test.cc
index 70d2450662a..fd7959512c8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver_test.cc
@@ -4,8 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using testing::Eq;
@@ -27,7 +28,7 @@ class MockDelegate : public QpackDecoderStreamReceiver::Delegate {
MOCK_METHOD(void, OnStreamCancellation, (QuicStreamId stream_id), (override));
MOCK_METHOD(void,
OnErrorDetected,
- (quiche::QuicheStringPiece error_message),
+ (QuicErrorCode error_code, absl::string_view error_message),
(override));
};
@@ -42,53 +43,59 @@ class QpackDecoderStreamReceiverTest : public QuicTest {
TEST_F(QpackDecoderStreamReceiverTest, InsertCountIncrement) {
EXPECT_CALL(delegate_, OnInsertCountIncrement(0));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("00"));
+ stream_.Decode(absl::HexStringToBytes("00"));
EXPECT_CALL(delegate_, OnInsertCountIncrement(10));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("0a"));
+ stream_.Decode(absl::HexStringToBytes("0a"));
EXPECT_CALL(delegate_, OnInsertCountIncrement(63));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("3f00"));
+ stream_.Decode(absl::HexStringToBytes("3f00"));
EXPECT_CALL(delegate_, OnInsertCountIncrement(200));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("3f8901"));
+ stream_.Decode(absl::HexStringToBytes("3f8901"));
- EXPECT_CALL(delegate_, OnErrorDetected(Eq("Encoded integer too large.")));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("3fffffffffffffffffffff"));
+ EXPECT_CALL(delegate_,
+ OnErrorDetected(QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
+ stream_.Decode(absl::HexStringToBytes("3fffffffffffffffffffff"));
}
TEST_F(QpackDecoderStreamReceiverTest, HeaderAcknowledgement) {
EXPECT_CALL(delegate_, OnHeaderAcknowledgement(0));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("80"));
+ stream_.Decode(absl::HexStringToBytes("80"));
EXPECT_CALL(delegate_, OnHeaderAcknowledgement(37));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("a5"));
+ stream_.Decode(absl::HexStringToBytes("a5"));
EXPECT_CALL(delegate_, OnHeaderAcknowledgement(127));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("ff00"));
+ stream_.Decode(absl::HexStringToBytes("ff00"));
EXPECT_CALL(delegate_, OnHeaderAcknowledgement(503));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("fff802"));
+ stream_.Decode(absl::HexStringToBytes("fff802"));
- EXPECT_CALL(delegate_, OnErrorDetected(Eq("Encoded integer too large.")));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("ffffffffffffffffffffff"));
+ EXPECT_CALL(delegate_,
+ OnErrorDetected(QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
+ stream_.Decode(absl::HexStringToBytes("ffffffffffffffffffffff"));
}
TEST_F(QpackDecoderStreamReceiverTest, StreamCancellation) {
EXPECT_CALL(delegate_, OnStreamCancellation(0));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("40"));
+ stream_.Decode(absl::HexStringToBytes("40"));
EXPECT_CALL(delegate_, OnStreamCancellation(19));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("53"));
+ stream_.Decode(absl::HexStringToBytes("53"));
EXPECT_CALL(delegate_, OnStreamCancellation(63));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("7f00"));
+ stream_.Decode(absl::HexStringToBytes("7f00"));
EXPECT_CALL(delegate_, OnStreamCancellation(110));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("7f2f"));
+ stream_.Decode(absl::HexStringToBytes("7f2f"));
- EXPECT_CALL(delegate_, OnErrorDetected(Eq("Encoded integer too large.")));
- stream_.Decode(quiche::QuicheTextUtils::HexDecode("7fffffffffffffffffffff"));
+ EXPECT_CALL(delegate_,
+ OnErrorDetected(QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
+ stream_.Decode(absl::HexStringToBytes("7fffffffffffffffffffff"));
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.cc
index 34f4de8d2af..bfb19e10f59 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.cc
@@ -8,9 +8,9 @@
#include <limits>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender_test.cc
index 1d18fa92e59..c412c9f78e3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender_test.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_sender.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
@@ -27,67 +28,55 @@ class QpackDecoderStreamSenderTest : public QuicTest {
};
TEST_F(QpackDecoderStreamSenderTest, InsertCountIncrement) {
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("00"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("00"))));
stream_.SendInsertCountIncrement(0);
stream_.Flush();
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("0a"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("0a"))));
stream_.SendInsertCountIncrement(10);
stream_.Flush();
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("3f00"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("3f00"))));
stream_.SendInsertCountIncrement(63);
stream_.Flush();
- EXPECT_CALL(delegate_, WriteStreamData(
- Eq(quiche::QuicheTextUtils::HexDecode("3f8901"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("3f8901"))));
stream_.SendInsertCountIncrement(200);
stream_.Flush();
}
TEST_F(QpackDecoderStreamSenderTest, HeaderAcknowledgement) {
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("80"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("80"))));
stream_.SendHeaderAcknowledgement(0);
stream_.Flush();
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("a5"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("a5"))));
stream_.SendHeaderAcknowledgement(37);
stream_.Flush();
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("ff00"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("ff00"))));
stream_.SendHeaderAcknowledgement(127);
stream_.Flush();
- EXPECT_CALL(delegate_, WriteStreamData(
- Eq(quiche::QuicheTextUtils::HexDecode("fff802"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("fff802"))));
stream_.SendHeaderAcknowledgement(503);
stream_.Flush();
}
TEST_F(QpackDecoderStreamSenderTest, StreamCancellation) {
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("40"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("40"))));
stream_.SendStreamCancellation(0);
stream_.Flush();
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("53"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("53"))));
stream_.SendStreamCancellation(19);
stream_.Flush();
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("7f00"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("7f00"))));
stream_.SendStreamCancellation(63);
stream_.Flush();
- EXPECT_CALL(delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("7f2f"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("7f2f"))));
stream_.SendStreamCancellation(110);
stream_.Flush();
}
@@ -97,16 +86,14 @@ TEST_F(QpackDecoderStreamSenderTest, Coalesce) {
stream_.SendHeaderAcknowledgement(37);
stream_.SendStreamCancellation(0);
- EXPECT_CALL(delegate_, WriteStreamData(
- Eq(quiche::QuicheTextUtils::HexDecode("0aa540"))));
+ EXPECT_CALL(delegate_, WriteStreamData(Eq(absl::HexStringToBytes("0aa540"))));
stream_.Flush();
stream_.SendInsertCountIncrement(63);
stream_.SendStreamCancellation(110);
- EXPECT_CALL(
- delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("3f007f2f"))));
+ EXPECT_CALL(delegate_,
+ WriteStreamData(Eq(absl::HexStringToBytes("3f007f2f"))));
stream_.Flush();
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_test.cc
index 8b546b0ed9f..cf7c9d39a5c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_decoder_test.cc
@@ -6,11 +6,13 @@
#include <algorithm>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
@@ -49,13 +51,12 @@ class QpackDecoderTest : public QuicTestWithParam<FragmentMode> {
// Destroy QpackProgressiveDecoder on error to test that it does not crash.
// See https://crbug.com/1025209.
ON_CALL(handler_, OnDecodingErrorDetected(_))
- .WillByDefault(
- Invoke([this](quiche::QuicheStringPiece /* error_message */) {
- progressive_decoder_.reset();
- }));
+ .WillByDefault(Invoke([this](absl::string_view /* error_message */) {
+ progressive_decoder_.reset();
+ }));
}
- void DecodeEncoderStreamData(quiche::QuicheStringPiece data) {
+ void DecodeEncoderStreamData(absl::string_view data) {
qpack_decoder_.encoder_stream_receiver()->Decode(data);
}
@@ -71,7 +72,7 @@ class QpackDecoderTest : public QuicTestWithParam<FragmentMode> {
// Pass header block data to QpackProgressiveDecoder::Decode()
// in fragments dictated by |fragment_mode_|.
- void DecodeData(quiche::QuicheStringPiece data) {
+ void DecodeData(absl::string_view data) {
auto fragment_size_generator =
FragmentModeToFragmentSizeGenerator(fragment_mode_);
while (progressive_decoder_ && !data.empty()) {
@@ -91,7 +92,7 @@ class QpackDecoderTest : public QuicTestWithParam<FragmentMode> {
}
// Decode an entire header block.
- void DecodeHeaderBlock(quiche::QuicheStringPiece data) {
+ void DecodeHeaderBlock(absl::string_view data) {
StartDecoding();
DecodeData(data);
EndDecoding();
@@ -117,7 +118,7 @@ TEST_P(QpackDecoderTest, NoPrefix) {
OnDecodingErrorDetected(Eq("Incomplete header data prefix.")));
// Header Data Prefix is at least two bytes long.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("00"));
+ DecodeHeaderBlock(absl::HexStringToBytes("00"));
}
// Regression test for https://1025209: QpackProgressiveDecoder must not crash
@@ -129,52 +130,50 @@ TEST_P(QpackDecoderTest, InvalidPrefix) {
OnDecodingErrorDetected(Eq("Encoded integer too large.")));
// Encoded Required Insert Count in Header Data Prefix is too large.
- DecodeData(
- quiche::QuicheTextUtils::HexDecode("ffffffffffffffffffffffffffff"));
+ DecodeData(absl::HexStringToBytes("ffffffffffffffffffffffffffff"));
}
TEST_P(QpackDecoderTest, EmptyHeaderBlock) {
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("0000"));
+ DecodeHeaderBlock(absl::HexStringToBytes("0000"));
}
TEST_P(QpackDecoderTest, LiteralEntryEmptyName) {
EXPECT_CALL(handler_, OnHeaderDecoded(Eq(""), Eq("foo")));
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("00002003666f6f"));
+ DecodeHeaderBlock(absl::HexStringToBytes("00002003666f6f"));
}
TEST_P(QpackDecoderTest, LiteralEntryEmptyValue) {
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("")));
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("000023666f6f00"));
+ DecodeHeaderBlock(absl::HexStringToBytes("000023666f6f00"));
}
TEST_P(QpackDecoderTest, LiteralEntryEmptyNameAndValue) {
EXPECT_CALL(handler_, OnHeaderDecoded(Eq(""), Eq("")));
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("00002000"));
+ DecodeHeaderBlock(absl::HexStringToBytes("00002000"));
}
TEST_P(QpackDecoderTest, SimpleLiteralEntry) {
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("bar")));
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("000023666f6f03626172"));
+ DecodeHeaderBlock(absl::HexStringToBytes("000023666f6f03626172"));
}
TEST_P(QpackDecoderTest, MultipleLiteralEntries) {
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("bar")));
std::string str(127, 'a');
- EXPECT_CALL(handler_,
- OnHeaderDecoded(Eq("foobaar"), quiche::QuicheStringPiece(str)));
+ EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foobaar"), absl::string_view(str)));
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0000" // prefix
"23666f6f03626172" // foo: bar
"2700666f6f62616172" // 7 octet long header name, the smallest number
@@ -192,8 +191,7 @@ TEST_P(QpackDecoderTest, NameLenTooLargeForVarintDecoder) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Encoded integer too large.")));
- DecodeHeaderBlock(
- quiche::QuicheTextUtils::HexDecode("000027ffffffffffffffffffff"));
+ DecodeHeaderBlock(absl::HexStringToBytes("000027ffffffffffffffffffff"));
}
// Name Length value can be decoded by varint decoder but exceeds 1 MB limit.
@@ -201,7 +199,7 @@ TEST_P(QpackDecoderTest, NameLenExceedsLimit) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("String literal too long.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("000027ffff7f"));
+ DecodeHeaderBlock(absl::HexStringToBytes("000027ffff7f"));
}
// Value Length value is too large for varint decoder to decode.
@@ -210,7 +208,7 @@ TEST_P(QpackDecoderTest, ValueLenTooLargeForVarintDecoder) {
OnDecodingErrorDetected(Eq("Encoded integer too large.")));
DecodeHeaderBlock(
- quiche::QuicheTextUtils::HexDecode("000023666f6f7fffffffffffffffffffff"));
+ absl::HexStringToBytes("000023666f6f7fffffffffffffffffffff"));
}
// Value Length value can be decoded by varint decoder but exceeds 1 MB limit.
@@ -218,22 +216,22 @@ TEST_P(QpackDecoderTest, ValueLenExceedsLimit) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("String literal too long.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("000023666f6f7fffff7f"));
+ DecodeHeaderBlock(absl::HexStringToBytes("000023666f6f7fffff7f"));
}
TEST_P(QpackDecoderTest, IncompleteHeaderBlock) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Incomplete header block.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("00002366"));
+ DecodeHeaderBlock(absl::HexStringToBytes("00002366"));
}
TEST_P(QpackDecoderTest, HuffmanSimple) {
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("custom-key"), Eq("custom-value")));
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
- "00002f0125a849e95ba97d7f8925a849e95bb8e8b4bf"));
+ DecodeHeaderBlock(
+ absl::HexStringToBytes("00002f0125a849e95ba97d7f8925a849e95bb8e8b4bf"));
}
TEST_P(QpackDecoderTest, AlternatingHuffmanNonHuffman) {
@@ -241,7 +239,7 @@ TEST_P(QpackDecoderTest, AlternatingHuffmanNonHuffman) {
.Times(4);
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0000" // Prefix.
"2f0125a849e95ba97d7f" // Huffman-encoded name.
"8925a849e95bb8e8b4bf" // Huffman-encoded value.
@@ -254,45 +252,45 @@ TEST_P(QpackDecoderTest, AlternatingHuffmanNonHuffman) {
}
TEST_P(QpackDecoderTest, HuffmanNameDoesNotHaveEOSPrefix) {
- EXPECT_CALL(handler_, OnDecodingErrorDetected(quiche::QuicheStringPiece(
+ EXPECT_CALL(handler_, OnDecodingErrorDetected(absl::string_view(
"Error in Huffman-encoded string.")));
// 'y' ends in 0b0 on the most significant bit of the last byte.
// The remaining 7 bits must be a prefix of EOS, which is all 1s.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
- "00002f0125a849e95ba97d7e8925a849e95bb8e8b4bf"));
+ DecodeHeaderBlock(
+ absl::HexStringToBytes("00002f0125a849e95ba97d7e8925a849e95bb8e8b4bf"));
}
TEST_P(QpackDecoderTest, HuffmanValueDoesNotHaveEOSPrefix) {
- EXPECT_CALL(handler_, OnDecodingErrorDetected(quiche::QuicheStringPiece(
+ EXPECT_CALL(handler_, OnDecodingErrorDetected(absl::string_view(
"Error in Huffman-encoded string.")));
// 'e' ends in 0b101, taking up the 3 most significant bits of the last byte.
// The remaining 5 bits must be a prefix of EOS, which is all 1s.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
- "00002f0125a849e95ba97d7f8925a849e95bb8e8b4be"));
+ DecodeHeaderBlock(
+ absl::HexStringToBytes("00002f0125a849e95ba97d7f8925a849e95bb8e8b4be"));
}
TEST_P(QpackDecoderTest, HuffmanNameEOSPrefixTooLong) {
- EXPECT_CALL(handler_, OnDecodingErrorDetected(quiche::QuicheStringPiece(
+ EXPECT_CALL(handler_, OnDecodingErrorDetected(absl::string_view(
"Error in Huffman-encoded string.")));
// The trailing EOS prefix must be at most 7 bits long. Appending one octet
// with value 0xff is invalid, even though 0b111111111111111 (15 bits) is a
// prefix of EOS.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
- "00002f0225a849e95ba97d7fff8925a849e95bb8e8b4bf"));
+ DecodeHeaderBlock(
+ absl::HexStringToBytes("00002f0225a849e95ba97d7fff8925a849e95bb8e8b4bf"));
}
TEST_P(QpackDecoderTest, HuffmanValueEOSPrefixTooLong) {
- EXPECT_CALL(handler_, OnDecodingErrorDetected(quiche::QuicheStringPiece(
+ EXPECT_CALL(handler_, OnDecodingErrorDetected(absl::string_view(
"Error in Huffman-encoded string.")));
// The trailing EOS prefix must be at most 7 bits long. Appending one octet
// with value 0xff is invalid, even though 0b1111111111111 (13 bits) is a
// prefix of EOS.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
- "00002f0125a849e95ba97d7f8a25a849e95bb8e8b4bfff"));
+ DecodeHeaderBlock(
+ absl::HexStringToBytes("00002f0125a849e95ba97d7f8a25a849e95bb8e8b4bfff"));
}
TEST_P(QpackDecoderTest, StaticTable) {
@@ -313,7 +311,7 @@ TEST_P(QpackDecoderTest, StaticTable) {
EXPECT_CALL(handler_, OnDecodingCompleted());
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0000d1dfccd45f108621e9aec2a11f5c8294e75f000554524143455f1000"));
}
@@ -326,11 +324,11 @@ TEST_P(QpackDecoderTest, TooHighStaticTableIndex) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Static table entry not found.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("0000ff23ff24"));
+ DecodeHeaderBlock(absl::HexStringToBytes("0000ff23ff24"));
}
TEST_P(QpackDecoderTest, DynamicTable) {
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode(
+ DecodeEncoderStreamData(absl::HexStringToBytes(
"3fe107" // Set dynamic table capacity to 1024.
"6294e703626172" // Add literal entry with name "foo" and value "bar".
"80035a5a5a" // Add entry with name of dynamic table entry index 0
@@ -359,7 +357,7 @@ TEST_P(QpackDecoderTest, DynamicTable) {
.InSequence(s);
EXPECT_CALL(handler_, OnDecodingCompleted()).InSequence(s);
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0500" // Required Insert Count 4 and Delta Base 0.
// Base is 4 + 0 = 4.
"83" // Dynamic table entry with relative index 3, absolute index 0.
@@ -380,7 +378,7 @@ TEST_P(QpackDecoderTest, DynamicTable) {
.InSequence(s);
EXPECT_CALL(handler_, OnDecodingCompleted()).InSequence(s);
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0502" // Required Insert Count 4 and Delta Base 2.
// Base is 4 + 2 = 6.
"85" // Dynamic table entry with relative index 5, absolute index 0.
@@ -401,7 +399,7 @@ TEST_P(QpackDecoderTest, DynamicTable) {
.InSequence(s);
EXPECT_CALL(handler_, OnDecodingCompleted()).InSequence(s);
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0582" // Required Insert Count 4 and Delta Base 2 with sign bit set.
// Base is 4 - 2 - 1 = 1.
"80" // Dynamic table entry with relative index 0, absolute index 0.
@@ -414,28 +412,28 @@ TEST_P(QpackDecoderTest, DynamicTable) {
TEST_P(QpackDecoderTest, DecreasingDynamicTableCapacityEvictsEntries) {
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("bar")));
EXPECT_CALL(handler_, OnDecodingCompleted());
EXPECT_CALL(decoder_stream_sender_delegate_,
WriteStreamData(Eq(kHeaderAcknowledgement)));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"80")); // Dynamic table entry with relative index 0, absolute index 0.
// Change dynamic table capacity to 32 bytes, smaller than the entry.
// This must cause the entry to be evicted.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3f01"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3f01"));
EXPECT_CALL(handler_, OnDecodingErrorDetected(
Eq("Dynamic table entry already evicted.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"80")); // Dynamic table entry with relative index 0, absolute index 0.
@@ -443,27 +441,40 @@ TEST_P(QpackDecoderTest, DecreasingDynamicTableCapacityEvictsEntries) {
TEST_P(QpackDecoderTest, EncoderStreamErrorEntryTooLarge) {
EXPECT_CALL(encoder_stream_error_delegate_,
- OnEncoderStreamError(Eq("Error inserting literal entry.")));
+ OnEncoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_LITERAL
+ : QUIC_QPACK_ENCODER_STREAM_ERROR,
+ Eq("Error inserting literal entry.")));
// Set dynamic table capacity to 34.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3f03"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3f03"));
// Add literal entry with name "foo" and value "bar", size is 32 + 3 + 3 = 38.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
}
TEST_P(QpackDecoderTest, EncoderStreamErrorInvalidStaticTableEntry) {
EXPECT_CALL(encoder_stream_error_delegate_,
- OnEncoderStreamError(Eq("Invalid static table entry.")));
+ OnEncoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_ENCODER_STREAM_INVALID_STATIC_ENTRY
+ : QUIC_QPACK_ENCODER_STREAM_ERROR,
+ Eq("Invalid static table entry.")));
// Address invalid static table entry index 99.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("ff2400"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("ff2400"));
}
TEST_P(QpackDecoderTest, EncoderStreamErrorInvalidDynamicTableEntry) {
- EXPECT_CALL(encoder_stream_error_delegate_,
- OnEncoderStreamError(Eq("Invalid relative index.")));
+ EXPECT_CALL(
+ encoder_stream_error_delegate_,
+ OnEncoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_ENCODER_STREAM_INSERTION_INVALID_RELATIVE_INDEX
+ : QUIC_QPACK_ENCODER_STREAM_ERROR,
+ Eq("Invalid relative index.")));
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode(
+ DecodeEncoderStreamData(absl::HexStringToBytes(
"3fe107" // Set dynamic table capacity to 1024.
"6294e703626172" // Add literal entry with name "foo" and value "bar".
"8100")); // Address dynamic table entry with relative index 1. Such
@@ -472,10 +483,15 @@ TEST_P(QpackDecoderTest, EncoderStreamErrorInvalidDynamicTableEntry) {
}
TEST_P(QpackDecoderTest, EncoderStreamErrorDuplicateInvalidEntry) {
- EXPECT_CALL(encoder_stream_error_delegate_,
- OnEncoderStreamError(Eq("Invalid relative index.")));
+ EXPECT_CALL(
+ encoder_stream_error_delegate_,
+ OnEncoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_ENCODER_STREAM_DUPLICATE_INVALID_RELATIVE_INDEX
+ : QUIC_QPACK_ENCODER_STREAM_ERROR,
+ Eq("Invalid relative index.")));
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode(
+ DecodeEncoderStreamData(absl::HexStringToBytes(
"3fe107" // Set dynamic table capacity to 1024.
"6294e703626172" // Add literal entry with name "foo" and value "bar".
"01")); // Duplicate dynamic table entry with relative index 1. Such
@@ -485,21 +501,24 @@ TEST_P(QpackDecoderTest, EncoderStreamErrorDuplicateInvalidEntry) {
TEST_P(QpackDecoderTest, EncoderStreamErrorTooLargeInteger) {
EXPECT_CALL(encoder_stream_error_delegate_,
- OnEncoderStreamError(Eq("Encoded integer too large.")));
+ OnEncoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE
+ : QUIC_QPACK_ENCODER_STREAM_ERROR,
+ Eq("Encoded integer too large.")));
- DecodeEncoderStreamData(
- quiche::QuicheTextUtils::HexDecode("3fffffffffffffffffffff"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fffffffffffffffffffff"));
}
TEST_P(QpackDecoderTest, InvalidDynamicEntryWhenBaseIsZero) {
EXPECT_CALL(handler_, OnDecodingErrorDetected(Eq("Invalid relative index.")));
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0280" // Required Insert Count is 1. Base 1 - 1 - 0 = 0 is explicitly
// permitted by the spec.
"80")); // However, addressing entry with relative index 0 would point to
@@ -511,18 +530,18 @@ TEST_P(QpackDecoderTest, InvalidNegativeBase) {
// Required Insert Count 1, Delta Base 1 with sign bit set, Base would
// be 1 - 1 - 1 = -1, but it is not allowed to be negative.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("0281"));
+ DecodeHeaderBlock(absl::HexStringToBytes("0281"));
}
TEST_P(QpackDecoderTest, InvalidDynamicEntryByRelativeIndex) {
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
EXPECT_CALL(handler_, OnDecodingErrorDetected(Eq("Invalid relative index.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"81")); // Indexed Header Field instruction addressing relative index 1.
@@ -530,7 +549,7 @@ TEST_P(QpackDecoderTest, InvalidDynamicEntryByRelativeIndex) {
EXPECT_CALL(handler_, OnDecodingErrorDetected(Eq("Invalid relative index.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"4100")); // Literal Header Field with Name Reference instruction
@@ -540,18 +559,18 @@ TEST_P(QpackDecoderTest, InvalidDynamicEntryByRelativeIndex) {
TEST_P(QpackDecoderTest, EvictedDynamicTableEntry) {
// Update dynamic table capacity to 128.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3f61"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3f61"));
// Add literal entry with name "foo" and value "bar", size 32 + 3 + 3 = 38.
// This fits in the table three times.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
// Duplicate entry four times. This evicts the first two instances.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("00000000"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("00000000"));
EXPECT_CALL(handler_, OnDecodingErrorDetected(
Eq("Dynamic table entry already evicted.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0500" // Required Insert Count 4 and Delta Base 0.
// Base is 4 + 0 = 4.
"82")); // Indexed Header Field instruction addressing relative index 2.
@@ -560,7 +579,7 @@ TEST_P(QpackDecoderTest, EvictedDynamicTableEntry) {
EXPECT_CALL(handler_, OnDecodingErrorDetected(
Eq("Dynamic table entry already evicted.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0500" // Required Insert Count 4 and Delta Base 0.
// Base is 4 + 0 = 4.
"4200")); // Literal Header Field with Name Reference instruction
@@ -570,7 +589,7 @@ TEST_P(QpackDecoderTest, EvictedDynamicTableEntry) {
EXPECT_CALL(handler_, OnDecodingErrorDetected(
Eq("Dynamic table entry already evicted.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0380" // Required Insert Count 2 and Delta Base 0 with sign bit set.
// Base is 2 - 0 - 1 = 1
"10")); // Indexed Header Field instruction addressing dynamic table
@@ -580,7 +599,7 @@ TEST_P(QpackDecoderTest, EvictedDynamicTableEntry) {
EXPECT_CALL(handler_, OnDecodingErrorDetected(
Eq("Dynamic table entry already evicted.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0380" // Required Insert Count 2 and Delta Base 0 with sign bit set.
// Base is 2 - 0 - 1 = 1
"0000")); // Literal Header Field With Name Reference instruction
@@ -589,17 +608,20 @@ TEST_P(QpackDecoderTest, EvictedDynamicTableEntry) {
}
TEST_P(QpackDecoderTest, TableCapacityMustNotExceedMaximum) {
- EXPECT_CALL(
- encoder_stream_error_delegate_,
- OnEncoderStreamError(Eq("Error updating dynamic table capacity.")));
+ EXPECT_CALL(encoder_stream_error_delegate_,
+ OnEncoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_ENCODER_STREAM_SET_DYNAMIC_TABLE_CAPACITY
+ : QUIC_QPACK_ENCODER_STREAM_ERROR,
+ Eq("Error updating dynamic table capacity.")));
// Try to update dynamic table capacity to 2048, which exceeds the maximum.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe10f"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe10f"));
}
TEST_P(QpackDecoderTest, SetDynamicTableCapacity) {
// Update dynamic table capacity to 128, which does not exceed the maximum.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3f61"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3f61"));
}
TEST_P(QpackDecoderTest, InvalidEncodedRequiredInsertCount) {
@@ -609,7 +631,7 @@ TEST_P(QpackDecoderTest, InvalidEncodedRequiredInsertCount) {
// A value of 1 cannot be encoded as 65 even though it has the same remainder.
EXPECT_CALL(handler_, OnDecodingErrorDetected(
Eq("Error decoding Required Insert Count.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("4100"));
+ DecodeHeaderBlock(absl::HexStringToBytes("4100"));
}
// Regression test for https://crbug.com/970218: Decoder must stop processing
@@ -618,7 +640,7 @@ TEST_P(QpackDecoderTest, DataAfterInvalidEncodedRequiredInsertCount) {
EXPECT_CALL(handler_, OnDecodingErrorDetected(
Eq("Error decoding Required Insert Count.")));
// Header Block Prefix followed by some extra data.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode("410000"));
+ DecodeHeaderBlock(absl::HexStringToBytes("410000"));
}
TEST_P(QpackDecoderTest, WrappedRequiredInsertCount) {
@@ -626,12 +648,12 @@ TEST_P(QpackDecoderTest, WrappedRequiredInsertCount) {
// MaxEntries is 1024 / 32 = 32.
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and a 600 byte long value. This will fit
// in the dynamic table once but not twice.
DecodeEncoderStreamData(
- quiche::QuicheTextUtils::HexDecode("6294e7" // Name "foo".
- "7fd903")); // Value length 600.
+ absl::HexStringToBytes("6294e7" // Name "foo".
+ "7fd903")); // Value length 600.
std::string header_value(600, 'Z');
DecodeEncoderStreamData(header_value);
@@ -646,7 +668,7 @@ TEST_P(QpackDecoderTest, WrappedRequiredInsertCount) {
WriteStreamData(Eq(kHeaderAcknowledgement)));
// Send header block with Required Insert Count = 201.
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0a00" // Encoded Required Insert Count 10, Required Insert Count 201,
// Delta Base 0, Base 201.
"80")); // Emit dynamic table entry with relative index 0.
@@ -654,31 +676,31 @@ TEST_P(QpackDecoderTest, WrappedRequiredInsertCount) {
TEST_P(QpackDecoderTest, NonZeroRequiredInsertCountButNoDynamicEntries) {
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
EXPECT_CALL(handler_, OnHeaderDecoded(Eq(":method"), Eq("GET")));
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Required Insert Count too large.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count is 1.
"d1")); // But the only instruction references the static table.
}
TEST_P(QpackDecoderTest, AddressEntryNotAllowedByRequiredInsertCount) {
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
EXPECT_CALL(
handler_,
OnDecodingErrorDetected(
Eq("Absolute Index must be smaller than Required Insert Count.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0201" // Required Insert Count 1 and Delta Base 1.
// Base is 1 + 1 = 2.
"80")); // Indexed Header Field instruction addressing dynamic table
@@ -690,7 +712,7 @@ TEST_P(QpackDecoderTest, AddressEntryNotAllowedByRequiredInsertCount) {
OnDecodingErrorDetected(
Eq("Absolute Index must be smaller than Required Insert Count.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0201" // Required Insert Count 1 and Delta Base 1.
// Base is 1 + 1 = 2.
"4000")); // Literal Header Field with Name Reference instruction
@@ -703,7 +725,7 @@ TEST_P(QpackDecoderTest, AddressEntryNotAllowedByRequiredInsertCount) {
OnDecodingErrorDetected(
Eq("Absolute Index must be smaller than Required Insert Count.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"10")); // Indexed Header Field with Post-Base Index instruction
@@ -716,7 +738,7 @@ TEST_P(QpackDecoderTest, AddressEntryNotAllowedByRequiredInsertCount) {
OnDecodingErrorDetected(
Eq("Absolute Index must be smaller than Required Insert Count.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"0000")); // Literal Header Field with Post-Base Name Reference
@@ -727,19 +749,19 @@ TEST_P(QpackDecoderTest, AddressEntryNotAllowedByRequiredInsertCount) {
TEST_P(QpackDecoderTest, PromisedRequiredInsertCountLargerThanActual) {
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
// Duplicate entry twice so that decoding of header blocks with Required
// Insert Count not exceeding 3 is not blocked.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("00"));
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("00"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("00"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("00"));
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("bar")));
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Required Insert Count too large.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0300" // Required Insert Count 2 and Delta Base 0.
// Base is 2 + 0 = 2.
"81")); // Indexed Header Field instruction addressing dynamic table
@@ -751,7 +773,7 @@ TEST_P(QpackDecoderTest, PromisedRequiredInsertCountLargerThanActual) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Required Insert Count too large.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0300" // Required Insert Count 2 and Delta Base 0.
// Base is 2 + 0 = 2.
"4100")); // Literal Header Field with Name Reference instruction
@@ -763,7 +785,7 @@ TEST_P(QpackDecoderTest, PromisedRequiredInsertCountLargerThanActual) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Required Insert Count too large.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0481" // Required Insert Count 3 and Delta Base 1 with sign bit set.
// Base is 3 - 1 - 1 = 1.
"10")); // Indexed Header Field with Post-Base Index instruction
@@ -775,7 +797,7 @@ TEST_P(QpackDecoderTest, PromisedRequiredInsertCountLargerThanActual) {
EXPECT_CALL(handler_,
OnDecodingErrorDetected(Eq("Required Insert Count too large.")));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0481" // Required Insert Count 3 and Delta Base 1 with sign bit set.
// Base is 3 - 1 - 1 = 1.
"0000")); // Literal Header Field with Post-Base Name Reference
@@ -785,7 +807,7 @@ TEST_P(QpackDecoderTest, PromisedRequiredInsertCountLargerThanActual) {
}
TEST_P(QpackDecoderTest, BlockedDecoding) {
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"80")); // Indexed Header Field instruction addressing dynamic table
@@ -797,14 +819,14 @@ TEST_P(QpackDecoderTest, BlockedDecoding) {
WriteStreamData(Eq(kHeaderAcknowledgement)));
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
}
TEST_P(QpackDecoderTest, BlockedDecodingUnblockedBeforeEndOfHeaderBlock) {
StartDecoding();
- DecodeData(quiche::QuicheTextUtils::HexDecode(
+ DecodeData(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"80" // Indexed Header Field instruction addressing dynamic table
@@ -812,7 +834,7 @@ TEST_P(QpackDecoderTest, BlockedDecodingUnblockedBeforeEndOfHeaderBlock) {
"d1")); // Static table entry with index 17.
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar". Decoding is now
// unblocked because dynamic table Insert Count reached the Required Insert
@@ -820,14 +842,14 @@ TEST_P(QpackDecoderTest, BlockedDecodingUnblockedBeforeEndOfHeaderBlock) {
// the already consumed part of the header block.
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("bar")));
EXPECT_CALL(handler_, OnHeaderDecoded(Eq(":method"), Eq("GET")));
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
Mock::VerifyAndClearExpectations(&handler_);
// Rest of header block is processed by QpackProgressiveDecoder
// in the unblocked state.
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("bar")));
EXPECT_CALL(handler_, OnHeaderDecoded(Eq(":scheme"), Eq("https")));
- DecodeData(quiche::QuicheTextUtils::HexDecode(
+ DecodeData(absl::HexStringToBytes(
"80" // Indexed Header Field instruction addressing dynamic table
// entry with relative index 0, absolute index 0.
"d7")); // Static table entry with index 23.
@@ -843,7 +865,7 @@ TEST_P(QpackDecoderTest, BlockedDecodingUnblockedBeforeEndOfHeaderBlock) {
TEST_P(QpackDecoderTest,
BlockedDecodingUnblockedAndErrorBeforeEndOfHeaderBlock) {
StartDecoding();
- DecodeData(quiche::QuicheTextUtils::HexDecode(
+ DecodeData(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"80" // Indexed Header Field instruction addressing dynamic table
@@ -851,7 +873,7 @@ TEST_P(QpackDecoderTest,
"81")); // Relative index 1 is equal to Base, therefore invalid.
// Set dynamic table capacity to 1024.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3fe107"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3fe107"));
// Add literal entry with name "foo" and value "bar". Decoding is now
// unblocked because dynamic table Insert Count reached the Required Insert
@@ -859,7 +881,7 @@ TEST_P(QpackDecoderTest,
// the already consumed part of the header block.
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("bar")));
EXPECT_CALL(handler_, OnDecodingErrorDetected(Eq("Invalid relative index.")));
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
}
// Make sure that Required Insert Count is compared to Insert Count,
@@ -867,19 +889,19 @@ TEST_P(QpackDecoderTest,
TEST_P(QpackDecoderTest, BlockedDecodingAndEvictedEntries) {
// Update dynamic table capacity to 128.
// At most three non-empty entries fit in the dynamic table.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("3f61"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("3f61"));
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0700" // Required Insert Count 6 and Delta Base 0.
// Base is 6 + 0 = 6.
"80")); // Indexed Header Field instruction addressing dynamic table
// entry with relative index 0, absolute index 5.
// Add literal entry with name "foo" and value "bar".
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e703626172"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e703626172"));
// Duplicate entry four times. This evicts the first two instances.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("00000000"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("00000000"));
EXPECT_CALL(handler_, OnHeaderDecoded(Eq("foo"), Eq("baz")));
EXPECT_CALL(handler_, OnDecodingCompleted());
@@ -888,13 +910,13 @@ TEST_P(QpackDecoderTest, BlockedDecodingAndEvictedEntries) {
// Add literal entry with name "foo" and value "bar".
// Insert Count is now 6, reaching Required Insert Count of the header block.
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode("6294e70362617a"));
+ DecodeEncoderStreamData(absl::HexStringToBytes("6294e70362617a"));
}
TEST_P(QpackDecoderTest, TooManyBlockedStreams) {
// Required Insert Count 1 and Delta Base 0.
// Without any dynamic table entries received, decoding is blocked.
- std::string data = quiche::QuicheTextUtils::HexDecode("0200");
+ std::string data = absl::HexStringToBytes("0200");
auto progressive_decoder1 = CreateProgressiveDecoder(/* stream_id = */ 1);
progressive_decoder1->Decode(data);
@@ -907,7 +929,7 @@ TEST_P(QpackDecoderTest, TooManyBlockedStreams) {
}
TEST_P(QpackDecoderTest, InsertCountIncrement) {
- DecodeEncoderStreamData(quiche::QuicheTextUtils::HexDecode(
+ DecodeEncoderStreamData(absl::HexStringToBytes(
"3fe107" // Set dynamic table capacity to 1024.
"6294e703626172" // Add literal entry with name "foo" and value "bar".
"00")); // Duplicate entry.
@@ -919,11 +941,11 @@ TEST_P(QpackDecoderTest, InsertCountIncrement) {
// Known Insert Count to one. Decoder should send an Insert Count Increment
// instruction with increment of one to update Known Insert Count to two.
EXPECT_CALL(decoder_stream_sender_delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode(
+ WriteStreamData(Eq(absl::HexStringToBytes(
"81" // Header Acknowledgement on stream 1
"01")))); // Insert Count Increment with increment of one
- DecodeHeaderBlock(quiche::QuicheTextUtils::HexDecode(
+ DecodeHeaderBlock(absl::HexStringToBytes(
"0200" // Required Insert Count 1 and Delta Base 0.
// Base is 1 + 0 = 1.
"80")); // Dynamic table entry with relative index 0, absolute index 0.
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.cc
index 67adf1268eb..bf7cdc63a3f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.cc
@@ -7,13 +7,14 @@
#include <algorithm>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_index_conversions.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count.h"
#include "net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -58,7 +59,7 @@ QpackInstructionWithValues
QpackEncoder::EncodeLiteralHeaderFieldWithNameReference(
bool is_static,
uint64_t index,
- quiche::QuicheStringPiece value,
+ absl::string_view value,
QpackBlockingManager::IndexSet* referred_indices) {
// Add |index| to |*referred_indices| only if entry is in the dynamic table.
if (!is_static) {
@@ -70,14 +71,14 @@ QpackEncoder::EncodeLiteralHeaderFieldWithNameReference(
// static
QpackInstructionWithValues QpackEncoder::EncodeLiteralHeaderField(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ absl::string_view name,
+ absl::string_view value) {
return QpackInstructionWithValues::LiteralHeaderField(name, value);
}
QpackEncoder::Instructions QpackEncoder::FirstPassEncode(
QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock& header_list,
+ const spdy::Http2HeaderBlock& header_list,
QpackBlockingManager::IndexSet* referred_indices,
QuicByteCount* encoder_stream_sent_byte_count) {
// If previous instructions are buffered in |encoder_stream_sender_|,
@@ -110,8 +111,8 @@ QpackEncoder::Instructions QpackEncoder::FirstPassEncode(
for (const auto& header : ValueSplittingHeaderList(&header_list)) {
// These strings are owned by |header_list|.
- quiche::QuicheStringPiece name = header.first;
- quiche::QuicheStringPiece value = header.second;
+ absl::string_view name = header.first;
+ absl::string_view value = header.second;
bool is_static;
uint64_t index;
@@ -355,7 +356,7 @@ std::string QpackEncoder::SecondPassEncode(
std::string QpackEncoder::EncodeHeaderList(
QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock& header_list,
+ const spdy::Http2HeaderBlock& header_list,
QuicByteCount* encoder_stream_sent_byte_count) {
// Keep track of all dynamic table indices that this header block refers to so
// that it can be passed to QpackBlockingManager.
@@ -403,29 +404,32 @@ bool QpackEncoder::SetMaximumBlockedStreams(uint64_t maximum_blocked_streams) {
void QpackEncoder::OnInsertCountIncrement(uint64_t increment) {
if (increment == 0) {
- decoder_stream_error_delegate_->OnDecoderStreamError(
- "Invalid increment value 0.");
+ OnErrorDetected(QUIC_QPACK_DECODER_STREAM_INVALID_ZERO_INCREMENT,
+ "Invalid increment value 0.");
return;
}
if (!blocking_manager_.OnInsertCountIncrement(increment)) {
- decoder_stream_error_delegate_->OnDecoderStreamError(
- "Insert Count Increment instruction causes overflow.");
+ OnErrorDetected(QUIC_QPACK_DECODER_STREAM_INCREMENT_OVERFLOW,
+ "Insert Count Increment instruction causes overflow.");
}
if (blocking_manager_.known_received_count() >
header_table_.inserted_entry_count()) {
- decoder_stream_error_delegate_->OnDecoderStreamError(quiche::QuicheStrCat(
- "Increment value ", increment, " raises known received count to ",
- blocking_manager_.known_received_count(),
- " exceeding inserted entry count ",
- header_table_.inserted_entry_count()));
+ OnErrorDetected(
+ QUIC_QPACK_DECODER_STREAM_IMPOSSIBLE_INSERT_COUNT,
+ quiche::QuicheStrCat("Increment value ", increment,
+ " raises known received count to ",
+ blocking_manager_.known_received_count(),
+ " exceeding inserted entry count ",
+ header_table_.inserted_entry_count()));
}
}
void QpackEncoder::OnHeaderAcknowledgement(QuicStreamId stream_id) {
if (!blocking_manager_.OnHeaderAcknowledgement(stream_id)) {
- decoder_stream_error_delegate_->OnDecoderStreamError(
+ OnErrorDetected(
+ QUIC_QPACK_DECODER_STREAM_INCORRECT_ACKNOWLEDGEMENT,
quiche::QuicheStrCat("Header Acknowledgement received for stream ",
stream_id, " with no outstanding header blocks."));
}
@@ -435,8 +439,16 @@ void QpackEncoder::OnStreamCancellation(QuicStreamId stream_id) {
blocking_manager_.OnStreamCancellation(stream_id);
}
-void QpackEncoder::OnErrorDetected(quiche::QuicheStringPiece error_message) {
- decoder_stream_error_delegate_->OnDecoderStreamError(error_message);
+void QpackEncoder::OnErrorDetected(QuicErrorCode error_code,
+ absl::string_view error_message) {
+ if (GetQuicReloadableFlag(quic_granular_qpack_error_codes)) {
+ QUIC_CODE_COUNT_N(quic_granular_qpack_error_codes, 1, 2);
+ decoder_stream_error_delegate_->OnDecoderStreamError(error_code,
+ error_message);
+ } else {
+ decoder_stream_error_delegate_->OnDecoderStreamError(
+ QUIC_QPACK_DECODER_STREAM_ERROR, error_message);
+ }
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.h
index 202fc6d8ef1..c6c8aa5d8ae 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder.h
@@ -10,21 +10,17 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_blocking_manager.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder_stream_receiver.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_exported_stats.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
-
-namespace spdy {
-
-class SpdyHeaderBlock;
-
-} // namespace spdy
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace quic {
@@ -45,8 +41,8 @@ class QUIC_EXPORT_PRIVATE QpackEncoder
public:
virtual ~DecoderStreamErrorDelegate() {}
- virtual void OnDecoderStreamError(
- quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnDecoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) = 0;
};
QpackEncoder(DecoderStreamErrorDelegate* decoder_stream_error_delegate);
@@ -56,7 +52,7 @@ class QUIC_EXPORT_PRIVATE QpackEncoder
// |*encoder_stream_sent_byte_count| will be set to the number of bytes sent
// on the encoder stream to insert dynamic table entries.
std::string EncodeHeaderList(QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock& header_list,
+ const spdy::Http2HeaderBlock& header_list,
QuicByteCount* encoder_stream_sent_byte_count);
// Set maximum dynamic table capacity to |maximum_dynamic_table_capacity|,
@@ -83,7 +79,8 @@ class QUIC_EXPORT_PRIVATE QpackEncoder
void OnInsertCountIncrement(uint64_t increment) override;
void OnHeaderAcknowledgement(QuicStreamId stream_id) override;
void OnStreamCancellation(QuicStreamId stream_id) override;
- void OnErrorDetected(quiche::QuicheStringPiece error_message) override;
+ void OnErrorDetected(QuicErrorCode error_code,
+ absl::string_view error_message) override;
// delegate must be set if dynamic table capacity is not zero.
void set_qpack_stream_sender_delegate(QpackStreamSenderDelegate* delegate) {
@@ -122,13 +119,13 @@ class QUIC_EXPORT_PRIVATE QpackEncoder
static QpackInstructionWithValues EncodeLiteralHeaderFieldWithNameReference(
bool is_static,
uint64_t index,
- quiche::QuicheStringPiece value,
+ absl::string_view value,
QpackBlockingManager::IndexSet* referred_indices);
// Generate literal header field instruction.
static QpackInstructionWithValues EncodeLiteralHeaderField(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ absl::string_view name,
+ absl::string_view value);
// Performs first pass of two-pass encoding: represent each header field in
// |*header_list| as a reference to an existing entry, the name of an existing
@@ -140,9 +137,9 @@ class QUIC_EXPORT_PRIVATE QpackEncoder
// encoder stream to insert dynamic table entries. Returns list of header
// field representations, with all dynamic table entries referred to with
// absolute indices. Returned Instructions object may have
- // quiche::QuicheStringPieces pointing to strings owned by |*header_list|.
+ // absl::string_views pointing to strings owned by |*header_list|.
Instructions FirstPassEncode(QuicStreamId stream_id,
- const spdy::SpdyHeaderBlock& header_list,
+ const spdy::Http2HeaderBlock& header_list,
QpackBlockingManager::IndexSet* referred_indices,
QuicByteCount* encoder_stream_sent_byte_count);
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.cc
index 56ee23241db..95260ab3e7a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/decoder/decode_buffer.h"
#include "net/third_party/quiche/src/http2/decoder/decode_status.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -18,7 +18,7 @@ QpackEncoderStreamReceiver::QpackEncoderStreamReceiver(Delegate* delegate)
DCHECK(delegate_);
}
-void QpackEncoderStreamReceiver::Decode(quiche::QuicheStringPiece data) {
+void QpackEncoderStreamReceiver::Decode(absl::string_view data) {
if (data.empty() || error_detected_) {
return;
}
@@ -51,12 +51,29 @@ bool QpackEncoderStreamReceiver::OnInstructionDecoded(
return true;
}
-void QpackEncoderStreamReceiver::OnError(
- quiche::QuicheStringPiece error_message) {
+void QpackEncoderStreamReceiver::OnInstructionDecodingError(
+ QpackInstructionDecoder::ErrorCode error_code,
+ absl::string_view error_message) {
DCHECK(!error_detected_);
error_detected_ = true;
- delegate_->OnErrorDetected(error_message);
+
+ QuicErrorCode quic_error_code;
+ switch (error_code) {
+ case QpackInstructionDecoder::ErrorCode::INTEGER_TOO_LARGE:
+ quic_error_code = QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE;
+ break;
+ case QpackInstructionDecoder::ErrorCode::STRING_LITERAL_TOO_LONG:
+ quic_error_code = QUIC_QPACK_ENCODER_STREAM_STRING_LITERAL_TOO_LONG;
+ break;
+ case QpackInstructionDecoder::ErrorCode::HUFFMAN_ENCODING_ERROR:
+ quic_error_code = QUIC_QPACK_ENCODER_STREAM_HUFFMAN_ENCODING_ERROR;
+ break;
+ default:
+ quic_error_code = QUIC_INTERNAL_ERROR;
+ }
+
+ delegate_->OnErrorDetected(quic_error_code, error_message);
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h
index 80622e5460d..fa94a5353ee 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h
@@ -8,10 +8,11 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_stream_receiver.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -29,17 +30,17 @@ class QUIC_EXPORT_PRIVATE QpackEncoderStreamReceiver
// 5.2.1. Insert With Name Reference
virtual void OnInsertWithNameReference(bool is_static,
uint64_t name_index,
- quiche::QuicheStringPiece value) = 0;
+ absl::string_view value) = 0;
// 5.2.2. Insert Without Name Reference
- virtual void OnInsertWithoutNameReference(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) = 0;
+ virtual void OnInsertWithoutNameReference(absl::string_view name,
+ absl::string_view value) = 0;
// 5.2.3. Duplicate
virtual void OnDuplicate(uint64_t index) = 0;
// 5.2.4. Set Dynamic Table Capacity
virtual void OnSetDynamicTableCapacity(uint64_t capacity) = 0;
// Decoding error
- virtual void OnErrorDetected(quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnErrorDetected(QuicErrorCode error_code,
+ absl::string_view error_message) = 0;
};
explicit QpackEncoderStreamReceiver(Delegate* delegate);
@@ -53,11 +54,12 @@ class QUIC_EXPORT_PRIVATE QpackEncoderStreamReceiver
// Decode data and call appropriate Delegate method after each decoded
// instruction. Once an error occurs, Delegate::OnErrorDetected() is called,
// and all further data is ignored.
- void Decode(quiche::QuicheStringPiece data) override;
+ void Decode(absl::string_view data) override;
// QpackInstructionDecoder::Delegate implementation.
bool OnInstructionDecoded(const QpackInstruction* instruction) override;
- void OnError(quiche::QuicheStringPiece error_message) override;
+ void OnInstructionDecodingError(QpackInstructionDecoder::ErrorCode error_code,
+ absl::string_view error_message) override;
private:
QpackInstructionDecoder instruction_decoder_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver_test.cc
index 71b6d3438e4..31bea896899 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver_test.cc
@@ -4,8 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using testing::Eq;
@@ -21,19 +22,17 @@ class MockDelegate : public QpackEncoderStreamReceiver::Delegate {
MOCK_METHOD(void,
OnInsertWithNameReference,
- (bool is_static,
- uint64_t name_index,
- quiche::QuicheStringPiece value),
+ (bool is_static, uint64_t name_index, absl::string_view value),
(override));
MOCK_METHOD(void,
OnInsertWithoutNameReference,
- (quiche::QuicheStringPiece name, quiche::QuicheStringPiece value),
+ (absl::string_view name, absl::string_view value),
(override));
MOCK_METHOD(void, OnDuplicate, (uint64_t index), (override));
MOCK_METHOD(void, OnSetDynamicTableCapacity, (uint64_t capacity), (override));
MOCK_METHOD(void,
OnErrorDetected,
- (quiche::QuicheStringPiece error_message),
+ (QuicErrorCode error_code, absl::string_view error_message),
(override));
};
@@ -42,7 +41,7 @@ class QpackEncoderStreamReceiverTest : public QuicTest {
QpackEncoderStreamReceiverTest() : stream_(&delegate_) {}
~QpackEncoderStreamReceiverTest() override = default;
- void Decode(quiche::QuicheStringPiece data) { stream_.Decode(data); }
+ void Decode(absl::string_view data) { stream_.Decode(data); }
StrictMock<MockDelegate>* delegate() { return &delegate_; }
private:
@@ -62,7 +61,7 @@ TEST_F(QpackEncoderStreamReceiverTest, InsertWithNameReference) {
EXPECT_CALL(*delegate(),
OnInsertWithNameReference(false, 42, Eq(std::string(127, 'Z'))));
- Decode(quiche::QuicheTextUtils::HexDecode(
+ Decode(absl::HexStringToBytes(
"c500"
"c28294e7"
"bf4a03626172"
@@ -73,15 +72,19 @@ TEST_F(QpackEncoderStreamReceiverTest, InsertWithNameReference) {
}
TEST_F(QpackEncoderStreamReceiverTest, InsertWithNameReferenceIndexTooLarge) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("Encoded integer too large.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
- Decode(quiche::QuicheTextUtils::HexDecode("bfffffffffffffffffffffff"));
+ Decode(absl::HexStringToBytes("bfffffffffffffffffffffff"));
}
TEST_F(QpackEncoderStreamReceiverTest, InsertWithNameReferenceValueTooLong) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("Encoded integer too large.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
- Decode(quiche::QuicheTextUtils::HexDecode("c57fffffffffffffffffffff"));
+ Decode(absl::HexStringToBytes("c57fffffffffffffffffffff"));
}
TEST_F(QpackEncoderStreamReceiverTest, InsertWithoutNameReference) {
@@ -97,7 +100,7 @@ TEST_F(QpackEncoderStreamReceiverTest, InsertWithoutNameReference) {
OnInsertWithoutNameReference(Eq(std::string(31, 'Z')),
Eq(std::string(127, 'Z'))));
- Decode(quiche::QuicheTextUtils::HexDecode(
+ Decode(absl::HexStringToBytes(
"4000"
"4362617203626172"
"6294e78294e7"
@@ -111,33 +114,41 @@ TEST_F(QpackEncoderStreamReceiverTest, InsertWithoutNameReference) {
// Name Length value is too large for varint decoder to decode.
TEST_F(QpackEncoderStreamReceiverTest,
InsertWithoutNameReferenceNameTooLongForVarintDecoder) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("Encoded integer too large.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
- Decode(quiche::QuicheTextUtils::HexDecode("5fffffffffffffffffffff"));
+ Decode(absl::HexStringToBytes("5fffffffffffffffffffff"));
}
// Name Length value can be decoded by varint decoder but exceeds 1 MB limit.
TEST_F(QpackEncoderStreamReceiverTest,
InsertWithoutNameReferenceNameExceedsLimit) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("String literal too long.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_STRING_LITERAL_TOO_LONG,
+ Eq("String literal too long.")));
- Decode(quiche::QuicheTextUtils::HexDecode("5fffff7f"));
+ Decode(absl::HexStringToBytes("5fffff7f"));
}
// Value Length value is too large for varint decoder to decode.
TEST_F(QpackEncoderStreamReceiverTest,
InsertWithoutNameReferenceValueTooLongForVarintDecoder) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("Encoded integer too large.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
- Decode(quiche::QuicheTextUtils::HexDecode("436261727fffffffffffffffffffff"));
+ Decode(absl::HexStringToBytes("436261727fffffffffffffffffffff"));
}
// Value Length value can be decoded by varint decoder but exceeds 1 MB limit.
TEST_F(QpackEncoderStreamReceiverTest,
InsertWithoutNameReferenceValueExceedsLimit) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("String literal too long.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_STRING_LITERAL_TOO_LONG,
+ Eq("String literal too long.")));
- Decode(quiche::QuicheTextUtils::HexDecode("436261727fffff7f"));
+ Decode(absl::HexStringToBytes("436261727fffff7f"));
}
TEST_F(QpackEncoderStreamReceiverTest, Duplicate) {
@@ -146,13 +157,15 @@ TEST_F(QpackEncoderStreamReceiverTest, Duplicate) {
// Large index requires two extension bytes.
EXPECT_CALL(*delegate(), OnDuplicate(500));
- Decode(quiche::QuicheTextUtils::HexDecode("111fd503"));
+ Decode(absl::HexStringToBytes("111fd503"));
}
TEST_F(QpackEncoderStreamReceiverTest, DuplicateIndexTooLarge) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("Encoded integer too large.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
- Decode(quiche::QuicheTextUtils::HexDecode("1fffffffffffffffffffff"));
+ Decode(absl::HexStringToBytes("1fffffffffffffffffffff"));
}
TEST_F(QpackEncoderStreamReceiverTest, SetDynamicTableCapacity) {
@@ -161,13 +174,23 @@ TEST_F(QpackEncoderStreamReceiverTest, SetDynamicTableCapacity) {
// Large capacity requires two extension bytes.
EXPECT_CALL(*delegate(), OnSetDynamicTableCapacity(500));
- Decode(quiche::QuicheTextUtils::HexDecode("313fd503"));
+ Decode(absl::HexStringToBytes("313fd503"));
}
TEST_F(QpackEncoderStreamReceiverTest, SetDynamicTableCapacityTooLarge) {
- EXPECT_CALL(*delegate(), OnErrorDetected(Eq("Encoded integer too large.")));
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
+
+ Decode(absl::HexStringToBytes("3fffffffffffffffffffff"));
+}
+
+TEST_F(QpackEncoderStreamReceiverTest, InvalidHuffmanEncoding) {
+ EXPECT_CALL(*delegate(),
+ OnErrorDetected(QUIC_QPACK_ENCODER_STREAM_HUFFMAN_ENCODING_ERROR,
+ Eq("Error in Huffman-encoded string.")));
- Decode(quiche::QuicheTextUtils::HexDecode("3fffffffffffffffffffff"));
+ Decode(absl::HexStringToBytes("c281ff"));
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.cc
index 0ae1aae7ff1..88214abee17 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.cc
@@ -8,9 +8,9 @@
#include <limits>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -19,7 +19,7 @@ QpackEncoderStreamSender::QpackEncoderStreamSender() : delegate_(nullptr) {}
void QpackEncoderStreamSender::SendInsertWithNameReference(
bool is_static,
uint64_t name_index,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
instruction_encoder_.Encode(
QpackInstructionWithValues::InsertWithNameReference(is_static, name_index,
value),
@@ -27,8 +27,8 @@ void QpackEncoderStreamSender::SendInsertWithNameReference(
}
void QpackEncoderStreamSender::SendInsertWithoutNameReference(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ absl::string_view name,
+ absl::string_view value) {
instruction_encoder_.Encode(
QpackInstructionWithValues::InsertWithoutNameReference(name, value),
&buffer_);
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h
index dee23c50d5b..dbef027e1b7 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h
@@ -7,11 +7,11 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -29,10 +29,10 @@ class QUIC_EXPORT_PRIVATE QpackEncoderStreamSender {
// 5.2.1. Insert With Name Reference
void SendInsertWithNameReference(bool is_static,
uint64_t name_index,
- quiche::QuicheStringPiece value);
+ absl::string_view value);
// 5.2.2. Insert Without Name Reference
- void SendInsertWithoutNameReference(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ void SendInsertWithoutNameReference(absl::string_view name,
+ absl::string_view value);
// 5.2.3. Duplicate
void SendDuplicate(uint64_t index);
// 5.2.4. Set Dynamic Table Capacity
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender_test.cc
index ea45acc1abd..08138190c84 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender_test.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_sender.h"
+#include "absl/strings/escaping.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
@@ -30,22 +31,21 @@ TEST_F(QpackEncoderStreamSenderTest, InsertWithNameReference) {
EXPECT_EQ(0u, stream_.BufferedByteCount());
// Static, index fits in prefix, empty value.
- std::string expected_encoded_data =
- quiche::QuicheTextUtils::HexDecode("c500");
+ std::string expected_encoded_data = absl::HexStringToBytes("c500");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendInsertWithNameReference(true, 5, "");
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
stream_.Flush();
// Static, index fits in prefix, Huffman encoded value.
- expected_encoded_data = quiche::QuicheTextUtils::HexDecode("c28294e7");
+ expected_encoded_data = absl::HexStringToBytes("c28294e7");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendInsertWithNameReference(true, 2, "foo");
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
stream_.Flush();
// Not static, index does not fit in prefix, not Huffman encoded value.
- expected_encoded_data = quiche::QuicheTextUtils::HexDecode("bf4a03626172");
+ expected_encoded_data = absl::HexStringToBytes("bf4a03626172");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendInsertWithNameReference(false, 137, "bar");
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
@@ -53,7 +53,7 @@ TEST_F(QpackEncoderStreamSenderTest, InsertWithNameReference) {
// Value length does not fit in prefix.
// 'Z' would be Huffman encoded to 8 bits, so no Huffman encoding is used.
- expected_encoded_data = quiche::QuicheTextUtils::HexDecode(
+ expected_encoded_data = absl::HexStringToBytes(
"aa7f005a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a"
"5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a"
"5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a"
@@ -68,23 +68,21 @@ TEST_F(QpackEncoderStreamSenderTest, InsertWithoutNameReference) {
EXPECT_EQ(0u, stream_.BufferedByteCount());
// Empty name and value.
- std::string expected_encoded_data =
- quiche::QuicheTextUtils::HexDecode("4000");
+ std::string expected_encoded_data = absl::HexStringToBytes("4000");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendInsertWithoutNameReference("", "");
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
stream_.Flush();
// Huffman encoded short strings.
- expected_encoded_data = quiche::QuicheTextUtils::HexDecode("6294e78294e7");
+ expected_encoded_data = absl::HexStringToBytes("6294e78294e7");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendInsertWithoutNameReference("foo", "foo");
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
stream_.Flush();
// Not Huffman encoded short strings.
- expected_encoded_data =
- quiche::QuicheTextUtils::HexDecode("4362617203626172");
+ expected_encoded_data = absl::HexStringToBytes("4362617203626172");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendInsertWithoutNameReference("bar", "bar");
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
@@ -92,7 +90,7 @@ TEST_F(QpackEncoderStreamSenderTest, InsertWithoutNameReference) {
// Not Huffman encoded long strings; length does not fit on prefix.
// 'Z' would be Huffman encoded to 8 bits, so no Huffman encoding is used.
- expected_encoded_data = quiche::QuicheTextUtils::HexDecode(
+ expected_encoded_data = absl::HexStringToBytes(
"5f005a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a7f"
"005a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a"
"5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a5a"
@@ -109,14 +107,14 @@ TEST_F(QpackEncoderStreamSenderTest, Duplicate) {
EXPECT_EQ(0u, stream_.BufferedByteCount());
// Small index fits in prefix.
- std::string expected_encoded_data = quiche::QuicheTextUtils::HexDecode("11");
+ std::string expected_encoded_data = absl::HexStringToBytes("11");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendDuplicate(17);
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
stream_.Flush();
// Large index requires two extension bytes.
- expected_encoded_data = quiche::QuicheTextUtils::HexDecode("1fd503");
+ expected_encoded_data = absl::HexStringToBytes("1fd503");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendDuplicate(500);
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
@@ -127,7 +125,7 @@ TEST_F(QpackEncoderStreamSenderTest, SetDynamicTableCapacity) {
EXPECT_EQ(0u, stream_.BufferedByteCount());
// Small capacity fits in prefix.
- std::string expected_encoded_data = quiche::QuicheTextUtils::HexDecode("31");
+ std::string expected_encoded_data = absl::HexStringToBytes("31");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendSetDynamicTableCapacity(17);
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
@@ -135,7 +133,7 @@ TEST_F(QpackEncoderStreamSenderTest, SetDynamicTableCapacity) {
EXPECT_EQ(0u, stream_.BufferedByteCount());
// Large capacity requires two extension bytes.
- expected_encoded_data = quiche::QuicheTextUtils::HexDecode("3fd503");
+ expected_encoded_data = absl::HexStringToBytes("3fd503");
EXPECT_CALL(delegate_, WriteStreamData(Eq(expected_encoded_data)));
stream_.SendSetDynamicTableCapacity(500);
EXPECT_EQ(expected_encoded_data.size(), stream_.BufferedByteCount());
@@ -157,7 +155,7 @@ TEST_F(QpackEncoderStreamSenderTest, Coalesce) {
// Duplicate entry.
stream_.SendDuplicate(17);
- std::string expected_encoded_data = quiche::QuicheTextUtils::HexDecode(
+ std::string expected_encoded_data = absl::HexStringToBytes(
"c500" // Insert entry with static name reference.
"c28294e7" // Insert entry with static name reference.
"6294e78294e7" // Insert literal entry.
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_test.cc
index e0d21c53269..08c6123fc82 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_encoder_test.cc
@@ -7,13 +7,15 @@
#include <limits>
#include <string>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_header_table_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using ::testing::_;
@@ -35,7 +37,7 @@ class QpackEncoderTest : public QuicTest {
~QpackEncoderTest() override = default;
- std::string Encode(const spdy::SpdyHeaderBlock& header_list) {
+ std::string Encode(const spdy::Http2HeaderBlock& header_list) {
return encoder_.EncodeHeaderList(/* stream_id = */ 1, header_list,
&encoder_stream_sent_byte_count_);
}
@@ -47,53 +49,53 @@ class QpackEncoderTest : public QuicTest {
};
TEST_F(QpackEncoderTest, Empty) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("0000"), output);
+ EXPECT_EQ(absl::HexStringToBytes("0000"), output);
}
TEST_F(QpackEncoderTest, EmptyName) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[""] = "foo";
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("0000208294e7"), output);
+ EXPECT_EQ(absl::HexStringToBytes("0000208294e7"), output);
}
TEST_F(QpackEncoderTest, EmptyValue) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "";
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("00002a94e700"), output);
+ EXPECT_EQ(absl::HexStringToBytes("00002a94e700"), output);
}
TEST_F(QpackEncoderTest, EmptyNameAndValue) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[""] = "";
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("00002000"), output);
+ EXPECT_EQ(absl::HexStringToBytes("00002000"), output);
}
TEST_F(QpackEncoderTest, Simple) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "bar";
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("00002a94e703626172"), output);
+ EXPECT_EQ(absl::HexStringToBytes("00002a94e703626172"), output);
}
TEST_F(QpackEncoderTest, Multiple) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "bar";
// 'Z' would be Huffman encoded to 8 bits, so no Huffman encoding is used.
header_list["ZZZZZZZ"] = std::string(127, 'Z');
std::string output = Encode(header_list);
EXPECT_EQ(
- quiche::QuicheTextUtils::HexDecode(
+ absl::HexStringToBytes(
"0000" // prefix
"2a94e703626172" // foo: bar
"27005a5a5a5a5a5a5a" // 7 octet long header name, the smallest number
@@ -109,63 +111,69 @@ TEST_F(QpackEncoderTest, Multiple) {
TEST_F(QpackEncoderTest, StaticTable) {
{
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[":method"] = "GET";
header_list["accept-encoding"] = "gzip, deflate, br";
header_list["location"] = "";
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("0000d1dfcc"), output);
+ EXPECT_EQ(absl::HexStringToBytes("0000d1dfcc"), output);
}
{
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[":method"] = "POST";
header_list["accept-encoding"] = "compress";
header_list["location"] = "foo";
std::string output = Encode(header_list);
- EXPECT_EQ(
- quiche::QuicheTextUtils::HexDecode("0000d45f108621e9aec2a11f5c8294e7"),
- output);
+ EXPECT_EQ(absl::HexStringToBytes("0000d45f108621e9aec2a11f5c8294e7"),
+ output);
}
{
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[":method"] = "TRACE";
header_list["accept-encoding"] = "";
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("00005f000554524143455f1000"),
- output);
+ EXPECT_EQ(absl::HexStringToBytes("00005f000554524143455f1000"), output);
}
}
TEST_F(QpackEncoderTest, DecoderStreamError) {
EXPECT_CALL(decoder_stream_error_delegate_,
- OnDecoderStreamError(Eq("Encoded integer too large.")));
+ OnDecoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE
+ : QUIC_QPACK_DECODER_STREAM_ERROR,
+ Eq("Encoded integer too large.")));
QpackEncoder encoder(&decoder_stream_error_delegate_);
encoder.set_qpack_stream_sender_delegate(&encoder_stream_sender_delegate_);
encoder.decoder_stream_receiver()->Decode(
- quiche::QuicheTextUtils::HexDecode("ffffffffffffffffffffff"));
+ absl::HexStringToBytes("ffffffffffffffffffffff"));
}
TEST_F(QpackEncoderTest, SplitAlongNullCharacter) {
- spdy::SpdyHeaderBlock header_list;
- header_list["foo"] = quiche::QuicheStringPiece("bar\0bar\0baz", 11);
+ spdy::Http2HeaderBlock header_list;
+ header_list["foo"] = absl::string_view("bar\0bar\0baz", 11);
std::string output = Encode(header_list);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("0000" // prefix
- "2a94e703626172" // foo: bar
- "2a94e703626172" // foo: bar
- "2a94e70362617a" // foo: baz
- ),
+ EXPECT_EQ(absl::HexStringToBytes("0000" // prefix
+ "2a94e703626172" // foo: bar
+ "2a94e703626172" // foo: bar
+ "2a94e70362617a" // foo: baz
+ ),
output);
}
TEST_F(QpackEncoderTest, ZeroInsertCountIncrement) {
// Encoder receives insert count increment with forbidden value 0.
EXPECT_CALL(decoder_stream_error_delegate_,
- OnDecoderStreamError(Eq("Invalid increment value 0.")));
+ OnDecoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_DECODER_STREAM_INVALID_ZERO_INCREMENT
+ : QUIC_QPACK_DECODER_STREAM_ERROR,
+ Eq("Invalid increment value 0.")));
encoder_.OnInsertCountIncrement(0);
}
@@ -173,10 +181,13 @@ TEST_F(QpackEncoderTest, TooLargeInsertCountIncrement) {
// Encoder receives insert count increment with value that increases Known
// Received Count to a value (one) which is larger than the number of dynamic
// table insertions sent (zero).
- EXPECT_CALL(
- decoder_stream_error_delegate_,
- OnDecoderStreamError(Eq("Increment value 1 raises known received count "
- "to 1 exceeding inserted entry count 0")));
+ EXPECT_CALL(decoder_stream_error_delegate_,
+ OnDecoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_DECODER_STREAM_IMPOSSIBLE_INSERT_COUNT
+ : QUIC_QPACK_DECODER_STREAM_ERROR,
+ Eq("Increment value 1 raises known received count "
+ "to 1 exceeding inserted entry count 0")));
encoder_.OnInsertCountIncrement(1);
}
@@ -197,6 +208,9 @@ TEST_F(QpackEncoderTest, InsertCountIncrementOverflow) {
// received count. This must result in an error instead of a crash.
EXPECT_CALL(decoder_stream_error_delegate_,
OnDecoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_DECODER_STREAM_INCREMENT_OVERFLOW
+ : QUIC_QPACK_DECODER_STREAM_ERROR,
Eq("Insert Count Increment instruction causes overflow.")));
encoder_.OnInsertCountIncrement(std::numeric_limits<uint64_t>::max());
}
@@ -204,10 +218,13 @@ TEST_F(QpackEncoderTest, InsertCountIncrementOverflow) {
TEST_F(QpackEncoderTest, InvalidHeaderAcknowledgement) {
// Encoder receives header acknowledgement for a stream on which no header
// block with dynamic table entries was ever sent.
- EXPECT_CALL(
- decoder_stream_error_delegate_,
- OnDecoderStreamError(Eq("Header Acknowledgement received for stream 0 "
- "with no outstanding header blocks.")));
+ EXPECT_CALL(decoder_stream_error_delegate_,
+ OnDecoderStreamError(
+ GetQuicReloadableFlag(quic_granular_qpack_error_codes)
+ ? QUIC_QPACK_DECODER_STREAM_INCORRECT_ACKNOWLEDGEMENT
+ : QUIC_QPACK_DECODER_STREAM_ERROR,
+ Eq("Header Acknowledgement received for stream 0 "
+ "with no outstanding header blocks.")));
encoder_.OnHeaderAcknowledgement(/* stream_id = */ 0);
}
@@ -216,17 +233,16 @@ TEST_F(QpackEncoderTest, DynamicTable) {
encoder_.SetMaximumDynamicTableCapacity(4096);
encoder_.SetDynamicTableCapacity(4096);
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "bar";
header_list.AppendValueOrAddHeader("foo",
"baz"); // name matches dynamic entry
header_list["cookie"] = "baz"; // name matches static entry
// Set Dynamic Table Capacity instruction.
- std::string set_dyanamic_table_capacity =
- quiche::QuicheTextUtils::HexDecode("3fe11f");
+ std::string set_dyanamic_table_capacity = absl::HexStringToBytes("3fe11f");
// Insert three entries into the dynamic table.
- std::string insert_entries = quiche::QuicheTextUtils::HexDecode(
+ std::string insert_entries = absl::HexStringToBytes(
"62" // insert without name reference
"94e7" // Huffman-encoded name "foo"
"03626172" // value "bar"
@@ -238,7 +254,7 @@ TEST_F(QpackEncoderTest, DynamicTable) {
WriteStreamData(Eq(quiche::QuicheStrCat(
set_dyanamic_table_capacity, insert_entries))));
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode(
+ EXPECT_EQ(absl::HexStringToBytes(
"0400" // prefix
"828180"), // dynamic entries with relative index 0, 1, and 2
Encode(header_list));
@@ -252,7 +268,7 @@ TEST_F(QpackEncoderTest, SmallDynamicTable) {
encoder_.SetMaximumDynamicTableCapacity(QpackEntry::Size("foo", "bar"));
encoder_.SetDynamicTableCapacity(QpackEntry::Size("foo", "bar"));
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "bar";
header_list.AppendValueOrAddHeader("foo",
"baz"); // name matches dynamic entry
@@ -260,10 +276,9 @@ TEST_F(QpackEncoderTest, SmallDynamicTable) {
header_list["bar"] = "baz"; // no match
// Set Dynamic Table Capacity instruction.
- std::string set_dyanamic_table_capacity =
- quiche::QuicheTextUtils::HexDecode("3f07");
+ std::string set_dyanamic_table_capacity = absl::HexStringToBytes("3f07");
// Insert one entry into the dynamic table.
- std::string insert_entry = quiche::QuicheTextUtils::HexDecode(
+ std::string insert_entry = absl::HexStringToBytes(
"62" // insert without name reference
"94e7" // Huffman-encoded name "foo"
"03626172"); // value "bar"
@@ -271,15 +286,14 @@ TEST_F(QpackEncoderTest, SmallDynamicTable) {
WriteStreamData(Eq(quiche::QuicheStrCat(
set_dyanamic_table_capacity, insert_entry))));
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode(
- "0200" // prefix
- "80" // dynamic entry 0
- "40" // reference to dynamic entry 0 name
- "0362617a" // with literal value "baz"
- "55" // reference to static entry 5 name
- "0362617a" // with literal value "baz"
- "23626172" // literal name "bar"
- "0362617a"), // with literal value "baz"
+ EXPECT_EQ(absl::HexStringToBytes("0200" // prefix
+ "80" // dynamic entry 0
+ "40" // reference to dynamic entry 0 name
+ "0362617a" // with literal value "baz"
+ "55" // reference to static entry 5 name
+ "0362617a" // with literal value "baz"
+ "23626172" // literal name "bar"
+ "0362617a"), // with literal value "baz"
Encode(header_list));
EXPECT_EQ(insert_entry.size(), encoder_stream_sent_byte_count_);
@@ -290,14 +304,13 @@ TEST_F(QpackEncoderTest, BlockedStream) {
encoder_.SetMaximumDynamicTableCapacity(4096);
encoder_.SetDynamicTableCapacity(4096);
- spdy::SpdyHeaderBlock header_list1;
+ spdy::Http2HeaderBlock header_list1;
header_list1["foo"] = "bar";
// Set Dynamic Table Capacity instruction.
- std::string set_dyanamic_table_capacity =
- quiche::QuicheTextUtils::HexDecode("3fe11f");
+ std::string set_dyanamic_table_capacity = absl::HexStringToBytes("3fe11f");
// Insert one entry into the dynamic table.
- std::string insert_entry1 = quiche::QuicheTextUtils::HexDecode(
+ std::string insert_entry1 = absl::HexStringToBytes(
"62" // insert without name reference
"94e7" // Huffman-encoded name "foo"
"03626172"); // value "bar"
@@ -305,30 +318,29 @@ TEST_F(QpackEncoderTest, BlockedStream) {
WriteStreamData(Eq(quiche::QuicheStrCat(
set_dyanamic_table_capacity, insert_entry1))));
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("0200" // prefix
- "80"), // dynamic entry 0
+ EXPECT_EQ(absl::HexStringToBytes("0200" // prefix
+ "80"), // dynamic entry 0
encoder_.EncodeHeaderList(/* stream_id = */ 1, header_list1,
&encoder_stream_sent_byte_count_));
EXPECT_EQ(insert_entry1.size(), encoder_stream_sent_byte_count_);
// Stream 1 is blocked. Stream 2 is not allowed to block.
- spdy::SpdyHeaderBlock header_list2;
+ spdy::Http2HeaderBlock header_list2;
header_list2["foo"] = "bar"; // name and value match dynamic entry
header_list2.AppendValueOrAddHeader("foo",
"baz"); // name matches dynamic entry
header_list2["cookie"] = "baz"; // name matches static entry
header_list2["bar"] = "baz"; // no match
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode(
- "0000" // prefix
- "2a94e7" // literal name "foo"
- "03626172" // with literal value "bar"
- "2a94e7" // literal name "foo"
- "0362617a" // with literal value "baz"
- "55" // name of static entry 5
- "0362617a" // with literal value "baz"
- "23626172" // literal name "bar"
- "0362617a"), // with literal value "baz"
+ EXPECT_EQ(absl::HexStringToBytes("0000" // prefix
+ "2a94e7" // literal name "foo"
+ "03626172" // with literal value "bar"
+ "2a94e7" // literal name "foo"
+ "0362617a" // with literal value "baz"
+ "55" // name of static entry 5
+ "0362617a" // with literal value "baz"
+ "23626172" // literal name "bar"
+ "0362617a"), // with literal value "baz"
encoder_.EncodeHeaderList(/* stream_id = */ 2, header_list2,
&encoder_stream_sent_byte_count_));
EXPECT_EQ(0u, encoder_stream_sent_byte_count_);
@@ -338,7 +350,7 @@ TEST_F(QpackEncoderTest, BlockedStream) {
encoder_.OnInsertCountIncrement(1);
// Insert three entries into the dynamic table.
- std::string insert_entries = quiche::QuicheTextUtils::HexDecode(
+ std::string insert_entries = absl::HexStringToBytes(
"80" // insert with name reference, dynamic index 0
"0362617a" // value "baz"
"c5" // insert with name reference, static index 5
@@ -349,23 +361,22 @@ TEST_F(QpackEncoderTest, BlockedStream) {
EXPECT_CALL(encoder_stream_sender_delegate_,
WriteStreamData(Eq(insert_entries)));
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("0500" // prefix
- "83828180"), // dynamic entries
+ EXPECT_EQ(absl::HexStringToBytes("0500" // prefix
+ "83828180"), // dynamic entries
encoder_.EncodeHeaderList(/* stream_id = */ 3, header_list2,
&encoder_stream_sent_byte_count_));
EXPECT_EQ(insert_entries.size(), encoder_stream_sent_byte_count_);
// Stream 3 is blocked. Stream 4 is not allowed to block, but it can
// reference already acknowledged dynamic entry 0.
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode(
- "0200" // prefix
- "80" // dynamic entry 0
- "2a94e7" // literal name "foo"
- "0362617a" // with literal value "baz"
- "2c21cfd4c5" // literal name "cookie"
- "0362617a" // with literal value "baz"
- "23626172" // literal name "bar"
- "0362617a"), // with literal value "baz"
+ EXPECT_EQ(absl::HexStringToBytes("0200" // prefix
+ "80" // dynamic entry 0
+ "2a94e7" // literal name "foo"
+ "0362617a" // with literal value "baz"
+ "2c21cfd4c5" // literal name "cookie"
+ "0362617a" // with literal value "baz"
+ "23626172" // literal name "bar"
+ "0362617a"), // with literal value "baz"
encoder_.EncodeHeaderList(/* stream_id = */ 4, header_list2,
&encoder_stream_sent_byte_count_));
EXPECT_EQ(0u, encoder_stream_sent_byte_count_);
@@ -376,11 +387,10 @@ TEST_F(QpackEncoderTest, BlockedStream) {
// Stream 5 is not allowed to block, but it can reference already acknowledged
// dynamic entries 0, 1, and 2.
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode(
- "0400" // prefix
- "828180" // dynamic entries
- "23626172" // literal name "bar"
- "0362617a"), // with literal value "baz"
+ EXPECT_EQ(absl::HexStringToBytes("0400" // prefix
+ "828180" // dynamic entries
+ "23626172" // literal name "bar"
+ "0362617a"), // with literal value "baz"
encoder_.EncodeHeaderList(/* stream_id = */ 5, header_list2,
&encoder_stream_sent_byte_count_));
EXPECT_EQ(0u, encoder_stream_sent_byte_count_);
@@ -389,15 +399,15 @@ TEST_F(QpackEncoderTest, BlockedStream) {
// Stream 3 is not blocked any longer.
encoder_.OnHeaderAcknowledgement(3);
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode("0500" // prefix
- "83828180"), // dynamic entries
+ EXPECT_EQ(absl::HexStringToBytes("0500" // prefix
+ "83828180"), // dynamic entries
encoder_.EncodeHeaderList(/* stream_id = */ 6, header_list2,
&encoder_stream_sent_byte_count_));
EXPECT_EQ(0u, encoder_stream_sent_byte_count_);
}
TEST_F(QpackEncoderTest, Draining) {
- spdy::SpdyHeaderBlock header_list1;
+ spdy::Http2HeaderBlock header_list1;
header_list1["one"] = "foo";
header_list1["two"] = "foo";
header_list1["three"] = "foo";
@@ -425,26 +435,24 @@ TEST_F(QpackEncoderTest, Draining) {
// dynamic table.
EXPECT_CALL(encoder_stream_sender_delegate_, WriteStreamData(_));
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode(
- "0b00" // prefix
- "89888786858483828180"), // dynamic entries
+ EXPECT_EQ(absl::HexStringToBytes("0b00" // prefix
+ "89888786858483828180"), // dynamic entries
Encode(header_list1));
// Entry is identical to oldest one, which is draining. It will be
// duplicated and referenced.
- spdy::SpdyHeaderBlock header_list2;
+ spdy::Http2HeaderBlock header_list2;
header_list2["one"] = "foo";
// Duplicate oldest entry.
EXPECT_CALL(encoder_stream_sender_delegate_,
- WriteStreamData(Eq(quiche::QuicheTextUtils::HexDecode("09"))));
+ WriteStreamData(Eq(absl::HexStringToBytes("09"))));
- EXPECT_EQ(quiche::QuicheTextUtils::HexDecode(
- "0c00" // prefix
- "80"), // most recent dynamic table entry
+ EXPECT_EQ(absl::HexStringToBytes("0c00" // prefix
+ "80"), // most recent dynamic table entry
Encode(header_list2));
- spdy::SpdyHeaderBlock header_list3;
+ spdy::Http2HeaderBlock header_list3;
// Entry is identical to second oldest one, which is draining. There is no
// room to duplicate, it will be encoded with string literals.
header_list3.AppendValueOrAddHeader("two", "foo");
@@ -452,13 +460,12 @@ TEST_F(QpackEncoderTest, Draining) {
// no room to insert new entry, it will be encoded with string literals.
header_list3.AppendValueOrAddHeader("two", "bar");
- EXPECT_EQ(
- quiche::QuicheTextUtils::HexDecode("0000" // prefix
- "2374776f" // literal name "two"
- "8294e7" // literal value "foo"
- "2374776f" // literal name "two"
- "03626172"), // literal value "bar"
- Encode(header_list3));
+ EXPECT_EQ(absl::HexStringToBytes("0000" // prefix
+ "2374776f" // literal name "two"
+ "8294e7" // literal value "foo"
+ "2374776f" // literal name "two"
+ "03626172"), // literal value "bar"
+ Encode(header_list3));
}
TEST_F(QpackEncoderTest, DynamicTableCapacityLessThanMaximum) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.cc
index 29e71488bda..1440ca58a1b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_static_table.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -51,8 +51,8 @@ const QpackEntry* QpackHeaderTable::LookupEntry(bool is_static,
}
QpackHeaderTable::MatchType QpackHeaderTable::FindHeaderField(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value,
+ absl::string_view name,
+ absl::string_view value,
bool* is_static,
uint64_t* index) const {
QpackEntry query(name, value);
@@ -96,9 +96,8 @@ QpackHeaderTable::MatchType QpackHeaderTable::FindHeaderField(
return MatchType::kNoMatch;
}
-const QpackEntry* QpackHeaderTable::InsertEntry(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+const QpackEntry* QpackHeaderTable::InsertEntry(absl::string_view name,
+ absl::string_view value) {
const uint64_t entry_size = QpackEntry::Size(name, value);
if (entry_size > dynamic_table_capacity_) {
return nullptr;
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h
index bed1cc84afa..c9aa767ac10 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h
@@ -10,8 +10,8 @@
#include <queue>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h"
@@ -70,16 +70,16 @@ class QUIC_EXPORT_PRIVATE QpackHeaderTable {
// Returns the absolute index of an entry with matching name and value if such
// exists, otherwise one with matching name is such exists. |index| is zero
// based for both the static and the dynamic table.
- MatchType FindHeaderField(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value,
+ MatchType FindHeaderField(absl::string_view name,
+ absl::string_view value,
bool* is_static,
uint64_t* index) const;
// Insert (name, value) into the dynamic table. May evict entries. Returns a
// pointer to the inserted owned entry on success. Returns nullptr if entry
// is larger than the capacity of the dynamic table.
- const QpackEntry* InsertEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ const QpackEntry* InsertEntry(absl::string_view name,
+ absl::string_view value);
// Returns the size of the largest entry that could be inserted into the
// dynamic table without evicting entry |index|. |index| might be larger than
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table_test.cc
index a96159be486..b06786eb437 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_header_table_test.cc
@@ -6,10 +6,10 @@
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_static_table.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
using ::testing::Mock;
@@ -40,8 +40,8 @@ class QpackHeaderTableTest : public QuicTest {
void ExpectEntryAtIndex(bool is_static,
uint64_t index,
- quiche::QuicheStringPiece expected_name,
- quiche::QuicheStringPiece expected_value) const {
+ absl::string_view expected_name,
+ absl::string_view expected_value) const {
const auto* entry = table_.LookupEntry(is_static, index);
ASSERT_TRUE(entry);
EXPECT_EQ(expected_name, entry->name());
@@ -52,8 +52,8 @@ class QpackHeaderTableTest : public QuicTest {
EXPECT_FALSE(table_.LookupEntry(is_static, index));
}
- void ExpectMatch(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value,
+ void ExpectMatch(absl::string_view name,
+ absl::string_view value,
QpackHeaderTable::MatchType expected_match_type,
bool expected_is_static,
uint64_t expected_index) const {
@@ -70,8 +70,7 @@ class QpackHeaderTableTest : public QuicTest {
EXPECT_EQ(expected_index, index) << name << ": " << value;
}
- void ExpectNoMatch(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) const {
+ void ExpectNoMatch(absl::string_view name, absl::string_view value) const {
bool is_static = false;
uint64_t index = 0;
@@ -82,13 +81,12 @@ class QpackHeaderTableTest : public QuicTest {
<< name << ": " << value;
}
- void InsertEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ void InsertEntry(absl::string_view name, absl::string_view value) {
EXPECT_TRUE(table_.InsertEntry(name, value));
}
- void ExpectToFailInsertingEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ void ExpectToFailInsertingEntry(absl::string_view name,
+ absl::string_view value) {
EXPECT_FALSE(table_.InsertEntry(name, value));
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.cc
index 1f85d7f1fa7..539e3109cca 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.cc
@@ -7,9 +7,9 @@
#include <algorithm>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -33,7 +33,7 @@ QpackInstructionDecoder::QpackInstructionDecoder(const QpackLanguage* language,
error_detected_(false),
state_(State::kStartInstruction) {}
-bool QpackInstructionDecoder::Decode(quiche::QuicheStringPiece data) {
+bool QpackInstructionDecoder::Decode(absl::string_view data) {
DCHECK(!data.empty());
DCHECK(!error_detected_);
@@ -77,8 +77,8 @@ bool QpackInstructionDecoder::Decode(quiche::QuicheStringPiece data) {
DCHECK_LE(bytes_consumed, data.size());
- data = quiche::QuicheStringPiece(data.data() + bytes_consumed,
- data.size() - bytes_consumed);
+ data = absl::string_view(data.data() + bytes_consumed,
+ data.size() - bytes_consumed);
// Stop processing if no more data but next state would require it.
if (data.empty() && (state_ != State::kStartField) &&
@@ -94,8 +94,7 @@ bool QpackInstructionDecoder::AtInstructionBoundary() const {
return state_ == State::kStartInstruction;
}
-bool QpackInstructionDecoder::DoStartInstruction(
- quiche::QuicheStringPiece data) {
+bool QpackInstructionDecoder::DoStartInstruction(absl::string_view data) {
DCHECK(!data.empty());
instruction_ = LookupOpcode(data[0]);
@@ -133,7 +132,7 @@ bool QpackInstructionDecoder::DoStartField() {
}
}
-bool QpackInstructionDecoder::DoReadBit(quiche::QuicheStringPiece data) {
+bool QpackInstructionDecoder::DoReadBit(absl::string_view data) {
DCHECK(!data.empty());
switch (field_->type) {
@@ -163,7 +162,7 @@ bool QpackInstructionDecoder::DoReadBit(quiche::QuicheStringPiece data) {
}
}
-bool QpackInstructionDecoder::DoVarintStart(quiche::QuicheStringPiece data,
+bool QpackInstructionDecoder::DoVarintStart(absl::string_view data,
size_t* bytes_consumed) {
DCHECK(!data.empty());
DCHECK(field_->type == QpackInstructionFieldType::kVarint ||
@@ -184,7 +183,7 @@ bool QpackInstructionDecoder::DoVarintStart(quiche::QuicheStringPiece data,
state_ = State::kVarintResume;
return true;
case http2::DecodeStatus::kDecodeError:
- OnError("Encoded integer too large.");
+ OnError(ErrorCode::INTEGER_TOO_LARGE, "Encoded integer too large.");
return false;
default:
QUIC_BUG << "Unknown decode status " << status;
@@ -192,7 +191,7 @@ bool QpackInstructionDecoder::DoVarintStart(quiche::QuicheStringPiece data,
}
}
-bool QpackInstructionDecoder::DoVarintResume(quiche::QuicheStringPiece data,
+bool QpackInstructionDecoder::DoVarintResume(absl::string_view data,
size_t* bytes_consumed) {
DCHECK(!data.empty());
DCHECK(field_->type == QpackInstructionFieldType::kVarint ||
@@ -213,7 +212,7 @@ bool QpackInstructionDecoder::DoVarintResume(quiche::QuicheStringPiece data,
DCHECK(buffer.Empty());
return true;
case http2::DecodeStatus::kDecodeError:
- OnError("Encoded integer too large.");
+ OnError(ErrorCode::INTEGER_TOO_LARGE, "Encoded integer too large.");
return false;
default:
QUIC_BUG << "Unknown decode status " << status;
@@ -245,7 +244,7 @@ bool QpackInstructionDecoder::DoVarintDone() {
string_length_ = varint_decoder_.value();
if (string_length_ > kStringLiteralLengthLimit) {
- OnError("String literal too long.");
+ OnError(ErrorCode::STRING_LITERAL_TOO_LONG, "String literal too long.");
return false;
}
@@ -265,7 +264,7 @@ bool QpackInstructionDecoder::DoVarintDone() {
return true;
}
-bool QpackInstructionDecoder::DoReadString(quiche::QuicheStringPiece data,
+bool QpackInstructionDecoder::DoReadString(absl::string_view data,
size_t* bytes_consumed) {
DCHECK(!data.empty());
DCHECK(field_->type == QpackInstructionFieldType::kName ||
@@ -299,7 +298,8 @@ bool QpackInstructionDecoder::DoReadStringDone() {
std::string decoded_value;
huffman_decoder_.Decode(*string, &decoded_value);
if (!huffman_decoder_.InputProperlyTerminated()) {
- OnError("Error in Huffman-encoded string.");
+ OnError(ErrorCode::HUFFMAN_ENCODING_ERROR,
+ "Error in Huffman-encoded string.");
return false;
}
*string = std::move(decoded_value);
@@ -323,11 +323,12 @@ const QpackInstruction* QpackInstructionDecoder::LookupOpcode(
return nullptr;
}
-void QpackInstructionDecoder::OnError(quiche::QuicheStringPiece error_message) {
+void QpackInstructionDecoder::OnError(ErrorCode error_code,
+ absl::string_view error_message) {
DCHECK(!error_detected_);
error_detected_ = true;
- delegate_->OnError(error_message);
+ delegate_->OnInstructionDecodingError(error_code, error_message);
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h
index 08eb665749b..b8edfb7dbf4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h
@@ -9,11 +9,11 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_decoder.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -22,6 +22,12 @@ namespace quic {
// fields that follow each instruction.
class QUIC_EXPORT_PRIVATE QpackInstructionDecoder {
public:
+ enum class ErrorCode {
+ INTEGER_TOO_LARGE,
+ STRING_LITERAL_TOO_LONG,
+ HUFFMAN_ENCODING_ERROR,
+ };
+
// Delegate is notified each time an instruction is decoded or when an error
// occurs.
class QUIC_EXPORT_PRIVATE Delegate {
@@ -42,7 +48,9 @@ class QUIC_EXPORT_PRIVATE QpackInstructionDecoder {
// No more data is processed afterwards.
// Implementations are allowed to destroy the QpackInstructionDecoder
// instance synchronously.
- virtual void OnError(quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnInstructionDecodingError(
+ ErrorCode error_code,
+ absl::string_view error_message) = 0;
};
// Both |*language| and |*delegate| must outlive this object.
@@ -53,8 +61,9 @@ class QUIC_EXPORT_PRIVATE QpackInstructionDecoder {
// Provide a data fragment to decode. Must not be called after an error has
// occurred. Must not be called with empty |data|. Return true on success,
- // false on error (in which case Delegate::OnError() is called synchronously).
- bool Decode(quiche::QuicheStringPiece data);
+ // false on error (in which case Delegate::OnInstructionDecodingError() is
+ // called synchronously).
+ bool Decode(absl::string_view data);
// Returns true if no decoding has taken place yet or if the last instruction
// has been entirely parsed.
@@ -94,21 +103,21 @@ class QUIC_EXPORT_PRIVATE QpackInstructionDecoder {
// data and set |*bytes_consumed| to the number of octets processed. Some
// take input data but do not consume any bytes. Some do not take any
// arguments because they only change internal state.
- bool DoStartInstruction(quiche::QuicheStringPiece data);
+ bool DoStartInstruction(absl::string_view data);
bool DoStartField();
- bool DoReadBit(quiche::QuicheStringPiece data);
- bool DoVarintStart(quiche::QuicheStringPiece data, size_t* bytes_consumed);
- bool DoVarintResume(quiche::QuicheStringPiece data, size_t* bytes_consumed);
+ bool DoReadBit(absl::string_view data);
+ bool DoVarintStart(absl::string_view data, size_t* bytes_consumed);
+ bool DoVarintResume(absl::string_view data, size_t* bytes_consumed);
bool DoVarintDone();
- bool DoReadString(quiche::QuicheStringPiece data, size_t* bytes_consumed);
+ bool DoReadString(absl::string_view data, size_t* bytes_consumed);
bool DoReadStringDone();
// Identify instruction based on opcode encoded in |byte|.
// Returns a pointer to an element of |*language_|.
const QpackInstruction* LookupOpcode(uint8_t byte) const;
- // Stops decoding and calls Delegate::OnError().
- void OnError(quiche::QuicheStringPiece error_message);
+ // Stops decoding and calls Delegate::OnInstructionDecodingError().
+ void OnError(ErrorCode error_code, absl::string_view error_message);
// Describes the language used for decoding.
const QpackLanguage* const language_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder_test.cc
index a4bbc91aaf5..52ec38bc8c8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder_test.cc
@@ -6,17 +6,18 @@
#include <algorithm>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using ::testing::_;
using ::testing::Eq;
using ::testing::Expectation;
-using ::testing::Invoke;
+using ::testing::InvokeWithoutArgs;
using ::testing::Return;
using ::testing::StrictMock;
using ::testing::Values;
@@ -66,8 +67,9 @@ class MockDelegate : public QpackInstructionDecoder::Delegate {
(const QpackInstruction*),
(override));
MOCK_METHOD(void,
- OnError,
- (quiche::QuicheStringPiece error_message),
+ OnInstructionDecodingError,
+ (QpackInstructionDecoder::ErrorCode error_code,
+ absl::string_view error_message),
(override));
};
@@ -82,11 +84,8 @@ class QpackInstructionDecoderTest : public QuicTestWithParam<FragmentMode> {
void SetUp() override {
// Destroy QpackInstructionDecoder on error to test that it does not crash.
// See https://crbug.com/1025209.
- ON_CALL(delegate_, OnError(_))
- .WillByDefault(
- Invoke([this](quiche::QuicheStringPiece /* error_message */) {
- decoder_.reset();
- }));
+ ON_CALL(delegate_, OnInstructionDecodingError(_, _))
+ .WillByDefault(InvokeWithoutArgs([this]() { decoder_.reset(); }));
}
// Decode one full instruction with fragment sizes dictated by
@@ -95,7 +94,7 @@ class QpackInstructionDecoderTest : public QuicTestWithParam<FragmentMode> {
// verifies that AtInstructionBoundary() returns true before and after the
// instruction, and returns false while decoding is in progress.
// Assumes that delegate methods destroy |decoder_| if they return false.
- void DecodeInstruction(quiche::QuicheStringPiece data) {
+ void DecodeInstruction(absl::string_view data) {
EXPECT_TRUE(decoder_->AtInstructionBoundary());
FragmentSizeGenerator fragment_size_generator =
@@ -132,14 +131,14 @@ INSTANTIATE_TEST_SUITE_P(All,
TEST_P(QpackInstructionDecoderTest, SBitAndVarint2) {
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction1()));
- DecodeInstruction(quiche::QuicheTextUtils::HexDecode("7f01ff65"));
+ DecodeInstruction(absl::HexStringToBytes("7f01ff65"));
EXPECT_TRUE(decoder_->s_bit());
EXPECT_EQ(64u, decoder_->varint());
EXPECT_EQ(356u, decoder_->varint2());
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction1()));
- DecodeInstruction(quiche::QuicheTextUtils::HexDecode("05c8"));
+ DecodeInstruction(absl::HexStringToBytes("05c8"));
EXPECT_FALSE(decoder_->s_bit());
EXPECT_EQ(5u, decoder_->varint());
@@ -148,69 +147,79 @@ TEST_P(QpackInstructionDecoderTest, SBitAndVarint2) {
TEST_P(QpackInstructionDecoderTest, NameAndValue) {
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction2()));
- DecodeInstruction(quiche::QuicheTextUtils::HexDecode("83666f6f03626172"));
+ DecodeInstruction(absl::HexStringToBytes("83666f6f03626172"));
EXPECT_EQ("foo", decoder_->name());
EXPECT_EQ("bar", decoder_->value());
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction2()));
- DecodeInstruction(quiche::QuicheTextUtils::HexDecode("8000"));
+ DecodeInstruction(absl::HexStringToBytes("8000"));
EXPECT_EQ("", decoder_->name());
EXPECT_EQ("", decoder_->value());
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction2()));
- DecodeInstruction(quiche::QuicheTextUtils::HexDecode("c294e7838c767f"));
+ DecodeInstruction(absl::HexStringToBytes("c294e7838c767f"));
EXPECT_EQ("foo", decoder_->name());
EXPECT_EQ("bar", decoder_->value());
}
TEST_P(QpackInstructionDecoderTest, InvalidHuffmanEncoding) {
- EXPECT_CALL(delegate_, OnError(Eq("Error in Huffman-encoded string.")));
- DecodeInstruction(quiche::QuicheTextUtils::HexDecode("c1ff"));
+ EXPECT_CALL(delegate_,
+ OnInstructionDecodingError(
+ QpackInstructionDecoder::ErrorCode::HUFFMAN_ENCODING_ERROR,
+ Eq("Error in Huffman-encoded string.")));
+ DecodeInstruction(absl::HexStringToBytes("c1ff"));
}
TEST_P(QpackInstructionDecoderTest, InvalidVarintEncoding) {
- EXPECT_CALL(delegate_, OnError(Eq("Encoded integer too large.")));
- DecodeInstruction(
- quiche::QuicheTextUtils::HexDecode("ffffffffffffffffffffff"));
+ EXPECT_CALL(delegate_,
+ OnInstructionDecodingError(
+ QpackInstructionDecoder::ErrorCode::INTEGER_TOO_LARGE,
+ Eq("Encoded integer too large.")));
+ DecodeInstruction(absl::HexStringToBytes("ffffffffffffffffffffff"));
+}
+
+TEST_P(QpackInstructionDecoderTest, StringLiteralTooLong) {
+ EXPECT_CALL(delegate_,
+ OnInstructionDecodingError(
+ QpackInstructionDecoder::ErrorCode::STRING_LITERAL_TOO_LONG,
+ Eq("String literal too long.")));
+ DecodeInstruction(absl::HexStringToBytes("bfffff7f"));
}
TEST_P(QpackInstructionDecoderTest, DelegateSignalsError) {
// First instruction is valid.
Expectation first_call =
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction1()))
- .WillOnce(Invoke(
- [this](const QpackInstruction * /* instruction */) -> bool {
- EXPECT_EQ(1u, decoder_->varint());
- return true;
- }));
+ .WillOnce(InvokeWithoutArgs([this]() -> bool {
+ EXPECT_EQ(1u, decoder_->varint());
+ return true;
+ }));
// Second instruction is invalid. Decoding must halt.
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction1()))
.After(first_call)
- .WillOnce(
- Invoke([this](const QpackInstruction * /* instruction */) -> bool {
- EXPECT_EQ(2u, decoder_->varint());
- return false;
- }));
+ .WillOnce(InvokeWithoutArgs([this]() -> bool {
+ EXPECT_EQ(2u, decoder_->varint());
+ return false;
+ }));
- EXPECT_FALSE(decoder_->Decode(
- quiche::QuicheTextUtils::HexDecode("01000200030004000500")));
+ EXPECT_FALSE(
+ decoder_->Decode(absl::HexStringToBytes("01000200030004000500")));
}
// QpackInstructionDecoder must not crash if it is destroyed from a
// Delegate::OnInstructionDecoded() call as long as it returns false.
TEST_P(QpackInstructionDecoderTest, DelegateSignalsErrorAndDestroysDecoder) {
EXPECT_CALL(delegate_, OnInstructionDecoded(TestInstruction1()))
- .WillOnce(
- Invoke([this](const QpackInstruction * /* instruction */) -> bool {
- EXPECT_EQ(1u, decoder_->varint());
- decoder_.reset();
- return false;
- }));
- DecodeInstruction(quiche::QuicheTextUtils::HexDecode("0100"));
+ .WillOnce(InvokeWithoutArgs([this]() -> bool {
+ EXPECT_EQ(1u, decoder_->varint());
+ decoder_.reset();
+ return false;
+ }));
+ DecodeInstruction(absl::HexStringToBytes("0100"));
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.cc
index 41e2d763455..c79665447f9 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.cc
@@ -6,16 +6,27 @@
#include <limits>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
#include "net/third_party/quiche/src/http2/hpack/varint/hpack_varint_encoder.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
QpackInstructionEncoder::QpackInstructionEncoder()
- : byte_(0), state_(State::kOpcode), instruction_(nullptr) {}
+ : use_huffman_(false),
+ string_length_(0),
+ byte_(0),
+ state_(State::kOpcode),
+ instruction_(nullptr),
+ use_fast_huffman_encoder_(
+ GetQuicReloadableFlag(quic_use_fast_huffman_encoder)) {
+ if (use_fast_huffman_encoder_) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_use_fast_huffman_encoder);
+ }
+}
void QpackInstructionEncoder::Encode(
const QpackInstructionWithValues& instruction_with_values,
@@ -49,7 +60,8 @@ void QpackInstructionEncoder::Encode(
instruction_with_values.value());
break;
case State::kWriteString:
- DoWriteString(output);
+ DoWriteString(instruction_with_values.name(),
+ instruction_with_values.value(), output);
break;
}
} while (field_ != instruction_->fields.end());
@@ -110,7 +122,7 @@ void QpackInstructionEncoder::DoVarintEncode(uint64_t varint,
integer_to_encode = varint2;
break;
default:
- integer_to_encode = string_to_write_.size();
+ integer_to_encode = string_length_;
break;
}
@@ -128,30 +140,45 @@ void QpackInstructionEncoder::DoVarintEncode(uint64_t varint,
state_ = State::kWriteString;
}
-void QpackInstructionEncoder::DoStartString(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+void QpackInstructionEncoder::DoStartString(absl::string_view name,
+ absl::string_view value) {
DCHECK(field_->type == QpackInstructionFieldType::kName ||
field_->type == QpackInstructionFieldType::kValue);
- string_to_write_ =
+ absl::string_view string_to_write =
(field_->type == QpackInstructionFieldType::kName) ? name : value;
- http2::HuffmanEncode(string_to_write_, &huffman_encoded_string_);
+ string_length_ = string_to_write.size();
- if (huffman_encoded_string_.size() < string_to_write_.size()) {
- DCHECK_EQ(0, byte_ & (1 << field_->param));
+ size_t encoded_size = http2::HuffmanSize(string_to_write);
+ use_huffman_ = encoded_size < string_length_;
+ if (use_huffman_) {
+ DCHECK_EQ(0, byte_ & (1 << field_->param));
byte_ |= (1 << field_->param);
- string_to_write_ = huffman_encoded_string_;
+
+ string_length_ = encoded_size;
}
state_ = State::kVarintEncode;
}
-void QpackInstructionEncoder::DoWriteString(std::string* output) {
+void QpackInstructionEncoder::DoWriteString(absl::string_view name,
+ absl::string_view value,
+ std::string* output) {
DCHECK(field_->type == QpackInstructionFieldType::kName ||
field_->type == QpackInstructionFieldType::kValue);
- QuicStrAppend(output, string_to_write_);
+ absl::string_view string_to_write =
+ (field_->type == QpackInstructionFieldType::kName) ? name : value;
+ if (use_huffman_) {
+ if (use_fast_huffman_encoder_) {
+ http2::HuffmanEncodeFast(string_to_write, string_length_, output);
+ } else {
+ http2::HuffmanEncode(string_to_write, string_length_, output);
+ }
+ } else {
+ QuicStrAppend(output, string_to_write);
+ }
++field_;
state_ = State::kStartField;
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h
index 2a955f88db4..4f6fac71c6b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h
@@ -8,9 +8,9 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -38,11 +38,12 @@ class QUIC_EXPORT_PRIVATE QpackInstructionEncoder {
// Encode an integer (|varint_| or |varint2_| or string length) with a
// prefix, using |byte_| for the high bits.
kVarintEncode,
- // Determine if Huffman encoding should be used for |name_| or |value_|, set
- // up |name_| or |value_| and |huffman_encoded_string_| accordingly, and
- // write the Huffman bit to |byte_|.
+ // Determine if Huffman encoding should be used for the header name or
+ // value, set |use_huffman_| and |string_length_| appropriately, write the
+ // Huffman bit to |byte_|.
kStartString,
- // Write string.
+ // Write header name or value, performing Huffman encoding if |use_huffman_|
+ // is true.
kWriteString
};
@@ -52,19 +53,17 @@ class QUIC_EXPORT_PRIVATE QpackInstructionEncoder {
void DoStartField();
void DoSBit(bool s_bit);
void DoVarintEncode(uint64_t varint, uint64_t varint2, std::string* output);
- void DoStartString(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
- void DoWriteString(std::string* output);
+ void DoStartString(absl::string_view name, absl::string_view value);
+ void DoWriteString(absl::string_view name,
+ absl::string_view value,
+ std::string* output);
+ // True if name or value should be Huffman encoded.
+ bool use_huffman_;
- // Storage for the Huffman encoded string literal to be written if Huffman
- // encoding is used.
- std::string huffman_encoded_string_;
-
- // If Huffman encoding is used, points to a substring of
- // |huffman_encoded_string_|.
- // Otherwise points to a substring of |name_| or |value_|.
- quiche::QuicheStringPiece string_to_write_;
+ // Length of name or value string to be written.
+ // If |use_huffman_| is true, length is after Huffman encoding.
+ size_t string_length_;
// Storage for a single byte that contains multiple fields, that is, multiple
// states are writing it.
@@ -78,6 +77,9 @@ class QUIC_EXPORT_PRIVATE QpackInstructionEncoder {
// Field currently being decoded.
QpackInstructionFields::const_iterator field_;
+
+ // Latched value of gfe2_reloadable_flag_quic_use_fast_huffman_encoder.
+ const bool use_fast_huffman_encoder_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder_test.cc
index 6f3337c1a61..893bc50670f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder_test.cc
@@ -4,9 +4,10 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instruction_encoder.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -37,12 +38,12 @@ class QpackInstructionWithValuesPeer {
}
static void set_name(QpackInstructionWithValues* instruction_with_values,
- quiche::QuicheStringPiece name) {
+ absl::string_view name) {
instruction_with_values->name_ = name;
}
static void set_value(QpackInstructionWithValues* instruction_with_values,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
instruction_with_values->value_ = value;
}
};
@@ -62,12 +63,10 @@ class QpackInstructionEncoderTest : public QuicTest {
// Compare substring appended to |output_| since last EncodedSegmentMatches()
// call against hex-encoded argument.
- bool EncodedSegmentMatches(
- quiche::QuicheStringPiece hex_encoded_expected_substring) {
+ bool EncodedSegmentMatches(absl::string_view hex_encoded_expected_substring) {
auto recently_encoded =
- quiche::QuicheStringPiece(output_).substr(verified_position_);
- auto expected =
- quiche::QuicheTextUtils::HexDecode(hex_encoded_expected_substring);
+ absl::string_view(output_).substr(verified_position_);
+ auto expected = absl::HexStringToBytes(hex_encoded_expected_substring);
verified_position_ = output_.size();
return recently_encoded == expected;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.cc
index 1e5d1124c57..12db3639d39 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.cc
@@ -6,8 +6,8 @@
#include <limits>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -204,7 +204,7 @@ const QpackLanguage* QpackRequestStreamLanguage() {
QpackInstructionWithValues QpackInstructionWithValues::InsertWithNameReference(
bool is_static,
uint64_t name_index,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
QpackInstructionWithValues instruction_with_values;
instruction_with_values.instruction_ = InsertWithNameReferenceInstruction();
instruction_with_values.s_bit_ = is_static;
@@ -217,8 +217,8 @@ QpackInstructionWithValues QpackInstructionWithValues::InsertWithNameReference(
// static
QpackInstructionWithValues
QpackInstructionWithValues::InsertWithoutNameReference(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ absl::string_view name,
+ absl::string_view value) {
QpackInstructionWithValues instruction_with_values;
instruction_with_values.instruction_ =
InsertWithoutNameReferenceInstruction();
@@ -307,7 +307,7 @@ QpackInstructionWithValues
QpackInstructionWithValues::LiteralHeaderFieldNameReference(
bool is_static,
uint64_t index,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
QpackInstructionWithValues instruction_with_values;
instruction_with_values.instruction_ =
QpackLiteralHeaderFieldNameReferenceInstruction();
@@ -320,8 +320,8 @@ QpackInstructionWithValues::LiteralHeaderFieldNameReference(
// static
QpackInstructionWithValues QpackInstructionWithValues::LiteralHeaderField(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ absl::string_view name,
+ absl::string_view value) {
QpackInstructionWithValues instruction_with_values;
instruction_with_values.instruction_ = QpackLiteralHeaderFieldInstruction();
instruction_with_values.name_ = name;
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h
index d63a1e26ba5..006c9a7ab2f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h
@@ -10,8 +10,8 @@
#include <tuple>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -151,10 +151,10 @@ class QUIC_EXPORT_PRIVATE QpackInstructionWithValues {
static QpackInstructionWithValues InsertWithNameReference(
bool is_static,
uint64_t name_index,
- quiche::QuicheStringPiece value);
+ absl::string_view value);
static QpackInstructionWithValues InsertWithoutNameReference(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ absl::string_view name,
+ absl::string_view value);
static QpackInstructionWithValues Duplicate(uint64_t index);
static QpackInstructionWithValues SetDynamicTableCapacity(uint64_t capacity);
@@ -172,17 +172,16 @@ class QUIC_EXPORT_PRIVATE QpackInstructionWithValues {
static QpackInstructionWithValues LiteralHeaderFieldNameReference(
bool is_static,
uint64_t index,
- quiche::QuicheStringPiece value);
- static QpackInstructionWithValues LiteralHeaderField(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ absl::string_view value);
+ static QpackInstructionWithValues LiteralHeaderField(absl::string_view name,
+ absl::string_view value);
const QpackInstruction* instruction() const { return instruction_; }
bool s_bit() const { return s_bit_; }
uint64_t varint() const { return varint_; }
uint64_t varint2() const { return varint2_; }
- quiche::QuicheStringPiece name() const { return name_; }
- quiche::QuicheStringPiece value() const { return value_; }
+ absl::string_view name() const { return name_; }
+ absl::string_view value() const { return value_; }
// Used by QpackEncoder, because in the first pass it stores absolute indices,
// which are converted into relative indices in the second pass after base is
@@ -199,8 +198,8 @@ class QUIC_EXPORT_PRIVATE QpackInstructionWithValues {
bool s_bit_;
uint64_t varint_;
uint64_t varint2_;
- quiche::QuicheStringPiece name_;
- quiche::QuicheStringPiece value_;
+ absl::string_view name_;
+ absl::string_view value_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_offline_decoder_bin.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_offline_decoder_bin.cc
index c1c002fd913..851efe73633 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_offline_decoder_bin.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_offline_decoder_bin.cc
@@ -5,10 +5,10 @@
#include <cstddef>
#include <iostream>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
int main(int argc, char* argv[]) {
const char* usage =
@@ -25,8 +25,8 @@ int main(int argc, char* argv[]) {
size_t i;
size_t success_count = 0;
for (i = 0; 2 * i < args.size(); ++i) {
- const quiche::QuicheStringPiece input_filename(args[2 * i]);
- const quiche::QuicheStringPiece expected_headers_filename(args[2 * i + 1]);
+ const absl::string_view input_filename(args[2 * i]);
+ const absl::string_view expected_headers_filename(args[2 * i + 1]);
// Every file represents a different connection,
// therefore every file needs a fresh decoding context.
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.cc
index cf20bde3c60..83c55e0b31b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.cc
@@ -8,11 +8,11 @@
#include <limits>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_index_conversions.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instructions.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -46,7 +46,7 @@ QpackProgressiveDecoder::~QpackProgressiveDecoder() {
}
}
-void QpackProgressiveDecoder::Decode(quiche::QuicheStringPiece data) {
+void QpackProgressiveDecoder::Decode(absl::string_view data) {
DCHECK(decoding_);
if (data.empty() || error_detected_) {
@@ -89,6 +89,14 @@ void QpackProgressiveDecoder::EndHeaderBlock() {
}
}
+void QpackProgressiveDecoder::OnError(absl::string_view error_message) {
+ DCHECK(!error_detected_);
+
+ error_detected_ = true;
+ // Might destroy |this|.
+ handler_->OnDecodingErrorDetected(error_message);
+}
+
bool QpackProgressiveDecoder::OnInstructionDecoded(
const QpackInstruction* instruction) {
if (instruction == QpackPrefixInstruction()) {
@@ -114,12 +122,13 @@ bool QpackProgressiveDecoder::OnInstructionDecoded(
return DoLiteralHeaderFieldInstruction();
}
-void QpackProgressiveDecoder::OnError(quiche::QuicheStringPiece error_message) {
- DCHECK(!error_detected_);
-
- error_detected_ = true;
- // Might destroy |this|.
- handler_->OnDecodingErrorDetected(error_message);
+void QpackProgressiveDecoder::OnInstructionDecodingError(
+ QpackInstructionDecoder::ErrorCode /* error_code */,
+ absl::string_view error_message) {
+ // Ignore |error_code|, because header block decoding errors trigger a
+ // RESET_STREAM frame which cannot carry an error code more granular than
+ // QPACK_DECOMPRESSION_FAILED.
+ OnError(error_message);
}
void QpackProgressiveDecoder::OnInsertCountReachedThreshold() {
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h
index f9c0224c637..dfc25f9177d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h
@@ -9,12 +9,12 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder_stream_receiver.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_header_table.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_instruction_decoder.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -32,8 +32,8 @@ class QUIC_EXPORT_PRIVATE QpackProgressiveDecoder
// Called when a new header name-value pair is decoded. Multiple values for
// a given name will be emitted as multiple calls to OnHeader.
- virtual void OnHeaderDecoded(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) = 0;
+ virtual void OnHeaderDecoded(absl::string_view name,
+ absl::string_view value) = 0;
// Called when the header block is completely decoded.
// Indicates the total number of bytes in this block.
@@ -46,8 +46,7 @@ class QUIC_EXPORT_PRIVATE QpackProgressiveDecoder
// Called when a decoding error has occurred. No other methods will be
// called afterwards. Implementations are allowed to destroy
// the QpackProgressiveDecoder instance synchronously.
- virtual void OnDecodingErrorDetected(
- quiche::QuicheStringPiece error_message) = 0;
+ virtual void OnDecodingErrorDetected(absl::string_view error_message) = 0;
};
// Interface for keeping track of blocked streams for the purpose of enforcing
@@ -90,15 +89,19 @@ class QUIC_EXPORT_PRIVATE QpackProgressiveDecoder
~QpackProgressiveDecoder() override;
// Provide a data fragment to decode.
- void Decode(quiche::QuicheStringPiece data);
+ void Decode(absl::string_view data);
// Signal that the entire header block has been received and passed in
// through Decode(). No methods must be called afterwards.
void EndHeaderBlock();
+ // Called on error.
+ void OnError(absl::string_view error_message);
+
// QpackInstructionDecoder::Delegate implementation.
bool OnInstructionDecoded(const QpackInstruction* instruction) override;
- void OnError(quiche::QuicheStringPiece error_message) override;
+ void OnInstructionDecodingError(QpackInstructionDecoder::ErrorCode error_code,
+ absl::string_view error_message) override;
// QpackHeaderTable::Observer implementation.
void OnInsertCountReachedThreshold() override;
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.cc
index b2f15c4ecb3..c7291f7d779 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
QpackReceiveStream::QpackReceiveStream(PendingStream* pending,
@@ -25,7 +25,7 @@ void QpackReceiveStream::OnDataAvailable() {
while (!reading_stopped() && sequencer()->GetReadableRegion(&iov)) {
DCHECK(!sequencer()->IsClosed());
- receiver_->Decode(quiche::QuicheStringPiece(
+ receiver_->Decode(absl::string_view(
reinterpret_cast<const char*>(iov.iov_base), iov.iov_len));
sequencer()->MarkConsumed(iov.iov_len);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream_test.cc
index 8a8064e5a7e..88cb589a67e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream_test.cc
@@ -4,11 +4,11 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_receive_stream.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -64,7 +64,7 @@ class QpackReceiveStreamTest : public QuicTestWithParam<TestParams> {
: GetNthServerInitiatedUnidirectionalStreamId(
session_.transport_version(), 3);
char type[] = {0x03};
- QuicStreamFrame data1(id, false, 0, quiche::QuicheStringPiece(type, 1));
+ QuicStreamFrame data1(id, false, 0, absl::string_view(type, 1));
session_.OnStreamFrame(data1);
qpack_receive_stream_ =
QuicSpdySessionPeer::GetQpackDecoderReceiveStream(&session_);
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count_test.cc
index fce7de9af01..fca16c04745 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count_test.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_required_insert_count.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -50,7 +50,7 @@ struct {
{600, 100, 500}};
TEST(QpackRequiredInsertCountTest, QpackDecodeRequiredInsertCount) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kTestData); ++i) {
const uint64_t required_insert_count = kTestData[i].required_insert_count;
const uint64_t max_entries = kTestData[i].max_entries;
const uint64_t total_number_of_inserts =
@@ -109,7 +109,7 @@ struct {
{601, 100, 500}};
TEST(QpackRequiredInsertCountTest, DecodeRequiredInsertCountError) {
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kInvalidTestData); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kInvalidTestData); ++i) {
uint64_t decoded_required_insert_count = 0;
EXPECT_FALSE(QpackDecodeRequiredInsertCount(
kInvalidTestData[i].encoded_required_insert_count,
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_round_trip_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_round_trip_test.cc
index 8625baa3c5c..46e7e887a15 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_round_trip_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_round_trip_test.cc
@@ -5,11 +5,11 @@
#include <string>
#include <tuple>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
using ::testing::Values;
@@ -23,8 +23,8 @@ class QpackRoundTripTest : public QuicTestWithParam<FragmentMode> {
QpackRoundTripTest() = default;
~QpackRoundTripTest() override = default;
- spdy::SpdyHeaderBlock EncodeThenDecode(
- const spdy::SpdyHeaderBlock& header_list) {
+ spdy::Http2HeaderBlock EncodeThenDecode(
+ const spdy::Http2HeaderBlock& header_list) {
NoopDecoderStreamErrorDelegate decoder_stream_error_delegate;
NoopQpackStreamSenderDelegate encoder_stream_sender_delegate;
QpackEncoder encoder(&decoder_stream_error_delegate);
@@ -55,80 +55,80 @@ INSTANTIATE_TEST_SUITE_P(All,
FragmentMode::kOctetByOctet));
TEST_P(QpackRoundTripTest, Empty) {
- spdy::SpdyHeaderBlock header_list;
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock header_list;
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
TEST_P(QpackRoundTripTest, EmptyName) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "bar";
header_list[""] = "bar";
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
TEST_P(QpackRoundTripTest, EmptyValue) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "";
header_list[""] = "";
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
TEST_P(QpackRoundTripTest, MultipleWithLongEntries) {
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list["foo"] = "bar";
header_list[":path"] = "/";
header_list["foobaar"] = std::string(127, 'Z');
header_list[std::string(1000, 'b')] = std::string(1000, 'c');
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
TEST_P(QpackRoundTripTest, StaticTable) {
{
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[":method"] = "GET";
header_list["accept-encoding"] = "gzip, deflate";
header_list["cache-control"] = "";
header_list["foo"] = "bar";
header_list[":path"] = "/";
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
{
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[":method"] = "POST";
header_list["accept-encoding"] = "brotli";
header_list["cache-control"] = "foo";
header_list["foo"] = "bar";
header_list[":path"] = "/";
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
{
- spdy::SpdyHeaderBlock header_list;
+ spdy::Http2HeaderBlock header_list;
header_list[":method"] = "CONNECT";
header_list["accept-encoding"] = "";
header_list["foo"] = "bar";
header_list[":path"] = "/";
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
}
TEST_P(QpackRoundTripTest, ValueHasNullCharacter) {
- spdy::SpdyHeaderBlock header_list;
- header_list["foo"] = quiche::QuicheStringPiece("bar\0bar\0baz", 11);
+ spdy::Http2HeaderBlock header_list;
+ header_list["foo"] = absl::string_view("bar\0bar\0baz", 11);
- spdy::SpdyHeaderBlock output = EncodeThenDecode(header_list);
+ spdy::Http2HeaderBlock output = EncodeThenDecode(header_list);
EXPECT_EQ(header_list, output);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.cc
index 176c431afb9..d6919d73600 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h"
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
QpackSendStream::QpackSendStream(QuicStreamId id,
@@ -27,7 +27,7 @@ bool QpackSendStream::OnStopSending(QuicRstStreamErrorCode /* code */) {
return false;
}
-void QpackSendStream::WriteStreamData(quiche::QuicheStringPiece data) {
+void QpackSendStream::WriteStreamData(absl::string_view data) {
QuicConnection::ScopedPacketFlusher flusher(session()->connection());
MaybeSendStreamType();
WriteOrBufferData(data, false, nullptr);
@@ -36,10 +36,10 @@ void QpackSendStream::WriteStreamData(quiche::QuicheStringPiece data) {
void QpackSendStream::MaybeSendStreamType() {
if (!stream_type_sent_) {
char type[sizeof(http3_stream_type_)];
- QuicDataWriter writer(QUICHE_ARRAYSIZE(type), type);
+ QuicDataWriter writer(ABSL_ARRAYSIZE(type), type);
writer.WriteVarInt62(http3_stream_type_);
- WriteOrBufferData(quiche::QuicheStringPiece(writer.data(), writer.length()),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(writer.data(), writer.length()), false,
+ nullptr);
stream_type_sent_ = true;
}
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h
index e8a4ea797d2..d7f68ee887b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h
@@ -7,10 +7,10 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h"
#include "net/third_party/quiche/src/quic/core/quic_stream.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -41,7 +41,7 @@ class QUIC_EXPORT_PRIVATE QpackSendStream : public QuicStream,
// Writes the instructions to peer. The stream type will be sent
// before the first instruction so that the peer can open an qpack stream.
- void WriteStreamData(quiche::QuicheStringPiece data) override;
+ void WriteStreamData(absl::string_view data) override;
// TODO(b/112770235): Remove this method once QuicStreamIdManager supports
// creating HTTP/3 unidirectional streams dynamically.
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream_test.cc
index 2ac3289d476..80c89863062 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_send_stream_test.cc
@@ -4,6 +4,8 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_send_stream.h"
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/http_constants.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_config_peer.h"
@@ -11,7 +13,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_session_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -69,6 +70,9 @@ class QpackSendStreamTest : public QuicTestWithParam<TestParams> {
session_(connection_) {
EXPECT_CALL(session_, OnCongestionWindowChange(_)).Times(AnyNumber());
session_.Initialize();
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
if (connection_->version().SupportsAntiAmplificationLimit()) {
QuicConnectionPeer::SetAddressValidated(connection_);
}
@@ -104,10 +108,10 @@ TEST_P(QpackSendStreamTest, WriteStreamTypeOnlyFirstTime) {
std::string data = "data";
EXPECT_CALL(session_, WritevData(_, 1, _, _, _, _));
EXPECT_CALL(session_, WritevData(_, data.length(), _, _, _, _));
- qpack_send_stream_->WriteStreamData(quiche::QuicheStringPiece(data));
+ qpack_send_stream_->WriteStreamData(absl::string_view(data));
EXPECT_CALL(session_, WritevData(_, data.length(), _, _, _, _));
- qpack_send_stream_->WriteStreamData(quiche::QuicheStringPiece(data));
+ qpack_send_stream_->WriteStreamData(absl::string_view(data));
EXPECT_CALL(session_, WritevData(_, _, _, _, _, _)).Times(0);
qpack_send_stream_->MaybeSendStreamType();
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table.cc
index 17138be94d5..e88abe00026 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table.cc
@@ -4,15 +4,15 @@
#include "net/third_party/quiche/src/quic/core/qpack/qpack_static_table.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
// The "constructor" for a QpackStaticEntry that computes the lengths at
// compile time.
#define STATIC_ENTRY(name, value) \
- { name, QUICHE_ARRAYSIZE(name) - 1, value, QUICHE_ARRAYSIZE(value) - 1 }
+ { name, ABSL_ARRAYSIZE(name) - 1, value, ABSL_ARRAYSIZE(value) - 1 }
const std::vector<QpackStaticEntry>& QpackStaticTableVector() {
static const auto* kQpackStaticTable = new std::vector<QpackStaticEntry>{
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table_test.cc
index 1376d2cd51a..a771cf3862d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_static_table_test.cc
@@ -6,9 +6,9 @@
#include <set>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -32,7 +32,7 @@ TEST(QpackStaticTableTest, Initialize) {
EXPECT_EQ(QpackStaticTableVector().size(), static_index.size());
auto static_name_index = table.GetStaticNameIndex();
- std::set<quiche::QuicheStringPiece> names;
+ std::set<absl::string_view> names;
for (auto entry : static_index) {
names.insert(entry->name());
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_receiver.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_receiver.h
index 01c2d5f4237..d7c4b550b1b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_receiver.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_receiver.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_RECEIVER_H_
#define QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_RECEIVER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -16,7 +16,7 @@ class QUIC_EXPORT_PRIVATE QpackStreamReceiver {
virtual ~QpackStreamReceiver() = default;
// Decode data.
- virtual void Decode(quiche::QuicheStringPiece data) = 0;
+ virtual void Decode(absl::string_view data) = 0;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h
index 524b756653d..9f3faf80bb1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_SENDER_DELEGATE_H_
#define QUICHE_QUIC_CORE_QPACK_QPACK_STREAM_SENDER_DELEGATE_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -16,7 +16,7 @@ class QUIC_EXPORT_PRIVATE QpackStreamSenderDelegate {
virtual ~QpackStreamSenderDelegate() = default;
// Write data on the unidirectional stream.
- virtual void WriteStreamData(quiche::QuicheStringPiece data) = 0;
+ virtual void WriteStreamData(absl::string_view data) = 0;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.cc
index 65d1b99e0a8..c18610939f1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.cc
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
namespace quic {
namespace {
@@ -16,8 +16,8 @@ const char kNonCookieSeparator = '\0';
} // namespace
ValueSplittingHeaderList::const_iterator::const_iterator(
- const spdy::SpdyHeaderBlock* header_list,
- spdy::SpdyHeaderBlock::const_iterator header_list_iterator)
+ const spdy::Http2HeaderBlock* header_list,
+ spdy::Http2HeaderBlock::const_iterator header_list_iterator)
: header_list_(header_list),
header_list_iterator_(header_list_iterator),
value_start_(0) {
@@ -37,7 +37,7 @@ bool ValueSplittingHeaderList::const_iterator::operator!=(
const ValueSplittingHeaderList::const_iterator&
ValueSplittingHeaderList::const_iterator::operator++() {
- if (value_end_ == quiche::QuicheStringPiece::npos) {
+ if (value_end_ == absl::string_view::npos) {
// This was the last frament within |*header_list_iterator_|,
// move on to the next header element of |header_list_|.
++header_list_iterator_;
@@ -61,15 +61,14 @@ const ValueSplittingHeaderList::value_type*
}
void ValueSplittingHeaderList::const_iterator::UpdateHeaderField() {
- DCHECK(value_start_ != quiche::QuicheStringPiece::npos);
+ DCHECK(value_start_ != absl::string_view::npos);
if (header_list_iterator_ == header_list_->end()) {
return;
}
- const quiche::QuicheStringPiece name = header_list_iterator_->first;
- const quiche::QuicheStringPiece original_value =
- header_list_iterator_->second;
+ const absl::string_view name = header_list_iterator_->first;
+ const absl::string_view original_value = header_list_iterator_->second;
if (name == kCookieKey) {
value_end_ = original_value.find(kCookieSeparator, value_start_);
@@ -77,12 +76,12 @@ void ValueSplittingHeaderList::const_iterator::UpdateHeaderField() {
value_end_ = original_value.find(kNonCookieSeparator, value_start_);
}
- const quiche::QuicheStringPiece value =
+ const absl::string_view value =
original_value.substr(value_start_, value_end_ - value_start_);
header_field_ = std::make_pair(name, value);
// Skip character after ';' separator if it is a space.
- if (name == kCookieKey && value_end_ != quiche::QuicheStringPiece::npos &&
+ if (name == kCookieKey && value_end_ != absl::string_view::npos &&
value_end_ + 1 < original_value.size() &&
original_value[value_end_ + 1] == kOptionalSpaceAfterCookieSeparator) {
++value_end_;
@@ -90,7 +89,7 @@ void ValueSplittingHeaderList::const_iterator::UpdateHeaderField() {
}
ValueSplittingHeaderList::ValueSplittingHeaderList(
- const spdy::SpdyHeaderBlock* header_list)
+ const spdy::Http2HeaderBlock* header_list)
: header_list_(header_list) {
DCHECK(header_list_);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h b/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h
index 446548a23ab..06518a59075 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h
@@ -5,24 +5,24 @@
#ifndef QUICHE_QUIC_CORE_QPACK_VALUE_SPLITTING_HEADER_LIST_H_
#define QUICHE_QUIC_CORE_QPACK_VALUE_SPLITTING_HEADER_LIST_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace quic {
-// A wrapper class around SpdyHeaderBlock that splits header values along ';'
+// A wrapper class around Http2HeaderBlock that splits header values along ';'
// separators (while also removing optional space following separator) for
// cookies and along '\0' separators for other header fields.
class QUIC_EXPORT_PRIVATE ValueSplittingHeaderList {
public:
- using value_type = spdy::SpdyHeaderBlock::value_type;
+ using value_type = spdy::Http2HeaderBlock::value_type;
class QUIC_EXPORT_PRIVATE const_iterator {
public:
// |header_list| must outlive this object.
- const_iterator(const spdy::SpdyHeaderBlock* header_list,
- spdy::SpdyHeaderBlock::const_iterator header_list_iterator);
+ const_iterator(const spdy::Http2HeaderBlock* header_list,
+ spdy::Http2HeaderBlock::const_iterator header_list_iterator);
const_iterator(const const_iterator&) = default;
const_iterator& operator=(const const_iterator&) = delete;
@@ -38,15 +38,15 @@ class QUIC_EXPORT_PRIVATE ValueSplittingHeaderList {
// Find next separator; update |value_end_| and |header_field_|.
void UpdateHeaderField();
- const spdy::SpdyHeaderBlock* const header_list_;
- spdy::SpdyHeaderBlock::const_iterator header_list_iterator_;
- quiche::QuicheStringPiece::size_type value_start_;
- quiche::QuicheStringPiece::size_type value_end_;
+ const spdy::Http2HeaderBlock* const header_list_;
+ spdy::Http2HeaderBlock::const_iterator header_list_iterator_;
+ absl::string_view::size_type value_start_;
+ absl::string_view::size_type value_end_;
value_type header_field_;
};
// |header_list| must outlive this object.
- explicit ValueSplittingHeaderList(const spdy::SpdyHeaderBlock* header_list);
+ explicit ValueSplittingHeaderList(const spdy::Http2HeaderBlock* header_list);
ValueSplittingHeaderList(const ValueSplittingHeaderList&) = delete;
ValueSplittingHeaderList& operator=(const ValueSplittingHeaderList&) = delete;
@@ -54,7 +54,7 @@ class QUIC_EXPORT_PRIVATE ValueSplittingHeaderList {
const_iterator end() const;
private:
- const spdy::SpdyHeaderBlock* const header_list_;
+ const spdy::Http2HeaderBlock* const header_list_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list_test.cc b/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list_test.cc
index c1da85c8cd0..0fc04ccbf56 100644
--- a/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list_test.cc
@@ -4,9 +4,9 @@
#include "net/third_party/quiche/src/quic/core/qpack/value_splitting_header_list.h"
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -16,8 +16,8 @@ using ::testing::ElementsAre;
using ::testing::Pair;
TEST(ValueSplittingHeaderListTest, Comparison) {
- spdy::SpdyHeaderBlock block;
- block["foo"] = quiche::QuicheStringPiece("bar\0baz", 7);
+ spdy::Http2HeaderBlock block;
+ block["foo"] = absl::string_view("bar\0baz", 7);
block["baz"] = "qux";
block["cookie"] = "foo; bar";
@@ -75,7 +75,7 @@ TEST(ValueSplittingHeaderListTest, Comparison) {
}
TEST(ValueSplittingHeaderListTest, Empty) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
ValueSplittingHeaderList headers(&block);
EXPECT_THAT(headers, ElementsAre());
@@ -85,7 +85,7 @@ TEST(ValueSplittingHeaderListTest, Empty) {
TEST(ValueSplittingHeaderListTest, Split) {
struct {
const char* name;
- quiche::QuicheStringPiece value;
+ absl::string_view value;
std::vector<const char*> expected_values;
} kTestData[]{
// Empty value.
@@ -113,8 +113,8 @@ TEST(ValueSplittingHeaderListTest, Split) {
{"cookie", "; foobar; ", {"", "foobar", ""}},
};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(kTestData); ++i) {
- spdy::SpdyHeaderBlock block;
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(kTestData); ++i) {
+ spdy::Http2HeaderBlock block;
block[kTestData[i].name] = kTestData[i].value;
ValueSplittingHeaderList headers(&block);
@@ -130,10 +130,10 @@ TEST(ValueSplittingHeaderListTest, Split) {
}
TEST(ValueSplittingHeaderListTest, MultipleFields) {
- spdy::SpdyHeaderBlock block;
- block["foo"] = quiche::QuicheStringPiece("bar\0baz\0", 8);
+ spdy::Http2HeaderBlock block;
+ block["foo"] = absl::string_view("bar\0baz\0", 8);
block["cookie"] = "foo; bar";
- block["bar"] = quiche::QuicheStringPiece("qux\0foo", 7);
+ block["bar"] = absl::string_view("qux\0foo", 7);
ValueSplittingHeaderList headers(&block);
EXPECT_THAT(headers, ElementsAre(Pair("foo", "bar"), Pair("foo", "baz"),
@@ -143,7 +143,7 @@ TEST(ValueSplittingHeaderListTest, MultipleFields) {
}
TEST(ValueSplittingHeaderListTest, CookieStartsWithSpace) {
- spdy::SpdyHeaderBlock block;
+ spdy::Http2HeaderBlock block;
block["foo"] = "bar";
block["cookie"] = " foo";
block["bar"] = "baz";
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_arena_scoped_ptr.h b/chromium/net/third_party/quiche/src/quic/core/quic_arena_scoped_ptr.h
index 92da3dbc9de..fdd0c2928b7 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_arena_scoped_ptr.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_arena_scoped_ptr.h
@@ -13,7 +13,6 @@
#include <cstdint> // for uintptr_t
-#include "net/third_party/quiche/src/quic/platform/api/quic_aligned.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
@@ -21,7 +20,7 @@ namespace quic {
template <typename T>
class QUIC_NO_EXPORT QuicArenaScopedPtr {
- static_assert(QUIC_ALIGN_OF(T*) > 1,
+ static_assert(alignof(T*) > 1,
"QuicArenaScopedPtr can only store objects that are aligned to "
"greater than 1 byte.");
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.cc b/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.cc
index ad2c03289a6..144a1765d62 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.cc
@@ -7,8 +7,8 @@
#include <cinttypes>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.h b/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.h
index e3e0cd1d8ba..97de22c9dcf 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth.h
@@ -17,6 +17,7 @@
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
namespace quic {
@@ -54,8 +55,23 @@ class QUIC_EXPORT_PRIVATE QuicBandwidth {
// Create a new QuicBandwidth based on the bytes per the elapsed delta.
static inline QuicBandwidth FromBytesAndTimeDelta(QuicByteCount bytes,
QuicTime::Delta delta) {
- return QuicBandwidth((8 * bytes * kNumMicrosPerSecond) /
- delta.ToMicroseconds());
+ if (!GetQuicReloadableFlag(quic_round_up_tiny_bandwidth)) {
+ return QuicBandwidth((8 * bytes * kNumMicrosPerSecond) /
+ delta.ToMicroseconds());
+ }
+
+ if (bytes == 0) {
+ return QuicBandwidth(0);
+ }
+
+ // 1 bit is 1000000 micro bits.
+ int64_t num_micro_bits = 8 * bytes * kNumMicrosPerSecond;
+ if (num_micro_bits < delta.ToMicroseconds()) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_round_up_tiny_bandwidth);
+ return QuicBandwidth(1);
+ }
+
+ return QuicBandwidth(num_micro_bits / delta.ToMicroseconds());
}
inline int64_t ToBitsPerSecond() const { return bits_per_second_; }
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth_test.cc
index 005eef07f8f..0a32e4e9104 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_bandwidth_test.cc
@@ -58,6 +58,18 @@ TEST_F(QuicBandwidthTest, TimeDelta) {
EXPECT_EQ(QuicBandwidth::FromKBytesPerSecond(10),
QuicBandwidth::FromBytesAndTimeDelta(
1000, QuicTime::Delta::FromMilliseconds(100)));
+
+ EXPECT_EQ(QuicBandwidth::Zero(), QuicBandwidth::FromBytesAndTimeDelta(
+ 0, QuicTime::Delta::FromSeconds(9)));
+
+ if (GetQuicReloadableFlag(quic_round_up_tiny_bandwidth)) {
+ EXPECT_EQ(QuicBandwidth::FromBitsPerSecond(1),
+ QuicBandwidth::FromBytesAndTimeDelta(
+ 1, QuicTime::Delta::FromSeconds(9)));
+ } else {
+ EXPECT_EQ(QuicBandwidth::Zero(), QuicBandwidth::FromBytesAndTimeDelta(
+ 1, QuicTime::Delta::FromSeconds(9)));
+ }
}
TEST_F(QuicBandwidthTest, Scale) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.cc b/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.cc
index a90cef6d324..6de1ab0cfe0 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.cc
@@ -12,9 +12,9 @@
namespace quic {
-typedef QuicBufferedPacketStore::BufferedPacket BufferedPacket;
-typedef QuicBufferedPacketStore::BufferedPacketList BufferedPacketList;
-typedef QuicBufferedPacketStore::EnqueuePacketResult EnqueuePacketResult;
+using BufferedPacket = QuicBufferedPacketStore::BufferedPacket;
+using BufferedPacketList = QuicBufferedPacketStore::BufferedPacketList;
+using EnqueuePacketResult = QuicBufferedPacketStore::EnqueuePacketResult;
// Max number of connections this store can keep track.
static const size_t kDefaultMaxConnectionsInStore = 100;
@@ -100,7 +100,7 @@ EnqueuePacketResult QuicBufferedPacketStore::EnqueuePacket(
const bool is_first_packet =
!QuicContainsKey(undecryptable_packets_, connection_id);
if (is_first_packet) {
- if (ShouldBufferPacket(is_chlo)) {
+ if (ShouldNotBufferPacket(is_chlo)) {
// Drop the packet if the upper limit of undecryptable packets has been
// reached or the whole capacity of the store has been reached.
return TOO_MANY_CONNECTIONS;
@@ -217,7 +217,7 @@ void QuicBufferedPacketStore::MaybeSetExpirationAlarm() {
}
}
-bool QuicBufferedPacketStore::ShouldBufferPacket(bool is_chlo) {
+bool QuicBufferedPacketStore::ShouldNotBufferPacket(bool is_chlo) {
bool is_store_full =
undecryptable_packets_.size() >= kDefaultMaxConnectionsInStore;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.h b/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.h
index b862b42ee4f..7cb179d6d95 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store.h
@@ -77,10 +77,9 @@ class QUIC_NO_EXPORT QuicBufferedPacketStore {
TlsChloExtractor tls_chlo_extractor;
};
- typedef QuicLinkedHashMap<QuicConnectionId,
- BufferedPacketList,
- QuicConnectionIdHash>
- BufferedPacketMap;
+ using BufferedPacketMap = QuicLinkedHashMap<QuicConnectionId,
+ BufferedPacketList,
+ QuicConnectionIdHash>;
class QUIC_NO_EXPORT VisitorInterface {
public:
@@ -166,7 +165,7 @@ class QUIC_NO_EXPORT QuicBufferedPacketStore {
// Return true if add an extra packet will go beyond allowed max connection
// limit. The limit for non-CHLO packet and CHLO packet is different.
- bool ShouldBufferPacket(bool is_chlo);
+ bool ShouldNotBufferPacket(bool is_chlo);
// A map to store packet queues with creation time for each connection.
BufferedPacketMap undecryptable_packets_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store_test.cc
index 85e4e5db79e..ffb7b5f196b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_buffered_packet_store_test.cc
@@ -15,10 +15,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
namespace quic {
-
-typedef QuicBufferedPacketStore::BufferedPacket BufferedPacket;
-typedef QuicBufferedPacketStore::EnqueuePacketResult EnqueuePacketResult;
-
static const size_t kDefaultMaxConnectionsInStore = 100;
static const size_t kMaxConnectionsWithoutCHLO =
kDefaultMaxConnectionsInStore / 2;
@@ -26,9 +22,9 @@ static const size_t kMaxConnectionsWithoutCHLO =
namespace test {
namespace {
-typedef QuicBufferedPacketStore::BufferedPacket BufferedPacket;
-typedef QuicBufferedPacketStore::BufferedPacketList BufferedPacketList;
-
+using BufferedPacket = QuicBufferedPacketStore::BufferedPacket;
+using BufferedPacketList = QuicBufferedPacketStore::BufferedPacketList;
+using EnqueuePacketResult = QuicBufferedPacketStore::EnqueuePacketResult;
class QuicBufferedPacketStoreVisitor
: public QuicBufferedPacketStore::VisitorInterface {
public:
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_circular_deque_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_circular_deque_test.cc
index 19005f694e2..f2e14a26530 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_circular_deque_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_circular_deque_test.cc
@@ -20,7 +20,7 @@ namespace {
template <typename T, template <typename> class BaseAllocator = std::allocator>
class CountingAllocator : public BaseAllocator<T> {
- typedef BaseAllocator<T> BaseType;
+ using BaseType = BaseAllocator<T>;
public:
using propagate_on_container_copy_assignment = std::true_type;
@@ -582,7 +582,7 @@ TEST_F(QuicCircularDequeTest, RelocateNonTriviallyCopyable) {
{
// Move construct in Relocate.
- typedef std::unique_ptr<Foo> MoveConstructible;
+ using MoveConstructible = std::unique_ptr<Foo>;
ASSERT_FALSE(std::is_trivially_copyable<MoveConstructible>::value);
ASSERT_TRUE(std::is_move_constructible<MoveConstructible>::value);
QuicCircularDeque<MoveConstructible, 3,
@@ -603,7 +603,7 @@ TEST_F(QuicCircularDequeTest, RelocateNonTriviallyCopyable) {
{
// Copy construct in Relocate.
- typedef Foo NonMoveConstructible;
+ using NonMoveConstructible = Foo;
ASSERT_FALSE(std::is_trivially_copyable<NonMoveConstructible>::value);
ASSERT_FALSE(std::is_move_constructible<NonMoveConstructible>::value);
QuicCircularDeque<NonMoveConstructible, 3,
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_config.cc b/chromium/net/third_party/quiche/src/quic/core/quic_config.cc
index bac4e181c20..20dcb902318 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_config.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_config.cc
@@ -10,6 +10,8 @@
#include <string>
#include <utility>
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
@@ -20,10 +22,8 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -411,7 +411,7 @@ QuicErrorCode QuicFixedSocketAddress::ProcessPeerHello(
const CryptoHandshakeMessage& peer_hello,
HelloType /*hello_type*/,
std::string* error_details) {
- quiche::QuicheStringPiece address;
+ absl::string_view address;
if (!peer_hello.GetStringPiece(tag_, &address)) {
if (presence_ == PRESENCE_REQUIRED) {
*error_details = "Missing " + QuicTagToString(tag_);
@@ -448,6 +448,8 @@ QuicConfig::QuicConfig()
initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL),
connection_migration_disabled_(kNCMR, PRESENCE_OPTIONAL),
support_handshake_done_(0, PRESENCE_OPTIONAL),
+ key_update_supported_remotely_(false),
+ key_update_supported_locally_(false),
alternate_server_address_ipv6_(kASAD, PRESENCE_OPTIONAL),
alternate_server_address_ipv4_(kASAD, PRESENCE_OPTIONAL),
stateless_reset_token_(kSRST, PRESENCE_OPTIONAL),
@@ -863,6 +865,22 @@ bool QuicConfig::PeerSupportsHandshakeDone() const {
return support_handshake_done_.HasReceivedValue();
}
+void QuicConfig::SetKeyUpdateSupportedLocally() {
+ key_update_supported_locally_ = true;
+}
+
+bool QuicConfig::KeyUpdateSupportedForConnection() const {
+ return KeyUpdateSupportedRemotely() && KeyUpdateSupportedLocally();
+}
+
+bool QuicConfig::KeyUpdateSupportedLocally() const {
+ return key_update_supported_locally_;
+}
+
+bool QuicConfig::KeyUpdateSupportedRemotely() const {
+ return key_update_supported_remotely_;
+}
+
void QuicConfig::SetIPv6AlternateServerAddressToSend(
const QuicSocketAddress& alternate_server_address_ipv6) {
if (!alternate_server_address_ipv6.host().IsIPv6()) {
@@ -1228,8 +1246,7 @@ bool QuicConfig::FillTransportParameters(TransportParameters* params) const {
params->google_connection_options = connection_options_.GetSendValues();
}
- if (GetQuicReloadableFlag(quic_send_key_update_not_yet_supported)) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_send_key_update_not_yet_supported);
+ if (!KeyUpdateSupportedLocally()) {
params->key_update_not_yet_supported = true;
}
@@ -1339,6 +1356,9 @@ QuicErrorCode QuicConfig::ProcessTransportParameters(
if (params.support_handshake_done) {
support_handshake_done_.SetReceivedValue(1u);
}
+ if (!is_resumption && !params.key_update_not_yet_supported) {
+ key_update_supported_remotely_ = true;
+ }
active_connection_id_limit_.SetReceivedValue(
params.active_connection_id_limit.value());
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_config.h b/chromium/net/third_party/quiche/src/quic/core/quic_config.h
index 4132987fb95..6e9eee12807 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_config.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_config.h
@@ -9,13 +9,13 @@
#include <cstdint>
#include <string>
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/crypto/transport_parameters.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
namespace quic {
@@ -27,7 +27,7 @@ class CryptoHandshakeMessage;
// Describes whether or not a given QuicTag is required or optional in the
// handshake message.
-enum QuicConfigPresence {
+enum QuicConfigPresence : uint8_t {
// This negotiable value can be absent from the handshake message. Default
// value is selected as the negotiated value in such a case.
PRESENCE_OPTIONAL,
@@ -91,10 +91,10 @@ class QUIC_EXPORT_PRIVATE QuicFixedUint32 : public QuicConfigValue {
std::string* error_details) override;
private:
- uint32_t send_value_;
bool has_send_value_;
- uint32_t receive_value_;
bool has_receive_value_;
+ uint32_t send_value_;
+ uint32_t receive_value_;
};
// Stores 62bit numbers from handshake messages that unilaterally shared by each
@@ -128,10 +128,10 @@ class QUIC_EXPORT_PRIVATE QuicFixedUint62 : public QuicConfigValue {
std::string* error_details) override;
private:
- uint64_t send_value_;
bool has_send_value_;
- uint64_t receive_value_;
bool has_receive_value_;
+ uint64_t send_value_;
+ uint64_t receive_value_;
};
// Stores uint128 from CHLO or SHLO messages that are not negotiated.
@@ -161,10 +161,10 @@ class QUIC_EXPORT_PRIVATE QuicFixedUint128 : public QuicConfigValue {
std::string* error_details) override;
private:
- QuicUint128 send_value_;
bool has_send_value_;
- QuicUint128 receive_value_;
bool has_receive_value_;
+ QuicUint128 send_value_;
+ QuicUint128 receive_value_;
};
// Stores tag from CHLO or SHLO messages that are not negotiated.
@@ -197,10 +197,10 @@ class QUIC_EXPORT_PRIVATE QuicFixedTagVector : public QuicConfigValue {
std::string* error_details) override;
private:
- QuicTagVector send_values_;
bool has_send_values_;
- QuicTagVector receive_values_;
bool has_receive_values_;
+ QuicTagVector send_values_;
+ QuicTagVector receive_values_;
};
// Stores QuicSocketAddress from CHLO or SHLO messages that are not negotiated.
@@ -228,10 +228,10 @@ class QUIC_EXPORT_PRIVATE QuicFixedSocketAddress : public QuicConfigValue {
std::string* error_details) override;
private:
- QuicSocketAddress send_value_;
bool has_send_value_;
- QuicSocketAddress receive_value_;
bool has_receive_value_;
+ QuicSocketAddress send_value_;
+ QuicSocketAddress receive_value_;
};
// QuicConfig contains non-crypto configuration options that are negotiated in
@@ -387,6 +387,12 @@ class QUIC_EXPORT_PRIVATE QuicConfig {
bool HandshakeDoneSupported() const;
bool PeerSupportsHandshakeDone() const;
+ // Key update support.
+ void SetKeyUpdateSupportedLocally();
+ bool KeyUpdateSupportedForConnection() const;
+ bool KeyUpdateSupportedLocally() const;
+ bool KeyUpdateSupportedRemotely() const;
+
// IPv6 alternate server address.
void SetIPv6AlternateServerAddressToSend(
const QuicSocketAddress& alternate_server_address_ipv6);
@@ -528,7 +534,7 @@ class QUIC_EXPORT_PRIVATE QuicConfig {
// Note that received_max_idle_timeout_ is only populated if we receive the
// peer's value, which isn't guaranteed in IETF QUIC as sending is optional.
QuicTime::Delta max_idle_timeout_to_send_;
- quiche::QuicheOptional<QuicTime::Delta> received_max_idle_timeout_;
+ absl::optional<QuicTime::Delta> received_max_idle_timeout_;
// Maximum number of dynamic streams that a Google QUIC connection
// can support or the maximum number of bidirectional streams that
// an IETF QUIC connection can support.
@@ -580,6 +586,13 @@ class QUIC_EXPORT_PRIVATE QuicConfig {
// Uses the support_handshake_done transport parameter in IETF QUIC.
QuicFixedUint32 support_handshake_done_;
+ // Whether key update is supported by the peer. Uses key_update_not_yet
+ // supported transport parameter in IETF QUIC.
+ bool key_update_supported_remotely_;
+
+ // Whether key update is supported locally.
+ bool key_update_supported_locally_;
+
// Alternate server addresses the client could connect to.
// Uses the preferred_address transport parameter in IETF QUIC.
// Note that when QUIC_CRYPTO is in use, only one of the addresses is sent.
@@ -628,24 +641,20 @@ class QUIC_EXPORT_PRIVATE QuicConfig {
// Initial packet sent by the client.
// Uses the original_destination_connection_id transport parameter in
// IETF QUIC.
- quiche::QuicheOptional<QuicConnectionId>
- original_destination_connection_id_to_send_;
- quiche::QuicheOptional<QuicConnectionId>
- received_original_destination_connection_id_;
+ absl::optional<QuicConnectionId> original_destination_connection_id_to_send_;
+ absl::optional<QuicConnectionId> received_original_destination_connection_id_;
// The value that the endpoint included in the Source Connection ID field of
// the first Initial packet it sent.
// Uses the initial_source_connection_id transport parameter in IETF QUIC.
- quiche::QuicheOptional<QuicConnectionId>
- initial_source_connection_id_to_send_;
- quiche::QuicheOptional<QuicConnectionId>
- received_initial_source_connection_id_;
+ absl::optional<QuicConnectionId> initial_source_connection_id_to_send_;
+ absl::optional<QuicConnectionId> received_initial_source_connection_id_;
// The value that the server included in the Source Connection ID field of a
// Retry packet it sent.
// Uses the retry_source_connection_id transport parameter in IETF QUIC.
- quiche::QuicheOptional<QuicConnectionId> retry_source_connection_id_to_send_;
- quiche::QuicheOptional<QuicConnectionId> received_retry_source_connection_id_;
+ absl::optional<QuicConnectionId> retry_source_connection_id_to_send_;
+ absl::optional<QuicConnectionId> received_retry_source_connection_id_;
// Custom transport parameters that can be sent and received in the TLS
// handshake.
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_config_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_config_test.cc
index dad24230b1c..f7f1618fe03 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_config_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_config_test.cc
@@ -55,6 +55,9 @@ TEST_P(QuicConfigTest, SetDefaults) {
EXPECT_FALSE(config_.HasReceivedInitialMaxStreamDataBytesUnidirectional());
EXPECT_EQ(kMaxIncomingPacketSize, config_.GetMaxPacketSizeToSend());
EXPECT_FALSE(config_.HasReceivedMaxPacketSize());
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+ EXPECT_FALSE(config_.KeyUpdateSupportedLocally());
+ EXPECT_FALSE(config_.KeyUpdateSupportedRemotely());
}
TEST_P(QuicConfigTest, AutoSetIetfFlowControl) {
@@ -505,8 +508,7 @@ TEST_P(QuicConfigTest, FillTransportParams) {
EXPECT_EQ(
static_cast<uint64_t>(kDefaultMinAckDelayTimeMs) * kNumMicrosPerMilli,
params.min_ack_delay_us.value());
- EXPECT_EQ(params.key_update_not_yet_supported,
- GetQuicReloadableFlag(quic_send_key_update_not_yet_supported));
+ EXPECT_TRUE(params.key_update_not_yet_supported);
}
TEST_P(QuicConfigTest, ProcessTransportParametersServer) {
@@ -674,6 +676,83 @@ TEST_P(QuicConfigTest, DisableMigrationTransportParameter) {
EXPECT_TRUE(config_.DisableConnectionMigration());
}
+TEST_P(QuicConfigTest, KeyUpdateNotYetSupportedTransportParameterNorLocally) {
+ if (!version_.UsesTls()) {
+ // TransportParameters are only used for QUIC+TLS.
+ return;
+ }
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+ EXPECT_FALSE(config_.KeyUpdateSupportedLocally());
+ EXPECT_FALSE(config_.KeyUpdateSupportedRemotely());
+ TransportParameters params;
+ params.key_update_not_yet_supported = true;
+ std::string error_details;
+ EXPECT_THAT(config_.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+ EXPECT_FALSE(config_.KeyUpdateSupportedLocally());
+ EXPECT_FALSE(config_.KeyUpdateSupportedRemotely());
+}
+
+TEST_P(QuicConfigTest, KeyUpdateNotYetSupportedTransportParameter) {
+ if (!version_.UsesTls()) {
+ // TransportParameters are only used for QUIC+TLS.
+ return;
+ }
+ config_.SetKeyUpdateSupportedLocally();
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+ EXPECT_TRUE(config_.KeyUpdateSupportedLocally());
+
+ TransportParameters params;
+ params.key_update_not_yet_supported = true;
+ std::string error_details;
+ EXPECT_THAT(config_.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+ EXPECT_TRUE(config_.KeyUpdateSupportedLocally());
+}
+
+TEST_P(QuicConfigTest, KeyUpdateSupportedRemotelyButNotLocally) {
+ if (!version_.UsesTls()) {
+ // TransportParameters are only used for QUIC+TLS.
+ return;
+ }
+ EXPECT_FALSE(config_.KeyUpdateSupportedLocally());
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+
+ TransportParameters params;
+ params.key_update_not_yet_supported = false;
+ std::string error_details;
+ EXPECT_THAT(config_.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+ EXPECT_FALSE(config_.KeyUpdateSupportedLocally());
+ EXPECT_TRUE(config_.KeyUpdateSupportedRemotely());
+}
+
+TEST_P(QuicConfigTest, KeyUpdateSupported) {
+ if (!version_.UsesTls()) {
+ // TransportParameters are only used for QUIC+TLS.
+ return;
+ }
+ config_.SetKeyUpdateSupportedLocally();
+ EXPECT_TRUE(config_.KeyUpdateSupportedLocally());
+ EXPECT_FALSE(config_.KeyUpdateSupportedForConnection());
+
+ TransportParameters params;
+ params.key_update_not_yet_supported = false;
+ std::string error_details;
+ EXPECT_THAT(config_.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ EXPECT_TRUE(config_.KeyUpdateSupportedForConnection());
+ EXPECT_TRUE(config_.KeyUpdateSupportedLocally());
+ EXPECT_TRUE(config_.KeyUpdateSupportedRemotely());
+}
+
} // namespace
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection.cc b/chromium/net/third_party/quiche/src/quic/core/quic_connection.cc
index e1799817168..845e07871b6 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection.cc
@@ -15,6 +15,8 @@
#include <string>
#include <utility>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_utils.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
@@ -27,6 +29,7 @@
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.h"
#include "net/third_party/quiche/src/quic/core/quic_packet_creator.h"
+#include "net/third_party/quiche/src/quic/core/quic_packet_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
@@ -41,7 +44,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -170,6 +172,24 @@ class ProcessUndecryptablePacketsAlarmDelegate : public QuicAlarm::Delegate {
QuicConnection* connection_;
};
+class DiscardPreviousOneRttKeysAlarmDelegate : public QuicAlarm::Delegate {
+ public:
+ explicit DiscardPreviousOneRttKeysAlarmDelegate(QuicConnection* connection)
+ : connection_(connection) {}
+ DiscardPreviousOneRttKeysAlarmDelegate(
+ const DiscardPreviousOneRttKeysAlarmDelegate&) = delete;
+ DiscardPreviousOneRttKeysAlarmDelegate& operator=(
+ const DiscardPreviousOneRttKeysAlarmDelegate&) = delete;
+
+ void OnAlarm() override {
+ DCHECK(connection_->connected());
+ connection_->DiscardPreviousOneRttKeys();
+ }
+
+ private:
+ QuicConnection* connection_;
+};
+
// When the clearer goes out of scope, the coalesced packet gets cleared.
class ScopedCoalescedPacketClearer {
public:
@@ -211,6 +231,7 @@ CongestionControlType GetDefaultCongestionControlType() {
QuicConnection::QuicConnection(
QuicConnectionId server_connection_id,
+ QuicSocketAddress initial_self_address,
QuicSocketAddress initial_peer_address,
QuicConnectionHelperInterface* helper,
QuicAlarmFactory* alarm_factory,
@@ -237,9 +258,16 @@ QuicConnection::QuicConnection(
server_connection_id_(server_connection_id),
client_connection_id_(EmptyQuicConnectionId()),
client_connection_id_is_set_(false),
+ self_address_(
+ GetQuicReloadableFlag(quic_connection_set_initial_self_address)
+ ? initial_self_address
+ : QuicSocketAddress()),
peer_address_(initial_peer_address),
direct_peer_address_(initial_peer_address),
active_effective_peer_migration_type_(NO_CHANGE),
+ support_key_update_for_connection_(false),
+ enable_aead_limits_(GetQuicReloadableFlag(quic_enable_aead_limits) &&
+ version().UsesTls()),
last_packet_decrypted_(false),
last_size_(0),
current_packet_data_(nullptr),
@@ -257,6 +285,7 @@ QuicConnection::QuicConnection(
ping_timeout_(QuicTime::Delta::FromSeconds(kPingTimeoutSecs)),
initial_retransmittable_on_wire_timeout_(QuicTime::Delta::Infinite()),
consecutive_retransmittable_on_wire_ping_count_(0),
+ retransmittable_on_wire_ping_count_(0),
arena_(),
ack_alarm_(alarm_factory_->CreateAlarm(arena_.New<AckAlarmDelegate>(this),
&arena_)),
@@ -275,6 +304,9 @@ QuicConnection::QuicConnection(
process_undecryptable_packets_alarm_(alarm_factory_->CreateAlarm(
arena_.New<ProcessUndecryptablePacketsAlarmDelegate>(this),
&arena_)),
+ discard_previous_one_rtt_keys_alarm_(alarm_factory_->CreateAlarm(
+ arena_.New<DiscardPreviousOneRttKeysAlarmDelegate>(this),
+ &arena_)),
visitor_(nullptr),
debug_visitor_(nullptr),
packet_creator_(server_connection_id_, &framer_, random_generator_, this),
@@ -317,10 +349,24 @@ QuicConnection::QuicConnection(
clock_->ApproximateNow(),
&arena_,
alarm_factory_),
- support_handshake_done_(version().HasHandshakeDone()) {
+ support_handshake_done_(version().HasHandshakeDone()),
+ encrypted_control_frames_(
+ GetQuicReloadableFlag(quic_encrypted_control_frames) &&
+ packet_creator_.let_connection_handle_pings()),
+ use_encryption_level_context_(
+ encrypted_control_frames_ &&
+ GetQuicReloadableFlag(quic_use_encryption_level_context)) {
QUIC_BUG_IF(!start_peer_migration_earlier_ && send_path_response_);
- if (fix_missing_connected_checks_) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_add_missing_connected_checks);
+ if (GetQuicReloadableFlag(quic_connection_set_initial_self_address)) {
+ DCHECK(perspective_ == Perspective::IS_CLIENT ||
+ self_address_.IsInitialized());
+ QUIC_RELOADABLE_FLAG_COUNT(quic_connection_set_initial_self_address);
+ }
+ if (enable_aead_limits_) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_enable_aead_limits);
+ }
+ if (use_encryption_level_context_) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_use_encryption_level_context);
}
QUIC_DLOG(INFO) << ENDPOINT << "Created connection with server connection ID "
<< server_connection_id
@@ -336,6 +382,8 @@ QuicConnection::QuicConnection(
// TODO(ianswett): Supply the NetworkChangeVisitor as a constructor argument
// and make it required non-null, because it's always used.
sent_packet_manager_.SetNetworkChangeVisitor(this);
+ sent_packet_manager_.ReserveUnackedPacketsInitialCapacity(
+ GetUnackedMapInitialCapacity());
if (GetQuicRestartFlag(quic_offload_pacing_to_usps2)) {
sent_packet_manager_.SetPacingAlarmGranularity(QuicTime::Delta::Zero());
release_time_into_future_ =
@@ -533,8 +581,7 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
config.IdleNetworkTimeout());
idle_timeout_connection_close_behavior_ =
ConnectionCloseBehavior::SILENT_CLOSE;
- if (GetQuicReloadableFlag(quic_add_silent_idle_timeout) &&
- perspective_ == Perspective::IS_SERVER) {
+ if (perspective_ == Perspective::IS_SERVER) {
idle_timeout_connection_close_behavior_ = ConnectionCloseBehavior::
SILENT_CLOSE_WITH_CONNECTION_CLOSE_PACKET_SERIALIZED;
}
@@ -545,6 +592,10 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
if (!ValidateConfigConnectionIds(config)) {
return;
}
+ support_key_update_for_connection_ =
+ config.KeyUpdateSupportedForConnection();
+ framer_.SetKeyUpdateSupportForConnection(
+ support_key_update_for_connection_);
} else {
SetNetworkTimeouts(config.max_time_before_crypto_handshake(),
config.max_idle_time_before_crypto_handshake());
@@ -554,6 +605,10 @@ void QuicConnection::SetFromConfig(const QuicConfig& config) {
}
sent_packet_manager_.SetFromConfig(config);
+ if (perspective_ == Perspective::IS_SERVER &&
+ config.HasClientSentConnectionOption(kAFF2, perspective_)) {
+ send_ack_frequency_on_handshake_completion_ = true;
+ }
if (config.HasReceivedBytesForConnectionId() &&
can_truncate_connection_ids_) {
packet_creator_.SetServerConnectionIdLength(
@@ -690,7 +745,7 @@ bool QuicConnection::MaybeTestLiveness() {
}
const QuicTime now = clock_->ApproximateNow();
if (now > idle_network_deadline) {
- QUIC_BUG << "Idle network deadline has passed";
+ QUIC_DLOG(WARNING) << "Idle network deadline has passed";
return false;
}
const QuicTime::Delta timeout = idle_network_deadline - now;
@@ -878,12 +933,11 @@ void QuicConnection::OnVersionNegotiationPacket(
}
// Handles retry for client connection.
-void QuicConnection::OnRetryPacket(
- QuicConnectionId original_connection_id,
- QuicConnectionId new_connection_id,
- quiche::QuicheStringPiece retry_token,
- quiche::QuicheStringPiece retry_integrity_tag,
- quiche::QuicheStringPiece retry_without_tag) {
+void QuicConnection::OnRetryPacket(QuicConnectionId original_connection_id,
+ QuicConnectionId new_connection_id,
+ absl::string_view retry_token,
+ absl::string_view retry_integrity_tag,
+ absl::string_view retry_without_tag) {
DCHECK_EQ(Perspective::IS_CLIENT, perspective_);
if (version().HasRetryIntegrityTag()) {
if (!CryptoUtils::ValidateRetryIntegrityTag(
@@ -897,21 +951,20 @@ void QuicConnection::OnRetryPacket(
QUIC_DLOG(ERROR) << "Ignoring RETRY with original connection ID "
<< original_connection_id << " not matching expected "
<< server_connection_id_ << " token "
- << quiche::QuicheTextUtils::HexEncode(retry_token);
+ << absl::BytesToHexString(retry_token);
return;
}
}
if (drop_incoming_retry_packets_) {
QUIC_DLOG(ERROR) << "Ignoring RETRY with token "
- << quiche::QuicheTextUtils::HexEncode(retry_token);
+ << absl::BytesToHexString(retry_token);
return;
}
drop_incoming_retry_packets_ = true;
stats_.retry_packet_processed = true;
QUIC_DLOG(INFO) << "Received RETRY, replacing connection ID "
<< server_connection_id_ << " with " << new_connection_id
- << ", received token "
- << quiche::QuicheTextUtils::HexEncode(retry_token);
+ << ", received token " << absl::BytesToHexString(retry_token);
if (!original_destination_connection_id_.has_value()) {
original_destination_connection_id_ = server_connection_id_;
}
@@ -1094,10 +1147,20 @@ bool QuicConnection::HasPendingAcks() const {
void QuicConnection::OnDecryptedPacket(EncryptionLevel level) {
last_decrypted_packet_level_ = level;
last_packet_decrypted_ = true;
- if (EnforceAntiAmplificationLimit() &&
- last_decrypted_packet_level_ >= ENCRYPTION_HANDSHAKE) {
- // Address is validated by successfully processing a HANDSHAKE packet.
- address_validated_ = true;
+ if (EnforceAntiAmplificationLimit()) {
+ bool address_validated =
+ last_decrypted_packet_level_ >= ENCRYPTION_HANDSHAKE;
+ if (GetQuicReloadableFlag(quic_fix_address_validation)) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_fix_address_validation);
+ address_validated =
+ (last_decrypted_packet_level_ == ENCRYPTION_HANDSHAKE ||
+ last_decrypted_packet_level_ == ENCRYPTION_FORWARD_SECURE);
+ }
+ if (address_validated) {
+ // Address is validated by successfully processing a HANDSHAKE or 1-RTT
+ // packet.
+ address_validated_ = true;
+ }
}
idle_network_detector_.OnPacketReceived(time_of_last_received_packet_);
@@ -1113,7 +1176,8 @@ QuicSocketAddress QuicConnection::GetEffectivePeerAddressFromCurrentPacket()
bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
if (debug_visitor_ != nullptr) {
- debug_visitor_->OnPacketHeader(header);
+ debug_visitor_->OnPacketHeader(header, clock_->ApproximateNow(),
+ last_decrypted_packet_level_);
}
// Will be decremented below if we fall through to return true.
@@ -1681,7 +1745,7 @@ bool QuicConnection::OnMessageFrame(const QuicMessageFrame& frame) {
}
MaybeUpdateAckTimeout();
visitor_->OnMessageReceived(
- quiche::QuicheStringPiece(frame.data, frame.message_length));
+ absl::string_view(frame.data, frame.message_length));
return connected_;
}
@@ -1714,6 +1778,9 @@ bool QuicConnection::OnHandshakeDoneFrame(const QuicHandshakeDoneFrame& frame) {
}
bool QuicConnection::OnAckFrequencyFrame(const QuicAckFrequencyFrame& frame) {
+ if (debug_visitor_ != nullptr) {
+ debug_visitor_->OnAckFrequencyFrame(frame);
+ }
UpdatePacketContent(ACK_FREQUENCY_FRAME);
if (!can_receive_ack_frequency_frame_) {
QUIC_LOG_EVERY_N_SEC(ERROR, 120) << "Get unexpected AckFrequencyFrame.";
@@ -1784,8 +1851,8 @@ void QuicConnection::OnPacketComplete() {
if (!should_last_packet_instigate_acks_) {
uber_received_packet_manager_.MaybeUpdateAckTimeout(
should_last_packet_instigate_acks_, last_decrypted_packet_level_,
- last_header_.packet_number,
- clock_->ApproximateNow(), sent_packet_manager_.GetRttStats());
+ last_header_.packet_number, clock_->ApproximateNow(),
+ sent_packet_manager_.GetRttStats());
}
ClearLastFrames();
@@ -1877,6 +1944,45 @@ void QuicConnection::OnAuthenticatedIetfStatelessResetPacket(
ConnectionCloseSource::FROM_PEER);
}
+void QuicConnection::OnKeyUpdate(KeyUpdateReason reason) {
+ DCHECK(support_key_update_for_connection_);
+ QUIC_DLOG(INFO) << ENDPOINT << "Key phase updated for " << reason;
+
+ lowest_packet_sent_in_current_key_phase_.Clear();
+ stats_.key_update_count++;
+
+ // If another key update triggers while the previous
+ // discard_previous_one_rtt_keys_alarm_ hasn't fired yet, cancel it since the
+ // old keys would already be discarded.
+ discard_previous_one_rtt_keys_alarm_->Cancel();
+
+ visitor_->OnKeyUpdate(reason);
+}
+
+void QuicConnection::OnDecryptedFirstPacketInKeyPhase() {
+ QUIC_DLOG(INFO) << ENDPOINT << "OnDecryptedFirstPacketInKeyPhase";
+ // An endpoint SHOULD retain old read keys for no more than three times the
+ // PTO after having received a packet protected using the new keys. After this
+ // period, old read keys and their corresponding secrets SHOULD be discarded.
+ //
+ // Note that this will cause an unnecessary
+ // discard_previous_one_rtt_keys_alarm_ on the first packet in the 1RTT
+ // encryption level, but this is harmless.
+ discard_previous_one_rtt_keys_alarm_->Set(
+ clock_->ApproximateNow() + sent_packet_manager_.GetPtoDelay() * 3);
+}
+
+std::unique_ptr<QuicDecrypter>
+QuicConnection::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ QUIC_DLOG(INFO) << ENDPOINT << "AdvanceKeysAndCreateCurrentOneRttDecrypter";
+ return visitor_->AdvanceKeysAndCreateCurrentOneRttDecrypter();
+}
+
+std::unique_ptr<QuicEncrypter> QuicConnection::CreateCurrentOneRttEncrypter() {
+ QUIC_DLOG(INFO) << ENDPOINT << "CreateCurrentOneRttEncrypter";
+ return visitor_->CreateCurrentOneRttEncrypter();
+}
+
void QuicConnection::ClearLastFrames() {
should_last_packet_instigate_acks_ = false;
}
@@ -2116,6 +2222,30 @@ void QuicConnection::OnUndecryptablePacket(const QuicEncryptedPacket& packet,
debug_visitor_->OnUndecryptablePacket(decryption_level,
/*dropped=*/!should_enqueue);
}
+
+ if (has_decryption_key) {
+ stats_.num_failed_authentication_packets_received++;
+ if (enable_aead_limits_) {
+ // Should always be non-null if has_decryption_key is true.
+ DCHECK(framer_.GetDecrypter(decryption_level));
+ const QuicPacketCount integrity_limit =
+ framer_.GetDecrypter(decryption_level)->GetIntegrityLimit();
+ QUIC_DVLOG(2) << ENDPOINT << "Checking AEAD integrity limits:"
+ << " num_failed_authentication_packets_received="
+ << stats_.num_failed_authentication_packets_received
+ << " integrity_limit=" << integrity_limit;
+ if (stats_.num_failed_authentication_packets_received >=
+ integrity_limit) {
+ const std::string error_details = quiche::QuicheStrCat(
+ "decrypter integrity limit reached:"
+ " num_failed_authentication_packets_received=",
+ stats_.num_failed_authentication_packets_received,
+ " integrity_limit=", integrity_limit);
+ CloseConnection(QUIC_AEAD_LIMIT_REACHED, error_details,
+ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
+ }
+ }
+ }
}
bool QuicConnection::ShouldEnqueueUnDecryptablePacket(
@@ -2184,8 +2314,8 @@ void QuicConnection::ProcessUdpPacket(const QuicSocketAddress& self_address,
}
QUIC_DVLOG(2) << ENDPOINT << "Received encrypted " << packet.length()
<< " bytes:" << std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
- packet.data(), packet.length()));
+ << quiche::QuicheTextUtils::HexDump(
+ absl::string_view(packet.data(), packet.length()));
QUIC_BUG_IF(current_packet_data_ != nullptr)
<< "ProcessUdpPacket must not be called while processing a packet.";
if (debug_visitor_ != nullptr) {
@@ -2508,12 +2638,7 @@ void QuicConnection::MarkZeroRttPacketsForRetransmission(int reject_reason) {
void QuicConnection::NeuterUnencryptedPackets() {
sent_packet_manager_.NeuterUnencryptedPackets();
- if (!fix_missing_initial_keys_ &&
- GetQuicReloadableFlag(
- quic_neuter_initial_packet_in_coalescer_with_initial_key_discarded) &&
- version().CanSendCoalescedPackets()) {
- QUIC_RELOADABLE_FLAG_COUNT(
- quic_neuter_initial_packet_in_coalescer_with_initial_key_discarded);
+ if (!fix_missing_initial_keys_ && version().CanSendCoalescedPackets()) {
coalesced_packet_.NeuterInitialPacket();
}
// This may have changed the retransmission timer, so re-arm it.
@@ -2545,6 +2670,16 @@ bool QuicConnection::ShouldGeneratePacket(
}
const QuicFrames QuicConnection::MaybeBundleAckOpportunistically() {
+ if (!ack_frequency_sent_ && sent_packet_manager_.CanSendAckFrequency()) {
+ if (packet_creator_.NextSendingPacketNumber() >=
+ FirstSendingPacketNumber() + kMinReceivedBeforeAckDecimation) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_can_send_ack_frequency, 3, 3);
+ ack_frequency_sent_ = true;
+ auto frame = sent_packet_manager_.GetUpdatedAckFrequencyFrame();
+ visitor_->SendAckFrequency(frame);
+ }
+ }
+
QuicFrames frames;
const bool has_pending_ack =
uber_received_packet_manager_
@@ -2678,7 +2813,6 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
termination_packets_->emplace_back(
new QuicEncryptedPacket(buffer_copy, encrypted_length, true));
if (error_code == QUIC_SILENT_IDLE_TIMEOUT) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_add_silent_idle_timeout);
DCHECK_EQ(Perspective::IS_SERVER, perspective_);
// TODO(fayang): populate histogram indicating the time elapsed from this
// connection gets closed to following client packets get received.
@@ -2706,7 +2840,7 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
QUIC_DVLOG(2) << ENDPOINT << packet->encryption_level << " packet number "
<< packet_number << " of length " << encrypted_length << ": "
<< std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
+ << quiche::QuicheTextUtils::HexDump(absl::string_view(
packet->encrypted_buffer, encrypted_length));
// Measure the RTT from before the write begins to avoid underestimating the
@@ -2805,8 +2939,8 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
QuicPacketLength encapsulated_length =
QuicLegacyVersionEncapsulator::Encapsulate(
legacy_version_encapsulation_sni_,
- quiche::QuicheStringPiece(packet->encrypted_buffer,
- packet->encrypted_length),
+ absl::string_view(packet->encrypted_buffer,
+ packet->encrypted_length),
server_connection_id_, framer_.creation_time(),
GetLimitedMaxPacketSize(long_term_mtu_),
const_cast<char*>(packet->encrypted_buffer));
@@ -2819,7 +2953,7 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
<< "Successfully performed Legacy Version Encapsulation on "
<< packet->encryption_level << " packet number " << packet_number
<< " of length " << encrypted_length << ": " << std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
+ << quiche::QuicheTextUtils::HexDump(absl::string_view(
packet->encrypted_buffer, encrypted_length));
} else {
QUIC_BUG << ENDPOINT
@@ -2973,6 +3107,19 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
handshake_packet_sent_ = true;
}
+ if (packet->encryption_level == ENCRYPTION_FORWARD_SECURE) {
+ if (!lowest_packet_sent_in_current_key_phase_.IsInitialized()) {
+ QUIC_DLOG(INFO) << ENDPOINT
+ << "lowest_packet_sent_in_current_key_phase_ = "
+ << packet_number;
+ lowest_packet_sent_in_current_key_phase_ = packet_number;
+ }
+ if (!is_termination_packet &&
+ MaybeHandleAeadConfidentialityLimits(*packet)) {
+ return true;
+ }
+ }
+
if (in_flight || !retransmission_alarm_->IsSet()) {
SetRetransmissionAlarm();
}
@@ -2994,6 +3141,112 @@ bool QuicConnection::WritePacket(SerializedPacket* packet) {
return true;
}
+bool QuicConnection::MaybeHandleAeadConfidentialityLimits(
+ const SerializedPacket& packet) {
+ if (!enable_aead_limits_) {
+ return false;
+ }
+
+ if (packet.encryption_level != ENCRYPTION_FORWARD_SECURE) {
+ QUIC_BUG
+ << "MaybeHandleAeadConfidentialityLimits called on non 1-RTT packet";
+ return false;
+ }
+ if (!lowest_packet_sent_in_current_key_phase_.IsInitialized()) {
+ QUIC_BUG << "lowest_packet_sent_in_current_key_phase_ must be initialized "
+ "before calling MaybeHandleAeadConfidentialityLimits";
+ return false;
+ }
+
+ // Calculate the number of packets encrypted from the packet number, which is
+ // simpler than keeping another counter. The packet number space may be
+ // sparse, so this might overcount, but doing a key update earlier than
+ // necessary would only improve security and has negligible cost.
+ if (packet.packet_number < lowest_packet_sent_in_current_key_phase_) {
+ const std::string error_details = quiche::QuicheStrCat(
+ "packet_number(", packet.packet_number.ToString(),
+ ") < lowest_packet_sent_in_current_key_phase_ (",
+ lowest_packet_sent_in_current_key_phase_.ToString(), ")");
+ QUIC_BUG << error_details;
+ CloseConnection(QUIC_INTERNAL_ERROR, error_details,
+ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
+ return true;
+ }
+ const QuicPacketCount num_packets_encrypted_in_current_key_phase =
+ packet.packet_number - lowest_packet_sent_in_current_key_phase_ + 1;
+
+ const QuicPacketCount confidentiality_limit =
+ framer_.GetOneRttEncrypterConfidentialityLimit();
+
+ // Attempt to initiate a key update before reaching the AEAD
+ // confidentiality limit when the number of packets sent in the current
+ // key phase gets within |kKeyUpdateConfidentialityLimitOffset| packets of
+ // the limit, unless overridden by
+ // FLAGS_quic_key_update_confidentiality_limit.
+ constexpr QuicPacketCount kKeyUpdateConfidentialityLimitOffset = 1000;
+ QuicPacketCount key_update_limit = 0;
+ if (confidentiality_limit > kKeyUpdateConfidentialityLimitOffset) {
+ key_update_limit =
+ confidentiality_limit - kKeyUpdateConfidentialityLimitOffset;
+ }
+ const QuicPacketCount key_update_limit_override =
+ GetQuicFlag(FLAGS_quic_key_update_confidentiality_limit);
+ if (key_update_limit_override) {
+ key_update_limit = key_update_limit_override;
+ }
+
+ QUIC_DVLOG(2) << ENDPOINT << "Checking AEAD confidentiality limits: "
+ << "num_packets_encrypted_in_current_key_phase="
+ << num_packets_encrypted_in_current_key_phase
+ << " key_update_limit=" << key_update_limit
+ << " confidentiality_limit=" << confidentiality_limit
+ << " IsKeyUpdateAllowed()=" << IsKeyUpdateAllowed();
+
+ if (num_packets_encrypted_in_current_key_phase >= confidentiality_limit) {
+ // Reached the confidentiality limit without initiating a key update,
+ // must close the connection.
+ const std::string error_details = quiche::QuicheStrCat(
+ "encrypter confidentiality limit reached: "
+ "num_packets_encrypted_in_current_key_phase=",
+ num_packets_encrypted_in_current_key_phase,
+ " key_update_limit=", key_update_limit,
+ " confidentiality_limit=", confidentiality_limit,
+ " IsKeyUpdateAllowed()=", IsKeyUpdateAllowed());
+ CloseConnection(QUIC_AEAD_LIMIT_REACHED, error_details,
+ ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
+ return true;
+ }
+
+ if (IsKeyUpdateAllowed() &&
+ num_packets_encrypted_in_current_key_phase >= key_update_limit) {
+ // Approaching the confidentiality limit, initiate key update so that
+ // the next set of keys will be ready for the next packet before the
+ // limit is reached.
+ KeyUpdateReason reason = KeyUpdateReason::kLocalAeadConfidentialityLimit;
+ if (key_update_limit_override) {
+ QUIC_DLOG(INFO) << ENDPOINT
+ << "reached FLAGS_quic_key_update_confidentiality_limit, "
+ "initiating key update: "
+ << "num_packets_encrypted_in_current_key_phase="
+ << num_packets_encrypted_in_current_key_phase
+ << " key_update_limit=" << key_update_limit
+ << " confidentiality_limit=" << confidentiality_limit;
+ reason = KeyUpdateReason::kLocalKeyUpdateLimitOverride;
+ } else {
+ QUIC_DLOG(INFO) << ENDPOINT
+ << "approaching AEAD confidentiality limit, "
+ "initiating key update: "
+ << "num_packets_encrypted_in_current_key_phase="
+ << num_packets_encrypted_in_current_key_phase
+ << " key_update_limit=" << key_update_limit
+ << " confidentiality_limit=" << confidentiality_limit;
+ }
+ InitiateKeyUpdate(reason);
+ }
+
+ return false;
+}
+
void QuicConnection::FlushPackets() {
if (!connected_) {
return;
@@ -3189,6 +3442,20 @@ void QuicConnection::OnPathMtuIncreased(QuicPacketLength packet_size) {
void QuicConnection::OnHandshakeComplete() {
sent_packet_manager_.SetHandshakeConfirmed();
+ if (send_ack_frequency_on_handshake_completion_ &&
+ sent_packet_manager_.CanSendAckFrequency()) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_can_send_ack_frequency, 2, 3);
+ auto ack_frequency_frame =
+ sent_packet_manager_.GetUpdatedAckFrequencyFrame();
+ // This AckFrequencyFrame is meant to only update the max_ack_delay. Set
+ // packet tolerance to the default value for now.
+ ack_frequency_frame.packet_tolerance =
+ kDefaultRetransmittablePacketsBeforeAck;
+ visitor_->SendAckFrequency(ack_frequency_frame);
+ if (!connected_) {
+ return;
+ }
+ }
// This may have changed the retransmission timer, so re-arm it.
SetRetransmissionAlarm();
if (default_enable_5rto_blackhole_detection_) {
@@ -3221,7 +3488,13 @@ void QuicConnection::OnPingTimeout() {
!visitor_->ShouldKeepConnectionAlive()) {
return;
}
- visitor_->SendPing();
+ if (packet_creator_.let_connection_handle_pings()) {
+ SendPingAtLevel(use_encryption_level_context_
+ ? framer().GetEncryptionLevelToSendApplicationData()
+ : encryption_level_);
+ } else {
+ visitor_->SendPing();
+ }
}
void QuicConnection::SendAck() {
@@ -3258,7 +3531,7 @@ void QuicConnection::OnRetransmissionTimeout() {
DCHECK(!IsHandshakeComplete());
}
#endif
- if (fix_missing_connected_checks_ && !connected_) {
+ if (!connected_) {
return;
}
@@ -3317,7 +3590,19 @@ void QuicConnection::OnRetransmissionTimeout() {
<< "No packet gets sent when timer fires in mode "
<< retransmission_mode << ", send PING";
DCHECK_LT(0u, sent_packet_manager_.pending_timer_transmission_count());
- visitor_->SendPing();
+ if (packet_creator_.let_connection_handle_pings()) {
+ EncryptionLevel level = encryption_level_;
+ PacketNumberSpace packet_number_space = NUM_PACKET_NUMBER_SPACES;
+ if (SupportsMultiplePacketNumberSpaces() &&
+ sent_packet_manager_
+ .GetEarliestPacketSentTimeForPto(&packet_number_space)
+ .IsInitialized()) {
+ level = QuicUtils::GetEncryptionLevel(packet_number_space);
+ }
+ SendPingAtLevel(level);
+ } else {
+ visitor_->SendPing();
+ }
}
if (retransmission_mode == QuicSentPacketManager::PTO_MODE) {
sent_packet_manager_.AdjustPendingTimerTransmissions();
@@ -3424,6 +3709,36 @@ void QuicConnection::RemoveDecrypter(EncryptionLevel level) {
framer_.RemoveDecrypter(level);
}
+void QuicConnection::DiscardPreviousOneRttKeys() {
+ framer_.DiscardPreviousOneRttKeys();
+}
+
+bool QuicConnection::IsKeyUpdateAllowed() const {
+ return support_key_update_for_connection_ &&
+ GetLargestAckedPacket().IsInitialized() &&
+ lowest_packet_sent_in_current_key_phase_.IsInitialized() &&
+ GetLargestAckedPacket() >= lowest_packet_sent_in_current_key_phase_;
+}
+
+bool QuicConnection::HaveSentPacketsInCurrentKeyPhaseButNoneAcked() const {
+ return lowest_packet_sent_in_current_key_phase_.IsInitialized() &&
+ (!GetLargestAckedPacket().IsInitialized() ||
+ GetLargestAckedPacket() < lowest_packet_sent_in_current_key_phase_);
+}
+
+QuicPacketCount QuicConnection::PotentialPeerKeyUpdateAttemptCount() const {
+ return framer_.PotentialPeerKeyUpdateAttemptCount();
+}
+
+bool QuicConnection::InitiateKeyUpdate(KeyUpdateReason reason) {
+ QUIC_DLOG(INFO) << ENDPOINT << "InitiateKeyUpdate";
+ if (!IsKeyUpdateAllowed()) {
+ QUIC_BUG << "key update not allowed";
+ return false;
+ }
+ return framer_.DoKeyUpdate(reason);
+}
+
const QuicDecrypter* QuicConnection::decrypter() const {
return framer_.decrypter();
}
@@ -3444,6 +3759,9 @@ void QuicConnection::QueueUndecryptablePacket(
}
QUIC_DVLOG(1) << ENDPOINT << "Queueing undecryptable packet.";
undecryptable_packets_.emplace_back(packet, decryption_level);
+ if (perspective_ == Perspective::IS_CLIENT) {
+ SetRetransmissionAlarm();
+ }
}
void QuicConnection::MaybeProcessUndecryptablePackets() {
@@ -3531,6 +3849,9 @@ void QuicConnection::MaybeProcessUndecryptablePackets() {
}
undecryptable_packets_.clear();
}
+ if (perspective_ == Perspective::IS_CLIENT) {
+ SetRetransmissionAlarm();
+ }
}
void QuicConnection::QueueCoalescedPacket(const QuicEncryptedPacket& packet) {
@@ -3596,7 +3917,12 @@ void QuicConnection::SendConnectionClosePacket(QuicErrorCode error,
peer_address());
if (!SupportsMultiplePacketNumberSpaces()) {
QUIC_DLOG(INFO) << ENDPOINT << "Sending connection close packet.";
- SetDefaultEncryptionLevel(GetConnectionCloseEncryptionLevel());
+ if (!use_encryption_level_context_) {
+ SetDefaultEncryptionLevel(GetConnectionCloseEncryptionLevel());
+ }
+ ScopedEncryptionLevelContext context(
+ use_encryption_level_context_ ? this : nullptr,
+ GetConnectionCloseEncryptionLevel());
if (version().CanSendCoalescedPackets()) {
coalesced_packet_.Clear();
}
@@ -3639,7 +3965,11 @@ void QuicConnection::SendConnectionClosePacket(QuicErrorCode error,
}
QUIC_DLOG(INFO) << ENDPOINT
<< "Sending connection close packet at level: " << level;
- SetDefaultEncryptionLevel(level);
+ if (!use_encryption_level_context_) {
+ SetDefaultEncryptionLevel(level);
+ }
+ ScopedEncryptionLevelContext context(
+ use_encryption_level_context_ ? this : nullptr, level);
// Bundle an ACK of the corresponding packet number space for debugging
// purpose.
if (error != QUIC_PACKET_WRITE_ERROR &&
@@ -3650,6 +3980,11 @@ void QuicConnection::SendConnectionClosePacket(QuicErrorCode error,
packet_creator_.FlushAckFrame(frames);
}
+ if (level == ENCRYPTION_FORWARD_SECURE &&
+ perspective_ == Perspective::IS_SERVER) {
+ visitor_->BeforeConnectionCloseSent();
+ }
+
auto* frame =
new QuicConnectionCloseFrame(transport_version(), error, details,
framer_.current_received_frame_type());
@@ -3662,7 +3997,9 @@ void QuicConnection::SendConnectionClosePacket(QuicErrorCode error,
// Since the connection is closing, if the connection close packets were not
// sent, then they should be discarded.
ClearQueuedPackets();
- SetDefaultEncryptionLevel(current_encryption_level);
+ if (!use_encryption_level_context_) {
+ SetDefaultEncryptionLevel(current_encryption_level);
+ }
}
void QuicConnection::TearDownLocalConnectionState(
@@ -3708,6 +4045,7 @@ void QuicConnection::CancelAllAlarms() {
send_alarm_->Cancel();
mtu_discovery_alarm_->Cancel();
process_undecryptable_packets_alarm_->Cancel();
+ discard_previous_one_rtt_keys_alarm_->Cancel();
blackhole_detector_.StopDetection();
idle_network_detector_.StopDetection();
}
@@ -3752,7 +4090,9 @@ void QuicConnection::SetPingAlarm() {
return;
}
if (initial_retransmittable_on_wire_timeout_.IsInfinite() ||
- sent_packet_manager_.HasInFlightPackets()) {
+ sent_packet_manager_.HasInFlightPackets() ||
+ retransmittable_on_wire_ping_count_ >
+ GetQuicFlag(FLAGS_quic_max_retransmittable_on_wire_ping_count)) {
// Extend the ping alarm.
ping_alarm_->Update(clock_->ApproximateNow() + ping_timeout_,
QuicTime::Delta::FromSeconds(1));
@@ -3788,6 +4128,7 @@ void QuicConnection::SetPingAlarm() {
if (max_aggressive_retransmittable_on_wire_ping_count != 0) {
consecutive_retransmittable_on_wire_ping_count_++;
}
+ retransmittable_on_wire_ping_count_++;
return;
}
@@ -3796,7 +4137,7 @@ void QuicConnection::SetPingAlarm() {
}
void QuicConnection::SetRetransmissionAlarm() {
- if (fix_missing_connected_checks_ && !connected_) {
+ if (!connected_) {
if (retransmission_alarm_->IsSet()) {
QUIC_BUG << ENDPOINT << "Retransmission alarm is set while disconnected";
retransmission_alarm_->Cancel();
@@ -3814,8 +4155,7 @@ void QuicConnection::SetRetransmissionAlarm() {
return;
}
- retransmission_alarm_->Update(sent_packet_manager_.GetRetransmissionTime(),
- kAlarmGranularity);
+ retransmission_alarm_->Update(GetRetransmissionDeadline(), kAlarmGranularity);
}
void QuicConnection::MaybeSetMtuAlarm(QuicPacketNumber sent_packet_number) {
@@ -3923,6 +4263,24 @@ QuicConnection::ScopedPacketFlusher::~ScopedPacketFlusher() {
!connection_->packet_creator_.PacketFlusherAttached());
}
+QuicConnection::ScopedEncryptionLevelContext::ScopedEncryptionLevelContext(
+ QuicConnection* connection,
+ EncryptionLevel encryption_level)
+ : connection_(connection), latched_encryption_level_(ENCRYPTION_INITIAL) {
+ if (connection_ == nullptr) {
+ return;
+ }
+ latched_encryption_level_ = connection_->encryption_level_;
+ connection_->SetDefaultEncryptionLevel(encryption_level);
+}
+
+QuicConnection::ScopedEncryptionLevelContext::~ScopedEncryptionLevelContext() {
+ if (connection_ == nullptr || !connection_->connected_) {
+ return;
+ }
+ connection_->SetDefaultEncryptionLevel(latched_encryption_level_);
+}
+
QuicConnection::BufferedPacket::BufferedPacket(
const SerializedPacket& packet,
const QuicSocketAddress& self_address,
@@ -4081,24 +4439,32 @@ bool QuicConnection::SendGenericPathProbePacket(
transmitted_connectivity_probe_payload_ = nullptr;
}
}
-
DCHECK_EQ(IsRetransmittable(*probing_packet), NO_RETRANSMITTABLE_DATA);
+ return WritePacketUsingWriter(std::move(probing_packet), probing_writer,
+ self_address(), peer_address,
+ /*measure_rtt=*/true);
+}
+bool QuicConnection::WritePacketUsingWriter(
+ std::unique_ptr<SerializedPacket> packet,
+ QuicPacketWriter* writer,
+ const QuicSocketAddress& self_address,
+ const QuicSocketAddress& peer_address,
+ bool measure_rtt) {
const QuicTime packet_send_time = clock_->Now();
QUIC_DVLOG(2) << ENDPOINT
<< "Sending path probe packet for server connection ID "
<< server_connection_id_ << std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
- probing_packet->encrypted_buffer,
- probing_packet->encrypted_length));
- WriteResult result = probing_writer->WritePacket(
- probing_packet->encrypted_buffer, probing_packet->encrypted_length,
- self_address().host(), peer_address, per_packet_options_);
+ << quiche::QuicheTextUtils::HexDump(absl::string_view(
+ packet->encrypted_buffer, packet->encrypted_length));
+ WriteResult result = writer->WritePacket(
+ packet->encrypted_buffer, packet->encrypted_length, self_address.host(),
+ peer_address, per_packet_options_);
// If using a batch writer and the probing packet is buffered, flush it.
- if (probing_writer->IsBatchMode() && result.status == WRITE_STATUS_OK &&
+ if (writer->IsBatchMode() && result.status == WRITE_STATUS_OK &&
result.bytes_written == 0) {
- result = probing_writer->Flush();
+ result = writer->Flush();
}
if (IsWriteError(result.status)) {
@@ -4111,14 +4477,14 @@ bool QuicConnection::SendGenericPathProbePacket(
if (!sent_packet_manager_.give_sent_packet_to_debug_visitor_after_sent() &&
debug_visitor_ != nullptr) {
- debug_visitor_->OnPacketSent(
- *probing_packet, probing_packet->transmission_type, packet_send_time);
+ debug_visitor_->OnPacketSent(*packet, packet->transmission_type,
+ packet_send_time);
}
// Send in currrent path. Call OnPacketSent regardless of the write result.
- sent_packet_manager_.OnPacketSent(
- probing_packet.get(), packet_send_time, probing_packet->transmission_type,
- NO_RETRANSMITTABLE_DATA, /*measure_rtt=*/true);
+ sent_packet_manager_.OnPacketSent(packet.get(), packet_send_time,
+ packet->transmission_type,
+ NO_RETRANSMITTABLE_DATA, measure_rtt);
if (sent_packet_manager_.give_sent_packet_to_debug_visitor_after_sent() &&
debug_visitor_ != nullptr) {
@@ -4128,18 +4494,18 @@ bool QuicConnection::SendGenericPathProbePacket(
QUIC_BUG << "Unacked map is empty right after packet is sent";
} else {
debug_visitor_->OnPacketSent(
- probing_packet->packet_number, probing_packet->encrypted_length,
- probing_packet->has_crypto_handshake,
- probing_packet->transmission_type, probing_packet->encryption_level,
+ packet->packet_number, packet->encrypted_length,
+ packet->has_crypto_handshake, packet->transmission_type,
+ packet->encryption_level,
sent_packet_manager_.unacked_packets()
.rbegin()
->retransmittable_frames,
- probing_packet->nonretransmittable_frames, packet_send_time);
+ packet->nonretransmittable_frames, packet_send_time);
}
}
if (IsWriteBlockedStatus(result.status)) {
- if (probing_writer == writer_) {
+ if (writer == writer_) {
// Visitor should not be write blocked if the probing writer is not the
// default packet writer.
visitor_->OnWriteBlocked();
@@ -4222,11 +4588,11 @@ bool QuicConnection::ack_frame_updated() const {
return uber_received_packet_manager_.IsAckFrameUpdated();
}
-quiche::QuicheStringPiece QuicConnection::GetCurrentPacket() {
+absl::string_view QuicConnection::GetCurrentPacket() {
if (current_packet_data_ == nullptr) {
- return quiche::QuicheStringPiece();
+ return absl::string_view();
}
- return quiche::QuicheStringPiece(current_packet_data_, last_size_);
+ return absl::string_view(current_packet_data_, last_size_);
}
bool QuicConnection::MaybeConsiderAsMemoryCorruption(
@@ -4274,8 +4640,7 @@ void QuicConnection::MaybeSendProbingRetransmissions() {
}
void QuicConnection::CheckIfApplicationLimited() {
- if ((fix_missing_connected_checks_ && !connected_) ||
- probing_retransmission_pending_) {
+ if (!connected_ || probing_retransmission_pending_) {
return;
}
@@ -4582,7 +4947,12 @@ void QuicConnection::SendAllPendingAcks() {
<< PacketNumberSpaceToString(
static_cast<PacketNumberSpace>(i));
// Switch to the appropriate encryption level.
- SetDefaultEncryptionLevel(
+ if (!use_encryption_level_context_) {
+ SetDefaultEncryptionLevel(
+ QuicUtils::GetEncryptionLevel(static_cast<PacketNumberSpace>(i)));
+ }
+ ScopedEncryptionLevelContext context(
+ use_encryption_level_context_ ? this : nullptr,
QuicUtils::GetEncryptionLevel(static_cast<PacketNumberSpace>(i)));
QuicFrames frames;
frames.push_back(uber_received_packet_manager_.GetUpdatedAckFrame(
@@ -4598,8 +4968,10 @@ void QuicConnection::SendAllPendingAcks() {
}
ResetAckStates();
}
- // Restores encryption level.
- SetDefaultEncryptionLevel(current_encryption_level);
+ if (!use_encryption_level_context_) {
+ // Restores encryption level.
+ SetDefaultEncryptionLevel(current_encryption_level);
+ }
const QuicTime timeout =
uber_received_packet_manager_.GetEarliestAckTimeout();
@@ -4672,7 +5044,7 @@ void QuicConnection::MaybeCoalescePacketOfHigherSpace() {
bool QuicConnection::FlushCoalescedPacket() {
ScopedCoalescedPacketClearer clearer(&coalesced_packet_);
- if (fix_missing_connected_checks_ && !connected_) {
+ if (!connected_) {
return false;
}
if (!version().CanSendCoalescedPackets()) {
@@ -4773,7 +5145,8 @@ void QuicConnection::MaybeEnableMultiplePacketNumberSpacesSupport() {
<< " supports multiple packet number spaces";
framer_.EnableMultiplePacketNumberSpacesSupport();
sent_packet_manager_.EnableMultiplePacketNumberSpacesSupport();
- uber_received_packet_manager_.EnableMultiplePacketNumberSpacesSupport();
+ uber_received_packet_manager_.EnableMultiplePacketNumberSpacesSupport(
+ perspective_);
}
bool QuicConnection::SupportsMultiplePacketNumberSpaces() const {
@@ -5000,8 +5373,8 @@ void QuicConnection::MaybeUpdateAckTimeout() {
should_last_packet_instigate_acks_ = true;
uber_received_packet_manager_.MaybeUpdateAckTimeout(
/*should_last_packet_instigate_acks=*/true, last_decrypted_packet_level_,
- last_header_.packet_number,
- clock_->ApproximateNow(), sent_packet_manager_.GetRttStats());
+ last_header_.packet_number, clock_->ApproximateNow(),
+ sent_packet_manager_.GetRttStats());
}
QuicTime QuicConnection::GetPathDegradingDeadline() const {
@@ -5050,6 +5423,40 @@ bool QuicConnection::ShouldDetectBlackhole() const {
return num_rtos_for_blackhole_detection_ > 0;
}
+QuicTime QuicConnection::GetRetransmissionDeadline() const {
+ if (perspective_ == Perspective::IS_CLIENT &&
+ SupportsMultiplePacketNumberSpaces() && !IsHandshakeConfirmed() &&
+ stats_.pto_count == 0 &&
+ !framer_.HasDecrypterOfEncryptionLevel(ENCRYPTION_HANDSHAKE) &&
+ !undecryptable_packets_.empty()) {
+ // Retransmits ClientHello quickly when a Handshake or 1-RTT packet is
+ // received prior to having Handshake keys. Adding kAlarmGranulary will
+ // avoid spurious retransmissions in the case of small-scale reordering.
+ return clock_->ApproximateNow() + kAlarmGranularity;
+ }
+ return sent_packet_manager_.GetRetransmissionTime();
+}
+
+void QuicConnection::SendPathChallenge(QuicPathFrameBuffer* data_buffer,
+ const QuicSocketAddress& self_address,
+ const QuicSocketAddress& peer_address,
+ QuicPacketWriter* writer) {
+ if (writer == writer_) {
+ // It's on current path, add the PATH_CHALLENGE the same way as other
+ // frames.
+ QuicPacketCreator::ScopedPeerAddressContext context(&packet_creator_,
+ peer_address);
+ packet_creator_.AddPathChallengeFrame(data_buffer);
+ return;
+ }
+ std::unique_ptr<SerializedPacket> probing_packet =
+ packet_creator_.SerializePathChallengeConnectivityProbingPacket(
+ data_buffer);
+ DCHECK_EQ(IsRetransmittable(*probing_packet), NO_RETRANSMITTABLE_DATA);
+ WritePacketUsingWriter(std::move(probing_packet), writer, self_address,
+ peer_address, /*measure_rtt=*/false);
+}
+
bool QuicConnection::SendPathResponse(const QuicPathFrameBuffer& data_buffer,
QuicSocketAddress peer_address_to_send) {
// Send PATH_RESPONSE using the provided peer address. If the creator has been
@@ -5066,5 +5473,11 @@ void QuicConnection::UpdatePeerAddress(QuicSocketAddress peer_address) {
packet_creator_.SetDefaultPeerAddress(peer_address);
}
+void QuicConnection::SendPingAtLevel(EncryptionLevel level) {
+ DCHECK(packet_creator_.let_connection_handle_pings());
+ ScopedEncryptionLevelContext context(this, level);
+ SendControlFrame(QuicFrame(QuicPingFrame()));
+}
+
#undef ENDPOINT // undef for jumbo builds
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection.h b/chromium/net/third_party/quiche/src/quic/core/quic_connection.h
index 9b4544ff7b4..35d15ffee92 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection.h
@@ -24,9 +24,12 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/transport_parameters.h"
+#include "net/third_party/quiche/src/quic/core/frames/quic_ack_frequency_frame.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_max_streams_frame.h"
#include "net/third_party/quiche/src/quic/core/proto/cached_network_parameters_proto.h"
#include "net/third_party/quiche/src/quic/core/quic_alarm.h"
@@ -35,6 +38,7 @@
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_stats.h"
+#include "net/third_party/quiche/src/quic/core/quic_constants.h"
#include "net/third_party/quiche/src/quic/core/quic_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_idle_network_detector.h"
#include "net/third_party/quiche/src/quic/core/quic_mtu_discovery.h"
@@ -50,9 +54,7 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -92,7 +94,7 @@ class QUIC_EXPORT_PRIVATE QuicConnectionVisitorInterface {
virtual void OnGoAway(const QuicGoAwayFrame& frame) = 0;
// Called when |message| has been received.
- virtual void OnMessageReceived(quiche::QuicheStringPiece message) = 0;
+ virtual void OnMessageReceived(absl::string_view message) = 0;
// Called when a HANDSHAKE_DONE frame has been received.
virtual void OnHandshakeDoneReceived() = 0;
@@ -158,6 +160,9 @@ class QUIC_EXPORT_PRIVATE QuicConnectionVisitorInterface {
// Called when a ping needs to be sent.
virtual void SendPing() = 0;
+ // Called when an AckFrequency frame need to be sent.
+ virtual void SendAckFrequency(const QuicAckFrequencyFrame& frame) = 0;
+
// Called to ask if the visitor wants to schedule write resumption as it both
// has pending data to write, and is able to write (e.g. based on flow control
// limits).
@@ -191,6 +196,23 @@ class QUIC_EXPORT_PRIVATE QuicConnectionVisitorInterface {
// Called when a packet of ENCRYPTION_HANDSHAKE gets sent.
virtual void OnHandshakePacketSent() = 0;
+
+ // Called when a key update has occurred.
+ virtual void OnKeyUpdate(KeyUpdateReason reason) = 0;
+
+ // Called to generate a decrypter for the next key phase. Each call should
+ // generate the key for phase n+1.
+ virtual std::unique_ptr<QuicDecrypter>
+ AdvanceKeysAndCreateCurrentOneRttDecrypter() = 0;
+
+ // Called to generate an encrypter for the same key phase of the last
+ // decrypter returned by AdvanceKeysAndCreateCurrentOneRttDecrypter().
+ virtual std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() = 0;
+
+ // Called when connection is being closed right before a CONNECTION_CLOSE
+ // frame is serialized, but only on the server and only if forward secure
+ // encryption has already been established.
+ virtual void BeforeConnectionCloseSent() = 0;
};
// Interface which gets callbacks from the QuicConnection at interesting
@@ -256,7 +278,9 @@ class QUIC_EXPORT_PRIVATE QuicConnectionDebugVisitor
virtual void OnProtocolVersionMismatch(ParsedQuicVersion /*version*/) {}
// Called when the complete header of a packet has been parsed.
- virtual void OnPacketHeader(const QuicPacketHeader& /*header*/) {}
+ virtual void OnPacketHeader(const QuicPacketHeader& /*header*/,
+ QuicTime /*receive_time*/,
+ EncryptionLevel /*level*/) {}
// Called when a StreamFrame has been parsed.
virtual void OnStreamFrame(const QuicStreamFrame& /*frame*/) {}
@@ -357,6 +381,9 @@ class QUIC_EXPORT_PRIVATE QuicConnectionDebugVisitor
// Called when a MaxStreamsFrame has been parsed.
virtual void OnMaxStreamsFrame(const QuicMaxStreamsFrame& /*frame*/) {}
+ // Called when an AckFrequencyFrame has been parsed.
+ virtual void OnAckFrequencyFrame(const QuicAckFrequencyFrame& /*frame*/) {}
+
// Called when |count| packet numbers have been skipped.
virtual void OnNPacketNumbersSkipped(QuicPacketCount /*count*/,
QuicTime /*now*/) {}
@@ -412,6 +439,7 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// specifies whether the connection takes ownership of |writer|. |helper| must
// outlive this connection.
QuicConnection(QuicConnectionId server_connection_id,
+ QuicSocketAddress initial_self_address,
QuicSocketAddress initial_peer_address,
QuicConnectionHelperInterface* helper,
QuicAlarmFactory* alarm_factory,
@@ -499,6 +527,10 @@ class QUIC_EXPORT_PRIVATE QuicConnection
QuicConnectionStats& mutable_stats() { return stats_; }
+ int retransmittable_on_wire_ping_count() const {
+ return retransmittable_on_wire_ping_count_;
+ }
+
// Returns statistics tracked for this connection.
const QuicConnectionStats& GetStats();
@@ -579,9 +611,9 @@ class QUIC_EXPORT_PRIVATE QuicConnection
const QuicVersionNegotiationPacket& packet) override;
void OnRetryPacket(QuicConnectionId original_connection_id,
QuicConnectionId new_connection_id,
- quiche::QuicheStringPiece retry_token,
- quiche::QuicheStringPiece retry_integrity_tag,
- quiche::QuicheStringPiece retry_without_tag) override;
+ absl::string_view retry_token,
+ absl::string_view retry_integrity_tag,
+ absl::string_view retry_without_tag) override;
bool OnUnauthenticatedPublicHeader(const QuicPacketHeader& header) override;
bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
void OnDecryptedPacket(EncryptionLevel level) override;
@@ -622,6 +654,11 @@ class QUIC_EXPORT_PRIVATE QuicConnection
bool IsValidStatelessResetToken(QuicUint128 token) const override;
void OnAuthenticatedIetfStatelessResetPacket(
const QuicIetfStatelessResetPacket& packet) override;
+ void OnKeyUpdate(KeyUpdateReason reason) override;
+ void OnDecryptedFirstPacketInKeyPhase() override;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
// QuicPacketCreator::DelegateInterface
bool ShouldGeneratePacket(HasRetransmittableData retransmittable,
@@ -782,6 +819,25 @@ class QUIC_EXPORT_PRIVATE QuicConnection
std::unique_ptr<QuicDecrypter> decrypter);
void RemoveDecrypter(EncryptionLevel level);
+ // Discard keys for the previous key phase.
+ void DiscardPreviousOneRttKeys();
+
+ // Returns true if it is currently allowed to initiate a key update.
+ bool IsKeyUpdateAllowed() const;
+
+ // Returns true if packets have been sent in the current 1-RTT key phase but
+ // none of these packets have been acked.
+ bool HaveSentPacketsInCurrentKeyPhaseButNoneAcked() const;
+
+ // Returns the count of packets received that appeared to attempt a key
+ // update but failed decryption that have been received since the last
+ // successfully decrypted packet.
+ QuicPacketCount PotentialPeerKeyUpdateAttemptCount() const;
+
+ // Increment the key phase. It is a bug to call this when IsKeyUpdateAllowed()
+ // is false. Returns false on error.
+ bool InitiateKeyUpdate(KeyUpdateReason reason);
+
const QuicDecrypter* decrypter() const;
const QuicDecrypter* alternative_decrypter() const;
@@ -825,6 +881,18 @@ class QUIC_EXPORT_PRIVATE QuicConnection
const bool handshake_packet_sent_;
};
+ class QUIC_EXPORT_PRIVATE ScopedEncryptionLevelContext {
+ public:
+ ScopedEncryptionLevelContext(QuicConnection* connection,
+ EncryptionLevel level);
+ ~ScopedEncryptionLevelContext();
+
+ private:
+ QuicConnection* connection_;
+ // Latched current write encryption level on creation of this context.
+ EncryptionLevel latched_encryption_level_;
+ };
+
QuicPacketWriter* writer() { return writer_; }
const QuicPacketWriter* writer() const { return writer_; }
@@ -882,6 +950,10 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// connection ID lengths do not change.
QuicPacketLength GetGuaranteedLargestMessagePayload() const;
+ virtual int GetUnackedMapInitialCapacity() const {
+ return kDefaultUnackedPacketsInitialCapacity;
+ }
+
// Returns the id of the cipher last used for decrypting packets.
uint32_t cipher_id() const;
@@ -895,7 +967,7 @@ class QUIC_EXPORT_PRIVATE QuicConnection
const QuicConnectionHelperInterface* helper() const { return helper_; }
QuicAlarmFactory* alarm_factory() { return alarm_factory_; }
- quiche::QuicheStringPiece GetCurrentPacket();
+ absl::string_view GetCurrentPacket();
const QuicFramer& framer() const { return framer_; }
@@ -1037,6 +1109,17 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// false.
bool MaybeTestLiveness();
+ // Send PATH_CHALLENGE using the given path information. If |writer| is the
+ // default writer, PATH_CHALLENGE can be bundled with other frames, and the
+ // containing packet can be buffered if the writer is blocked. Otherwise,
+ // PATH_CHALLENGE will be written in an individual packet and it will be
+ // dropped if write fails. |data_buffer| will be populated with the payload
+ // for future validation.
+ void SendPathChallenge(QuicPathFrameBuffer* data_buffer,
+ const QuicSocketAddress& self_address,
+ const QuicSocketAddress& peer_address,
+ QuicPacketWriter* writer);
+
bool can_receive_ack_frequency_frame() const {
return can_receive_ack_frequency_frame_;
}
@@ -1047,6 +1130,14 @@ class QUIC_EXPORT_PRIVATE QuicConnection
bool check_keys_before_writing() const { return check_keys_before_writing_; }
+ bool is_processing_packet() const { return framer_.is_processing_packet(); }
+
+ bool encrypted_control_frames() const { return encrypted_control_frames_; }
+
+ bool use_encryption_level_context() const {
+ return use_encryption_level_context_;
+ }
+
protected:
// Calls cancel() on all the alarms owned by this connection.
void CancelAllAlarms();
@@ -1126,7 +1217,7 @@ class QUIC_EXPORT_PRIVATE QuicConnection
private:
friend class test::QuicConnectionPeer;
- typedef std::list<SerializedPacket> QueuedPacketList;
+ using QueuedPacketList = std::list<SerializedPacket>;
// BufferedPacket stores necessary information (encrypted buffer and self/peer
// addresses) of those packets which are serialized but failed to send because
@@ -1146,7 +1237,7 @@ class QUIC_EXPORT_PRIVATE QuicConnection
~BufferedPacket();
// encrypted_buffer is owned by buffered packet.
- quiche::QuicheStringPiece encrypted_buffer;
+ absl::string_view encrypted_buffer;
// Self and peer addresses when the packet is serialized.
const QuicSocketAddress self_address;
const QuicSocketAddress peer_address;
@@ -1190,6 +1281,12 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// writer is write blocked.
bool WritePacket(SerializedPacket* packet);
+ // Enforce AEAD Confidentiality limits by iniating key update or closing
+ // connection if too many packets have been encrypted with the current key.
+ // Returns true if the connection was closed. Should not be called for
+ // termination packets.
+ bool MaybeHandleAeadConfidentialityLimits(const SerializedPacket& packet);
+
// Flush packets buffered in the writer, if any.
void FlushPackets();
@@ -1373,6 +1470,9 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// Returns true if network blackhole should be detected.
bool ShouldDetectBlackhole() const;
+ // Returns retransmission deadline.
+ QuicTime GetRetransmissionDeadline() const;
+
// Validate connection IDs used during the handshake. Closes the connection
// on validation failure.
bool ValidateConfigConnectionIds(const QuicConfig& config);
@@ -1416,6 +1516,16 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// Update both connection's and packet creator's peer address.
void UpdatePeerAddress(QuicSocketAddress peer_address);
+ // Send PING at encryption level.
+ void SendPingAtLevel(EncryptionLevel level);
+
+ // Write the given packet with |self_address| and |peer_address| using
+ // |writer|.
+ bool WritePacketUsingWriter(std::unique_ptr<SerializedPacket> packet,
+ QuicPacketWriter* writer,
+ const QuicSocketAddress& self_address,
+ const QuicSocketAddress& peer_address,
+ bool measure_rtt);
QuicFramer framer_;
// Contents received in the current packet, especially used to identify
@@ -1472,6 +1582,18 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// started.
QuicPacketNumber highest_packet_sent_before_effective_peer_migration_;
+ // True if Key Update is supported on this connection.
+ bool support_key_update_for_connection_;
+
+ // Tracks the lowest packet sent in the current key phase. Will be
+ // uninitialized before the first one-RTT packet has been sent or after a
+ // key update but before the first packet has been sent.
+ QuicPacketNumber lowest_packet_sent_in_current_key_phase_;
+
+ // Honor the AEAD confidentiality and integrity limits by initiating key
+ // update (if allowed) and/or closing the connection, as necessary.
+ bool enable_aead_limits_;
+
// True if the last packet has gotten far enough in the framer to be
// decrypted.
bool last_packet_decrypted_;
@@ -1525,6 +1647,9 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// When > 0, close the QUIC connection after this number of RTOs.
size_t num_rtos_for_blackhole_detection_;
+ // Statistics for this session.
+ QuicConnectionStats stats_;
+
UberReceivedPacketManager uber_received_packet_manager_;
// Indicates how many consecutive times an ack has arrived which indicates
@@ -1549,6 +1674,9 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// receiving any new data in between.
int consecutive_retransmittable_on_wire_ping_count_;
+ // Indicates how many retransmittable-on-wire pings have been emitted.
+ int retransmittable_on_wire_ping_count_;
+
// Arena to store class implementations within the QuicConnection.
QuicConnectionArena arena_;
@@ -1566,15 +1694,15 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// An alarm that fires to process undecryptable packets when new decyrption
// keys are available.
QuicArenaScopedPtr<QuicAlarm> process_undecryptable_packets_alarm_;
+ // An alarm that fires to discard keys for the previous key phase some time
+ // after a key update has completed.
+ QuicArenaScopedPtr<QuicAlarm> discard_previous_one_rtt_keys_alarm_;
// Neither visitor is owned by this class.
QuicConnectionVisitorInterface* visitor_;
QuicConnectionDebugVisitor* debug_visitor_;
QuicPacketCreator packet_creator_;
- // Statistics for this session.
- QuicConnectionStats stats_;
-
// The time that a packet is received for this connection. Initialized to
// connection creation time.
// This does not indicate the packet was processed.
@@ -1715,11 +1843,11 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// |server_connection_id_| with the value from that packet and save off the
// original value of |server_connection_id_| into
// |original_destination_connection_id_| for validation.
- quiche::QuicheOptional<QuicConnectionId> original_destination_connection_id_;
+ absl::optional<QuicConnectionId> original_destination_connection_id_;
// After we receive a RETRY packet, |retry_source_connection_id_| contains
// the source connection ID from that packet.
- quiche::QuicheOptional<QuicConnectionId> retry_source_connection_id_;
+ absl::optional<QuicConnectionId> retry_source_connection_id_;
// Indicates whether received RETRY packets should be dropped.
bool drop_incoming_retry_packets_;
@@ -1780,9 +1908,6 @@ class QUIC_EXPORT_PRIVATE QuicConnection
bool start_peer_migration_earlier_ =
GetQuicReloadableFlag(quic_start_peer_migration_earlier);
- bool fix_missing_connected_checks_ =
- GetQuicReloadableFlag(quic_add_missing_connected_checks);
-
// latch --gfe2_reloadable_flag_quic_send_path_response and
// --gfe2_reloadable_flag_quic_start_peer_migration_earlier.
bool send_path_response_ = start_peer_migration_earlier_ &&
@@ -1796,6 +1921,14 @@ class QUIC_EXPORT_PRIVATE QuicConnection
// Indicate whether any ENCRYPTION_HANDSHAKE packet has been sent.
bool handshake_packet_sent_ = false;
+ // Indicate whether to send an AckFrequencyFrame upon handshake completion.
+ // The AckFrequencyFrame sent will updates client's max_ack_delay, which if
+ // chosen properly can reduce the CPU and bandwidth usage for ACK frames.
+ bool send_ack_frequency_on_handshake_completion_ = false;
+
+ // Indicate whether AckFrequency frame has been sent.
+ bool ack_frequency_sent_ = false;
+
const bool fix_missing_initial_keys_ =
GetQuicReloadableFlag(quic_fix_missing_initial_keys2);
@@ -1804,6 +1937,10 @@ class QUIC_EXPORT_PRIVATE QuicConnection
const bool check_keys_before_writing_ =
GetQuicReloadableFlag(quic_check_keys_before_writing);
+
+ const bool encrypted_control_frames_;
+
+ const bool use_encryption_level_context_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.cc b/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.cc
index 7e31f16adb2..e682ee32c6a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.cc
@@ -10,6 +10,7 @@
#include <iomanip>
#include <string>
+#include "absl/strings/escaping.h"
#include "third_party/boringssl/src/include/openssl/siphash.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -17,8 +18,8 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -50,7 +51,12 @@ class QuicConnectionIdHasher {
} // namespace
-QuicConnectionId::QuicConnectionId() : QuicConnectionId(nullptr, 0) {}
+QuicConnectionId::QuicConnectionId() : QuicConnectionId(nullptr, 0) {
+ static_assert(offsetof(QuicConnectionId, padding_) ==
+ offsetof(QuicConnectionId, length_),
+ "bad offset");
+ static_assert(sizeof(QuicConnectionId) <= 16, "bad size");
+}
QuicConnectionId::QuicConnectionId(const char* data, uint8_t length) {
length_ = length;
@@ -139,7 +145,7 @@ std::string QuicConnectionId::ToString() const {
if (IsEmpty()) {
return std::string("0");
}
- return quiche::QuicheTextUtils::HexEncode(data(), length_);
+ return absl::BytesToHexString(absl::string_view(data(), length_));
}
std::ostream& operator<<(std::ostream& os, const QuicConnectionId& v) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.h b/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.h
index 52d5e11a354..d3706c83020 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection_id.h
@@ -99,7 +99,6 @@ class QUIC_EXPORT_PRIVATE QuicConnectionId {
bool operator<(const QuicConnectionId& v) const;
private:
- uint8_t length_; // length of the connection ID, in bytes.
// The connection ID is represented in network byte order.
union {
// If the connection ID fits in |data_short_|, it is stored in the
@@ -107,9 +106,16 @@ class QUIC_EXPORT_PRIVATE QuicConnectionId {
// Otherwise it is stored in |data_long_| which is guaranteed to have a size
// equal to |length_|.
// A value of 11 was chosen because our commonly used connection ID length
- // is 8 and with the length, the class is padded to 12 bytes anyway.
- char data_short_[11];
- char* data_long_;
+ // is 8 and with the length, the class is padded to at least 12 bytes
+ // anyway.
+ struct {
+ uint8_t padding_; // Match length_ field of the other union member.
+ char data_short_[11];
+ };
+ struct {
+ uint8_t length_; // length of the connection ID, in bytes.
+ char* data_long_;
+ };
};
};
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection_id_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_connection_id_test.cc
index 3fa7c020b40..84d30900551 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection_id_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection_id_test.cc
@@ -8,10 +8,10 @@
#include <cstring>
#include <string>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.cc b/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.cc
index 191918c9887..d7440b4589b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.cc
@@ -55,6 +55,9 @@ std::ostream& operator<<(std::ostream& os, const QuicConnectionStats& s) {
os << " num_ack_aggregation_epochs: " << s.num_ack_aggregation_epochs;
os << " sent_legacy_version_encapsulated_packets: "
<< s.sent_legacy_version_encapsulated_packets;
+ os << " key_update_count: " << s.key_update_count;
+ os << " num_failed_authentication_packets_received: "
+ << s.num_failed_authentication_packets_received;
os << " }";
return os;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.h b/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.h
index 5a568e19f9c..95cf61eed5a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection_stats.h
@@ -169,6 +169,15 @@ struct QUIC_EXPORT_PRIVATE QuicConnectionStats {
// Number of times when the connection tries to send data but gets throttled
// by amplification factor.
size_t num_amplification_throttling = 0;
+
+ // Number of key phase updates that have occurred. In the case of a locally
+ // initiated key update, this is incremented when the keys are updated, before
+ // the peer has acknowledged the key update.
+ uint32_t key_update_count = 0;
+
+ // Counts the number of undecryptable packets received across all keys. Does
+ // not include packets where a decryption key for that level was absent.
+ QuicPacketCount num_failed_authentication_packets_received = 0;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_connection_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_connection_test.cc
index 3acac1c22dc..1d55c1a78c4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_connection_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_connection_test.cc
@@ -11,14 +11,18 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/loss_detection_interface.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
+#include "net/third_party/quiche/src/quic/core/frames/quic_connection_close_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_constants.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_simple_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -40,9 +44,7 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_data_producer.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_session_notifier.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using testing::_;
using testing::AnyNumber;
@@ -108,23 +110,36 @@ QuicLongHeaderType EncryptionlevelToLongHeaderType(EncryptionLevel level) {
}
}
-// StringTaggingDecrypter ensures that the final kTagSize bytes of the message
-// match the expected value.
-class StrictTaggingDecrypter : public TaggingDecrypter {
+// A NullEncrypterWithConfidentialityLimit is a NullEncrypter that allows
+// specifying the confidentiality limit on the maximum number of packets that
+// may be encrypted per key phase in TLS+QUIC.
+class NullEncrypterWithConfidentialityLimit : public NullEncrypter {
public:
- explicit StrictTaggingDecrypter(uint8_t tag) : tag_(tag) {}
- ~StrictTaggingDecrypter() override {}
+ NullEncrypterWithConfidentialityLimit(Perspective perspective,
+ QuicPacketCount confidentiality_limit)
+ : NullEncrypter(perspective),
+ confidentiality_limit_(confidentiality_limit) {}
- // TaggingQuicDecrypter
- uint8_t GetTag(quiche::QuicheStringPiece /*ciphertext*/) override {
- return tag_;
+ QuicPacketCount GetConfidentialityLimit() const override {
+ return confidentiality_limit_;
}
- // Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
- uint32_t cipher_id() const override { return 0xFFFFFFF1; }
+ private:
+ QuicPacketCount confidentiality_limit_;
+};
+
+class StrictTaggingDecrypterWithIntegrityLimit : public StrictTaggingDecrypter {
+ public:
+ StrictTaggingDecrypterWithIntegrityLimit(uint8_t tag,
+ QuicPacketCount integrity_limit)
+ : StrictTaggingDecrypter(tag), integrity_limit_(integrity_limit) {}
+
+ QuicPacketCount GetIntegrityLimit() const override {
+ return integrity_limit_;
+ }
private:
- const uint8_t tag_;
+ QuicPacketCount integrity_limit_;
};
class TestConnectionHelper : public QuicConnectionHelperInterface {
@@ -181,14 +196,16 @@ class TestAlarmFactory : public QuicAlarmFactory {
class TestConnection : public QuicConnection {
public:
TestConnection(QuicConnectionId connection_id,
- QuicSocketAddress address,
+ QuicSocketAddress initial_self_address,
+ QuicSocketAddress initial_peer_address,
TestConnectionHelper* helper,
TestAlarmFactory* alarm_factory,
TestPacketWriter* writer,
Perspective perspective,
ParsedQuicVersion version)
: QuicConnection(connection_id,
- address,
+ initial_self_address,
+ initial_peer_address,
helper,
alarm_factory,
writer,
@@ -250,7 +267,7 @@ class TestConnection : public QuicConnection {
}
QuicConsumedData SendStreamDataWithString(QuicStreamId id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
QuicStreamOffset offset,
StreamSendingState state) {
ScopedPacketFlusher flusher(this);
@@ -271,7 +288,7 @@ class TestConnection : public QuicConnection {
QuicConsumedData SendApplicationDataAtLevel(EncryptionLevel encryption_level,
QuicStreamId id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
QuicStreamOffset offset,
StreamSendingState state) {
ScopedPacketFlusher flusher(this);
@@ -308,7 +325,7 @@ class TestConnection : public QuicConnection {
// tests for some cases for this stream.
QuicConsumedData SendCryptoStreamData() {
QuicStreamOffset offset = 0;
- quiche::QuicheStringPiece data("chlo");
+ absl::string_view data("chlo");
if (!QuicVersionUsesCryptoFrames(transport_version())) {
return SendCryptoDataWithString(data, offset);
}
@@ -324,12 +341,12 @@ class TestConnection : public QuicConnection {
return QuicConsumedData(bytes_written, /*fin_consumed*/ false);
}
- QuicConsumedData SendCryptoDataWithString(quiche::QuicheStringPiece data,
+ QuicConsumedData SendCryptoDataWithString(absl::string_view data,
QuicStreamOffset offset) {
return SendCryptoDataWithString(data, offset, ENCRYPTION_INITIAL);
}
- QuicConsumedData SendCryptoDataWithString(quiche::QuicheStringPiece data,
+ QuicConsumedData SendCryptoDataWithString(absl::string_view data,
QuicStreamOffset offset,
EncryptionLevel encryption_level) {
if (!QuicVersionUsesCryptoFrames(transport_version())) {
@@ -438,6 +455,11 @@ class TestConnection : public QuicConnection {
QuicConnectionPeer::GetProcessUndecryptablePacketsAlarm(this));
}
+ TestAlarmFactory::TestAlarm* GetDiscardPreviousOneRttKeysAlarm() {
+ return reinterpret_cast<TestAlarmFactory::TestAlarm*>(
+ QuicConnectionPeer::GetDiscardPreviousOneRttKeysAlarm(this));
+ }
+
TestAlarmFactory::TestAlarm* GetBlackholeDetectorAlarm() {
return reinterpret_cast<TestAlarmFactory::TestAlarm*>(
QuicConnectionPeer::GetBlackholeDetectorAlarm(this));
@@ -593,6 +615,7 @@ class QuicConnectionTest : public QuicTestWithParam<TestParams> {
writer_(
new TestPacketWriter(version(), &clock_, Perspective::IS_CLIENT)),
connection_(connection_id_,
+ kSelfAddress,
kPeerAddress,
helper_.get(),
alarm_factory_.get(),
@@ -601,9 +624,9 @@ class QuicConnectionTest : public QuicTestWithParam<TestParams> {
version()),
creator_(QuicConnectionPeer::GetPacketCreator(&connection_)),
manager_(QuicConnectionPeer::GetSentPacketManager(&connection_)),
- frame1_(0, false, 0, quiche::QuicheStringPiece(data1)),
- frame2_(0, false, 3, quiche::QuicheStringPiece(data2)),
- crypto_frame_(ENCRYPTION_INITIAL, 0, quiche::QuicheStringPiece(data1)),
+ frame1_(0, false, 0, absl::string_view(data1)),
+ frame2_(0, false, 3, absl::string_view(data2)),
+ crypto_frame_(ENCRYPTION_INITIAL, 0, absl::string_view(data1)),
packet_number_length_(PACKET_4BYTE_PACKET_NUMBER),
connection_id_included_(CONNECTION_ID_PRESENT),
notifier_(&connection_),
@@ -747,28 +770,33 @@ class QuicConnectionTest : public QuicTestWithParam<TestParams> {
}
return QuicFrame(QuicStreamFrame(
QuicUtils::GetCryptoStreamId(connection_.transport_version()), false,
- 0u, quiche::QuicheStringPiece()));
+ 0u, absl::string_view()));
}
void ProcessFramePacket(QuicFrame frame) {
- ProcessFramePacketWithAddresses(frame, kSelfAddress, kPeerAddress);
+ ProcessFramePacketWithAddresses(frame, kSelfAddress, kPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
}
void ProcessFramePacketWithAddresses(QuicFrame frame,
QuicSocketAddress self_address,
- QuicSocketAddress peer_address) {
+ QuicSocketAddress peer_address,
+ EncryptionLevel level) {
QuicFrames frames;
frames.push_back(QuicFrame(frame));
- return ProcessFramesPacketWithAddresses(frames, self_address, peer_address);
+ return ProcessFramesPacketWithAddresses(frames, self_address, peer_address,
+ level);
}
void ProcessFramesPacketWithAddresses(QuicFrames frames,
QuicSocketAddress self_address,
- QuicSocketAddress peer_address) {
+ QuicSocketAddress peer_address,
+ EncryptionLevel level) {
+ DCHECK(peer_framer_.HasEncrypterOfEncryptionLevel(level));
+ peer_creator_.set_encryption_level(level);
QuicPacketCreatorPeer::SetSendVersionInPacket(
&peer_creator_,
- QuicPacketCreatorPeer::GetEncryptionLevel(&peer_creator_) <
- ENCRYPTION_FORWARD_SECURE &&
+ level < ENCRYPTION_FORWARD_SECURE &&
connection_.perspective() == Perspective::IS_SERVER);
char buffer[kMaxOutgoingPacketSize];
@@ -998,7 +1026,7 @@ class QuicConnectionTest : public QuicTestWithParam<TestParams> {
}
QuicByteCount SendStreamDataToPeer(QuicStreamId id,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
QuicStreamOffset offset,
StreamSendingState state,
QuicPacketNumber* last_packet) {
@@ -1035,7 +1063,7 @@ class QuicConnectionTest : public QuicTestWithParam<TestParams> {
void SendPing() { notifier_.WriteOrBufferPing(); }
- MessageStatus SendMessage(quiche::QuicheStringPiece message) {
+ MessageStatus SendMessage(absl::string_view message) {
connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
QuicMemSliceStorage storage(nullptr, 0, nullptr, 0);
return connection_.SendMessage(
@@ -1142,6 +1170,7 @@ class QuicConnectionTest : public QuicTestWithParam<TestParams> {
}
std::unique_ptr<SerializedPacket> ConstructProbingPacket() {
+ peer_creator_.set_encryption_level(ENCRYPTION_FORWARD_SECURE);
if (VersionHasIetfQuicFrames(version().transport_version)) {
QuicPathFrameBuffer payload = {
{0xde, 0xad, 0xbe, 0xef, 0xba, 0xdc, 0x0f, 0xfe}};
@@ -1154,6 +1183,7 @@ class QuicConnectionTest : public QuicTestWithParam<TestParams> {
}
std::unique_ptr<QuicPacket> ConstructClosePacket(uint64_t number) {
+ peer_creator_.set_encryption_level(ENCRYPTION_FORWARD_SECURE);
QuicPacketHeader header;
// Set connection_id to peer's in memory representation as this connection
// close packet is created by peer_framer.
@@ -1446,8 +1476,8 @@ TEST_P(QuicConnectionTest, SelfAddressChangeAtClient) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_));
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
// Cause change in self_address.
QuicIpAddress host;
host.FromString("1.1.1.1");
@@ -1457,8 +1487,8 @@ TEST_P(QuicConnectionTest, SelfAddressChangeAtClient) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_));
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), self_address,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), self_address, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_TRUE(connection_.connected());
}
@@ -1474,16 +1504,19 @@ TEST_P(QuicConnectionTest, SelfAddressChangeAtServer) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_));
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
// Cause change in self_address.
QuicIpAddress host;
host.FromString("1.1.1.1");
QuicSocketAddress self_address(host, 123);
EXPECT_CALL(visitor_, AllowSelfAddressChange()).WillOnce(Return(false));
+ if (version().handshake_protocol == PROTOCOL_TLS1_3) {
+ EXPECT_CALL(visitor_, BeforeConnectionCloseSent());
+ }
EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), self_address,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), self_address, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_FALSE(connection_.connected());
TestConnectionCloseQuicErrorCode(QUIC_ERROR_MIGRATING_ADDRESS);
}
@@ -1503,19 +1536,20 @@ TEST_P(QuicConnectionTest, AllowSelfAddressChangeToMappedIpv4AddressAtServer) {
QuicIpAddress host;
host.FromString("1.1.1.1");
QuicSocketAddress self_address1(host, 443);
+ connection_.SetSelfAddress(self_address1);
ProcessFramePacketWithAddresses(MakeCryptoFrame(), self_address1,
- kPeerAddress);
+ kPeerAddress, ENCRYPTION_INITIAL);
// Cause self_address change to mapped Ipv4 address.
QuicIpAddress host2;
host2.FromString(quiche::QuicheStrCat(
"::ffff:", connection_.self_address().host().ToString()));
QuicSocketAddress self_address2(host2, connection_.self_address().port());
ProcessFramePacketWithAddresses(MakeCryptoFrame(), self_address2,
- kPeerAddress);
+ kPeerAddress, ENCRYPTION_INITIAL);
EXPECT_TRUE(connection_.connected());
// self_address change back to Ipv4 address.
ProcessFramePacketWithAddresses(MakeCryptoFrame(), self_address1,
- kPeerAddress);
+ kPeerAddress, ENCRYPTION_INITIAL);
EXPECT_TRUE(connection_.connected());
}
@@ -1540,7 +1574,7 @@ TEST_P(QuicConnectionTest, ClientAddressChangeAndPacketReordered) {
QuicSocketAddress(QuicIpAddress::Loopback6(),
/*port=*/23456);
ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kNewPeerAddress);
+ kNewPeerAddress, ENCRYPTION_INITIAL);
EXPECT_EQ(kNewPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address());
@@ -1548,8 +1582,8 @@ TEST_P(QuicConnectionTest, ClientAddressChangeAndPacketReordered) {
QuicPacketCreatorPeer::SetPacketNumber(&peer_creator_, 4);
// This is an old packet, do not migrate.
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(0);
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kNewPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address());
}
@@ -1559,7 +1593,6 @@ TEST_P(QuicConnectionTest, PeerAddressChangeAtServer) {
QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false);
EXPECT_EQ(Perspective::IS_SERVER, connection_.perspective());
connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
- peer_creator_.set_encryption_level(ENCRYPTION_FORWARD_SECURE);
// Prevent packets from being coalesced.
EXPECT_CALL(visitor_, GetHandshakeState())
.WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
@@ -1586,7 +1619,8 @@ TEST_P(QuicConnectionTest, PeerAddressChangeAtServer) {
}));
QuicFrames frames;
frames.push_back(QuicFrame(frame1_));
- ProcessFramesPacketWithAddresses(frames, kSelfAddress, kPeerAddress);
+ ProcessFramesPacketWithAddresses(frames, kSelfAddress, kPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -1595,7 +1629,8 @@ TEST_P(QuicConnectionTest, PeerAddressChangeAtServer) {
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(1);
QuicFrames frames2;
frames2.push_back(QuicFrame(frame2_));
- ProcessFramesPacketWithAddresses(frames2, kSelfAddress, kNewPeerAddress);
+ ProcessFramesPacketWithAddresses(frames2, kSelfAddress, kNewPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
EXPECT_EQ(kNewPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address());
}
@@ -1623,8 +1658,8 @@ TEST_P(QuicConnectionTest, EffectivePeerAddressChangeAtServer) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kEffectivePeerAddress, connection_.effective_peer_address());
@@ -1634,8 +1669,8 @@ TEST_P(QuicConnectionTest, EffectivePeerAddressChangeAtServer) {
QuicSocketAddress(QuicIpAddress::Loopback6(), /*port=*/54321);
connection_.ReturnEffectivePeerAddressForNextPacket(kNewEffectivePeerAddress);
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(1);
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewEffectivePeerAddress, connection_.effective_peer_address());
@@ -1651,7 +1686,7 @@ TEST_P(QuicConnectionTest, EffectivePeerAddressChangeAtServer) {
QuicAckFrame ack_frame = InitAckFrame(1);
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(_, _, _, _, _));
ProcessFramePacketWithAddresses(QuicFrame(&ack_frame), kSelfAddress,
- kNewPeerAddress);
+ kNewPeerAddress, ENCRYPTION_INITIAL);
EXPECT_EQ(kNewPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewEffectivePeerAddress, connection_.effective_peer_address());
@@ -1665,7 +1700,7 @@ TEST_P(QuicConnectionTest, EffectivePeerAddressChangeAtServer) {
kNewerEffectivePeerAddress);
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(1);
ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kFinalPeerAddress);
+ kFinalPeerAddress, ENCRYPTION_INITIAL);
EXPECT_EQ(kFinalPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewerEffectivePeerAddress, connection_.effective_peer_address());
EXPECT_EQ(PORT_CHANGE, connection_.active_effective_peer_migration_type());
@@ -1680,7 +1715,7 @@ TEST_P(QuicConnectionTest, EffectivePeerAddressChangeAtServer) {
EXPECT_CALL(visitor_, OnConnectionMigration(IPV6_TO_IPV4_CHANGE)).Times(1);
EXPECT_CALL(*send_algorithm_, OnConnectionMigration()).Times(1);
ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kFinalPeerAddress);
+ kFinalPeerAddress, ENCRYPTION_INITIAL);
EXPECT_EQ(kFinalPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewestEffectivePeerAddress, connection_.effective_peer_address());
EXPECT_EQ(IPV6_TO_IPV4_CHANGE,
@@ -1703,8 +1738,8 @@ TEST_P(QuicConnectionTest, ReceivePathProbeWithNoAddressChangeAtServer) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -1818,8 +1853,8 @@ TEST_P(QuicConnectionTest, ReceivePathProbingAtServer) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -1854,8 +1889,8 @@ TEST_P(QuicConnectionTest, ReceivePathProbingAtServer) {
// Process another packet with the old peer address on server side will not
// start peer migration.
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(0);
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
}
@@ -1879,8 +1914,8 @@ TEST_P(QuicConnectionTest, ReceivePaddedPingWithPortChangeAtServer) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -1912,7 +1947,8 @@ TEST_P(QuicConnectionTest, ReceivePaddedPingWithPortChangeAtServer) {
uint64_t num_probing_received =
connection_.GetStats().num_connectivity_probing_received;
- ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress);
+ ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress,
+ ENCRYPTION_INITIAL);
if (GetParam().version.HasIetfQuicFrames()) {
// Padded PING with port changen is not considered as connectivity probe but
@@ -1934,8 +1970,8 @@ TEST_P(QuicConnectionTest, ReceivePaddedPingWithPortChangeAtServer) {
} else {
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(0);
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
}
@@ -1957,8 +1993,8 @@ TEST_P(QuicConnectionTest, ReceiveReorderedPathProbingAtServer) {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
QuicPacketCreatorPeer::SetPacketNumber(&peer_creator_, 5);
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -2012,8 +2048,8 @@ TEST_P(QuicConnectionTest, MigrateAfterProbingAtServer) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -2045,7 +2081,7 @@ TEST_P(QuicConnectionTest, MigrateAfterProbingAtServer) {
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(1);
ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kNewPeerAddress);
+ kNewPeerAddress, ENCRYPTION_INITIAL);
EXPECT_EQ(kNewPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address());
}
@@ -2067,8 +2103,8 @@ TEST_P(QuicConnectionTest, ReceiveConnectivityProbingPacketAtClient) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -2120,8 +2156,8 @@ TEST_P(QuicConnectionTest, ReceiveConnectivityProbingResponseAtClient) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -2172,8 +2208,8 @@ TEST_P(QuicConnectionTest, PeerAddressChangeAtClient) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -2183,7 +2219,7 @@ TEST_P(QuicConnectionTest, PeerAddressChangeAtClient) {
QuicSocketAddress(QuicIpAddress::Loopback6(), /*port=*/23456);
EXPECT_CALL(visitor_, OnConnectionMigration(PORT_CHANGE)).Times(0);
ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kNewPeerAddress);
+ kNewPeerAddress, ENCRYPTION_INITIAL);
EXPECT_EQ(kNewPeerAddress, connection_.peer_address());
EXPECT_EQ(kNewPeerAddress, connection_.effective_peer_address());
}
@@ -2220,8 +2256,8 @@ TEST_P(QuicConnectionTest, PeerCannotRaiseMaxPacketSize) {
}
TEST_P(QuicConnectionTest, SmallerServerMaxPacketSize) {
- TestConnection connection(TestConnectionId(), kPeerAddress, helper_.get(),
- alarm_factory_.get(), writer_.get(),
+ TestConnection connection(TestConnectionId(), kSelfAddress, kPeerAddress,
+ helper_.get(), alarm_factory_.get(), writer_.get(),
Perspective::IS_SERVER, version());
EXPECT_EQ(Perspective::IS_SERVER, connection.perspective());
EXPECT_EQ(1000u, connection.max_packet_length());
@@ -2335,8 +2371,8 @@ TEST_P(QuicConnectionTest, LimitMaxPacketSizeByWriterForNewConnection) {
const QuicConnectionId connection_id = TestConnectionId(17);
const QuicByteCount lower_max_packet_size = 1240;
writer_->set_max_packet_size(lower_max_packet_size);
- TestConnection connection(connection_id, kPeerAddress, helper_.get(),
- alarm_factory_.get(), writer_.get(),
+ TestConnection connection(connection_id, kSelfAddress, kPeerAddress,
+ helper_.get(), alarm_factory_.get(), writer_.get(),
Perspective::IS_CLIENT, version());
EXPECT_EQ(Perspective::IS_CLIENT, connection.perspective());
EXPECT_EQ(lower_max_packet_size, connection.max_packet_length());
@@ -2612,7 +2648,6 @@ TEST_P(QuicConnectionTest, AckDecimationReducesAcks) {
QuicTime::Delta::Zero(), QuicTime::Zero());
EXPECT_CALL(visitor_, OnAckNeedsRetransmittableFrame()).Times(AnyNumber());
-
// Start ack decimation from 10th packet.
connection_.set_min_received_before_ack_decimation(10);
@@ -3111,7 +3146,7 @@ TEST_P(QuicConnectionTest, FramePackingSendv) {
QuicStreamFrame* frame = writer_->stream_frames()[0].get();
EXPECT_EQ(stream_id, frame->stream_id);
EXPECT_EQ("ABCDEF",
- quiche::QuicheStringPiece(frame->data_buffer, frame->data_length));
+ absl::string_view(frame->data_buffer, frame->data_length));
}
TEST_P(QuicConnectionTest, FramePackingSendvQueued) {
@@ -4012,7 +4047,11 @@ TEST_P(QuicConnectionTest, TailLossProbeDelayForNonStreamDataInTLPR) {
connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
// Simulate firing of the retransmittable on wire and send a PING.
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
clock_.AdvanceTime(retransmittable_on_wire_timeout);
connection_.GetPingAlarm()->Fire();
@@ -4026,13 +4065,21 @@ TEST_P(QuicConnectionTest, TailLossProbeDelayForNonStreamDataInTLPR) {
QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs);
srtt = manager_->GetRttStats()->SmoothedOrInitialRtt();
- // First TLP without unacked stream data will no longer use TLPR.
- expected_delay = std::max(2 * srtt, 1.5 * srtt + 0.5 * min_rto_timeout);
+ if (GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ // Arm RTO mode since there is only PING in flight.
+ expected_delay = manager_->GetPtoDelay();
+ } else {
+ // First TLP without unacked stream data will no longer use TLPR.
+ expected_delay = std::max(2 * srtt, 1.5 * srtt + 0.5 * min_rto_timeout);
+ }
EXPECT_EQ(expected_delay,
connection_.GetRetransmissionAlarm()->deadline() - clock_.Now());
// Verify the path degrading delay = TLP delay + 1st RTO + 2nd RTO.
// Add 1st RTO.
+ if (GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ expected_delay = std::max(2 * srtt, 1.5 * srtt + 0.5 * min_rto_timeout);
+ }
retransmission_delay =
std::max(manager_->GetRttStats()->smoothed_rtt() +
4 * manager_->GetRttStats()->mean_deviation(),
@@ -4059,7 +4106,12 @@ TEST_P(QuicConnectionTest, TailLossProbeDelayForNonStreamDataInTLPR) {
// Verify the retransmission delay.
// First TLP without unacked stream data will no longer use TLPR.
- expected_delay = std::max(2 * srtt, 1.5 * srtt + 0.5 * min_rto_timeout);
+ if (GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ // Arm RTO mode since there is only PING in flight.
+ expected_delay = manager_->GetPtoDelay();
+ } else {
+ expected_delay = std::max(2 * srtt, 1.5 * srtt + 0.5 * min_rto_timeout);
+ }
expected_delay = expected_delay - QuicTime::Delta::FromMilliseconds(5);
EXPECT_EQ(expected_delay,
connection_.GetRetransmissionAlarm()->deadline() - clock_.Now());
@@ -4585,7 +4637,11 @@ TEST_P(QuicConnectionTest, PingAfterSend) {
writer_->Reset();
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(15));
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
connection_.GetPingAlarm()->Fire();
size_t padding_frame_count = writer_->padding_frames().size();
EXPECT_EQ(padding_frame_count + 1u, writer_->frame_count());
@@ -4639,9 +4695,11 @@ TEST_P(QuicConnectionTest, ReducedPingTimeout) {
writer_->Reset();
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(10));
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
- connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
- }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
+ }));
+ }
connection_.GetPingAlarm()->Fire();
size_t padding_frame_count = writer_->padding_frames().size();
EXPECT_EQ(padding_frame_count + 1u, writer_->frame_count());
@@ -6432,6 +6490,9 @@ TEST_P(QuicConnectionTest, WriteBlockedAfterClientSendsConnectivityProbe) {
TEST_P(QuicConnectionTest, WriterBlockedAfterServerSendsConnectivityProbe) {
PathProbeTestInit(Perspective::IS_SERVER);
+ if (version().SupportsAntiAmplificationLimit()) {
+ QuicConnectionPeer::SetAddressValidated(&connection_);
+ }
// Block next write so that sending connectivity probe will encounter a
// blocked write when send a connectivity probe to the peer.
@@ -6442,8 +6503,16 @@ TEST_P(QuicConnectionTest, WriterBlockedAfterServerSendsConnectivityProbe) {
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, QuicPacketNumber(1), _, _))
.Times(1);
- connection_.SendConnectivityProbingPacket(writer_.get(),
- connection_.peer_address());
+ if (connection_.send_path_response() &&
+ VersionHasIetfQuicFrames(GetParam().version.transport_version)) {
+ QuicPathFrameBuffer payload;
+ QuicConnection::ScopedPacketFlusher flusher(&connection_);
+ connection_.SendPathChallenge(&payload, connection_.self_address(),
+ connection_.peer_address(), writer_.get());
+ } else {
+ connection_.SendConnectivityProbingPacket(writer_.get(),
+ connection_.peer_address());
+ }
}
TEST_P(QuicConnectionTest, WriterErrorWhenClientSendsConnectivityProbe) {
@@ -6814,18 +6883,18 @@ TEST_P(QuicConnectionTest, OnPacketHeaderDebugVisitor) {
MockQuicConnectionDebugVisitor debug_visitor;
connection_.set_debug_visitor(&debug_visitor);
- EXPECT_CALL(debug_visitor, OnPacketHeader(Ref(header))).Times(1);
+ EXPECT_CALL(debug_visitor, OnPacketHeader(Ref(header), _, _)).Times(1);
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)).Times(1);
EXPECT_CALL(debug_visitor, OnSuccessfulVersionNegotiation(_)).Times(1);
connection_.OnPacketHeader(header);
}
TEST_P(QuicConnectionTest, Pacing) {
- TestConnection server(connection_id_, kSelfAddress, helper_.get(),
- alarm_factory_.get(), writer_.get(),
+ TestConnection server(connection_id_, kPeerAddress, kSelfAddress,
+ helper_.get(), alarm_factory_.get(), writer_.get(),
Perspective::IS_SERVER, version());
- TestConnection client(connection_id_, kPeerAddress, helper_.get(),
- alarm_factory_.get(), writer_.get(),
+ TestConnection client(connection_id_, kSelfAddress, kPeerAddress,
+ helper_.get(), alarm_factory_.get(), writer_.get(),
Perspective::IS_CLIENT, version());
EXPECT_FALSE(QuicSentPacketManagerPeer::UsingPacing(
static_cast<const QuicSentPacketManager*>(
@@ -7147,9 +7216,11 @@ TEST_P(QuicConnectionTest, RetransmittableOnWireSetsPingAlarm) {
// Simulate firing the ping alarm and sending a PING.
clock_.AdvanceTime(retransmittable_on_wire_timeout);
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
- connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
- }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
+ }));
+ }
connection_.GetPingAlarm()->Fire();
// Now there's a retransmittable packet (PING) on the wire, so the path
@@ -7365,6 +7436,9 @@ TEST_P(QuicConnectionTest, ServerReceivesChloOnNonCryptoStream) {
frame1_.data_buffer = data->data();
frame1_.data_length = data->length();
+ if (version().handshake_protocol == PROTOCOL_TLS1_3) {
+ EXPECT_CALL(visitor_, BeforeConnectionCloseSent());
+ }
EXPECT_CALL(visitor_,
OnConnectionClosed(_, ConnectionCloseSource::FROM_SELF));
ForceProcessFramePacket(QuicFrame(frame1_));
@@ -7621,6 +7695,9 @@ TEST_P(QuicConnectionTest, DoNotPadServerInitialConnectionClose) {
}
set_perspective(Perspective::IS_SERVER);
+ if (version().handshake_protocol == PROTOCOL_TLS1_3) {
+ EXPECT_CALL(visitor_, BeforeConnectionCloseSent());
+ }
EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
const QuicErrorCode kQuicErrorCode = QUIC_INTERNAL_ERROR;
connection_.CloseConnection(
@@ -7850,9 +7927,11 @@ TEST_P(QuicConnectionTest, PingAfterLastRetransmittablePacketAcked) {
EXPECT_EQ(prev_deadline, connection_.GetPingAlarm()->deadline());
// Simulate the alarm firing and check that a PING is sent.
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
- connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
- }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
+ }));
+ }
connection_.GetPingAlarm()->Fire();
size_t padding_frame_count = writer_->padding_frames().size();
if (GetParam().no_stop_waiting) {
@@ -7923,9 +8002,11 @@ TEST_P(QuicConnectionTest, NoPingIfRetransmittablePacketSent) {
// Simulate the alarm firing and check that a PING is sent.
writer_->Reset();
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
- connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
- }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ connection_.SendControlFrame(QuicFrame(QuicPingFrame(1)));
+ }));
+ }
connection_.GetPingAlarm()->Fire();
size_t padding_frame_count = writer_->padding_frames().size();
if (GetParam().no_stop_waiting) {
@@ -7985,9 +8066,11 @@ TEST_P(QuicConnectionTest, BackOffRetransmittableOnWireTimeout) {
connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
// Simulate the alarm firing and check that a PING is sent.
writer_->Reset();
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
- SendPing();
- }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
clock_.AdvanceTime(initial_retransmittable_on_wire_timeout);
connection_.GetPingAlarm()->Fire();
}
@@ -8012,9 +8095,11 @@ TEST_P(QuicConnectionTest, BackOffRetransmittableOnWireTimeout) {
// Simulate the alarm firing and check that a PING is sent.
writer_->Reset();
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
- SendPing();
- }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
clock_.AdvanceTime(retransmittable_on_wire_timeout);
connection_.GetPingAlarm()->Fire();
}
@@ -8080,7 +8165,11 @@ TEST_P(QuicConnectionTest, ResetBackOffRetransmitableOnWireTimeout) {
// Simulate the alarm firing and check that a PING is sent.
writer_->Reset();
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
clock_.AdvanceTime(initial_retransmittable_on_wire_timeout);
connection_.GetPingAlarm()->Fire();
@@ -8116,9 +8205,11 @@ TEST_P(QuicConnectionTest, ResetBackOffRetransmitableOnWireTimeout) {
connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
// Simulate the alarm firing and check that a PING is sent.
writer_->Reset();
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
- SendPing();
- }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
clock_.AdvanceTime(initial_retransmittable_on_wire_timeout);
connection_.GetPingAlarm()->Fire();
// Advance 5ms to receive next packet.
@@ -8136,7 +8227,11 @@ TEST_P(QuicConnectionTest, ResetBackOffRetransmitableOnWireTimeout) {
connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
writer_->Reset();
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
clock_.AdvanceTime(2 * initial_retransmittable_on_wire_timeout);
connection_.GetPingAlarm()->Fire();
@@ -8156,6 +8251,75 @@ TEST_P(QuicConnectionTest, ResetBackOffRetransmitableOnWireTimeout) {
connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
}
+// Make sure that we never send more retransmissible on the wire pings than
+// the limit in FLAGS_quic_max_retransmittable_on_wire_ping_count.
+TEST_P(QuicConnectionTest, RetransmittableOnWirePingLimit) {
+ static constexpr int kMaxRetransmittableOnWirePingCount = 3;
+ SetQuicFlag(FLAGS_quic_max_retransmittable_on_wire_ping_count,
+ kMaxRetransmittableOnWirePingCount);
+ static constexpr QuicTime::Delta initial_retransmittable_on_wire_timeout =
+ QuicTime::Delta::FromMilliseconds(200);
+ static constexpr QuicTime::Delta short_delay =
+ QuicTime::Delta::FromMilliseconds(5);
+ ASSERT_LT(short_delay * 10, initial_retransmittable_on_wire_timeout);
+ connection_.set_initial_retransmittable_on_wire_timeout(
+ initial_retransmittable_on_wire_timeout);
+
+ EXPECT_TRUE(connection_.connected());
+ EXPECT_CALL(visitor_, ShouldKeepConnectionAlive())
+ .WillRepeatedly(Return(true));
+
+ const char data[] = "data";
+ // Advance 5ms, send a retransmittable data packet to the peer.
+ clock_.AdvanceTime(short_delay);
+ EXPECT_FALSE(connection_.GetPingAlarm()->IsSet());
+ connection_.SendStreamDataWithString(1, data, 0, NO_FIN);
+ EXPECT_TRUE(connection_.sent_packet_manager().HasInFlightPackets());
+ // The ping alarm is set for the ping timeout, not the shorter
+ // retransmittable_on_wire_timeout.
+ EXPECT_TRUE(connection_.GetPingAlarm()->IsSet());
+ EXPECT_EQ(connection_.ping_timeout(),
+ connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
+
+ EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_)).Times(AnyNumber());
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _))
+ .Times(AnyNumber());
+
+ // Verify that the first few consecutive retransmittable on wire pings are
+ // sent with aggressive timeout.
+ for (int i = 0; i <= kMaxRetransmittableOnWirePingCount; i++) {
+ // Receive an ACK of the previous packet. This should set the ping alarm
+ // with the initial retransmittable-on-wire timeout.
+ clock_.AdvanceTime(short_delay);
+ QuicPacketNumber ack_num = creator_->packet_number();
+ QuicAckFrame frame = InitAckFrame(
+ {{QuicPacketNumber(ack_num), QuicPacketNumber(ack_num + 1)}});
+ ProcessAckPacket(&frame);
+ EXPECT_TRUE(connection_.GetPingAlarm()->IsSet());
+ EXPECT_EQ(initial_retransmittable_on_wire_timeout,
+ connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
+ // Simulate the alarm firing and check that a PING is sent.
+ writer_->Reset();
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
+ clock_.AdvanceTime(initial_retransmittable_on_wire_timeout);
+ connection_.GetPingAlarm()->Fire();
+ }
+
+ // Receive an ACK of the previous packet. This should set the ping alarm
+ // but this time with the default ping timeout.
+ QuicPacketNumber ack_num = creator_->packet_number();
+ QuicAckFrame frame = InitAckFrame(
+ {{QuicPacketNumber(ack_num), QuicPacketNumber(ack_num + 1)}});
+ ProcessAckPacket(&frame);
+ EXPECT_TRUE(connection_.GetPingAlarm()->IsSet());
+ EXPECT_EQ(connection_.ping_timeout(),
+ connection_.GetPingAlarm()->deadline() - clock_.ApproximateNow());
+}
+
TEST_P(QuicConnectionTest, ValidStatelessResetToken) {
const QuicUint128 kTestToken = 1010101;
const QuicUint128 kWrongTestToken = 1010100;
@@ -8199,7 +8363,7 @@ TEST_P(QuicConnectionTest, SendMessage) {
connection_.SetFromConfig(config);
}
std::string message(connection_.GetCurrentLargestMessagePayload() * 2, 'a');
- quiche::QuicheStringPiece message_data(message);
+ absl::string_view message_data(message);
QuicMemSliceStorage storage(nullptr, 0, nullptr, 0);
{
QuicConnection::ScopedPacketFlusher flusher(&connection_);
@@ -8212,7 +8376,7 @@ TEST_P(QuicConnectionTest, SendMessage) {
connection_.SendMessage(
1,
MakeSpan(connection_.helper()->GetStreamSendBufferAllocator(),
- quiche::QuicheStringPiece(
+ absl::string_view(
message_data.data(),
connection_.GetCurrentLargestMessagePayload()),
&storage),
@@ -8233,7 +8397,7 @@ TEST_P(QuicConnectionTest, SendMessage) {
connection_.SendMessage(
3,
MakeSpan(connection_.helper()->GetStreamSendBufferAllocator(),
- quiche::QuicheStringPiece(
+ absl::string_view(
message_data.data(),
connection_.GetCurrentLargestMessagePayload() + 1),
&storage),
@@ -8445,8 +8609,8 @@ TEST_P(QuicConnectionTest,
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -8579,8 +8743,8 @@ TEST_P(QuicConnectionTest, StopProcessingGQuicPacketInIetfQuicConnection) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(1);
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
// Let connection process a Google QUIC packet.
peer_framer_.set_version_for_tests(ParsedQuicVersion::Q043());
@@ -8895,11 +9059,12 @@ TEST_P(QuicConnectionTest, CheckConnectedBeforeFlush) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_TRUE(connection_.HasPendingAcks());
ProcessFramePacketWithAddresses(QuicFrame(connection_close_frame.release()),
- kSelfAddress, kPeerAddress);
+ kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
// Verify ack alarm is not set.
EXPECT_FALSE(connection_.HasPendingAcks());
}
@@ -9097,7 +9262,11 @@ TEST_P(QuicConnectionTest, RtoForcesSendingPing) {
// RTO fires, verify a PING packet gets sent because there is no data to send.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, QuicPacketNumber(3), _, _));
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
clock_.AdvanceTime(retransmission_time - clock_.Now());
connection_.GetRetransmissionAlarm()->Fire();
EXPECT_EQ(1u, connection_.GetStats().tlp_count);
@@ -9317,7 +9486,11 @@ TEST_P(QuicConnectionTest, DeprecateHandshakeMode) {
? QuicPacketNumber(2)
: QuicPacketNumber(3),
_, _));
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
connection_.GetRetransmissionAlarm()->Fire();
EXPECT_EQ(1u, connection_.GetStats().pto_count);
EXPECT_EQ(1u, connection_.GetStats().crypto_retransmit_count);
@@ -9614,7 +9787,11 @@ TEST_P(QuicConnectionTest, RtoPacketAsTwo) {
// Fires TLP, verify a PING gets sent because packet 3 is marked
// RTO_RETRANSMITTED.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, QuicPacketNumber(70), _, _));
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
connection_.GetRetransmissionAlarm()->Fire();
}
@@ -9756,6 +9933,9 @@ TEST_P(QuicConnectionTest, ServerReceivedHandshakeDone) {
}
set_perspective(Perspective::IS_SERVER);
EXPECT_CALL(visitor_, OnHandshakeDoneReceived()).Times(0);
+ if (version().handshake_protocol == PROTOCOL_TLS1_3) {
+ EXPECT_CALL(visitor_, BeforeConnectionCloseSent());
+ }
EXPECT_CALL(visitor_, OnConnectionClosed(_, ConnectionCloseSource::FROM_SELF))
.WillOnce(Invoke(this, &QuicConnectionTest::SaveConnectionCloseFrame));
QuicFrames frames;
@@ -9877,10 +10057,10 @@ void QuicConnectionTest::TestClientRetryHandling(
size_t retry_packet_length;
if (version() == ParsedQuicVersion::Draft29()) {
retry_packet = retry_packet29;
- retry_packet_length = QUICHE_ARRAYSIZE(retry_packet29);
+ retry_packet_length = ABSL_ARRAYSIZE(retry_packet29);
} else if (version() == ParsedQuicVersion::Draft27()) {
retry_packet = retry_packet27;
- retry_packet_length = QUICHE_ARRAYSIZE(retry_packet27);
+ retry_packet_length = ABSL_ARRAYSIZE(retry_packet27);
} else {
// TODO(dschinazi) generate retry packets for all versions once we have
// server-side support for generating these programmatically.
@@ -9895,12 +10075,11 @@ void QuicConnectionTest::TestClientRetryHandling(
QuicConnectionId original_connection_id(
original_connection_id_bytes,
- QUICHE_ARRAYSIZE(original_connection_id_bytes));
+ ABSL_ARRAYSIZE(original_connection_id_bytes));
QuicConnectionId new_connection_id(new_connection_id_bytes,
- QUICHE_ARRAYSIZE(new_connection_id_bytes));
+ ABSL_ARRAYSIZE(new_connection_id_bytes));
- std::string retry_token(retry_token_bytes,
- QUICHE_ARRAYSIZE(retry_token_bytes));
+ std::string retry_token(retry_token_bytes, ABSL_ARRAYSIZE(retry_token_bytes));
if (invalid_retry_tag) {
// Flip the last bit of the retry packet to prevent the integrity tag
@@ -10205,7 +10384,11 @@ TEST_P(QuicConnectionTest, SendPingWhenSkipPacketNumberForPto) {
// PTO fires, verify a PING packet gets sent because there is no data to
// send.
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, QuicPacketNumber(3), _, _));
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
connection_.GetRetransmissionAlarm()->Fire();
EXPECT_EQ(1u, connection_.GetStats().pto_count);
EXPECT_EQ(0u, connection_.GetStats().crypto_retransmit_count);
@@ -10233,7 +10416,7 @@ TEST_P(QuicConnectionTest, DonotChangeQueuedAcks) {
frames.push_back(QuicFrame(QuicStreamFrame(
QuicUtils::GetFirstBidirectionalStreamId(
connection_.version().transport_version, Perspective::IS_CLIENT),
- false, 0u, quiche::QuicheStringPiece())));
+ false, 0u, absl::string_view())));
QuicAckFrame ack_frame = InitAckFrame(1);
frames.push_back(QuicFrame(&ack_frame));
// Receiving stream frame causes something to send.
@@ -10937,51 +11120,17 @@ TEST_P(QuicConnectionTest, SilentIdleTimeout) {
EXPECT_TRUE(connection_.connected());
EXPECT_TRUE(connection_.GetTimeoutAlarm()->IsSet());
- EXPECT_CALL(visitor_,
- OnConnectionClosed(_, ConnectionCloseSource::FROM_SELF));
- EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0);
- connection_.GetTimeoutAlarm()->Fire();
- if (GetQuicReloadableFlag(quic_add_silent_idle_timeout)) {
- // Verify the connection close packets get serialized and added to
- // termination packets list.
- EXPECT_NE(nullptr,
- QuicConnectionPeer::GetConnectionClosePacket(&connection_));
- } else {
- // Verify no connection close packet is serialized.
- EXPECT_EQ(nullptr,
- QuicConnectionPeer::GetConnectionClosePacket(&connection_));
- }
-}
-
-TEST_P(QuicConnectionTest, NoSilentClose) {
- SetQuicReloadableFlag(quic_add_silent_idle_timeout, false);
- set_perspective(Perspective::IS_SERVER);
- QuicPacketCreatorPeer::SetSendVersionInPacket(creator_, false);
- if (version().SupportsAntiAmplificationLimit()) {
- QuicConnectionPeer::SetAddressValidated(&connection_);
- }
-
- QuicConfig config;
- QuicTagVector connection_options;
- connection_options.push_back(kNSLC);
- config.SetInitialReceivedConnectionOptions(connection_options);
- QuicConfigPeer::SetNegotiated(&config, true);
- if (connection_.version().AuthenticatesHandshakeConnectionIds()) {
- QuicConfigPeer::SetReceivedOriginalConnectionId(
- &config, connection_.connection_id());
- QuicConfigPeer::SetReceivedInitialSourceConnectionId(&config,
- QuicConnectionId());
+ if (version().handshake_protocol == PROTOCOL_TLS1_3) {
+ EXPECT_CALL(visitor_, BeforeConnectionCloseSent());
}
- EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
- connection_.SetFromConfig(config);
-
- EXPECT_TRUE(connection_.connected());
- EXPECT_TRUE(connection_.GetTimeoutAlarm()->IsSet());
-
EXPECT_CALL(visitor_,
OnConnectionClosed(_, ConnectionCloseSource::FROM_SELF));
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0);
connection_.GetTimeoutAlarm()->Fire();
- TestConnectionCloseQuicErrorCode(QUIC_NETWORK_IDLE_TIMEOUT);
+ // Verify the connection close packets get serialized and added to
+ // termination packets list.
+ EXPECT_NE(nullptr,
+ QuicConnectionPeer::GetConnectionClosePacket(&connection_));
}
TEST_P(QuicConnectionTest, DonotSendPing) {
@@ -11009,7 +11158,7 @@ TEST_P(QuicConnectionTest, DonotSendPing) {
frames.push_back(QuicFrame(&ack_frame));
frames.push_back(QuicFrame(QuicStreamFrame(
GetNthClientInitiatedStreamId(0, connection_.transport_version()), true,
- 0u, quiche::QuicheStringPiece())));
+ 0u, absl::string_view())));
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(1);
@@ -11027,7 +11176,11 @@ TEST_P(QuicConnectionTest, DonotSendPing) {
EXPECT_CALL(visitor_, ShouldKeepConnectionAlive())
.WillRepeatedly(Return(false));
// Verify PING does not get sent.
- EXPECT_CALL(visitor_, SendPing()).Times(0);
+ if (GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0);
+ } else {
+ EXPECT_CALL(visitor_, SendPing()).Times(0);
+ }
connection_.GetPingAlarm()->Fire();
}
@@ -11038,7 +11191,6 @@ TEST_P(QuicConnectionTest, DuplicateAckCausesLostPackets) {
}
// Finish handshake.
connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
- peer_creator_.set_encryption_level(ENCRYPTION_FORWARD_SECURE);
notifier_.NeuterUnencryptedData();
connection_.NeuterUnencryptedPackets();
connection_.OnHandshakeComplete();
@@ -11144,8 +11296,6 @@ TEST_P(QuicConnectionTest, ShorterIdleTimeoutOnSentPackets) {
// Regression test for b/166255274
TEST_P(QuicConnectionTest,
ReserializeInitialPacketInCoalescerAfterDiscardingInitialKey) {
- SetQuicReloadableFlag(
- quic_neuter_initial_packet_in_coalescer_with_initial_key_discarded, true);
if (!connection_.version().CanSendCoalescedPackets() ||
!GetQuicReloadableFlag(quic_fix_missing_initial_keys2)) {
// Cannot set quic_fix_missing_initial_keys in the test since connection_ is
@@ -11174,9 +11324,6 @@ TEST_P(QuicConnectionTest,
// Flush pending ACKs.
connection_.GetAckAlarm()->Fire();
}
- // If not setting
- // quic_neuter_initial_packet_in_coalescer_with_initial_key_discarded, there
- // will be pending frames in the creator.
EXPECT_FALSE(connection_.packet_creator().HasPendingFrames());
// The ACK frame is deleted along with initial_packet_ in coalescer. Sending
// connection close would cause this (released) ACK frame be serialized (and
@@ -11186,6 +11333,178 @@ TEST_P(QuicConnectionTest,
EXPECT_TRUE(connection_.connected());
}
+TEST_P(QuicConnectionTest, SendPathChallenge) {
+ if (!VersionHasIetfQuicFrames(connection_.version().transport_version) ||
+ !connection_.send_path_response()) {
+ return;
+ }
+ PathProbeTestInit(Perspective::IS_CLIENT);
+ const QuicSocketAddress kNewSourceAddress(QuicIpAddress::Any6(), 12345);
+ EXPECT_NE(kNewSourceAddress, connection_.self_address());
+ TestPacketWriter new_writer(version(), &clock_, Perspective::IS_CLIENT);
+ QuicPathFrameBuffer payload;
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
+ .WillOnce(Invoke([&]() {
+ EXPECT_EQ(1u, new_writer.packets_write_attempts());
+ EXPECT_EQ(1u, new_writer.path_challenge_frames().size());
+ EXPECT_EQ(
+ 0, memcmp(payload.data(),
+ &(new_writer.path_challenge_frames().front().data_buffer),
+ sizeof(payload)));
+ EXPECT_EQ(1u, new_writer.padding_frames().size());
+ EXPECT_EQ(kNewSourceAddress.host(),
+ new_writer.last_write_source_address());
+ }));
+ connection_.SendPathChallenge(&payload, kNewSourceAddress,
+ connection_.peer_address(), &new_writer);
+ EXPECT_EQ(0u, writer_->packets_write_attempts());
+}
+
+TEST_P(QuicConnectionTest, SendPathChallengeUsingBlockedNewSocket) {
+ if (!VersionHasIetfQuicFrames(connection_.version().transport_version) ||
+ !connection_.send_path_response()) {
+ return;
+ }
+ PathProbeTestInit(Perspective::IS_CLIENT);
+ const QuicSocketAddress kNewSourceAddress(QuicIpAddress::Any6(), 12345);
+ EXPECT_NE(kNewSourceAddress, connection_.self_address());
+ TestPacketWriter new_writer(version(), &clock_, Perspective::IS_CLIENT);
+ new_writer.BlockOnNextWrite();
+ QuicPathFrameBuffer payload;
+ EXPECT_CALL(visitor_, OnWriteBlocked()).Times(0);
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
+ .WillOnce(Invoke([&]() {
+ // Even though the socket is blocked, the PATH_CHALLENGE should still be
+ // treated as sent.
+ EXPECT_EQ(1u, new_writer.packets_write_attempts());
+ EXPECT_EQ(1u, new_writer.path_challenge_frames().size());
+ EXPECT_EQ(
+ 0, memcmp(payload.data(),
+ &(new_writer.path_challenge_frames().front().data_buffer),
+ sizeof(payload)));
+ EXPECT_EQ(1u, new_writer.padding_frames().size());
+ EXPECT_EQ(kNewSourceAddress.host(),
+ new_writer.last_write_source_address());
+ }));
+ connection_.SendPathChallenge(&payload, kNewSourceAddress,
+ connection_.peer_address(), &new_writer);
+ EXPECT_EQ(0u, writer_->packets_write_attempts());
+
+ new_writer.SetWritable();
+ // Write event on the default socket shouldn't make any difference.
+ connection_.OnCanWrite();
+ EXPECT_EQ(0u, writer_->packets_write_attempts());
+ EXPECT_EQ(1u, new_writer.packets_write_attempts());
+}
+
+TEST_P(QuicConnectionTest, SendPathChallengeWithDefaultSocketBlocked) {
+ if (!VersionHasIetfQuicFrames(connection_.version().transport_version) ||
+ !connection_.send_path_response()) {
+ return;
+ }
+ PathProbeTestInit(Perspective::IS_SERVER);
+ if (version().SupportsAntiAmplificationLimit()) {
+ QuicConnectionPeer::SetAddressValidated(&connection_);
+ }
+ const QuicSocketAddress kNewPeerAddress(QuicIpAddress::Any6(), 12345);
+ writer_->BlockOnNextWrite();
+ QuicPathFrameBuffer payload;
+ // 1st time is after writer returns WRITE_STATUS_BLOCKED. 2nd time is in
+ // ShouldGeneratePacket();
+ EXPECT_CALL(visitor_, OnWriteBlocked()).Times(2u);
+ // This packet isn't sent actually, instead it is buffered in the connection.
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _))
+ .WillOnce(Invoke([&]() {
+ EXPECT_EQ(1u, writer_->path_challenge_frames().size());
+ EXPECT_EQ(
+ 0, memcmp(payload.data(),
+ &(writer_->path_challenge_frames().front().data_buffer),
+ sizeof(payload)));
+ EXPECT_EQ(1u, writer_->padding_frames().size());
+ EXPECT_EQ(kNewPeerAddress, writer_->last_write_peer_address());
+ }));
+ connection_.SendPathChallenge(&payload, connection_.self_address(),
+ kNewPeerAddress, writer_.get());
+ EXPECT_EQ(1u, writer_->packets_write_attempts());
+
+ memset(payload.data(), 0, sizeof(payload));
+ // Try again with the new socket blocked from the beginning. The 2nd
+ // PATH_CHALLENGE shouldn't be serialized, but be dropped.
+ connection_.SendPathChallenge(&payload, connection_.self_address(),
+ kNewPeerAddress, writer_.get());
+ // No more write attempt should be made.
+ EXPECT_EQ(1u, writer_->packets_write_attempts());
+
+ writer_->SetWritable();
+ // OnCanWrite() should actually write out the 1st PATH_CHALLENGE packet
+ // buffered earlier, thus incrementing the write counter.
+ connection_.OnCanWrite();
+ EXPECT_EQ(2u, writer_->packets_write_attempts());
+}
+
+// Tests that write error on the alternate socket should be ignored.
+TEST_P(QuicConnectionTest, SendPathChallengeFailOnNewSocket) {
+ if (!VersionHasIetfQuicFrames(connection_.version().transport_version) ||
+ !connection_.send_path_response()) {
+ return;
+ }
+ PathProbeTestInit(Perspective::IS_CLIENT);
+ const QuicSocketAddress kNewSourceAddress(QuicIpAddress::Any6(), 12345);
+ EXPECT_NE(kNewSourceAddress, connection_.self_address());
+ TestPacketWriter new_writer(version(), &clock_, Perspective::IS_CLIENT);
+ new_writer.SetShouldWriteFail();
+ QuicPathFrameBuffer payload;
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, ConnectionCloseSource::FROM_SELF))
+ .Times(0);
+
+ connection_.SendPathChallenge(&payload, kNewSourceAddress,
+ connection_.peer_address(), &new_writer);
+ // Regardless of the write error, the PATH_CHALLENGE should still be
+ // treated as sent.
+ EXPECT_EQ(1u, new_writer.packets_write_attempts());
+ EXPECT_EQ(1u, new_writer.path_challenge_frames().size());
+ EXPECT_EQ(0, memcmp(payload.data(),
+ &(new_writer.path_challenge_frames().front().data_buffer),
+ sizeof(payload)));
+ EXPECT_EQ(1u, new_writer.padding_frames().size());
+ EXPECT_EQ(kNewSourceAddress.host(), new_writer.last_write_source_address());
+ EXPECT_EQ(0u, writer_->packets_write_attempts());
+ EXPECT_TRUE(connection_.connected());
+}
+
+// Tests that write error while sending PATH_CHALLANGE from the default socket
+// should close the connection.
+TEST_P(QuicConnectionTest, SendPathChallengeFailOnDefaultPath) {
+ if (!VersionHasIetfQuicFrames(connection_.version().transport_version) ||
+ !connection_.send_path_response()) {
+ return;
+ }
+ PathProbeTestInit(Perspective::IS_CLIENT);
+ writer_->SetShouldWriteFail();
+ QuicPathFrameBuffer payload;
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, ConnectionCloseSource::FROM_SELF))
+ .WillOnce(
+ Invoke([](QuicConnectionCloseFrame frame, ConnectionCloseSource) {
+ EXPECT_EQ(QUIC_PACKET_WRITE_ERROR, frame.quic_error_code);
+ }));
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0u);
+ {
+ // Add a flusher to force flush, otherwise the frames will remain in the
+ // packet creator.
+ QuicConnection::ScopedPacketFlusher flusher(&connection_);
+ connection_.SendPathChallenge(&payload, connection_.self_address(),
+ connection_.peer_address(), writer_.get());
+ }
+ EXPECT_EQ(1u, writer_->packets_write_attempts());
+ EXPECT_EQ(1u, writer_->path_challenge_frames().size());
+ EXPECT_EQ(0, memcmp(payload.data(),
+ &(writer_->path_challenge_frames().front().data_buffer),
+ sizeof(payload)));
+ EXPECT_EQ(1u, writer_->padding_frames().size());
+ EXPECT_EQ(connection_.peer_address(), writer_->last_write_peer_address());
+ EXPECT_FALSE(connection_.connected());
+}
+
// Check that if there are two PATH_CHALLENGE frames in the packet, the latter
// one is ignored.
TEST_P(QuicConnectionTest, ReceiveMultiplePathChallenge) {
@@ -11207,8 +11526,8 @@ TEST_P(QuicConnectionTest, ReceiveMultiplePathChallenge) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -11253,7 +11572,8 @@ TEST_P(QuicConnectionTest, ReceiveMultiplePathChallenge) {
// address.
EXPECT_EQ(kPeerAddress, writer_->last_write_peer_address());
}));
- ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress);
+ ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
}
TEST_P(QuicConnectionTest, ReceiveStreamFrameBeforePathChallenge) {
@@ -11276,8 +11596,8 @@ TEST_P(QuicConnectionTest, ReceiveStreamFrameBeforePathChallenge) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -11302,7 +11622,8 @@ TEST_P(QuicConnectionTest, ReceiveStreamFrameBeforePathChallenge) {
NO_FIN);
}));
EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _));
- ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress);
+ ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
// Verify that this packet contains a STREAM_FRAME and a
// PATH_RESPONSE_FRAME.
@@ -11337,8 +11658,8 @@ TEST_P(QuicConnectionTest, ReceiveStreamFrameFollowingPathChallenge) {
} else {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -11382,7 +11703,8 @@ TEST_P(QuicConnectionTest, ReceiveStreamFrameFollowingPathChallenge) {
NO_FIN);
}));
- ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress);
+ ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
}
// Tests that a PATH_CHALLENGE is received in between other frames in an out of
@@ -11408,8 +11730,8 @@ TEST_P(QuicConnectionTest, PathChallengeWithDataInOutOfOrderPacket) {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
QuicPacketCreatorPeer::SetPacketNumber(&peer_creator_, 2);
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -11468,7 +11790,8 @@ TEST_P(QuicConnectionTest, PathChallengeWithDataInOutOfOrderPacket) {
// Lower the packet number so that receiving this packet shouldn't trigger
// peer migration.
QuicPacketCreatorPeer::SetPacketNumber(&peer_creator_, 1);
- ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress);
+ ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
}
// Tests that a PATH_CHALLENGE is cached if its PATH_RESPONSE can't be sent.
@@ -11493,8 +11816,8 @@ TEST_P(QuicConnectionTest, FailToWritePathResponse) {
EXPECT_CALL(visitor_, OnStreamFrame(_)).Times(AnyNumber());
}
QuicPacketCreatorPeer::SetPacketNumber(&peer_creator_, 2);
- ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress,
- kPeerAddress);
+ ProcessFramePacketWithAddresses(MakeCryptoFrame(), kSelfAddress, kPeerAddress,
+ ENCRYPTION_INITIAL);
EXPECT_EQ(kPeerAddress, connection_.peer_address());
EXPECT_EQ(kPeerAddress, connection_.effective_peer_address());
@@ -11510,7 +11833,8 @@ TEST_P(QuicConnectionTest, FailToWritePathResponse) {
QuicPacketCreatorPeer::SetPacketNumber(&peer_creator_, 1);
EXPECT_CALL(visitor_, OnWriteBlocked()).Times(AtLeast(1));
writer_->SetWriteBlocked();
- ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress);
+ ProcessFramesPacketWithAddresses(frames, kSelfAddress, kNewPeerAddress,
+ ENCRYPTION_FORWARD_SECURE);
EXPECT_EQ(
1u,
@@ -11601,6 +11925,10 @@ TEST_P(QuicConnectionTest, HandshakeDataDoesNotGetPtoed) {
if (!GetQuicReloadableFlag(quic_fix_missing_initial_keys2)) {
EXPECT_CALL(visitor_, OnHandshakePacketSent()).Times(1);
}
+ } else if (GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ if (!GetQuicReloadableFlag(quic_fix_missing_initial_keys2)) {
+ EXPECT_CALL(visitor_, OnHandshakePacketSent()).Times(1);
+ }
} else {
EXPECT_CALL(visitor_, OnHandshakePacketSent()).Times(0);
EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
@@ -11612,10 +11940,15 @@ TEST_P(QuicConnectionTest, HandshakeDataDoesNotGetPtoed) {
// Verify a handshake packet gets PTOed and 1-RTT packet gets coalesced.
EXPECT_EQ(0x03030303u, writer_->final_bytes_of_last_packet());
} else {
- // Verify an 1-RTT PING gets sent because there is nothing to PTO, bummer,
- // since this 1-RTT PING cannot be processed by peer and there is a
- // deadlock.
- EXPECT_EQ(0x03030303u, writer_->final_bytes_of_last_packet());
+ if (GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ // Verify PING is sent in the right encryption level.
+ EXPECT_EQ(0x02020202u, writer_->final_bytes_of_last_packet());
+ } else {
+ // Verify an 1-RTT PING gets sent because there is nothing to PTO, bummer,
+ // since this 1-RTT PING cannot be processed by peer and there is a
+ // deadlock.
+ EXPECT_EQ(0x03030303u, writer_->final_bytes_of_last_packet());
+ }
EXPECT_FALSE(writer_->ping_frames().empty());
}
}
@@ -11704,14 +12037,18 @@ TEST_P(QuicConnectionTest, ZeroRttRejectionAndMissingInitialKeys) {
EXPECT_TRUE(connection_.GetRetransmissionAlarm()->IsSet());
// Fire retransmission alarm.
- EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() { SendPing(); }));
+ if (!GetQuicReloadableFlag(quic_let_connection_handle_pings)) {
+ EXPECT_CALL(visitor_, SendPing()).WillOnce(Invoke([this]() {
+ SendPing();
+ }));
+ }
connection_.GetRetransmissionAlarm()->Fire();
QuicFrames frames1;
frames1.push_back(QuicFrame(&crypto_frame_));
QuicFrames frames2;
QuicCryptoFrame crypto_frame(ENCRYPTION_HANDSHAKE, 0,
- quiche::QuicheStringPiece(data1));
+ absl::string_view(data1));
frames2.push_back(QuicFrame(&crypto_frame));
ProcessCoalescedPacket(
{{2, frames1, ENCRYPTION_INITIAL}, {3, frames2, ENCRYPTION_HANDSHAKE}});
@@ -11742,7 +12079,7 @@ TEST_P(QuicConnectionTest, OnZeroRttPacketAcked) {
QuicFrames frames2;
QuicCryptoFrame crypto_frame(ENCRYPTION_HANDSHAKE, 0,
- quiche::QuicheStringPiece(data1));
+ absl::string_view(data1));
frames2.push_back(QuicFrame(&crypto_frame));
EXPECT_CALL(debug_visitor, OnZeroRttPacketAcked()).Times(0);
EXPECT_CALL(visitor_, OnCryptoFrame(_)).Times(1);
@@ -11764,6 +12101,849 @@ TEST_P(QuicConnectionTest, OnZeroRttPacketAcked) {
ProcessCoalescedPacket({{4, frames4, ENCRYPTION_FORWARD_SECURE}});
}
+TEST_P(QuicConnectionTest, InitiateKeyUpdate) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ TransportParameters params;
+ params.key_update_not_yet_supported = false;
+ QuicConfig config;
+ std::string error_details;
+ EXPECT_THAT(config.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ config.SetKeyUpdateSupportedLocally();
+ QuicConfigPeer::SetNegotiated(&config, true);
+ if (connection_.version().AuthenticatesHandshakeConnectionIds()) {
+ QuicConfigPeer::SetReceivedOriginalConnectionId(
+ &config, connection_.connection_id());
+ QuicConfigPeer::SetReceivedInitialSourceConnectionId(
+ &config, connection_.connection_id());
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+
+ EXPECT_FALSE(connection_.IsKeyUpdateAllowed());
+
+ MockFramerVisitor peer_framer_visitor_;
+ peer_framer_.set_visitor(&peer_framer_visitor_);
+
+ use_tagging_decrypter();
+
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(0x01));
+ SetDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(0x01));
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(0x01));
+
+ // Key update should still not be allowed, since no packet has been acked
+ // from the current key phase.
+ EXPECT_FALSE(connection_.IsKeyUpdateAllowed());
+ EXPECT_FALSE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+
+ // Send packet 1.
+ QuicPacketNumber last_packet;
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_EQ(QuicPacketNumber(1u), last_packet);
+
+ // Key update should still not be allowed, even though a packet was sent in
+ // the current key phase it hasn't been acked yet.
+ EXPECT_FALSE(connection_.IsKeyUpdateAllowed());
+ EXPECT_TRUE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+
+ EXPECT_FALSE(connection_.GetDiscardPreviousOneRttKeysAlarm()->IsSet());
+ // Receive ack for packet 1.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame1 = InitAckFrame(1);
+ ProcessAckPacket(&frame1);
+
+ // OnDecryptedFirstPacketInKeyPhase is called even on the first key phase,
+ // so discard_previous_keys_alarm_ should be set now.
+ EXPECT_TRUE(connection_.GetDiscardPreviousOneRttKeysAlarm()->IsSet());
+ EXPECT_FALSE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+
+ // Key update should now be allowed.
+ EXPECT_CALL(visitor_, AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce(
+ []() { return std::make_unique<StrictTaggingDecrypter>(0x02); });
+ EXPECT_CALL(visitor_, CreateCurrentOneRttEncrypter()).WillOnce([]() {
+ return std::make_unique<TaggingEncrypter>(0x02);
+ });
+ EXPECT_CALL(visitor_, OnKeyUpdate(KeyUpdateReason::kLocalForTests));
+ EXPECT_TRUE(connection_.InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+ // discard_previous_keys_alarm_ should not be set until a packet from the new
+ // key phase has been received. (The alarm that was set above should be
+ // cleared if it hasn't fired before the next key update happened.)
+ EXPECT_FALSE(connection_.GetDiscardPreviousOneRttKeysAlarm()->IsSet());
+ EXPECT_FALSE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+
+ // Pretend that peer accepts the key update.
+ EXPECT_CALL(peer_framer_visitor_,
+ AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce(
+ []() { return std::make_unique<StrictTaggingDecrypter>(0x02); });
+ EXPECT_CALL(peer_framer_visitor_, CreateCurrentOneRttEncrypter())
+ .WillOnce([]() { return std::make_unique<TaggingEncrypter>(0x02); });
+ peer_framer_.SetKeyUpdateSupportForConnection(true);
+ peer_framer_.DoKeyUpdate(KeyUpdateReason::kRemote);
+
+ // Another key update should not be allowed yet.
+ EXPECT_FALSE(connection_.IsKeyUpdateAllowed());
+
+ // Send packet 2.
+ SendStreamDataToPeer(2, "bar", 0, NO_FIN, &last_packet);
+ EXPECT_EQ(QuicPacketNumber(2u), last_packet);
+ EXPECT_TRUE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+ // Receive ack for packet 2.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame2 = InitAckFrame(2);
+ ProcessAckPacket(&frame2);
+ EXPECT_TRUE(connection_.GetDiscardPreviousOneRttKeysAlarm()->IsSet());
+ EXPECT_FALSE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+
+ // Key update should be allowed again now that a packet has been acked from
+ // the current key phase.
+ EXPECT_CALL(visitor_, AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce(
+ []() { return std::make_unique<StrictTaggingDecrypter>(0x03); });
+ EXPECT_CALL(visitor_, CreateCurrentOneRttEncrypter()).WillOnce([]() {
+ return std::make_unique<TaggingEncrypter>(0x03);
+ });
+ EXPECT_CALL(visitor_, OnKeyUpdate(KeyUpdateReason::kLocalForTests));
+ EXPECT_TRUE(connection_.InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+
+ // Pretend that peer accepts the key update.
+ EXPECT_CALL(peer_framer_visitor_,
+ AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce(
+ []() { return std::make_unique<StrictTaggingDecrypter>(0x03); });
+ EXPECT_CALL(peer_framer_visitor_, CreateCurrentOneRttEncrypter())
+ .WillOnce([]() { return std::make_unique<TaggingEncrypter>(0x03); });
+ peer_framer_.DoKeyUpdate(KeyUpdateReason::kRemote);
+
+ // Another key update should not be allowed yet.
+ EXPECT_FALSE(connection_.IsKeyUpdateAllowed());
+
+ // Send packet 3.
+ SendStreamDataToPeer(3, "baz", 0, NO_FIN, &last_packet);
+ EXPECT_EQ(QuicPacketNumber(3u), last_packet);
+
+ // Another key update should not be allowed yet.
+ EXPECT_FALSE(connection_.IsKeyUpdateAllowed());
+ EXPECT_TRUE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+
+ // Receive ack for packet 3.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame3 = InitAckFrame(3);
+ ProcessAckPacket(&frame3);
+ EXPECT_TRUE(connection_.GetDiscardPreviousOneRttKeysAlarm()->IsSet());
+ EXPECT_FALSE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+
+ // Key update should be allowed now.
+ EXPECT_CALL(visitor_, AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce(
+ []() { return std::make_unique<StrictTaggingDecrypter>(0x04); });
+ EXPECT_CALL(visitor_, CreateCurrentOneRttEncrypter()).WillOnce([]() {
+ return std::make_unique<TaggingEncrypter>(0x04);
+ });
+ EXPECT_CALL(visitor_, OnKeyUpdate(KeyUpdateReason::kLocalForTests));
+ EXPECT_TRUE(connection_.InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+ EXPECT_FALSE(connection_.GetDiscardPreviousOneRttKeysAlarm()->IsSet());
+ EXPECT_FALSE(connection_.HaveSentPacketsInCurrentKeyPhaseButNoneAcked());
+}
+
+TEST_P(QuicConnectionTest, InitiateKeyUpdateApproachingConfidentialityLimit) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+ SetQuicFlag(FLAGS_quic_key_update_confidentiality_limit, 3U);
+
+ std::string error_details;
+ TransportParameters params;
+ // Key update is enabled.
+ params.key_update_not_yet_supported = false;
+ QuicConfig config;
+ EXPECT_THAT(config.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ config.SetKeyUpdateSupportedLocally();
+ QuicConfigPeer::SetNegotiated(&config, true);
+ if (connection_.version().AuthenticatesHandshakeConnectionIds()) {
+ QuicConfigPeer::SetReceivedOriginalConnectionId(
+ &config, connection_.connection_id());
+ QuicConfigPeer::SetReceivedInitialSourceConnectionId(
+ &config, connection_.connection_id());
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+
+ MockFramerVisitor peer_framer_visitor_;
+ peer_framer_.set_visitor(&peer_framer_visitor_);
+
+ use_tagging_decrypter();
+
+ uint8_t current_tag = 0x01;
+
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(current_tag));
+ SetDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(current_tag));
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+
+ peer_framer_.SetKeyUpdateSupportForConnection(true);
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(current_tag));
+
+ const QuicConnectionStats& stats = connection_.GetStats();
+
+ for (int packet_num = 1; packet_num <= 8; ++packet_num) {
+ if (packet_num == 3 || packet_num == 6) {
+ current_tag++;
+ EXPECT_CALL(visitor_, AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce([current_tag]() {
+ return std::make_unique<StrictTaggingDecrypter>(current_tag);
+ });
+ EXPECT_CALL(visitor_, CreateCurrentOneRttEncrypter())
+ .WillOnce([current_tag]() {
+ return std::make_unique<TaggingEncrypter>(current_tag);
+ });
+ EXPECT_CALL(visitor_,
+ OnKeyUpdate(KeyUpdateReason::kLocalKeyUpdateLimitOverride));
+ }
+ // Send packet.
+ QuicPacketNumber last_packet;
+ SendStreamDataToPeer(packet_num, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_EQ(QuicPacketNumber(packet_num), last_packet);
+ if (packet_num >= 6) {
+ EXPECT_EQ(2U, stats.key_update_count);
+ } else if (packet_num >= 3) {
+ EXPECT_EQ(1U, stats.key_update_count);
+ } else {
+ EXPECT_EQ(0U, stats.key_update_count);
+ }
+
+ if (packet_num == 4 || packet_num == 7) {
+ // Pretend that peer accepts the key update.
+ EXPECT_CALL(peer_framer_visitor_,
+ AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce([current_tag]() {
+ return std::make_unique<StrictTaggingDecrypter>(current_tag);
+ });
+ EXPECT_CALL(peer_framer_visitor_, CreateCurrentOneRttEncrypter())
+ .WillOnce([current_tag]() {
+ return std::make_unique<TaggingEncrypter>(current_tag);
+ });
+ peer_framer_.DoKeyUpdate(KeyUpdateReason::kRemote);
+ }
+ // Receive ack for packet.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame1 = InitAckFrame(packet_num);
+ ProcessAckPacket(&frame1);
+ }
+}
+
+TEST_P(QuicConnectionTest,
+ CloseConnectionOnConfidentialityLimitKeyUpdateNotAllowed) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+ // Set key update confidentiality limit to 1 packet.
+ SetQuicFlag(FLAGS_quic_key_update_confidentiality_limit, 1U);
+ // Use confidentiality limit for connection close of 3 packets.
+ constexpr size_t kConfidentialityLimit = 3U;
+
+ std::string error_details;
+ TransportParameters params;
+ // Key update is enabled.
+ params.key_update_not_yet_supported = false;
+ QuicConfig config;
+ EXPECT_THAT(config.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ config.SetKeyUpdateSupportedLocally();
+ QuicConfigPeer::SetNegotiated(&config, true);
+ if (connection_.version().AuthenticatesHandshakeConnectionIds()) {
+ QuicConfigPeer::SetReceivedOriginalConnectionId(
+ &config, connection_.connection_id());
+ QuicConfigPeer::SetReceivedInitialSourceConnectionId(
+ &config, connection_.connection_id());
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ connection_.SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypterWithConfidentialityLimit>(
+ Perspective::IS_CLIENT, kConfidentialityLimit));
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+
+ QuicPacketNumber last_packet;
+ // Send 3 packets without receiving acks for any of them. Key update will not
+ // be allowed, so the confidentiality limit should be reached, forcing the
+ // connection to be closed.
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_TRUE(connection_.connected());
+ SendStreamDataToPeer(2, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_TRUE(connection_.connected());
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_FALSE(connection_.connected());
+ const QuicConnectionStats& stats = connection_.GetStats();
+ EXPECT_EQ(0U, stats.key_update_count);
+ TestConnectionCloseQuicErrorCode(QUIC_AEAD_LIMIT_REACHED);
+}
+
+TEST_P(QuicConnectionTest,
+ CloseConnectionOnConfidentialityLimitKeyUpdateNotSupportedByPeer) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+ // Set key update confidentiality limit to 1 packet.
+ SetQuicFlag(FLAGS_quic_key_update_confidentiality_limit, 1U);
+ // Use confidentiality limit for connection close of 3 packets.
+ constexpr size_t kConfidentialityLimit = 3U;
+
+ std::string error_details;
+ TransportParameters params;
+ // Key update not enabled for this connection as peer doesn't support it.
+ params.key_update_not_yet_supported = true;
+ QuicConfig config;
+ EXPECT_THAT(config.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ // Key update is supported locally.
+ config.SetKeyUpdateSupportedLocally();
+ QuicConfigPeer::SetNegotiated(&config, true);
+ if (connection_.version().AuthenticatesHandshakeConnectionIds()) {
+ QuicConfigPeer::SetReceivedOriginalConnectionId(
+ &config, connection_.connection_id());
+ QuicConfigPeer::SetReceivedInitialSourceConnectionId(
+ &config, connection_.connection_id());
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ connection_.SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypterWithConfidentialityLimit>(
+ Perspective::IS_CLIENT, kConfidentialityLimit));
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+
+ QuicPacketNumber last_packet;
+ // Send 3 packets and receive acks for them. Since key update is not enabled
+ // the confidentiality limit should be reached, forcing the connection to be
+ // closed.
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_TRUE(connection_.connected());
+ // Receive ack for packet.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame1 = InitAckFrame(1);
+ ProcessAckPacket(&frame1);
+
+ SendStreamDataToPeer(2, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_TRUE(connection_.connected());
+ // Receive ack for packet.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame2 = InitAckFrame(2);
+ ProcessAckPacket(&frame2);
+
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_FALSE(connection_.connected());
+ const QuicConnectionStats& stats = connection_.GetStats();
+ EXPECT_EQ(0U, stats.key_update_count);
+ TestConnectionCloseQuicErrorCode(QUIC_AEAD_LIMIT_REACHED);
+}
+
+TEST_P(QuicConnectionTest,
+ CloseConnectionOnConfidentialityLimitKeyUpdateNotEnabledLocally) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+ // Set key update confidentiality limit to 1 packet.
+ SetQuicFlag(FLAGS_quic_key_update_confidentiality_limit, 1U);
+ // Use confidentiality limit for connection close of 3 packets.
+ constexpr size_t kConfidentialityLimit = 3U;
+
+ std::string error_details;
+ TransportParameters params;
+ // Key update is supported by peer but not locally
+ // (config.SetKeyUpdateSupportedLocally is not called.)
+ params.key_update_not_yet_supported = false;
+ QuicConfig config;
+ EXPECT_THAT(config.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ QuicConfigPeer::SetNegotiated(&config, true);
+ if (connection_.version().AuthenticatesHandshakeConnectionIds()) {
+ QuicConfigPeer::SetReceivedOriginalConnectionId(
+ &config, connection_.connection_id());
+ QuicConfigPeer::SetReceivedInitialSourceConnectionId(
+ &config, connection_.connection_id());
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ connection_.SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypterWithConfidentialityLimit>(
+ Perspective::IS_CLIENT, kConfidentialityLimit));
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+
+ QuicPacketNumber last_packet;
+ // Send 3 packets and receive acks for them. Since key update is not enabled
+ // the confidentiality limit should be reached, forcing the connection to be
+ // closed.
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_TRUE(connection_.connected());
+ // Receive ack for packet.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame1 = InitAckFrame(1);
+ ProcessAckPacket(&frame1);
+
+ SendStreamDataToPeer(2, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_TRUE(connection_.connected());
+ // Receive ack for packet.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame2 = InitAckFrame(2);
+ ProcessAckPacket(&frame2);
+
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
+ SendStreamDataToPeer(3, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_FALSE(connection_.connected());
+ const QuicConnectionStats& stats = connection_.GetStats();
+ EXPECT_EQ(0U, stats.key_update_count);
+ TestConnectionCloseQuicErrorCode(QUIC_AEAD_LIMIT_REACHED);
+}
+
+TEST_P(QuicConnectionTest, CloseConnectionOnIntegrityLimitDuringHandshake) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+
+ constexpr uint8_t correct_tag = 0x01;
+ constexpr uint8_t wrong_tag = 0xFE;
+ constexpr QuicPacketCount kIntegrityLimit = 3;
+
+ SetDecrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<StrictTaggingDecrypterWithIntegrityLimit>(
+ correct_tag, kIntegrityLimit));
+ connection_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(correct_tag));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_HANDSHAKE);
+ peer_framer_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(wrong_tag));
+ for (uint64_t i = 1; i <= kIntegrityLimit; ++i) {
+ EXPECT_TRUE(connection_.connected());
+ if (i == kIntegrityLimit) {
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
+ EXPECT_CALL(visitor_, OnHandshakePacketSent()).Times(AnyNumber());
+ }
+ ProcessDataPacketAtLevel(i, !kHasStopWaiting, ENCRYPTION_HANDSHAKE);
+ EXPECT_EQ(
+ i, connection_.GetStats().num_failed_authentication_packets_received);
+ }
+ EXPECT_FALSE(connection_.connected());
+ TestConnectionCloseQuicErrorCode(QUIC_AEAD_LIMIT_REACHED);
+}
+
+TEST_P(QuicConnectionTest, CloseConnectionOnIntegrityLimitAfterHandshake) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+
+ constexpr uint8_t correct_tag = 0x01;
+ constexpr uint8_t wrong_tag = 0xFE;
+ constexpr QuicPacketCount kIntegrityLimit = 3;
+
+ use_tagging_decrypter();
+ SetDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypterWithIntegrityLimit>(
+ correct_tag, kIntegrityLimit));
+ connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(correct_tag));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+ connection_.RemoveEncrypter(ENCRYPTION_INITIAL);
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(wrong_tag));
+ for (uint64_t i = 1; i <= kIntegrityLimit; ++i) {
+ EXPECT_TRUE(connection_.connected());
+ if (i == kIntegrityLimit) {
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
+ }
+ ProcessDataPacketAtLevel(i, !kHasStopWaiting, ENCRYPTION_FORWARD_SECURE);
+ EXPECT_EQ(
+ i, connection_.GetStats().num_failed_authentication_packets_received);
+ }
+ EXPECT_FALSE(connection_.connected());
+ TestConnectionCloseQuicErrorCode(QUIC_AEAD_LIMIT_REACHED);
+}
+
+TEST_P(QuicConnectionTest,
+ CloseConnectionOnIntegrityLimitAcrossEncryptionLevels) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+
+ constexpr uint8_t correct_tag = 0x01;
+ constexpr uint8_t wrong_tag = 0xFE;
+ constexpr QuicPacketCount kIntegrityLimit = 4;
+
+ use_tagging_decrypter();
+ SetDecrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<StrictTaggingDecrypterWithIntegrityLimit>(
+ correct_tag, kIntegrityLimit));
+ connection_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(correct_tag));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_HANDSHAKE);
+ peer_framer_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(wrong_tag));
+ for (uint64_t i = 1; i <= 2; ++i) {
+ EXPECT_TRUE(connection_.connected());
+ ProcessDataPacketAtLevel(i, !kHasStopWaiting, ENCRYPTION_HANDSHAKE);
+ EXPECT_EQ(
+ i, connection_.GetStats().num_failed_authentication_packets_received);
+ }
+
+ SetDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypterWithIntegrityLimit>(
+ correct_tag, kIntegrityLimit));
+ connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(correct_tag));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+ connection_.RemoveEncrypter(ENCRYPTION_INITIAL);
+ connection_.RemoveEncrypter(ENCRYPTION_HANDSHAKE);
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(wrong_tag));
+ for (uint64_t i = 3; i <= kIntegrityLimit; ++i) {
+ EXPECT_TRUE(connection_.connected());
+ if (i == kIntegrityLimit) {
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
+ }
+ ProcessDataPacketAtLevel(i, !kHasStopWaiting, ENCRYPTION_FORWARD_SECURE);
+ EXPECT_EQ(
+ i, connection_.GetStats().num_failed_authentication_packets_received);
+ }
+ EXPECT_FALSE(connection_.connected());
+ TestConnectionCloseQuicErrorCode(QUIC_AEAD_LIMIT_REACHED);
+}
+
+TEST_P(QuicConnectionTest, IntegrityLimitDoesNotApplyWithoutDecryptionKey) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+
+ constexpr uint8_t correct_tag = 0x01;
+ constexpr uint8_t wrong_tag = 0xFE;
+ constexpr QuicPacketCount kIntegrityLimit = 3;
+
+ use_tagging_decrypter();
+ SetDecrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<StrictTaggingDecrypterWithIntegrityLimit>(
+ correct_tag, kIntegrityLimit));
+ connection_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(correct_tag));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_HANDSHAKE);
+ connection_.RemoveDecrypter(ENCRYPTION_FORWARD_SECURE);
+
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(wrong_tag));
+ for (uint64_t i = 1; i <= kIntegrityLimit * 2; ++i) {
+ EXPECT_TRUE(connection_.connected());
+ ProcessDataPacketAtLevel(i, !kHasStopWaiting, ENCRYPTION_FORWARD_SECURE);
+ EXPECT_EQ(
+ 0u, connection_.GetStats().num_failed_authentication_packets_received);
+ }
+ EXPECT_TRUE(connection_.connected());
+}
+
+TEST_P(QuicConnectionTest, CloseConnectionOnIntegrityLimitAcrossKeyPhases) {
+ if (!connection_.version().UsesTls()) {
+ return;
+ }
+
+ constexpr QuicPacketCount kIntegrityLimit = 4;
+
+ QuicConnectionPeer::SetEnableAeadLimits(&connection_, true);
+ TransportParameters params;
+ params.key_update_not_yet_supported = false;
+ QuicConfig config;
+ std::string error_details;
+ EXPECT_THAT(config.ProcessTransportParameters(
+ params, /* is_resumption = */ false, &error_details),
+ IsQuicNoError());
+ config.SetKeyUpdateSupportedLocally();
+ QuicConfigPeer::SetNegotiated(&config, true);
+ if (connection_.version().AuthenticatesHandshakeConnectionIds()) {
+ QuicConfigPeer::SetReceivedOriginalConnectionId(
+ &config, connection_.connection_id());
+ QuicConfigPeer::SetReceivedInitialSourceConnectionId(
+ &config, connection_.connection_id());
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+
+ MockFramerVisitor peer_framer_visitor_;
+ peer_framer_.set_visitor(&peer_framer_visitor_);
+
+ use_tagging_decrypter();
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ connection_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(0x01));
+ SetDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypterWithIntegrityLimit>(
+ 0x01, kIntegrityLimit));
+ EXPECT_CALL(visitor_, GetHandshakeState())
+ .WillRepeatedly(Return(HANDSHAKE_CONFIRMED));
+ connection_.OnHandshakeComplete();
+ connection_.RemoveEncrypter(ENCRYPTION_INITIAL);
+
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(0xFF));
+ for (uint64_t i = 1; i <= 2; ++i) {
+ EXPECT_TRUE(connection_.connected());
+ ProcessDataPacketAtLevel(i, !kHasStopWaiting, ENCRYPTION_FORWARD_SECURE);
+ EXPECT_EQ(
+ i, connection_.GetStats().num_failed_authentication_packets_received);
+ }
+
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(0x01));
+ // Send packet 1.
+ QuicPacketNumber last_packet;
+ SendStreamDataToPeer(1, "foo", 0, NO_FIN, &last_packet);
+ EXPECT_EQ(QuicPacketNumber(1u), last_packet);
+ // Receive ack for packet 1.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame1 = InitAckFrame(1);
+ ProcessAckPacket(&frame1);
+ // Key update should now be allowed, initiate it.
+ EXPECT_CALL(visitor_, AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce([kIntegrityLimit]() {
+ return std::make_unique<StrictTaggingDecrypterWithIntegrityLimit>(
+ 0x02, kIntegrityLimit);
+ });
+ EXPECT_CALL(visitor_, CreateCurrentOneRttEncrypter()).WillOnce([]() {
+ return std::make_unique<TaggingEncrypter>(0x02);
+ });
+ EXPECT_CALL(visitor_, OnKeyUpdate(KeyUpdateReason::kLocalForTests));
+ EXPECT_TRUE(connection_.InitiateKeyUpdate(KeyUpdateReason::kLocalForTests));
+
+ // Pretend that peer accepts the key update.
+ EXPECT_CALL(peer_framer_visitor_,
+ AdvanceKeysAndCreateCurrentOneRttDecrypter())
+ .WillOnce(
+ []() { return std::make_unique<StrictTaggingDecrypter>(0x02); });
+ EXPECT_CALL(peer_framer_visitor_, CreateCurrentOneRttEncrypter())
+ .WillOnce([]() { return std::make_unique<TaggingEncrypter>(0x02); });
+ peer_framer_.SetKeyUpdateSupportForConnection(true);
+ peer_framer_.DoKeyUpdate(KeyUpdateReason::kLocalForTests);
+
+ // Send packet 2.
+ SendStreamDataToPeer(2, "bar", 0, NO_FIN, &last_packet);
+ EXPECT_EQ(QuicPacketNumber(2u), last_packet);
+ // Receive ack for packet 2.
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
+ QuicAckFrame frame2 = InitAckFrame(2);
+ ProcessAckPacket(&frame2);
+
+ EXPECT_EQ(2u,
+ connection_.GetStats().num_failed_authentication_packets_received);
+
+ // Do two more undecryptable packets. Integrity limit should be reached.
+ peer_framer_.SetEncrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<TaggingEncrypter>(0xFF));
+ for (uint64_t i = 3; i <= kIntegrityLimit; ++i) {
+ EXPECT_TRUE(connection_.connected());
+ if (i == kIntegrityLimit) {
+ EXPECT_CALL(visitor_, OnConnectionClosed(_, _));
+ }
+ ProcessDataPacketAtLevel(i, !kHasStopWaiting, ENCRYPTION_FORWARD_SECURE);
+ EXPECT_EQ(
+ i, connection_.GetStats().num_failed_authentication_packets_received);
+ }
+ EXPECT_FALSE(connection_.connected());
+ TestConnectionCloseQuicErrorCode(QUIC_AEAD_LIMIT_REACHED);
+}
+
+TEST_P(QuicConnectionTest, SendAckFrequencyFrame) {
+ if (!version().HasIetfQuicFrames()) {
+ return;
+ }
+ SetQuicReloadableFlag(quic_can_send_ack_frequency, true);
+ set_perspective(Perspective::IS_SERVER);
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(_, _, _, _, _))
+ .Times(AnyNumber());
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
+
+ QuicConfig config;
+ QuicConfigPeer::SetReceivedMinAckDelayMs(&config, /*min_ack_delay_ms=*/1);
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+ QuicConnectionPeer::SetAddressValidated(&connection_);
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ peer_creator_.set_encryption_level(ENCRYPTION_FORWARD_SECURE);
+
+ connection_.OnHandshakeComplete();
+
+ writer_->SetWritable();
+ QuicPacketCreatorPeer::SetPacketNumber(creator_, 99);
+ // Send packet 100
+ SendStreamDataToPeer(/*id=*/1, "foo", /*offset=*/0, NO_FIN, nullptr);
+
+ QuicAckFrequencyFrame captured_frame;
+ EXPECT_CALL(visitor_, SendAckFrequency(_))
+ .WillOnce(Invoke([&captured_frame](const QuicAckFrequencyFrame& frame) {
+ captured_frame = frame;
+ }));
+ // Send packet 101.
+ SendStreamDataToPeer(/*id=*/1, "bar", /*offset=*/3, NO_FIN, nullptr);
+
+ EXPECT_EQ(captured_frame.packet_tolerance, 10u);
+ EXPECT_EQ(captured_frame.max_ack_delay,
+ QuicTime::Delta::FromMilliseconds(kDefaultDelayedAckTimeMs));
+
+ // Sending packet 102 does not trigger sending another AckFrequencyFrame.
+ SendStreamDataToPeer(/*id=*/1, "baz", /*offset=*/6, NO_FIN, nullptr);
+}
+
+TEST_P(QuicConnectionTest, SendAckFrequencyFrameUponHandshakeCompletion) {
+ if (!version().HasIetfQuicFrames()) {
+ return;
+ }
+ SetQuicReloadableFlag(quic_can_send_ack_frequency, true);
+ set_perspective(Perspective::IS_SERVER);
+ EXPECT_CALL(*send_algorithm_, OnCongestionEvent(_, _, _, _, _))
+ .Times(AnyNumber());
+ EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(AnyNumber());
+
+ QuicConfig config;
+ QuicConfigPeer::SetReceivedMinAckDelayMs(&config, /*min_ack_delay_ms=*/1);
+ QuicTagVector quic_tag_vector;
+ // Enable sending AckFrequency upon handshake completion.
+ quic_tag_vector.push_back(kAFF2);
+ QuicConfigPeer::SetReceivedConnectionOptions(&config, quic_tag_vector);
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ connection_.SetFromConfig(config);
+ QuicConnectionPeer::SetAddressValidated(&connection_);
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
+ peer_creator_.set_encryption_level(ENCRYPTION_FORWARD_SECURE);
+
+ QuicAckFrequencyFrame captured_frame;
+ EXPECT_CALL(visitor_, SendAckFrequency(_))
+ .WillOnce(Invoke([&captured_frame](const QuicAckFrequencyFrame& frame) {
+ captured_frame = frame;
+ }));
+
+ connection_.OnHandshakeComplete();
+
+ EXPECT_EQ(captured_frame.packet_tolerance, 2u);
+ EXPECT_EQ(captured_frame.max_ack_delay,
+ QuicTime::Delta::FromMilliseconds(kDefaultDelayedAckTimeMs));
+}
+
+TEST_P(QuicConnectionTest, FastRecoveryOfLostServerHello) {
+ if (!connection_.SupportsMultiplePacketNumberSpaces()) {
+ return;
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ QuicConfig config;
+ connection_.SetFromConfig(config);
+
+ use_tagging_decrypter();
+ connection_.SetEncrypter(ENCRYPTION_INITIAL,
+ std::make_unique<TaggingEncrypter>(0x01));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
+ connection_.SendCryptoStreamData();
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(20));
+
+ // Assume ServerHello gets lost.
+ peer_framer_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(0x02));
+ ProcessCryptoPacketAtLevel(2, ENCRYPTION_HANDSHAKE);
+ ASSERT_TRUE(connection_.GetRetransmissionAlarm()->IsSet());
+ // Shorten PTO for fast recovery from lost ServerHello.
+ EXPECT_EQ(clock_.ApproximateNow() + kAlarmGranularity,
+ connection_.GetRetransmissionAlarm()->deadline());
+}
+
+TEST_P(QuicConnectionTest, ServerHelloGetsReordered) {
+ if (!connection_.SupportsMultiplePacketNumberSpaces()) {
+ return;
+ }
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ QuicConfig config;
+ connection_.SetFromConfig(config);
+ EXPECT_CALL(visitor_, OnCryptoFrame(_))
+ .WillRepeatedly(Invoke([=](const QuicCryptoFrame& frame) {
+ if (frame.level == ENCRYPTION_INITIAL) {
+ // Install handshake read keys.
+ SetDecrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<StrictTaggingDecrypter>(0x02));
+ connection_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(0x02));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_HANDSHAKE);
+ }
+ }));
+
+ use_tagging_decrypter();
+ connection_.SetEncrypter(ENCRYPTION_INITIAL,
+ std::make_unique<TaggingEncrypter>(0x01));
+ connection_.SetDefaultEncryptionLevel(ENCRYPTION_INITIAL);
+ connection_.SendCryptoStreamData();
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(20));
+
+ // Assume ServerHello gets reordered.
+ peer_framer_.SetEncrypter(ENCRYPTION_HANDSHAKE,
+ std::make_unique<TaggingEncrypter>(0x02));
+ ProcessCryptoPacketAtLevel(2, ENCRYPTION_HANDSHAKE);
+ ProcessCryptoPacketAtLevel(1, ENCRYPTION_INITIAL);
+ // Verify fast recovery is not enabled.
+ EXPECT_EQ(connection_.sent_packet_manager().GetRetransmissionTime(),
+ connection_.GetRetransmissionAlarm()->deadline());
+}
+
} // namespace
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_constants.h b/chromium/net/third_party/quiche/src/quic/core/quic_constants.h
index eaf0170c7ac..4cd6ba59901 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_constants.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_constants.h
@@ -89,8 +89,8 @@ const QuicByteCount kDefaultSocketReceiveBuffer = 1024 * 1024;
// Don't allow a client to suggest an RTT shorter than 10ms.
const uint32_t kMinInitialRoundTripTimeUs = 10 * kNumMicrosPerMilli;
-// Don't allow a client to suggest an RTT longer than 15 seconds.
-const uint32_t kMaxInitialRoundTripTimeUs = 15 * kNumMicrosPerSecond;
+// Don't allow a client to suggest an RTT longer than 1 second.
+const uint32_t kMaxInitialRoundTripTimeUs = kNumMicrosPerSecond;
// Maximum number of open streams per connection.
const size_t kDefaultMaxStreamsPerConnection = 100;
@@ -104,6 +104,10 @@ const size_t kQuicVersionSize = 4;
// https://tools.ietf.org/html/draft-ietf-quic-transport-25#section-17.2.5
const size_t kRetryIntegrityTagLength = 16;
+// By default, UnackedPacketsMap allocates buffer of 64 after the first packet
+// is added.
+const int kDefaultUnackedPacketsInitialCapacity = 64;
+
// Signifies that the QuicPacket will contain version of the protocol.
const bool kIncludeVersion = true;
// Signifies that the QuicPacket will include a diversification nonce.
@@ -120,7 +124,7 @@ const int64_t kDefaultDelayedAckTimeMs = 25;
// Default minimum delayed ack time, in ms (used only for sender control of ack
// frequency).
-const uint32_t kDefaultMinAckDelayTimeMs = 1;
+const uint32_t kDefaultMinAckDelayTimeMs = 5;
// Default shift of the ACK delay in the IETF QUIC ACK frame.
const uint32_t kDefaultAckDelayExponent = 3;
@@ -265,6 +269,8 @@ const QuicPacketCount kMaxRetransmittablePacketsBeforeAck = 10;
// This intends to avoid the beginning of slow start, when CWNDs may be
// rapidly increasing.
const QuicPacketCount kMinReceivedBeforeAckDecimation = 100;
+// One quarter RTT delay when doing ack decimation.
+const float kAckDecimationDelay = 0.25;
// The default alarm granularity assumed by QUIC code.
const QuicTime::Delta kAlarmGranularity = QuicTime::Delta::FromMilliseconds(1);
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.cc b/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.cc
index 28b3446fb02..fddf0878586 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.cc
@@ -120,13 +120,16 @@ void QuicControlFrameManager::WriteOrBufferHandshakeDone() {
}
void QuicControlFrameManager::WriteOrBufferAckFrequency(
- uint64_t packet_tolerance,
- QuicTime::Delta max_ack_delay) {
+ const QuicAckFrequencyFrame& ack_frequency_frame) {
QUIC_DVLOG(1) << "Writing ACK_FREQUENCY frame";
QuicControlFrameId control_frame_id = ++last_control_frame_id_;
- WriteOrBufferQuicFrame(QuicFrame(new QuicAckFrequencyFrame(
- control_frame_id,
- /*sequence_number=*/control_frame_id, packet_tolerance, max_ack_delay)));
+ // Using the control_frame_id for sequence_number here leaves gaps in
+ // sequence_number.
+ WriteOrBufferQuicFrame(
+ QuicFrame(new QuicAckFrequencyFrame(control_frame_id,
+ /*sequence_number=*/control_frame_id,
+ ack_frequency_frame.packet_tolerance,
+ ack_frequency_frame.max_ack_delay)));
}
void QuicControlFrameManager::WritePing() {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.h b/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.h
index d79b679c984..493e7f02416 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager.h
@@ -86,8 +86,8 @@ class QUIC_EXPORT_PRIVATE QuicControlFrameManager {
// Tries to send an AckFrequencyFrame. The frame is buffered if it cannot be
// sent immediately.
- void WriteOrBufferAckFrequency(uint64_t packet_tolerance,
- QuicTime::Delta max_ack_delay);
+ void WriteOrBufferAckFrequency(
+ const QuicAckFrequencyFrame& ack_frequency_frame);
// Sends a PING_FRAME. Do not send PING if there is buffered frames.
void WritePing();
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager_test.cc
index 68176997944..68658bb32c3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_control_frame_manager_test.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_ack_frequency_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
@@ -37,7 +38,7 @@ const QuicRstStreamErrorCode kTestStopSendingCode =
class QuicControlFrameManagerTest : public QuicTest {
public:
- bool SaveControlFrame(const QuicFrame& frame) {
+ bool SaveControlFrame(const QuicFrame& frame, TransmissionType /*type*/) {
frame_ = frame;
return true;
}
@@ -54,13 +55,16 @@ class QuicControlFrameManagerTest : public QuicTest {
void Initialize() {
connection_ = new MockQuicConnection(&helper_, &alarm_factory_,
Perspective::IS_SERVER);
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_);
manager_ = std::make_unique<QuicControlFrameManager>(session_.get());
EXPECT_EQ(0u, QuicControlFrameManagerPeer::QueueSize(manager_.get()));
EXPECT_FALSE(manager_->HasPendingRetransmission());
EXPECT_FALSE(manager_->WillingToWrite());
- EXPECT_CALL(*connection_, SendControlFrame(_)).WillOnce(Return(false));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).WillOnce(Return(false));
manager_->WriteOrBufferRstStream(kTestStreamId, QUIC_STREAM_CANCELLED, 0);
manager_->WriteOrBufferGoAway(QUIC_PEER_GOING_AWAY, kTestStreamId,
"Going away.");
@@ -103,10 +107,10 @@ class QuicControlFrameManagerTest : public QuicTest {
TEST_F(QuicControlFrameManagerTest, OnControlFrameAcked) {
Initialize();
InSequence s;
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(3)
- .WillRepeatedly(Invoke(&ClearControlFrame));
- EXPECT_CALL(*connection_, SendControlFrame(_)).WillOnce(Return(false));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).WillOnce(Return(false));
// Send control frames 1, 2, 3.
manager_->OnCanWrite();
EXPECT_TRUE(manager_->IsControlFrameOutstanding(QuicFrame(&rst_stream_)));
@@ -139,8 +143,8 @@ TEST_F(QuicControlFrameManagerTest, OnControlFrameAcked) {
EXPECT_TRUE(manager_->WillingToWrite());
// Send control frames 4, 5.
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
manager_->WritePing();
EXPECT_FALSE(manager_->WillingToWrite());
@@ -149,10 +153,10 @@ TEST_F(QuicControlFrameManagerTest, OnControlFrameAcked) {
TEST_F(QuicControlFrameManagerTest, OnControlFrameLost) {
Initialize();
InSequence s;
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(3)
- .WillRepeatedly(Invoke(&ClearControlFrame));
- EXPECT_CALL(*connection_, SendControlFrame(_)).WillOnce(Return(false));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).WillOnce(Return(false));
// Send control frames 1, 2, 3.
manager_->OnCanWrite();
@@ -166,17 +170,17 @@ TEST_F(QuicControlFrameManagerTest, OnControlFrameLost) {
manager_->OnControlFrameAcked(QuicFrame(&goaway_));
// Retransmit control frames 1, 3.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(2)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
EXPECT_FALSE(manager_->HasPendingRetransmission());
EXPECT_TRUE(manager_->WillingToWrite());
// Send control frames 4, 5, and 6.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(number_of_frames_ - 2u)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
manager_->WritePing();
EXPECT_FALSE(manager_->WillingToWrite());
@@ -186,26 +190,26 @@ TEST_F(QuicControlFrameManagerTest, RetransmitControlFrame) {
Initialize();
InSequence s;
// Send control frames 1, 2, 3, 4.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(number_of_frames_)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
// Ack control frame 2.
manager_->OnControlFrameAcked(QuicFrame(&goaway_));
- // Do not retransmit an acked frame.
- EXPECT_CALL(*connection_, SendControlFrame(_)).Times(0);
+ // Do not retransmit an acked frame
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).Times(0);
EXPECT_TRUE(manager_->RetransmitControlFrame(QuicFrame(&goaway_),
PTO_RETRANSMISSION));
// Retransmit control frame 3.
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
EXPECT_TRUE(manager_->RetransmitControlFrame(QuicFrame(&window_update_),
PTO_RETRANSMISSION));
// Retransmit control frame 4, and connection is write blocked.
- EXPECT_CALL(*connection_, SendControlFrame(_)).WillOnce(Return(false));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).WillOnce(Return(false));
EXPECT_FALSE(manager_->RetransmitControlFrame(QuicFrame(&window_update_),
PTO_RETRANSMISSION));
}
@@ -213,9 +217,9 @@ TEST_F(QuicControlFrameManagerTest, RetransmitControlFrame) {
TEST_F(QuicControlFrameManagerTest, DonotSendPingWithBufferedFrames) {
Initialize();
InSequence s;
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
- EXPECT_CALL(*connection_, SendControlFrame(_)).WillOnce(Return(false));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).WillOnce(Return(false));
// Send control frame 1.
manager_->OnCanWrite();
EXPECT_FALSE(manager_->HasPendingRetransmission());
@@ -224,9 +228,9 @@ TEST_F(QuicControlFrameManagerTest, DonotSendPingWithBufferedFrames) {
// Send PING when there is buffered frames.
manager_->WritePing();
// Verify only the buffered frames are sent.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(number_of_frames_ - 1)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
EXPECT_FALSE(manager_->HasPendingRetransmission());
EXPECT_FALSE(manager_->WillingToWrite());
@@ -236,23 +240,26 @@ TEST_F(QuicControlFrameManagerTest, SendAndAckAckFrequencyFrame) {
Initialize();
InSequence s;
// Send Non-AckFrequency frame 1-5.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(5)
- .WillRepeatedly(Invoke(&ClearControlFrame));
- EXPECT_CALL(*connection_, SendControlFrame(_)).WillOnce(Return(false));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).WillOnce(Return(false));
manager_->OnCanWrite();
// Send AckFrequencyFrame as frame 6.
- QuicAckFrequencyFrame ack_frequency = {6, 6, 10,
- QuicTime::Delta::FromMilliseconds(24)};
- manager_->WriteOrBufferAckFrequency(10,
- QuicTime::Delta::FromMilliseconds(24));
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
+ QuicAckFrequencyFrame frame_to_send;
+ frame_to_send.packet_tolerance = 10;
+ frame_to_send.max_ack_delay = QuicTime::Delta::FromMilliseconds(24);
+ manager_->WriteOrBufferAckFrequency(frame_to_send);
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
// Ack AckFrequencyFrame.
- EXPECT_TRUE(manager_->OnControlFrameAcked(QuicFrame(&ack_frequency)));
+ QuicAckFrequencyFrame expected_ack_frequency = {
+ 6, 6, 10, QuicTime::Delta::FromMilliseconds(24)};
+ EXPECT_TRUE(
+ manager_->OnControlFrameAcked(QuicFrame(&expected_ack_frequency)));
}
TEST_F(QuicControlFrameManagerTest, DonotRetransmitOldWindowUpdates) {
@@ -267,8 +274,8 @@ TEST_F(QuicControlFrameManagerTest, DonotRetransmitOldWindowUpdates) {
300);
InSequence s;
// Flush all buffered control frames.
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
// Mark all 3 window updates as lost.
@@ -279,7 +286,7 @@ TEST_F(QuicControlFrameManagerTest, DonotRetransmitOldWindowUpdates) {
EXPECT_TRUE(manager_->WillingToWrite());
// Verify only the latest window update gets retransmitted.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.WillOnce(Invoke(this, &QuicControlFrameManagerTest::SaveControlFrame));
manager_->OnCanWrite();
EXPECT_EQ(number_of_frames_ + 2u,
@@ -299,8 +306,8 @@ TEST_F(QuicControlFrameManagerTest, RetransmitWindowUpdateOfDifferentStreams) {
QuicWindowUpdateFrame window_update3(6, kTestStreamId + 4, 300);
InSequence s;
// Flush all buffered control frames.
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
// Mark all 3 window updates as lost.
@@ -311,9 +318,9 @@ TEST_F(QuicControlFrameManagerTest, RetransmitWindowUpdateOfDifferentStreams) {
EXPECT_TRUE(manager_->WillingToWrite());
// Verify all 3 window updates get retransmitted.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(3)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
manager_->OnCanWrite();
EXPECT_FALSE(manager_->HasPendingRetransmission());
EXPECT_FALSE(manager_->WillingToWrite());
@@ -321,13 +328,13 @@ TEST_F(QuicControlFrameManagerTest, RetransmitWindowUpdateOfDifferentStreams) {
TEST_F(QuicControlFrameManagerTest, TooManyBufferedControlFrames) {
Initialize();
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(5)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
// Flush buffered frames.
manager_->OnCanWrite();
// Write 995 control frames.
- EXPECT_CALL(*connection_, SendControlFrame(_)).WillOnce(Return(false));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).WillOnce(Return(false));
for (size_t i = 0; i < 995; ++i) {
manager_->WriteOrBufferRstStream(kTestStreamId, QUIC_STREAM_CANCELLED, 0);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.cc
index b60b02643b6..74f0724e368 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.cc
@@ -175,6 +175,24 @@ size_t QuicCryptoClientHandshaker::BufferSizeLimitForLevel(
return QuicCryptoHandshaker::BufferSizeLimitForLevel(level);
}
+bool QuicCryptoClientHandshaker::KeyUpdateSupportedLocally() const {
+ return false;
+}
+
+std::unique_ptr<QuicDecrypter>
+QuicCryptoClientHandshaker::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ // Key update is only defined in QUIC+TLS.
+ DCHECK(false);
+ return nullptr;
+}
+
+std::unique_ptr<QuicEncrypter>
+QuicCryptoClientHandshaker::CreateCurrentOneRttEncrypter() {
+ // Key update is only defined in QUIC+TLS.
+ DCHECK(false);
+ return nullptr;
+}
+
void QuicCryptoClientHandshaker::OnConnectionClosed(
QuicErrorCode /*error*/,
ConnectionCloseSource /*source*/) {
@@ -299,7 +317,8 @@ void QuicCryptoClientHandshaker::DoSendCHLO(
early_data_reason_ = ssl_early_data_no_session_offered;
fill_inchoate_client_hello = true;
} else if (session()->config()->HasClientRequestedIndependentOption(
- kQNZR, session()->perspective())) {
+ kQNZ2, session()->perspective()) &&
+ num_client_hellos_ == 1) {
early_data_reason_ = ssl_early_data_disabled;
fill_inchoate_client_hello = true;
}
@@ -328,7 +347,7 @@ void QuicCryptoClientHandshaker::DoSendCHLO(
chlo_hash_ = CryptoUtils::HashHandshakeMessage(out, Perspective::IS_CLIENT);
session()->connection()->set_fully_pad_crypto_handshake_packets(
crypto_config_->pad_inchoate_hello());
- SendHandshakeMessage(out);
+ SendHandshakeMessage(out, ENCRYPTION_INITIAL);
return;
}
@@ -355,7 +374,7 @@ void QuicCryptoClientHandshaker::DoSendCHLO(
next_state_ = STATE_RECV_SHLO;
session()->connection()->set_fully_pad_crypto_handshake_packets(
crypto_config_->pad_full_hello());
- SendHandshakeMessage(out);
+ SendHandshakeMessage(out, ENCRYPTION_INITIAL);
// Be prepared to decrypt with the new server write key.
delegate_->OnNewEncryptionKeyAvailable(
ENCRYPTION_ZERO_RTT,
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.h b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.h
index 605318edc06..49fa405c469 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker.h
@@ -51,6 +51,10 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientHandshaker
CryptoMessageParser* crypto_message_parser() override;
HandshakeState GetHandshakeState() const override;
size_t BufferSizeLimitForLevel(EncryptionLevel level) const override;
+ bool KeyUpdateSupportedLocally() const override;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
void OnOneRttPacketAcknowledged() override {}
void OnHandshakePacketSent() override {}
void OnConnectionClosed(QuicErrorCode /*error*/,
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker_test.cc
index 3ea08a51941..2d6db7f28f7 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_handshaker_test.cc
@@ -6,10 +6,10 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/proto/crypto_server_config_proto.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace {
@@ -34,7 +34,7 @@ class InsecureProofVerifier : public ProofVerifier {
const uint16_t /*port*/,
const std::string& /*server_config*/,
QuicTransportVersion /*transport_version*/,
- quiche::QuicheStringPiece /*chlo_hash*/,
+ absl::string_view /*chlo_hash*/,
const std::vector<std::string>& /*certs*/,
const std::string& /*cert_sct*/,
const std::string& /*signature*/,
@@ -54,6 +54,7 @@ class InsecureProofVerifier : public ProofVerifier {
const ProofVerifyContext* /*context*/,
std::string* /*error_details*/,
std::unique_ptr<ProofVerifyDetails>* /*details*/,
+ uint8_t* /*out_alert*/,
std::unique_ptr<ProofVerifierCallback> /*callback*/) override {
return QUIC_SUCCESS;
}
@@ -74,7 +75,7 @@ class DummyProofSource : public ProofSource {
const std::string& hostname,
const std::string& /*server_config*/,
QuicTransportVersion /*transport_version*/,
- quiche::QuicheStringPiece /*chlo_hash*/,
+ absl::string_view /*chlo_hash*/,
std::unique_ptr<Callback> callback) override {
QuicReferenceCountedPointer<ProofSource::Chain> chain =
GetCertChain(server_address, client_address, hostname);
@@ -99,7 +100,7 @@ class DummyProofSource : public ProofSource {
const QuicSocketAddress& /*client_address*/,
const std::string& /*hostname*/,
uint16_t /*signature_algorit*/,
- quiche::QuicheStringPiece /*in*/,
+ absl::string_view /*in*/,
std::unique_ptr<SignatureCallback> callback) override {
callback->Run(true, "Dummy signature", /*details=*/nullptr);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.cc
index 67a9a113510..94a894836b4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.cc
@@ -109,6 +109,20 @@ size_t QuicCryptoClientStream::BufferSizeLimitForLevel(
return handshaker_->BufferSizeLimitForLevel(level);
}
+bool QuicCryptoClientStream::KeyUpdateSupportedLocally() const {
+ return handshaker_->KeyUpdateSupportedLocally();
+}
+
+std::unique_ptr<QuicDecrypter>
+QuicCryptoClientStream::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ return handshaker_->AdvanceKeysAndCreateCurrentOneRttDecrypter();
+}
+
+std::unique_ptr<QuicEncrypter>
+QuicCryptoClientStream::CreateCurrentOneRttEncrypter() {
+ return handshaker_->CreateCurrentOneRttEncrypter();
+}
+
std::string QuicCryptoClientStream::chlo_hash() const {
return handshaker_->chlo_hash();
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h
index 1d9b04b35fc..123bdfeaffb 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h
@@ -151,6 +151,18 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientStream
// buffered at each encryption level.
virtual size_t BufferSizeLimitForLevel(EncryptionLevel level) const = 0;
+ // Returns whether the implementation supports key update.
+ virtual bool KeyUpdateSupportedLocally() const = 0;
+
+ // Called to generate a decrypter for the next key phase. Each call should
+ // generate the key for phase n+1.
+ virtual std::unique_ptr<QuicDecrypter>
+ AdvanceKeysAndCreateCurrentOneRttDecrypter() = 0;
+
+ // Called to generate an encrypter for the same key phase of the last
+ // decrypter returned by AdvanceKeysAndCreateCurrentOneRttDecrypter().
+ virtual std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() = 0;
+
// Returns current handshake state.
virtual HandshakeState GetHandshakeState() const = 0;
@@ -228,6 +240,10 @@ class QUIC_EXPORT_PRIVATE QuicCryptoClientStream
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> application_state) override;
size_t BufferSizeLimitForLevel(EncryptionLevel level) const override;
+ bool KeyUpdateSupportedLocally() const override;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
std::string chlo_hash() const;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream_test.cc
index 52791b3d8e1..86fa3b8b341 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_client_stream_test.cc
@@ -8,6 +8,7 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_quic_framer.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_session_cache.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
using testing::_;
@@ -69,7 +69,8 @@ class QuicCryptoClientStreamTest : public QuicTest {
void CompleteCryptoHandshake() {
int proof_verify_details_calls = 1;
if (stream()->handshake_protocol() != PROTOCOL_TLS1_3) {
- EXPECT_CALL(*session_, OnProofValid(testing::_));
+ EXPECT_CALL(*session_, OnProofValid(testing::_))
+ .Times(testing::AtLeast(1));
proof_verify_details_calls = 0;
}
EXPECT_CALL(*session_, OnProofVerifyDetailsAvailable(testing::_))
@@ -172,14 +173,13 @@ TEST_F(QuicCryptoClientStreamTest, ClientTurnedOffZeroRtt) {
// Set connection option.
QuicTagVector options;
- options.push_back(kQNZR);
+ options.push_back(kQNZ2);
session_->config()->SetClientConnectionOptions(options);
- EXPECT_CALL(*session_, OnProofValid(testing::_));
- stream()->CryptoConnect();
- // Check that a client hello was sent.
- ASSERT_EQ(1u, connection_->encrypted_packets_.size());
- EXPECT_EQ(ENCRYPTION_INITIAL, connection_->encryption_level());
+ CompleteCryptoHandshake();
+ // Check that two client hellos were sent, one inchoate and one normal.
+ EXPECT_EQ(2, stream()->num_sent_client_hellos());
+ EXPECT_FALSE(stream()->EarlyDataAccepted());
EXPECT_EQ(stream()->EarlyDataReason(), ssl_early_data_disabled);
}
@@ -265,7 +265,7 @@ TEST_F(QuicCryptoClientStreamTest, ServerConfigUpdate) {
const std::string& cached_scfg = state->server_config();
quiche::test::CompareCharArraysWithHexError(
"scfg", cached_scfg.data(), cached_scfg.length(),
- reinterpret_cast<char*>(scfg), QUICHE_ARRAYSIZE(scfg));
+ reinterpret_cast<char*>(scfg), ABSL_ARRAYSIZE(scfg));
QuicStreamSequencer* sequencer = QuicStreamPeer::sequencer(stream());
EXPECT_FALSE(QuicStreamSequencerPeer::IsUnderlyingBufferAllocated(sequencer));
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.cc
index d608ead807c..8adf83b7e86 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.cc
@@ -20,13 +20,16 @@ QuicCryptoHandshaker::QuicCryptoHandshaker(QuicCryptoStream* stream,
QuicCryptoHandshaker::~QuicCryptoHandshaker() {}
void QuicCryptoHandshaker::SendHandshakeMessage(
- const CryptoHandshakeMessage& message) {
+ const CryptoHandshakeMessage& message,
+ EncryptionLevel level) {
QUIC_DVLOG(1) << ENDPOINT << "Sending " << message.DebugString();
session()->NeuterUnencryptedData();
session()->OnCryptoHandshakeMessageSent(message);
last_sent_handshake_message_tag_ = message.tag();
const QuicData& data = message.GetSerialized();
- stream_->WriteCryptoData(session_->connection()->encryption_level(),
+ stream_->WriteCryptoData(session_->use_write_or_buffer_data_at_level()
+ ? level
+ : session_->connection()->encryption_level(),
data.AsStringPiece());
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.h b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.h
index e5d8d51894e..b971580a4a3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_handshaker.h
@@ -21,7 +21,8 @@ class QUIC_EXPORT_PRIVATE QuicCryptoHandshaker
// Sends |message| to the peer.
// TODO(wtc): return a success/failure status.
- void SendHandshakeMessage(const CryptoHandshakeMessage& message);
+ void SendHandshakeMessage(const CryptoHandshakeMessage& message,
+ EncryptionLevel level);
void OnError(CryptoFramer* framer) override;
void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.cc
index 5fc683944ab..2bad8ecfdcd 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.cc
@@ -7,10 +7,10 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -173,7 +173,8 @@ void QuicCryptoServerStream::
if (reply->tag() != kSHLO) {
session()->connection()->set_fully_pad_crypto_handshake_packets(
crypto_config_->pad_rej());
- SendHandshakeMessage(*reply);
+ // Send REJ in plaintext.
+ SendHandshakeMessage(*reply, ENCRYPTION_INITIAL);
return;
}
@@ -213,7 +214,8 @@ void QuicCryptoServerStream::
session()->connection()->set_fully_pad_crypto_handshake_packets(
crypto_config_->pad_shlo());
- SendHandshakeMessage(*reply);
+ // Send SHLO in ENCRYPTION_ZERO_RTT.
+ SendHandshakeMessage(*reply, ENCRYPTION_ZERO_RTT);
delegate_->OnNewEncryptionKeyAvailable(
ENCRYPTION_FORWARD_SECURE,
std::move(crypto_negotiated_params_->forward_secure_crypters.encrypter));
@@ -284,12 +286,15 @@ void QuicCryptoServerStream::FinishSendServerConfigUpdate(
QUIC_DVLOG(1) << "Server: Sending server config update: "
<< message.DebugString();
- if (!QuicVersionUsesCryptoFrames(transport_version())) {
+
+ if (!session()->use_write_or_buffer_data_at_level() &&
+ !QuicVersionUsesCryptoFrames(transport_version())) {
const QuicData& data = message.GetSerialized();
- WriteOrBufferData(quiche::QuicheStringPiece(data.data(), data.length()),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(data.data(), data.length()), false,
+ nullptr);
} else {
- SendHandshakeMessage(message);
+ // Send server config update in ENCRYPTION_FORWARD_SECURE.
+ SendHandshakeMessage(message, ENCRYPTION_FORWARD_SECURE);
}
++num_server_config_update_messages_sent_;
@@ -355,8 +360,7 @@ bool QuicCryptoServerStream::GetBase64SHA256ClientChannelID(
SHA256(reinterpret_cast<const uint8_t*>(channel_id.data()), channel_id.size(),
digest);
- quiche::QuicheTextUtils::Base64Encode(digest, QUICHE_ARRAYSIZE(digest),
- output);
+ quiche::QuicheTextUtils::Base64Encode(digest, ABSL_ARRAYSIZE(digest), output);
return true;
}
@@ -402,6 +406,24 @@ size_t QuicCryptoServerStream::BufferSizeLimitForLevel(
return QuicCryptoHandshaker::BufferSizeLimitForLevel(level);
}
+bool QuicCryptoServerStream::KeyUpdateSupportedLocally() const {
+ return false;
+}
+
+std::unique_ptr<QuicDecrypter>
+QuicCryptoServerStream::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ // Key update is only defined in QUIC+TLS.
+ DCHECK(false);
+ return nullptr;
+}
+
+std::unique_ptr<QuicEncrypter>
+QuicCryptoServerStream::CreateCurrentOneRttEncrypter() {
+ // Key update is only defined in QUIC+TLS.
+ DCHECK(false);
+ return nullptr;
+}
+
void QuicCryptoServerStream::ProcessClientHello(
QuicReferenceCountedPointer<ValidateClientHelloResultCallback::Result>
result,
@@ -418,7 +440,7 @@ void QuicCryptoServerStream::ProcessClientHello(
return;
}
- quiche::QuicheStringPiece user_agent_id;
+ absl::string_view user_agent_id;
message.GetStringPiece(quic::kUAID, &user_agent_id);
if (!session()->user_agent_id().has_value() && !user_agent_id.empty()) {
session()->SetUserAgentId(std::string(user_agent_id));
@@ -430,7 +452,7 @@ void QuicCryptoServerStream::ProcessClientHello(
if (num_handshake_messages_ == 1) {
// Client attempts zero RTT handshake by sending a non-inchoate CHLO.
- quiche::QuicheStringPiece public_value;
+ absl::string_view public_value;
zero_rtt_attempted_ = message.GetStringPiece(kPUBS, &public_value);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h
index 29d680ec98d..c99a13689d8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h
@@ -61,6 +61,10 @@ class QUIC_EXPORT_PRIVATE QuicCryptoServerStream
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> state) override;
size_t BufferSizeLimitForLevel(EncryptionLevel level) const override;
+ bool KeyUpdateSupportedLocally() const override;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
// From QuicCryptoHandshaker
void OnHandshakeMessage(const CryptoHandshakeMessage& message) override;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream_test.cc
index 9ff7dc05d47..2831dc03b64 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_server_stream_test.cc
@@ -9,6 +9,7 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/aes_128_gcm_12_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
@@ -32,7 +33,6 @@
#include "net/third_party/quiche/src/quic/test_tools/fake_proof_source.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
class QuicConnection;
@@ -96,7 +96,7 @@ class QuicCryptoServerStreamTest : public QuicTest {
.Times(testing::AnyNumber());
EXPECT_CALL(*server_session_, SelectAlpn(_))
.WillRepeatedly(
- [this](const std::vector<quiche::QuicheStringPiece>& alpns) {
+ [this](const std::vector<absl::string_view>& alpns) {
return std::find(
alpns.cbegin(), alpns.cend(),
AlpnForVersion(server_session_->connection()->version()));
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.cc
index ae2f067466d..5cdae35e3ea 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.cc
@@ -6,6 +6,8 @@
#include <string>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
@@ -15,8 +17,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -108,8 +108,7 @@ void QuicCryptoStream::OnDataAvailableInSequencer(
EncryptionLevel level) {
struct iovec iov;
while (sequencer->GetReadableRegion(&iov)) {
- quiche::QuicheStringPiece data(static_cast<char*>(iov.iov_base),
- iov.iov_len);
+ absl::string_view data(static_cast<char*>(iov.iov_base), iov.iov_len);
if (!crypto_message_parser()->ProcessInput(data, level)) {
OnUnrecoverableError(crypto_message_parser()->error(),
crypto_message_parser()->error_detail());
@@ -126,8 +125,8 @@ void QuicCryptoStream::OnDataAvailableInSequencer(
}
}
-bool QuicCryptoStream::ExportKeyingMaterial(quiche::QuicheStringPiece label,
- quiche::QuicheStringPiece context,
+bool QuicCryptoStream::ExportKeyingMaterial(absl::string_view label,
+ absl::string_view context,
size_t result_len,
std::string* result) const {
if (!one_rtt_keys_available()) {
@@ -141,8 +140,13 @@ bool QuicCryptoStream::ExportKeyingMaterial(quiche::QuicheStringPiece label,
}
void QuicCryptoStream::WriteCryptoData(EncryptionLevel level,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
if (!QuicVersionUsesCryptoFrames(session()->transport_version())) {
+ if (session()->use_write_or_buffer_data_at_level()) {
+ WriteOrBufferDataAtLevel(data, /*fin=*/false, level,
+ /*ack_listener=*/nullptr);
+ return;
+ }
// The QUIC crypto handshake takes care of setting the appropriate
// encryption level before writing data. Since that is the only handshake
// supported in versions less than 47, |level| can be ignored here.
@@ -308,7 +312,7 @@ bool QuicCryptoStream::RetransmitStreamData(QuicStreamOffset offset,
QuicByteCount data_length,
bool /*fin*/,
TransmissionType type) {
- DCHECK_EQ(HANDSHAKE_RETRANSMISSION, type);
+ DCHECK(type == HANDSHAKE_RETRANSMISSION || type == PTO_RETRANSMISSION);
QuicIntervalSet<QuicStreamOffset> retransmission(offset,
offset + data_length);
// Determine the encryption level to send data. This only needs to be once as
@@ -341,7 +345,7 @@ QuicConsumedData QuicCryptoStream::RetransmitStreamDataAtLevel(
QuicByteCount retransmission_length,
EncryptionLevel encryption_level,
TransmissionType type) {
- DCHECK_EQ(HANDSHAKE_RETRANSMISSION, type);
+ DCHECK(type == HANDSHAKE_RETRANSMISSION || type == PTO_RETRANSMISSION);
const auto consumed = stream_delegate()->WritevData(
id(), retransmission_length, retransmission_offset, NO_FIN, type,
encryption_level);
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.h b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.h
index d73d97080a8..ea15ded0a33 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream.h
@@ -9,6 +9,7 @@
#include <cstddef>
#include <string>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_utils.h"
@@ -17,7 +18,6 @@
#include "net/third_party/quiche/src/quic/core/quic_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -64,14 +64,13 @@ class QUIC_EXPORT_PRIVATE QuicCryptoStream : public QuicStream {
// dependent on |label|, |context|, and the stream's negotiated subkey secret.
// Returns false if the handshake has not been confirmed or the parameters are
// invalid (e.g. |label| contains null bytes); returns true on success.
- bool ExportKeyingMaterial(quiche::QuicheStringPiece label,
- quiche::QuicheStringPiece context,
+ bool ExportKeyingMaterial(absl::string_view label,
+ absl::string_view context,
size_t result_len,
std::string* result) const;
// Writes |data| to the QuicStream at level |level|.
- virtual void WriteCryptoData(EncryptionLevel level,
- quiche::QuicheStringPiece data);
+ virtual void WriteCryptoData(EncryptionLevel level, absl::string_view data);
// Returns the ssl_early_data_reason_t describing why 0-RTT was accepted or
// rejected. Note that the value returned by this function may vary during the
@@ -127,6 +126,18 @@ class QUIC_EXPORT_PRIVATE QuicCryptoStream : public QuicStream {
// encryption level |level|.
virtual size_t BufferSizeLimitForLevel(EncryptionLevel level) const;
+ // Returns whether the implementation supports key update.
+ virtual bool KeyUpdateSupportedLocally() const = 0;
+
+ // Called to generate a decrypter for the next key phase. Each call should
+ // generate the key for phase n+1.
+ virtual std::unique_ptr<QuicDecrypter>
+ AdvanceKeysAndCreateCurrentOneRttDecrypter() = 0;
+
+ // Called to generate an encrypter for the same key phase of the last
+ // decrypter returned by AdvanceKeysAndCreateCurrentOneRttDecrypter().
+ virtual std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() = 0;
+
// Called to cancel retransmission of unencrypted crypto stream data.
void NeuterUnencryptedStreamData();
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream_test.cc
index f7e24830943..c67a5dcd797 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_crypto_stream_test.cc
@@ -66,6 +66,14 @@ class MockQuicCryptoStream : public QuicCryptoStream,
HandshakeState GetHandshakeState() const override { return HANDSHAKE_START; }
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> /*application_state*/) override {}
+ bool KeyUpdateSupportedLocally() const override { return false; }
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
private:
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_;
@@ -433,7 +441,7 @@ TEST_F(QuicCryptoStreamTest, RetransmitStreamData) {
.WillOnce(InvokeWithoutArgs([this]() {
return session_.ConsumeData(
QuicUtils::GetCryptoStreamId(connection_->transport_version()), 150,
- 1350, NO_FIN, HANDSHAKE_RETRANSMISSION, QUICHE_NULLOPT);
+ 1350, NO_FIN, HANDSHAKE_RETRANSMISSION, absl::nullopt);
}));
EXPECT_FALSE(stream_->RetransmitStreamData(1350, 1350, false,
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.cc b/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.cc
index c82e051c342..be533b13677 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.cc
@@ -4,17 +4,17 @@
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
-QuicDataReader::QuicDataReader(quiche::QuicheStringPiece data)
+QuicDataReader::QuicDataReader(absl::string_view data)
: quiche::QuicheDataReader(data) {}
QuicDataReader::QuicDataReader(const char* data, const size_t len)
@@ -165,8 +165,7 @@ bool QuicDataReader::ReadVarInt62(uint64_t* result) {
return false;
}
-bool QuicDataReader::ReadStringPieceVarInt62(
- quiche::QuicheStringPiece* result) {
+bool QuicDataReader::ReadStringPieceVarInt62(absl::string_view* result) {
uint64_t result_length;
if (!ReadVarInt62(&result_length)) {
return false;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.h b/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.h
index 13499ea83dd..00b1dba34c6 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_data_reader.h
@@ -8,11 +8,11 @@
#include <cstddef>
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/quiche_data_reader.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -34,7 +34,7 @@ class QUIC_EXPORT_PRIVATE QuicDataReader : public quiche::QuicheDataReader {
public:
// Constructs a reader using NETWORK_BYTE_ORDER endianness.
// Caller must provide an underlying buffer to work on.
- explicit QuicDataReader(quiche::QuicheStringPiece data);
+ explicit QuicDataReader(absl::string_view data);
// Constructs a reader using NETWORK_BYTE_ORDER endianness.
// Caller must provide an underlying buffer to work on.
QuicDataReader(const char* data, const size_t len);
@@ -85,7 +85,7 @@ class QUIC_EXPORT_PRIVATE QuicDataReader : public quiche::QuicheDataReader {
//
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadStringPieceVarInt62(quiche::QuicheStringPiece* result);
+ bool ReadStringPieceVarInt62(absl::string_view* result);
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.cc b/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.cc
index 41c374cc6d6..91645b8d04a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.cc
@@ -7,13 +7,13 @@
#include <algorithm>
#include <limits>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_constants.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -234,7 +234,7 @@ QuicVariableLengthIntegerLength QuicDataWriter::GetVarInt62Len(uint64_t value) {
}
bool QuicDataWriter::WriteStringPieceVarInt62(
- const quiche::QuicheStringPiece& string_piece) {
+ const absl::string_view& string_piece) {
if (!WriteVarInt62(string_piece.size())) {
return false;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.h b/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.h
index 3926c1a6aa5..e0a27c60766 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_data_writer.h
@@ -8,11 +8,11 @@
#include <cstddef>
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/quiche_data_writer.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -69,7 +69,7 @@ class QUIC_EXPORT_PRIVATE QuicDataWriter : public quiche::QuicheDataWriter {
// Writes a string piece as a consecutive length/content pair. The
// length is VarInt62 encoded.
- bool WriteStringPieceVarInt62(const quiche::QuicheStringPiece& string_piece);
+ bool WriteStringPieceVarInt62(const absl::string_view& string_piece);
// Utility function to return the number of bytes needed to encode
// the given value using IETF VarInt62 encoding. Returns the number
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_data_writer_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_data_writer_test.cc
index e05af218994..ef83ac82a63 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_data_writer_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_data_writer_test.cc
@@ -7,6 +7,8 @@
#include <cstdint>
#include <cstring>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -15,10 +17,8 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
namespace quic {
@@ -269,7 +269,7 @@ TEST_P(QuicDataWriterTest, WriteConnectionId) {
char big_endian[] = {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
};
- EXPECT_EQ(connection_id.length(), QUICHE_ARRAYSIZE(big_endian));
+ EXPECT_EQ(connection_id.length(), ABSL_ARRAYSIZE(big_endian));
ASSERT_LE(connection_id.length(), 255);
char buffer[255];
QuicDataWriter writer(connection_id.length(), buffer, GetParam().endianness);
@@ -280,8 +280,8 @@ TEST_P(QuicDataWriterTest, WriteConnectionId) {
QuicConnectionId read_connection_id;
QuicDataReader reader(buffer, connection_id.length(), GetParam().endianness);
- EXPECT_TRUE(reader.ReadConnectionId(&read_connection_id,
- QUICHE_ARRAYSIZE(big_endian)));
+ EXPECT_TRUE(
+ reader.ReadConnectionId(&read_connection_id, ABSL_ARRAYSIZE(big_endian)));
EXPECT_EQ(connection_id, read_connection_id);
}
@@ -291,35 +291,35 @@ TEST_P(QuicDataWriterTest, LengthPrefixedConnectionId) {
char length_prefixed_connection_id[] = {
0x08, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
};
- EXPECT_EQ(QUICHE_ARRAYSIZE(length_prefixed_connection_id),
+ EXPECT_EQ(ABSL_ARRAYSIZE(length_prefixed_connection_id),
kConnectionIdLengthSize + connection_id.length());
char buffer[kConnectionIdLengthSize + 255] = {};
- QuicDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer);
+ QuicDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer);
EXPECT_TRUE(writer.WriteLengthPrefixedConnectionId(connection_id));
quiche::test::CompareCharArraysWithHexError(
"WriteLengthPrefixedConnectionId", buffer, writer.length(),
length_prefixed_connection_id,
- QUICHE_ARRAYSIZE(length_prefixed_connection_id));
+ ABSL_ARRAYSIZE(length_prefixed_connection_id));
// Verify that writing length then connection ID produces the same output.
- memset(buffer, 0, QUICHE_ARRAYSIZE(buffer));
- QuicDataWriter writer2(QUICHE_ARRAYSIZE(buffer), buffer);
+ memset(buffer, 0, ABSL_ARRAYSIZE(buffer));
+ QuicDataWriter writer2(ABSL_ARRAYSIZE(buffer), buffer);
EXPECT_TRUE(writer2.WriteUInt8(connection_id.length()));
EXPECT_TRUE(writer2.WriteConnectionId(connection_id));
quiche::test::CompareCharArraysWithHexError(
"Write length then ConnectionId", buffer, writer2.length(),
length_prefixed_connection_id,
- QUICHE_ARRAYSIZE(length_prefixed_connection_id));
+ ABSL_ARRAYSIZE(length_prefixed_connection_id));
QuicConnectionId read_connection_id;
- QuicDataReader reader(buffer, QUICHE_ARRAYSIZE(buffer));
+ QuicDataReader reader(buffer, ABSL_ARRAYSIZE(buffer));
EXPECT_TRUE(reader.ReadLengthPrefixedConnectionId(&read_connection_id));
EXPECT_EQ(connection_id, read_connection_id);
// Verify that reading length then connection ID produces the same output.
uint8_t read_connection_id_length2 = 33;
QuicConnectionId read_connection_id2;
- QuicDataReader reader2(buffer, QUICHE_ARRAYSIZE(buffer));
+ QuicDataReader reader2(buffer, ABSL_ARRAYSIZE(buffer));
ASSERT_TRUE(reader2.ReadUInt8(&read_connection_id_length2));
EXPECT_EQ(connection_id.length(), read_connection_id_length2);
EXPECT_TRUE(reader2.ReadConnectionId(&read_connection_id2,
@@ -330,8 +330,7 @@ TEST_P(QuicDataWriterTest, LengthPrefixedConnectionId) {
TEST_P(QuicDataWriterTest, EmptyConnectionIds) {
QuicConnectionId empty_connection_id = EmptyQuicConnectionId();
char buffer[2];
- QuicDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
- GetParam().endianness);
+ QuicDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer, GetParam().endianness);
EXPECT_TRUE(writer.WriteConnectionId(empty_connection_id));
EXPECT_TRUE(writer.WriteUInt8(1));
EXPECT_TRUE(writer.WriteConnectionId(empty_connection_id));
@@ -344,8 +343,7 @@ TEST_P(QuicDataWriterTest, EmptyConnectionIds) {
QuicConnectionId read_connection_id = TestConnectionId();
uint8_t read_byte;
- QuicDataReader reader(buffer, QUICHE_ARRAYSIZE(buffer),
- GetParam().endianness);
+ QuicDataReader reader(buffer, ABSL_ARRAYSIZE(buffer), GetParam().endianness);
EXPECT_TRUE(reader.ReadConnectionId(&read_connection_id, 0));
EXPECT_EQ(read_connection_id, empty_connection_id);
EXPECT_TRUE(reader.ReadUInt8(&read_byte));
@@ -663,10 +661,10 @@ TEST_P(QuicDataWriterTest, WriteIntegers) {
TEST_P(QuicDataWriterTest, WriteBytes) {
char bytes[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
- char buf[QUICHE_ARRAYSIZE(bytes)];
- QuicDataWriter writer(QUICHE_ARRAYSIZE(buf), buf, GetParam().endianness);
- EXPECT_TRUE(writer.WriteBytes(bytes, QUICHE_ARRAYSIZE(bytes)));
- for (unsigned int i = 0; i < QUICHE_ARRAYSIZE(bytes); ++i) {
+ char buf[ABSL_ARRAYSIZE(bytes)];
+ QuicDataWriter writer(ABSL_ARRAYSIZE(buf), buf, GetParam().endianness);
+ EXPECT_TRUE(writer.WriteBytes(bytes, ABSL_ARRAYSIZE(bytes)));
+ for (unsigned int i = 0; i < ABSL_ARRAYSIZE(bytes); ++i) {
EXPECT_EQ(bytes[i], buf[i]);
}
}
@@ -1178,14 +1176,13 @@ TEST_P(QuicDataWriterTest, ValidStreamCount) {
TEST_P(QuicDataWriterTest, Seek) {
char buffer[3] = {};
- QuicDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
- GetParam().endianness);
+ QuicDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer, GetParam().endianness);
EXPECT_TRUE(writer.WriteUInt8(42));
EXPECT_TRUE(writer.Seek(1));
EXPECT_TRUE(writer.WriteUInt8(3));
char expected[] = {42, 0, 3};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(expected); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(expected); ++i) {
EXPECT_EQ(buffer[i], expected[i]);
}
}
@@ -1195,7 +1192,7 @@ TEST_P(QuicDataWriterTest, SeekTooFarFails) {
// Check that one can seek to the end of the writer, but not past.
{
- QuicDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
+ QuicDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer,
GetParam().endianness);
EXPECT_TRUE(writer.Seek(20));
EXPECT_FALSE(writer.Seek(1));
@@ -1203,14 +1200,14 @@ TEST_P(QuicDataWriterTest, SeekTooFarFails) {
// Seeking several bytes past the end fails.
{
- QuicDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
+ QuicDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer,
GetParam().endianness);
EXPECT_FALSE(writer.Seek(100));
}
// Seeking so far that arithmetic overflow could occur also fails.
{
- QuicDataWriter writer(QUICHE_ARRAYSIZE(buffer), buffer,
+ QuicDataWriter writer(ABSL_ARRAYSIZE(buffer), buffer,
GetParam().endianness);
EXPECT_TRUE(writer.Seek(10));
EXPECT_FALSE(writer.Seek(std::numeric_limits<size_t>::max()));
@@ -1227,24 +1224,22 @@ TEST_P(QuicDataWriterTest, PayloadReads) {
quiche::test::CompareCharArraysWithHexError(
"first read", first_read_buffer, sizeof(first_read_buffer),
expected_first_read, sizeof(expected_first_read));
- quiche::QuicheStringPiece peeked_remaining_payload =
- reader.PeekRemainingPayload();
+ absl::string_view peeked_remaining_payload = reader.PeekRemainingPayload();
quiche::test::CompareCharArraysWithHexError(
"peeked_remaining_payload", peeked_remaining_payload.data(),
peeked_remaining_payload.length(), expected_remaining,
sizeof(expected_remaining));
- quiche::QuicheStringPiece full_payload = reader.FullPayload();
+ absl::string_view full_payload = reader.FullPayload();
quiche::test::CompareCharArraysWithHexError(
"full_payload", full_payload.data(), full_payload.length(), buffer,
sizeof(buffer));
- quiche::QuicheStringPiece read_remaining_payload =
- reader.ReadRemainingPayload();
+ absl::string_view read_remaining_payload = reader.ReadRemainingPayload();
quiche::test::CompareCharArraysWithHexError(
"read_remaining_payload", read_remaining_payload.data(),
read_remaining_payload.length(), expected_remaining,
sizeof(expected_remaining));
EXPECT_TRUE(reader.IsDoneReading());
- quiche::QuicheStringPiece full_payload2 = reader.FullPayload();
+ absl::string_view full_payload2 = reader.FullPayload();
quiche::test::CompareCharArraysWithHexError(
"full_payload2", full_payload2.data(), full_payload2.length(), buffer,
sizeof(buffer));
@@ -1253,14 +1248,13 @@ TEST_P(QuicDataWriterTest, PayloadReads) {
TEST_P(QuicDataWriterTest, StringPieceVarInt62) {
char inner_buffer[16] = {1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16};
- quiche::QuicheStringPiece inner_payload_write(inner_buffer,
- sizeof(inner_buffer));
+ absl::string_view inner_payload_write(inner_buffer, sizeof(inner_buffer));
char buffer[sizeof(inner_buffer) + sizeof(uint8_t)] = {};
QuicDataWriter writer(sizeof(buffer), buffer);
EXPECT_TRUE(writer.WriteStringPieceVarInt62(inner_payload_write));
EXPECT_EQ(0u, writer.remaining());
QuicDataReader reader(buffer, sizeof(buffer));
- quiche::QuicheStringPiece inner_payload_read;
+ absl::string_view inner_payload_read;
EXPECT_TRUE(reader.ReadStringPieceVarInt62(&inner_payload_read));
quiche::test::CompareCharArraysWithHexError(
"inner_payload", inner_payload_write.data(), inner_payload_write.length(),
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.cc b/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.cc
index 22a57cd8336..e10a91904c1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.cc
@@ -12,7 +12,6 @@
namespace quic {
-using quiche::QuicheOptional;
constexpr float kExpiryInMinRtts = 1.25;
constexpr float kMinPacingWindows = 4;
@@ -37,10 +36,10 @@ MessageStatus QuicDatagramQueue::SendOrQueueDatagram(QuicMemSlice datagram) {
return MESSAGE_STATUS_BLOCKED;
}
-QuicheOptional<MessageStatus> QuicDatagramQueue::TrySendingNextDatagram() {
+absl::optional<MessageStatus> QuicDatagramQueue::TrySendingNextDatagram() {
RemoveExpiredDatagrams();
if (queue_.empty()) {
- return QuicheOptional<MessageStatus>();
+ return absl::nullopt;
}
QuicMemSliceSpan span(&queue_.front().datagram);
@@ -54,7 +53,7 @@ QuicheOptional<MessageStatus> QuicDatagramQueue::TrySendingNextDatagram() {
size_t QuicDatagramQueue::SendDatagrams() {
size_t num_datagrams = 0;
for (;;) {
- QuicheOptional<MessageStatus> status = TrySendingNextDatagram();
+ absl::optional<MessageStatus> status = TrySendingNextDatagram();
if (!status.has_value()) {
break;
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.h b/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.h
index ac78ad4f82b..09524027533 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue.h
@@ -5,11 +5,11 @@
#ifndef QUICHE_QUIC_CORE_QUIC_DATAGRAM_QUEUE_H_
#define QUICHE_QUIC_CORE_QUIC_DATAGRAM_QUEUE_H_
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
namespace quic {
@@ -29,7 +29,7 @@ class QUIC_EXPORT_PRIVATE QuicDatagramQueue {
// Attempts to send a single datagram from the queue. Returns the result of
// SendMessage(), or nullopt if there were no unexpired datagrams to send.
- quiche::QuicheOptional<MessageStatus> TrySendingNextDatagram();
+ absl::optional<MessageStatus> TrySendingNextDatagram();
// Sends all of the unexpired datagrams until either the connection becomes
// write-blocked or the queue is empty. Returns the number of datagrams sent.
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue_test.cc
index 34ccccc482e..0e6e3dec39a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_datagram_queue_test.cc
@@ -4,20 +4,20 @@
#include "net/third_party/quiche/src/quic/core/quic_datagram_queue.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
namespace {
-using quiche::QuicheOptional;
using testing::_;
using testing::ElementsAre;
@@ -39,9 +39,12 @@ class QuicDatagramQueueTest : public QuicTest {
session_(connection_),
queue_(&session_) {
session_.SetCryptoStream(new EstablishedCryptoStream(&session_));
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
}
- QuicMemSlice CreateMemSlice(quiche::QuicheStringPiece data) {
+ QuicMemSlice CreateMemSlice(absl::string_view data) {
QuicUniqueBufferPtr buffer =
MakeUniqueBuffer(helper_.GetStreamSendBufferAllocator(), data.size());
memcpy(buffer.get(), data.data(), data.size());
@@ -75,7 +78,7 @@ TEST_F(QuicDatagramQueueTest, SendDatagramAfterBuffering) {
// Verify getting write blocked does not remove the datagram from the queue.
EXPECT_CALL(*connection_, SendMessage(_, _, _))
.WillOnce(Return(MESSAGE_STATUS_BLOCKED));
- QuicheOptional<MessageStatus> status = queue_.TrySendingNextDatagram();
+ absl::optional<MessageStatus> status = queue_.TrySendingNextDatagram();
ASSERT_TRUE(status.has_value());
EXPECT_EQ(MESSAGE_STATUS_BLOCKED, *status);
EXPECT_EQ(1u, queue_.queue_size());
@@ -89,7 +92,7 @@ TEST_F(QuicDatagramQueueTest, SendDatagramAfterBuffering) {
}
TEST_F(QuicDatagramQueueTest, EmptyBuffer) {
- QuicheOptional<MessageStatus> status = queue_.TrySendingNextDatagram();
+ absl::optional<MessageStatus> status = queue_.TrySendingNextDatagram();
EXPECT_FALSE(status.has_value());
size_t num_messages = queue_.SendDatagrams();
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.cc b/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.cc
index 972a9ac0f86..d048e60af29 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.cc
@@ -7,6 +7,7 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/chlo_extractor.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
@@ -22,14 +23,13 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_stack_trace.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
-typedef QuicBufferedPacketStore::BufferedPacket BufferedPacket;
-typedef QuicBufferedPacketStore::BufferedPacketList BufferedPacketList;
-typedef QuicBufferedPacketStore::EnqueuePacketResult EnqueuePacketResult;
+using BufferedPacket = QuicBufferedPacketStore::BufferedPacket;
+using BufferedPacketList = QuicBufferedPacketStore::BufferedPacketList;
+using EnqueuePacketResult = QuicBufferedPacketStore::EnqueuePacketResult;
namespace {
@@ -190,12 +190,12 @@ class ChloAlpnExtractor : public ChloExtractor::Delegate {
void OnChlo(QuicTransportVersion version,
QuicConnectionId /*server_connection_id*/,
const CryptoHandshakeMessage& chlo) override {
- quiche::QuicheStringPiece alpn_value;
+ absl::string_view alpn_value;
if (chlo.GetStringPiece(kALPN, &alpn_value)) {
alpn_ = std::string(alpn_value);
}
if (version == LegacyVersionForEncapsulation().transport_version) {
- quiche::QuicheStringPiece qlve_value;
+ absl::string_view qlve_value;
if (chlo.GetStringPiece(kQLVE, &qlve_value)) {
legacy_version_encapsulation_inner_packet_ = std::string(qlve_value);
}
@@ -231,7 +231,7 @@ bool MaybeHandleLegacyVersionEncapsulation(
ParsedQuicVersion parsed_version = ParsedQuicVersion::Unsupported();
QuicConnectionId destination_connection_id, source_connection_id;
bool retry_token_present;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
std::string detailed_error;
const QuicErrorCode error = QuicFramer::ParsePublicHeaderDispatcher(
QuicEncryptedPacket(legacy_version_encapsulation_inner_packet.data(),
@@ -338,12 +338,12 @@ void QuicDispatcher::ProcessPacket(const QuicSocketAddress& self_address,
const QuicReceivedPacket& packet) {
QUIC_DVLOG(2) << "Dispatcher received encrypted " << packet.length()
<< " bytes:" << std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
- packet.data(), packet.length()));
+ << quiche::QuicheTextUtils::HexDump(
+ absl::string_view(packet.data(), packet.length()));
ReceivedPacketInfo packet_info(self_address, peer_address, packet);
std::string detailed_error;
bool retry_token_present;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
const QuicErrorCode error = QuicFramer::ParsePublicHeaderDispatcher(
packet, expected_server_connection_id_length_, &packet_info.form,
&packet_info.long_packet_type, &packet_info.version_flag,
@@ -465,7 +465,16 @@ bool QuicDispatcher::MaybeDispatchPacket(
// connection ID, the dispatcher picks a new one of its expected length.
// Therefore we should never receive a connection ID that is smaller
// than 64 bits and smaller than what we expect.
- if (server_connection_id.length() < kQuicMinimumInitialConnectionIdLength &&
+ bool should_check_short_connection_ids = true;
+ if (GetQuicReloadableFlag(
+ quic_send_version_negotiation_for_short_connection_ids)) {
+ QUIC_RELOADABLE_FLAG_COUNT(
+ quic_send_version_negotiation_for_short_connection_ids);
+ should_check_short_connection_ids =
+ packet_info.version_flag && packet_info.version.IsKnown();
+ }
+ if (should_check_short_connection_ids &&
+ server_connection_id.length() < kQuicMinimumInitialConnectionIdLength &&
server_connection_id.length() < expected_server_connection_id_length_ &&
!allow_short_initial_server_connection_ids_) {
DCHECK(packet_info.version_flag);
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.h b/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.h
index e4c61e529a1..92c73208412 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher.h
@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_compressed_certs_cache.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_blocked_writer_interface.h"
@@ -25,7 +26,6 @@
#include "net/third_party/quiche/src/quic/core/quic_version_manager.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -41,7 +41,7 @@ class QUIC_NO_EXPORT QuicDispatcher
public QuicBufferedPacketStore::VisitorInterface {
public:
// Ideally we'd have a linked_hash_set: the boolean is unused.
- typedef QuicLinkedHashMap<QuicBlockedWriterInterface*, bool> WriteBlockedList;
+ using WriteBlockedList = QuicLinkedHashMap<QuicBlockedWriterInterface*, bool>;
QuicDispatcher(
const QuicConfig* config,
@@ -140,7 +140,7 @@ class QUIC_NO_EXPORT QuicDispatcher
QuicConnectionId server_connection_id,
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece alpn,
+ absl::string_view alpn,
const ParsedQuicVersion& version) = 0;
// Tries to validate and dispatch packet based on available information.
@@ -321,6 +321,11 @@ class QUIC_NO_EXPORT QuicDispatcher
const QuicConnectionId& server_connection_id,
const ParsedQuicVersion& version) const;
+ // Sends public/stateless reset packets with no version and unknown
+ // connection ID according to the packet's size.
+ virtual void MaybeResetPacketsWithNoVersion(
+ const quic::ReceivedPacketInfo& packet_info);
+
private:
friend class test::QuicDispatcherPeer;
@@ -336,10 +341,6 @@ class QUIC_NO_EXPORT QuicDispatcher
// Returns true if |version| is a supported protocol version.
bool IsSupportedVersion(const ParsedQuicVersion version);
- // Sends public/stateless reset packets with no version and unknown
- // connection ID according to the packet's size.
- void MaybeResetPacketsWithNoVersion(const ReceivedPacketInfo& packet_info);
-
const QuicConfig* config_;
const QuicCryptoServerConfig* crypto_config_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc
index e90489a9f93..9f692a8029a 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_dispatcher_test.cc
@@ -9,6 +9,7 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/chlo_extractor.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
@@ -36,7 +37,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_time_wait_list_manager_peer.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_crypto_server_stream_helper.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -135,7 +135,7 @@ class TestDispatcher : public QuicDispatcher {
(QuicConnectionId connection_id,
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece alpn,
+ absl::string_view alpn,
const quic::ParsedQuicVersion& version),
(override));
@@ -471,6 +471,10 @@ class QuicDispatcherTestBase : public QuicTestWithParam<ParsedQuicVersion> {
void TestTlsMultiPacketClientHello(bool add_reordering);
+ void TestVersionNegotiationForUnknownVersionInvalidShortInitialConnectionId(
+ const QuicConnectionId& server_connection_id,
+ const QuicConnectionId& client_connection_id);
+
ParsedQuicVersion version_;
MockQuicConnectionHelper mock_helper_;
MockAlarmFactory mock_alarm_factory_;
@@ -605,7 +609,7 @@ TEST_P(QuicDispatcherTestAllVersions, LegacyVersionEncapsulation) {
ParsedQuicVersion parsed_version = ParsedQuicVersion::Unsupported();
QuicConnectionId destination_connection_id, source_connection_id;
bool retry_token_present;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
std::string detailed_error;
const QuicErrorCode error = QuicFramer::ParsePublicHeaderDispatcher(
QuicEncryptedPacket(packets[0]->data(), packets[0]->length()),
@@ -1054,7 +1058,7 @@ TEST_P(QuicDispatcherTestAllVersions, ProcessPacketWithZeroPort) {
}
TEST_P(QuicDispatcherTestAllVersions,
- ProcessPacketWithInvalidShortInitialConnectionId) {
+ DropPacketWithKnownVersionAndInvalidShortInitialConnectionId) {
if (!version_.AllowsVariableLengthConnectionIds()) {
return;
}
@@ -1063,14 +1067,59 @@ TEST_P(QuicDispatcherTestAllVersions,
QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
// dispatcher_ should drop this packet.
- EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, client_address, _, _))
- .Times(0);
+ EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
EXPECT_CALL(*time_wait_list_manager_, ProcessPacket(_, _, _, _, _)).Times(0);
EXPECT_CALL(*time_wait_list_manager_, AddConnectionIdToTimeWait(_, _, _))
.Times(0);
ProcessFirstFlight(client_address, EmptyQuicConnectionId());
}
+void QuicDispatcherTestBase::
+ TestVersionNegotiationForUnknownVersionInvalidShortInitialConnectionId(
+ const QuicConnectionId& server_connection_id,
+ const QuicConnectionId& client_connection_id) {
+ SetQuicReloadableFlag(quic_send_version_negotiation_for_short_connection_ids,
+ true);
+ CreateTimeWaitListManager();
+
+ QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
+
+ EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
+ EXPECT_CALL(*time_wait_list_manager_,
+ SendVersionNegotiationPacket(
+ server_connection_id, client_connection_id,
+ /*ietf_quic=*/true,
+ /*use_length_prefix=*/true, _, _, client_address, _))
+ .Times(1);
+ ProcessFirstFlight(ParsedQuicVersion::ReservedForNegotiation(),
+ client_address, server_connection_id,
+ client_connection_id);
+}
+
+TEST_P(QuicDispatcherTestOneVersion,
+ VersionNegotiationForUnknownVersionInvalidShortInitialConnectionId) {
+ TestVersionNegotiationForUnknownVersionInvalidShortInitialConnectionId(
+ EmptyQuicConnectionId(), EmptyQuicConnectionId());
+}
+
+TEST_P(QuicDispatcherTestOneVersion,
+ VersionNegotiationForUnknownVersionInvalidShortInitialConnectionId2) {
+ char server_connection_id_bytes[3] = {1, 2, 3};
+ QuicConnectionId server_connection_id(server_connection_id_bytes,
+ sizeof(server_connection_id_bytes));
+ TestVersionNegotiationForUnknownVersionInvalidShortInitialConnectionId(
+ server_connection_id, EmptyQuicConnectionId());
+}
+
+TEST_P(QuicDispatcherTestOneVersion,
+ VersionNegotiationForUnknownVersionInvalidShortInitialConnectionId3) {
+ char client_connection_id_bytes[8] = {1, 2, 3, 4, 5, 6, 7, 8};
+ QuicConnectionId client_connection_id(client_connection_id_bytes,
+ sizeof(client_connection_id_bytes));
+ TestVersionNegotiationForUnknownVersionInvalidShortInitialConnectionId(
+ EmptyQuicConnectionId(), client_connection_id);
+}
+
TEST_P(QuicDispatcherTestOneVersion, VersionsChangeInFlight) {
VerifyVersionNotSupported(QuicVersionReservedForNegotiation());
for (ParsedQuicVersion version : CurrentSupportedVersions()) {
@@ -1088,7 +1137,7 @@ TEST_P(QuicDispatcherTestOneVersion,
CreateTimeWaitListManager();
char packet[kMinPacketSizeForVersionNegotiation] = {
0xC0, 0xFF, 0x00, 0x00, 28, /*destination connection ID length*/ 0x08};
- QuicReceivedPacket received_packet(packet, QUICHE_ARRAYSIZE(packet),
+ QuicReceivedPacket received_packet(packet, ABSL_ARRAYSIZE(packet),
QuicTime::Zero());
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
EXPECT_CALL(
@@ -1105,7 +1154,7 @@ TEST_P(QuicDispatcherTestOneVersion,
CreateTimeWaitListManager();
char packet[kMinPacketSizeForVersionNegotiation] = {
0xC0, 0xFF, 0x00, 0x00, 25, /*destination connection ID length*/ 0x08};
- QuicReceivedPacket received_packet(packet, QUICHE_ARRAYSIZE(packet),
+ QuicReceivedPacket received_packet(packet, ABSL_ARRAYSIZE(packet),
QuicTime::Zero());
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
EXPECT_CALL(
@@ -1122,7 +1171,7 @@ TEST_P(QuicDispatcherTestOneVersion,
CreateTimeWaitListManager();
char packet[kMinPacketSizeForVersionNegotiation] = {
0xC0, 'Q', '0', '4', '9', /*destination connection ID length*/ 0x08};
- QuicReceivedPacket received_packet(packet, QUICHE_ARRAYSIZE(packet),
+ QuicReceivedPacket received_packet(packet, ABSL_ARRAYSIZE(packet),
QuicTime::Zero());
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
EXPECT_CALL(
@@ -1139,7 +1188,7 @@ TEST_P(QuicDispatcherTestOneVersion,
CreateTimeWaitListManager();
char packet[kMinPacketSizeForVersionNegotiation] = {
0xC0, 'Q', '0', '4', '8', /*connection ID length byte*/ 0x50};
- QuicReceivedPacket received_packet(packet, QUICHE_ARRAYSIZE(packet),
+ QuicReceivedPacket received_packet(packet, ABSL_ARRAYSIZE(packet),
QuicTime::Zero());
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
EXPECT_CALL(
@@ -1156,7 +1205,7 @@ TEST_P(QuicDispatcherTestOneVersion,
CreateTimeWaitListManager();
char packet[kMinPacketSizeForVersionNegotiation] = {
0xC0, 'Q', '0', '4', '7', /*connection ID length byte*/ 0x50};
- QuicReceivedPacket received_packet(packet, QUICHE_ARRAYSIZE(packet),
+ QuicReceivedPacket received_packet(packet, ABSL_ARRAYSIZE(packet),
QuicTime::Zero());
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
EXPECT_CALL(
@@ -1173,7 +1222,7 @@ TEST_P(QuicDispatcherTestOneVersion,
CreateTimeWaitListManager();
char packet[kMinPacketSizeForVersionNegotiation] = {
0xC0, 'Q', '0', '4', '5', /*connection ID length byte*/ 0x50};
- QuicReceivedPacket received_packet(packet, QUICHE_ARRAYSIZE(packet),
+ QuicReceivedPacket received_packet(packet, ABSL_ARRAYSIZE(packet),
QuicTime::Zero());
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
EXPECT_CALL(
@@ -1206,37 +1255,7 @@ static_assert(quic::SupportedVersions().size() == 7u,
"Please add new RejectDeprecatedVersion tests above this assert "
"when deprecating versions");
-TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeOld) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, false);
- QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
- CreateTimeWaitListManager();
- char packet[1200];
- char destination_connection_id_bytes[] = {0x56, 0x4e, 0x20, 0x70,
- 0x6c, 0x7a, 0x20, 0x21};
- EXPECT_TRUE(QuicFramer::WriteClientVersionNegotiationProbePacket(
- packet, sizeof(packet), destination_connection_id_bytes,
- sizeof(destination_connection_id_bytes)));
- QuicEncryptedPacket encrypted(packet, sizeof(packet), false);
- std::unique_ptr<QuicReceivedPacket> received_packet(
- ConstructReceivedPacket(encrypted, mock_helper_.GetClock()->Now()));
- QuicConnectionId client_connection_id = EmptyQuicConnectionId();
- QuicConnectionId server_connection_id(
- destination_connection_id_bytes, sizeof(destination_connection_id_bytes));
- bool ietf_quic = true;
- bool use_length_prefix =
- GetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids);
- EXPECT_CALL(
- *time_wait_list_manager_,
- SendVersionNegotiationPacket(server_connection_id, client_connection_id,
- ietf_quic, use_length_prefix, _, _, _, _))
- .Times(1);
- EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
-
- dispatcher_->ProcessPacket(server_address_, client_address, *received_packet);
-}
-
TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbe) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, true);
QuicSocketAddress client_address(QuicIpAddress::Loopback4(), 1);
CreateTimeWaitListManager();
char packet[1200];
@@ -1251,13 +1270,10 @@ TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbe) {
QuicConnectionId client_connection_id = EmptyQuicConnectionId();
QuicConnectionId server_connection_id(
destination_connection_id_bytes, sizeof(destination_connection_id_bytes));
- bool ietf_quic = true;
- bool use_length_prefix =
- GetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids);
- EXPECT_CALL(
- *time_wait_list_manager_,
- SendVersionNegotiationPacket(server_connection_id, client_connection_id,
- ietf_quic, use_length_prefix, _, _, _, _))
+ EXPECT_CALL(*time_wait_list_manager_,
+ SendVersionNegotiationPacket(
+ server_connection_id, client_connection_id,
+ /*ietf_quic=*/true, /*use_length_prefix=*/true, _, _, _, _))
.Times(1);
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
@@ -1288,9 +1304,7 @@ class SavingWriter : public QuicPacketWriterWrapper {
std::vector<std::unique_ptr<QuicEncryptedPacket>> packets_;
};
-TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeEndToEndOld) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, false);
-
+TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeEndToEnd) {
SavingWriter* saving_writer = new SavingWriter();
// dispatcher_ takes ownership of saving_writer.
QuicDispatcherPeer::UseWriter(dispatcher_.get(), saving_writer);
@@ -1317,7 +1331,7 @@ TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeEndToEndOld) {
ASSERT_EQ(1u, saving_writer->packets()->size());
char source_connection_id_bytes[255] = {};
- uint8_t source_connection_id_length = 0;
+ uint8_t source_connection_id_length = sizeof(source_connection_id_bytes);
std::string detailed_error = "foobar";
EXPECT_TRUE(QuicFramer::ParseServerVersionNegotiationProbeResponse(
(*(saving_writer->packets()))[0]->data(),
@@ -1332,9 +1346,9 @@ TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeEndToEndOld) {
destination_connection_id_bytes, sizeof(destination_connection_id_bytes));
}
-TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeEndToEnd) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, true);
-
+TEST_P(QuicDispatcherTestOneVersion, AndroidConformanceTest) {
+ // WARNING: do not remove or modify this test without making sure that we
+ // still have adequate coverage for the Android conformance test.
SavingWriter* saving_writer = new SavingWriter();
// dispatcher_ takes ownership of saving_writer.
QuicDispatcherPeer::UseWriter(dispatcher_.get(), saving_writer);
@@ -1345,13 +1359,20 @@ TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeEndToEnd) {
// dispatcher_ takes ownership of time_wait_list_manager.
QuicDispatcherPeer::SetTimeWaitListManager(dispatcher_.get(),
time_wait_list_manager);
- char packet[1200] = {};
- char destination_connection_id_bytes[] = {0x56, 0x4e, 0x20, 0x70,
- 0x6c, 0x7a, 0x20, 0x21};
- EXPECT_TRUE(QuicFramer::WriteClientVersionNegotiationProbePacket(
- packet, sizeof(packet), destination_connection_id_bytes,
- sizeof(destination_connection_id_bytes)));
- QuicEncryptedPacket encrypted(packet, sizeof(packet), false);
+ // clang-format off
+ static const unsigned char packet[1200] = {
+ // Android UDP network conformance test packet as it was after this change:
+ // https://android-review.googlesource.com/c/platform/cts/+/1454515
+ 0xc0, // long header
+ 0xaa, 0xda, 0xca, 0xca, // reserved-space version number
+ 0x08, // destination connection ID length
+ 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, // 8-byte connection ID
+ 0x00, // source connection ID length
+ };
+ // clang-format on
+
+ QuicEncryptedPacket encrypted(reinterpret_cast<const char*>(packet),
+ sizeof(packet), false);
std::unique_ptr<QuicReceivedPacket> received_packet(
ConstructReceivedPacket(encrypted, mock_helper_.GetClock()->Now()));
EXPECT_CALL(*dispatcher_, CreateQuicSession(_, _, _, _, _)).Times(0);
@@ -1360,25 +1381,22 @@ TEST_P(QuicDispatcherTestOneVersion, VersionNegotiationProbeEndToEnd) {
dispatcher_->ProcessPacket(server_address_, client_address, *received_packet);
ASSERT_EQ(1u, saving_writer->packets()->size());
- char source_connection_id_bytes[255] = {};
- uint8_t source_connection_id_length = 0;
- std::string detailed_error = "foobar";
- EXPECT_TRUE(QuicFramer::ParseServerVersionNegotiationProbeResponse(
- (*(saving_writer->packets()))[0]->data(),
- (*(saving_writer->packets()))[0]->length(), source_connection_id_bytes,
- &source_connection_id_length, &detailed_error));
- EXPECT_EQ("", detailed_error);
-
- // The source connection ID of the probe response should match the
- // destination connection ID of the probe request.
+ // The Android UDP network conformance test directly checks that these bytes
+ // of the response match the connection ID that was sent.
+ ASSERT_GE((*(saving_writer->packets()))[0]->length(), 15u);
quiche::test::CompareCharArraysWithHexError(
- "parsed probe", source_connection_id_bytes, source_connection_id_length,
- destination_connection_id_bytes, sizeof(destination_connection_id_bytes));
+ "response connection ID", &(*(saving_writer->packets()))[0]->data()[7], 8,
+ reinterpret_cast<const char*>(&packet[6]), 8);
}
-TEST_P(QuicDispatcherTestOneVersion, AndroidConformanceTest) {
- // WARNING: do not remove or modify this test without making sure that we
- // still have adequate coverage for the Android conformance test.
+TEST_P(QuicDispatcherTestOneVersion, AndroidConformanceTestOld) {
+ // WARNING: this test covers an old Android Conformance Test that has now been
+ // changed, but it'll take time for the change to propagate through the
+ // Android ecosystem. The Android team has asked us to keep this test
+ // supported until at least 2021-03-31. After that date, and when we drop
+ // support for sending QUIC version negotiation packets using the legacy
+ // Google QUIC format (Q001-Q043), then we can delete this test.
+ // TODO(dschinazi) delete this test after 2021-03-31
SavingWriter* saving_writer = new SavingWriter();
// dispatcher_ takes ownership of saving_writer.
QuicDispatcherPeer::UseWriter(dispatcher_.get(), saving_writer);
@@ -1393,6 +1411,8 @@ TEST_P(QuicDispatcherTestOneVersion, AndroidConformanceTest) {
static const unsigned char packet[1200] = {
// Android UDP network conformance test packet as it was after this change:
// https://android-review.googlesource.com/c/platform/cts/+/1104285
+ // but before this change:
+ // https://android-review.googlesource.com/c/platform/cts/+/1454515
0x0d, // public flags: version, 8-byte connection ID, 1-byte packet number
0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, // 8-byte connection ID
0xaa, 0xda, 0xca, 0xaa, // reserved-space version number
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.cc b/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.cc
index 8a075984be1..9abde9f52b1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.cc
@@ -7,7 +7,6 @@
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_client_stats.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
@@ -188,6 +187,27 @@ const char* QuicErrorCodeToString(QuicErrorCode error) {
RETURN_STRING_LITERAL(QUIC_QPACK_DECOMPRESSION_FAILED);
RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_ERROR);
RETURN_STRING_LITERAL(QUIC_QPACK_DECODER_STREAM_ERROR);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_STRING_LITERAL_TOO_LONG);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_HUFFMAN_ENCODING_ERROR);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_INVALID_STATIC_ENTRY);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_STATIC);
+ RETURN_STRING_LITERAL(
+ QUIC_QPACK_ENCODER_STREAM_INSERTION_INVALID_RELATIVE_INDEX);
+ RETURN_STRING_LITERAL(
+ QUIC_QPACK_ENCODER_STREAM_INSERTION_DYNAMIC_ENTRY_NOT_FOUND);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_DYNAMIC);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_LITERAL);
+ RETURN_STRING_LITERAL(
+ QUIC_QPACK_ENCODER_STREAM_DUPLICATE_INVALID_RELATIVE_INDEX);
+ RETURN_STRING_LITERAL(
+ QUIC_QPACK_ENCODER_STREAM_DUPLICATE_DYNAMIC_ENTRY_NOT_FOUND);
+ RETURN_STRING_LITERAL(QUIC_QPACK_ENCODER_STREAM_SET_DYNAMIC_TABLE_CAPACITY);
+ RETURN_STRING_LITERAL(QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE);
+ RETURN_STRING_LITERAL(QUIC_QPACK_DECODER_STREAM_INVALID_ZERO_INCREMENT);
+ RETURN_STRING_LITERAL(QUIC_QPACK_DECODER_STREAM_INCREMENT_OVERFLOW);
+ RETURN_STRING_LITERAL(QUIC_QPACK_DECODER_STREAM_IMPOSSIBLE_INSERT_COUNT);
+ RETURN_STRING_LITERAL(QUIC_QPACK_DECODER_STREAM_INCORRECT_ACKNOWLEDGEMENT);
RETURN_STRING_LITERAL(QUIC_STREAM_DATA_BEYOND_CLOSE_OFFSET);
RETURN_STRING_LITERAL(QUIC_STREAM_MULTIPLE_OFFSET);
RETURN_STRING_LITERAL(QUIC_HTTP_FRAME_TOO_LARGE);
@@ -209,6 +229,7 @@ const char* QuicErrorCodeToString(QuicErrorCode error) {
RETURN_STRING_LITERAL(QUIC_HTTP_GOAWAY_INVALID_STREAM_ID);
RETURN_STRING_LITERAL(QUIC_HTTP_GOAWAY_ID_LARGER_THAN_PREVIOUS);
RETURN_STRING_LITERAL(QUIC_HTTP_RECEIVE_SPDY_SETTING);
+ RETURN_STRING_LITERAL(QUIC_HTTP_RECEIVE_SPDY_FRAME);
RETURN_STRING_LITERAL(QUIC_HPACK_INDEX_VARINT_ERROR);
RETURN_STRING_LITERAL(QUIC_HPACK_NAME_LENGTH_VARINT_ERROR);
RETURN_STRING_LITERAL(QUIC_HPACK_VALUE_LENGTH_VARINT_ERROR);
@@ -232,6 +253,9 @@ const char* QuicErrorCodeToString(QuicErrorCode error) {
RETURN_STRING_LITERAL(QUIC_ZERO_RTT_RESUMPTION_LIMIT_REDUCED);
RETURN_STRING_LITERAL(QUIC_SILENT_IDLE_TIMEOUT);
RETURN_STRING_LITERAL(QUIC_MISSING_WRITE_KEYS);
+ RETURN_STRING_LITERAL(QUIC_KEY_UPDATE_ERROR);
+ RETURN_STRING_LITERAL(QUIC_AEAD_LIMIT_REACHED);
+ RETURN_STRING_LITERAL(QUIC_MAX_AGE_TIMEOUT);
RETURN_STRING_LITERAL(QUIC_LAST_ERROR);
// Intentionally have no default case, so we'll break the build
@@ -270,6 +294,8 @@ std::string QuicIetfTransportErrorCodeString(QuicIetfTransportErrorCodes c) {
RETURN_STRING_LITERAL(PROTOCOL_VIOLATION);
RETURN_STRING_LITERAL(INVALID_TOKEN);
RETURN_STRING_LITERAL(CRYPTO_BUFFER_EXCEEDED);
+ RETURN_STRING_LITERAL(KEY_UPDATE_ERROR);
+ RETURN_STRING_LITERAL(AEAD_LIMIT_REACHED);
// CRYPTO_ERROR is handled in the if before this switch, these cases do not
// change behavior and are only here to make the compiler happy.
case CRYPTO_ERROR_FIRST:
@@ -539,6 +565,57 @@ QuicErrorCodeToIetfMapping QuicErrorCodeToTransportErrorCode(
case QUIC_QPACK_DECODER_STREAM_ERROR:
return {false, static_cast<uint64_t>(
QuicHttpQpackErrorCode::DECODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_STRING_LITERAL_TOO_LONG:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_HUFFMAN_ENCODING_ERROR:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_INVALID_STATIC_ENTRY:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_STATIC:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_INSERTION_INVALID_RELATIVE_INDEX:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_INSERTION_DYNAMIC_ENTRY_NOT_FOUND:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_DYNAMIC:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_LITERAL:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_DUPLICATE_INVALID_RELATIVE_INDEX:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_DUPLICATE_DYNAMIC_ENTRY_NOT_FOUND:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_ENCODER_STREAM_SET_DYNAMIC_TABLE_CAPACITY:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::ENCODER_STREAM_ERROR)};
+ case QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::DECODER_STREAM_ERROR)};
+ case QUIC_QPACK_DECODER_STREAM_INVALID_ZERO_INCREMENT:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::DECODER_STREAM_ERROR)};
+ case QUIC_QPACK_DECODER_STREAM_INCREMENT_OVERFLOW:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::DECODER_STREAM_ERROR)};
+ case QUIC_QPACK_DECODER_STREAM_IMPOSSIBLE_INSERT_COUNT:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::DECODER_STREAM_ERROR)};
+ case QUIC_QPACK_DECODER_STREAM_INCORRECT_ACKNOWLEDGEMENT:
+ return {false, static_cast<uint64_t>(
+ QuicHttpQpackErrorCode::DECODER_STREAM_ERROR)};
case QUIC_STREAM_DATA_BEYOND_CLOSE_OFFSET:
return {true, static_cast<uint64_t>(PROTOCOL_VIOLATION)};
case QUIC_STREAM_MULTIPLE_OFFSET:
@@ -590,6 +667,9 @@ QuicErrorCodeToIetfMapping QuicErrorCodeToTransportErrorCode(
return {false, static_cast<uint64_t>(QuicHttp3ErrorCode::ID_ERROR)};
case QUIC_HTTP_RECEIVE_SPDY_SETTING:
return {false, static_cast<uint64_t>(QuicHttp3ErrorCode::SETTINGS_ERROR)};
+ case QUIC_HTTP_RECEIVE_SPDY_FRAME:
+ return {false,
+ static_cast<uint64_t>(QuicHttp3ErrorCode::FRAME_UNEXPECTED)};
case QUIC_HPACK_INDEX_VARINT_ERROR:
return {true, static_cast<uint64_t>(INTERNAL_ERROR)};
case QUIC_HPACK_NAME_LENGTH_VARINT_ERROR:
@@ -630,6 +710,12 @@ QuicErrorCodeToIetfMapping QuicErrorCodeToTransportErrorCode(
return {true, static_cast<uint64_t>(PROTOCOL_VIOLATION)};
case QUIC_MISSING_WRITE_KEYS:
return {true, static_cast<uint64_t>(INTERNAL_ERROR)};
+ case QUIC_KEY_UPDATE_ERROR:
+ return {true, static_cast<uint64_t>(KEY_UPDATE_ERROR)};
+ case QUIC_AEAD_LIMIT_REACHED:
+ return {true, static_cast<uint64_t>(AEAD_LIMIT_REACHED)};
+ case QUIC_MAX_AGE_TIMEOUT:
+ return {false, static_cast<uint64_t>(QuicHttp3ErrorCode::INTERNAL_ERROR)};
case QUIC_LAST_ERROR:
return {false, static_cast<uint64_t>(QUIC_LAST_ERROR)};
}
@@ -770,13 +856,6 @@ QuicRstStreamErrorCode IetfResetStreamErrorCodeToRstStreamErrorCode(
return QUIC_STREAM_UNKNOWN_APPLICATION_ERROR_CODE;
}
-void RecordFailToSerializePacketLocation(
- QuicFailToSerializePacketLocation location) {
- QUIC_CLIENT_HISTOGRAM_ENUM("QuicSession.FailToSerializePacketLocation",
- location, kMaxFailLocationValue,
- "The reason why a packet fails to serialize");
-}
-
#undef RETURN_STRING_LITERAL // undef for jumbo builds
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.h b/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.h
index 180dff7baf1..a1cd7a6eac9 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_error_codes.h
@@ -19,92 +19,92 @@ enum QuicRstStreamErrorCode {
QUIC_STREAM_NO_ERROR = 0,
// There was some error which halted stream processing.
- QUIC_ERROR_PROCESSING_STREAM,
+ QUIC_ERROR_PROCESSING_STREAM = 1,
// We got two fin or reset offsets which did not match.
- QUIC_MULTIPLE_TERMINATION_OFFSETS,
+ QUIC_MULTIPLE_TERMINATION_OFFSETS = 2,
// We got bad payload and can not respond to it at the protocol level.
- QUIC_BAD_APPLICATION_PAYLOAD,
+ QUIC_BAD_APPLICATION_PAYLOAD = 3,
// Stream closed due to connection error. No reset frame is sent when this
// happens.
- QUIC_STREAM_CONNECTION_ERROR,
+ QUIC_STREAM_CONNECTION_ERROR = 4,
// GoAway frame sent. No more stream can be created.
- QUIC_STREAM_PEER_GOING_AWAY,
+ QUIC_STREAM_PEER_GOING_AWAY = 5,
// The stream has been cancelled.
- QUIC_STREAM_CANCELLED,
+ QUIC_STREAM_CANCELLED = 6,
// Closing stream locally, sending a RST to allow for proper flow control
// accounting. Sent in response to a RST from the peer.
- QUIC_RST_ACKNOWLEDGEMENT,
+ QUIC_RST_ACKNOWLEDGEMENT = 7,
// Receiver refused to create the stream (because its limit on open streams
// has been reached). The sender should retry the request later (using
// another stream).
- QUIC_REFUSED_STREAM,
+ QUIC_REFUSED_STREAM = 8,
// Invalid URL in PUSH_PROMISE request header.
- QUIC_INVALID_PROMISE_URL,
+ QUIC_INVALID_PROMISE_URL = 9,
// Server is not authoritative for this URL.
- QUIC_UNAUTHORIZED_PROMISE_URL,
+ QUIC_UNAUTHORIZED_PROMISE_URL = 10,
// Can't have more than one active PUSH_PROMISE per URL.
- QUIC_DUPLICATE_PROMISE_URL,
+ QUIC_DUPLICATE_PROMISE_URL = 11,
// Vary check failed.
- QUIC_PROMISE_VARY_MISMATCH,
+ QUIC_PROMISE_VARY_MISMATCH = 12,
// Only GET and HEAD methods allowed.
- QUIC_INVALID_PROMISE_METHOD,
+ QUIC_INVALID_PROMISE_METHOD = 13,
// The push stream is unclaimed and timed out.
- QUIC_PUSH_STREAM_TIMED_OUT,
+ QUIC_PUSH_STREAM_TIMED_OUT = 14,
// Received headers were too large.
- QUIC_HEADERS_TOO_LARGE,
+ QUIC_HEADERS_TOO_LARGE = 15,
// The data is not likely arrive in time.
- QUIC_STREAM_TTL_EXPIRED,
+ QUIC_STREAM_TTL_EXPIRED = 16,
// The stream received data that goes beyond its close offset.
- QUIC_DATA_AFTER_CLOSE_OFFSET,
+ QUIC_DATA_AFTER_CLOSE_OFFSET = 17,
// Peer violated protocol requirements in a way which does not match a more
// specific error code, or endpoint declines to use the more specific error
// code.
- QUIC_STREAM_GENERAL_PROTOCOL_ERROR,
+ QUIC_STREAM_GENERAL_PROTOCOL_ERROR = 18,
// An internal error has occurred.
- QUIC_STREAM_INTERNAL_ERROR,
+ QUIC_STREAM_INTERNAL_ERROR = 19,
// Peer created a stream that will not be accepted.
- QUIC_STREAM_STREAM_CREATION_ERROR,
+ QUIC_STREAM_STREAM_CREATION_ERROR = 20,
// A stream required by the connection was closed or reset.
- QUIC_STREAM_CLOSED_CRITICAL_STREAM,
+ QUIC_STREAM_CLOSED_CRITICAL_STREAM = 21,
// A frame was received which was not permitted in the current state or on the
// current stream.
- QUIC_STREAM_FRAME_UNEXPECTED,
+ QUIC_STREAM_FRAME_UNEXPECTED = 22,
// A frame that fails to satisfy layout requirements or with an invalid size
// was received.
- QUIC_STREAM_FRAME_ERROR,
+ QUIC_STREAM_FRAME_ERROR = 23,
// Peer exhibits a behavior that might be generating excessive load.
- QUIC_STREAM_EXCESSIVE_LOAD,
+ QUIC_STREAM_EXCESSIVE_LOAD = 24,
// A Stream ID or Push ID was used incorrectly, such as exceeding a limit,
// reducing a limit, or being reused.
- QUIC_STREAM_ID_ERROR,
+ QUIC_STREAM_ID_ERROR = 25,
// Error in the payload of a SETTINGS frame.
- QUIC_STREAM_SETTINGS_ERROR,
+ QUIC_STREAM_SETTINGS_ERROR = 26,
// No SETTINGS frame was received at the beginning of the control stream.
- QUIC_STREAM_MISSING_SETTINGS,
+ QUIC_STREAM_MISSING_SETTINGS = 27,
// A server rejected a request without performing any application processing.
- QUIC_STREAM_REQUEST_REJECTED,
+ QUIC_STREAM_REQUEST_REJECTED = 28,
// The client's stream terminated without containing a fully-formed request.
- QUIC_STREAM_REQUEST_INCOMPLETE,
+ QUIC_STREAM_REQUEST_INCOMPLETE = 29,
// The connection established in response to a CONNECT request was reset or
// abnormally closed.
- QUIC_STREAM_CONNECT_ERROR,
+ QUIC_STREAM_CONNECT_ERROR = 30,
// The requested operation cannot be served over HTTP/3.
// The peer should retry over HTTP/1.1.
- QUIC_STREAM_VERSION_FALLBACK,
+ QUIC_STREAM_VERSION_FALLBACK = 31,
// The QPACK decoder failed to interpret a header block and is not able to
// continue decoding that header block.
- QUIC_STREAM_DECOMPRESSION_FAILED,
+ QUIC_STREAM_DECOMPRESSION_FAILED = 32,
// The QPACK decoder failed to interpret an encoder instruction received on
// the encoder stream.
- QUIC_STREAM_ENCODER_STREAM_ERROR,
+ QUIC_STREAM_ENCODER_STREAM_ERROR = 33,
// The QPACK encoder failed to interpret a decoder instruction received on the
// decoder stream.
- QUIC_STREAM_DECODER_STREAM_ERROR,
+ QUIC_STREAM_DECODER_STREAM_ERROR = 34,
// IETF RESET_FRAME application error code not matching any HTTP/3 or QPACK
// error codes.
- QUIC_STREAM_UNKNOWN_APPLICATION_ERROR_CODE,
+ QUIC_STREAM_UNKNOWN_APPLICATION_ERROR_CODE = 35,
// No error. Used as bound while iterating.
- QUIC_STREAM_LAST_ERROR,
+ QUIC_STREAM_LAST_ERROR = 36,
};
// QuicRstStreamErrorCode is encoded as a single octet on-the-wire.
static_assert(static_cast<int>(QUIC_STREAM_LAST_ERROR) <=
@@ -391,9 +391,58 @@ enum QuicErrorCode {
// Internal error codes for QPACK errors.
QUIC_QPACK_DECOMPRESSION_FAILED = 126,
+
+ // Obsolete generic QPACK encoder and decoder stream error codes.
+ // (Obsoleted by gfe2_reloadable_flag_quic_granular_qpack_error_codes.)
QUIC_QPACK_ENCODER_STREAM_ERROR = 127,
QUIC_QPACK_DECODER_STREAM_ERROR = 128,
+ // QPACK encoder stream errors.
+
+ // Variable integer exceeding 2^64-1 received.
+ QUIC_QPACK_ENCODER_STREAM_INTEGER_TOO_LARGE = 174,
+ // String literal exceeding kStringLiteralLengthLimit in length received.
+ QUIC_QPACK_ENCODER_STREAM_STRING_LITERAL_TOO_LONG = 175,
+ // String literal with invalid Huffman encoding received.
+ QUIC_QPACK_ENCODER_STREAM_HUFFMAN_ENCODING_ERROR = 176,
+ // Invalid static table index in Insert With Name Reference instruction.
+ QUIC_QPACK_ENCODER_STREAM_INVALID_STATIC_ENTRY = 177,
+ // Error inserting entry with static name reference in Insert With Name
+ // Reference instruction due to entry size exceeding dynamic table capacity.
+ QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_STATIC = 178,
+ // Invalid relative index in Insert With Name Reference instruction.
+ QUIC_QPACK_ENCODER_STREAM_INSERTION_INVALID_RELATIVE_INDEX = 179,
+ // Dynamic entry not found in Insert With Name Reference instruction.
+ QUIC_QPACK_ENCODER_STREAM_INSERTION_DYNAMIC_ENTRY_NOT_FOUND = 180,
+ // Error inserting entry with dynamic name reference in Insert With Name
+ // Reference instruction due to entry size exceeding dynamic table capacity.
+ QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_DYNAMIC = 181,
+ // Error inserting entry in Insert With Literal Name instruction due to entry
+ // size exceeding dynamic table capacity.
+ QUIC_QPACK_ENCODER_STREAM_ERROR_INSERTING_LITERAL = 182,
+ // Invalid relative index in Duplicate instruction.
+ QUIC_QPACK_ENCODER_STREAM_DUPLICATE_INVALID_RELATIVE_INDEX = 183,
+ // Dynamic entry not found in Duplicate instruction.
+ QUIC_QPACK_ENCODER_STREAM_DUPLICATE_DYNAMIC_ENTRY_NOT_FOUND = 184,
+ // Error in Set Dynamic Table Capacity instruction due to new capacity
+ // exceeding maximum dynamic table capacity.
+ QUIC_QPACK_ENCODER_STREAM_SET_DYNAMIC_TABLE_CAPACITY = 185,
+
+ // QPACK decoder stream errors.
+
+ // Variable integer exceeding 2^64-1 received.
+ QUIC_QPACK_DECODER_STREAM_INTEGER_TOO_LARGE = 186,
+ // Insert Count Increment instruction received with invalid 0 increment.
+ QUIC_QPACK_DECODER_STREAM_INVALID_ZERO_INCREMENT = 187,
+ // Insert Count Increment instruction causes uint64_t overflow.
+ QUIC_QPACK_DECODER_STREAM_INCREMENT_OVERFLOW = 188,
+ // Insert Count Increment instruction increases Known Received Count beyond
+ // inserted entry cound.
+ QUIC_QPACK_DECODER_STREAM_IMPOSSIBLE_INSERT_COUNT = 189,
+ // Header Acknowledgement received for stream that has no outstanding header
+ // blocks.
+ QUIC_QPACK_DECODER_STREAM_INCORRECT_ACKNOWLEDGEMENT = 190,
+
// Received stream data beyond close offset.
QUIC_STREAM_DATA_BEYOND_CLOSE_OFFSET = 129,
@@ -445,6 +494,8 @@ enum QuicErrorCode {
// HTTP/3 session received SETTINGS frame which contains HTTP/2 specific
// settings.
QUIC_HTTP_RECEIVE_SPDY_SETTING = 169,
+ // HTTP/3 session received an HTTP/2 only frame.
+ QUIC_HTTP_RECEIVE_SPDY_FRAME = 171,
// HPACK header block decoding errors.
// Index varint beyond implementation limit.
@@ -498,8 +549,22 @@ enum QuicErrorCode {
// Try to write data without the right write keys.
QUIC_MISSING_WRITE_KEYS = 170,
+ // An endpoint detected errors in performing key updates.
+ QUIC_KEY_UPDATE_ERROR = 172,
+
+ // An endpoint has reached the confidentiality or integrity limit for the
+ // AEAD algorithm used by the given connection.
+ QUIC_AEAD_LIMIT_REACHED = 173,
+
+ // Connection reached maximum age (regardless of activity), no new requests
+ // are accepted. This error code is sent in transport layer GOAWAY frame when
+ // using gQUIC, and only used internally when using HTTP/3. Active requests
+ // are still served, after which connection will be closed due to idle
+ // timeout.
+ QUIC_MAX_AGE_TIMEOUT = 191,
+
// No error. Used as bound while iterating.
- QUIC_LAST_ERROR = 171,
+ QUIC_LAST_ERROR = 192,
};
// QuicErrorCodes is encoded as four octets on-the-wire when doing Google QUIC,
// or a varint62 when doing IETF QUIC. Ensure that its value does not exceed
@@ -531,6 +596,8 @@ enum QuicIetfTransportErrorCodes : uint64_t {
PROTOCOL_VIOLATION = 0xA,
INVALID_TOKEN = 0xB,
CRYPTO_BUFFER_EXCEEDED = 0xD,
+ KEY_UPDATE_ERROR = 0xE,
+ AEAD_LIMIT_REACHED = 0xF,
CRYPTO_ERROR_FIRST = 0x100,
CRYPTO_ERROR_LAST = 0x1FF,
};
@@ -604,36 +671,6 @@ QUIC_EXPORT_PRIVATE inline std::string HistogramEnumDescription(
return "cause";
}
-enum QuicFailToSerializePacketLocation {
- kQuicFailToAppendPacketHeaderFastPath = 0,
- kQuicFailToAppendTypeFastPath = 1,
- kQuicFailToAppendStreamFrameFastPath = 2,
- kQuicFailToAddPaddingFastPath = 3,
- kQuicFailToWriteIetfLongHeaderLengthFastPath = 4,
- kQuicFailToEncryptPacketFastPath = 5,
- kQuicSerializePacketNonEmptyBuffer = 6,
- kQuicMissingInitialKey = 7,
- kQuicMissingHandshakeKey = 8,
- kQuicMissingZeroRttKey = 9,
- kQuicMissingOneRttKey = 10,
- kQuicFailToBuildPacketWithPaddingInitial = 11,
- kQuicFailToBuildPacketInitial = 12,
- kQuicFailToBuildPacketWithPaddingHandshake = 13,
- kQuicFailToBuildPacketHandshake = 14,
- kQuicFailToBuildPacketWithPaddingZeroRtt = 15,
- kQuicFailToBuildPacketZeroRtt = 16,
- kQuicFailToBuildPacketWithPaddingOneRtt = 17,
- kQuicFailToBuildPacketOneRtt = 18,
- kQuicFailToEncryptInitial = 19,
- kQuicFailToEncryptHandshake = 20,
- kQuicFailToEncryptZeroRtt = 21,
- kQuicFailToEncryptOneRtt = 22,
- kMaxFailLocationValue = kQuicFailToEncryptOneRtt
-};
-
-QUIC_EXPORT_PRIVATE void RecordFailToSerializePacketLocation(
- QuicFailToSerializePacketLocation location);
-
} // namespace quic
#endif // QUICHE_QUIC_CORE_QUIC_ERROR_CODES_H_
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_error_codes_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_error_codes_test.cc
index 0f567df48c2..ee4cacdbdf4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_error_codes_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_error_codes_test.cc
@@ -53,6 +53,10 @@ TEST_F(QuicErrorCodesTest, QuicIetfTransportErrorCodeString) {
EXPECT_EQ("INVALID_TOKEN", QuicIetfTransportErrorCodeString(INVALID_TOKEN));
EXPECT_EQ("CRYPTO_BUFFER_EXCEEDED",
QuicIetfTransportErrorCodeString(CRYPTO_BUFFER_EXCEEDED));
+ EXPECT_EQ("KEY_UPDATE_ERROR",
+ QuicIetfTransportErrorCodeString(KEY_UPDATE_ERROR));
+ EXPECT_EQ("AEAD_LIMIT_REACHED",
+ QuicIetfTransportErrorCodeString(AEAD_LIMIT_REACHED));
EXPECT_EQ("Unknown(1024)",
QuicIetfTransportErrorCodeString(
@@ -74,7 +78,7 @@ TEST_F(QuicErrorCodesTest, QuicErrorCodeToTransportErrorCode) {
if (ietf_error_code.is_transport_close) {
QuicIetfTransportErrorCodes transport_error_code =
static_cast<QuicIetfTransportErrorCodes>(ietf_error_code.error_code);
- bool is_valid_transport_error_code = transport_error_code <= 0x0d;
+ bool is_valid_transport_error_code = transport_error_code <= 0x0f;
EXPECT_TRUE(is_valid_transport_error_code) << internal_error_code_string;
} else {
// Non-transport errors are application errors, either HTTP/3 or QPACK.
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_flags_list.h b/chromium/net/third_party/quiche/src/quic/core/quic_flags_list.h
new file mode 100644
index 00000000000..72cd4bb38df
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_flags_list.h
@@ -0,0 +1,92 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file is autogenerated by the QUICHE Copybara export script.
+
+QUIC_FLAG(FLAGS_quic_reloadable_flag_http2_use_fast_huffman_encoder, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_abort_qpack_on_stream_close, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_ack_delay_alarm_granularity, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_add_stream_info_to_idle_close_detail, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_allocate_stream_sequencer_buffer_blocks_on_demand, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_allow_client_enabled_bbr_v2, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_avoid_too_low_probe_bw_cwnd, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_fewer_startup_round_trips, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_no_exit_startup_on_loss_with_bw_growth, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_startup_loss_exit_use_max_delivered, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_support_max_bootstrap_cwnd, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_use_post_inflight_to_detect_queuing, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_bbr2_use_tcp_inflight_hi_headroom, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_can_send_ack_frequency, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_check_keys_before_writing, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_clean_up_spdy_session_destructor, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_close_connection_in_on_can_write_with_blocked_writer, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_connection_set_initial_self_address, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_conservative_bursts, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_conservative_cwnd_and_pacing_gains, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_copy_bbr_cwnd_to_bbr2, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_deallocate_message_right_after_sent, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_default_enable_5rto_blackhole_detection2, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_default_on_pto, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_default_to_2_rttvar, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_default_to_bbr, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_default_to_bbr_v2, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_delay_initial_ack, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_server_blackhole_detection, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_draft_27, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_draft_29, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_q043, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_q046, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_q050, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_t050, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_disable_version_t051, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_discard_initial_packet_with_key_dropped, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_do_not_clip_received_error_code, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_donot_reset_ideal_next_packet_send_time, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_enable_aead_limits, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_enable_mtu_discovery_at_server, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_encrypted_control_frames, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_extract_x509_subject_using_certificate_view, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_address_validation, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_arm_pto_for_application_data, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_http3_goaway_stream_id, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_missing_initial_keys2, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_out_of_order_sending2, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_pto_pending_timer_count, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_undecryptable_packets2, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_fix_willing_and_able_to_write2, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_give_sent_packet_to_debug_visitor_after_sent, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_goaway_with_max_stream_id, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_granular_qpack_error_codes, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_key_update_supported, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_let_connection_handle_pings, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_max_age_send_goaway, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_new_priority_update_frame, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_process_undecryptable_packets_after_async_decrypt_callback, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_record_received_min_ack_delay, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_reject_spdy_frames, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_reject_spdy_settings, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_require_handshake_confirmation, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_round_up_tiny_bandwidth, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_send_goaway_with_connection_close, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_send_path_response, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_send_timestamps, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_send_version_negotiation_for_short_connection_ids, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_split_up_send_rst_2, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_start_peer_migration_earlier, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_stop_sending_uses_ietf_error_code, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_testonly_default_false, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_testonly_default_true, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_unified_iw_options, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_use_circular_deque_for_unacked_packets, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_use_encryption_level_context, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_use_fast_huffman_encoder, true)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_quic_use_write_or_buffer_data_at_level, false)
+QUIC_FLAG(FLAGS_quic_reloadable_flag_send_quic_fallback_server_config_on_leto_error, false)
+QUIC_FLAG(FLAGS_quic_restart_flag_dont_fetch_quic_private_keys_from_leto, false)
+QUIC_FLAG(FLAGS_quic_restart_flag_quic_enable_zero_rtt_for_tls_v2, true)
+QUIC_FLAG(FLAGS_quic_restart_flag_quic_offload_pacing_to_usps2, false)
+QUIC_FLAG(FLAGS_quic_restart_flag_quic_session_tickets_always_enabled, true)
+QUIC_FLAG(FLAGS_quic_restart_flag_quic_support_release_time_for_gso, false)
+QUIC_FLAG(FLAGS_quic_restart_flag_quic_testonly_default_false, false)
+QUIC_FLAG(FLAGS_quic_restart_flag_quic_testonly_default_true, true)
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_flow_controller_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_flow_controller_test.cc
index 29a9ba37649..5a275700502 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_flow_controller_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_flow_controller_test.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <utility>
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h"
@@ -39,6 +40,9 @@ class QuicFlowControllerTest : public QuicTest {
void Initialize() {
connection_ = new MockQuicConnection(&helper_, &alarm_factory_,
Perspective::IS_CLIENT);
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
session_ = std::make_unique<MockQuicSession>(connection_);
flow_controller_ = std::make_unique<QuicFlowController>(
session_.get(), stream_id_, /*is_connection_flow_controller*/ false,
@@ -115,7 +119,7 @@ TEST_F(QuicFlowControllerTest, ReceivingBytes) {
QuicFlowControllerPeer::ReceiveWindowSize(flow_controller_.get()));
// Consume enough bytes to send a WINDOW_UPDATE frame.
- EXPECT_CALL(*connection_, SendControlFrame(_)).Times(1);
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).Times(1);
flow_controller_->AddBytesConsumed(1 + receive_window_ / 2);
@@ -185,7 +189,7 @@ TEST_F(QuicFlowControllerTest, ReceivingBytesFastIncreasesFlowWindow) {
should_auto_tune_receive_window_ = true;
Initialize();
// This test will generate two WINDOW_UPDATE frames.
- EXPECT_CALL(*connection_, SendControlFrame(_)).Times(1);
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).Times(1);
EXPECT_TRUE(flow_controller_->auto_tune_receive_window());
// Make sure clock is inititialized.
@@ -237,9 +241,9 @@ TEST_F(QuicFlowControllerTest, ReceivingBytesFastIncreasesFlowWindow) {
TEST_F(QuicFlowControllerTest, ReceivingBytesFastNoAutoTune) {
Initialize();
// This test will generate two WINDOW_UPDATE frames.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(2)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
EXPECT_FALSE(flow_controller_->auto_tune_receive_window());
// Make sure clock is inititialized.
@@ -292,7 +296,7 @@ TEST_F(QuicFlowControllerTest, ReceivingBytesNormalStableFlowWindow) {
should_auto_tune_receive_window_ = true;
Initialize();
// This test will generate two WINDOW_UPDATE frames.
- EXPECT_CALL(*connection_, SendControlFrame(_)).Times(1);
+ EXPECT_CALL(*session_, WriteControlFrame(_, _)).Times(1);
EXPECT_TRUE(flow_controller_->auto_tune_receive_window());
// Make sure clock is inititialized.
@@ -347,9 +351,9 @@ TEST_F(QuicFlowControllerTest, ReceivingBytesNormalStableFlowWindow) {
TEST_F(QuicFlowControllerTest, ReceivingBytesNormalNoAutoTune) {
Initialize();
// This test will generate two WINDOW_UPDATE frames.
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(2)
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
EXPECT_FALSE(flow_controller_->auto_tune_receive_window());
// Make sure clock is inititialized.
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_framer.cc b/chromium/net/third_party/quiche/src/quic/core/quic_framer.cc
index e57277c672a..90f4370b063 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_framer.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_framer.cc
@@ -11,6 +11,13 @@
#include <string>
#include <utility>
+#include "absl/base/attributes.h"
+#include "absl/base/macros.h"
+#include "absl/base/optimization.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_split.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake_message.h"
@@ -34,18 +41,14 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_aligned.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_client_stats.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_stack_trace.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -295,14 +298,14 @@ EncryptionLevel GetEncryptionLevel(const QuicPacketHeader& header) {
return NUM_ENCRYPTION_LEVELS;
}
-quiche::QuicheStringPiece TruncateErrorString(quiche::QuicheStringPiece error) {
+absl::string_view TruncateErrorString(absl::string_view error) {
if (error.length() <= kMaxErrorStringLength) {
return error;
}
- return quiche::QuicheStringPiece(error.data(), kMaxErrorStringLength);
+ return absl::string_view(error.data(), kMaxErrorStringLength);
}
-size_t TruncatedErrorStringSize(const quiche::QuicheStringPiece& error) {
+size_t TruncatedErrorStringSize(const absl::string_view& error) {
if (error.length() < kMaxErrorStringLength) {
return error.length();
}
@@ -412,6 +415,9 @@ QuicFramer::QuicFramer(const ParsedQuicVersionVector& supported_versions,
process_timestamps_(false),
creation_time_(creation_time),
last_timestamp_(QuicTime::Delta::Zero()),
+ support_key_update_for_connection_(false),
+ current_key_phase_bit_(false),
+ potential_peer_key_update_attempt_count_(0),
first_sending_packet_number_(FirstSendingPacketNumber()),
data_producer_(nullptr),
infer_packet_header_type_from_version_(perspective ==
@@ -942,7 +948,7 @@ size_t QuicFramer::BuildDataPacket(const QuicPacketHeader& header,
break;
case MTU_DISCOVERY_FRAME:
// MTU discovery frames are serialized as ping frames.
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case PING_FRAME:
// Ping has no payload.
break;
@@ -1088,7 +1094,7 @@ size_t QuicFramer::AppendIetfFrames(const QuicFrames& frames,
return 0;
case MTU_DISCOVERY_FRAME:
// MTU discovery frames are serialized as ping frames.
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case PING_FRAME:
// Ping has no payload.
break;
@@ -1304,6 +1310,15 @@ std::unique_ptr<QuicEncryptedPacket> QuicFramer::BuildVersionNegotiationPacket(
bool ietf_quic,
bool use_length_prefix,
const ParsedQuicVersionVector& versions) {
+ QUIC_CODE_COUNT(quic_build_version_negotiation);
+ if (use_length_prefix) {
+ DCHECK(ietf_quic);
+ QUIC_CODE_COUNT(quic_build_version_negotiation_ietf);
+ } else if (ietf_quic) {
+ QUIC_CODE_COUNT(quic_build_version_negotiation_old_ietf);
+ } else {
+ QUIC_CODE_COUNT(quic_build_version_negotiation_old_gquic);
+ }
ParsedQuicVersionVector wire_versions = versions;
// Add a version reserved for negotiation as suggested by the
// "Using Reserved Versions" section of draft-ietf-quic-transport.
@@ -1413,6 +1428,13 @@ QuicFramer::BuildIetfVersionNegotiationPacket(
}
bool QuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) {
+ is_processing_packet_ = true;
+ bool result = ProcessPacketInternal(packet);
+ is_processing_packet_ = false;
+ return result;
+}
+
+bool QuicFramer::ProcessPacketInternal(const QuicEncryptedPacket& packet) {
QuicDataReader reader(packet.data(), packet.length());
bool packet_has_ietf_packet_header = false;
@@ -1480,13 +1502,13 @@ bool QuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) {
} else if (packet.length() <= kMaxIncomingPacketSize) {
// The optimized decryption algorithm implementations run faster when
// operating on aligned memory.
- QUIC_CACHELINE_ALIGNED char buffer[kMaxIncomingPacketSize];
+ ABSL_CACHELINE_ALIGNED char buffer[kMaxIncomingPacketSize];
if (packet_has_ietf_packet_header) {
rv = ProcessIetfDataPacket(&reader, &header, packet, buffer,
- QUICHE_ARRAYSIZE(buffer));
+ ABSL_ARRAYSIZE(buffer));
} else {
rv = ProcessDataPacket(&reader, &header, packet, buffer,
- QUICHE_ARRAYSIZE(buffer));
+ ABSL_ARRAYSIZE(buffer));
}
} else {
std::unique_ptr<char[]> large_buffer(new char[packet.length()]);
@@ -1547,14 +1569,13 @@ bool QuicFramer::ProcessRetryPacket(QuicDataReader* reader,
const size_t retry_token_length =
bytes_remaining - kRetryIntegrityTagLength;
DCHECK_GT(retry_token_length, 0u);
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
if (!reader->ReadStringPiece(&retry_token, retry_token_length)) {
set_detailed_error("Failed to read retry token.");
return false;
}
- quiche::QuicheStringPiece retry_without_tag =
- reader->PreviouslyReadPayload();
- quiche::QuicheStringPiece integrity_tag = reader->ReadRemainingPayload();
+ absl::string_view retry_without_tag = reader->PreviouslyReadPayload();
+ absl::string_view integrity_tag = reader->ReadRemainingPayload();
DCHECK_EQ(integrity_tag.length(), kRetryIntegrityTagLength);
visitor_->OnRetryPacket(EmptyQuicConnectionId(),
header.source_connection_id, retry_token,
@@ -1591,11 +1612,11 @@ bool QuicFramer::ProcessRetryPacket(QuicDataReader* reader,
return false;
}
- quiche::QuicheStringPiece retry_token = reader->ReadRemainingPayload();
+ absl::string_view retry_token = reader->ReadRemainingPayload();
visitor_->OnRetryPacket(original_destination_connection_id,
header.source_connection_id, retry_token,
- /*retry_integrity_tag=*/quiche::QuicheStringPiece(),
- /*retry_without_tag=*/quiche::QuicheStringPiece());
+ /*retry_integrity_tag=*/absl::string_view(),
+ /*retry_without_tag=*/absl::string_view());
return true;
}
@@ -1611,8 +1632,7 @@ void QuicFramer::MaybeProcessCoalescedPacket(
return;
}
- quiche::QuicheStringPiece remaining_data =
- encrypted_reader.PeekRemainingPayload();
+ absl::string_view remaining_data = encrypted_reader.PeekRemainingPayload();
DCHECK_EQ(remaining_data.length(), remaining_bytes_length);
const char* coalesced_data =
@@ -1630,8 +1650,8 @@ void QuicFramer::MaybeProcessCoalescedPacket(
<< "Failed to parse received coalesced header of length "
<< coalesced_data_length
<< " with error: " << detailed_error_ << ": "
- << quiche::QuicheTextUtils::HexEncode(coalesced_data,
- coalesced_data_length)
+ << absl::BytesToHexString(absl::string_view(
+ coalesced_data, coalesced_data_length))
<< " previous header was " << header;
return;
}
@@ -1695,8 +1715,7 @@ bool QuicFramer::ProcessIetfDataPacket(QuicDataReader* encrypted_reader,
perspective_ == Perspective::IS_CLIENT) {
// Peek possible stateless reset token. Will only be used on decryption
// failure.
- quiche::QuicheStringPiece remaining =
- encrypted_reader->PeekRemainingPayload();
+ absl::string_view remaining = encrypted_reader->PeekRemainingPayload();
if (remaining.length() >= sizeof(header->possible_stateless_reset_token)) {
header->has_possible_stateless_reset_token = true;
memcpy(&header->possible_stateless_reset_token,
@@ -1710,7 +1729,7 @@ bool QuicFramer::ProcessIetfDataPacket(QuicDataReader* encrypted_reader,
return false;
}
- quiche::QuicheStringPiece associated_data;
+ absl::string_view associated_data;
std::vector<char> ad_storage;
QuicPacketNumber base_packet_number;
if (header->form == IETF_QUIC_SHORT_HEADER_PACKET ||
@@ -1736,8 +1755,7 @@ bool QuicFramer::ProcessIetfDataPacket(QuicDataReader* encrypted_reader,
&full_packet_number, &ad_storage)) {
hp_removal_failed = true;
}
- associated_data =
- quiche::QuicheStringPiece(ad_storage.data(), ad_storage.size());
+ associated_data = absl::string_view(ad_storage.data(), ad_storage.size());
} else if (!ProcessAndCalculatePacketNumber(
encrypted_reader, header->packet_number_length,
base_packet_number, &full_packet_number)) {
@@ -1801,8 +1819,7 @@ bool QuicFramer::ProcessIetfDataPacket(QuicDataReader* encrypted_reader,
return false;
}
- quiche::QuicheStringPiece encrypted =
- encrypted_reader->ReadRemainingPayload();
+ absl::string_view encrypted = encrypted_reader->ReadRemainingPayload();
if (!version_.HasHeaderProtection()) {
associated_data = GetAssociatedDataFromEncryptedPacket(
version_.transport_version, packet,
@@ -1906,16 +1923,14 @@ bool QuicFramer::ProcessDataPacket(QuicDataReader* encrypted_reader,
return false;
}
- quiche::QuicheStringPiece encrypted =
- encrypted_reader->ReadRemainingPayload();
- quiche::QuicheStringPiece associated_data =
- GetAssociatedDataFromEncryptedPacket(
- version_.transport_version, packet,
- GetIncludedDestinationConnectionIdLength(*header),
- GetIncludedSourceConnectionIdLength(*header), header->version_flag,
- header->nonce != nullptr, header->packet_number_length,
- header->retry_token_length_length, header->retry_token.length(),
- header->length_length);
+ absl::string_view encrypted = encrypted_reader->ReadRemainingPayload();
+ absl::string_view associated_data = GetAssociatedDataFromEncryptedPacket(
+ version_.transport_version, packet,
+ GetIncludedDestinationConnectionIdLength(*header),
+ GetIncludedSourceConnectionIdLength(*header), header->version_flag,
+ header->nonce != nullptr, header->packet_number_length,
+ header->retry_token_length_length, header->retry_token.length(),
+ header->length_length);
size_t decrypted_length = 0;
EncryptionLevel decrypted_level;
@@ -1995,7 +2010,7 @@ bool QuicFramer::ProcessPublicResetPacket(QuicDataReader* reader,
}
// TODO(satyamshekhar): validate nonce to protect against DoS.
- quiche::QuicheStringPiece address;
+ absl::string_view address;
if (reset->GetStringPiece(kCADR, &address)) {
QuicSocketAddressCoder address_coder;
if (address_coder.Decode(address.data(), address.length())) {
@@ -2004,7 +2019,7 @@ bool QuicFramer::ProcessPublicResetPacket(QuicDataReader* reader,
}
}
- quiche::QuicheStringPiece endpoint_id;
+ absl::string_view endpoint_id;
if (perspective_ == Perspective::IS_CLIENT &&
reset->GetStringPiece(kEPID, &endpoint_id)) {
packet.endpoint_id = std::string(endpoint_id);
@@ -2051,6 +2066,20 @@ bool QuicFramer::HasAnEncrypterForSpace(PacketNumberSpace space) const {
return false;
}
+EncryptionLevel QuicFramer::GetEncryptionLevelToSendApplicationData() const {
+ if (!HasAnEncrypterForSpace(APPLICATION_DATA)) {
+ QUIC_BUG
+ << "Tried to get encryption level to send application data with no "
+ "encrypter available.";
+ return NUM_ENCRYPTION_LEVELS;
+ }
+ if (HasEncrypterOfEncryptionLevel(ENCRYPTION_FORWARD_SECURE)) {
+ return ENCRYPTION_FORWARD_SECURE;
+ }
+ DCHECK(HasEncrypterOfEncryptionLevel(ENCRYPTION_ZERO_RTT));
+ return ENCRYPTION_ZERO_RTT;
+}
+
bool QuicFramer::AppendPacketHeader(const QuicPacketHeader& header,
QuicDataWriter* writer,
size_t* length_field_offset) {
@@ -2143,7 +2172,7 @@ bool QuicFramer::AppendIetfHeaderTypeByte(const QuicPacketHeader& header,
PacketNumberLengthToOnWireValue(header.packet_number_length));
} else {
type = static_cast<uint8_t>(
- FLAGS_FIXED_BIT |
+ FLAGS_FIXED_BIT | (current_key_phase_bit_ ? FLAGS_KEY_PHASE_BIT : 0) |
PacketNumberLengthToOnWireValue(header.packet_number_length));
}
return writer->WriteUInt8(type);
@@ -2992,7 +3021,7 @@ bool QuicFramer::ProcessFrameData(QuicDataReader* reader,
continue;
}
case IETF_EXTENSION_MESSAGE_NO_LENGTH:
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case IETF_EXTENSION_MESSAGE: {
QuicMessageFrame message_frame;
if (!ProcessMessageFrame(reader,
@@ -3339,7 +3368,7 @@ bool QuicFramer::ProcessIetfFrameData(QuicDataReader* reader,
break;
}
case IETF_EXTENSION_MESSAGE_NO_LENGTH_V99:
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case IETF_EXTENSION_MESSAGE_V99: {
QuicMessageFrame message_frame;
if (!ProcessMessageFrame(
@@ -3476,8 +3505,8 @@ bool QuicFramer::ProcessStreamFrame(QuicDataReader* reader,
return false;
}
- // TODO(ianswett): Don't use quiche::QuicheStringPiece as an intermediary.
- quiche::QuicheStringPiece data;
+ // TODO(ianswett): Don't use absl::string_view as an intermediary.
+ absl::string_view data;
if (has_data_length) {
if (!reader->ReadStringPiece16(&data)) {
set_detailed_error("Unable to read frame data.");
@@ -3538,8 +3567,8 @@ bool QuicFramer::ProcessIetfStreamFrame(QuicDataReader* reader,
frame->fin = false;
}
- // TODO(ianswett): Don't use quiche::QuicheStringPiece as an intermediary.
- quiche::QuicheStringPiece data;
+ // TODO(ianswett): Don't use absl::string_view as an intermediary.
+ absl::string_view data;
if (!reader->ReadStringPiece(&data, frame->data_length)) {
set_detailed_error("Unable to read frame data.");
return false;
@@ -3566,8 +3595,8 @@ bool QuicFramer::ProcessCryptoFrame(QuicDataReader* reader,
}
frame->data_length = len;
- // TODO(ianswett): Don't use quiche::QuicheStringPiece as an intermediary.
- quiche::QuicheStringPiece data;
+ // TODO(ianswett): Don't use absl::string_view as an intermediary.
+ absl::string_view data;
if (!reader->ReadStringPiece(&data, frame->data_length)) {
set_detailed_error("Unable to read frame data.");
return false;
@@ -4058,10 +4087,13 @@ bool QuicFramer::ProcessConnectionCloseFrame(QuicDataReader* reader,
return false;
}
- if (!GetQuicReloadableFlag(quic_do_not_clip_received_error_code) &&
- error_code >= QUIC_LAST_ERROR) {
- // Ignore invalid QUIC error code if any.
- error_code = QUIC_LAST_ERROR;
+ if (GetQuicReloadableFlag(quic_do_not_clip_received_error_code)) {
+ QUIC_CODE_COUNT_N(quic_do_not_clip_received_error_code, 1, 2);
+ } else {
+ if (error_code >= QUIC_LAST_ERROR) {
+ // Ignore invalid QUIC error code if any.
+ error_code = QUIC_LAST_ERROR;
+ }
}
// For Google QUIC connection closes, |wire_error_code| and |quic_error_code|
@@ -4069,7 +4101,7 @@ bool QuicFramer::ProcessConnectionCloseFrame(QuicDataReader* reader,
frame->wire_error_code = error_code;
frame->quic_error_code = static_cast<QuicErrorCode>(error_code);
- quiche::QuicheStringPiece error_details;
+ absl::string_view error_details;
if (!reader->ReadStringPiece16(&error_details)) {
set_detailed_error("Unable to read connection close error details.");
return false;
@@ -4087,10 +4119,13 @@ bool QuicFramer::ProcessGoAwayFrame(QuicDataReader* reader,
return false;
}
- if (!GetQuicReloadableFlag(quic_do_not_clip_received_error_code) &&
- error_code >= QUIC_LAST_ERROR) {
- // Ignore invalid QUIC error code if any.
- error_code = QUIC_LAST_ERROR;
+ if (GetQuicReloadableFlag(quic_do_not_clip_received_error_code)) {
+ QUIC_CODE_COUNT_N(quic_do_not_clip_received_error_code, 2, 2);
+ } else {
+ if (error_code >= QUIC_LAST_ERROR) {
+ // Ignore invalid QUIC error code if any.
+ error_code = QUIC_LAST_ERROR;
+ }
}
frame->error_code = static_cast<QuicErrorCode>(error_code);
@@ -4101,7 +4136,7 @@ bool QuicFramer::ProcessGoAwayFrame(QuicDataReader* reader,
}
frame->last_good_stream_id = static_cast<QuicStreamId>(stream_id);
- quiche::QuicheStringPiece reason_phrase;
+ absl::string_view reason_phrase;
if (!reader->ReadStringPiece16(&reason_phrase)) {
set_detailed_error("Unable to read goaway reason.");
return false;
@@ -4155,7 +4190,7 @@ bool QuicFramer::ProcessMessageFrame(QuicDataReader* reader,
bool no_message_length,
QuicMessageFrame* frame) {
if (no_message_length) {
- quiche::QuicheStringPiece remaining(reader->ReadRemainingPayload());
+ absl::string_view remaining(reader->ReadRemainingPayload());
frame->data = remaining.data();
frame->message_length = remaining.length();
return true;
@@ -4167,7 +4202,7 @@ bool QuicFramer::ProcessMessageFrame(QuicDataReader* reader,
return false;
}
- quiche::QuicheStringPiece message_piece;
+ absl::string_view message_piece;
if (!reader->ReadStringPiece(&message_piece, message_length)) {
set_detailed_error("Unable to read message data");
return false;
@@ -4180,7 +4215,7 @@ bool QuicFramer::ProcessMessageFrame(QuicDataReader* reader,
}
// static
-quiche::QuicheStringPiece QuicFramer::GetAssociatedDataFromEncryptedPacket(
+absl::string_view QuicFramer::GetAssociatedDataFromEncryptedPacket(
QuicTransportVersion version,
const QuicEncryptedPacket& encrypted,
QuicConnectionIdLength destination_connection_id_length,
@@ -4192,7 +4227,7 @@ quiche::QuicheStringPiece QuicFramer::GetAssociatedDataFromEncryptedPacket(
uint64_t retry_token_length,
QuicVariableLengthIntegerLength length_length) {
// TODO(ianswett): This is identical to QuicData::AssociatedData.
- return quiche::QuicheStringPiece(
+ return absl::string_view(
encrypted.data(),
GetStartOfEncryptedData(version, destination_connection_id_length,
source_connection_id_length, includes_version,
@@ -4242,6 +4277,48 @@ void QuicFramer::RemoveDecrypter(EncryptionLevel level) {
decrypter_[level] = nullptr;
}
+void QuicFramer::SetKeyUpdateSupportForConnection(bool enabled) {
+ QUIC_DVLOG(1) << ENDPOINT << "SetKeyUpdateSupportForConnection: " << enabled;
+ support_key_update_for_connection_ = enabled;
+ if (enabled) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_key_update_supported);
+ }
+}
+
+void QuicFramer::DiscardPreviousOneRttKeys() {
+ DCHECK(support_key_update_for_connection_);
+ QUIC_DVLOG(1) << ENDPOINT << "Discarding previous set of 1-RTT keys";
+ previous_decrypter_ = nullptr;
+}
+
+bool QuicFramer::DoKeyUpdate(KeyUpdateReason reason) {
+ DCHECK(support_key_update_for_connection_);
+ if (!next_decrypter_) {
+ // If key update is locally initiated, next decrypter might not be created
+ // yet.
+ next_decrypter_ = visitor_->AdvanceKeysAndCreateCurrentOneRttDecrypter();
+ }
+ std::unique_ptr<QuicEncrypter> next_encrypter =
+ visitor_->CreateCurrentOneRttEncrypter();
+ if (!next_decrypter_ || !next_encrypter) {
+ QUIC_BUG << "Failed to create next crypters";
+ return false;
+ }
+ current_key_phase_bit_ = !current_key_phase_bit_;
+ QUIC_DLOG(INFO) << ENDPOINT << "DoKeyUpdate: new current_key_phase_bit_="
+ << current_key_phase_bit_;
+ current_key_phase_first_received_packet_number_.Clear();
+ previous_decrypter_ = std::move(decrypter_[ENCRYPTION_FORWARD_SECURE]);
+ decrypter_[ENCRYPTION_FORWARD_SECURE] = std::move(next_decrypter_);
+ encrypter_[ENCRYPTION_FORWARD_SECURE] = std::move(next_encrypter);
+ visitor_->OnKeyUpdate(reason);
+ return true;
+}
+
+QuicPacketCount QuicFramer::PotentialPeerKeyUpdateAttemptCount() const {
+ return potential_peer_key_update_attempt_count_;
+}
+
const QuicDecrypter* QuicFramer::GetDecrypter(EncryptionLevel level) const {
DCHECK(version_.KnowsWhichDecrypterToUse());
return decrypter_[level].get();
@@ -4297,10 +4374,10 @@ size_t QuicFramer::EncryptInPlace(EncryptionLevel level,
size_t output_length = 0;
if (!encrypter_[level]->EncryptPacket(
packet_number.ToUint64(),
- quiche::QuicheStringPiece(buffer, ad_len), // Associated data
- quiche::QuicheStringPiece(buffer + ad_len,
- total_len - ad_len), // Plaintext
- buffer + ad_len, // Destination buffer
+ absl::string_view(buffer, ad_len), // Associated data
+ absl::string_view(buffer + ad_len,
+ total_len - ad_len), // Plaintext
+ buffer + ad_len, // Destination buffer
&output_length, buffer_len - ad_len)) {
RaiseError(QUIC_ENCRYPTION_FAILURE);
return 0;
@@ -4339,7 +4416,7 @@ bool QuicFramer::ApplyHeaderProtection(EncryptionLevel level,
// Sample the ciphertext and generate the mask to use for header protection.
size_t sample_offset = pn_offset + 4;
QuicDataReader sample_reader(buffer, buffer_len);
- quiche::QuicheStringPiece sample;
+ absl::string_view sample;
if (!sample_reader.Seek(sample_offset) ||
!sample_reader.ReadStringPiece(&sample, kHPSampleLen)) {
QUIC_BUG << "Not enough bytes to sample: sample_offset " << sample_offset
@@ -4434,11 +4511,11 @@ bool QuicFramer::RemoveHeaderProtection(QuicDataReader* reader,
// Read a sample from the ciphertext and compute the mask to use for header
// protection.
- quiche::QuicheStringPiece remaining_packet = reader->PeekRemainingPayload();
+ absl::string_view remaining_packet = reader->PeekRemainingPayload();
QuicDataReader sample_reader(remaining_packet);
// The sample starts 4 bytes after the start of the packet number.
- quiche::QuicheStringPiece pn;
+ absl::string_view pn;
if (!sample_reader.ReadStringPiece(&pn, 4)) {
QUIC_DVLOG(1) << "Not enough data to sample";
return false;
@@ -4475,7 +4552,7 @@ bool QuicFramer::RemoveHeaderProtection(QuicDataReader* reader,
static_cast<QuicPacketNumberLength>((header->type_byte & 0x03) + 1);
char pn_buffer[IETF_MAX_PACKET_NUMBER_LENGTH] = {};
- QuicDataWriter pn_writer(QUICHE_ARRAYSIZE(pn_buffer), pn_buffer);
+ QuicDataWriter pn_writer(ABSL_ARRAYSIZE(pn_buffer), pn_buffer);
// Read the (protected) packet number from the reader and unmask the packet
// number.
@@ -4506,7 +4583,7 @@ bool QuicFramer::RemoveHeaderProtection(QuicDataReader* reader,
}
// Get the associated data, and apply the same unmasking operations to it.
- quiche::QuicheStringPiece ad = GetAssociatedDataFromEncryptedPacket(
+ absl::string_view ad = GetAssociatedDataFromEncryptedPacket(
version_.transport_version, packet,
GetIncludedDestinationConnectionIdLength(*header),
GetIncludedSourceConnectionIdLength(*header), header->version_flag,
@@ -4548,7 +4625,7 @@ size_t QuicFramer::EncryptPayload(EncryptionLevel level,
return 0;
}
- quiche::QuicheStringPiece associated_data =
+ absl::string_view associated_data =
packet.AssociatedData(version_.transport_version);
// Copy in the header, because the encrypter only populates the encrypted
// plaintext content.
@@ -4609,8 +4686,16 @@ size_t QuicFramer::GetMaxPlaintextSize(size_t ciphertext_size) {
return min_plaintext_size;
}
-bool QuicFramer::DecryptPayload(quiche::QuicheStringPiece encrypted,
- quiche::QuicheStringPiece associated_data,
+QuicPacketCount QuicFramer::GetOneRttEncrypterConfidentialityLimit() const {
+ if (!encrypter_[ENCRYPTION_FORWARD_SECURE]) {
+ QUIC_BUG << "1-RTT encrypter not set";
+ return 0;
+ }
+ return encrypter_[ENCRYPTION_FORWARD_SECURE]->GetConfidentialityLimit();
+}
+
+bool QuicFramer::DecryptPayload(absl::string_view encrypted,
+ absl::string_view associated_data,
const QuicPacketHeader& header,
char* decrypted_buffer,
size_t buffer_length,
@@ -4623,6 +4708,9 @@ bool QuicFramer::DecryptPayload(quiche::QuicheStringPiece encrypted,
EncryptionLevel level = decrypter_level_;
QuicDecrypter* decrypter = decrypter_[level].get();
QuicDecrypter* alternative_decrypter = nullptr;
+ bool key_phase_parsed = false;
+ bool key_phase;
+ bool attempt_key_update = false;
if (version().KnowsWhichDecrypterToUse()) {
if (header.form == GOOGLE_QUIC_PACKET) {
QUIC_BUG << "Attempted to decrypt GOOGLE_QUIC_PACKET with a version that "
@@ -4642,6 +4730,46 @@ bool QuicFramer::DecryptPayload(quiche::QuicheStringPiece encrypted,
perspective_ == Perspective::IS_CLIENT && header.nonce != nullptr) {
decrypter->SetDiversificationNonce(*header.nonce);
}
+ if (support_key_update_for_connection_ &&
+ header.form == IETF_QUIC_SHORT_HEADER_PACKET) {
+ DCHECK(version().UsesTls());
+ DCHECK_EQ(level, ENCRYPTION_FORWARD_SECURE);
+ key_phase = (header.type_byte & FLAGS_KEY_PHASE_BIT) != 0;
+ key_phase_parsed = true;
+ QUIC_DVLOG(1) << ENDPOINT << "packet " << header.packet_number
+ << " received key_phase=" << key_phase
+ << " current_key_phase_bit_=" << current_key_phase_bit_;
+ if (key_phase != current_key_phase_bit_) {
+ if (current_key_phase_first_received_packet_number_.IsInitialized() &&
+ header.packet_number >
+ current_key_phase_first_received_packet_number_) {
+ if (!next_decrypter_) {
+ next_decrypter_ =
+ visitor_->AdvanceKeysAndCreateCurrentOneRttDecrypter();
+ if (!next_decrypter_) {
+ QUIC_BUG << "Failed to create next_decrypter";
+ return false;
+ }
+ }
+ QUIC_DVLOG(1) << ENDPOINT << "packet " << header.packet_number
+ << " attempt_key_update=true";
+ attempt_key_update = true;
+ potential_peer_key_update_attempt_count_++;
+ decrypter = next_decrypter_.get();
+ } else {
+ if (previous_decrypter_) {
+ QUIC_DVLOG(1) << ENDPOINT
+ << "trying previous_decrypter_ for packet "
+ << header.packet_number;
+ decrypter = previous_decrypter_.get();
+ } else {
+ QUIC_DVLOG(1) << ENDPOINT << "dropping packet "
+ << header.packet_number << " with old key phase";
+ return false;
+ }
+ }
+ }
+ }
} else if (alternative_decrypter_level_ != NUM_ENCRYPTION_LEVELS) {
if (!EncryptionLevelIsValid(alternative_decrypter_level_)) {
QUIC_BUG << "Attempted to decrypt with bad alternative_decrypter_level_";
@@ -4662,6 +4790,28 @@ bool QuicFramer::DecryptPayload(quiche::QuicheStringPiece encrypted,
if (success) {
visitor_->OnDecryptedPacket(level);
*decrypted_level = level;
+ potential_peer_key_update_attempt_count_ = 0;
+ if (attempt_key_update) {
+ if (!DoKeyUpdate(KeyUpdateReason::kRemote)) {
+ set_detailed_error("Key update failed due to internal error");
+ return RaiseError(QUIC_INTERNAL_ERROR);
+ }
+ DCHECK_EQ(current_key_phase_bit_, key_phase);
+ }
+ if (key_phase_parsed &&
+ !current_key_phase_first_received_packet_number_.IsInitialized() &&
+ key_phase == current_key_phase_bit_) {
+ // Set packet number for current key phase if it hasn't been initialized
+ // yet. This is set outside of attempt_key_update since the key update
+ // may have been initiated locally, and in that case we don't know yet
+ // which packet number from the remote side to use until we receive a
+ // packet with that phase.
+ QUIC_DVLOG(1) << ENDPOINT
+ << "current_key_phase_first_received_packet_number_ = "
+ << header.packet_number;
+ current_key_phase_first_received_packet_number_ = header.packet_number;
+ visitor_->OnDecryptedFirstPacketInKeyPhase();
+ }
} else if (alternative_decrypter != nullptr) {
if (header.nonce != nullptr) {
DCHECK_EQ(perspective_, Perspective::IS_CLIENT);
@@ -5142,8 +5292,8 @@ bool QuicFramer::ProcessNewTokenFrame(QuicDataReader* reader,
return false;
}
- // TODO(ianswett): Don't use quiche::QuicheStringPiece as an intermediary.
- quiche::QuicheStringPiece data;
+ // TODO(ianswett): Don't use absl::string_view as an intermediary.
+ absl::string_view data;
if (!reader->ReadStringPiece(&data, length)) {
set_detailed_error("Unable to read new token data.");
return false;
@@ -5556,9 +5706,9 @@ bool QuicFramer::AppendIetfAckFrameAndTypeByte(const QuicAckFrame& frame,
const uint64_t ack_range = iter->Length() - 1;
if (writer->remaining() < ecn_size ||
- static_cast<size_t>(writer->remaining() - ecn_size) <
- QuicDataWriter::GetVarInt62Len(gap) +
- QuicDataWriter::GetVarInt62Len(ack_range)) {
+ writer->remaining() - ecn_size <
+ static_cast<size_t>(QuicDataWriter::GetVarInt62Len(gap) +
+ QuicDataWriter::GetVarInt62Len(ack_range))) {
// ACK range does not fit, truncate it.
break;
}
@@ -5813,7 +5963,7 @@ bool QuicFramer::ProcessIetfConnectionCloseFrame(
return false;
}
- quiche::QuicheStringPiece phrase;
+ absl::string_view phrase;
if (!reader->ReadStringPiece(&phrase, static_cast<size_t>(phrase_length))) {
set_detailed_error("Unable to read connection close error details.");
return false;
@@ -6284,7 +6434,7 @@ QuicErrorCode QuicFramer::ParsePublicHeaderDispatcher(
QuicConnectionId* destination_connection_id,
QuicConnectionId* source_connection_id,
bool* retry_token_present,
- quiche::QuicheStringPiece* retry_token,
+ absl::string_view* retry_token,
std::string* detailed_error) {
QuicDataReader reader(packet.data(), packet.length());
if (reader.IsDoneReading()) {
@@ -6454,7 +6604,7 @@ QuicErrorCode QuicFramer::ParsePublicHeader(
QuicConnectionId* source_connection_id,
QuicLongHeaderType* long_packet_type,
QuicVariableLengthIntegerLength* retry_token_length_length,
- quiche::QuicheStringPiece* retry_token,
+ absl::string_view* retry_token,
std::string* detailed_error) {
*version_present = false;
*has_length_prefix = false;
@@ -6463,7 +6613,7 @@ QuicErrorCode QuicFramer::ParsePublicHeader(
*source_connection_id = EmptyQuicConnectionId();
*long_packet_type = INVALID_PACKET_TYPE;
*retry_token_length_length = VARIABLE_LENGTH_INTEGER_LENGTH_0;
- *retry_token = quiche::QuicheStringPiece();
+ *retry_token = absl::string_view();
*detailed_error = "";
if (!reader->ReadUInt8(first_byte)) {
@@ -6563,14 +6713,10 @@ bool QuicFramer::WriteClientVersionNegotiationProbePacket(
return false;
}
if (destination_connection_id_length > kQuicMaxConnectionId4BitLength ||
- destination_connection_id_length <
- kQuicMinimumInitialConnectionIdLength) {
+ destination_connection_id_length < kQuicDefaultConnectionIdLength) {
QUIC_BUG << "Invalid connection_id_length";
return false;
}
- const bool use_length_prefix =
- GetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids);
- const uint8_t last_version_byte = use_length_prefix ? 0xda : 0xba;
// clang-format off
const unsigned char packet_start_bytes[] = {
// IETF long header with fixed bit set, type initial, all-0 encrypted bits.
@@ -6578,7 +6724,7 @@ bool QuicFramer::WriteClientVersionNegotiationProbePacket(
// Version, part of the IETF space reserved for negotiation.
// This intentionally differs from QuicVersionReservedForNegotiation()
// to allow differentiating them over the wire.
- 0xca, 0xba, 0xda, last_version_byte,
+ 0xca, 0xba, 0xda, 0xda,
};
// clang-format on
static_assert(sizeof(packet_start_bytes) == 5, "bad packet_start_bytes size");
@@ -6591,8 +6737,8 @@ bool QuicFramer::WriteClientVersionNegotiationProbePacket(
QuicConnectionId destination_connection_id(destination_connection_id_bytes,
destination_connection_id_length);
if (!AppendIetfConnectionIds(
- /*version_flag=*/true, use_length_prefix, destination_connection_id,
- EmptyQuicConnectionId(), &writer)) {
+ /*version_flag=*/true, /*use_length_prefix=*/true,
+ destination_connection_id, EmptyQuicConnectionId(), &writer)) {
QUIC_BUG << "Failed to write connection IDs";
return false;
}
@@ -6676,46 +6822,28 @@ bool QuicFramer::ParseServerVersionNegotiationProbeResponse(
*detailed_error = "Packet is not a version negotiation packet";
return false;
}
- const bool use_length_prefix =
- GetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids);
+
QuicConnectionId destination_connection_id, source_connection_id;
- if (use_length_prefix) {
- if (!reader.ReadLengthPrefixedConnectionId(&destination_connection_id)) {
- *detailed_error = "Failed to read destination connection ID";
- return false;
- }
- if (!reader.ReadLengthPrefixedConnectionId(&source_connection_id)) {
- *detailed_error = "Failed to read source connection ID";
- return false;
- }
- } else {
- uint8_t expected_server_connection_id_length = 0,
- destination_connection_id_length = 0,
- source_connection_id_length = 0;
- if (!ProcessAndValidateIetfConnectionIdLength(
- &reader, UnsupportedQuicVersion(), Perspective::IS_CLIENT,
- /*should_update_expected_server_connection_id_length=*/true,
- &expected_server_connection_id_length,
- &destination_connection_id_length, &source_connection_id_length,
- detailed_error)) {
- return false;
- }
- if (!reader.ReadConnectionId(&destination_connection_id,
- destination_connection_id_length)) {
- *detailed_error = "Failed to read destination connection ID";
- return false;
- }
- if (!reader.ReadConnectionId(&source_connection_id,
- source_connection_id_length)) {
- *detailed_error = "Failed to read source connection ID";
- return false;
- }
+ if (!reader.ReadLengthPrefixedConnectionId(&destination_connection_id)) {
+ *detailed_error = "Failed to read destination connection ID";
+ return false;
+ }
+ if (!reader.ReadLengthPrefixedConnectionId(&source_connection_id)) {
+ *detailed_error = "Failed to read source connection ID";
+ return false;
}
if (destination_connection_id.length() != 0) {
*detailed_error = "Received unexpected destination connection ID length";
return false;
}
+ if (*source_connection_id_length_out < source_connection_id.length()) {
+ *detailed_error = quiche::QuicheStrCat(
+ "*source_connection_id_length_out too small ",
+ static_cast<int>(*source_connection_id_length_out), " < ",
+ static_cast<int>(source_connection_id.length()));
+ return false;
+ }
memcpy(source_connection_id_bytes, source_connection_id.data(),
source_connection_id.length());
@@ -6731,11 +6859,10 @@ bool QuicFramer::ParseServerVersionNegotiationProbeResponse(
// the string is not found, or is not properly formed, it returns
// ErrorCode::QUIC_IETF_GQUIC_ERROR_MISSING
void MaybeExtractQuicErrorCode(QuicConnectionCloseFrame* frame) {
- std::vector<quiche::QuicheStringPiece> ed =
- quiche::QuicheTextUtils::Split(frame->error_details, ':');
+ std::vector<absl::string_view> ed = absl::StrSplit(frame->error_details, ':');
uint64_t extracted_error_code;
if (ed.size() < 2 || !quiche::QuicheTextUtils::IsAllDigits(ed[0]) ||
- !quiche::QuicheTextUtils::StringToUint64(ed[0], &extracted_error_code)) {
+ !absl::SimpleAtoi(ed[0], &extracted_error_code)) {
if (frame->close_type == IETF_QUIC_TRANSPORT_CONNECTION_CLOSE &&
frame->wire_error_code == NO_IETF_QUIC_ERROR) {
frame->quic_error_code = QUIC_NO_ERROR;
@@ -6749,7 +6876,7 @@ void MaybeExtractQuicErrorCode(QuicConnectionCloseFrame* frame) {
// including, the split character, so the length of ed[0] is just the number
// of digits in the error number. In removing the prefix, 1 is added to the
// length to account for the :
- quiche::QuicheStringPiece x = quiche::QuicheStringPiece(frame->error_details);
+ absl::string_view x = absl::string_view(frame->error_details);
x.remove_prefix(ed[0].length() + 1);
frame->error_details = std::string(x);
frame->quic_error_code = static_cast<QuicErrorCode>(extracted_error_code);
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_framer.h b/chromium/net/third_party/quiche/src/quic/core/quic_framer.h
index 4fcd67110f6..fba99f875d5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_framer.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_framer.h
@@ -10,6 +10,7 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
@@ -17,7 +18,6 @@
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -106,9 +106,9 @@ class QUIC_EXPORT_PRIVATE QuicFramerVisitorInterface {
// the entire RETRY packet except the Retry Integrity Tag field.
virtual void OnRetryPacket(QuicConnectionId original_connection_id,
QuicConnectionId new_connection_id,
- quiche::QuicheStringPiece retry_token,
- quiche::QuicheStringPiece retry_integrity_tag,
- quiche::QuicheStringPiece retry_without_tag) = 0;
+ absl::string_view retry_token,
+ absl::string_view retry_integrity_tag,
+ absl::string_view retry_without_tag) = 0;
// Called when all fields except packet number has been parsed, but has not
// been authenticated. If it returns false, framing for this packet will
@@ -237,6 +237,25 @@ class QUIC_EXPORT_PRIVATE QuicFramerVisitorInterface {
// Called when an IETF StreamsBlocked frame has been parsed.
virtual bool OnStreamsBlockedFrame(const QuicStreamsBlockedFrame& frame) = 0;
+
+ // Called when a Key Phase Update has been initiated. This is called for both
+ // locally and peer initiated key updates. If the key update was locally
+ // initiated, this does not indicate the peer has received the key update yet.
+ virtual void OnKeyUpdate(KeyUpdateReason reason) = 0;
+
+ // Called on the first decrypted packet in each key phase (including the
+ // first key phase.)
+ virtual void OnDecryptedFirstPacketInKeyPhase() = 0;
+
+ // Called when the framer needs to generate a decrypter for the next key
+ // phase. Each call should generate the key for phase n+1.
+ virtual std::unique_ptr<QuicDecrypter>
+ AdvanceKeysAndCreateCurrentOneRttDecrypter() = 0;
+
+ // Called when the framer needs to generate an encrypter. The key corresponds
+ // to the key phase of the last decrypter returned by
+ // AdvanceKeysAndCreateCurrentOneRttDecrypter().
+ virtual std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() = 0;
};
// Class for parsing and constructing QUIC packets. It has a
@@ -300,6 +319,9 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
// ignored.
bool ProcessPacket(const QuicEncryptedPacket& packet);
+ // Whether we are in the middle of a call to this->ProcessPacket.
+ bool is_processing_packet() const { return is_processing_packet_; }
+
// Largest size in bytes of all stream frame fields without the payload.
static size_t GetMinStreamFrameSize(QuicTransportVersion version,
QuicStreamId stream_id,
@@ -385,7 +407,7 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
// Returns the associated data from the encrypted packet |encrypted| as a
// stringpiece.
- static quiche::QuicheStringPiece GetAssociatedDataFromEncryptedPacket(
+ static absl::string_view GetAssociatedDataFromEncryptedPacket(
QuicTransportVersion version,
const QuicEncryptedPacket& encrypted,
QuicConnectionIdLength destination_connection_id_length,
@@ -397,7 +419,7 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
uint64_t retry_token_length,
QuicVariableLengthIntegerLength length_length);
- // Parses the unencryoted fields in a QUIC header using |reader| as input,
+ // Parses the unencrypted fields in a QUIC header using |reader| as input,
// stores the result in the other parameters.
// |expected_destination_connection_id_length| is only used for short headers.
static QuicErrorCode ParsePublicHeader(
@@ -414,10 +436,10 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
QuicConnectionId* source_connection_id,
QuicLongHeaderType* long_packet_type,
QuicVariableLengthIntegerLength* retry_token_length_length,
- quiche::QuicheStringPiece* retry_token,
+ absl::string_view* retry_token,
std::string* detailed_error);
- // Parses the unencryoted fields in |packet| and stores them in the other
+ // Parses the unencrypted fields in |packet| and stores them in the other
// parameters. This can only be called on the server.
// |expected_destination_connection_id_length| is only used for short headers.
static QuicErrorCode ParsePublicHeaderDispatcher(
@@ -432,7 +454,7 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
QuicConnectionId* destination_connection_id,
QuicConnectionId* source_connection_id,
bool* retry_token_present,
- quiche::QuicheStringPiece* retry_token,
+ absl::string_view* retry_token,
std::string* detailed_error);
// Serializes a packet containing |frames| into |buffer|.
@@ -519,6 +541,17 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
std::unique_ptr<QuicDecrypter> decrypter);
void RemoveDecrypter(EncryptionLevel level);
+ // Enables key update support.
+ void SetKeyUpdateSupportForConnection(bool enabled);
+ // Discard the decrypter for the previous key phase.
+ void DiscardPreviousOneRttKeys();
+ // Update the key phase.
+ bool DoKeyUpdate(KeyUpdateReason reason);
+ // Returns the count of packets received that appeared to attempt a key
+ // update but failed decryption which have been received since the last
+ // successfully decrypted packet.
+ QuicPacketCount PotentialPeerKeyUpdateAttemptCount() const;
+
const QuicDecrypter* GetDecrypter(EncryptionLevel level) const;
const QuicDecrypter* decrypter() const;
const QuicDecrypter* alternative_decrypter() const;
@@ -559,6 +592,10 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
// to ciphertext no larger than |ciphertext_size|.
size_t GetMaxPlaintextSize(size_t ciphertext_size);
+ // Returns the maximum number of packets that can be safely encrypted with
+ // the active AEAD. 1-RTT keys must be set before calling this method.
+ QuicPacketCount GetOneRttEncrypterConfidentialityLimit() const;
+
const std::string& detailed_error() { return detailed_error_; }
// The minimum packet number length required to represent |packet_number|.
@@ -584,6 +621,10 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
// Returns true if an encrypter of |space| is available.
bool HasAnEncrypterForSpace(PacketNumberSpace space) const;
+ // Returns the encryption level to send application data. This should be only
+ // called with available encrypter for application data.
+ EncryptionLevel GetEncryptionLevelToSendApplicationData() const;
+
void set_validate_flags(bool value) { validate_flags_ = value; }
Perspective perspective() const { return perspective_; }
@@ -637,10 +678,12 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
// WriteClientVersionNegotiationProbePacket. |packet_bytes| must point to
// |packet_length| bytes in memory which represent the response.
// |packet_length| must be greater or equal to 6. This method will fill in
- // |source_connection_id_bytes| which must point to at least 18 bytes in
- // memory. |source_connection_id_length_out| will contain the length of the
- // received source connection ID, which on success will match the contents of
- // the destination connection ID passed in to
+ // |source_connection_id_bytes| which must point to at least
+ // |*source_connection_id_length_out| bytes in memory.
+ // |*source_connection_id_length_out| must be at least 18.
+ // |*source_connection_id_length_out| will contain the length of the received
+ // source connection ID, which on success will match the contents of the
+ // destination connection ID passed in to
// WriteClientVersionNegotiationProbePacket. In the case of a failure,
// |detailed_error| will be filled in with an explanation of what failed.
static bool ParseServerVersionNegotiationProbeResponse(
@@ -665,7 +708,7 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
private:
friend class test::QuicFramerPeer;
- typedef std::map<QuicPacketNumber, uint8_t> NackRangeMap;
+ using NackRangeMap = std::map<QuicPacketNumber, uint8_t>;
struct QUIC_EXPORT_PRIVATE AckFrameInfo {
AckFrameInfo();
@@ -806,8 +849,8 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
bool no_message_length,
QuicMessageFrame* frame);
- bool DecryptPayload(quiche::QuicheStringPiece encrypted,
- quiche::QuicheStringPiece associated_data,
+ bool DecryptPayload(absl::string_view encrypted,
+ absl::string_view associated_data,
const QuicPacketHeader& header,
char* decrypted_buffer,
size_t buffer_length,
@@ -1010,6 +1053,8 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
QuicIetfFrameType type,
QuicStreamId* id);
+ bool ProcessPacketInternal(const QuicEncryptedPacket& packet);
+
std::string detailed_error_;
QuicFramerVisitorInterface* visitor_;
QuicErrorCode error_;
@@ -1057,6 +1102,27 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
// The last timestamp received if process_timestamps_ is true.
QuicTime::Delta last_timestamp_;
+ // Whether IETF QUIC Key Update is supported on this connection.
+ bool support_key_update_for_connection_;
+ // The value of the current key phase bit, which is toggled when the keys are
+ // changed.
+ bool current_key_phase_bit_;
+ // Tracks the first packet received in the current key phase. Will be
+ // uninitialized before the first one-RTT packet has been received or after a
+ // locally initiated key update but before the first packet from the peer in
+ // the new key phase is received.
+ QuicPacketNumber current_key_phase_first_received_packet_number_;
+ // Counts the number of packets received that might have been failed key
+ // update attempts. Reset to zero every time a packet is successfully
+ // decrypted.
+ QuicPacketCount potential_peer_key_update_attempt_count_;
+ // Decrypter for the previous key phase. Will be null if in the first key
+ // phase or previous keys have been discarded.
+ std::unique_ptr<QuicDecrypter> previous_decrypter_;
+ // Decrypter for the next key phase. May be null if next keys haven't been
+ // generated yet.
+ std::unique_ptr<QuicDecrypter> next_decrypter_;
+
// If this is a framer of a connection, this is the packet number of first
// sending packet. If this is a framer of a framer of dispatcher, this is the
// packet number of sent packets (for those which have packet number).
@@ -1066,6 +1132,9 @@ class QUIC_EXPORT_PRIVATE QuicFramer {
// owned. TODO(fayang): Consider add data producer to framer's constructor.
QuicStreamFrameDataProducer* data_producer_;
+ // Whether we are in the middle of a call to this->ProcessPacket.
+ bool is_processing_packet_ = false;
+
// If true, framer infers packet header type (IETF/GQUIC) from version_.
// Otherwise, framer infers packet header type from first byte of a received
// packet.
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_framer_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_framer_test.cc
index 4da3e03fb99..ba9a70e46fc 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_framer_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_framer_test.cc
@@ -12,6 +12,10 @@
#include <utility>
#include <vector>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/match.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
@@ -30,8 +34,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_framer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_data_producer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -92,17 +94,17 @@ const uint8_t kVarInt62EightBytes = 0xc0;
class TestEncrypter : public QuicEncrypter {
public:
~TestEncrypter() override {}
- bool SetKey(quiche::QuicheStringPiece /*key*/) override { return true; }
- bool SetNoncePrefix(quiche::QuicheStringPiece /*nonce_prefix*/) override {
+ bool SetKey(absl::string_view /*key*/) override { return true; }
+ bool SetNoncePrefix(absl::string_view /*nonce_prefix*/) override {
return true;
}
- bool SetIV(quiche::QuicheStringPiece /*iv*/) override { return true; }
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece /*key*/) override {
+ bool SetIV(absl::string_view /*iv*/) override { return true; }
+ bool SetHeaderProtectionKey(absl::string_view /*key*/) override {
return true;
}
bool EncryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t /*max_output_length*/) override {
@@ -114,7 +116,7 @@ class TestEncrypter : public QuicEncrypter {
return true;
}
std::string GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece /*sample*/) override {
+ absl::string_view /*sample*/) override {
return std::string(5, 0);
}
size_t GetKeySize() const override { return 0; }
@@ -126,11 +128,12 @@ class TestEncrypter : public QuicEncrypter {
size_t GetCiphertextSize(size_t plaintext_size) const override {
return plaintext_size;
}
- quiche::QuicheStringPiece GetKey() const override {
- return quiche::QuicheStringPiece();
+ QuicPacketCount GetConfidentialityLimit() const override {
+ return std::numeric_limits<QuicPacketCount>::max();
}
- quiche::QuicheStringPiece GetNoncePrefix() const override {
- return quiche::QuicheStringPiece();
+ absl::string_view GetKey() const override { return absl::string_view(); }
+ absl::string_view GetNoncePrefix() const override {
+ return absl::string_view();
}
QuicPacketNumber packet_number_;
@@ -141,15 +144,15 @@ class TestEncrypter : public QuicEncrypter {
class TestDecrypter : public QuicDecrypter {
public:
~TestDecrypter() override {}
- bool SetKey(quiche::QuicheStringPiece /*key*/) override { return true; }
- bool SetNoncePrefix(quiche::QuicheStringPiece /*nonce_prefix*/) override {
+ bool SetKey(absl::string_view /*key*/) override { return true; }
+ bool SetNoncePrefix(absl::string_view /*nonce_prefix*/) override {
return true;
}
- bool SetIV(quiche::QuicheStringPiece /*iv*/) override { return true; }
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece /*key*/) override {
+ bool SetIV(absl::string_view /*iv*/) override { return true; }
+ bool SetHeaderProtectionKey(absl::string_view /*key*/) override {
return true;
}
- bool SetPreliminaryKey(quiche::QuicheStringPiece /*key*/) override {
+ bool SetPreliminaryKey(absl::string_view /*key*/) override {
QUIC_BUG << "should not be called";
return false;
}
@@ -157,8 +160,8 @@ class TestDecrypter : public QuicDecrypter {
return true;
}
bool DecryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t /*max_output_length*/) override {
@@ -176,19 +179,45 @@ class TestDecrypter : public QuicDecrypter {
size_t GetKeySize() const override { return 0; }
size_t GetNoncePrefixSize() const override { return 0; }
size_t GetIVSize() const override { return 0; }
- quiche::QuicheStringPiece GetKey() const override {
- return quiche::QuicheStringPiece();
- }
- quiche::QuicheStringPiece GetNoncePrefix() const override {
- return quiche::QuicheStringPiece();
+ absl::string_view GetKey() const override { return absl::string_view(); }
+ absl::string_view GetNoncePrefix() const override {
+ return absl::string_view();
}
// Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
uint32_t cipher_id() const override { return 0xFFFFFFF2; }
+ QuicPacketCount GetIntegrityLimit() const override {
+ return std::numeric_limits<QuicPacketCount>::max();
+ }
QuicPacketNumber packet_number_;
std::string associated_data_;
std::string ciphertext_;
};
+std::unique_ptr<QuicEncryptedPacket> EncryptPacketWithTagAndPhase(
+ const QuicPacket& packet,
+ uint8_t tag,
+ bool phase) {
+ std::string packet_data = std::string(packet.AsStringPiece());
+ if (phase) {
+ packet_data[0] |= FLAGS_KEY_PHASE_BIT;
+ } else {
+ packet_data[0] &= ~FLAGS_KEY_PHASE_BIT;
+ }
+
+ TaggingEncrypter crypter(tag);
+ const size_t packet_size = crypter.GetCiphertextSize(packet_data.size());
+ char* buffer = new char[packet_size];
+ size_t buf_len = 0;
+ if (!crypter.EncryptPacket(0, absl::string_view(), packet_data, buffer,
+ &buf_len, packet_size)) {
+ delete[] buffer;
+ return nullptr;
+ }
+
+ return std::make_unique<QuicEncryptedPacket>(buffer, buf_len,
+ /*owns_buffer=*/true);
+}
+
class TestQuicVisitor : public QuicFramerVisitorInterface {
public:
TestQuicVisitor()
@@ -197,6 +226,8 @@ class TestQuicVisitor : public QuicFramerVisitorInterface {
packet_count_(0),
frame_count_(0),
complete_packets_(0),
+ derive_next_key_count_(0),
+ decrypted_first_packet_in_key_phase_count_(0),
accept_packet_(true),
accept_public_header_(true) {}
@@ -224,9 +255,9 @@ class TestQuicVisitor : public QuicFramerVisitorInterface {
void OnRetryPacket(QuicConnectionId original_connection_id,
QuicConnectionId new_connection_id,
- quiche::QuicheStringPiece retry_token,
- quiche::QuicheStringPiece retry_integrity_tag,
- quiche::QuicheStringPiece retry_without_tag) override {
+ absl::string_view retry_token,
+ absl::string_view retry_integrity_tag,
+ absl::string_view retry_without_tag) override {
on_retry_packet_called_ = true;
retry_original_connection_id_ =
std::make_unique<QuicConnectionId>(original_connection_id);
@@ -551,17 +582,39 @@ class TestQuicVisitor : public QuicFramerVisitorInterface {
EXPECT_EQ(0u, framer_->current_received_frame_type());
}
+ void OnKeyUpdate(KeyUpdateReason reason) override {
+ key_update_reasons_.push_back(reason);
+ }
+
+ void OnDecryptedFirstPacketInKeyPhase() override {
+ decrypted_first_packet_in_key_phase_count_++;
+ }
+
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ derive_next_key_count_++;
+ return std::make_unique<StrictTaggingDecrypter>(derive_next_key_count_);
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return std::make_unique<TaggingEncrypter>(derive_next_key_count_);
+ }
+
void set_framer(QuicFramer* framer) {
framer_ = framer;
transport_version_ = framer->transport_version();
}
+ size_t key_update_count() const { return key_update_reasons_.size(); }
+
// Counters from the visitor_ callbacks.
int error_count_;
int version_mismatch_;
int packet_count_;
int frame_count_;
int complete_packets_;
+ std::vector<KeyUpdateReason> key_update_reasons_;
+ int derive_next_key_count_;
+ int decrypted_first_packet_in_key_phase_count_;
bool accept_packet_;
bool accept_public_header_;
@@ -707,7 +760,7 @@ class QuicFramerTest : public QuicTestWithParam<ParsedQuicVersion> {
<< " actual: " << decrypter_->packet_number_;
return false;
}
- quiche::QuicheStringPiece associated_data =
+ absl::string_view associated_data =
QuicFramer::GetAssociatedDataFromEncryptedPacket(
framer_.transport_version(), encrypted,
destination_connection_id_length, source_connection_id_length,
@@ -716,13 +769,11 @@ class QuicFramerTest : public QuicTestWithParam<ParsedQuicVersion> {
retry_token_length, length_length);
if (associated_data != decrypter_->associated_data_) {
QUIC_LOG(ERROR) << "Decrypted incorrect associated data. expected "
- << quiche::QuicheTextUtils::HexEncode(associated_data)
- << " actual: "
- << quiche::QuicheTextUtils::HexEncode(
- decrypter_->associated_data_);
+ << absl::BytesToHexString(associated_data) << " actual: "
+ << absl::BytesToHexString(decrypter_->associated_data_);
return false;
}
- quiche::QuicheStringPiece ciphertext(
+ absl::string_view ciphertext(
encrypted.AsStringPiece().substr(GetStartOfEncryptedData(
framer_.transport_version(), destination_connection_id_length,
source_connection_id_length, includes_version,
@@ -730,12 +781,10 @@ class QuicFramerTest : public QuicTestWithParam<ParsedQuicVersion> {
retry_token_length_length, retry_token_length, length_length)));
if (ciphertext != decrypter_->ciphertext_) {
QUIC_LOG(ERROR) << "Decrypted incorrect ciphertext data. expected "
- << quiche::QuicheTextUtils::HexEncode(ciphertext)
- << " actual: "
- << quiche::QuicheTextUtils::HexEncode(
- decrypter_->ciphertext_)
+ << absl::BytesToHexString(ciphertext) << " actual: "
+ << absl::BytesToHexString(decrypter_->ciphertext_)
<< " associated data: "
- << quiche::QuicheTextUtils::HexEncode(associated_data);
+ << absl::BytesToHexString(associated_data);
return false;
}
return true;
@@ -1002,10 +1051,10 @@ TEST_P(QuicFramerTest, LargePacket) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
const size_t header_size = GetPacketHeaderSize(
@@ -1070,7 +1119,7 @@ TEST_P(QuicFramerTest, PacketHeader) {
QuicVersionLabel version_label;
std::string detailed_error;
bool retry_token_present, use_length_prefix;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
ParsedQuicVersion parsed_version = UnsupportedQuicVersion();
const QuicErrorCode error_code = QuicFramer::ParsePublicHeaderDispatcher(
*encrypted, kQuicDefaultConnectionIdLength, &format, &long_packet_type,
@@ -1135,7 +1184,7 @@ TEST_P(QuicFramerTest, LongPacketHeader) {
QuicVersionLabel version_label;
std::string detailed_error;
bool retry_token_present, use_length_prefix;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
ParsedQuicVersion parsed_version = UnsupportedQuicVersion();
const QuicErrorCode error_code = QuicFramer::ParsePublicHeaderDispatcher(
*encrypted, kQuicDefaultConnectionIdLength, &format, &long_packet_type,
@@ -1201,10 +1250,10 @@ TEST_P(QuicFramerTest, LongPacketHeaderWithBothConnectionIds) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -1215,7 +1264,7 @@ TEST_P(QuicFramerTest, LongPacketHeaderWithBothConnectionIds) {
QuicVersionLabel version_label = 0;
std::string detailed_error = "";
bool retry_token_present, use_length_prefix;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
ParsedQuicVersion parsed_version = UnsupportedQuicVersion();
const QuicErrorCode error_code = QuicFramer::ParsePublicHeaderDispatcher(
encrypted, kQuicDefaultConnectionIdLength, &format, &long_packet_type,
@@ -1286,13 +1335,13 @@ TEST_P(QuicFramerTest, ParsePublicHeader) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_length = QUICHE_ARRAYSIZE(packet46);
+ p_length = ABSL_ARRAYSIZE(packet46);
}
uint8_t first_byte = 0x33;
@@ -1305,7 +1354,7 @@ TEST_P(QuicFramerTest, ParsePublicHeader) {
QuicLongHeaderType long_packet_type = INVALID_PACKET_TYPE;
QuicVariableLengthIntegerLength retry_token_length_length =
VARIABLE_LENGTH_INTEGER_LENGTH_4;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
std::string detailed_error = "foobar";
QuicDataReader reader(AsChars(p), p_length);
@@ -1328,7 +1377,7 @@ TEST_P(QuicFramerTest, ParsePublicHeader) {
EXPECT_EQ(FramerTestConnectionId(), destination_connection_id);
EXPECT_EQ(EmptyQuicConnectionId(), source_connection_id);
EXPECT_EQ(VARIABLE_LENGTH_INTEGER_LENGTH_0, retry_token_length_length);
- EXPECT_EQ(quiche::QuicheStringPiece(), retry_token);
+ EXPECT_EQ(absl::string_view(), retry_token);
if (VersionHasIetfInvariantHeader(framer_.transport_version())) {
EXPECT_EQ(IETF_QUIC_LONG_HEADER_PACKET, format);
EXPECT_EQ(HANDSHAKE, long_packet_type);
@@ -1363,7 +1412,7 @@ TEST_P(QuicFramerTest, ParsePublicHeaderProxBadSourceConnectionIdLength) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
uint8_t first_byte = 0x33;
PacketHeaderFormat format = GOOGLE_QUIC_PACKET;
@@ -1375,7 +1424,7 @@ TEST_P(QuicFramerTest, ParsePublicHeaderProxBadSourceConnectionIdLength) {
QuicLongHeaderType long_packet_type = INVALID_PACKET_TYPE;
QuicVariableLengthIntegerLength retry_token_length_length =
VARIABLE_LENGTH_INTEGER_LENGTH_4;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
std::string detailed_error = "foobar";
QuicDataReader reader(AsChars(p), p_length);
@@ -1395,7 +1444,7 @@ TEST_P(QuicFramerTest, ParsePublicHeaderProxBadSourceConnectionIdLength) {
EXPECT_EQ(FramerTestConnectionId(), destination_connection_id);
EXPECT_EQ(EmptyQuicConnectionId(), source_connection_id);
EXPECT_EQ(VARIABLE_LENGTH_INTEGER_LENGTH_0, retry_token_length_length);
- EXPECT_EQ(quiche::QuicheStringPiece(), retry_token);
+ EXPECT_EQ(absl::string_view(), retry_token);
EXPECT_EQ(IETF_QUIC_LONG_HEADER_PACKET, format);
}
@@ -1420,8 +1469,7 @@ TEST_P(QuicFramerTest, ClientConnectionIdFromShortHeaderToClient) {
0x00,
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsQuicNoError());
EXPECT_EQ("", framer_.detailed_error());
@@ -1455,8 +1503,7 @@ TEST_P(QuicFramerTest, ClientConnectionIdFromShortHeaderToServer) {
0x00,
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsQuicNoError());
EXPECT_EQ("", framer_.detailed_error());
@@ -1944,13 +1991,13 @@ TEST_P(QuicFramerTest, PacketWithDiversificationNonce) {
}
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_size = QUICHE_ARRAYSIZE(packet49);
+ p_size = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
@@ -2019,13 +2066,13 @@ TEST_P(QuicFramerTest, LargePublicFlagWithMismatchedVersions) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_size = QUICHE_ARRAYSIZE(packet49);
+ p_size = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -2122,13 +2169,13 @@ TEST_P(QuicFramerTest, PaddingFrame) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
@@ -2391,13 +2438,13 @@ TEST_P(QuicFramerTest, MissingDiversificationNonce) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_length = QUICHE_ARRAYSIZE(packet46);
+ p_length = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
@@ -2974,8 +3021,8 @@ TEST_P(QuicFramerTest, RejectPacket) {
}
QuicEncryptedPacket encrypted(AsChars(p),
framer_.version().HasIetfInvariantHeader()
- ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet),
+ ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet),
false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -3013,8 +3060,8 @@ TEST_P(QuicFramerTest, RejectPublicHeader) {
QuicEncryptedPacket encrypted(
framer_.version().HasIetfInvariantHeader() ? AsChars(packet46)
: AsChars(packet),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet),
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet),
false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -4029,10 +4076,10 @@ TEST_P(QuicFramerTest, AckFrameTimeStampDeltaTooHigh) {
}
QuicEncryptedPacket encrypted(
AsChars(framer_.version().HasIetfInvariantHeader() ? packet46 : packet),
- QUICHE_ARRAYSIZE(packet), false);
+ ABSL_ARRAYSIZE(packet), false);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
- EXPECT_TRUE(quiche::QuicheTextUtils::StartsWith(
- framer_.detailed_error(), "delta_from_largest_observed too high"));
+ EXPECT_TRUE(absl::StartsWith(framer_.detailed_error(),
+ "delta_from_largest_observed too high"));
}
TEST_P(QuicFramerTest, AckFrameTimeStampSecondDeltaTooHigh) {
@@ -4102,10 +4149,10 @@ TEST_P(QuicFramerTest, AckFrameTimeStampSecondDeltaTooHigh) {
}
QuicEncryptedPacket encrypted(
AsChars(framer_.version().HasIetfInvariantHeader() ? packet46 : packet),
- QUICHE_ARRAYSIZE(packet), false);
+ ABSL_ARRAYSIZE(packet), false);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
- EXPECT_TRUE(quiche::QuicheTextUtils::StartsWith(
- framer_.detailed_error(), "delta_from_largest_observed too high"));
+ EXPECT_TRUE(absl::StartsWith(framer_.detailed_error(),
+ "delta_from_largest_observed too high"));
}
TEST_P(QuicFramerTest, NewStopWaitingFrame) {
@@ -4211,8 +4258,8 @@ TEST_P(QuicFramerTest, InvalidNewStopWaitingFrame) {
QuicEncryptedPacket encrypted(
AsChars(framer_.version().HasIetfInvariantHeader() ? packet46 : packet),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet),
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet),
false);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsError(QUIC_INVALID_STOP_WAITING_DATA));
@@ -5313,10 +5360,10 @@ TEST_P(QuicFramerTest, PingFrame) {
: (framer_.version().HasIetfInvariantHeader() ? packet46
: packet)),
VersionHasIetfQuicFrames(framer_.transport_version())
- ? QUICHE_ARRAYSIZE(packet99)
+ ? ABSL_ARRAYSIZE(packet99)
: (framer_.version().HasIetfInvariantHeader()
- ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet)),
+ ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet)),
false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -5351,8 +5398,7 @@ TEST_P(QuicFramerTest, HandshakeDoneFrame) {
return;
}
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsQuicNoError());
@@ -5392,8 +5438,7 @@ TEST_P(QuicFramerTest, ParseAckFrequencyFrame) {
return;
}
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsQuicNoError());
@@ -5635,8 +5680,7 @@ TEST_P(QuicFramerTest, PublicResetPacketWithTrailingJunk) {
return;
}
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
ASSERT_THAT(framer_.error(), IsError(QUIC_INVALID_PUBLIC_RST_PACKET));
EXPECT_EQ("Unable to read reset message.", framer_.detailed_error());
@@ -5737,8 +5781,7 @@ TEST_P(QuicFramerTest, IetfStatelessResetPacket) {
ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_), false);
}
// This packet cannot be decrypted because diversification nonce is missing.
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
ASSERT_THAT(framer_.error(), IsQuicNoError());
ASSERT_TRUE(visitor_.stateless_reset_packet_.get());
@@ -5781,8 +5824,7 @@ TEST_P(QuicFramerTest, IetfStatelessResetPacketInvalidStatelessResetToken) {
ENCRYPTION_ZERO_RTT, std::unique_ptr<QuicDecrypter>(decrypter_), false);
}
// This packet cannot be decrypted because diversification nonce is missing.
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsError(QUIC_DECRYPTION_FAILURE));
ASSERT_FALSE(visitor_.stateless_reset_packet_);
@@ -5902,10 +5944,10 @@ TEST_P(QuicFramerTest, VersionNegotiationPacketServer) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLengthPrefixedConnectionIds()) {
p = packet2;
- p_length = QUICHE_ARRAYSIZE(packet2);
+ p_length = ABSL_ARRAYSIZE(packet2);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -6018,13 +6060,13 @@ TEST_P(QuicFramerTest, ParseIetfRetryPacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasRetryIntegrityTag()) {
p = packet_with_tag;
- p_length = QUICHE_ARRAYSIZE(packet_with_tag);
+ p_length = ABSL_ARRAYSIZE(packet_with_tag);
} else if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -6046,7 +6088,7 @@ TEST_P(QuicFramerTest, ParseIetfRetryPacket) {
"retry integrity tag", visitor_.retry_token_integrity_tag_->data(),
visitor_.retry_token_integrity_tag_->length(),
reinterpret_cast<const char*>(expected_integrity_tag),
- QUICHE_ARRAYSIZE(expected_integrity_tag));
+ ABSL_ARRAYSIZE(expected_integrity_tag));
ASSERT_TRUE(visitor_.retry_without_tag_.get());
quiche::test::CompareCharArraysWithHexError(
"retry without tag", visitor_.retry_without_tag_->data(),
@@ -6155,8 +6197,8 @@ TEST_P(QuicFramerTest, BuildPaddingFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet));
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildStreamFramePacketWithNewPaddingFrame) {
@@ -6167,7 +6209,7 @@ TEST_P(QuicFramerTest, BuildStreamFramePacketWithNewPaddingFrame) {
header.version_flag = false;
header.packet_number = kPacketNumber;
QuicStreamFrame stream_frame(kStreamId, true, kStreamOffset,
- quiche::QuicheStringPiece("hello world!"));
+ absl::string_view("hello world!"));
QuicPaddingFrame padding_frame(2);
QuicFrames frames = {QuicFrame(padding_frame), QuicFrame(stream_frame),
QuicFrame(padding_frame)};
@@ -6259,13 +6301,13 @@ TEST_P(QuicFramerTest, BuildStreamFramePacketWithNewPaddingFrame) {
ASSERT_TRUE(data != nullptr);
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
@@ -6344,8 +6386,8 @@ TEST_P(QuicFramerTest, Build4ByteSequenceNumberPaddingFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet));
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, Build2ByteSequenceNumberPaddingFramePacket) {
@@ -6419,8 +6461,8 @@ TEST_P(QuicFramerTest, Build2ByteSequenceNumberPaddingFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet));
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, Build1ByteSequenceNumberPaddingFramePacket) {
@@ -6494,8 +6536,8 @@ TEST_P(QuicFramerTest, Build1ByteSequenceNumberPaddingFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet));
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildStreamFramePacket) {
@@ -6510,7 +6552,7 @@ TEST_P(QuicFramerTest, BuildStreamFramePacket) {
}
QuicStreamFrame stream_frame(kStreamId, true, kStreamOffset,
- quiche::QuicheStringPiece("hello world!"));
+ absl::string_view("hello world!"));
QuicFrames frames = {QuicFrame(stream_frame)};
@@ -6583,13 +6625,13 @@ TEST_P(QuicFramerTest, BuildStreamFramePacket) {
ASSERT_TRUE(data != nullptr);
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p), p_size);
@@ -6609,7 +6651,7 @@ TEST_P(QuicFramerTest, BuildStreamFramePacketWithVersionFlag) {
}
QuicStreamFrame stream_frame(kStreamId, true, kStreamOffset,
- quiche::QuicheStringPiece("hello world!"));
+ absl::string_view("hello world!"));
QuicFrames frames = {QuicFrame(stream_frame)};
// clang-format off
@@ -6713,16 +6755,16 @@ TEST_P(QuicFramerTest, BuildStreamFramePacketWithVersionFlag) {
ASSERT_TRUE(data != nullptr);
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_size = QUICHE_ARRAYSIZE(packet49);
+ p_size = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p), p_size);
@@ -6742,7 +6784,7 @@ TEST_P(QuicFramerTest, BuildCryptoFramePacket) {
SimpleDataProducer data_producer;
framer_.set_data_producer(&data_producer);
- quiche::QuicheStringPiece crypto_frame_contents("hello world!");
+ absl::string_view crypto_frame_contents("hello world!");
QuicCryptoFrame crypto_frame(ENCRYPTION_INITIAL, kStreamOffset,
crypto_frame_contents.length());
data_producer.SaveCryptoData(ENCRYPTION_INITIAL, kStreamOffset,
@@ -6795,10 +6837,10 @@ TEST_P(QuicFramerTest, BuildCryptoFramePacket) {
// clang-format on
unsigned char* packet = packet48;
- size_t packet_size = QUICHE_ARRAYSIZE(packet48);
+ size_t packet_size = ABSL_ARRAYSIZE(packet48);
if (framer_.version().HasIetfQuicFrames()) {
packet = packet99;
- packet_size = QUICHE_ARRAYSIZE(packet99);
+ packet_size = ABSL_ARRAYSIZE(packet99);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -6934,13 +6976,13 @@ TEST_P(QuicFramerTest, BuildVersionNegotiationPacket) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_size = QUICHE_ARRAYSIZE(packet49);
+ p_size = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicConnectionId connection_id = FramerTestConnectionId();
@@ -6987,7 +7029,7 @@ TEST_P(QuicFramerTest, BuildVersionNegotiationPacketWithClientConnectionId) {
SupportedVersions(GetParam())));
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildAckFramePacketOneAckBlock) {
@@ -7068,13 +7110,13 @@ TEST_P(QuicFramerTest, BuildAckFramePacketOneAckBlock) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -7161,13 +7203,13 @@ TEST_P(QuicFramerTest, BuildAckFramePacketOneAckBlockMaxLength) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -7309,13 +7351,13 @@ TEST_P(QuicFramerTest, BuildAckFramePacketMultipleAckBlocks) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -7618,13 +7660,13 @@ TEST_P(QuicFramerTest, BuildAckFramePacketMaxAckBlocks) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -7672,7 +7714,7 @@ TEST_P(QuicFramerTest, BuildNewStopWaitingPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildRstFramePacketQuic) {
@@ -7756,13 +7798,13 @@ TEST_P(QuicFramerTest, BuildRstFramePacketQuic) {
ASSERT_TRUE(data != nullptr);
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
@@ -7850,13 +7892,13 @@ TEST_P(QuicFramerTest, BuildCloseFramePacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -7956,13 +7998,13 @@ TEST_P(QuicFramerTest, BuildCloseFramePacketExtendedInfo) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -8137,13 +8179,13 @@ TEST_P(QuicFramerTest, BuildTruncatedCloseFramePacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -8201,7 +8243,7 @@ TEST_P(QuicFramerTest, BuildApplicationCloseFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BuildTruncatedApplicationCloseFramePacket) {
@@ -8282,7 +8324,7 @@ TEST_P(QuicFramerTest, BuildTruncatedApplicationCloseFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BuildGoAwayPacket) {
@@ -8354,10 +8396,10 @@ TEST_P(QuicFramerTest, BuildGoAwayPacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -8491,10 +8533,10 @@ TEST_P(QuicFramerTest, BuildTruncatedGoAwayPacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
@@ -8575,13 +8617,13 @@ TEST_P(QuicFramerTest, BuildWindowUpdatePacket) {
ASSERT_TRUE(data != nullptr);
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
quiche::test::CompareCharArraysWithHexError(
@@ -8630,7 +8672,7 @@ TEST_P(QuicFramerTest, BuildMaxStreamDataPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BuildMaxDataPacket) {
@@ -8674,7 +8716,7 @@ TEST_P(QuicFramerTest, BuildMaxDataPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BuildBlockedPacket) {
@@ -8747,13 +8789,13 @@ TEST_P(QuicFramerTest, BuildBlockedPacket) {
ASSERT_TRUE(data != nullptr);
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
quiche::test::CompareCharArraysWithHexError(
@@ -8820,8 +8862,8 @@ TEST_P(QuicFramerTest, BuildPingPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet));
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildHandshakeDonePacket) {
@@ -8855,7 +8897,7 @@ TEST_P(QuicFramerTest, BuildHandshakeDonePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildAckFrequencyPacket) {
@@ -8902,7 +8944,7 @@ TEST_P(QuicFramerTest, BuildAckFrequencyPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildMessagePacket) {
@@ -8973,7 +9015,7 @@ TEST_P(QuicFramerTest, BuildMessagePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p),
- QUICHE_ARRAYSIZE(packet46));
+ ABSL_ARRAYSIZE(packet46));
}
// Test that the MTU discovery packet is serialized correctly as a PING packet.
@@ -9037,8 +9079,8 @@ TEST_P(QuicFramerTest, BuildMtuDiscoveryPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(p),
- framer_.version().HasIetfInvariantHeader() ? QUICHE_ARRAYSIZE(packet46)
- : QUICHE_ARRAYSIZE(packet));
+ framer_.version().HasIetfInvariantHeader() ? ABSL_ARRAYSIZE(packet46)
+ : ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildPublicResetPacket) {
@@ -9075,7 +9117,7 @@ TEST_P(QuicFramerTest, BuildPublicResetPacket) {
ASSERT_TRUE(data != nullptr);
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildPublicResetPacketWithClientAddress) {
@@ -9124,7 +9166,7 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketWithClientAddress) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, BuildPublicResetPacketWithEndpointId) {
@@ -9198,11 +9240,11 @@ TEST_P(QuicFramerTest, BuildPublicResetPacketWithEndpointId) {
if ('d' == data->data()[data->length() - 1]) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(),
- AsChars(packet_variant1), QUICHE_ARRAYSIZE(packet_variant1));
+ AsChars(packet_variant1), ABSL_ARRAYSIZE(packet_variant1));
} else {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(),
- AsChars(packet_variant2), QUICHE_ARRAYSIZE(packet_variant2));
+ AsChars(packet_variant2), ABSL_ARRAYSIZE(packet_variant2));
}
}
@@ -9234,7 +9276,7 @@ TEST_P(QuicFramerTest, BuildIetfStatelessResetPacket) {
"constructed packet",
data->data() + data->length() - sizeof(kTestStatelessResetToken),
sizeof(kTestStatelessResetToken),
- AsChars(packet) + QUICHE_ARRAYSIZE(packet) -
+ AsChars(packet) + ABSL_ARRAYSIZE(packet) -
sizeof(kTestStatelessResetToken),
sizeof(kTestStatelessResetToken));
}
@@ -9290,10 +9332,10 @@ TEST_P(QuicFramerTest, EncryptPacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasHeaderProtection()) {
p = packet50;
- p_size = QUICHE_ARRAYSIZE(packet50);
+ p_size = ABSL_ARRAYSIZE(packet50);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
}
@@ -9393,14 +9435,14 @@ TEST_P(QuicFramerTest, EncryptPacketWithVersionFlag) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
// TODO(ianswett): see todo in previous test.
if (framer_.version().HasHeaderProtection()) {
p = packet50;
- p_size = QUICHE_ARRAYSIZE(packet50);
+ p_size = ABSL_ARRAYSIZE(packet50);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<QuicPacket> raw(new QuicPacket(
@@ -9726,13 +9768,13 @@ TEST_P(QuicFramerTest, StopPacketProcessing) {
EXPECT_CALL(visitor, OnDecryptedPacket(_));
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -9917,7 +9959,7 @@ TEST_P(QuicFramerTest, BuildIetfBlockedPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, IetfStreamBlockedFrame) {
@@ -10005,7 +10047,7 @@ TEST_P(QuicFramerTest, BuildIetfStreamBlockedPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BiDiMaxStreamsFrame) {
@@ -10205,7 +10247,7 @@ TEST_P(QuicFramerTest, BiDiMaxStreamsFrameTooBig) {
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet99), QUICHE_ARRAYSIZE(packet99),
+ QuicEncryptedPacket encrypted(AsChars(packet99), ABSL_ARRAYSIZE(packet99),
false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsQuicNoError());
@@ -10242,7 +10284,7 @@ TEST_P(QuicFramerTest, ClientBiDiMaxStreamsFrameTooBig) {
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet99), QUICHE_ARRAYSIZE(packet99),
+ QuicEncryptedPacket encrypted(AsChars(packet99), ABSL_ARRAYSIZE(packet99),
false);
QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -10282,7 +10324,7 @@ TEST_P(QuicFramerTest, ServerUniDiMaxStreamsFrameTooBig) {
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet99), QUICHE_ARRAYSIZE(packet99),
+ QuicEncryptedPacket encrypted(AsChars(packet99), ABSL_ARRAYSIZE(packet99),
false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -10320,7 +10362,7 @@ TEST_P(QuicFramerTest, ClientUniDiMaxStreamsFrameTooBig) {
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet99), QUICHE_ARRAYSIZE(packet99),
+ QuicEncryptedPacket encrypted(AsChars(packet99), ABSL_ARRAYSIZE(packet99),
false);
QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -10358,7 +10400,7 @@ TEST_P(QuicFramerTest, MaxStreamsFrameZeroCount) {
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet99), QUICHE_ARRAYSIZE(packet99),
+ QuicEncryptedPacket encrypted(AsChars(packet99), ABSL_ARRAYSIZE(packet99),
false);
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
}
@@ -10563,7 +10605,7 @@ TEST_P(QuicFramerTest, StreamsBlockedFrameTooBig) {
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet99), QUICHE_ARRAYSIZE(packet99),
+ QuicEncryptedPacket encrypted(AsChars(packet99), ABSL_ARRAYSIZE(packet99),
false);
QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
@@ -10658,7 +10700,7 @@ TEST_P(QuicFramerTest, BuildBiDiStreamsBlockedPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BuildUniStreamsBlockedPacket) {
@@ -10700,7 +10742,7 @@ TEST_P(QuicFramerTest, BuildUniStreamsBlockedPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BuildBiDiMaxStreamsPacket) {
@@ -10742,7 +10784,7 @@ TEST_P(QuicFramerTest, BuildBiDiMaxStreamsPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, BuildUniDiMaxStreamsPacket) {
@@ -10787,7 +10829,7 @@ TEST_P(QuicFramerTest, BuildUniDiMaxStreamsPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, NewConnectionIdFrame) {
@@ -11056,7 +11098,7 @@ TEST_P(QuicFramerTest, BuildNewConnectionIdFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, NewTokenFrame) {
@@ -11150,7 +11192,7 @@ TEST_P(QuicFramerTest, BuildNewTokenFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet),
- QUICHE_ARRAYSIZE(packet));
+ ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicFramerTest, IetfStopSendingFrame) {
@@ -11247,7 +11289,7 @@ TEST_P(QuicFramerTest, BuildIetfStopSendingPacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, IetfPathChallengeFrame) {
@@ -11330,7 +11372,7 @@ TEST_P(QuicFramerTest, BuildIetfPathChallengePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, IetfPathResponseFrame) {
@@ -11413,7 +11455,7 @@ TEST_P(QuicFramerTest, BuildIetfPathResponsePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, GetRetransmittableControlFrameSize) {
@@ -12218,7 +12260,7 @@ TEST_P(QuicFramerTest, BuildRetireConnectionIdFramePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data->data(), data->length(), AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99));
+ ABSL_ARRAYSIZE(packet99));
}
TEST_P(QuicFramerTest, AckFrameWithInvalidLargestObserved) {
@@ -12286,10 +12328,10 @@ TEST_P(QuicFramerTest, AckFrameWithInvalidLargestObserved) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
}
@@ -12364,13 +12406,13 @@ TEST_P(QuicFramerTest, FirstAckBlockJustUnderFlow) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
@@ -12472,13 +12514,13 @@ TEST_P(QuicFramerTest, ThirdAckBlockJustUnderflow) {
// clang-format on
unsigned char* p = packet;
- size_t p_size = QUICHE_ARRAYSIZE(packet);
+ size_t p_size = ABSL_ARRAYSIZE(packet);
if (VersionHasIetfQuicFrames(framer_.transport_version())) {
p = packet99;
- p_size = QUICHE_ARRAYSIZE(packet99);
+ p_size = ABSL_ARRAYSIZE(packet99);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_size = QUICHE_ARRAYSIZE(packet46);
+ p_size = ABSL_ARRAYSIZE(packet46);
}
QuicEncryptedPacket encrypted(AsChars(p), p_size, false);
@@ -12619,10 +12661,10 @@ TEST_P(QuicFramerTest, CoalescedPacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfQuicFrames()) {
p = packet99;
- p_length = QUICHE_ARRAYSIZE(packet99);
+ p_length = ABSL_ARRAYSIZE(packet99);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -12738,10 +12780,10 @@ TEST_P(QuicFramerTest, CoalescedPacketWithUdpPadding) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfQuicFrames()) {
p = packet99;
- p_length = QUICHE_ARRAYSIZE(packet99);
+ p_length = ABSL_ARRAYSIZE(packet99);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -12889,10 +12931,10 @@ TEST_P(QuicFramerTest, CoalescedPacketWithDifferentVersion) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfQuicFrames()) {
p = packet99;
- p_length = QUICHE_ARRAYSIZE(packet99);
+ p_length = ABSL_ARRAYSIZE(packet99);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -12996,13 +13038,13 @@ TEST_P(QuicFramerTest, UndecryptablePacketWithoutDecrypter) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_length = QUICHE_ARRAYSIZE(packet46);
+ p_length = ABSL_ARRAYSIZE(packet46);
}
// First attempt decryption without the handshake crypter.
EXPECT_FALSE(
@@ -13098,13 +13140,13 @@ TEST_P(QuicFramerTest, UndecryptablePacketWithDecrypter) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
} else if (framer_.version().HasIetfInvariantHeader()) {
p = packet46;
- p_length = QUICHE_ARRAYSIZE(packet46);
+ p_length = ABSL_ARRAYSIZE(packet46);
}
EXPECT_FALSE(
@@ -13262,10 +13304,10 @@ TEST_P(QuicFramerTest, UndecryptableCoalescedPacket) {
const size_t length_of_first_coalesced_packet = 46;
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfQuicFrames()) {
p = packet99;
- p_length = QUICHE_ARRAYSIZE(packet99);
+ p_length = ABSL_ARRAYSIZE(packet99);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -13429,10 +13471,10 @@ TEST_P(QuicFramerTest, MismatchedCoalescedPacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfQuicFrames()) {
p = packet99;
- p_length = QUICHE_ARRAYSIZE(packet99);
+ p_length = ABSL_ARRAYSIZE(packet99);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -13534,10 +13576,10 @@ TEST_P(QuicFramerTest, InvalidCoalescedPacket) {
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasIetfQuicFrames()) {
p = packet99;
- p_length = QUICHE_ARRAYSIZE(packet99);
+ p_length = ABSL_ARRAYSIZE(packet99);
}
QuicEncryptedPacket encrypted(AsChars(p), p_length, false);
@@ -13596,7 +13638,7 @@ TEST_P(QuicFramerTest, CoalescedPacketWithZeroesRoundTrip) {
unsigned char packet[kMaxOutgoingPacketSize] = {};
size_t encrypted_length =
framer_.EncryptPayload(ENCRYPTION_INITIAL, header.packet_number, *data,
- AsChars(packet), QUICHE_ARRAYSIZE(packet));
+ AsChars(packet), ABSL_ARRAYSIZE(packet));
ASSERT_NE(0u, encrypted_length);
QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
@@ -13608,8 +13650,7 @@ TEST_P(QuicFramerTest, CoalescedPacketWithZeroesRoundTrip) {
std::move(server_crypters.decrypter));
// Make sure the first long header initial packet parses correctly.
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
// Make sure we discard the subsequent zeroes.
EXPECT_TRUE(framer_.ProcessPacket(encrypted));
@@ -13639,8 +13680,7 @@ TEST_P(QuicFramerTest, ClientReceivesInvalidVersion) {
};
// clang-format on
- QuicEncryptedPacket encrypted(AsChars(packet), QUICHE_ARRAYSIZE(packet),
- false);
+ QuicEncryptedPacket encrypted(AsChars(packet), ABSL_ARRAYSIZE(packet), false);
EXPECT_FALSE(framer_.ProcessPacket(encrypted));
EXPECT_THAT(framer_.error(), IsError(QUIC_INVALID_VERSION));
@@ -13763,11 +13803,11 @@ TEST_P(QuicFramerTest, MultiplePacketNumberSpaces) {
if (!QuicVersionHasLongHeaderLengths(framer_.transport_version())) {
EXPECT_TRUE(framer_.ProcessPacket(
QuicEncryptedPacket(AsChars(long_header_packet),
- QUICHE_ARRAYSIZE(long_header_packet), false)));
+ ABSL_ARRAYSIZE(long_header_packet), false)));
} else {
EXPECT_TRUE(framer_.ProcessPacket(
QuicEncryptedPacket(AsChars(long_header_packet99),
- QUICHE_ARRAYSIZE(long_header_packet99), false)));
+ ABSL_ARRAYSIZE(long_header_packet99), false)));
}
EXPECT_THAT(framer_.error(), IsQuicNoError());
@@ -13794,8 +13834,7 @@ TEST_P(QuicFramerTest, MultiplePacketNumberSpaces) {
// clang-format on
QuicEncryptedPacket short_header_encrypted(
- AsChars(short_header_packet), QUICHE_ARRAYSIZE(short_header_packet),
- false);
+ AsChars(short_header_packet), ABSL_ARRAYSIZE(short_header_packet), false);
if (framer_.version().KnowsWhichDecrypterToUse()) {
framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
std::make_unique<TestDecrypter>());
@@ -13952,106 +13991,7 @@ TEST_P(QuicFramerTest, ProcessMismatchedHeaderVersion) {
CheckFramingBoundaries(packet, QUIC_INVALID_PACKET_HEADER);
}
-TEST_P(QuicFramerTest, WriteClientVersionNegotiationProbePacketOld) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, false);
- // clang-format off
- static const char expected_packet[1200] = {
- // IETF long header with fixed bit set, type initial, all-0 encrypted bits.
- 0xc0,
- // Version, part of the IETF space reserved for negotiation.
- 0xca, 0xba, 0xda, 0xba,
- // Destination connection ID length 8, source connection ID length 0.
- 0x50,
- // 8-byte destination connection ID.
- 0x56, 0x4e, 0x20, 0x70, 0x6c, 0x7a, 0x20, 0x21,
- // 8 bytes of zeroes followed by 8 bytes of ones to ensure that this does
- // not parse with any known version.
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- // 2 bytes of zeroes to pad to 16 byte boundary.
- 0x00, 0x00,
- // A polite greeting in case a human sees this in tcpdump.
- 0x54, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x63,
- 0x6b, 0x65, 0x74, 0x20, 0x6f, 0x6e, 0x6c, 0x79,
- 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x20,
- 0x74, 0x6f, 0x20, 0x74, 0x72, 0x69, 0x67, 0x67,
- 0x65, 0x72, 0x20, 0x49, 0x45, 0x54, 0x46, 0x20,
- 0x51, 0x55, 0x49, 0x43, 0x20, 0x76, 0x65, 0x72,
- 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x65, 0x67,
- 0x6f, 0x74, 0x69, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x2e, 0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x64,
- 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20,
- 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20,
- 0x4e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x61, 0x63, 0x6b,
- 0x65, 0x74, 0x20, 0x69, 0x6e, 0x64, 0x69, 0x63,
- 0x61, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x68,
- 0x61, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69,
- 0x6f, 0x6e, 0x73, 0x20, 0x79, 0x6f, 0x75, 0x20,
- 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x2e,
- 0x20, 0x54, 0x68, 0x61, 0x6e, 0x6b, 0x20, 0x79,
- 0x6f, 0x75, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x68,
- 0x61, 0x76, 0x65, 0x20, 0x61, 0x20, 0x6e, 0x69,
- 0x63, 0x65, 0x20, 0x64, 0x61, 0x79, 0x2e, 0x00,
- };
- // clang-format on
- char packet[1200];
- char destination_connection_id_bytes[] = {0x56, 0x4e, 0x20, 0x70,
- 0x6c, 0x7a, 0x20, 0x21};
- EXPECT_TRUE(QuicFramer::WriteClientVersionNegotiationProbePacket(
- packet, sizeof(packet), destination_connection_id_bytes,
- sizeof(destination_connection_id_bytes)));
- quiche::test::CompareCharArraysWithHexError("constructed packet", packet,
- sizeof(packet), expected_packet,
- sizeof(expected_packet));
- QuicEncryptedPacket encrypted(reinterpret_cast<const char*>(packet),
- sizeof(packet), false);
- // Make sure we fail to parse this packet for the version under test.
- if (!framer_.version().HasIetfInvariantHeader()) {
- // We can only parse the connection ID with an IETF parser.
- EXPECT_FALSE(framer_.ProcessPacket(encrypted));
- return;
- }
- EXPECT_TRUE(framer_.ProcessPacket(encrypted));
- ASSERT_TRUE(visitor_.header_.get());
- QuicConnectionId probe_payload_connection_id(
- reinterpret_cast<const char*>(destination_connection_id_bytes),
- sizeof(destination_connection_id_bytes));
- EXPECT_EQ(probe_payload_connection_id,
- visitor_.header_.get()->destination_connection_id);
-
- PacketHeaderFormat format = GOOGLE_QUIC_PACKET;
- QuicLongHeaderType long_packet_type = INVALID_PACKET_TYPE;
- bool version_present = false, has_length_prefix = false;
- QuicVersionLabel version_label = 0;
- ParsedQuicVersion parsed_version = QuicVersionReservedForNegotiation();
- QuicConnectionId destination_connection_id = TestConnectionId(0x33);
- QuicConnectionId source_connection_id = TestConnectionId(0x34);
- bool retry_token_present = true;
- quiche::QuicheStringPiece retry_token;
- std::string detailed_error = "foobar";
-
- QuicErrorCode parse_result = QuicFramer::ParsePublicHeaderDispatcher(
- encrypted, kQuicDefaultConnectionIdLength, &format, &long_packet_type,
- &version_present, &has_length_prefix, &version_label, &parsed_version,
- &destination_connection_id, &source_connection_id, &retry_token_present,
- &retry_token, &detailed_error);
- EXPECT_THAT(parse_result, IsQuicNoError());
- EXPECT_EQ(IETF_QUIC_LONG_HEADER_PACKET, format);
- EXPECT_TRUE(version_present);
- EXPECT_FALSE(has_length_prefix);
- EXPECT_EQ(0xcabadaba, version_label);
- EXPECT_EQ(QUIC_VERSION_UNSUPPORTED, parsed_version.transport_version);
- EXPECT_EQ(probe_payload_connection_id, destination_connection_id);
- EXPECT_EQ(EmptyQuicConnectionId(), source_connection_id);
- EXPECT_FALSE(retry_token_present);
- EXPECT_EQ(quiche::QuicheStringPiece(), retry_token);
- EXPECT_EQ("", detailed_error);
-}
-
TEST_P(QuicFramerTest, WriteClientVersionNegotiationProbePacket) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, true);
// clang-format off
static const char expected_packet[1200] = {
// IETF long header with fixed bit set, type initial, all-0 encrypted bits.
@@ -14181,7 +14121,7 @@ TEST_P(QuicFramerTest, DispatcherParseOldClientVersionNegotiationProbePacket) {
QuicConnectionId destination_connection_id = TestConnectionId(1);
QuicConnectionId source_connection_id = TestConnectionId(2);
bool retry_token_present = true;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
std::string detailed_error = "foobar";
QuicErrorCode header_parse_result = QuicFramer::ParsePublicHeaderDispatcher(
encrypted, kQuicDefaultConnectionIdLength, &format, &long_packet_type,
@@ -14260,7 +14200,7 @@ TEST_P(QuicFramerTest, DispatcherParseClientVersionNegotiationProbePacket) {
QuicConnectionId destination_connection_id = TestConnectionId(1);
QuicConnectionId source_connection_id = TestConnectionId(2);
bool retry_token_present = true;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
std::string detailed_error = "foobar";
QuicErrorCode header_parse_result = QuicFramer::ParsePublicHeaderDispatcher(
encrypted, kQuicDefaultConnectionIdLength, &format, &long_packet_type,
@@ -14277,8 +14217,7 @@ TEST_P(QuicFramerTest, DispatcherParseClientVersionNegotiationProbePacket) {
EXPECT_EQ("", detailed_error);
}
-TEST_P(QuicFramerTest, ParseServerVersionNegotiationProbeResponseOld) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, false);
+TEST_P(QuicFramerTest, ParseServerVersionNegotiationProbeResponse) {
// clang-format off
const char packet[] = {
// IETF long header with fixed bit set, type initial, all-0 encrypted bits.
@@ -14286,7 +14225,7 @@ TEST_P(QuicFramerTest, ParseServerVersionNegotiationProbeResponseOld) {
// Version of 0, indicating version negotiation.
0x00, 0x00, 0x00, 0x00,
// Destination connection ID length 0, source connection ID length 8.
- 0x05,
+ 0x00, 0x08,
// 8-byte source connection ID.
0x56, 0x4e, 0x20, 0x70, 0x6c, 0x7a, 0x20, 0x21,
// A few supported versions.
@@ -14296,7 +14235,7 @@ TEST_P(QuicFramerTest, ParseServerVersionNegotiationProbeResponseOld) {
// clang-format on
char probe_payload_bytes[] = {0x56, 0x4e, 0x20, 0x70, 0x6c, 0x7a, 0x20, 0x21};
char parsed_probe_payload_bytes[255] = {};
- uint8_t parsed_probe_payload_length = 0;
+ uint8_t parsed_probe_payload_length = sizeof(parsed_probe_payload_bytes);
std::string parse_detailed_error = "";
EXPECT_TRUE(QuicFramer::ParseServerVersionNegotiationProbeResponse(
reinterpret_cast<const char*>(packet), sizeof(packet),
@@ -14308,35 +14247,47 @@ TEST_P(QuicFramerTest, ParseServerVersionNegotiationProbeResponseOld) {
probe_payload_bytes, sizeof(probe_payload_bytes));
}
-TEST_P(QuicFramerTest, ParseServerVersionNegotiationProbeResponse) {
- SetQuicFlag(FLAGS_quic_prober_uses_length_prefixed_connection_ids, true);
- // clang-format off
- const char packet[] = {
- // IETF long header with fixed bit set, type initial, all-0 encrypted bits.
- 0xc0,
- // Version of 0, indicating version negotiation.
- 0x00, 0x00, 0x00, 0x00,
- // Destination connection ID length 0, source connection ID length 8.
- 0x00, 0x08,
- // 8-byte source connection ID.
- 0x56, 0x4e, 0x20, 0x70, 0x6c, 0x7a, 0x20, 0x21,
- // A few supported versions.
- 0xaa, 0xaa, 0xaa, 0xaa,
- QUIC_VERSION_BYTES,
- };
- // clang-format on
- char probe_payload_bytes[] = {0x56, 0x4e, 0x20, 0x70, 0x6c, 0x7a, 0x20, 0x21};
- char parsed_probe_payload_bytes[255] = {};
- uint8_t parsed_probe_payload_length = 0;
- std::string parse_detailed_error = "";
- EXPECT_TRUE(QuicFramer::ParseServerVersionNegotiationProbeResponse(
- reinterpret_cast<const char*>(packet), sizeof(packet),
- reinterpret_cast<char*>(parsed_probe_payload_bytes),
- &parsed_probe_payload_length, &parse_detailed_error));
- EXPECT_EQ("", parse_detailed_error);
+TEST_P(QuicFramerTest, ParseClientVersionNegotiationProbePacket) {
+ char packet[1200];
+ char input_destination_connection_id_bytes[] = {0x56, 0x4e, 0x20, 0x70,
+ 0x6c, 0x7a, 0x20, 0x21};
+ ASSERT_TRUE(QuicFramer::WriteClientVersionNegotiationProbePacket(
+ packet, sizeof(packet), input_destination_connection_id_bytes,
+ sizeof(input_destination_connection_id_bytes)));
+ char parsed_destination_connection_id_bytes[255] = {0};
+ uint8_t parsed_destination_connection_id_length =
+ sizeof(parsed_destination_connection_id_bytes);
+ ASSERT_TRUE(ParseClientVersionNegotiationProbePacket(
+ packet, sizeof(packet), parsed_destination_connection_id_bytes,
+ &parsed_destination_connection_id_length));
quiche::test::CompareCharArraysWithHexError(
- "parsed probe", parsed_probe_payload_bytes, parsed_probe_payload_length,
- probe_payload_bytes, sizeof(probe_payload_bytes));
+ "parsed destination connection ID",
+ parsed_destination_connection_id_bytes,
+ parsed_destination_connection_id_length,
+ input_destination_connection_id_bytes,
+ sizeof(input_destination_connection_id_bytes));
+}
+
+TEST_P(QuicFramerTest, WriteServerVersionNegotiationProbeResponse) {
+ char packet[1200];
+ size_t packet_length = sizeof(packet);
+ char input_source_connection_id_bytes[] = {0x56, 0x4e, 0x20, 0x70,
+ 0x6c, 0x7a, 0x20, 0x21};
+ ASSERT_TRUE(WriteServerVersionNegotiationProbeResponse(
+ packet, &packet_length, input_source_connection_id_bytes,
+ sizeof(input_source_connection_id_bytes)));
+ char parsed_source_connection_id_bytes[255] = {0};
+ uint8_t parsed_source_connection_id_length =
+ sizeof(parsed_source_connection_id_bytes);
+ std::string detailed_error;
+ ASSERT_TRUE(QuicFramer::ParseServerVersionNegotiationProbeResponse(
+ packet, packet_length, parsed_source_connection_id_bytes,
+ &parsed_source_connection_id_length, &detailed_error))
+ << detailed_error;
+ quiche::test::CompareCharArraysWithHexError(
+ "parsed destination connection ID", parsed_source_connection_id_bytes,
+ parsed_source_connection_id_length, input_source_connection_id_bytes,
+ sizeof(input_source_connection_id_bytes));
}
TEST_P(QuicFramerTest, ClientConnectionIdFromLongHeaderToClient) {
@@ -14385,10 +14336,10 @@ TEST_P(QuicFramerTest, ClientConnectionIdFromLongHeaderToClient) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
}
const bool parse_success =
framer_.ProcessPacket(QuicEncryptedPacket(AsChars(p), p_length, false));
@@ -14450,10 +14401,10 @@ TEST_P(QuicFramerTest, ClientConnectionIdFromLongHeaderToServer) {
};
// clang-format on
unsigned char* p = packet;
- size_t p_length = QUICHE_ARRAYSIZE(packet);
+ size_t p_length = ABSL_ARRAYSIZE(packet);
if (framer_.version().HasLongHeaderLengths()) {
p = packet49;
- p_length = QUICHE_ARRAYSIZE(packet49);
+ p_length = ABSL_ARRAYSIZE(packet49);
}
const bool parse_success =
framer_.ProcessPacket(QuicEncryptedPacket(AsChars(p), p_length, false));
@@ -14665,14 +14616,566 @@ TEST_P(QuicFramerTest, OverlyLargeAckDelay) {
};
// clang-format on
- framer_.ProcessPacket(QuicEncryptedPacket(AsChars(packet99),
- QUICHE_ARRAYSIZE(packet99), false));
+ framer_.ProcessPacket(
+ QuicEncryptedPacket(AsChars(packet99), ABSL_ARRAYSIZE(packet99), false));
ASSERT_EQ(1u, visitor_.ack_frames_.size());
// Verify ack_delay_time is set correctly.
EXPECT_EQ(QuicTime::Delta::Infinite(),
visitor_.ack_frames_[0]->ack_delay_time);
}
+TEST_P(QuicFramerTest, KeyUpdate) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+ framer_.SetKeyUpdateSupportForConnection(true);
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted(
+ EncryptPacketWithTagAndPhase(*data, 0, false));
+ ASSERT_TRUE(encrypted);
+
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ // Processed valid packet with phase=0, key=1: no key update.
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(0, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ header.packet_number += 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ // Processed valid packet with phase=1, key=2: key update should have
+ // occurred.
+ ASSERT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(KeyUpdateReason::kRemote, visitor_.key_update_reasons_[0]);
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ header.packet_number += 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ // Processed another valid packet with phase=1, key=2: no key update.
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process another key update.
+ header.packet_number += 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 2, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ ASSERT_EQ(2u, visitor_.key_update_count());
+ EXPECT_EQ(KeyUpdateReason::kRemote, visitor_.key_update_reasons_[1]);
+ EXPECT_EQ(2, visitor_.derive_next_key_count_);
+ EXPECT_EQ(3, visitor_.decrypted_first_packet_in_key_phase_count_);
+}
+
+TEST_P(QuicFramerTest, KeyUpdateOldPacketAfterUpdate) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+ framer_.SetKeyUpdateSupportForConnection(true);
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ // Process packet N with phase 0.
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted(
+ EncryptPacketWithTagAndPhase(*data, 0, false));
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(0, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+2 with phase 1.
+ header.packet_number = kPacketNumber + 2;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+1 with phase 0. (Receiving packet from previous phase
+ // after packet from new phase was received.)
+ header.packet_number = kPacketNumber + 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 0, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should decrypt and key update count should not change.
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+}
+
+TEST_P(QuicFramerTest, KeyUpdateOldPacketAfterDiscardPreviousOneRttKeys) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+ framer_.SetKeyUpdateSupportForConnection(true);
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ // Process packet N with phase 0.
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted(
+ EncryptPacketWithTagAndPhase(*data, 0, false));
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(0, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+2 with phase 1.
+ header.packet_number = kPacketNumber + 2;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Discard keys for previous key phase.
+ framer_.DiscardPreviousOneRttKeys();
+
+ // Process packet N+1 with phase 0. (Receiving packet from previous phase
+ // after packet from new phase was received.)
+ header.packet_number = kPacketNumber + 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 0, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should not decrypt and key update count should not change.
+ EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+}
+
+TEST_P(QuicFramerTest, KeyUpdatePacketsOutOfOrder) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+ framer_.SetKeyUpdateSupportForConnection(true);
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ // Process packet N with phase 0.
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted(
+ EncryptPacketWithTagAndPhase(*data, 0, false));
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(0, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+2 with phase 1.
+ header.packet_number = kPacketNumber + 2;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+1 with phase 1. (Receiving packet from new phase out of
+ // order.)
+ header.packet_number = kPacketNumber + 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should decrypt and key update count should not change.
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(2, visitor_.decrypted_first_packet_in_key_phase_count_);
+}
+
+TEST_P(QuicFramerTest, KeyUpdateWrongKey) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+ framer_.SetKeyUpdateSupportForConnection(true);
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted(
+ EncryptPacketWithTagAndPhase(*data, 0, false));
+ ASSERT_TRUE(encrypted);
+
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ // Processed valid packet with phase=0, key=1: no key update.
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(0, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+ EXPECT_EQ(0u, framer_.PotentialPeerKeyUpdateAttemptCount());
+
+ header.packet_number += 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 2, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet with phase=1 but key=3, should not process and should not cause key
+ // update, but next decrypter key should have been created to attempt to
+ // decode it.
+ EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+ EXPECT_EQ(1u, framer_.PotentialPeerKeyUpdateAttemptCount());
+
+ header.packet_number += 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 0, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet with phase=1 but key=1, should not process and should not cause key
+ // update.
+ EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+ EXPECT_EQ(2u, framer_.PotentialPeerKeyUpdateAttemptCount());
+
+ header.packet_number += 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet with phase=0 but key=2, should not process and should not cause key
+ // update.
+ EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+ EXPECT_EQ(2u, framer_.PotentialPeerKeyUpdateAttemptCount());
+
+ header.packet_number += 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 0, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet with phase=0 and key=0, should process and reset
+ // potential_peer_key_update_attempt_count_.
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+ EXPECT_EQ(0u, framer_.PotentialPeerKeyUpdateAttemptCount());
+}
+
+TEST_P(QuicFramerTest, KeyUpdateReceivedWhenNotEnabled) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted(
+ EncryptPacketWithTagAndPhase(*data, 1, true));
+ ASSERT_TRUE(encrypted);
+
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Received a packet with key phase updated even though framer hasn't had key
+ // update enabled (SetNextOneRttCrypters never called). Should fail to
+ // process.
+ EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(0u, visitor_.key_update_count());
+ EXPECT_EQ(0, visitor_.derive_next_key_count_);
+ EXPECT_EQ(0, visitor_.decrypted_first_packet_in_key_phase_count_);
+}
+
+TEST_P(QuicFramerTest, KeyUpdateLocallyInitiated) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+ framer_.SetKeyUpdateSupportForConnection(true);
+
+ EXPECT_TRUE(framer_.DoKeyUpdate(KeyUpdateReason::kLocalForTests));
+ // Key update count should be updated, but haven't received packet from peer
+ // with new key phase.
+ ASSERT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(KeyUpdateReason::kLocalForTests, visitor_.key_update_reasons_[0]);
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(0, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ // Process packet N with phase 1.
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data(BuildDataPacket(header, frames));
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted(
+ EncryptPacketWithTagAndPhase(*data, 1, true));
+ ASSERT_TRUE(encrypted);
+
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should decrypt and key update count should not change and
+ // OnDecryptedFirstPacketInKeyPhase should have been called.
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N-1 with phase 0. (Receiving packet from previous phase
+ // after packet from new phase was received.)
+ header.packet_number = kPacketNumber - 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 0, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should decrypt and key update count should not change.
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+1 with phase 0 and key 1. This should not decrypt even
+ // though it's using the previous key, since the packet number is higher than
+ // a packet number received using the current key.
+ header.packet_number = kPacketNumber + 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 0, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should not decrypt and key update count should not change.
+ EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(2, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+}
+
+TEST_P(QuicFramerTest, KeyUpdateLocallyInitiatedReceivedOldPacket) {
+ if (!framer_.version().UsesTls()) {
+ // Key update is only used in QUIC+TLS.
+ return;
+ }
+ ASSERT_TRUE(framer_.version().KnowsWhichDecrypterToUse());
+ // Doesn't use SetDecrypterLevel since we want to use StrictTaggingDecrypter
+ // instead of TestDecrypter.
+ framer_.InstallDecrypter(ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<StrictTaggingDecrypter>(/*key=*/0));
+ framer_.SetKeyUpdateSupportForConnection(true);
+
+ EXPECT_TRUE(framer_.DoKeyUpdate(KeyUpdateReason::kLocalForTests));
+ // Key update count should be updated, but haven't received packet
+ // from peer with new key phase.
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(0, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ QuicPacketHeader header;
+ header.destination_connection_id = FramerTestConnectionId();
+ header.reset_flag = false;
+ header.version_flag = false;
+ header.packet_number = kPacketNumber;
+
+ QuicFrames frames = {QuicFrame(QuicPaddingFrame())};
+
+ // Process packet N with phase 0. (Receiving packet from previous phase
+ // after locally initiated key update, but before any packet from new phase
+ // was received.)
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ std::unique_ptr<QuicPacket> data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ std::unique_ptr<QuicEncryptedPacket> encrypted =
+ EncryptPacketWithTagAndPhase(*data, 0, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should decrypt and key update count should not change and
+ // OnDecryptedFirstPacketInKeyPhase should not have been called since the
+ // packet was from the previous key phase.
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(0, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+1 with phase 1.
+ header.packet_number = kPacketNumber + 1;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 1, true);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should decrypt and key update count should not change, but
+ // OnDecryptedFirstPacketInKeyPhase should have been called.
+ EXPECT_TRUE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(1, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+
+ // Process packet N+2 with phase 0 and key 1. This should not decrypt even
+ // though it's using the previous key, since the packet number is higher than
+ // a packet number received using the current key.
+ header.packet_number = kPacketNumber + 2;
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_CLIENT);
+ data = BuildDataPacket(header, frames);
+ ASSERT_TRUE(data != nullptr);
+ encrypted = EncryptPacketWithTagAndPhase(*data, 0, false);
+ ASSERT_TRUE(encrypted);
+ QuicFramerPeer::SetPerspective(&framer_, Perspective::IS_SERVER);
+ // Packet should not decrypt and key update count should not change.
+ EXPECT_FALSE(framer_.ProcessPacket(*encrypted));
+ EXPECT_EQ(1u, visitor_.key_update_count());
+ EXPECT_EQ(2, visitor_.derive_next_key_count_);
+ EXPECT_EQ(1, visitor_.decrypted_first_packet_in_key_phase_count_);
+}
+
} // namespace
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque.h b/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque.h
index 0ac98278019..d469a083d9c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque.h
@@ -7,13 +7,13 @@
#include <algorithm>
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_interval.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
namespace quic {
@@ -260,7 +260,7 @@ class QUIC_NO_EXPORT QuicIntervalDeque {
friend class test::QuicIntervalDequePeer;
C container_;
- quiche::QuicheOptional<std::size_t> cached_index_;
+ absl::optional<std::size_t> cached_index_;
};
template <class T, class C>
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque_test.cc
index f7a84414434..2539f1d1b65 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_interval_deque_test.cc
@@ -32,7 +32,7 @@ struct TestIntervalItem {
: val(val), interval_start(interval_start), interval_end(interval_end) {}
};
-typedef QuicIntervalDeque<TestIntervalItem> QID;
+using QID = QuicIntervalDeque<TestIntervalItem>;
class QuicIntervalDequeTest : public QuicTest {
public:
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_interval_set.h b/chromium/net/third_party/quiche/src/quic/core/quic_interval_set.h
index 28153c19088..7ab06475792 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_interval_set.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_interval_set.h
@@ -67,18 +67,18 @@ namespace quic {
template <typename T>
class QUIC_NO_EXPORT QuicIntervalSet {
public:
- typedef QuicInterval<T> value_type;
+ using value_type = QuicInterval<T>;
private:
struct QUIC_NO_EXPORT IntervalLess {
bool operator()(const value_type& a, const value_type& b) const;
};
// TODO(wub): Switch to absl::btree_set when it is available in Chromium.
- typedef std::set<value_type, IntervalLess> Set;
+ using Set = std::set<value_type, IntervalLess>;
public:
- typedef typename Set::const_iterator const_iterator;
- typedef typename Set::const_reverse_iterator const_reverse_iterator;
+ using const_iterator = typename Set::const_iterator;
+ using const_reverse_iterator = typename Set::const_reverse_iterator;
// Instantiates an empty QuicIntervalSet.
QuicIntervalSet() {}
@@ -350,9 +350,6 @@ class QUIC_NO_EXPORT QuicIntervalSet {
return *this;
}
- // Swap this QuicIntervalSet with *other. This is a constant-time operation.
- void Swap(QuicIntervalSet<T>* other) { intervals_.swap(other->intervals_); }
-
friend bool operator==(const QuicIntervalSet& a, const QuicIntervalSet& b) {
return a.Size() == b.Size() &&
std::equal(a.begin(), a.end(), b.begin(), NonemptyIntervalEq());
@@ -438,9 +435,6 @@ auto operator<<(std::ostream& out, const QuicIntervalSet<T>& seq)
return out;
}
-template <typename T>
-void swap(QuicIntervalSet<T>& x, QuicIntervalSet<T>& y);
-
//==============================================================================
// Implementation details: Clients can stop reading here.
@@ -918,11 +912,6 @@ bool QuicIntervalSet<T>::Valid() const {
return true;
}
-template <typename T>
-void swap(QuicIntervalSet<T>& x, QuicIntervalSet<T>& y) {
- x.Swap(&y);
-}
-
// This comparator orders intervals first by ascending min() and then by
// descending max(). Readers who are satisified with that explanation can stop
// reading here. The remainder of this comment is for the benefit of future
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_interval_set_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_interval_set_test.cc
index efa8fe7e960..30d08b8bc1e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_interval_set_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_interval_set_test.cc
@@ -971,10 +971,10 @@ TEST_F(QuicIntervalSetTest, Swap) {
a.Add(300, 400);
b.Add(100, 200);
b.Add(500, 600);
- a.Swap(&b);
+ std::swap(a, b);
EXPECT_TRUE(Check(a, 2, 100, 200, 500, 600));
EXPECT_TRUE(Check(b, 1, 300, 400));
- swap(a, b);
+ std::swap(a, b);
EXPECT_TRUE(Check(a, 1, 300, 400));
EXPECT_TRUE(Check(b, 2, 100, 200, 500, 600));
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.cc b/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.cc
index 4afd34201c8..8e9317271dc 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.cc
@@ -19,7 +19,7 @@ QuicLegacyVersionEncapsulator::~QuicLegacyVersionEncapsulator() {}
// static
QuicByteCount QuicLegacyVersionEncapsulator::GetMinimumOverhead(
- quiche::QuicheStringPiece sni) {
+ absl::string_view sni) {
// The number 52 is the sum of:
// - Flags (1 byte)
// - Server Connection ID (8 bytes)
@@ -85,8 +85,8 @@ SerializedPacketFate QuicLegacyVersionEncapsulator::GetSerializedPacketFate(
// static
QuicPacketLength QuicLegacyVersionEncapsulator::Encapsulate(
- quiche::QuicheStringPiece sni,
- quiche::QuicheStringPiece inner_packet,
+ absl::string_view sni,
+ absl::string_view inner_packet,
const QuicConnectionId& server_connection_id,
QuicTime creation_time,
QuicByteCount outer_max_packet_length,
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.h b/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.h
index 413829b4be0..7a4ada68b9f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.h
@@ -5,11 +5,11 @@
#ifndef QUICHE_QUIC_CORE_QUIC_LEGACY_VERSION_ENCAPSULATOR_H_
#define QUICHE_QUIC_CORE_QUIC_LEGACY_VERSION_ENCAPSULATOR_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_packet_creator.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -27,8 +27,8 @@ class QUIC_EXPORT_PRIVATE QuicLegacyVersionEncapsulator
// the contents of the encapsulated packet to |out|. |out| must point to a
// valid memory buffer capable of holding kMaxOutgoingPacketSize bytes.
static QuicPacketLength Encapsulate(
- quiche::QuicheStringPiece sni,
- quiche::QuicheStringPiece inner_packet,
+ absl::string_view sni,
+ absl::string_view inner_packet,
const QuicConnectionId& server_connection_id,
QuicTime creation_time,
QuicByteCount outer_max_packet_length,
@@ -37,7 +37,7 @@ class QUIC_EXPORT_PRIVATE QuicLegacyVersionEncapsulator
// Returns the number of bytes of minimum overhead caused by Legacy Version
// Encapsulation, based on the length of the provided server name |sni|.
// The overhead may be higher due to extra padding added.
- static QuicByteCount GetMinimumOverhead(quiche::QuicheStringPiece sni);
+ static QuicByteCount GetMinimumOverhead(absl::string_view sni);
// Overrides for QuicPacketCreator::DelegateInterface.
QuicPacketBuffer GetPacketBuffer() override;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator_test.cc
index a71b2f44eb5..d765fff3ba6 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator_test.cc
@@ -4,11 +4,11 @@
#include "net/third_party/quiche/src/quic/core/quic_legacy_version_encapsulator.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -43,7 +43,7 @@ class QuicLegacyVersionEncapsulatorTest
ParsedQuicVersion parsed_version = ParsedQuicVersion::Unsupported();
QuicConnectionId destination_connection_id, source_connection_id;
bool retry_token_present;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
std::string detailed_error;
const QuicErrorCode error = QuicFramer::ParsePublicHeaderDispatcher(
QuicEncryptedPacket(outer_buffer_, encapsulated_length_),
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_linux_socket_utils.h b/chromium/net/third_party/quiche/src/quic/core/quic_linux_socket_utils.h
index 40916579fad..fe186dfe872 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_linux_socket_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_linux_socket_utils.h
@@ -161,9 +161,8 @@ struct QUIC_EXPORT_PRIVATE BufferedWrite {
// QuicSocketUtils::WriteMultiplePackets(fd, &mhdr, &num_packets_sent);
class QUIC_EXPORT_PRIVATE QuicMMsgHdr {
public:
- typedef std::function<
- void(QuicMMsgHdr* mhdr, int i, const BufferedWrite& buffered_write)>
- ControlBufferInitializer;
+ using ControlBufferInitializer = std::function<
+ void(QuicMMsgHdr* mhdr, int i, const BufferedWrite& buffered_write)>;
template <typename IteratorT>
QuicMMsgHdr(const IteratorT& first,
const IteratorT& last,
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_one_block_arena.h b/chromium/net/third_party/quiche/src/quic/core/quic_one_block_arena.h
index 41842f35963..d8218036643 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_one_block_arena.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_one_block_arena.h
@@ -44,7 +44,7 @@ class QUIC_EXPORT_PRIVATE QuicOneBlockArena {
// Actual storage.
// Subtle/annoying: the value '8' must be coded explicitly into the alignment
// declaration for MSVC.
- QUIC_ALIGNED(8) char storage_[ArenaSize];
+ alignas(8) char storage_[ArenaSize];
// Current offset into the storage.
uint32_t offset_;
};
@@ -57,7 +57,7 @@ template <typename T, typename... Args>
QuicArenaScopedPtr<T> QuicOneBlockArena<ArenaSize>::New(Args&&... args) {
DCHECK_LT(AlignedSize<T>(), ArenaSize)
<< "Object is too large for the arena.";
- static_assert(QUIC_ALIGN_OF(T) > 1,
+ static_assert(alignof(T) > 1,
"Objects added to the arena must be at least 2B aligned.");
if (QUIC_PREDICT_FALSE(offset_ > ArenaSize - AlignedSize<T>())) {
QUIC_BUG << "Ran out of space in QuicOneBlockArena at " << this
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.cc b/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.cc
index 30b911fa839..3db37eda64b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.cc
@@ -11,6 +11,9 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/base/optimization.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_frame.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.h"
@@ -22,16 +25,13 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_aligned.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_exported_stats.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_server_stats.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -134,8 +134,8 @@ QuicPacketCreator::QuicPacketCreator(QuicConnectionId server_connection_id,
fully_pad_crypto_handshake_packets_(true),
latched_hard_max_packet_length_(0),
max_datagram_frame_size_(0) {
- if (close_connection_on_serialization_failure_) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_close_connection_on_serialization_failure);
+ if (let_connection_handle_pings_) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_let_connection_handle_pings);
}
SetMaxPacketLength(kDefaultMaxPacketSize);
if (!framer_->version().UsesTls()) {
@@ -466,7 +466,7 @@ void QuicPacketCreator::FlushCurrentPacket() {
return;
}
- QUIC_CACHELINE_ALIGNED char stack_buffer[kMaxOutgoingPacketSize];
+ ABSL_CACHELINE_ALIGNED char stack_buffer[kMaxOutgoingPacketSize];
QuicOwnedPacketBuffer external_buffer(delegate_->GetPacketBuffer());
if (external_buffer.buffer == nullptr) {
@@ -475,24 +475,14 @@ void QuicPacketCreator::FlushCurrentPacket() {
}
DCHECK_EQ(nullptr, packet_.encrypted_buffer);
- const bool success =
- SerializePacket(std::move(external_buffer), kMaxOutgoingPacketSize);
- if (close_connection_on_serialization_failure_ && !success) {
+ if (!SerializePacket(std::move(external_buffer), kMaxOutgoingPacketSize)) {
return;
}
OnSerializedPacket();
}
void QuicPacketCreator::OnSerializedPacket() {
- if (close_connection_on_serialization_failure_) {
- QUIC_BUG_IF(packet_.encrypted_buffer == nullptr);
- } else if (packet_.encrypted_buffer == nullptr) {
- const std::string error_details = "Failed to SerializePacket.";
- QUIC_BUG << error_details;
- delegate_->OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET,
- error_details);
- return;
- }
+ QUIC_BUG_IF(packet_.encrypted_buffer == nullptr);
SerializedPacket packet(std::move(packet_));
ClearPacket();
@@ -556,9 +546,7 @@ size_t QuicPacketCreator::ReserializeInitialPacketInCoalescedPacket(
return 0;
}
}
- const bool success =
- SerializePacket(QuicOwnedPacketBuffer(buffer, nullptr), buffer_len);
- if (close_connection_on_serialization_failure_ && !success) {
+ if (!SerializePacket(QuicOwnedPacketBuffer(buffer, nullptr), buffer_len)) {
return 0;
}
const size_t encrypted_length = packet_.encrypted_length;
@@ -590,7 +578,7 @@ void QuicPacketCreator::CreateAndSerializeStreamFrame(
<< ": " << SerializedPacketFateToString(packet_.fate) << " of "
<< EncryptionLevelToString(packet_.encryption_level);
- QUIC_CACHELINE_ALIGNED char stack_buffer[kMaxOutgoingPacketSize];
+ ABSL_CACHELINE_ALIGNED char stack_buffer[kMaxOutgoingPacketSize];
QuicOwnedPacketBuffer packet_buffer(delegate_->GetPacketBuffer());
if (packet_buffer.buffer == nullptr) {
@@ -604,7 +592,6 @@ void QuicPacketCreator::CreateAndSerializeStreamFrame(
size_t length_field_offset = 0;
if (!framer_->AppendPacketHeader(header, &writer, &length_field_offset)) {
QUIC_BUG << "AppendPacketHeader failed";
- RecordFailToSerializePacketLocation(kQuicFailToAppendPacketHeaderFastPath);
return;
}
@@ -646,12 +633,10 @@ void QuicPacketCreator::CreateAndSerializeStreamFrame(
bool omit_frame_length = !needs_padding;
if (!framer_->AppendTypeByte(QuicFrame(frame), omit_frame_length, &writer)) {
QUIC_BUG << "AppendTypeByte failed";
- RecordFailToSerializePacketLocation(kQuicFailToAppendTypeFastPath);
return;
}
if (!framer_->AppendStreamFrame(frame, omit_frame_length, &writer)) {
QUIC_BUG << "AppendStreamFrame failed";
- RecordFailToSerializePacketLocation(kQuicFailToAppendStreamFrameFastPath);
return;
}
if (needs_padding &&
@@ -659,14 +644,11 @@ void QuicPacketCreator::CreateAndSerializeStreamFrame(
!writer.WritePaddingBytes(MinPlaintextPacketSize(framer_->version()) -
plaintext_bytes_written)) {
QUIC_BUG << "Unable to add padding bytes";
- RecordFailToSerializePacketLocation(kQuicFailToAddPaddingFastPath);
return;
}
if (!framer_->WriteIetfLongHeaderLength(header, &writer, length_field_offset,
packet_.encryption_level)) {
- RecordFailToSerializePacketLocation(
- kQuicFailToWriteIetfLongHeaderLengthFastPath);
return;
}
@@ -681,7 +663,6 @@ void QuicPacketCreator::CreateAndSerializeStreamFrame(
writer.length(), kMaxOutgoingPacketSize, encrypted_buffer);
if (encrypted_length == 0) {
QUIC_BUG << "Failed to encrypt packet number " << header.packet_number;
- RecordFailToSerializePacketLocation(kQuicFailToEncryptPacketFastPath);
return;
}
// TODO(ianswett): Optimize the storage so RetransmitableFrames can be
@@ -764,9 +745,7 @@ bool QuicPacketCreator::AddPaddedSavedFrame(
bool QuicPacketCreator::SerializePacket(QuicOwnedPacketBuffer encrypted_buffer,
size_t encrypted_buffer_len) {
- if (close_connection_on_serialization_failure_ &&
- packet_.encrypted_buffer != nullptr) {
- RecordFailToSerializePacketLocation(kQuicSerializePacketNonEmptyBuffer);
+ if (packet_.encrypted_buffer != nullptr) {
const std::string error_details =
"Packet's encrypted buffer is not empty before serialization";
QUIC_BUG << error_details;
@@ -774,11 +753,7 @@ bool QuicPacketCreator::SerializePacket(QuicOwnedPacketBuffer encrypted_buffer,
error_details);
return false;
}
- const bool use_handler =
- GetQuicReloadableFlag(
- quic_neuter_initial_packet_in_coalescer_with_initial_key_discarded) ||
- close_connection_on_serialization_failure_;
- ScopedSerializationFailureHandler handler(use_handler ? this : nullptr);
+ ScopedSerializationFailureHandler handler(this);
DCHECK_LT(0u, encrypted_buffer_len);
QUIC_BUG_IF(queued_frames_.empty() && pending_padding_bytes_ == 0)
@@ -810,22 +785,6 @@ bool QuicPacketCreator::SerializePacket(QuicOwnedPacketBuffer encrypted_buffer,
<< QuicFramesToString(queued_frames_)
<< " at missing encryption_level " << packet_.encryption_level
<< " using " << framer_->version();
- switch (packet_.encryption_level) {
- case ENCRYPTION_INITIAL:
- RecordFailToSerializePacketLocation(kQuicMissingInitialKey);
- break;
- case ENCRYPTION_HANDSHAKE:
- RecordFailToSerializePacketLocation(kQuicMissingHandshakeKey);
- break;
- case ENCRYPTION_ZERO_RTT:
- RecordFailToSerializePacketLocation(kQuicMissingZeroRttKey);
- break;
- case ENCRYPTION_FORWARD_SECURE:
- RecordFailToSerializePacketLocation(kQuicMissingOneRttKey);
- break;
- default:
- break;
- }
return false;
}
@@ -844,42 +803,6 @@ bool QuicPacketCreator::SerializePacket(QuicOwnedPacketBuffer encrypted_buffer,
<< latched_hard_max_packet_length_
<< ", max_packet_length_: " << max_packet_length_
<< ", header: " << header;
- switch (packet_.encryption_level) {
- case ENCRYPTION_INITIAL:
- if (QuicUtils::ContainsFrameType(queued_frames_, PADDING_FRAME)) {
- RecordFailToSerializePacketLocation(
- kQuicFailToBuildPacketWithPaddingInitial);
- } else {
- RecordFailToSerializePacketLocation(kQuicFailToBuildPacketInitial);
- }
- break;
- case ENCRYPTION_HANDSHAKE:
- if (QuicUtils::ContainsFrameType(queued_frames_, PADDING_FRAME)) {
- RecordFailToSerializePacketLocation(
- kQuicFailToBuildPacketWithPaddingHandshake);
- } else {
- RecordFailToSerializePacketLocation(kQuicFailToBuildPacketHandshake);
- }
- break;
- case ENCRYPTION_ZERO_RTT:
- if (QuicUtils::ContainsFrameType(queued_frames_, PADDING_FRAME)) {
- RecordFailToSerializePacketLocation(
- kQuicFailToBuildPacketWithPaddingZeroRtt);
- } else {
- RecordFailToSerializePacketLocation(kQuicFailToBuildPacketZeroRtt);
- }
- break;
- case ENCRYPTION_FORWARD_SECURE:
- if (QuicUtils::ContainsFrameType(queued_frames_, PADDING_FRAME)) {
- RecordFailToSerializePacketLocation(
- kQuicFailToBuildPacketWithPaddingOneRtt);
- } else {
- RecordFailToSerializePacketLocation(kQuicFailToBuildPacketOneRtt);
- }
- break;
- default:
- break;
- }
return false;
}
@@ -901,29 +824,10 @@ bool QuicPacketCreator::SerializePacket(QuicOwnedPacketBuffer encrypted_buffer,
encrypted_buffer_len, encrypted_buffer.buffer);
if (encrypted_length == 0) {
QUIC_BUG << "Failed to encrypt packet number " << packet_.packet_number;
- switch (packet_.encryption_level) {
- case ENCRYPTION_INITIAL:
- RecordFailToSerializePacketLocation(kQuicFailToEncryptInitial);
- break;
- case ENCRYPTION_HANDSHAKE:
- RecordFailToSerializePacketLocation(kQuicFailToEncryptHandshake);
- break;
- case ENCRYPTION_ZERO_RTT:
- RecordFailToSerializePacketLocation(kQuicFailToEncryptZeroRtt);
- break;
- case ENCRYPTION_FORWARD_SECURE:
- RecordFailToSerializePacketLocation(kQuicFailToEncryptOneRtt);
- break;
- default:
- break;
- }
return false;
}
packet_size_ = 0;
- if (!use_handler) {
- queued_frames_.clear();
- }
packet_.encrypted_buffer = encrypted_buffer.buffer;
packet_.encrypted_length = encrypted_length;
@@ -932,21 +836,6 @@ bool QuicPacketCreator::SerializePacket(QuicOwnedPacketBuffer encrypted_buffer,
return true;
}
-std::unique_ptr<QuicEncryptedPacket>
-QuicPacketCreator::SerializeVersionNegotiationPacket(
- bool ietf_quic,
- bool use_length_prefix,
- const ParsedQuicVersionVector& supported_versions) {
- DCHECK_EQ(Perspective::IS_SERVER, framer_->perspective());
- std::unique_ptr<QuicEncryptedPacket> encrypted =
- QuicFramer::BuildVersionNegotiationPacket(
- server_connection_id_, client_connection_id_, ietf_quic,
- use_length_prefix, supported_versions);
- DCHECK(encrypted);
- DCHECK_GE(max_packet_length_, encrypted->length());
- return encrypted;
-}
-
std::unique_ptr<SerializedPacket>
QuicPacketCreator::SerializeConnectivityProbingPacket() {
QUIC_BUG_IF(VersionHasIetfQuicFrames(framer_->transport_version()))
@@ -1288,22 +1177,23 @@ QuicVariableLengthIntegerLength QuicPacketCreator::GetRetryTokenLengthLength()
return VARIABLE_LENGTH_INTEGER_LENGTH_0;
}
-quiche::QuicheStringPiece QuicPacketCreator::GetRetryToken() const {
+absl::string_view QuicPacketCreator::GetRetryToken() const {
if (QuicVersionHasLongHeaderLengths(framer_->transport_version()) &&
HasIetfLongHeader() &&
EncryptionlevelToLongHeaderType(packet_.encryption_level) == INITIAL) {
return retry_token_;
}
- return quiche::QuicheStringPiece();
+ return absl::string_view();
}
-void QuicPacketCreator::SetRetryToken(quiche::QuicheStringPiece retry_token) {
+void QuicPacketCreator::SetRetryToken(absl::string_view retry_token) {
retry_token_ = std::string(retry_token);
}
bool QuicPacketCreator::ConsumeRetransmittableControlFrame(
const QuicFrame& frame) {
- QUIC_BUG_IF(IsControlFrame(frame.type) && !GetControlFrameId(frame))
+ QUIC_BUG_IF(IsControlFrame(frame.type) && !GetControlFrameId(frame) &&
+ (!let_connection_handle_pings_ || frame.type != PING_FRAME))
<< "Adding a control frame with no control frame id: " << frame;
DCHECK(QuicUtils::IsRetransmittableFrame(frame.type)) << frame;
MaybeBundleAckOpportunistically();
@@ -1574,7 +1464,7 @@ void QuicPacketCreator::Flush() {
FlushCurrentPacket();
SendRemainingPendingPadding();
flusher_attached_ = false;
- if (GetQuicFlag(FLAGS_quic_export_server_num_packets_per_write_histogram)) {
+ if (GetQuicFlag(FLAGS_quic_export_write_path_stats_at_server)) {
if (!write_start_packet_number_.IsInitialized()) {
QUIC_BUG << "write_start_packet_number is not initialized";
return;
@@ -2102,8 +1992,7 @@ QuicPacketCreator::ScopedSerializationFailureHandler::
// Always clear queued_frames_.
creator_->queued_frames_.clear();
- if (creator_->close_connection_on_serialization_failure_ &&
- creator_->packet_.encrypted_buffer == nullptr) {
+ if (creator_->packet_.encrypted_buffer == nullptr) {
const std::string error_details = "Failed to SerializePacket.";
QUIC_BUG << error_details;
creator_->delegate_->OnUnrecoverableError(QUIC_FAILED_TO_SERIALIZE_PACKET,
@@ -2119,11 +2008,39 @@ void QuicPacketCreator::set_encryption_level(EncryptionLevel level) {
packet_.encryption_level = level;
}
+void QuicPacketCreator::AddPathChallengeFrame(QuicPathFrameBuffer* payload) {
+ // Write a PATH_CHALLENGE frame, which has a random 8-byte payload.
+ random_->RandBytes(payload->data(), payload->size());
+ auto path_challenge_frame = new QuicPathChallengeFrame(0, *payload);
+ QuicFrame frame(path_challenge_frame);
+ if (AddPaddedFrameWithRetry(frame)) {
+ return;
+ }
+ // Fail silently if the probing packet cannot be written, path validation
+ // initiator will retry sending automatically.
+ // TODO(danzh) This will consume retry budget, if it causes performance
+ // regression, consider to notify the caller about the sending failure and let
+ // the caller to decide if it worth retrying.
+ QUIC_DVLOG(1) << ENDPOINT << "Can't send PATH_CHALLENGE now";
+ delete path_challenge_frame;
+}
+
bool QuicPacketCreator::AddPathResponseFrame(
const QuicPathFrameBuffer& data_buffer) {
auto path_response =
new QuicPathResponseFrame(kInvalidControlFrameId, data_buffer);
QuicFrame frame(path_response);
+ if (AddPaddedFrameWithRetry(frame)) {
+ return true;
+ }
+
+ QUIC_DVLOG(1) << ENDPOINT << "Can't send PATH_RESPONSE now";
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_send_path_response, 5, 5);
+ delete path_response;
+ return false;
+}
+
+bool QuicPacketCreator::AddPaddedFrameWithRetry(const QuicFrame& frame) {
if (HasPendingFrames()) {
if (AddPaddedSavedFrame(frame, NOT_RETRANSMISSION)) {
// Frame is queued.
@@ -2134,14 +2051,12 @@ bool QuicPacketCreator::AddPathResponseFrame(
DCHECK(!HasPendingFrames());
if (!delegate_->ShouldGeneratePacket(NO_RETRANSMITTABLE_DATA,
NOT_HANDSHAKE)) {
- QUIC_DVLOG(1) << ENDPOINT << "Can't send PATH_RESPONSE now";
- QUIC_RELOADABLE_FLAG_COUNT_N(quic_send_path_response, 5, 5);
- delete path_response;
return false;
}
bool success = AddPaddedSavedFrame(frame, NOT_RETRANSMISSION);
QUIC_BUG_IF(!success);
return true;
}
+
#undef ENDPOINT // undef for jumbo builds
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.h b/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.h
index b025d06f66f..54da59c05f3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator.h
@@ -20,6 +20,8 @@
#include <utility>
#include <vector>
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_coalesced_packet.h"
@@ -27,8 +29,6 @@
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -231,12 +231,6 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
bool AddPaddedSavedFrame(const QuicFrame& frame,
TransmissionType transmission_type);
- // Creates a version negotiation packet which supports |supported_versions|.
- std::unique_ptr<QuicEncryptedPacket> SerializeVersionNegotiationPacket(
- bool ietf_quic,
- bool use_length_prefix,
- const ParsedQuicVersionVector& supported_versions);
-
// Creates a connectivity probing packet for versions prior to version 99.
std::unique_ptr<SerializedPacket> SerializeConnectivityProbingPacket();
@@ -258,6 +252,11 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// Add PATH_RESPONSE to current packet, flush before or afterwards if needed.
bool AddPathResponseFrame(const QuicPathFrameBuffer& data_buffer);
+ // Add PATH_CHALLENGE to current packet, flush before or afterwards if needed.
+ // This is a best effort adding. It may fail becasue of delegate state, but
+ // it's okay because of path validation retry mechanism.
+ void AddPathChallengeFrame(QuicPathFrameBuffer* payload);
+
// Returns a dummy packet that is valid but contains no useful information.
static SerializedPacket NoPacket();
@@ -322,7 +321,7 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
void AddPendingPadding(QuicByteCount size);
// Sets the retry token to be sent over the wire in IETF Initial packets.
- void SetRetryToken(quiche::QuicheStringPiece retry_token);
+ void SetRetryToken(absl::string_view retry_token);
// Consumes retransmittable control |frame|. Returns true if the frame is
// successfully consumed. Returns false otherwise.
@@ -469,6 +468,10 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// different from the current one, flush all the queue frames first.
void SetDefaultPeerAddress(QuicSocketAddress address);
+ bool let_connection_handle_pings() const {
+ return let_connection_handle_pings_;
+ }
+
private:
friend class test::QuicPacketCreatorPeer;
@@ -510,7 +513,7 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// retransmitted to packet_.retransmittable_frames. All frames must fit into
// a single packet. Returns true on success, otherwise, returns false.
// Fails if |encrypted_buffer| is not large enough for the encrypted packet.
- QUIC_MUST_USE_RESULT bool SerializePacket(
+ ABSL_MUST_USE_RESULT bool SerializePacket(
QuicOwnedPacketBuffer encrypted_buffer,
size_t encrypted_buffer_len);
@@ -569,7 +572,7 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// Returns the retry token to send over the wire, only sent in
// v99 IETF Initial packets.
- quiche::QuicheStringPiece GetRetryToken() const;
+ absl::string_view GetRetryToken() const;
// Returns length of the length variable length integer to send over the
// wire. Is non-zero for v99 IETF Initial, 0-RTT or Handshake packets.
@@ -592,6 +595,11 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// Returns true and close connection if it attempts to send unencrypted data.
bool AttemptingToSendUnencryptedStreamData();
+ // Add the given frame to the current packet with full padding. If the current
+ // packet doesn't have enough space, flush once and try again. Return false if
+ // fail to add.
+ bool AddPaddedFrameWithRetry(const QuicFrame& frame);
+
// Does not own these delegates or the framer.
DelegateInterface* delegate_;
DebugDelegate* debug_delegate_;
@@ -663,8 +671,8 @@ class QUIC_EXPORT_PRIVATE QuicPacketCreator {
// negotiates this during the handshake.
QuicByteCount max_datagram_frame_size_;
- const bool close_connection_on_serialization_failure_ =
- GetQuicReloadableFlag(quic_close_connection_on_serialization_failure);
+ const bool let_connection_handle_pings_ =
+ GetQuicReloadableFlag(quic_let_connection_handle_pings);
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator_test.cc
index 4afbf06158a..d76f1985ad6 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_packet_creator_test.cc
@@ -11,6 +11,8 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
@@ -30,9 +32,7 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_data_producer.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_quic_framer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
using testing::_;
@@ -227,8 +227,7 @@ class QuicPacketCreatorTest : public QuicTestWithParam<TestParams> {
producer_.WriteStreamData(stream_id, frame.stream_frame.offset,
frame.stream_frame.data_length, &writer);
}
- EXPECT_EQ(data,
- quiche::QuicheStringPiece(buf, frame.stream_frame.data_length));
+ EXPECT_EQ(data, absl::string_view(buf, frame.stream_frame.data_length));
EXPECT_EQ(offset, frame.stream_frame.offset);
EXPECT_EQ(fin, frame.stream_frame.fin);
}
@@ -306,7 +305,7 @@ TEST_P(QuicPacketCreatorTest, SerializeFrames) {
client_framer_.transport_version(), Perspective::IS_CLIENT);
if (level != ENCRYPTION_INITIAL && level != ENCRYPTION_HANDSHAKE) {
frames_.push_back(QuicFrame(
- QuicStreamFrame(stream_id, false, 0u, quiche::QuicheStringPiece())));
+ QuicStreamFrame(stream_id, false, 0u, absl::string_view())));
}
SerializedPacket serialized = SerializeAllFrames(frames_);
EXPECT_EQ(level, serialized.encryption_level);
@@ -580,28 +579,6 @@ TEST_P(QuicPacketCreatorTest, NonCryptoStreamFramePacketNonPadding) {
}
}
-TEST_P(QuicPacketCreatorTest, SerializeVersionNegotiationPacket) {
- QuicFramerPeer::SetPerspective(&client_framer_, Perspective::IS_SERVER);
- ParsedQuicVersionVector versions;
- versions.push_back(test::QuicVersionMax());
- const bool ietf_quic =
- VersionHasIetfInvariantHeader(creator_.transport_version());
- const bool has_length_prefix =
- GetParam().version.HasLengthPrefixedConnectionIds();
- std::unique_ptr<QuicEncryptedPacket> encrypted(
- creator_.SerializeVersionNegotiationPacket(ietf_quic, has_length_prefix,
- versions));
-
- {
- InSequence s;
- EXPECT_CALL(framer_visitor_, OnPacket());
- EXPECT_CALL(framer_visitor_, OnUnauthenticatedPublicHeader(_));
- EXPECT_CALL(framer_visitor_, OnVersionNegotiationPacket(_));
- }
- QuicFramerPeer::SetPerspective(&client_framer_, Perspective::IS_CLIENT);
- client_framer_.ProcessPacket(*encrypted);
-}
-
// Test that the path challenge connectivity probing packet is serialized
// correctly as a padded PATH CHALLENGE packet.
TEST_P(QuicPacketCreatorTest, BuildPathChallengePacket) {
@@ -640,9 +617,9 @@ TEST_P(QuicPacketCreatorTest, BuildPathChallengePacket) {
MockRandom randomizer;
size_t length = creator_.BuildPaddedPathChallengePacket(
- header, buffer.get(), QUICHE_ARRAYSIZE(packet), &payload, &randomizer,
+ header, buffer.get(), ABSL_ARRAYSIZE(packet), &payload, &randomizer,
ENCRYPTION_INITIAL);
- EXPECT_EQ(length, QUICHE_ARRAYSIZE(packet));
+ EXPECT_EQ(length, ABSL_ARRAYSIZE(packet));
// Payload has the random bytes that were generated. Copy them into packet,
// above, before checking that the generated packet is correct.
@@ -653,7 +630,7 @@ TEST_P(QuicPacketCreatorTest, BuildPathChallengePacket) {
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data.data(), data.length(),
- reinterpret_cast<char*>(packet), QUICHE_ARRAYSIZE(packet));
+ reinterpret_cast<char*>(packet), ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicPacketCreatorTest, BuildConnectivityProbingPacket) {
@@ -711,13 +688,13 @@ TEST_P(QuicPacketCreatorTest, BuildConnectivityProbingPacket) {
// clang-format on
unsigned char* p = packet;
- size_t packet_size = QUICHE_ARRAYSIZE(packet);
+ size_t packet_size = ABSL_ARRAYSIZE(packet);
if (creator_.version().HasIetfQuicFrames()) {
p = packet99;
- packet_size = QUICHE_ARRAYSIZE(packet99);
+ packet_size = ABSL_ARRAYSIZE(packet99);
} else if (creator_.version().HasIetfInvariantHeader()) {
p = packet46;
- packet_size = QUICHE_ARRAYSIZE(packet46);
+ packet_size = ABSL_ARRAYSIZE(packet46);
}
std::unique_ptr<char[]> buffer(new char[kMaxOutgoingPacketSize]);
@@ -772,15 +749,15 @@ TEST_P(QuicPacketCreatorTest, BuildPathResponsePacket1ResponseUnpadded) {
QuicCircularDeque<QuicPathFrameBuffer> payloads;
payloads.push_back(payload0);
size_t length = creator_.BuildPathResponsePacket(
- header, buffer.get(), QUICHE_ARRAYSIZE(packet), payloads,
+ header, buffer.get(), ABSL_ARRAYSIZE(packet), payloads,
/*is_padded=*/false, ENCRYPTION_INITIAL);
- EXPECT_EQ(length, QUICHE_ARRAYSIZE(packet));
+ EXPECT_EQ(length, ABSL_ARRAYSIZE(packet));
QuicPacket data(creator_.transport_version(), buffer.release(), length, true,
header);
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data.data(), data.length(),
- reinterpret_cast<char*>(packet), QUICHE_ARRAYSIZE(packet));
+ reinterpret_cast<char*>(packet), ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicPacketCreatorTest, BuildPathResponsePacket1ResponsePadded) {
@@ -819,15 +796,15 @@ TEST_P(QuicPacketCreatorTest, BuildPathResponsePacket1ResponsePadded) {
QuicCircularDeque<QuicPathFrameBuffer> payloads;
payloads.push_back(payload0);
size_t length = creator_.BuildPathResponsePacket(
- header, buffer.get(), QUICHE_ARRAYSIZE(packet), payloads,
+ header, buffer.get(), ABSL_ARRAYSIZE(packet), payloads,
/*is_padded=*/true, ENCRYPTION_INITIAL);
- EXPECT_EQ(length, QUICHE_ARRAYSIZE(packet));
+ EXPECT_EQ(length, ABSL_ARRAYSIZE(packet));
QuicPacket data(creator_.transport_version(), buffer.release(), length, true,
header);
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data.data(), data.length(),
- reinterpret_cast<char*>(packet), QUICHE_ARRAYSIZE(packet));
+ reinterpret_cast<char*>(packet), ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicPacketCreatorTest, BuildPathResponsePacket3ResponsesUnpadded) {
@@ -871,15 +848,15 @@ TEST_P(QuicPacketCreatorTest, BuildPathResponsePacket3ResponsesUnpadded) {
payloads.push_back(payload1);
payloads.push_back(payload2);
size_t length = creator_.BuildPathResponsePacket(
- header, buffer.get(), QUICHE_ARRAYSIZE(packet), payloads,
+ header, buffer.get(), ABSL_ARRAYSIZE(packet), payloads,
/*is_padded=*/false, ENCRYPTION_INITIAL);
- EXPECT_EQ(length, QUICHE_ARRAYSIZE(packet));
+ EXPECT_EQ(length, ABSL_ARRAYSIZE(packet));
QuicPacket data(creator_.transport_version(), buffer.release(), length, true,
header);
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data.data(), data.length(),
- reinterpret_cast<char*>(packet), QUICHE_ARRAYSIZE(packet));
+ reinterpret_cast<char*>(packet), ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicPacketCreatorTest, BuildPathResponsePacket3ResponsesPadded) {
@@ -925,15 +902,15 @@ TEST_P(QuicPacketCreatorTest, BuildPathResponsePacket3ResponsesPadded) {
payloads.push_back(payload1);
payloads.push_back(payload2);
size_t length = creator_.BuildPathResponsePacket(
- header, buffer.get(), QUICHE_ARRAYSIZE(packet), payloads,
+ header, buffer.get(), ABSL_ARRAYSIZE(packet), payloads,
/*is_padded=*/true, ENCRYPTION_INITIAL);
- EXPECT_EQ(length, QUICHE_ARRAYSIZE(packet));
+ EXPECT_EQ(length, ABSL_ARRAYSIZE(packet));
QuicPacket data(creator_.transport_version(), buffer.release(), length, true,
header);
quiche::test::CompareCharArraysWithHexError(
"constructed packet", data.data(), data.length(),
- reinterpret_cast<char*>(packet), QUICHE_ARRAYSIZE(packet));
+ reinterpret_cast<char*>(packet), ABSL_ARRAYSIZE(packet));
}
TEST_P(QuicPacketCreatorTest, SerializeConnectivityProbingPacket) {
@@ -1296,7 +1273,7 @@ TEST_P(QuicPacketCreatorTest, SerializeFrame) {
if (!QuicVersionUsesCryptoFrames(client_framer_.transport_version())) {
QuicStreamFrame stream_frame(
QuicUtils::GetCryptoStreamId(client_framer_.transport_version()),
- /*fin=*/false, 0u, quiche::QuicheStringPiece());
+ /*fin=*/false, 0u, absl::string_view());
frames_.push_back(QuicFrame(stream_frame));
} else {
producer_.SaveCryptoData(ENCRYPTION_INITIAL, 0, data);
@@ -1333,7 +1310,7 @@ TEST_P(QuicPacketCreatorTest, SerializeFrameShortData) {
if (!QuicVersionUsesCryptoFrames(client_framer_.transport_version())) {
QuicStreamFrame stream_frame(
QuicUtils::GetCryptoStreamId(client_framer_.transport_version()),
- /*fin=*/false, 0u, quiche::QuicheStringPiece());
+ /*fin=*/false, 0u, absl::string_view());
frames_.push_back(QuicFrame(stream_frame));
} else {
producer_.SaveCryptoData(ENCRYPTION_INITIAL, 0, data);
@@ -1556,7 +1533,7 @@ TEST_P(QuicPacketCreatorTest, AddUnencryptedStreamDataClosesConnection) {
creator_.set_encryption_level(ENCRYPTION_INITIAL);
EXPECT_CALL(delegate_, OnUnrecoverableError(_, _));
QuicStreamFrame stream_frame(GetNthClientInitiatedStreamId(0),
- /*fin=*/false, 0u, quiche::QuicheStringPiece());
+ /*fin=*/false, 0u, absl::string_view());
EXPECT_QUIC_BUG(
creator_.AddFrame(QuicFrame(stream_frame), NOT_RETRANSMISSION),
"Cannot send stream data with level: ENCRYPTION_INITIAL");
@@ -1571,7 +1548,7 @@ TEST_P(QuicPacketCreatorTest, SendStreamDataWithEncryptionHandshake) {
creator_.set_encryption_level(ENCRYPTION_HANDSHAKE);
EXPECT_CALL(delegate_, OnUnrecoverableError(_, _));
QuicStreamFrame stream_frame(GetNthClientInitiatedStreamId(0),
- /*fin=*/false, 0u, quiche::QuicheStringPiece());
+ /*fin=*/false, 0u, absl::string_view());
EXPECT_QUIC_BUG(
creator_.AddFrame(QuicFrame(stream_frame), NOT_RETRANSMISSION),
"Cannot send stream data with level: ENCRYPTION_HANDSHAKE");
@@ -1598,9 +1575,8 @@ TEST_P(QuicPacketCreatorTest, ChloTooLarge) {
message_data = framer.ConstructHandshakeMessage(message);
struct iovec iov;
- MakeIOVector(
- quiche::QuicheStringPiece(message_data->data(), message_data->length()),
- &iov);
+ MakeIOVector(absl::string_view(message_data->data(), message_data->length()),
+ &iov);
QuicFrame frame;
EXPECT_CALL(delegate_, OnUnrecoverableError(QUIC_CRYPTO_CHLO_TOO_LARGE, _));
EXPECT_QUIC_BUG(
@@ -1677,7 +1653,7 @@ TEST_P(QuicPacketCreatorTest, ConsumeDataAndRandomPadding) {
.WillRepeatedly(
Invoke(this, &QuicPacketCreatorTest::SaveSerializedPacket));
// Send stream frame of size kStreamFramePayloadSize.
- MakeIOVector(quiche::QuicheStringPiece(buf, kStreamFramePayloadSize), &iov_);
+ MakeIOVector(absl::string_view(buf, kStreamFramePayloadSize), &iov_);
creator_.ConsumeDataToFillCurrentPacket(stream_id, &iov_, 1u, iov_.iov_len,
0u, 0u, false, false,
NOT_RETRANSMISSION, &frame);
@@ -1685,8 +1661,7 @@ TEST_P(QuicPacketCreatorTest, ConsumeDataAndRandomPadding) {
// 1 byte padding is sent.
EXPECT_EQ(pending_padding_bytes - 1, creator_.pending_padding_bytes());
// Send stream frame of size kStreamFramePayloadSize + 1.
- MakeIOVector(quiche::QuicheStringPiece(buf, kStreamFramePayloadSize + 1),
- &iov_);
+ MakeIOVector(absl::string_view(buf, kStreamFramePayloadSize + 1), &iov_);
creator_.ConsumeDataToFillCurrentPacket(stream_id, &iov_, 1u, iov_.iov_len,
0u, kStreamFramePayloadSize, false,
false, NOT_RETRANSMISSION, &frame);
@@ -1798,7 +1773,7 @@ TEST_P(QuicPacketCreatorTest, MessageFrameConsumption) {
creator_.SetMaxDatagramFrameSize(kMaxAcceptedDatagramFrameSize);
}
std::string message_data(kDefaultMaxPacketSize, 'a');
- quiche::QuicheStringPiece message_buffer(message_data);
+ absl::string_view message_buffer(message_data);
QuicMemSliceStorage storage(nullptr, 0, nullptr, 0);
// Test all possible encryption levels of message frames.
for (EncryptionLevel level :
@@ -1809,10 +1784,9 @@ TEST_P(QuicPacketCreatorTest, MessageFrameConsumption) {
message_size <= creator_.GetCurrentLargestMessagePayload();
++message_size) {
QuicMessageFrame* frame = new QuicMessageFrame(
- 0, MakeSpan(
- &allocator_,
- quiche::QuicheStringPiece(message_buffer.data(), message_size),
- &storage));
+ 0, MakeSpan(&allocator_,
+ absl::string_view(message_buffer.data(), message_size),
+ &storage));
EXPECT_TRUE(creator_.AddFrame(QuicFrame(frame), NOT_RETRANSMISSION));
EXPECT_TRUE(creator_.HasPendingFrames());
@@ -1938,7 +1912,7 @@ TEST_P(QuicPacketCreatorTest, PacketTransmissionType) {
client_framer_.transport_version(), Perspective::IS_CLIENT);
QuicFrame stream_frame(QuicStreamFrame(stream_id,
/*fin=*/false, 0u,
- quiche::QuicheStringPiece()));
+ absl::string_view()));
ASSERT_TRUE(QuicUtils::IsRetransmittableFrame(stream_frame.type));
QuicFrame padding_frame{QuicPaddingFrame()};
@@ -1979,7 +1953,7 @@ TEST_P(QuicPacketCreatorTest, RetryToken) {
if (!QuicVersionUsesCryptoFrames(client_framer_.transport_version())) {
QuicStreamFrame stream_frame(
QuicUtils::GetCryptoStreamId(client_framer_.transport_version()),
- /*fin=*/false, 0u, quiche::QuicheStringPiece());
+ /*fin=*/false, 0u, absl::string_view());
frames_.push_back(QuicFrame(stream_frame));
} else {
producer_.SaveCryptoData(ENCRYPTION_INITIAL, 0, data);
@@ -2146,8 +2120,8 @@ TEST_P(QuicPacketCreatorTest, SerializeCoalescedPacket) {
QuicAckFrame ack_frame(InitAckFrame(1));
frames_.push_back(QuicFrame(&ack_frame));
if (level != ENCRYPTION_INITIAL && level != ENCRYPTION_HANDSHAKE) {
- frames_.push_back(QuicFrame(
- QuicStreamFrame(1, false, 0u, quiche::QuicheStringPiece())));
+ frames_.push_back(
+ QuicFrame(QuicStreamFrame(1, false, 0u, absl::string_view())));
}
SerializedPacket serialized = SerializeAllFrames(frames_);
EXPECT_EQ(level, serialized.encryption_level);
@@ -2420,7 +2394,7 @@ class MultiplePacketsTestPacketCreator : public QuicPacketCreator {
}
size_t ConsumeCryptoData(EncryptionLevel level,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
QuicStreamOffset offset) {
producer_->SaveCryptoData(level, offset, data);
if (!has_ack() && delegate_->ShouldGeneratePacket(NO_RETRANSMITTABLE_DATA,
@@ -3576,7 +3550,7 @@ TEST_F(QuicPacketCreatorMultiplePacketsTest,
ConnectionCloseFrameLargerThanPacketSize) {
delegate_.SetCanWriteAnything();
char buf[2000] = {};
- quiche::QuicheStringPiece error_details(buf, 2000);
+ absl::string_view error_details(buf, 2000);
const QuicErrorCode kQuicErrorCode = QUIC_PACKET_WRITE_ERROR;
QuicConnectionCloseFrame* frame = new QuicConnectionCloseFrame(
@@ -3616,7 +3590,7 @@ TEST_F(QuicPacketCreatorMultiplePacketsTest,
EXPECT_CALL(delegate_, OnSerializedPacket(_))
.WillOnce(
Invoke(this, &QuicPacketCreatorMultiplePacketsTest::SavePacket));
- MakeIOVector(quiche::QuicheStringPiece(buf, kStreamFramePayloadSize), &iov_);
+ MakeIOVector(absl::string_view(buf, kStreamFramePayloadSize), &iov_);
QuicConsumedData consumed = creator_.ConsumeData(
kDataStreamId, &iov_, 1u, iov_.iov_len, 0, FIN_AND_PADDING);
creator_.Flush();
@@ -3659,7 +3633,7 @@ TEST_F(QuicPacketCreatorMultiplePacketsTest,
EXPECT_CALL(delegate_, OnSerializedPacket(_))
.WillRepeatedly(
Invoke(this, &QuicPacketCreatorMultiplePacketsTest::SavePacket));
- MakeIOVector(quiche::QuicheStringPiece(buf, kStreamFramePayloadSize), &iov_);
+ MakeIOVector(absl::string_view(buf, kStreamFramePayloadSize), &iov_);
QuicConsumedData consumed = creator_.ConsumeData(
kDataStreamId, &iov_, 1u, iov_.iov_len, 0, FIN_AND_PADDING);
creator_.Flush();
@@ -3714,11 +3688,11 @@ TEST_F(QuicPacketCreatorMultiplePacketsTest,
EXPECT_CALL(delegate_, OnSerializedPacket(_))
.WillRepeatedly(
Invoke(this, &QuicPacketCreatorMultiplePacketsTest::SavePacket));
- MakeIOVector(quiche::QuicheStringPiece(buf, kStreamFramePayloadSize), &iov_);
+ MakeIOVector(absl::string_view(buf, kStreamFramePayloadSize), &iov_);
QuicConsumedData consumed = creator_.ConsumeData(
kDataStreamId1, &iov_, 1u, iov_.iov_len, 0, FIN_AND_PADDING);
EXPECT_EQ(kStreamFramePayloadSize, consumed.bytes_consumed);
- MakeIOVector(quiche::QuicheStringPiece(buf, kStreamFramePayloadSize), &iov_);
+ MakeIOVector(absl::string_view(buf, kStreamFramePayloadSize), &iov_);
consumed = creator_.ConsumeData(kDataStreamId2, &iov_, 1u, iov_.iov_len, 0,
FIN_AND_PADDING);
EXPECT_EQ(kStreamFramePayloadSize, consumed.bytes_consumed);
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.cc b/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.cc
index 33340423eaf..2902f998b6e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/core/quic_packet_reader.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_process_packet_interface.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
@@ -13,7 +14,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_server_stats.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.h b/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.h
index 86eaa0ee9ad..6edf1f1dd29 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_packet_reader.h
@@ -7,11 +7,11 @@
#ifndef QUICHE_QUIC_CORE_QUIC_PACKET_READER_H_
#define QUICHE_QUIC_CORE_QUIC_PACKET_READER_H_
+#include "absl/base/optimization.h"
#include "net/third_party/quiche/src/quic/core/quic_clock.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_process_packet_interface.h"
#include "net/third_party/quiche/src/quic/core/quic_udp_socket.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_aligned.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
@@ -51,10 +51,10 @@ class QUIC_EXPORT_PRIVATE QuicPacketReader {
bool prefer_v6_ip);
struct QUIC_EXPORT_PRIVATE ReadBuffer {
- QUIC_CACHELINE_ALIGNED char
+ ABSL_CACHELINE_ALIGNED char
control_buffer[kDefaultUdpPacketControlBufferSize]; // For ancillary
// data.
- QUIC_CACHELINE_ALIGNED char packet_buffer[kMaxIncomingPacketSize];
+ ABSL_CACHELINE_ALIGNED char packet_buffer[kMaxIncomingPacketSize];
};
QuicUdpSocketApi socket_api_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_packets.cc b/chromium/net/third_party/quiche/src/quic/core/quic_packets.cc
index f54cf00d081..3d6228e6847 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_packets.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_packets.cc
@@ -6,6 +6,8 @@
#include <utility>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -14,7 +16,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_string_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -185,7 +186,7 @@ QuicPacketHeader::QuicPacketHeader()
long_packet_type(INITIAL),
possible_stateless_reset_token(0),
retry_token_length_length(VARIABLE_LENGTH_INTEGER_LENGTH_0),
- retry_token(quiche::QuicheStringPiece()),
+ retry_token(absl::string_view()),
length_length(VARIABLE_LENGTH_INTEGER_LENGTH_0),
remaining_packet_length(0) {}
@@ -263,8 +264,8 @@ std::ostream& operator<<(std::ostream& os, const QuicPacketHeader& header) {
}
if (header.nonce != nullptr) {
os << ", diversification_nonce: "
- << quiche::QuicheTextUtils::HexEncode(quiche::QuicheStringPiece(
- header.nonce->data(), header.nonce->size()));
+ << absl::BytesToHexString(
+ absl::string_view(header.nonce->data(), header.nonce->size()));
}
os << ", packet_number: " << header.packet_number << " }\n";
return os;
@@ -276,7 +277,7 @@ QuicData::QuicData(const char* buffer, size_t length)
QuicData::QuicData(const char* buffer, size_t length, bool owns_buffer)
: buffer_(buffer), length_(length), owns_buffer_(owns_buffer) {}
-QuicData::QuicData(quiche::QuicheStringPiece packet_data)
+QuicData::QuicData(absl::string_view packet_data)
: buffer_(packet_data.data()),
length_(packet_data.length()),
owns_buffer_(false) {}
@@ -335,7 +336,7 @@ QuicEncryptedPacket::QuicEncryptedPacket(const char* buffer,
bool owns_buffer)
: QuicData(buffer, length, owns_buffer) {}
-QuicEncryptedPacket::QuicEncryptedPacket(quiche::QuicheStringPiece data)
+QuicEncryptedPacket::QuicEncryptedPacket(absl::string_view data)
: QuicData(data) {}
std::unique_ptr<QuicEncryptedPacket> QuicEncryptedPacket::Clone() const {
@@ -426,9 +427,9 @@ std::ostream& operator<<(std::ostream& os, const QuicReceivedPacket& s) {
return os;
}
-quiche::QuicheStringPiece QuicPacket::AssociatedData(
+absl::string_view QuicPacket::AssociatedData(
QuicTransportVersion version) const {
- return quiche::QuicheStringPiece(
+ return absl::string_view(
data(),
GetStartOfEncryptedData(version, destination_connection_id_length_,
source_connection_id_length_, includes_version_,
@@ -437,14 +438,13 @@ quiche::QuicheStringPiece QuicPacket::AssociatedData(
retry_token_length_, length_length_));
}
-quiche::QuicheStringPiece QuicPacket::Plaintext(
- QuicTransportVersion version) const {
+absl::string_view QuicPacket::Plaintext(QuicTransportVersion version) const {
const size_t start_of_encrypted_data = GetStartOfEncryptedData(
version, destination_connection_id_length_, source_connection_id_length_,
includes_version_, includes_diversification_nonce_, packet_number_length_,
retry_token_length_length_, retry_token_length_, length_length_);
- return quiche::QuicheStringPiece(data() + start_of_encrypted_data,
- length() - start_of_encrypted_data);
+ return absl::string_view(data() + start_of_encrypted_data,
+ length() - start_of_encrypted_data);
}
SerializedPacket::SerializedPacket(QuicPacketNumber packet_number,
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_packets.h b/chromium/net/third_party/quiche/src/quic/core/quic_packets.h
index e9c811c6737..8cf7305a84f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_packets.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_packets.h
@@ -14,6 +14,7 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_ack_listener_interface.h"
#include "net/third_party/quiche/src/quic/core/quic_bandwidth.h"
@@ -25,7 +26,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -160,7 +160,7 @@ struct QUIC_EXPORT_PRIVATE QuicPacketHeader {
// carried only by v99 IETF Initial packets.
QuicVariableLengthIntegerLength retry_token_length_length;
// Retry token, carried only by v99 IETF Initial packets.
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
// Length of the length variable length integer field,
// carried only by v99 IETF Initial, 0-RTT and Handshake packets.
QuicVariableLengthIntegerLength length_length;
@@ -211,15 +211,15 @@ class QUIC_EXPORT_PRIVATE QuicData {
// Creates a QuicData from a buffer and length,
// optionally taking ownership of the buffer.
QuicData(const char* buffer, size_t length, bool owns_buffer);
- // Creates a QuicData from a quiche::QuicheStringPiece. Does not own the
+ // Creates a QuicData from a absl::string_view. Does not own the
// buffer.
- QuicData(quiche::QuicheStringPiece data);
+ QuicData(absl::string_view data);
QuicData(const QuicData&) = delete;
QuicData& operator=(const QuicData&) = delete;
virtual ~QuicData();
- quiche::QuicheStringPiece AsStringPiece() const {
- return quiche::QuicheStringPiece(data(), length());
+ absl::string_view AsStringPiece() const {
+ return absl::string_view(data(), length());
}
const char* data() const { return buffer_; }
@@ -252,8 +252,8 @@ class QUIC_EXPORT_PRIVATE QuicPacket : public QuicData {
QuicPacket(const QuicPacket&) = delete;
QuicPacket& operator=(const QuicPacket&) = delete;
- quiche::QuicheStringPiece AssociatedData(QuicTransportVersion version) const;
- quiche::QuicheStringPiece Plaintext(QuicTransportVersion version) const;
+ absl::string_view AssociatedData(QuicTransportVersion version) const;
+ absl::string_view Plaintext(QuicTransportVersion version) const;
char* mutable_data() { return buffer_; }
@@ -277,9 +277,9 @@ class QUIC_EXPORT_PRIVATE QuicEncryptedPacket : public QuicData {
// Creates a QuicEncryptedPacket from a buffer and length,
// optionally taking ownership of the buffer.
QuicEncryptedPacket(const char* buffer, size_t length, bool owns_buffer);
- // Creates a QuicEncryptedPacket from a quiche::QuicheStringPiece.
+ // Creates a QuicEncryptedPacket from a absl::string_view.
// Does not own the buffer.
- QuicEncryptedPacket(quiche::QuicheStringPiece data);
+ QuicEncryptedPacket(absl::string_view data);
QuicEncryptedPacket(const QuicEncryptedPacket&) = delete;
QuicEncryptedPacket& operator=(const QuicEncryptedPacket&) = delete;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_path_validator.cc b/chromium/net/third_party/quiche/src/quic/core/quic_path_validator.cc
new file mode 100644
index 00000000000..5d5e7206d54
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_path_validator.cc
@@ -0,0 +1,128 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/third_party/quiche/src/quic/core/quic_path_validator.h"
+
+#include "net/third_party/quiche/src/quic/core/quic_constants.h"
+#include "net/third_party/quiche/src/quic/core/quic_types.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
+
+namespace quic {
+
+class RetryAlarmDelegate : public QuicAlarm::Delegate {
+ public:
+ explicit RetryAlarmDelegate(QuicPathValidator* path_validator)
+ : path_validator_(path_validator) {}
+ RetryAlarmDelegate(const RetryAlarmDelegate&) = delete;
+ RetryAlarmDelegate& operator=(const RetryAlarmDelegate&) = delete;
+
+ void OnAlarm() override { path_validator_->OnRetryTimeout(); }
+
+ private:
+ QuicPathValidator* path_validator_;
+};
+
+std::ostream& operator<<(std::ostream& os,
+ const QuicPathValidationContext& context) {
+ return os << " from " << context.self_address_ << " to "
+ << context.peer_address_;
+}
+
+QuicPathValidator::QuicPathValidator(QuicAlarmFactory* alarm_factory,
+ QuicOneBlockArena<1024>* arena,
+ SendDelegate* send_delegate,
+ QuicRandom* random)
+ : send_delegate_(send_delegate),
+ random_(random),
+ retry_timer_(
+ alarm_factory->CreateAlarm(arena->New<RetryAlarmDelegate>(this),
+ arena)),
+ retry_count_(0u) {}
+
+void QuicPathValidator::OnPathResponse(const QuicPathFrameBuffer& probing_data,
+ QuicSocketAddress self_address) {
+ if (!HasPendingPathValidation()) {
+ return;
+ }
+
+ QUIC_DVLOG(1) << "Match PATH_RESPONSE received on " << self_address;
+ QUIC_BUG_IF(!path_context_->self_address().IsInitialized())
+ << "Self address should have been known by now";
+ if (self_address != path_context_->self_address()) {
+ QUIC_DVLOG(1) << "Expect the response to be received on "
+ << path_context_->self_address();
+ return;
+ }
+ // This iterates at most 3 times.
+ if (std::find(probing_data_.begin(), probing_data_.end(), probing_data) !=
+ probing_data_.end()) {
+ result_delegate_->OnPathValidationSuccess(std::move(path_context_));
+ ResetPathValidation();
+ }
+}
+
+void QuicPathValidator::StartValidingPath(
+ std::unique_ptr<QuicPathValidationContext> context,
+ std::unique_ptr<ResultDelegate> result_delegate) {
+ CancelPathValidation();
+ DCHECK_NE(nullptr, context);
+ QUIC_DLOG(INFO) << "Start validating path " << *context
+ << " via writer: " << context->WriterToUse();
+
+ path_context_ = std::move(context);
+ result_delegate_ = std::move(result_delegate);
+ SendPathChallengeAndSetAlarm();
+}
+
+void QuicPathValidator::ResetPathValidation() {
+ path_context_ = nullptr;
+ result_delegate_ = nullptr;
+ retry_timer_->Cancel();
+ retry_count_ = 0;
+}
+
+void QuicPathValidator::CancelPathValidation() {
+ if (path_context_ == nullptr) {
+ return;
+ }
+ QUIC_DVLOG(1) << "Cancel validation on path" << *path_context_;
+ ResetPathValidation();
+}
+
+bool QuicPathValidator::HasPendingPathValidation() const {
+ return path_context_ != nullptr;
+}
+
+const QuicPathFrameBuffer& QuicPathValidator::GeneratePathChallengePayload() {
+ probing_data_.push_back(QuicPathFrameBuffer());
+ random_->RandBytes(probing_data_.back().data(), sizeof(QuicPathFrameBuffer));
+ return probing_data_.back();
+}
+
+void QuicPathValidator::OnRetryTimeout() {
+ ++retry_count_;
+ if (retry_count_ > kMaxRetryTimes) {
+ result_delegate_->OnPathValidationFailure(std::move(path_context_));
+ CancelPathValidation();
+ return;
+ }
+ QUIC_DVLOG(1) << "Send another PATH_CHALLENGE on path " << *path_context_;
+ SendPathChallengeAndSetAlarm();
+}
+
+void QuicPathValidator::SendPathChallengeAndSetAlarm() {
+ bool should_continue = send_delegate_->SendPathChallenge(
+ GeneratePathChallengePayload(), path_context_->self_address(),
+ path_context_->peer_address(), path_context_->WriterToUse());
+
+ if (!should_continue) {
+ // The delegate doesn't want to continue the path validation.
+ CancelPathValidation();
+ return;
+ }
+ retry_timer_->Set(send_delegate_->GetRetryTimeout(
+ path_context_->peer_address(), path_context_->WriterToUse()));
+}
+
+} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_path_validator.h b/chromium/net/third_party/quiche/src/quic/core/quic_path_validator.h
new file mode 100644
index 00000000000..8cfa81d733a
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_path_validator.h
@@ -0,0 +1,135 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef QUICHE_QUIC_CORE_QUIC_PATH_VALIDATOR_H_
+#define QUICHE_QUIC_CORE_QUIC_PATH_VALIDATOR_H_
+
+#include <ostream>
+
+#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
+#include "net/third_party/quiche/src/quic/core/quic_alarm.h"
+#include "net/third_party/quiche/src/quic/core/quic_alarm_factory.h"
+#include "net/third_party/quiche/src/quic/core/quic_arena_scoped_ptr.h"
+#include "net/third_party/quiche/src/quic/core/quic_clock.h"
+#include "net/third_party/quiche/src/quic/core/quic_one_block_arena.h"
+#include "net/third_party/quiche/src/quic/core/quic_packet_writer.h"
+#include "net/third_party/quiche/src/quic/core/quic_types.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
+#include "net/quic/platform/impl/quic_export_impl.h"
+
+namespace quic {
+
+namespace test {
+class QuicPathValidatorPeer;
+}
+
+class QuicConnection;
+
+// Interface to provide the information of the path to be validated.
+class QUIC_EXPORT_PRIVATE QuicPathValidationContext {
+ public:
+ QuicPathValidationContext(const QuicSocketAddress& self_address,
+ const QuicSocketAddress& peer_address)
+ : self_address_(self_address), peer_address_(peer_address) {}
+
+ virtual ~QuicPathValidationContext() = default;
+
+ virtual QuicPacketWriter* WriterToUse() = 0;
+
+ const QuicSocketAddress& self_address() const { return self_address_; }
+ const QuicSocketAddress& peer_address() const { return peer_address_; }
+
+ private:
+ QUIC_EXPORT_PRIVATE friend std::ostream& operator<<(
+ std::ostream& os,
+ const QuicPathValidationContext& context);
+
+ QuicSocketAddress self_address_;
+ QuicSocketAddress peer_address_;
+};
+
+// Used to validate a path by sending up to 3 PATH_CHALLENGE frames before
+// declaring a path validation failure.
+class QUIC_EXPORT_PRIVATE QuicPathValidator {
+ public:
+ static const uint16_t kMaxRetryTimes = 2;
+
+ // Used to write PATH_CHALLENGE on the path to be validated and to get retry
+ // timeout.
+ class QUIC_EXPORT_PRIVATE SendDelegate {
+ public:
+ virtual ~SendDelegate() = default;
+
+ // Send a PATH_CHALLENGE with |data_buffer| as the frame payload using given
+ // path information. Return false if the delegate doesn't want to continue
+ // the validation.
+ virtual bool SendPathChallenge(const QuicPathFrameBuffer& data_buffer,
+ const QuicSocketAddress& self_address,
+ const QuicSocketAddress& peer_address,
+ QuicPacketWriter* writer) = 0;
+ // Return the time to retry sending PATH_CHALLENGE again based on given peer
+ // address and writer.
+ virtual QuicTime GetRetryTimeout(const QuicSocketAddress& peer_address,
+ QuicPacketWriter* writer) const = 0;
+ };
+
+ // Handles the validation result.
+ class QUIC_EXPORT_PRIVATE ResultDelegate {
+ public:
+ virtual ~ResultDelegate() = default;
+
+ virtual void OnPathValidationSuccess(
+ std::unique_ptr<QuicPathValidationContext> context) = 0;
+
+ virtual void OnPathValidationFailure(
+ std::unique_ptr<QuicPathValidationContext> context) = 0;
+ };
+
+ QuicPathValidator(QuicAlarmFactory* alarm_factory,
+ QuicConnectionArena* arena,
+ SendDelegate* delegate,
+ QuicRandom* random);
+
+ // Send PATH_CHALLENGE and start the retry timer.
+ void StartValidingPath(std::unique_ptr<QuicPathValidationContext> context,
+ std::unique_ptr<ResultDelegate> result_delegate);
+
+ // Called when a PATH_RESPONSE frame has been received. Matches the received
+ // PATH_RESPONSE payload with the payloads previously sent in PATH_CHALLANGE
+ // frames and the self address on which it was sent.
+ void OnPathResponse(const QuicPathFrameBuffer& probing_data,
+ QuicSocketAddress self_address);
+
+ // Cancel the retry timer and reset the path and result delegate.
+ void CancelPathValidation();
+
+ bool HasPendingPathValidation() const;
+
+ // Send another PATH_CHALLENGE on the same path. After retrying
+ // |kMaxRetryTimes| times, fail the current path validation.
+ void OnRetryTimeout();
+
+ private:
+ friend class test::QuicPathValidatorPeer;
+
+ // Return the payload to be used in the next PATH_CHALLENGE frame.
+ const QuicPathFrameBuffer& GeneratePathChallengePayload();
+
+ void SendPathChallengeAndSetAlarm();
+
+ void ResetPathValidation();
+
+ // Has at most 3 entries due to validation timeout.
+ QuicInlinedVector<QuicPathFrameBuffer, 3> probing_data_;
+ SendDelegate* send_delegate_;
+ QuicRandom* random_;
+ std::unique_ptr<QuicPathValidationContext> path_context_;
+ std::unique_ptr<ResultDelegate> result_delegate_;
+ QuicArenaScopedPtr<QuicAlarm> retry_timer_;
+ size_t retry_count_;
+};
+
+} // namespace quic
+
+#endif // QUICHE_QUIC_CORE_QUIC_PATH_VALIDATOR_H_
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_path_validator_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_path_validator_test.cc
new file mode 100644
index 00000000000..656292eb149
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_path_validator_test.cc
@@ -0,0 +1,242 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/third_party/quiche/src/quic/core/quic_path_validator.h"
+
+#include <memory>
+
+#include "net/third_party/quiche/src/quic/core/frames/quic_path_challenge_frame.h"
+#include "net/third_party/quiche/src/quic/core/quic_constants.h"
+#include "net/third_party/quiche/src/quic/core/quic_types.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
+#include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
+#include "net/third_party/quiche/src/quic/test_tools/mock_random.h"
+#include "net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.h"
+#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
+#include "net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h"
+
+using testing::_;
+using testing::Invoke;
+using testing::Return;
+
+namespace quic {
+namespace test {
+
+class MockSendDelegate : public QuicPathValidator::SendDelegate {
+ public:
+ // Send a PATH_CHALLENGE frame using given path information and populate
+ // |data_buffer| with the frame payload. Return true if the validator should
+ // move forward in validation, i.e. arm the retry timer.
+ MOCK_METHOD(bool,
+ SendPathChallenge,
+ (const QuicPathFrameBuffer&,
+ const QuicSocketAddress&,
+ const QuicSocketAddress&,
+ QuicPacketWriter*),
+ (override));
+
+ MOCK_METHOD(QuicTime,
+ GetRetryTimeout,
+ (const QuicSocketAddress&, QuicPacketWriter*),
+ (const override));
+};
+
+class QuicPathValidatorTest : public QuicTest {
+ public:
+ QuicPathValidatorTest()
+ : path_validator_(&alarm_factory_, &arena_, &send_delegate_, &random_),
+ context_(new MockQuicPathValidationContext(self_address_,
+ peer_address_,
+ &writer_)),
+ result_delegate_(new MockQuicPathValidationResultDelegate()) {
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
+ ON_CALL(send_delegate_, GetRetryTimeout(_, _))
+ .WillByDefault(
+ Return(clock_.ApproximateNow() +
+ 3 * QuicTime::Delta::FromMilliseconds(kInitialRttMs)));
+ }
+
+ protected:
+ quic::test::MockAlarmFactory alarm_factory_;
+ MockSendDelegate send_delegate_;
+ MockRandom random_;
+ MockClock clock_;
+ QuicConnectionArena arena_;
+ QuicPathValidator path_validator_;
+ QuicSocketAddress self_address_{QuicIpAddress::Any4(), 443};
+ QuicSocketAddress peer_address_{QuicIpAddress::Loopback4(), 443};
+ MockPacketWriter writer_;
+ MockQuicPathValidationContext* context_;
+ MockQuicPathValidationResultDelegate* result_delegate_;
+};
+
+TEST_F(QuicPathValidatorTest, PathValidationSuccessOnFirstRound) {
+ QuicPathFrameBuffer challenge_data;
+ EXPECT_CALL(send_delegate_,
+ SendPathChallenge(_, self_address_, peer_address_, &writer_))
+ .WillOnce(Invoke([&](const QuicPathFrameBuffer& payload,
+ const QuicSocketAddress&, const QuicSocketAddress&,
+ QuicPacketWriter*) {
+ memcpy(challenge_data.data(), payload.data(), payload.size());
+ return true;
+ }));
+ EXPECT_CALL(send_delegate_, GetRetryTimeout(peer_address_, &writer_));
+ path_validator_.StartValidingPath(
+ std::unique_ptr<QuicPathValidationContext>(context_),
+ std::unique_ptr<MockQuicPathValidationResultDelegate>(result_delegate_));
+ EXPECT_TRUE(path_validator_.HasPendingPathValidation());
+ EXPECT_CALL(*result_delegate_, OnPathValidationSuccess(_))
+ .WillOnce(Invoke([=](std::unique_ptr<QuicPathValidationContext> context) {
+ EXPECT_EQ(context.get(), context_);
+ }));
+ path_validator_.OnPathResponse(challenge_data, self_address_);
+ EXPECT_FALSE(path_validator_.HasPendingPathValidation());
+}
+
+TEST_F(QuicPathValidatorTest, RespondWithDifferentSelfAddress) {
+ QuicPathFrameBuffer challenge_data;
+ EXPECT_CALL(send_delegate_,
+ SendPathChallenge(_, self_address_, peer_address_, &writer_))
+ .WillOnce(Invoke([&](const QuicPathFrameBuffer payload,
+ const QuicSocketAddress&, const QuicSocketAddress&,
+ QuicPacketWriter*) {
+ memcpy(challenge_data.data(), payload.data(), payload.size());
+ return true;
+ }));
+ EXPECT_CALL(send_delegate_, GetRetryTimeout(peer_address_, &writer_));
+ path_validator_.StartValidingPath(
+ std::unique_ptr<QuicPathValidationContext>(context_),
+ std::unique_ptr<MockQuicPathValidationResultDelegate>(result_delegate_));
+
+ // Reception of a PATH_RESPONSE on a different self address should be ignored.
+ const QuicSocketAddress kAlternativeSelfAddress(QuicIpAddress::Any6(), 54321);
+ EXPECT_NE(kAlternativeSelfAddress, self_address_);
+ path_validator_.OnPathResponse(challenge_data, kAlternativeSelfAddress);
+
+ EXPECT_CALL(*result_delegate_, OnPathValidationSuccess(_))
+ .WillOnce(Invoke([=](std::unique_ptr<QuicPathValidationContext> context) {
+ EXPECT_EQ(context->self_address(), self_address_);
+ }));
+ path_validator_.OnPathResponse(challenge_data, self_address_);
+}
+
+TEST_F(QuicPathValidatorTest, RespondAfter1stRetry) {
+ QuicPathFrameBuffer challenge_data;
+ EXPECT_CALL(send_delegate_,
+ SendPathChallenge(_, self_address_, peer_address_, &writer_))
+ .WillOnce(Invoke([&](const QuicPathFrameBuffer& payload,
+ const QuicSocketAddress&, const QuicSocketAddress&,
+ QuicPacketWriter*) {
+ // Store up the 1st PATH_CHALLANGE payload.
+ memcpy(challenge_data.data(), payload.data(), payload.size());
+ return true;
+ }))
+ .WillOnce(Invoke([&](const QuicPathFrameBuffer& payload,
+ const QuicSocketAddress&, const QuicSocketAddress&,
+ QuicPacketWriter*) {
+ EXPECT_NE(payload, challenge_data);
+ return true;
+ }));
+ EXPECT_CALL(send_delegate_, GetRetryTimeout(peer_address_, &writer_))
+ .Times(2u);
+ path_validator_.StartValidingPath(
+ std::unique_ptr<QuicPathValidationContext>(context_),
+ std::unique_ptr<MockQuicPathValidationResultDelegate>(result_delegate_));
+
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(3 * kInitialRttMs));
+ random_.ChangeValue();
+ alarm_factory_.FireAlarm(
+ QuicPathValidatorPeer::retry_timer(&path_validator_));
+
+ EXPECT_CALL(*result_delegate_, OnPathValidationSuccess(_));
+ // Respond to the 1st PATH_CHALLENGE should complete the validation.
+ path_validator_.OnPathResponse(challenge_data, self_address_);
+ EXPECT_FALSE(path_validator_.HasPendingPathValidation());
+}
+
+TEST_F(QuicPathValidatorTest, RespondToRetryChallenge) {
+ QuicPathFrameBuffer challenge_data;
+ EXPECT_CALL(send_delegate_,
+ SendPathChallenge(_, self_address_, peer_address_, &writer_))
+ .WillOnce(Invoke([&](const QuicPathFrameBuffer& payload,
+ const QuicSocketAddress&, const QuicSocketAddress&,
+ QuicPacketWriter*) {
+ memcpy(challenge_data.data(), payload.data(), payload.size());
+ return true;
+ }))
+ .WillOnce(Invoke([&](const QuicPathFrameBuffer& payload,
+ const QuicSocketAddress&, const QuicSocketAddress&,
+ QuicPacketWriter*) {
+ EXPECT_NE(challenge_data, payload);
+ memcpy(challenge_data.data(), payload.data(), payload.size());
+ return true;
+ }));
+ EXPECT_CALL(send_delegate_, GetRetryTimeout(peer_address_, &writer_))
+ .Times(2u);
+ path_validator_.StartValidingPath(
+ std::unique_ptr<QuicPathValidationContext>(context_),
+ std::unique_ptr<MockQuicPathValidationResultDelegate>(result_delegate_));
+
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(3 * kInitialRttMs));
+ random_.ChangeValue();
+ alarm_factory_.FireAlarm(
+ QuicPathValidatorPeer::retry_timer(&path_validator_));
+
+ // Respond to the 2nd PATH_CHALLENGE should complete the validation.
+ EXPECT_CALL(*result_delegate_, OnPathValidationSuccess(_));
+ path_validator_.OnPathResponse(challenge_data, self_address_);
+ EXPECT_FALSE(path_validator_.HasPendingPathValidation());
+}
+
+TEST_F(QuicPathValidatorTest, ValidationTimeOut) {
+ EXPECT_CALL(send_delegate_,
+ SendPathChallenge(_, self_address_, peer_address_, &writer_))
+ .Times(3u)
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(send_delegate_, GetRetryTimeout(peer_address_, &writer_))
+ .Times(3u);
+ path_validator_.StartValidingPath(
+ std::unique_ptr<QuicPathValidationContext>(context_),
+ std::unique_ptr<MockQuicPathValidationResultDelegate>(result_delegate_));
+
+ QuicPathFrameBuffer challenge_data;
+ memset(challenge_data.data(), 'a', challenge_data.size());
+ // Reception of a PATH_RESPONSE with different payload should be ignored.
+ path_validator_.OnPathResponse(challenge_data, self_address_);
+
+ // Retry 3 times. The 3rd time should fail the validation.
+ EXPECT_CALL(*result_delegate_, OnPathValidationFailure(_))
+ .WillOnce(Invoke([=](std::unique_ptr<QuicPathValidationContext> context) {
+ EXPECT_EQ(context_, context.get());
+ }));
+ for (size_t i = 0; i <= QuicPathValidator::kMaxRetryTimes; ++i) {
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(3 * kInitialRttMs));
+ alarm_factory_.FireAlarm(
+ QuicPathValidatorPeer::retry_timer(&path_validator_));
+ }
+}
+
+TEST_F(QuicPathValidatorTest, SendPathChallengeError) {
+ EXPECT_CALL(send_delegate_,
+ SendPathChallenge(_, self_address_, peer_address_, &writer_))
+ .WillOnce(Invoke([&](const QuicPathFrameBuffer&, const QuicSocketAddress&,
+ const QuicSocketAddress&, QuicPacketWriter*) {
+ // Abandon this validation in the call stack shouldn't cause crash and
+ // should cancel the alarm.
+ path_validator_.CancelPathValidation();
+ return false;
+ }));
+ EXPECT_CALL(send_delegate_, GetRetryTimeout(peer_address_, &writer_))
+ .Times(0u);
+ path_validator_.StartValidingPath(
+ std::unique_ptr<QuicPathValidationContext>(context_),
+ std::unique_ptr<MockQuicPathValidationResultDelegate>(result_delegate_));
+ EXPECT_FALSE(path_validator_.HasPendingPathValidation());
+ EXPECT_FALSE(QuicPathValidatorPeer::retry_timer(&path_validator_)->IsSet());
+}
+
+} // namespace test
+} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h b/chromium/net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h
new file mode 100644
index 00000000000..b9d0a2d68a3
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_protocol_flags_list.h
@@ -0,0 +1,246 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// NOLINT(build/header_guard)
+// This file intentionally does not have header guards, it's intended to be
+// included multiple times, each time with a different definition of
+// QUIC_PROTOCOL_FLAG.
+
+#if defined(QUIC_PROTOCOL_FLAG)
+
+QUIC_PROTOCOL_FLAG(
+ bool,
+ quic_allow_chlo_buffering,
+ true,
+ "If true, allows packets to be buffered in anticipation of a "
+ "future CHLO, and allow CHLO packets to be buffered until next "
+ "iteration of the event loop.")
+
+QUIC_PROTOCOL_FLAG(bool,
+ quic_disable_pacing_for_perf_tests,
+ false,
+ "If true, disable pacing in QUIC")
+
+QUIC_PROTOCOL_FLAG(bool,
+ quic_enforce_single_packet_chlo,
+ true,
+ "If true, enforce that QUIC CHLOs fit in one packet")
+
+// Currently, this number is quite conservative. At a hypothetical 1000 qps,
+// this means that the longest time-wait list we should see is:
+// 200 seconds * 1000 qps = 200000.
+// Of course, there are usually many queries per QUIC connection, so we allow a
+// factor of 3 leeway.
+QUIC_PROTOCOL_FLAG(int64_t,
+ quic_time_wait_list_max_connections,
+ 600000,
+ "Maximum number of connections on the time-wait list. "
+ "A negative value implies no configured limit.")
+
+QUIC_PROTOCOL_FLAG(int64_t,
+ quic_time_wait_list_seconds,
+ 200,
+ "Time period for which a given connection_id should live in "
+ "the time-wait state.")
+
+QUIC_PROTOCOL_FLAG(double,
+ quic_bbr_cwnd_gain,
+ 2.0f,
+ "Congestion window gain for QUIC BBR during PROBE_BW phase.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_buffered_data_threshold,
+ 8 * 1024,
+ "If buffered data in QUIC stream is less than this "
+ "threshold, buffers all provided data or asks upper layer for more data")
+
+QUIC_PROTOCOL_FLAG(
+ uint64_t,
+ quic_send_buffer_max_data_slice_size,
+ 4 * 1024,
+ "Max size of data slice in bytes for QUIC stream send buffer.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_lumpy_pacing_size,
+ 2,
+ "Number of packets that the pacing sender allows in bursts during "
+ "pacing. This flag is ignored if a flow's estimated bandwidth is "
+ "lower than 1200 kbps.")
+
+QUIC_PROTOCOL_FLAG(
+ double,
+ quic_lumpy_pacing_cwnd_fraction,
+ 0.25f,
+ "Congestion window fraction that the pacing sender allows in bursts "
+ "during pacing.")
+
+QUIC_PROTOCOL_FLAG(int32_t,
+ quic_max_pace_time_into_future_ms,
+ 10,
+ "Max time that QUIC can pace packets into the future in ms.")
+
+QUIC_PROTOCOL_FLAG(
+ double,
+ quic_pace_time_into_future_srtt_fraction,
+ 0.125f, // One-eighth smoothed RTT
+ "Smoothed RTT fraction that a connection can pace packets into the future.")
+
+QUIC_PROTOCOL_FLAG(bool,
+ quic_export_write_path_stats_at_server,
+ false,
+ "If true, export detailed write path statistics at server.")
+
+QUIC_PROTOCOL_FLAG(bool,
+ quic_disable_version_negotiation_grease_randomness,
+ false,
+ "If true, use predictable version negotiation versions.")
+
+QUIC_PROTOCOL_FLAG(bool,
+ quic_enable_http3_grease_randomness,
+ true,
+ "If true, use random greased settings and frames.")
+
+QUIC_PROTOCOL_FLAG(int64_t,
+ quic_max_tracked_packet_count,
+ 10000,
+ "Maximum number of tracked packets.")
+
+QUIC_PROTOCOL_FLAG(
+ bool,
+ quic_client_convert_http_header_name_to_lowercase,
+ true,
+ "If true, HTTP request header names sent from QuicSpdyClientBase(and "
+ "descendents) will be automatically converted to lower case.")
+
+QUIC_PROTOCOL_FLAG(
+ bool,
+ quic_enable_http3_server_push,
+ false,
+ "If true, server push will be allowed in QUIC versions that use HTTP/3.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_bbr2_default_probe_bw_base_duration_ms,
+ 2000,
+ "The default minimum duration for BBRv2-native probes, in milliseconds.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_bbr2_default_probe_bw_max_rand_duration_ms,
+ 1000,
+ "The default upper bound of the random amount of BBRv2-native "
+ "probes, in milliseconds.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_bbr2_default_probe_rtt_period_ms,
+ 10000,
+ "The default period for entering PROBE_RTT, in milliseconds.")
+
+QUIC_PROTOCOL_FLAG(
+ double,
+ quic_bbr2_default_loss_threshold,
+ 0.02,
+ "The default loss threshold for QUIC BBRv2, should be a value "
+ "between 0 and 1.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_bbr2_default_startup_full_loss_count,
+ 8,
+ "The default minimum number of loss marking events to exit STARTUP.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_bbr2_default_probe_bw_full_loss_count,
+ 2,
+ "The default minimum number of loss marking events to exit PROBE_UP phase.")
+
+QUIC_PROTOCOL_FLAG(
+ double,
+ quic_bbr2_default_inflight_hi_headroom,
+ 0.15,
+ "The default fraction of unutilized headroom to try to leave in path "
+ "upon high loss.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_bbr2_default_initial_ack_height_filter_window,
+ 10,
+ "The default initial value of the max ack height filter's window length.")
+
+QUIC_PROTOCOL_FLAG(
+ double,
+ quic_ack_aggregation_bandwidth_threshold,
+ 1.0,
+ "If the bandwidth during ack aggregation is smaller than (estimated "
+ "bandwidth * this flag), consider the current aggregation completed "
+ "and starts a new one.")
+
+// TODO(b/153892665): Change the default value of
+// quic_anti_amplification_factor back to 3 when cert compression is
+// supported.
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_anti_amplification_factor,
+ 5,
+ 3,
+ "Anti-amplification factor. Before address validation, server will "
+ "send no more than factor times bytes received.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_max_buffered_crypto_bytes,
+ 16 * 1024, // 16 KB
+ "The maximum amount of CRYPTO frame data that can be buffered.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_max_aggressive_retransmittable_on_wire_ping_count,
+ 5,
+ "Maximum number of consecutive pings that can be sent with the "
+ "aggressive initial retransmittable on the wire timeout if there is "
+ "no new stream data received. After this limit, the timeout will be "
+ "doubled each ping until it exceeds the default ping timeout.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_max_retransmittable_on_wire_ping_count,
+ 1000,
+ "Maximum number of pings that can be sent with the retransmittable "
+ "on the wire timeout, over the lifetime of a connection. After this "
+ "limit, the timeout will be the default ping timeout.")
+
+QUIC_PROTOCOL_FLAG(int32_t,
+ quic_max_congestion_window,
+ 2000,
+ "The maximum congestion window in packets.")
+
+QUIC_PROTOCOL_FLAG(
+ int32_t,
+ quic_max_streams_window_divisor,
+ 2,
+ "The divisor that controls how often MAX_STREAMS frame is sent.")
+
+QUIC_PROTOCOL_FLAG(
+ uint64_t,
+ quic_key_update_confidentiality_limit,
+ 0,
+ "If non-zero and key update is allowed, the maximum number of "
+ "packets sent for each key phase before initiating a key update.")
+
+QUIC_PROTOCOL_FLAG(bool,
+ quic_disable_client_tls_zero_rtt,
+ false,
+ "If true, QUIC client with TLS will not try 0-RTT.")
+
+QUIC_PROTOCOL_FLAG(bool,
+ quic_disable_server_tls_resumption,
+ false,
+ "If true, QUIC server will disable TLS resumption by not "
+ "issuing or processing session tickets.")
+
+#endif
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_received_packet_manager.cc b/chromium/net/third_party/quiche/src/quic/core/quic_received_packet_manager.cc
index 9a84d975fd5..98f450cbf37 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_received_packet_manager.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_received_packet_manager.cc
@@ -26,8 +26,6 @@ namespace {
// against an ack loss
const size_t kMaxPacketsAfterNewMissing = 4;
-// One quarter RTT delay when doing ack decimation.
-const float kAckDecimationDelay = 0.25;
// One eighth RTT delay when doing ack decimation.
const float kShortAckDecimationDelay = 0.125;
} // namespace
@@ -266,8 +264,11 @@ void QuicReceivedPacketManager::MaybeUpdateAckTimeout(
return;
}
- MaybeUpdateAckTimeoutTo(
- now + GetMaxAckDelay(last_received_packet_number, *rtt_stats));
+ QuicTime updated_ack_time =
+ now + GetMaxAckDelay(last_received_packet_number, *rtt_stats);
+ if (!ack_timeout_.IsInitialized() || ack_timeout_ > updated_ack_time) {
+ ack_timeout_ = updated_ack_time;
+ }
}
void QuicReceivedPacketManager::ResetAckStates() {
@@ -277,12 +278,6 @@ void QuicReceivedPacketManager::ResetAckStates() {
last_sent_largest_acked_ = LargestAcked(ack_frame_);
}
-void QuicReceivedPacketManager::MaybeUpdateAckTimeoutTo(QuicTime time) {
- if (!ack_timeout_.IsInitialized() || ack_timeout_ > time) {
- ack_timeout_ = time;
- }
-}
-
bool QuicReceivedPacketManager::HasMissingPackets() const {
if (ack_frame_.packets.Empty()) {
return false;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.cc b/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.cc
index 4dc25828378..592faa14baa 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.cc
@@ -5,13 +5,18 @@
#include "net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h"
#include <algorithm>
+#include <cstddef>
#include <string>
#include "net/third_party/quiche/src/quic/core/congestion_control/general_loss_algorithm.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/pacing_sender.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
+#include "net/third_party/quiche/src/quic/core/frames/quic_ack_frequency_frame.h"
#include "net/third_party/quiche/src/quic/core/proto/cached_network_parameters_proto.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_stats.h"
+#include "net/third_party/quiche/src/quic/core/quic_constants.h"
+#include "net/third_party/quiche/src/quic/core/quic_packet_number.h"
+#include "net/third_party/quiche/src/quic/core/quic_transmission_info.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
@@ -140,6 +145,16 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
peer_max_ack_delay_ =
QuicTime::Delta::FromMilliseconds(config.ReceivedMaxAckDelayMs());
}
+ if (GetQuicReloadableFlag(quic_can_send_ack_frequency) &&
+ perspective == Perspective::IS_SERVER) {
+ if (config.HasReceivedMinAckDelayMs()) {
+ peer_min_ack_delay_ =
+ QuicTime::Delta::FromMilliseconds(config.ReceivedMinAckDelayMs());
+ }
+ if (config.HasClientSentConnectionOption(kAFF1, perspective)) {
+ use_smoothed_rtt_in_ack_delay_ = true;
+ }
+ }
if (config.HasClientSentConnectionOption(kMAD0, perspective)) {
rtt_stats_.set_ignore_max_ack_delay(true);
}
@@ -462,17 +477,40 @@ void QuicSentPacketManager::MaybeInvokeCongestionEvent(
}
void QuicSentPacketManager::MarkZeroRttPacketsForRetransmission() {
- QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
- for (QuicUnackedPacketMap::iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
- if (it->encryption_level == ENCRYPTION_ZERO_RTT) {
- if (it->in_flight) {
- // Remove 0-RTT packets and packets of the wrong version from flight,
- // because neither can be processed by the peer.
- unacked_packets_.RemoveFromInFlight(&*it);
+ if (unacked_packets_.use_circular_deque()) {
+ if (unacked_packets_.empty()) {
+ return;
+ }
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ QuicPacketNumber largest_sent_packet =
+ unacked_packets_.largest_sent_packet();
+ for (; packet_number <= largest_sent_packet; ++packet_number) {
+ QuicTransmissionInfo* transmission_info =
+ unacked_packets_.GetMutableTransmissionInfo(packet_number);
+ if (transmission_info->encryption_level == ENCRYPTION_ZERO_RTT) {
+ if (transmission_info->in_flight) {
+ // Remove 0-RTT packets and packets of the wrong version from flight,
+ // because neither can be processed by the peer.
+ unacked_packets_.RemoveFromInFlight(transmission_info);
+ }
+ if (unacked_packets_.HasRetransmittableFrames(*transmission_info)) {
+ MarkForRetransmission(packet_number, ALL_ZERO_RTT_RETRANSMISSION);
+ }
}
- if (unacked_packets_.HasRetransmittableFrames(*it)) {
- MarkForRetransmission(packet_number, ALL_ZERO_RTT_RETRANSMISSION);
+ }
+ } else {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ for (QuicUnackedPacketMap::iterator it = unacked_packets_.begin();
+ it != unacked_packets_.end(); ++it, ++packet_number) {
+ if (it->encryption_level == ENCRYPTION_ZERO_RTT) {
+ if (it->in_flight) {
+ // Remove 0-RTT packets and packets of the wrong version from
+ // flight, because neither can be processed by the peer.
+ unacked_packets_.RemoveFromInFlight(&*it);
+ }
+ if (unacked_packets_.HasRetransmittableFrames(*it)) {
+ MarkForRetransmission(packet_number, ALL_ZERO_RTT_RETRANSMISSION);
+ }
}
}
}
@@ -593,6 +631,11 @@ void QuicSentPacketManager::MarkForRetransmission(
HandleRetransmission(transmission_type, transmission_info);
+ // Get the latest transmission_info here as it can be invalidated after
+ // HandleRetransmission adding new sent packets into unacked_packets_.
+ transmission_info =
+ unacked_packets_.GetMutableTransmissionInfo(packet_number);
+
// Update packet state according to transmission type.
transmission_info->state =
QuicUtils::RetransmissionTypeToPacketState(transmission_type);
@@ -700,6 +743,32 @@ void QuicSentPacketManager::MarkPacketHandled(QuicPacketNumber packet_number,
info->state = ACKED;
}
+bool QuicSentPacketManager::CanSendAckFrequency() const {
+ return !peer_min_ack_delay_.IsInfinite() && handshake_finished_;
+}
+
+QuicAckFrequencyFrame QuicSentPacketManager::GetUpdatedAckFrequencyFrame()
+ const {
+ QuicAckFrequencyFrame frame;
+ if (!CanSendAckFrequency()) {
+ QUIC_BUG << "New AckFrequencyFrame is created while it shouldn't.";
+ return frame;
+ }
+
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_can_send_ack_frequency, 1, 3);
+ frame.packet_tolerance = kMaxRetransmittablePacketsBeforeAck;
+ auto rtt = use_smoothed_rtt_in_ack_delay_ ? rtt_stats_.SmoothedOrInitialRtt()
+ : rtt_stats_.MinOrInitialRtt();
+ frame.max_ack_delay = rtt * kAckDecimationDelay;
+ frame.max_ack_delay = std::max(frame.max_ack_delay, peer_min_ack_delay_);
+ // TODO(haoyuewang) Remove this once kDefaultMinAckDelayTimeMs is updated to
+ // 5 ms on the client side.
+ frame.max_ack_delay =
+ std::max(frame.max_ack_delay,
+ QuicTime::Delta::FromMilliseconds(kDefaultMinAckDelayTimeMs));
+ return frame;
+}
+
bool QuicSentPacketManager::OnPacketSent(
SerializedPacket* mutable_packet,
QuicTime sent_time,
@@ -810,19 +879,43 @@ void QuicSentPacketManager::RetransmitCryptoPackets() {
DCHECK_EQ(HANDSHAKE_MODE, GetRetransmissionMode());
++consecutive_crypto_retransmission_count_;
bool packet_retransmitted = false;
- QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
std::vector<QuicPacketNumber> crypto_retransmissions;
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
- // Only retransmit frames which are in flight, and therefore have been sent.
- if (!it->in_flight || it->state != OUTSTANDING ||
- !it->has_crypto_handshake ||
- !unacked_packets_.HasRetransmittableFrames(*it)) {
- continue;
+ if (unacked_packets_.use_circular_deque()) {
+ if (!unacked_packets_.empty()) {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ QuicPacketNumber largest_sent_packet =
+ unacked_packets_.largest_sent_packet();
+ for (; packet_number <= largest_sent_packet; ++packet_number) {
+ QuicTransmissionInfo* transmission_info =
+ unacked_packets_.GetMutableTransmissionInfo(packet_number);
+ // Only retransmit frames which are in flight, and therefore have been
+ // sent.
+ if (!transmission_info->in_flight ||
+ transmission_info->state != OUTSTANDING ||
+ !transmission_info->has_crypto_handshake ||
+ !unacked_packets_.HasRetransmittableFrames(*transmission_info)) {
+ continue;
+ }
+ packet_retransmitted = true;
+ crypto_retransmissions.push_back(packet_number);
+ ++pending_timer_transmission_count_;
+ }
+ }
+ } else {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
+ ++it, ++packet_number) {
+ // Only retransmit frames which are in flight, and therefore have been
+ // sent.
+ if (!it->in_flight || it->state != OUTSTANDING ||
+ !it->has_crypto_handshake ||
+ !unacked_packets_.HasRetransmittableFrames(*it)) {
+ continue;
+ }
+ packet_retransmitted = true;
+ crypto_retransmissions.push_back(packet_number);
+ ++pending_timer_transmission_count_;
}
- packet_retransmitted = true;
- crypto_retransmissions.push_back(packet_number);
- ++pending_timer_transmission_count_;
}
DCHECK(packet_retransmitted) << "No crypto packets found to retransmit.";
for (QuicPacketNumber retransmission : crypto_retransmissions) {
@@ -842,16 +935,38 @@ bool QuicSentPacketManager::MaybeRetransmitTailLossProbe() {
}
bool QuicSentPacketManager::MaybeRetransmitOldestPacket(TransmissionType type) {
- QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
- // Only retransmit frames which are in flight, and therefore have been sent.
- if (!it->in_flight || it->state != OUTSTANDING ||
- !unacked_packets_.HasRetransmittableFrames(*it)) {
- continue;
+ if (unacked_packets_.use_circular_deque()) {
+ if (!unacked_packets_.empty()) {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ QuicPacketNumber largest_sent_packet =
+ unacked_packets_.largest_sent_packet();
+ for (; packet_number <= largest_sent_packet; ++packet_number) {
+ QuicTransmissionInfo* transmission_info =
+ unacked_packets_.GetMutableTransmissionInfo(packet_number);
+ // Only retransmit frames which are in flight, and therefore have been
+ // sent.
+ if (!transmission_info->in_flight ||
+ transmission_info->state != OUTSTANDING ||
+ !unacked_packets_.HasRetransmittableFrames(*transmission_info)) {
+ continue;
+ }
+ MarkForRetransmission(packet_number, type);
+ return true;
+ }
+ }
+ } else {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
+ ++it, ++packet_number) {
+ // Only retransmit frames which are in flight, and therefore have been
+ // sent.
+ if (!it->in_flight || it->state != OUTSTANDING ||
+ !unacked_packets_.HasRetransmittableFrames(*it)) {
+ continue;
+ }
+ MarkForRetransmission(packet_number, type);
+ return true;
}
- MarkForRetransmission(packet_number, type);
- return true;
}
QUIC_DVLOG(1)
<< "No retransmittable packets, so RetransmitOldestPacket failed.";
@@ -863,16 +978,35 @@ void QuicSentPacketManager::RetransmitRtoPackets() {
QUIC_BUG_IF(pending_timer_transmission_count_ > 0)
<< "Retransmissions already queued:" << pending_timer_transmission_count_;
// Mark two packets for retransmission.
- QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
std::vector<QuicPacketNumber> retransmissions;
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
- if (it->state == OUTSTANDING &&
- unacked_packets_.HasRetransmittableFrames(*it) &&
- pending_timer_transmission_count_ < max_rto_packets_) {
- DCHECK(it->in_flight);
- retransmissions.push_back(packet_number);
- ++pending_timer_transmission_count_;
+ if (unacked_packets_.use_circular_deque()) {
+ if (!unacked_packets_.empty()) {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ QuicPacketNumber largest_sent_packet =
+ unacked_packets_.largest_sent_packet();
+ for (; packet_number <= largest_sent_packet; ++packet_number) {
+ QuicTransmissionInfo* transmission_info =
+ unacked_packets_.GetMutableTransmissionInfo(packet_number);
+ if (transmission_info->state == OUTSTANDING &&
+ unacked_packets_.HasRetransmittableFrames(*transmission_info) &&
+ pending_timer_transmission_count_ < max_rto_packets_) {
+ DCHECK(transmission_info->in_flight);
+ retransmissions.push_back(packet_number);
+ ++pending_timer_transmission_count_;
+ }
+ }
+ }
+ } else {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
+ ++it, ++packet_number) {
+ if (it->state == OUTSTANDING &&
+ unacked_packets_.HasRetransmittableFrames(*it) &&
+ pending_timer_transmission_count_ < max_rto_packets_) {
+ DCHECK(it->in_flight);
+ retransmissions.push_back(packet_number);
+ ++pending_timer_transmission_count_;
+ }
}
}
if (pending_timer_transmission_count_ > 0) {
@@ -908,19 +1042,42 @@ void QuicSentPacketManager::MaybeSendProbePackets() {
return;
}
}
- QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
std::vector<QuicPacketNumber> probing_packets;
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
- if (it->state == OUTSTANDING &&
- unacked_packets_.HasRetransmittableFrames(*it) &&
- (!supports_multiple_packet_number_spaces() ||
- unacked_packets_.GetPacketNumberSpace(it->encryption_level) ==
- packet_number_space)) {
- DCHECK(it->in_flight);
- probing_packets.push_back(packet_number);
- if (probing_packets.size() == pending_timer_transmission_count_) {
- break;
+ if (unacked_packets_.use_circular_deque()) {
+ if (!unacked_packets_.empty()) {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ QuicPacketNumber largest_sent_packet =
+ unacked_packets_.largest_sent_packet();
+ for (; packet_number <= largest_sent_packet; ++packet_number) {
+ QuicTransmissionInfo* transmission_info =
+ unacked_packets_.GetMutableTransmissionInfo(packet_number);
+ if (transmission_info->state == OUTSTANDING &&
+ unacked_packets_.HasRetransmittableFrames(*transmission_info) &&
+ (!supports_multiple_packet_number_spaces() ||
+ unacked_packets_.GetPacketNumberSpace(
+ transmission_info->encryption_level) == packet_number_space)) {
+ DCHECK(transmission_info->in_flight);
+ probing_packets.push_back(packet_number);
+ if (probing_packets.size() == pending_timer_transmission_count_) {
+ break;
+ }
+ }
+ }
+ }
+ } else {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
+ ++it, ++packet_number) {
+ if (it->state == OUTSTANDING &&
+ unacked_packets_.HasRetransmittableFrames(*it) &&
+ (!supports_multiple_packet_number_spaces() ||
+ unacked_packets_.GetPacketNumberSpace(it->encryption_level) ==
+ packet_number_space)) {
+ DCHECK(it->in_flight);
+ probing_packets.push_back(packet_number);
+ if (probing_packets.size() == pending_timer_transmission_count_) {
+ break;
+ }
}
}
}
@@ -976,21 +1133,48 @@ void QuicSentPacketManager::RetransmitDataOfSpaceIfAny(
// No in flight data of space.
return;
}
- QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
- if (it->state == OUTSTANDING &&
- unacked_packets_.HasRetransmittableFrames(*it) &&
- unacked_packets_.GetPacketNumberSpace(it->encryption_level) == space) {
- DCHECK(it->in_flight);
- if (GetQuicReloadableFlag(quic_fix_pto_pending_timer_count) &&
- pending_timer_transmission_count_ == 0) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_fix_pto_pending_timer_count);
- pending_timer_transmission_count_ = 1;
- }
- MarkForRetransmission(packet_number, PTO_RETRANSMISSION);
+ if (unacked_packets_.use_circular_deque()) {
+ if (unacked_packets_.empty()) {
return;
}
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ QuicPacketNumber largest_sent_packet =
+ unacked_packets_.largest_sent_packet();
+ for (; packet_number <= largest_sent_packet; ++packet_number) {
+ QuicTransmissionInfo* transmission_info =
+ unacked_packets_.GetMutableTransmissionInfo(packet_number);
+ if (transmission_info->state == OUTSTANDING &&
+ unacked_packets_.HasRetransmittableFrames(*transmission_info) &&
+ unacked_packets_.GetPacketNumberSpace(
+ transmission_info->encryption_level) == space) {
+ DCHECK(transmission_info->in_flight);
+ if (GetQuicReloadableFlag(quic_fix_pto_pending_timer_count) &&
+ pending_timer_transmission_count_ == 0) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_fix_pto_pending_timer_count);
+ pending_timer_transmission_count_ = 1;
+ }
+ MarkForRetransmission(packet_number, PTO_RETRANSMISSION);
+ return;
+ }
+ }
+ } else {
+ QuicPacketNumber packet_number = unacked_packets_.GetLeastUnacked();
+ for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
+ ++it, ++packet_number) {
+ if (it->state == OUTSTANDING &&
+ unacked_packets_.HasRetransmittableFrames(*it) &&
+ unacked_packets_.GetPacketNumberSpace(it->encryption_level) ==
+ space) {
+ DCHECK(it->in_flight);
+ if (GetQuicReloadableFlag(quic_fix_pto_pending_timer_count) &&
+ pending_timer_transmission_count_ == 0) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_fix_pto_pending_timer_count);
+ pending_timer_transmission_count_ = 1;
+ }
+ MarkForRetransmission(packet_number, PTO_RETRANSMISSION);
+ return;
+ }
+ }
}
}
@@ -1535,11 +1719,6 @@ void QuicSentPacketManager::SetInitialRtt(QuicTime::Delta rtt) {
QuicTime::Delta::FromMicroseconds(kMinInitialRoundTripTimeUs);
QuicTime::Delta max_rtt =
QuicTime::Delta::FromMicroseconds(kMaxInitialRoundTripTimeUs);
- if (GetQuicReloadableFlag(quic_cap_large_client_initial_rtt)) {
- // TODO(fayang): change the value of kMaxInitialRoundTripTimeUs when
- // deprecating quic_cap_large_client_initial_rtt.
- max_rtt = QuicTime::Delta::FromSeconds(1);
- }
rtt_stats_.set_initial_rtt(std::max(min_rtt, std::min(max_rtt, rtt)));
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h b/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h
index 6e36da9f6b5..df18f2a22c1 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h
@@ -22,6 +22,7 @@
#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_sustained_bandwidth_recorder.h"
+#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/core/quic_transmission_info.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h"
@@ -124,6 +125,10 @@ class QUIC_EXPORT_PRIVATE QuicSentPacketManager {
virtual void SetFromConfig(const QuicConfig& config);
+ void ReserveUnackedPacketsInitialCapacity(int initial_capacity) {
+ unacked_packets_.ReserveInitialCapacity(initial_capacity);
+ }
+
void ApplyConnectionOptions(const QuicTagVector& connection_options);
// Pass the CachedNetworkParameters to the send algorithm.
@@ -197,6 +202,10 @@ class QUIC_EXPORT_PRIVATE QuicSentPacketManager {
HasRetransmittableData has_retransmittable_data,
bool measure_rtt);
+ bool CanSendAckFrequency() const;
+
+ QuicAckFrequencyFrame GetUpdatedAckFrequencyFrame() const;
+
// Called when the retransmission timer expires and returns the retransmission
// mode.
RetransmissionTimeoutMode OnRetransmissionTimeout();
@@ -442,6 +451,11 @@ class QUIC_EXPORT_PRIVATE QuicSentPacketManager {
void OnUserAgentIdKnown() { loss_algorithm_->OnUserAgentIdKnown(); }
+ // Gets the earliest in flight packet sent time to calculate PTO. Also
+ // updates |packet_number_space| if a PTO timer should be armed.
+ QuicTime GetEarliestPacketSentTimeForPto(
+ PacketNumberSpace* packet_number_space) const;
+
bool give_sent_packet_to_debug_visitor_after_sent() const {
return give_sent_packet_to_debug_visitor_after_sent_;
}
@@ -504,7 +518,8 @@ class QUIC_EXPORT_PRIVATE QuicSentPacketManager {
// Request that |packet_number| be retransmitted after the other pending
// retransmissions. Does not add it to the retransmissions if it's already
- // a pending retransmission.
+ // a pending retransmission. Do not reuse iterator of the underlying
+ // unacked_packets_ after calling this function as it can be invalidated.
void MarkForRetransmission(QuicPacketNumber packet_number,
TransmissionType transmission_type);
@@ -540,11 +555,6 @@ class QUIC_EXPORT_PRIVATE QuicSentPacketManager {
// timeout.
bool ShouldAddMaxAckDelay(PacketNumberSpace space) const;
- // Gets the earliest in flight packet sent time to calculate PTO. Also
- // updates |packet_number_space| if a PTO timer should be armed.
- QuicTime GetEarliestPacketSentTimeForPto(
- PacketNumberSpace* packet_number_space) const;
-
// Returns true if application data should be used to arm PTO. Only used when
// multiple packet number space is enabled.
bool ShouldArmPtoForApplicationData() const;
@@ -650,6 +660,13 @@ class QUIC_EXPORT_PRIVATE QuicSentPacketManager {
// negotiation or subsequently by AckFrequencyFrame.
QuicTime::Delta peer_max_ack_delay_;
+ // Peer sends min_ack_delay in TransportParameter to advertise its support for
+ // AckFrequencyFrame.
+ QuicTime::Delta peer_min_ack_delay_ = QuicTime::Delta::Infinite();
+
+ // Use smoothed RTT for computing max_ack_delay in AckFrequency frame.
+ bool use_smoothed_rtt_in_ack_delay_ = false;
+
// The history of outstanding max_ack_delays sent to peer. Outstanding means
// a max_ack_delay is sent as part of the last acked AckFrequencyFrame or
// an unacked AckFrequencyFrame after that.
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager_test.cc
index c186f65099b..3975809ac09 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_sent_packet_manager_test.cc
@@ -7,16 +7,17 @@
#include <memory>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_ack_frequency_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
+#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_config_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_sent_packet_manager_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using testing::_;
using testing::AnyNumber;
@@ -68,7 +69,7 @@ class QuicSentPacketManagerTest : public QuicTest {
kDefaultLength, HAS_RETRANSMITTABLE_DATA));
SerializedPacket packet(CreatePacket(packet_number, false));
packet.retransmittable_frames.push_back(
- QuicFrame(QuicStreamFrame(1, false, 0, quiche::QuicheStringPiece())));
+ QuicFrame(QuicStreamFrame(1, false, 0, absl::string_view())));
packet.has_crypto_handshake = IS_HANDSHAKE;
manager_.OnPacketSent(&packet, clock_.Now(), HANDSHAKE_RETRANSMISSION,
HAS_RETRANSMITTABLE_DATA, true);
@@ -252,8 +253,8 @@ class QuicSentPacketManagerTest : public QuicTest {
PACKET_4BYTE_PACKET_NUMBER, nullptr, kDefaultLength,
false, false);
if (retransmittable) {
- packet.retransmittable_frames.push_back(QuicFrame(
- QuicStreamFrame(kStreamId, false, 0, quiche::QuicheStringPiece())));
+ packet.retransmittable_frames.push_back(
+ QuicFrame(QuicStreamFrame(kStreamId, false, 0, absl::string_view())));
}
return packet;
}
@@ -299,7 +300,7 @@ class QuicSentPacketManagerTest : public QuicTest {
kDefaultLength, HAS_RETRANSMITTABLE_DATA));
SerializedPacket packet(CreatePacket(packet_number, false));
packet.retransmittable_frames.push_back(
- QuicFrame(QuicStreamFrame(1, false, 0, quiche::QuicheStringPiece())));
+ QuicFrame(QuicStreamFrame(1, false, 0, absl::string_view())));
packet.has_crypto_handshake = IS_HANDSHAKE;
manager_.OnPacketSent(&packet, clock_.Now(), NOT_RETRANSMISSION,
HAS_RETRANSMITTABLE_DATA, true);
@@ -360,10 +361,10 @@ TEST_F(QuicSentPacketManagerTest, IsUnacked) {
SendDataPacket(1);
uint64_t unacked[] = {1};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
uint64_t retransmittable[] = {1};
VerifyRetransmittablePackets(retransmittable,
- QUICHE_ARRAYSIZE(retransmittable));
+ ABSL_ARRAYSIZE(retransmittable));
}
TEST_F(QuicSentPacketManagerTest, IsUnAckedRetransmit) {
@@ -372,7 +373,7 @@ TEST_F(QuicSentPacketManagerTest, IsUnAckedRetransmit) {
EXPECT_TRUE(QuicSentPacketManagerPeer::IsRetransmission(&manager_, 2));
uint64_t unacked[] = {1, 2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
std::vector<uint64_t> retransmittable = {1, 2};
VerifyRetransmittablePackets(&retransmittable[0], retransmittable.size());
}
@@ -392,7 +393,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAck) {
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
// Packet 1 is unacked, pending, but not retransmittable.
uint64_t unacked[] = {1};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
EXPECT_TRUE(manager_.HasInFlightPackets());
VerifyRetransmittablePackets(nullptr, 0);
}
@@ -415,7 +416,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAckBeforeSend) {
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
uint64_t unacked[] = {2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
// We do not know packet 2 is a spurious retransmission until it gets acked.
VerifyRetransmittablePackets(nullptr, 0);
EXPECT_EQ(0u, stats_.packets_spuriously_retransmitted);
@@ -430,7 +431,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenStopRetransmittingBeforeSend) {
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
uint64_t unacked[] = {1};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
EXPECT_EQ(0u, stats_.packets_spuriously_retransmitted);
}
@@ -452,7 +453,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAckPrevious) {
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
// 2 remains unacked, but no packets have retransmittable data.
uint64_t unacked[] = {2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
EXPECT_TRUE(manager_.HasInFlightPackets());
VerifyRetransmittablePackets(nullptr, 0);
// Ack 2 causes 2 be considered as spurious retransmission.
@@ -519,7 +520,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitThenAckPreviousThenNackRetransmit) {
ENCRYPTION_INITIAL));
uint64_t unacked[] = {2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
EXPECT_FALSE(manager_.HasInFlightPackets());
VerifyRetransmittablePackets(nullptr, 0);
@@ -551,7 +552,7 @@ TEST_F(QuicSentPacketManagerTest,
// Since 2 was marked for retransmit, when 1 is acked, 2 is kept for RTT.
uint64_t unacked[] = {2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
EXPECT_FALSE(manager_.HasInFlightPackets());
VerifyRetransmittablePackets(nullptr, 0);
@@ -588,7 +589,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckFirst) {
// 2 and 3 remain unacked, but no packets have retransmittable data.
uint64_t unacked[] = {2, 3};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
EXPECT_TRUE(manager_.HasInFlightPackets());
VerifyRetransmittablePackets(nullptr, 0);
@@ -599,7 +600,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckFirst) {
.WillOnce(Return(false))
.WillRepeatedly(Return(true));
uint64_t acked[] = {3, 4};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(4), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(3), QuicPacketNumber(5));
@@ -609,7 +610,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckFirst) {
ENCRYPTION_INITIAL));
uint64_t unacked2[] = {2};
- VerifyUnackedPackets(unacked2, QUICHE_ARRAYSIZE(unacked2));
+ VerifyUnackedPackets(unacked2, ABSL_ARRAYSIZE(unacked2));
EXPECT_TRUE(manager_.HasInFlightPackets());
SendDataPacket(5);
@@ -630,7 +631,7 @@ TEST_F(QuicSentPacketManagerTest, RetransmitTwiceThenAckFirst) {
ENCRYPTION_INITIAL));
uint64_t unacked3[] = {2};
- VerifyUnackedPackets(unacked3, QUICHE_ARRAYSIZE(unacked3));
+ VerifyUnackedPackets(unacked3, ABSL_ARRAYSIZE(unacked3));
EXPECT_FALSE(manager_.HasInFlightPackets());
// Spurious retransmission is detected when packet 3 gets acked. We cannot
// know packet 2 is a spurious until it gets acked.
@@ -679,7 +680,7 @@ TEST_F(QuicSentPacketManagerTest, AckOriginalTransmission) {
// Ack 3, which causes SpuriousRetransmitDetected to be called.
{
uint64_t acked[] = {3};
- ExpectAcksAndLosses(false, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(false, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
EXPECT_CALL(*loss_algorithm, DetectLosses(_, _, _, _, _, _));
EXPECT_CALL(*loss_algorithm,
SpuriousLossDetected(_, _, _, QuicPacketNumber(3),
@@ -725,7 +726,7 @@ TEST_F(QuicSentPacketManagerTest, AckAckAndUpdateRtt) {
// Now ack the ack and expect an RTT update.
uint64_t acked[] = {1, 2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(2),
QuicTime::Delta::FromMilliseconds(5), clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(3));
@@ -738,7 +739,7 @@ TEST_F(QuicSentPacketManagerTest, AckAckAndUpdateRtt) {
// Now ack the ack and expect only an RTT update.
uint64_t acked2[] = {3};
- ExpectAcksAndLosses(true, acked2, QUICHE_ARRAYSIZE(acked2), nullptr, 0);
+ ExpectAcksAndLosses(true, acked2, ABSL_ARRAYSIZE(acked2), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(3), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(4));
@@ -885,8 +886,8 @@ TEST_F(QuicSentPacketManagerTest, TailLossProbeTimeout) {
SendDataPacket(5);
uint64_t acked[] = {4, 5};
uint64_t lost[] = {1, 2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), lost,
- QUICHE_ARRAYSIZE(lost));
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), lost,
+ ABSL_ARRAYSIZE(lost));
// Frames in all packets are acked.
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
// Notify session that stream frame in packets 1 and 2 get lost although
@@ -1021,8 +1022,8 @@ TEST_F(QuicSentPacketManagerTest, CryptoHandshakeTimeout) {
// Crypto packets remain in flight, so any that aren't acked will be lost.
uint64_t acked[] = {3, 4, 5, 8, 9};
uint64_t lost[] = {1, 2, 6};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), lost,
- QUICHE_ARRAYSIZE(lost));
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), lost,
+ ABSL_ARRAYSIZE(lost));
EXPECT_CALL(notifier_, OnFrameLost(_)).Times(3);
EXPECT_CALL(notifier_, HasUnackedCryptoData()).WillRepeatedly(Return(false));
manager_.OnAckFrameStart(QuicPacketNumber(9), QuicTime::Delta::Infinite(),
@@ -1054,7 +1055,7 @@ TEST_F(QuicSentPacketManagerTest, CryptoHandshakeSpuriousRetransmission) {
// Now ack the second crypto packet, and ensure the first gets removed, but
// the third does not.
uint64_t acked[] = {2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
EXPECT_CALL(notifier_, HasUnackedCryptoData()).WillRepeatedly(Return(false));
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
manager_.OnAckFrameStart(QuicPacketNumber(2), QuicTime::Delta::Infinite(),
@@ -1066,7 +1067,7 @@ TEST_F(QuicSentPacketManagerTest, CryptoHandshakeSpuriousRetransmission) {
EXPECT_FALSE(manager_.HasUnackedCryptoPackets());
uint64_t unacked[] = {1, 3};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
}
TEST_F(QuicSentPacketManagerTest, CryptoHandshakeTimeoutUnsentDataPacket) {
@@ -1113,14 +1114,14 @@ TEST_F(QuicSentPacketManagerTest,
manager_.NeuterUnencryptedPackets();
EXPECT_FALSE(manager_.HasUnackedCryptoPackets());
uint64_t unacked[] = {1, 2, 3};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
EXPECT_FALSE(manager_.HasUnackedCryptoPackets());
EXPECT_FALSE(manager_.HasInFlightPackets());
// Ensure both packets get discarded when packet 2 is acked.
uint64_t acked[] = {3};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(3), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(3), QuicPacketNumber(4));
@@ -1609,7 +1610,7 @@ TEST_F(QuicSentPacketManagerTest, GetTransmissionTimeSpuriousRTO) {
// Ack a packet before the first RTO and ensure the RTO timeout returns to the
// original value and OnRetransmissionTimeout is not called or reverted.
uint64_t acked[] = {1, 2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(2), QuicTime::Delta::Zero(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(3));
@@ -2309,8 +2310,8 @@ TEST_F(QuicSentPacketManagerTest, OnAckRangeSlowPath) {
// Ack [5, 7), [10, 12), [15, 17).
uint64_t acked1[] = {5, 6, 10, 11, 15, 16};
uint64_t lost1[] = {1, 2, 3, 4, 7, 8, 9, 12, 13};
- ExpectAcksAndLosses(true, acked1, QUICHE_ARRAYSIZE(acked1), lost1,
- QUICHE_ARRAYSIZE(lost1));
+ ExpectAcksAndLosses(true, acked1, ABSL_ARRAYSIZE(acked1), lost1,
+ ABSL_ARRAYSIZE(lost1));
EXPECT_CALL(notifier_, OnFrameLost(_)).Times(AnyNumber());
manager_.OnAckFrameStart(QuicPacketNumber(16), QuicTime::Delta::Infinite(),
clock_.Now());
@@ -2325,7 +2326,7 @@ TEST_F(QuicSentPacketManagerTest, OnAckRangeSlowPath) {
// Ack [4, 8), [9, 13), [14, 21).
uint64_t acked2[] = {4, 7, 9, 12, 14, 17, 18, 19, 20};
- ExpectAcksAndLosses(true, acked2, QUICHE_ARRAYSIZE(acked2), nullptr, 0);
+ ExpectAcksAndLosses(true, acked2, ABSL_ARRAYSIZE(acked2), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(20), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(14), QuicPacketNumber(21));
@@ -2344,8 +2345,8 @@ TEST_F(QuicSentPacketManagerTest, TolerateReneging) {
// Ack [5, 7), [10, 12), [15, 17).
uint64_t acked1[] = {5, 6, 10, 11, 15, 16};
uint64_t lost1[] = {1, 2, 3, 4, 7, 8, 9, 12, 13};
- ExpectAcksAndLosses(true, acked1, QUICHE_ARRAYSIZE(acked1), lost1,
- QUICHE_ARRAYSIZE(lost1));
+ ExpectAcksAndLosses(true, acked1, ABSL_ARRAYSIZE(acked1), lost1,
+ ABSL_ARRAYSIZE(lost1));
EXPECT_CALL(notifier_, OnFrameLost(_)).Times(AnyNumber());
manager_.OnAckFrameStart(QuicPacketNumber(16), QuicTime::Delta::Infinite(),
clock_.Now());
@@ -2358,7 +2359,7 @@ TEST_F(QuicSentPacketManagerTest, TolerateReneging) {
// Making sure reneged ACK does not harm. Ack [4, 8), [9, 13).
uint64_t acked2[] = {4, 7, 9, 12};
- ExpectAcksAndLosses(true, acked2, QUICHE_ARRAYSIZE(acked2), nullptr, 0);
+ ExpectAcksAndLosses(true, acked2, ABSL_ARRAYSIZE(acked2), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(12), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(9), QuicPacketNumber(13));
@@ -2479,7 +2480,7 @@ TEST_F(QuicSentPacketManagerTest, MultiplePacketNumberSpaces) {
APPLICATION_DATA));
// Ack all packets.
uint64_t acked[] = {4, 6, 7, 8};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(8), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(4), QuicPacketNumber(9));
@@ -2549,7 +2550,7 @@ TEST_F(QuicSentPacketManagerTest,
// Packet 1 gets acked in the wrong packet number space. Since packet 1 has
// been acked in the correct packet number space, tolerate it.
uint64_t acked[] = {2, 3};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(3), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(4));
@@ -2591,7 +2592,7 @@ TEST_F(QuicSentPacketManagerTest, PacketInLimbo) {
// Received Ack of packets 1, 3 and 4.
uint64_t acked[] = {1, 3, 4};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(4), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(3), QuicPacketNumber(5));
@@ -2604,8 +2605,8 @@ TEST_F(QuicSentPacketManagerTest, PacketInLimbo) {
uint64_t loss[] = {2};
// Verify packet 2 is detected lost.
EXPECT_CALL(notifier_, OnFrameLost(_)).Times(1);
- ExpectAcksAndLosses(true, acked2, QUICHE_ARRAYSIZE(acked2), loss,
- QUICHE_ARRAYSIZE(loss));
+ ExpectAcksAndLosses(true, acked2, ABSL_ARRAYSIZE(acked2), loss,
+ ABSL_ARRAYSIZE(loss));
manager_.OnAckFrameStart(QuicPacketNumber(6), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(3), QuicPacketNumber(7));
@@ -2696,7 +2697,7 @@ TEST_F(QuicSentPacketManagerTest, ComputingProbeTimeout) {
// Received ACK for packets 1 and 2.
uint64_t acked[] = {1, 2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(2), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(3));
@@ -2874,7 +2875,7 @@ TEST_F(QuicSentPacketManagerTest, PtoTimeoutIncludesMaxAckDelay) {
// Received ACK for packets 1 and 2.
uint64_t acked[] = {1, 2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(2), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(3));
@@ -3091,7 +3092,7 @@ TEST_F(QuicSentPacketManagerTest, RtoNotInFlightPacket) {
}
QuicSentPacketManagerPeer::SetMaxTailLossProbes(&manager_, 2);
// Send SHLO.
- QuicStreamFrame crypto_frame(1, false, 0, quiche::QuicheStringPiece());
+ QuicStreamFrame crypto_frame(1, false, 0, absl::string_view());
SendCryptoPacket(1);
// Send data packet.
SendDataPacket(2, ENCRYPTION_FORWARD_SECURE);
@@ -3473,7 +3474,7 @@ TEST_F(QuicSentPacketManagerTest, ComputingProbeTimeoutByLeftEdge) {
// Received ACK for packets 1 and 2.
uint64_t acked[] = {1, 2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(2), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(3));
@@ -3554,7 +3555,7 @@ TEST_F(QuicSentPacketManagerTest, ComputingProbeTimeoutByLeftEdge2) {
// Received ACK for packets 1 and 2.
uint64_t acked[] = {1, 2};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
manager_.OnAckFrameStart(QuicPacketNumber(2), QuicTime::Delta::Infinite(),
clock_.Now());
manager_.OnAckRange(QuicPacketNumber(1), QuicPacketNumber(3));
@@ -4025,7 +4026,7 @@ TEST_F(QuicSentPacketManagerTest, EarliestSentTimeNotInitializedWhenPtoFires) {
// Received ACK for HANDSHAKE packets.
uint64_t acked[] = {2, 3, 4};
- ExpectAcksAndLosses(true, acked, QUICHE_ARRAYSIZE(acked), nullptr, 0);
+ ExpectAcksAndLosses(true, acked, ABSL_ARRAYSIZE(acked), nullptr, 0);
clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(90));
manager_.OnAckFrameStart(QuicPacketNumber(4), QuicTime::Delta::Infinite(),
clock_.Now());
@@ -4419,6 +4420,62 @@ TEST_F(QuicSentPacketManagerTest, ClearDataInMessageFrameAfterPacketSent) {
EXPECT_EQ(message_frame->message_length, 0);
}
+TEST_F(QuicSentPacketManagerTest, BuildAckFrequencyFrame) {
+ SetQuicReloadableFlag(quic_can_send_ack_frequency, true);
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
+ QuicConfig config;
+ QuicConfigPeer::SetReceivedMinAckDelayMs(&config, /*min_ack_delay_ms=*/1);
+ manager_.SetFromConfig(config);
+ manager_.SetHandshakeConfirmed();
+
+ // Set up RTTs.
+ auto* rtt_stats = const_cast<RttStats*>(manager_.GetRttStats());
+ rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(80),
+ /*ack_delay=*/QuicTime::Delta::Zero(),
+ /*now=*/QuicTime::Zero());
+ // Make sure srtt and min_rtt are different.
+ rtt_stats->UpdateRtt(
+ QuicTime::Delta::FromMilliseconds(160),
+ /*ack_delay=*/QuicTime::Delta::Zero(),
+ /*now=*/QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(24));
+
+ auto frame = manager_.GetUpdatedAckFrequencyFrame();
+ EXPECT_EQ(frame.max_ack_delay,
+ std::max(rtt_stats->min_rtt() * 0.25,
+ QuicTime::Delta::FromMilliseconds(1u)));
+ EXPECT_EQ(frame.packet_tolerance, 10u);
+}
+
+TEST_F(QuicSentPacketManagerTest, BuildAckFrequencyFrameWithSRTT) {
+ SetQuicReloadableFlag(quic_can_send_ack_frequency, true);
+ EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
+ EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
+ QuicConfig config;
+ QuicConfigPeer::SetReceivedMinAckDelayMs(&config, /*min_ack_delay_ms=*/1);
+ QuicTagVector quic_tag_vector;
+ quic_tag_vector.push_back(kAFF1); // SRTT enabling tag.
+ QuicConfigPeer::SetReceivedConnectionOptions(&config, quic_tag_vector);
+ manager_.SetFromConfig(config);
+ manager_.SetHandshakeConfirmed();
+
+ // Set up RTTs.
+ auto* rtt_stats = const_cast<RttStats*>(manager_.GetRttStats());
+ rtt_stats->UpdateRtt(QuicTime::Delta::FromMilliseconds(80),
+ /*ack_delay=*/QuicTime::Delta::Zero(),
+ /*now=*/QuicTime::Zero());
+ // Make sure srtt and min_rtt are different.
+ rtt_stats->UpdateRtt(
+ QuicTime::Delta::FromMilliseconds(160),
+ /*ack_delay=*/QuicTime::Delta::Zero(),
+ /*now=*/QuicTime::Zero() + QuicTime::Delta::FromMilliseconds(24));
+
+ auto frame = manager_.GetUpdatedAckFrequencyFrame();
+ EXPECT_EQ(frame.max_ack_delay,
+ std::max(rtt_stats->SmoothedOrInitialRtt() * 0.25,
+ QuicTime::Delta::FromMilliseconds(1u)));
+}
+
} // namespace
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_session.cc b/chromium/net/third_party/quiche/src/quic/core/quic_session.cc
index 4737902ef2c..6b4c5170f12 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_session.cc
@@ -8,6 +8,8 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/core/frames/quic_ack_frequency_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_flow_controller.h"
@@ -23,7 +25,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_server_stats.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_stack_trace.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using spdy::SpdyPriority;
@@ -65,14 +66,14 @@ QuicSession::QuicSession(
connection->transport_version(),
kDefaultMaxStreamsPerConnection,
config_.GetMaxBidirectionalStreamsToSend()),
- v99_streamid_manager_(perspective(),
- connection->version(),
- this,
- 0,
- num_expected_unidirectional_static_streams,
- config_.GetMaxBidirectionalStreamsToSend(),
- config_.GetMaxUnidirectionalStreamsToSend() +
- num_expected_unidirectional_static_streams),
+ ietf_streamid_manager_(perspective(),
+ connection->version(),
+ this,
+ 0,
+ num_expected_unidirectional_static_streams,
+ config_.GetMaxBidirectionalStreamsToSend(),
+ config_.GetMaxUnidirectionalStreamsToSend() +
+ num_expected_unidirectional_static_streams),
num_draining_streams_(0),
num_outgoing_draining_streams_(0),
num_static_streams_(0),
@@ -137,6 +138,11 @@ void QuicSession::Initialize() {
connection_->OnSuccessfulVersionNegotiation();
}
+ if (GetQuicReloadableFlag(quic_key_update_supported) &&
+ GetMutableCryptoStream()->KeyUpdateSupportedLocally()) {
+ config_.SetKeyUpdateSupportedLocally();
+ }
+
if (QuicVersionUsesCryptoFrames(transport_version())) {
return;
}
@@ -276,6 +282,15 @@ void QuicSession::OnHandshakePacketSent() {
GetMutableCryptoStream()->OnHandshakePacketSent();
}
+std::unique_ptr<QuicDecrypter>
+QuicSession::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ return GetMutableCryptoStream()->AdvanceKeysAndCreateCurrentOneRttDecrypter();
+}
+
+std::unique_ptr<QuicEncrypter> QuicSession::CreateCurrentOneRttEncrypter() {
+ return GetMutableCryptoStream()->CreateCurrentOneRttEncrypter();
+}
+
void QuicSession::PendingStreamOnRstStream(const QuicRstStreamFrame& frame) {
DCHECK(VersionUsesHttp3(transport_version()));
QuicStreamId stream_id = frame.stream_id;
@@ -343,7 +358,7 @@ void QuicSession::OnGoAway(const QuicGoAwayFrame& /*frame*/) {
transport_goaway_received_ = true;
}
-void QuicSession::OnMessageReceived(quiche::QuicheStringPiece message) {
+void QuicSession::OnMessageReceived(absl::string_view message) {
QUIC_DVLOG(1) << ENDPOINT << "Received message, length: " << message.length()
<< ", " << message;
}
@@ -634,9 +649,16 @@ bool QuicSession::WillingAndAbleToWrite() const {
// 3) If the crypto or headers streams are blocked, or
// 4) connection is not flow control blocked and there are write blocked
// streams.
- if (QuicVersionUsesCryptoFrames(transport_version()) &&
- HasPendingHandshake()) {
- return true;
+ if (QuicVersionUsesCryptoFrames(transport_version())) {
+ if (HasPendingHandshake()) {
+ return true;
+ }
+ if (GetQuicReloadableFlag(quic_fix_willing_and_able_to_write2)) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_fix_willing_and_able_to_write2);
+ if (!IsEncryptionEstablished()) {
+ return false;
+ }
+ }
}
if (control_frame_manager_.WillingToWrite() ||
!streams_with_pending_retransmission_.empty()) {
@@ -705,9 +727,10 @@ QuicConsumedData QuicSession::WritevData(
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level) {
+ absl::optional<EncryptionLevel> level) {
DCHECK(connection_->connected())
<< ENDPOINT << "Try to write stream data when connection is closed.";
+ DCHECK(!use_write_or_buffer_data_at_level_ || level.has_value());
if (!IsEncryptionEstablished() &&
!QuicUtils::IsCryptoStreamId(transport_version(), id)) {
// Do not let streams write without encryption. The calling stream will end
@@ -726,9 +749,14 @@ QuicConsumedData QuicSession::WritevData(
SetTransmissionType(type);
const auto current_level = connection()->encryption_level();
- if (level.has_value()) {
- connection()->SetDefaultEncryptionLevel(level.value());
+ if (!use_encryption_level_context()) {
+ if (level.has_value()) {
+ connection()->SetDefaultEncryptionLevel(level.value());
+ }
}
+ QuicConnection::ScopedEncryptionLevelContext context(
+ use_encryption_level_context() ? connection() : nullptr,
+ use_encryption_level_context() ? level.value() : NUM_ENCRYPTION_LEVELS);
QuicConsumedData data =
connection_->SendStreamData(id, write_length, offset, state);
@@ -738,8 +766,11 @@ QuicConsumedData QuicSession::WritevData(
}
// Restore the encryption level.
- if (level.has_value()) {
- connection()->SetDefaultEncryptionLevel(current_level);
+ if (!use_encryption_level_context()) {
+ // Restore the encryption level.
+ if (level.has_value()) {
+ connection()->SetDefaultEncryptionLevel(current_level);
+ }
}
return data;
@@ -763,11 +794,17 @@ size_t QuicSession::SendCryptoData(EncryptionLevel level,
}
SetTransmissionType(type);
const auto current_level = connection()->encryption_level();
- connection_->SetDefaultEncryptionLevel(level);
+ if (!use_encryption_level_context()) {
+ connection_->SetDefaultEncryptionLevel(level);
+ }
+ QuicConnection::ScopedEncryptionLevelContext context(
+ use_encryption_level_context() ? connection() : nullptr, level);
const auto bytes_consumed =
connection_->SendCryptoData(level, write_length, offset);
- // Restores encryption level.
- connection_->SetDefaultEncryptionLevel(current_level);
+ if (!use_encryption_level_context()) {
+ // Restores encryption level.
+ connection_->SetDefaultEncryptionLevel(current_level);
+ }
return bytes_consumed;
}
@@ -782,7 +819,19 @@ bool QuicSession::WriteControlFrame(const QuicFrame& frame,
TransmissionType type) {
DCHECK(connection()->connected())
<< ENDPOINT << "Try to write control frames when connection is closed.";
+ if (connection_->encrypted_control_frames()) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_encrypted_control_frames);
+ if (!IsEncryptionEstablished()) {
+ QUIC_BUG << ENDPOINT << "Tried to send control frame " << frame
+ << " before encryption is established.";
+ return false;
+ }
+ }
SetTransmissionType(type);
+ QuicConnection::ScopedEncryptionLevelContext context(
+ use_encryption_level_context() ? connection() : nullptr,
+ use_encryption_level_context() ? GetEncryptionLevelToSendApplicationData()
+ : NUM_ENCRYPTION_LEVELS);
return connection_->SendControlFrame(frame);
}
@@ -790,15 +839,26 @@ void QuicSession::SendRstStream(QuicStreamId id,
QuicRstStreamErrorCode error,
QuicStreamOffset bytes_written,
bool send_rst_only) {
- if (connection()->connected()) {
- QuicConnection::ScopedPacketFlusher flusher(connection());
- MaybeSendRstStreamFrame(id, error, bytes_written);
- if (!send_rst_only) {
- MaybeSendStopSendingFrame(id, error);
- }
+ DCHECK(!split_up_send_rst());
+ if (!connection()->connected()) {
+ return;
+ }
- connection_->OnStreamReset(id, error);
+ QuicConnection::ScopedPacketFlusher flusher(connection());
+ if (!VersionHasIetfQuicFrames(transport_version()) ||
+ QuicUtils::GetStreamType(id, perspective(), IsIncomingStream(id),
+ version()) != READ_UNIDIRECTIONAL) {
+ control_frame_manager_.WriteOrBufferRstStream(id, error, bytes_written);
+ }
+ if (!send_rst_only) {
+ if (VersionHasIetfQuicFrames(transport_version()) &&
+ QuicUtils::GetStreamType(id, perspective(), IsIncomingStream(id),
+ version()) != WRITE_UNIDIRECTIONAL) {
+ control_frame_manager_.WriteOrBufferStopSending(error, id);
+ }
}
+
+ connection_->OnStreamReset(id, error);
}
void QuicSession::ResetStream(QuicStreamId id, QuicRstStreamErrorCode error) {
@@ -815,23 +875,37 @@ void QuicSession::ResetStream(QuicStreamId id, QuicRstStreamErrorCode error) {
return;
}
- SendRstStream(id, error, 0, /*send_rst_only = */ false);
+ if (split_up_send_rst()) {
+ QuicConnection::ScopedPacketFlusher flusher(connection());
+ MaybeSendStopSendingFrame(id, error);
+ MaybeSendRstStreamFrame(id, error, 0);
+ } else {
+ SendRstStream(id, error, 0, /*send_rst_only = */ false);
+ }
}
void QuicSession::MaybeSendRstStreamFrame(QuicStreamId id,
QuicRstStreamErrorCode error,
QuicStreamOffset bytes_written) {
- DCHECK(connection()->connected());
+ DCHECK(split_up_send_rst());
+ if (!connection()->connected()) {
+ return;
+ }
if (!VersionHasIetfQuicFrames(transport_version()) ||
QuicUtils::GetStreamType(id, perspective(), IsIncomingStream(id),
version()) != READ_UNIDIRECTIONAL) {
control_frame_manager_.WriteOrBufferRstStream(id, error, bytes_written);
}
+
+ connection_->OnStreamReset(id, error);
}
void QuicSession::MaybeSendStopSendingFrame(QuicStreamId id,
QuicRstStreamErrorCode error) {
- DCHECK(connection()->connected());
+ DCHECK(split_up_send_rst());
+ if (!connection()->connected()) {
+ return;
+ }
if (VersionHasIetfQuicFrames(transport_version()) &&
QuicUtils::GetStreamType(id, perspective(), IsIncomingStream(id),
version()) != WRITE_UNIDIRECTIONAL) {
@@ -841,14 +915,25 @@ void QuicSession::MaybeSendStopSendingFrame(QuicStreamId id,
void QuicSession::SendGoAway(QuicErrorCode error_code,
const std::string& reason) {
- // GOAWAY frame is not supported in v99.
+ // GOAWAY frame is not supported in IETF QUIC.
DCHECK(!VersionHasIetfQuicFrames(transport_version()));
if (transport_goaway_sent_) {
return;
}
transport_goaway_sent_ = true;
- control_frame_manager_.WriteOrBufferGoAway(
- error_code, stream_id_manager_.largest_peer_created_stream_id(), reason);
+ if (GetQuicReloadableFlag(quic_goaway_with_max_stream_id)) {
+ DCHECK_EQ(perspective(), Perspective::IS_SERVER);
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_goaway_with_max_stream_id, 2, 2);
+ control_frame_manager_.WriteOrBufferGoAway(
+ error_code,
+ QuicUtils::GetMaxClientInitiatedBidirectionalStreamId(
+ transport_version()),
+ reason);
+ } else {
+ control_frame_manager_.WriteOrBufferGoAway(
+ error_code, stream_id_manager_.largest_peer_created_stream_id(),
+ reason);
+ }
}
void QuicSession::SendBlocked(QuicStreamId id) {
@@ -942,7 +1027,7 @@ void QuicSession::OnStreamClosed(QuicStreamId stream_id) {
if (IsIncomingStream(stream_id)) {
// Stream Id manager is only interested in peer initiated stream IDs.
if (VersionHasIetfQuicFrames(transport_version())) {
- v99_streamid_manager_.OnStreamClosed(stream_id);
+ ietf_streamid_manager_.OnStreamClosed(stream_id);
}
return;
}
@@ -956,7 +1041,7 @@ void QuicSession::ClosePendingStream(QuicStreamId stream_id) {
DCHECK(VersionHasIetfQuicFrames(transport_version()));
pending_stream_map_.erase(stream_id);
if (connection_->connected()) {
- v99_streamid_manager_.OnStreamClosed(stream_id);
+ ietf_streamid_manager_.OnStreamClosed(stream_id);
}
}
@@ -991,7 +1076,7 @@ void QuicSession::OnFinalByteOffsetReceived(
}
if (IsIncomingStream(stream_id)) {
if (VersionHasIetfQuicFrames(transport_version())) {
- v99_streamid_manager_.OnStreamClosed(stream_id);
+ ietf_streamid_manager_.OnStreamClosed(stream_id);
}
} else if (!VersionHasIetfQuicFrames(transport_version())) {
OnCanCreateNewOutgoingStream(false);
@@ -1038,14 +1123,14 @@ void QuicSession::OnConfigNegotiated() {
}
if (was_zero_rtt_rejected_ &&
max_streams <
- v99_streamid_manager_.outgoing_bidirectional_stream_count()) {
+ ietf_streamid_manager_.outgoing_bidirectional_stream_count()) {
connection_->CloseConnection(
QUIC_ZERO_RTT_UNRETRANSMITTABLE,
quiche::QuicheStrCat(
"Server rejected 0-RTT, aborting because new bidirectional "
"initial stream limit ",
max_streams, " is less than current open streams: ",
- v99_streamid_manager_.outgoing_bidirectional_stream_count()),
+ ietf_streamid_manager_.outgoing_bidirectional_stream_count()),
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}
@@ -1054,7 +1139,7 @@ void QuicSession::OnConfigNegotiated() {
<< max_streams;
if (perspective_ == Perspective::IS_CLIENT &&
max_streams <
- v99_streamid_manager_.max_outgoing_bidirectional_streams()) {
+ ietf_streamid_manager_.max_outgoing_bidirectional_streams()) {
connection_->CloseConnection(
was_zero_rtt_rejected_ ? QUIC_ZERO_RTT_REJECTION_LIMIT_REDUCED
: QUIC_ZERO_RTT_RESUMPTION_LIMIT_REDUCED,
@@ -1064,11 +1149,11 @@ void QuicSession::OnConfigNegotiated() {
: "",
"new bidirectional limit ", max_streams,
" decreases the current limit: ",
- v99_streamid_manager_.max_outgoing_bidirectional_streams()),
+ ietf_streamid_manager_.max_outgoing_bidirectional_streams()),
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}
- if (v99_streamid_manager_.MaybeAllowNewOutgoingBidirectionalStreams(
+ if (ietf_streamid_manager_.MaybeAllowNewOutgoingBidirectionalStreams(
max_streams)) {
OnCanCreateNewOutgoingStream(/*unidirectional = */ false);
}
@@ -1080,20 +1165,20 @@ void QuicSession::OnConfigNegotiated() {
if (was_zero_rtt_rejected_ &&
max_streams <
- v99_streamid_manager_.outgoing_unidirectional_stream_count()) {
+ ietf_streamid_manager_.outgoing_unidirectional_stream_count()) {
connection_->CloseConnection(
QUIC_ZERO_RTT_UNRETRANSMITTABLE,
quiche::QuicheStrCat(
"Server rejected 0-RTT, aborting because new unidirectional "
"initial stream limit ",
max_streams, " is less than current open streams: ",
- v99_streamid_manager_.outgoing_unidirectional_stream_count()),
+ ietf_streamid_manager_.outgoing_unidirectional_stream_count()),
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}
if (max_streams <
- v99_streamid_manager_.max_outgoing_unidirectional_streams()) {
+ ietf_streamid_manager_.max_outgoing_unidirectional_streams()) {
connection_->CloseConnection(
was_zero_rtt_rejected_ ? QUIC_ZERO_RTT_REJECTION_LIMIT_REDUCED
: QUIC_ZERO_RTT_RESUMPTION_LIMIT_REDUCED,
@@ -1103,14 +1188,14 @@ void QuicSession::OnConfigNegotiated() {
: "",
"new unidirectional limit ", max_streams,
" decreases the current limit: ",
- v99_streamid_manager_.max_outgoing_unidirectional_streams()),
+ ietf_streamid_manager_.max_outgoing_unidirectional_streams()),
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}
QUIC_DVLOG(1) << ENDPOINT
<< "Setting Unidirectional outgoing_max_streams_ to "
<< max_streams;
- if (v99_streamid_manager_.MaybeAllowNewOutgoingUnidirectionalStreams(
+ if (ietf_streamid_manager_.MaybeAllowNewOutgoingUnidirectionalStreams(
max_streams)) {
OnCanCreateNewOutgoingStream(/*unidirectional = */ true);
}
@@ -1179,9 +1264,9 @@ void QuicSession::OnConfigNegotiated() {
}
if (VersionHasIetfQuicFrames(transport_version())) {
- v99_streamid_manager_.SetMaxOpenIncomingBidirectionalStreams(
+ ietf_streamid_manager_.SetMaxOpenIncomingBidirectionalStreams(
config_.GetMaxBidirectionalStreamsToSend());
- v99_streamid_manager_.SetMaxOpenIncomingUnidirectionalStreams(
+ ietf_streamid_manager_.SetMaxOpenIncomingUnidirectionalStreams(
config_.GetMaxUnidirectionalStreamsToSend());
} else {
// A small number of additional incoming streams beyond the limit should be
@@ -1635,6 +1720,16 @@ QuicErrorCode QuicSession::ProcessTransportParameters(
error_details);
}
+void QuicSession::OnHandshakeCallbackDone() {
+ if (!connection_->connected()) {
+ return;
+ }
+
+ if (!connection()->is_processing_packet()) {
+ connection()->MaybeProcessUndecryptablePackets();
+ }
+}
+
void QuicSession::OnCryptoHandshakeMessageSent(
const CryptoHandshakeMessage& /*message*/) {}
@@ -1693,14 +1788,14 @@ void QuicSession::ActivateStream(std::unique_ptr<QuicStream> stream) {
QuicStreamId QuicSession::GetNextOutgoingBidirectionalStreamId() {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.GetNextOutgoingBidirectionalStreamId();
+ return ietf_streamid_manager_.GetNextOutgoingBidirectionalStreamId();
}
return stream_id_manager_.GetNextOutgoingStreamId();
}
QuicStreamId QuicSession::GetNextOutgoingUnidirectionalStreamId() {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.GetNextOutgoingUnidirectionalStreamId();
+ return ietf_streamid_manager_.GetNextOutgoingUnidirectionalStreamId();
}
return stream_id_manager_.GetNextOutgoingStreamId();
}
@@ -1715,11 +1810,11 @@ bool QuicSession::CanOpenNextOutgoingBidirectionalStream() {
return false;
}
} else {
- if (!v99_streamid_manager_.CanOpenNextOutgoingBidirectionalStream()) {
+ if (!ietf_streamid_manager_.CanOpenNextOutgoingBidirectionalStream()) {
if (is_configured_) {
// Send STREAM_BLOCKED after config negotiated.
control_frame_manager_.WriteOrBufferStreamsBlocked(
- v99_streamid_manager_.max_outgoing_bidirectional_streams(),
+ ietf_streamid_manager_.max_outgoing_bidirectional_streams(),
/*unidirectional=*/false);
}
return false;
@@ -1739,13 +1834,13 @@ bool QuicSession::CanOpenNextOutgoingUnidirectionalStream() {
if (!VersionHasIetfQuicFrames(transport_version())) {
return stream_id_manager_.CanOpenNextOutgoingStream();
}
- if (v99_streamid_manager_.CanOpenNextOutgoingUnidirectionalStream()) {
+ if (ietf_streamid_manager_.CanOpenNextOutgoingUnidirectionalStream()) {
return true;
}
if (is_configured_) {
// Send STREAM_BLOCKED after config negotiated.
control_frame_manager_.WriteOrBufferStreamsBlocked(
- v99_streamid_manager_.max_outgoing_unidirectional_streams(),
+ ietf_streamid_manager_.max_outgoing_unidirectional_streams(),
/*unidirectional=*/true);
}
return false;
@@ -1754,7 +1849,7 @@ bool QuicSession::CanOpenNextOutgoingUnidirectionalStream() {
QuicStreamCount QuicSession::GetAdvertisedMaxIncomingBidirectionalStreams()
const {
DCHECK(VersionHasIetfQuicFrames(transport_version()));
- return v99_streamid_manager_.advertised_max_incoming_bidirectional_streams();
+ return ietf_streamid_manager_.advertised_max_incoming_bidirectional_streams();
}
QuicStream* QuicSession::GetOrCreateStream(const QuicStreamId stream_id) {
@@ -1800,7 +1895,7 @@ void QuicSession::StreamDraining(QuicStreamId stream_id, bool unidirectional) {
DCHECK(QuicContainsKey(stream_map_, stream_id));
QUIC_DVLOG(1) << ENDPOINT << "Stream " << stream_id << " is draining";
if (VersionHasIetfQuicFrames(transport_version())) {
- v99_streamid_manager_.OnStreamClosed(stream_id);
+ ietf_streamid_manager_.OnStreamClosed(stream_id);
} else {
stream_id_manager_.OnStreamClosed(
/*is_incoming=*/IsIncomingStream(stream_id));
@@ -1816,7 +1911,7 @@ bool QuicSession::MaybeIncreaseLargestPeerStreamId(
const QuicStreamId stream_id) {
if (VersionHasIetfQuicFrames(transport_version())) {
std::string error_details;
- if (v99_streamid_manager_.MaybeIncreaseLargestPeerStreamId(
+ if (ietf_streamid_manager_.MaybeIncreaseLargestPeerStreamId(
stream_id, &error_details)) {
return true;
}
@@ -1871,7 +1966,7 @@ QuicStreamId QuicSession::GetLargestPeerCreatedStreamId(
bool unidirectional) const {
// This method is only used in IETF QUIC.
DCHECK(VersionHasIetfQuicFrames(transport_version()));
- return v99_streamid_manager_.GetLargestPeerCreatedStreamId(unidirectional);
+ return ietf_streamid_manager_.GetLargestPeerCreatedStreamId(unidirectional);
}
void QuicSession::DeleteConnection() {
@@ -1901,7 +1996,7 @@ bool QuicSession::IsClosedStream(QuicStreamId id) {
}
if (VersionHasIetfQuicFrames(transport_version())) {
- return !v99_streamid_manager_.IsAvailableStream(id);
+ return !ietf_streamid_manager_.IsAvailableStream(id);
}
return !stream_id_manager_.IsAvailableStream(id);
@@ -1964,6 +2059,10 @@ void QuicSession::SendPing() {
control_frame_manager_.WritePing();
}
+void QuicSession::SendAckFrequency(const QuicAckFrequencyFrame& frame) {
+ control_frame_manager_.WriteOrBufferAckFrequency(frame);
+}
+
bool QuicSession::IsConnectionFlowControlBlocked() const {
return flow_controller_.IsBlocked();
}
@@ -1983,14 +2082,14 @@ bool QuicSession::IsStreamFlowControlBlocked() {
size_t QuicSession::MaxAvailableBidirectionalStreams() const {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.GetMaxAllowdIncomingBidirectionalStreams();
+ return ietf_streamid_manager_.GetMaxAllowdIncomingBidirectionalStreams();
}
return stream_id_manager_.MaxAvailableStreams();
}
size_t QuicSession::MaxAvailableUnidirectionalStreams() const {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.GetMaxAllowdIncomingUnidirectionalStreams();
+ return ietf_streamid_manager_.GetMaxAllowdIncomingUnidirectionalStreams();
}
return stream_id_manager_.MaxAvailableStreams();
}
@@ -2002,7 +2101,7 @@ bool QuicSession::IsIncomingStream(QuicStreamId id) const {
return stream_id_manager_.IsIncomingStream(id);
}
-void QuicSession::OnStreamDoneWaitingForAcks(QuicStreamId id) {
+void QuicSession::MaybeCloseZombieStream(QuicStreamId id) {
auto it = stream_map_.find(id);
if (it == stream_map_.end()) {
return;
@@ -2303,6 +2402,10 @@ MessageResult QuicSession::SendMessage(QuicMemSliceSpan message, bool flush) {
if (!IsEncryptionEstablished()) {
return {MESSAGE_STATUS_ENCRYPTION_NOT_ESTABLISHED, 0};
}
+ QuicConnection::ScopedEncryptionLevelContext context(
+ use_encryption_level_context() ? connection() : nullptr,
+ use_encryption_level_context() ? GetEncryptionLevelToSendApplicationData()
+ : NUM_ENCRYPTION_LEVELS);
MessageStatus result =
connection_->SendMessage(last_message_id_ + 1, message, flush);
if (result == MESSAGE_STATUS_SUCCESS) {
@@ -2340,14 +2443,14 @@ void QuicSession::SendStopSending(QuicRstStreamErrorCode code,
QuicStreamId QuicSession::next_outgoing_bidirectional_stream_id() const {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.next_outgoing_bidirectional_stream_id();
+ return ietf_streamid_manager_.next_outgoing_bidirectional_stream_id();
}
return stream_id_manager_.next_outgoing_stream_id();
}
QuicStreamId QuicSession::next_outgoing_unidirectional_stream_id() const {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.next_outgoing_unidirectional_stream_id();
+ return ietf_streamid_manager_.next_outgoing_unidirectional_stream_id();
}
return stream_id_manager_.next_outgoing_stream_id();
}
@@ -2355,9 +2458,9 @@ QuicStreamId QuicSession::next_outgoing_unidirectional_stream_id() const {
bool QuicSession::OnMaxStreamsFrame(const QuicMaxStreamsFrame& frame) {
const bool allow_new_streams =
frame.unidirectional
- ? v99_streamid_manager_.MaybeAllowNewOutgoingUnidirectionalStreams(
+ ? ietf_streamid_manager_.MaybeAllowNewOutgoingUnidirectionalStreams(
frame.stream_count)
- : v99_streamid_manager_.MaybeAllowNewOutgoingBidirectionalStreams(
+ : ietf_streamid_manager_.MaybeAllowNewOutgoingBidirectionalStreams(
frame.stream_count);
if (allow_new_streams) {
OnCanCreateNewOutgoingStream(frame.unidirectional);
@@ -2368,7 +2471,7 @@ bool QuicSession::OnMaxStreamsFrame(const QuicMaxStreamsFrame& frame) {
bool QuicSession::OnStreamsBlockedFrame(const QuicStreamsBlockedFrame& frame) {
std::string error_details;
- if (v99_streamid_manager_.OnStreamsBlockedFrame(frame, &error_details)) {
+ if (ietf_streamid_manager_.OnStreamsBlockedFrame(frame, &error_details)) {
return true;
}
connection_->CloseConnection(
@@ -2379,25 +2482,25 @@ bool QuicSession::OnStreamsBlockedFrame(const QuicStreamsBlockedFrame& frame) {
size_t QuicSession::max_open_incoming_bidirectional_streams() const {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.GetMaxAllowdIncomingBidirectionalStreams();
+ return ietf_streamid_manager_.GetMaxAllowdIncomingBidirectionalStreams();
}
return stream_id_manager_.max_open_incoming_streams();
}
size_t QuicSession::max_open_incoming_unidirectional_streams() const {
if (VersionHasIetfQuicFrames(transport_version())) {
- return v99_streamid_manager_.GetMaxAllowdIncomingUnidirectionalStreams();
+ return ietf_streamid_manager_.GetMaxAllowdIncomingUnidirectionalStreams();
}
return stream_id_manager_.max_open_incoming_streams();
}
-std::vector<quiche::QuicheStringPiece>::const_iterator QuicSession::SelectAlpn(
- const std::vector<quiche::QuicheStringPiece>& alpns) const {
+std::vector<absl::string_view>::const_iterator QuicSession::SelectAlpn(
+ const std::vector<absl::string_view>& alpns) const {
const std::string alpn = AlpnForVersion(connection()->version());
return std::find(alpns.cbegin(), alpns.cend(), alpn);
}
-void QuicSession::OnAlpnSelected(quiche::QuicheStringPiece alpn) {
+void QuicSession::OnAlpnSelected(absl::string_view alpn) {
QUIC_DLOG(INFO) << (perspective() == Perspective::IS_SERVER ? "Server: "
: "Client: ")
<< "ALPN selected: " << alpn;
@@ -2433,5 +2536,9 @@ void QuicSession::PerformActionOnActiveStreams(
}
}
+EncryptionLevel QuicSession::GetEncryptionLevelToSendApplicationData() const {
+ return connection_->framer().GetEncryptionLevelToSendApplicationData();
+}
+
#undef ENDPOINT // undef for jumbo builds
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_session.h b/chromium/net/third_party/quiche/src/quic/core/quic_session.h
index f5e01f85157..e454892ac5c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_session.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_session.h
@@ -14,6 +14,9 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
+#include "net/third_party/quiche/src/quic/core/frames/quic_ack_frequency_frame.h"
#include "net/third_party/quiche/src/quic/core/handshaker_delegate_interface.h"
#include "net/third_party/quiche/src/quic/core/legacy_quic_stream_id_manager.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
@@ -32,9 +35,8 @@
#include "net/third_party/quiche/src/quic/core/uber_quic_stream_id_manager.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -98,7 +100,7 @@ class QUIC_EXPORT_PRIVATE QuicSession
void OnCryptoFrame(const QuicCryptoFrame& frame) override;
void OnRstStream(const QuicRstStreamFrame& frame) override;
void OnGoAway(const QuicGoAwayFrame& frame) override;
- void OnMessageReceived(quiche::QuicheStringPiece message) override;
+ void OnMessageReceived(absl::string_view message) override;
void OnHandshakeDoneReceived() override;
void OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override;
void OnBlockedFrame(const QuicBlockedFrame& frame) override;
@@ -122,6 +124,7 @@ class QUIC_EXPORT_PRIVATE QuicSession
// Adds a connection level WINDOW_UPDATE frame.
void OnAckNeedsRetransmittableFrame() override;
void SendPing() override;
+ void SendAckFrequency(const QuicAckFrequencyFrame& frame) override;
bool WillingAndAbleToWrite() const override;
std::string GetStreamsInfoForLogging() const override;
void OnPathDegrading() override;
@@ -134,6 +137,11 @@ class QUIC_EXPORT_PRIVATE QuicSession
void OnPacketDecrypted(EncryptionLevel level) override;
void OnOneRttPacketAcknowledged() override;
void OnHandshakePacketSent() override;
+ void OnKeyUpdate(KeyUpdateReason /*reason*/) override {}
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
+ void BeforeConnectionCloseSent() override {}
// QuicStreamFrameDataProducer
WriteStreamDataResult WriteStreamData(QuicStreamId id,
@@ -213,6 +221,8 @@ class QUIC_EXPORT_PRIVATE QuicSession
// Called by stream to send RST_STREAM (and STOP_SENDING in IETF QUIC).
// if |send_rst_only|, STOP_SENDING will not be sent for IETF QUIC.
+ // TODO(b/170233449): Delete this method when flag quic_split_up_send_rst_2 is
+ // deprecated.
virtual void SendRstStream(QuicStreamId id,
QuicRstStreamErrorCode error,
QuicStreamOffset bytes_written,
@@ -267,6 +277,7 @@ class QUIC_EXPORT_PRIVATE QuicSession
QuicErrorCode ProcessTransportParameters(const TransportParameters& params,
bool is_resumption,
std::string* error_details) override;
+ void OnHandshakeCallbackDone() override;
// Implement StreamDelegateInterface.
void OnStreamError(QuicErrorCode error_code,
@@ -288,13 +299,12 @@ class QUIC_EXPORT_PRIVATE QuicSession
// indicating if the fin bit was consumed. This does not indicate the data
// has been sent on the wire: it may have been turned into a packet and queued
// if the socket was unexpectedly blocked.
- QuicConsumedData WritevData(
- QuicStreamId id,
- size_t write_length,
- QuicStreamOffset offset,
- StreamSendingState state,
- TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level) override;
+ QuicConsumedData WritevData(QuicStreamId id,
+ size_t write_length,
+ QuicStreamOffset offset,
+ StreamSendingState state,
+ TransmissionType type,
+ absl::optional<EncryptionLevel> level) override;
size_t SendCryptoData(EncryptionLevel level,
size_t write_length,
@@ -330,6 +340,8 @@ class QUIC_EXPORT_PRIVATE QuicSession
return connection_->connection_id();
}
+ bool split_up_send_rst() const { return split_up_send_rst_; }
+
// Returns the number of currently open streams, excluding static streams, and
// never counting unfinished streams.
size_t GetNumActiveStreams() const;
@@ -340,11 +352,8 @@ class QUIC_EXPORT_PRIVATE QuicSession
// WINDOW_UPDATE arrives.
virtual void MarkConnectionLevelWriteBlocked(QuicStreamId id);
- // Called when stream |id| is done waiting for acks either because all data
- // gets acked or is not interested in data being acked (which happens when
- // a stream is reset because of an error).
- // TODO(b/136274541): rename to CloseZombieStreams.
- void OnStreamDoneWaitingForAcks(QuicStreamId id);
+ // Called to close zombie stream |id|.
+ void MaybeCloseZombieStream(QuicStreamId id);
// Returns true if there is pending handshake data in the crypto stream.
// TODO(ianswett): Make this private or remove.
@@ -452,12 +461,12 @@ class QUIC_EXPORT_PRIVATE QuicSession
// Provided a list of ALPNs offered by the client, selects an ALPN from the
// list, or alpns.end() if none of the ALPNs are acceptable.
- virtual std::vector<quiche::QuicheStringPiece>::const_iterator SelectAlpn(
- const std::vector<quiche::QuicheStringPiece>& alpns) const;
+ virtual std::vector<absl::string_view>::const_iterator SelectAlpn(
+ const std::vector<absl::string_view>& alpns) const;
// Called when the ALPN of the connection is established for a connection that
// uses TLS handshake.
- virtual void OnAlpnSelected(quiche::QuicheStringPiece alpn);
+ virtual void OnAlpnSelected(absl::string_view alpn);
// Called on clients by the crypto handshaker to provide application state
// necessary for sending application data in 0-RTT. The state provided here is
@@ -474,7 +483,20 @@ class QUIC_EXPORT_PRIVATE QuicSession
return true;
}
- const quiche::QuicheOptional<std::string> user_agent_id() const {
+ // Does actual work of sending RESET_STREAM, if the stream type allows.
+ // Also informs the connection so that pending stream frames can be flushed.
+ virtual void MaybeSendRstStreamFrame(QuicStreamId id,
+ QuicRstStreamErrorCode error,
+ QuicStreamOffset bytes_written);
+
+ // Sends a STOP_SENDING frame if the stream type allows.
+ virtual void MaybeSendStopSendingFrame(QuicStreamId id,
+ QuicRstStreamErrorCode error);
+
+ // Returns the encryption level to send application data.
+ EncryptionLevel GetEncryptionLevelToSendApplicationData() const;
+
+ const absl::optional<std::string> user_agent_id() const {
return user_agent_id_;
}
@@ -491,6 +513,15 @@ class QUIC_EXPORT_PRIVATE QuicSession
return liveness_testing_in_progress_;
}
+ bool use_write_or_buffer_data_at_level() const {
+ return use_write_or_buffer_data_at_level_;
+ }
+
+ bool use_encryption_level_context() const {
+ return connection_->use_encryption_level_context() &&
+ use_write_or_buffer_data_at_level_;
+ }
+
protected:
using StreamMap = QuicHashMap<QuicStreamId, std::unique_ptr<QuicStream>>;
@@ -557,9 +588,6 @@ class QUIC_EXPORT_PRIVATE QuicSession
StreamMap& stream_map() { return stream_map_; }
- // TODO(b/136274541): remove this getter and only expose GetNumActiveStreams()
- size_t stream_map_size() const { return stream_map_.size(); }
-
size_t pending_streams_size() const { return pending_stream_map_.size(); }
ClosedStreams* closed_streams() { return &closed_streams_; }
@@ -618,6 +646,8 @@ class QUIC_EXPORT_PRIVATE QuicSession
return num_outgoing_draining_streams_;
}
+ size_t num_draining_streams() const { return num_draining_streams_; }
+
// Processes the stream type information of |pending| depending on
// different kinds of sessions' own rules. Returns true if the pending stream
// is converted into a normal stream.
@@ -717,14 +747,6 @@ class QUIC_EXPORT_PRIVATE QuicSession
// stream.
void PendingStreamOnRstStream(const QuicRstStreamFrame& frame);
- // Does actual work of sending RESET_STREAM, if the stream type allows.
- void MaybeSendRstStreamFrame(QuicStreamId id,
- QuicRstStreamErrorCode error,
- QuicStreamOffset bytes_written);
-
- // Sends a STOP_SENDING frame if the stream type allows.
- void MaybeSendStopSendingFrame(QuicStreamId id, QuicRstStreamErrorCode error);
-
// Keep track of highest received byte offset of locally closed streams, while
// waiting for a definitive final highest offset from the peer.
QuicHashMap<QuicStreamId, QuicStreamOffset>
@@ -761,7 +783,7 @@ class QUIC_EXPORT_PRIVATE QuicSession
LegacyQuicStreamIdManager stream_id_manager_;
// Manages stream IDs for version99/IETF QUIC
- UberQuicStreamIdManager v99_streamid_manager_;
+ UberQuicStreamIdManager ietf_streamid_manager_;
// A counter for streams which have sent and received FIN but waiting for
// application to consume data.
@@ -818,7 +840,7 @@ class QUIC_EXPORT_PRIVATE QuicSession
// list may be a superset of the connection framer's supported versions.
ParsedQuicVersionVector supported_versions_;
- quiche::QuicheOptional<std::string> user_agent_id_;
+ absl::optional<std::string> user_agent_id_;
// If true, write_blocked_streams_ uses HTTP2 (tree-style) priority write
// scheduler.
@@ -837,6 +859,12 @@ class QUIC_EXPORT_PRIVATE QuicSession
// This indicates a liveness testing is in progress, and push back the
// creation of new outgoing bidirectional streams.
bool liveness_testing_in_progress_;
+
+ const bool split_up_send_rst_ =
+ GetQuicReloadableFlag(quic_split_up_send_rst_2);
+
+ const bool use_write_or_buffer_data_at_level_ =
+ GetQuicReloadableFlag(quic_use_write_or_buffer_data_at_level);
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_session_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_session_test.cc
index e5b6cff3a03..06225086ed7 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_session_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_session_test.cc
@@ -9,6 +9,9 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
@@ -37,10 +40,7 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_send_buffer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using spdy::kV3HighestPriority;
using spdy::SpdyPriority;
@@ -70,6 +70,13 @@ class TestCryptoStream : public QuicCryptoStream, public QuicCryptoHandshaker {
params_->cipher_suite = 1;
}
+ void EstablishZeroRttEncryption() {
+ encryption_established_ = true;
+ session()->connection()->SetEncrypter(
+ ENCRYPTION_ZERO_RTT,
+ std::make_unique<NullEncrypter>(session()->perspective()));
+ }
+
void OnHandshakeMessage(const CryptoHandshakeMessage& /*message*/) override {
encryption_established_ = true;
one_rtt_keys_available_ = true;
@@ -104,6 +111,9 @@ class TestCryptoStream : public QuicCryptoStream, public QuicCryptoHandshaker {
session()->config()->ProcessPeerHello(msg, CLIENT, &error_details);
}
EXPECT_THAT(error, IsQuicNoError());
+ session()->OnNewEncryptionKeyAvailable(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(session()->perspective()));
session()->OnConfigNegotiated();
if (session()->connection()->version().handshake_protocol ==
PROTOCOL_TLS1_3) {
@@ -140,6 +150,15 @@ class TestCryptoStream : public QuicCryptoStream, public QuicCryptoHandshaker {
}
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> /*application_state*/) override {}
+ MOCK_METHOD(bool, KeyUpdateSupportedLocally, (), (const, override));
+ MOCK_METHOD(std::unique_ptr<QuicDecrypter>,
+ AdvanceKeysAndCreateCurrentOneRttDecrypter,
+ (),
+ (override));
+ MOCK_METHOD(std::unique_ptr<QuicEncrypter>,
+ CreateCurrentOneRttEncrypter,
+ (),
+ (override));
MOCK_METHOD(void, OnCanWrite, (), (override));
bool HasPendingCryptoRetransmission() const override { return false; }
@@ -198,6 +217,8 @@ class TestSession : public QuicSession {
writev_consumes_all_data_(false),
uses_pending_streams_(false),
num_incoming_streams_created_(0) {
+ EXPECT_CALL(*GetMutableCryptoStream(), KeyUpdateSupportedLocally())
+ .WillRepeatedly(Return(false));
Initialize();
this->connection()->SetEncrypter(
ENCRYPTION_FORWARD_SECURE,
@@ -293,13 +314,12 @@ class TestSession : public QuicSession {
return GetNumActiveStreams() > 0;
}
- QuicConsumedData WritevData(
- QuicStreamId id,
- size_t write_length,
- QuicStreamOffset offset,
- StreamSendingState state,
- TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level) override {
+ QuicConsumedData WritevData(QuicStreamId id,
+ size_t write_length,
+ QuicStreamOffset offset,
+ StreamSendingState state,
+ TransmissionType type,
+ absl::optional<EncryptionLevel> level) override {
bool fin = state != NO_FIN;
QuicConsumedData consumed(write_length, fin);
if (!writev_consumes_all_data_) {
@@ -330,7 +350,8 @@ class TestSession : public QuicSession {
MakeIOVector("not empty", &iov);
QuicStreamPeer::SendBuffer(stream).SaveStreamData(&iov, 1, 0, 9);
QuicConsumedData consumed =
- WritevData(stream->id(), 9, 0, FIN, NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ WritevData(stream->id(), 9, 0, FIN, NOT_RETRANSMISSION,
+ GetEncryptionLevelToSendApplicationData());
QuicStreamPeer::SendBuffer(stream).OnStreamDataConsumed(
consumed.bytes_consumed);
return consumed;
@@ -347,7 +368,7 @@ class TestSession : public QuicSession {
QuicConsumedData SendLargeFakeData(QuicStream* stream, int bytes) {
DCHECK(writev_consumes_all_data_);
return WritevData(stream->id(), bytes, 0, FIN, NOT_RETRANSMISSION,
- QUICHE_NULLOPT);
+ GetEncryptionLevelToSendApplicationData());
}
bool UsesPendingStreams() const override { return uses_pending_streams_; }
@@ -477,6 +498,16 @@ class QuicSessionTestBase : public QuicTestWithParam<ParsedQuicVersion> {
closed_streams_.insert(id);
}
+ void CompleteHandshake() {
+ CryptoHandshakeMessage msg;
+ if (connection_->version().HasHandshakeDone() &&
+ connection_->perspective() == Perspective::IS_SERVER) {
+ EXPECT_CALL(*connection_, SendControlFrame(_))
+ .WillOnce(Invoke(&ClearControlFrame));
+ }
+ session_.GetMutableCryptoStream()->OnHandshakeMessage(msg);
+ }
+
QuicTransportVersion transport_version() const {
return connection_->transport_version();
}
@@ -620,12 +651,7 @@ TEST_P(QuicSessionTestServer, DontCallOnWriteBlockedForDisconnectedConnection) {
TEST_P(QuicSessionTestServer, OneRttKeysAvailable) {
EXPECT_FALSE(session_.OneRttKeysAvailable());
- CryptoHandshakeMessage message;
- if (connection_->version().HasHandshakeDone()) {
- EXPECT_CALL(*connection_, SendControlFrame(_));
- }
- connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
- session_.GetMutableCryptoStream()->OnHandshakeMessage(message);
+ CompleteHandshake();
EXPECT_TRUE(session_.OneRttKeysAvailable());
}
@@ -697,6 +723,7 @@ TEST_P(QuicSessionTestServer, MaxAvailableUnidirectionalStreams) {
}
TEST_P(QuicSessionTestServer, IsClosedBidirectionalStreamLocallyCreated) {
+ CompleteHandshake();
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
EXPECT_EQ(GetNthServerInitiatedBidirectionalId(0), stream2->id());
TestStream* stream4 = session_.CreateOutgoingBidirectionalStream();
@@ -710,6 +737,7 @@ TEST_P(QuicSessionTestServer, IsClosedBidirectionalStreamLocallyCreated) {
}
TEST_P(QuicSessionTestServer, IsClosedUnidirectionalStreamLocallyCreated) {
+ CompleteHandshake();
TestStream* stream2 = session_.CreateOutgoingUnidirectionalStream();
EXPECT_EQ(GetNthServerInitiatedUnidirectionalId(0), stream2->id());
TestStream* stream4 = session_.CreateOutgoingUnidirectionalStream();
@@ -723,6 +751,7 @@ TEST_P(QuicSessionTestServer, IsClosedUnidirectionalStreamLocallyCreated) {
}
TEST_P(QuicSessionTestServer, IsClosedBidirectionalStreamPeerCreated) {
+ CompleteHandshake();
QuicStreamId stream_id1 = GetNthClientInitiatedBidirectionalId(0);
QuicStreamId stream_id2 = GetNthClientInitiatedBidirectionalId(1);
session_.GetOrCreateStream(stream_id1);
@@ -743,6 +772,7 @@ TEST_P(QuicSessionTestServer, IsClosedBidirectionalStreamPeerCreated) {
}
TEST_P(QuicSessionTestServer, IsClosedUnidirectionalStreamPeerCreated) {
+ CompleteHandshake();
QuicStreamId stream_id1 = GetNthClientInitiatedUnidirectionalId(0);
QuicStreamId stream_id2 = GetNthClientInitiatedUnidirectionalId(1);
session_.GetOrCreateStream(stream_id1);
@@ -905,6 +935,7 @@ TEST_P(QuicSessionTestServer, ManyAvailableUnidirectionalStreams) {
}
TEST_P(QuicSessionTestServer, DebugDFatalIfMarkingClosedStreamWriteBlocked) {
+ CompleteHandshake();
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
QuicStreamId closed_stream_id = stream2->id();
// Close the stream.
@@ -918,6 +949,7 @@ TEST_P(QuicSessionTestServer, DebugDFatalIfMarkingClosedStreamWriteBlocked) {
}
TEST_P(QuicSessionTestServer, OnCanWrite) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
TestStream* stream4 = session_.CreateOutgoingBidirectionalStream();
@@ -1142,15 +1174,9 @@ TEST_P(QuicSessionTestServer, RoundRobinScheduling) {
TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) {
// Encryption needs to be established before data can be sent.
- if (connection_->version().HasHandshakeDone()) {
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillRepeatedly(Invoke(&ClearControlFrame));
- }
- CryptoHandshakeMessage msg;
+ CompleteHandshake();
MockPacketWriter* writer = static_cast<MockPacketWriter*>(
QuicConnectionPeer::GetWriter(session_.connection()));
- connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
- session_.GetMutableCryptoStream()->OnHandshakeMessage(msg);
// Drive congestion control manually.
MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
@@ -1189,6 +1215,7 @@ TEST_P(QuicSessionTestServer, OnCanWriteBundlesStreams) {
}
TEST_P(QuicSessionTestServer, OnCanWriteCongestionControlBlocks) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
InSequence s;
@@ -1236,6 +1263,7 @@ TEST_P(QuicSessionTestServer, OnCanWriteCongestionControlBlocks) {
}
TEST_P(QuicSessionTestServer, OnCanWriteWriterBlocks) {
+ CompleteHandshake();
// Drive congestion control manually in order to ensure that
// application-limited signaling is handled correctly.
MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
@@ -1263,6 +1291,7 @@ TEST_P(QuicSessionTestServer, SendStreamsBlocked) {
if (!VersionHasIetfQuicFrames(transport_version())) {
return;
}
+ CompleteHandshake();
for (size_t i = 0; i < kDefaultMaxStreamsPerConnection; ++i) {
ASSERT_TRUE(session_.CanOpenNextOutgoingBidirectionalStream());
session_.GetNextOutgoingBidirectionalStreamId();
@@ -1348,6 +1377,7 @@ TEST_P(QuicSessionTestServer, BufferedHandshake) {
}
TEST_P(QuicSessionTestServer, OnCanWriteWithClosedStream) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
TestStream* stream4 = session_.CreateOutgoingBidirectionalStream();
@@ -1417,6 +1447,7 @@ TEST_P(QuicSessionTestServer, SendGoAway) {
// In IETF QUIC, GOAWAY lives up in the HTTP layer.
return;
}
+ CompleteHandshake();
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
MockPacketWriter* writer = static_cast<MockPacketWriter*>(
QuicConnectionPeer::GetWriter(session_.connection()));
@@ -1438,6 +1469,7 @@ TEST_P(QuicSessionTestServer, SendGoAway) {
}
TEST_P(QuicSessionTestServer, DoNotSendGoAwayTwice) {
+ CompleteHandshake();
if (VersionHasIetfQuicFrames(transport_version())) {
// In IETF QUIC, GOAWAY lives up in the HTTP layer.
return;
@@ -1539,12 +1571,7 @@ TEST_P(QuicSessionTestServer, ServerReplyToConnectivityProbes) {
TEST_P(QuicSessionTestServer, IncreasedTimeoutAfterCryptoHandshake) {
EXPECT_EQ(kInitialIdleTimeoutSecs + 3,
QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds());
- if (connection_->version().HasHandshakeDone()) {
- EXPECT_CALL(*connection_, SendControlFrame(_));
- }
- CryptoHandshakeMessage msg;
- connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
- session_.GetMutableCryptoStream()->OnHandshakeMessage(msg);
+ CompleteHandshake();
EXPECT_EQ(kMaximumIdleTimeoutSecs + 3,
QuicConnectionPeer::GetNetworkTimeout(connection_).ToSeconds());
}
@@ -1561,8 +1588,7 @@ TEST_P(QuicSessionTestServer, OnStreamFrameFinStaticStreamId) {
/*is_static*/ true, BIDIRECTIONAL);
QuicSessionPeer::ActivateStream(&session_, std::move(fake_headers_stream));
// Send two bytes of payload.
- QuicStreamFrame data1(headers_stream_id, true, 0,
- quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(headers_stream_id, true, 0, absl::string_view("HT"));
EXPECT_CALL(*connection_,
CloseConnection(
QUIC_INVALID_STREAM_ID, "Attempt to close a static stream",
@@ -1574,7 +1600,7 @@ TEST_P(QuicSessionTestServer, OnStreamFrameInvalidStreamId) {
// Send two bytes of payload.
QuicStreamFrame data1(
QuicUtils::GetInvalidStreamId(connection_->transport_version()), true, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
EXPECT_CALL(*connection_,
CloseConnection(
QUIC_INVALID_STREAM_ID, "Received data for an invalid stream",
@@ -1607,6 +1633,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedStream) {
// Ensure that Writev consumes all the data it is given (simulate no socket
// blocking).
session_.set_writev_consumes_all_data(true);
+ session_.GetMutableCryptoStream()->EstablishZeroRttEncryption();
// Create a stream, and send enough data to make it flow control blocked.
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
@@ -1622,8 +1649,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedStream) {
// Now complete the crypto handshake, resulting in an increased flow control
// send window.
- CryptoHandshakeMessage msg;
- session_.GetMutableCryptoStream()->OnHandshakeMessage(msg);
+ CompleteHandshake();
EXPECT_TRUE(QuicSessionPeer::IsStreamWriteBlocked(&session_, stream2->id()));
// Stream is now unblocked.
EXPECT_FALSE(stream2->IsFlowControlBlocked());
@@ -1632,7 +1658,8 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedStream) {
}
TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) {
- if (QuicVersionUsesCryptoFrames(GetParam().transport_version)) {
+ if (QuicVersionUsesCryptoFrames(GetParam().transport_version) ||
+ connection_->encrypted_control_frames()) {
// QUIC version 47 onwards uses CRYPTO frames for the handshake, so this
// test doesn't make sense for those versions since CRYPTO frames aren't
// flow controlled.
@@ -1657,7 +1684,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) {
QuicConfig config;
CryptoHandshakeMessage crypto_message;
config.ToHandshakeMessage(&crypto_message, transport_version());
- crypto_stream->SendHandshakeMessage(crypto_message);
+ crypto_stream->SendHandshakeMessage(crypto_message, ENCRYPTION_INITIAL);
char buf[1000];
QuicDataWriter writer(1000, buf, quiche::NETWORK_BYTE_ORDER);
crypto_stream->WriteStreamData(offset, crypto_message.size(), &writer);
@@ -1670,8 +1697,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) {
// Now complete the crypto handshake, resulting in an increased flow control
// send window.
- CryptoHandshakeMessage msg;
- session_.GetMutableCryptoStream()->OnHandshakeMessage(msg);
+ CompleteHandshake();
EXPECT_TRUE(QuicSessionPeer::IsStreamWriteBlocked(
&session_,
QuicUtils::GetCryptoStreamId(connection_->transport_version())));
@@ -1682,6 +1708,7 @@ TEST_P(QuicSessionTestServer, HandshakeUnblocksFlowControlBlockedCryptoStream) {
}
TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingRstOutOfOrder) {
+ CompleteHandshake();
// Test that when we receive an out of order stream RST we correctly adjust
// our connection level flow control receive window.
// On close, the stream should mark as consumed all bytes between the highest
@@ -1711,6 +1738,7 @@ TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingRstOutOfOrder) {
}
TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAndLocalReset) {
+ CompleteHandshake();
// Test the situation where we receive a FIN on a stream, and before we fully
// consume all the data from the sequencer buffer we locally RST the stream.
// The bytes between highest consumed byte, and the final byte offset that we
@@ -1737,6 +1765,7 @@ TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAndLocalReset) {
}
TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAfterRst) {
+ CompleteHandshake();
// Test that when we RST the stream (and tear down stream state), and then
// receive a FIN from the peer, we correctly adjust our connection level flow
// control receive window.
@@ -1763,7 +1792,7 @@ TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAfterRst) {
const QuicStreamOffset kByteOffset = 5678;
std::string body = "hello";
QuicStreamFrame frame(stream->id(), true, kByteOffset,
- quiche::QuicheStringPiece(body));
+ absl::string_view(body));
session_.OnStreamFrame(frame);
QuicStreamOffset total_stream_bytes_sent_by_peer =
@@ -1776,6 +1805,7 @@ TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingFinAfterRst) {
}
TEST_P(QuicSessionTestServer, ConnectionFlowControlAccountingRstAfterRst) {
+ CompleteHandshake();
// Test that when we RST the stream (and tear down stream state), and then
// receive a RST from the peer, we correctly adjust our connection level flow
// control receive window.
@@ -1841,6 +1871,7 @@ TEST_P(QuicSessionTestServer, CustomFlowControlWindow) {
}
TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) {
+ CompleteHandshake();
// Test that if we receive a stream RST with a highest byte offset that
// violates flow control, that we close the connection.
const uint64_t kLargeOffset = kInitialSessionFlowControlWindowForTest + 1;
@@ -1853,8 +1884,7 @@ TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) {
EXPECT_CALL(*connection_, SendControlFrame(_));
EXPECT_CALL(*connection_, OnStreamReset(stream->id(), _));
stream->Reset(QUIC_STREAM_CANCELLED);
- QuicStreamFrame frame(stream->id(), true, kLargeOffset,
- quiche::QuicheStringPiece());
+ QuicStreamFrame frame(stream->id(), true, kLargeOffset, absl::string_view());
session_.OnStreamFrame(frame);
// Check that RST results in connection close.
@@ -1864,6 +1894,7 @@ TEST_P(QuicSessionTestServer, FlowControlWithInvalidFinalOffset) {
}
TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseServerRejectStream) {
+ CompleteHandshake();
// If a buggy/malicious peer creates too many streams that are not ended
// with a FIN or RST then we send an RST to refuse streams. For IETF QUIC the
// connection is closed.
@@ -1881,7 +1912,7 @@ TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseServerRejectStream) {
// FIN or a RST_STREAM from the client.
for (QuicStreamId i = kFirstStreamId; i < kFinalStreamId;
i += QuicUtils::StreamIdDelta(connection_->transport_version())) {
- QuicStreamFrame data1(i, false, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(i, false, 0, absl::string_view("HT"));
session_.OnStreamFrame(data1);
CloseStream(i);
}
@@ -1898,8 +1929,7 @@ TEST_P(QuicSessionTestServer, TooManyUnfinishedStreamsCauseServerRejectStream) {
.Times(1);
}
// Create one more data streams to exceed limit of open stream.
- QuicStreamFrame data1(kFinalStreamId, false, 0,
- quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(kFinalStreamId, false, 0, absl::string_view("HT"));
session_.OnStreamFrame(data1);
}
@@ -1907,9 +1937,10 @@ TEST_P(QuicSessionTestServer, DrainingStreamsDoNotCountAsOpenedOutgoing) {
// Verify that a draining stream (which has received a FIN but not consumed
// it) does not count against the open quota (because it is closed from the
// protocol point of view).
+ CompleteHandshake();
TestStream* stream = session_.CreateOutgoingBidirectionalStream();
QuicStreamId stream_id = stream->id();
- QuicStreamFrame data1(stream_id, true, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(stream_id, true, 0, absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_CALL(session_, OnCanCreateNewOutgoingStream(false)).Times(1);
session_.StreamDraining(stream_id, /*unidirectional=*/false);
@@ -1920,11 +1951,11 @@ TEST_P(QuicSessionTestServer, NoPendingStreams) {
QuicStreamId stream_id = QuicUtils::GetFirstUnidirectionalStreamId(
transport_version(), Perspective::IS_CLIENT);
- QuicStreamFrame data1(stream_id, true, 10, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(stream_id, true, 10, absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_EQ(1, session_.num_incoming_streams_created());
- QuicStreamFrame data2(stream_id, false, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data2(stream_id, false, 0, absl::string_view("HT"));
session_.OnStreamFrame(data2);
EXPECT_EQ(1, session_.num_incoming_streams_created());
}
@@ -1937,12 +1968,12 @@ TEST_P(QuicSessionTestServer, PendingStreams) {
QuicStreamId stream_id = QuicUtils::GetFirstUnidirectionalStreamId(
transport_version(), Perspective::IS_CLIENT);
- QuicStreamFrame data1(stream_id, true, 10, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(stream_id, true, 10, absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_TRUE(QuicSessionPeer::GetPendingStream(&session_, stream_id));
EXPECT_EQ(0, session_.num_incoming_streams_created());
- QuicStreamFrame data2(stream_id, false, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data2(stream_id, false, 0, absl::string_view("HT"));
session_.OnStreamFrame(data2);
EXPECT_FALSE(QuicSessionPeer::GetPendingStream(&session_, stream_id));
EXPECT_EQ(1, session_.num_incoming_streams_created());
@@ -1956,7 +1987,7 @@ TEST_P(QuicSessionTestServer, RstPendingStreams) {
QuicStreamId stream_id = QuicUtils::GetFirstUnidirectionalStreamId(
transport_version(), Perspective::IS_CLIENT);
- QuicStreamFrame data1(stream_id, true, 10, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(stream_id, true, 10, absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_TRUE(QuicSessionPeer::GetPendingStream(&session_, stream_id));
EXPECT_EQ(0, session_.num_incoming_streams_created());
@@ -1969,7 +2000,7 @@ TEST_P(QuicSessionTestServer, RstPendingStreams) {
EXPECT_EQ(0, session_.num_incoming_streams_created());
EXPECT_EQ(0u, QuicSessionPeer::GetNumOpenDynamicStreams(&session_));
- QuicStreamFrame data2(stream_id, false, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data2(stream_id, false, 0, absl::string_view("HT"));
session_.OnStreamFrame(data2);
EXPECT_FALSE(QuicSessionPeer::GetPendingStream(&session_, stream_id));
EXPECT_EQ(0, session_.num_incoming_streams_created());
@@ -2000,7 +2031,7 @@ TEST_P(QuicSessionTestServer, PendingStreamOnWindowUpdate) {
session_.set_uses_pending_streams(true);
QuicStreamId stream_id = QuicUtils::GetFirstUnidirectionalStreamId(
transport_version(), Perspective::IS_CLIENT);
- QuicStreamFrame data1(stream_id, true, 10, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(stream_id, true, 10, absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_TRUE(QuicSessionPeer::GetPendingStream(&session_, stream_id));
EXPECT_EQ(0, session_.num_incoming_streams_created());
@@ -2018,6 +2049,7 @@ TEST_P(QuicSessionTestServer, DrainingStreamsDoNotCountAsOpened) {
// Verify that a draining stream (which has received a FIN but not consumed
// it) does not count against the open quota (because it is closed from the
// protocol point of view).
+ CompleteHandshake();
if (VersionHasIetfQuicFrames(transport_version())) {
// On IETF QUIC, we will expect to see a MAX_STREAMS go out when there are
// not enough streams to create the next one.
@@ -2040,7 +2072,7 @@ TEST_P(QuicSessionTestServer, DrainingStreamsDoNotCountAsOpened) {
GetNthClientInitiatedBidirectionalId(2 * kMaxStreams + 1);
for (QuicStreamId i = kFirstStreamId; i < kFinalStreamId;
i += QuicUtils::StreamIdDelta(connection_->transport_version())) {
- QuicStreamFrame data1(i, true, 0, quiche::QuicheStringPiece("HT"));
+ QuicStreamFrame data1(i, true, 0, absl::string_view("HT"));
session_.OnStreamFrame(data1);
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(&session_));
session_.StreamDraining(i, /*unidirectional=*/false);
@@ -2174,6 +2206,7 @@ TEST_P(QuicSessionTestClient, AvailableUnidirectionalStreamsClient) {
}
TEST_P(QuicSessionTestClient, RecordFinAfterReadSideClosed) {
+ CompleteHandshake();
// Verify that an incoming FIN is recorded in a stream object even if the read
// side has been closed. This prevents an entry from being made in
// locally_closed_streams_highest_offset_ (which will never be deleted).
@@ -2184,7 +2217,7 @@ TEST_P(QuicSessionTestClient, RecordFinAfterReadSideClosed) {
QuicStreamPeer::CloseReadSide(stream);
// Receive a stream data frame with FIN.
- QuicStreamFrame frame(stream_id, true, 0, quiche::QuicheStringPiece());
+ QuicStreamFrame frame(stream_id, true, 0, absl::string_view());
session_.OnStreamFrame(frame);
EXPECT_TRUE(stream->fin_received());
@@ -2217,7 +2250,7 @@ TEST_P(QuicSessionTestClient, IncomingStreamWithClientInitiatedStreamId) {
QuicStreamFrame frame(GetNthClientInitiatedBidirectionalId(1),
/* fin = */ false, /* offset = */ 0,
- quiche::QuicheStringPiece("foo"));
+ absl::string_view("foo"));
session_.OnStreamFrame(frame);
}
@@ -2232,6 +2265,30 @@ TEST_P(QuicSessionTestClient, MinAckDelaySetOnTheClientQuicConfig) {
ASSERT_TRUE(session_.connection()->can_receive_ack_frequency_frame());
}
+TEST_P(QuicSessionTestClient, KeyUpdateFlagNotSet) {
+ SetQuicReloadableFlag(quic_key_update_supported, false);
+ EXPECT_CALL(*session_.GetMutableCryptoStream(), KeyUpdateSupportedLocally())
+ .Times(0);
+ session_.Initialize();
+ EXPECT_FALSE(session_.config()->KeyUpdateSupportedLocally());
+}
+
+TEST_P(QuicSessionTestClient, KeyUpdateNotSupportedLocallyAndFlagSet) {
+ SetQuicReloadableFlag(quic_key_update_supported, true);
+ EXPECT_CALL(*session_.GetMutableCryptoStream(), KeyUpdateSupportedLocally())
+ .WillOnce(Return(false));
+ session_.Initialize();
+ EXPECT_FALSE(session_.config()->KeyUpdateSupportedLocally());
+}
+
+TEST_P(QuicSessionTestClient, KeyUpdateSupportedLocallyAndFlagSet) {
+ SetQuicReloadableFlag(quic_key_update_supported, true);
+ EXPECT_CALL(*session_.GetMutableCryptoStream(), KeyUpdateSupportedLocally())
+ .WillOnce(Return(true));
+ session_.Initialize();
+ EXPECT_TRUE(session_.config()->KeyUpdateSupportedLocally());
+}
+
TEST_P(QuicSessionTestClient, FailedToCreateStreamIfTooCloseToIdleTimeout) {
connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
EXPECT_TRUE(session_.CanOpenNextOutgoingBidirectionalStream());
@@ -2255,6 +2312,7 @@ TEST_P(QuicSessionTestClient, FailedToCreateStreamIfTooCloseToIdleTimeout) {
}
TEST_P(QuicSessionTestServer, ZombieStreams) {
+ CompleteHandshake();
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
QuicStreamPeer::SetStreamBytesWritten(3, stream2);
EXPECT_TRUE(stream2->IsWaitingForAcks());
@@ -2262,12 +2320,13 @@ TEST_P(QuicSessionTestServer, ZombieStreams) {
CloseStream(stream2->id());
ASSERT_EQ(1u, session_.closed_streams()->size());
EXPECT_EQ(stream2->id(), session_.closed_streams()->front()->id());
- session_.OnStreamDoneWaitingForAcks(stream2->id());
+ session_.MaybeCloseZombieStream(stream2->id());
EXPECT_EQ(1u, session_.closed_streams()->size());
EXPECT_EQ(stream2->id(), session_.closed_streams()->front()->id());
}
TEST_P(QuicSessionTestServer, RstStreamReceivedAfterRstStreamSent) {
+ CompleteHandshake();
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
QuicStreamPeer::SetStreamBytesWritten(3, stream2);
EXPECT_TRUE(stream2->IsWaitingForAcks());
@@ -2287,6 +2346,7 @@ TEST_P(QuicSessionTestServer, RstStreamReceivedAfterRstStreamSent) {
// Regression test of b/71548958.
TEST_P(QuicSessionTestServer, TestZombieStreams) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
@@ -2342,6 +2402,7 @@ TEST_P(QuicSessionTestServer, TestZombieStreams) {
}
TEST_P(QuicSessionTestServer, OnStreamFrameLost) {
+ CompleteHandshake();
InSequence s;
// Drive congestion control manually.
@@ -2418,6 +2479,7 @@ TEST_P(QuicSessionTestServer, OnStreamFrameLost) {
}
TEST_P(QuicSessionTestServer, DonotRetransmitDataOfClosedStreams) {
+ CompleteHandshake();
InSequence s;
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
@@ -2457,6 +2519,7 @@ TEST_P(QuicSessionTestServer, DonotRetransmitDataOfClosedStreams) {
}
TEST_P(QuicSessionTestServer, RetransmitFrames) {
+ CompleteHandshake();
MockSendAlgorithm* send_algorithm = new StrictMock<MockSendAlgorithm>;
QuicConnectionPeer::SetSendAlgorithm(session_.connection(), send_algorithm);
InSequence s;
@@ -2493,6 +2556,7 @@ TEST_P(QuicSessionTestServer, RetransmitFrames) {
// Regression test of b/110082001.
TEST_P(QuicSessionTestServer, RetransmitLostDataCausesConnectionClose) {
+ CompleteHandshake();
// This test mimics the scenario when a dynamic stream retransmits lost data
// and causes connection close.
TestStream* stream = session_.CreateOutgoingBidirectionalStream();
@@ -2531,16 +2595,10 @@ TEST_P(QuicSessionTestServer, SendMessage) {
MakeSpan(connection_->helper()->GetStreamSendBufferAllocator(),
"", &storage)));
- // Finish handshake.
- if (connection_->version().HasHandshakeDone()) {
- EXPECT_CALL(*connection_, SendControlFrame(_));
- }
- CryptoHandshakeMessage handshake_message;
- connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
- session_.GetMutableCryptoStream()->OnHandshakeMessage(handshake_message);
+ CompleteHandshake();
EXPECT_TRUE(session_.OneRttKeysAvailable());
- quiche::QuicheStringPiece message;
+ absl::string_view message;
EXPECT_CALL(*connection_, SendMessage(1, _, false))
.WillOnce(Return(MESSAGE_STATUS_SUCCESS));
EXPECT_EQ(MessageResult(MESSAGE_STATUS_SUCCESS, 1),
@@ -2578,6 +2636,7 @@ TEST_P(QuicSessionTestServer, SendMessage) {
// Regression test of b/115323618.
TEST_P(QuicSessionTestServer, LocallyResetZombieStreams) {
+ CompleteHandshake();
session_.set_writev_consumes_all_data(true);
TestStream* stream2 = session_.CreateOutgoingBidirectionalStream();
std::string body(100, '.');
@@ -2607,6 +2666,7 @@ TEST_P(QuicSessionTestServer, LocallyResetZombieStreams) {
}
TEST_P(QuicSessionTestServer, CleanUpClosedStreamsAlarm) {
+ CompleteHandshake();
EXPECT_FALSE(
QuicSessionPeer::GetCleanUpClosedStreamsAlarm(&session_)->IsSet());
@@ -2712,8 +2772,8 @@ TEST_P(QuicSessionTestServer, WriteMemSlicesOnReadUnidirectionalStream) {
.Times(1);
char data[1024];
std::vector<std::pair<char*, size_t>> buffers;
- buffers.push_back(std::make_pair(data, QUICHE_ARRAYSIZE(data)));
- buffers.push_back(std::make_pair(data, QUICHE_ARRAYSIZE(data)));
+ buffers.push_back(std::make_pair(data, ABSL_ARRAYSIZE(data)));
+ buffers.push_back(std::make_pair(data, ABSL_ARRAYSIZE(data)));
QuicTestMemSliceVector vector(buffers);
stream4->WriteMemSlices(vector.span(), false);
}
@@ -2731,7 +2791,7 @@ TEST_P(QuicSessionTestServer, NewStreamIdBelowLimit) {
return;
}
QuicStreamId bidirectional_stream_id = StreamCountToId(
- QuicSessionPeer::v99_streamid_manager(&session_)
+ QuicSessionPeer::ietf_streamid_manager(&session_)
->advertised_max_incoming_bidirectional_streams() -
1,
Perspective::IS_CLIENT,
@@ -2743,7 +2803,7 @@ TEST_P(QuicSessionTestServer, NewStreamIdBelowLimit) {
session_.OnStreamFrame(bidirectional_stream_frame);
QuicStreamId unidirectional_stream_id = StreamCountToId(
- QuicSessionPeer::v99_streamid_manager(&session_)
+ QuicSessionPeer::ietf_streamid_manager(&session_)
->advertised_max_incoming_unidirectional_streams() -
1,
Perspective::IS_CLIENT,
@@ -2761,7 +2821,7 @@ TEST_P(QuicSessionTestServer, NewStreamIdAtLimit) {
return;
}
QuicStreamId bidirectional_stream_id =
- StreamCountToId(QuicSessionPeer::v99_streamid_manager(&session_)
+ StreamCountToId(QuicSessionPeer::ietf_streamid_manager(&session_)
->advertised_max_incoming_bidirectional_streams(),
Perspective::IS_CLIENT, /*bidirectional=*/true);
QuicStreamFrame bidirectional_stream_frame(bidirectional_stream_id, false, 0,
@@ -2770,7 +2830,7 @@ TEST_P(QuicSessionTestServer, NewStreamIdAtLimit) {
session_.OnStreamFrame(bidirectional_stream_frame);
QuicStreamId unidirectional_stream_id =
- StreamCountToId(QuicSessionPeer::v99_streamid_manager(&session_)
+ StreamCountToId(QuicSessionPeer::ietf_streamid_manager(&session_)
->advertised_max_incoming_unidirectional_streams(),
Perspective::IS_CLIENT, /*bidirectional=*/false);
QuicStreamFrame unidirectional_stream_frame(unidirectional_stream_id, false,
@@ -2787,7 +2847,7 @@ TEST_P(QuicSessionTestServer, NewStreamIdAboveLimit) {
}
QuicStreamId bidirectional_stream_id = StreamCountToId(
- QuicSessionPeer::v99_streamid_manager(&session_)
+ QuicSessionPeer::ietf_streamid_manager(&session_)
->advertised_max_incoming_bidirectional_streams() +
1,
Perspective::IS_CLIENT, /*bidirectional=*/true);
@@ -2800,7 +2860,7 @@ TEST_P(QuicSessionTestServer, NewStreamIdAboveLimit) {
session_.OnStreamFrame(bidirectional_stream_frame);
QuicStreamId unidirectional_stream_id = StreamCountToId(
- QuicSessionPeer::v99_streamid_manager(&session_)
+ QuicSessionPeer::ietf_streamid_manager(&session_)
->advertised_max_incoming_unidirectional_streams() +
1,
Perspective::IS_CLIENT, /*bidirectional=*/false);
@@ -2879,7 +2939,7 @@ TEST_P(QuicSessionTestServer, OnStopSendingClosedStream) {
if (!VersionHasIetfQuicFrames(transport_version())) {
return;
}
-
+ CompleteHandshake();
TestStream* stream = session_.CreateOutgoingBidirectionalStream();
QuicStreamId stream_id = stream->id();
CloseStream(stream_id);
@@ -2906,6 +2966,7 @@ TEST_P(QuicSessionTestServer, OnStopSendingInputNonExistentLocalStream) {
// If a STOP_SENDING is received for a peer initiated stream, the new stream
// will be created.
TEST_P(QuicSessionTestServer, OnStopSendingNewStream) {
+ CompleteHandshake();
if (!VersionHasIetfQuicFrames(transport_version())) {
return;
}
@@ -2925,6 +2986,7 @@ TEST_P(QuicSessionTestServer, OnStopSendingNewStream) {
// For a valid stream, ensure that all works
TEST_P(QuicSessionTestServer, OnStopSendingInputValidStream) {
+ CompleteHandshake();
if (!VersionHasIetfQuicFrames(transport_version())) {
// Applicable only to IETF QUIC
return;
@@ -2990,6 +3052,7 @@ TEST_P(QuicSessionTestServer, StreamFrameReceivedAfterFin) {
}
TEST_P(QuicSessionTestServer, ResetForIETFStreamTypes) {
+ CompleteHandshake();
if (!VersionHasIetfQuicFrames(transport_version())) {
return;
}
@@ -3000,24 +3063,21 @@ TEST_P(QuicSessionTestServer, ResetForIETFStreamTypes) {
.Times(1)
.WillOnce(Invoke(&ClearControlFrame));
EXPECT_CALL(*connection_, OnStreamReset(read_only, _));
- session_.SendRstStream(read_only, QUIC_STREAM_CANCELLED, 0,
- /*send_rst_only = */ false);
+ session_.ResetStream(read_only, QUIC_STREAM_CANCELLED);
QuicStreamId write_only = GetNthServerInitiatedUnidirectionalId(0);
EXPECT_CALL(*connection_, SendControlFrame(_))
.Times(1)
.WillOnce(Invoke(&ClearControlFrame));
EXPECT_CALL(*connection_, OnStreamReset(write_only, _));
- session_.SendRstStream(write_only, QUIC_STREAM_CANCELLED, 0,
- /*send_rst_only = */ false);
+ session_.ResetStream(write_only, QUIC_STREAM_CANCELLED);
QuicStreamId bidirectional = GetNthClientInitiatedBidirectionalId(0);
EXPECT_CALL(*connection_, SendControlFrame(_))
.Times(2)
.WillRepeatedly(Invoke(&ClearControlFrame));
EXPECT_CALL(*connection_, OnStreamReset(bidirectional, _));
- session_.SendRstStream(bidirectional, QUIC_STREAM_CANCELLED, 0,
- /*send_rst_only = */ false);
+ session_.ResetStream(bidirectional, QUIC_STREAM_CANCELLED);
}
TEST_P(QuicSessionTestServer, DecryptionKeyAvailableBeforeEncryptionKey) {
@@ -3043,7 +3103,7 @@ TEST_P(QuicSessionTestServer, IncomingStreamWithServerInitiatedStreamId) {
QuicStreamFrame frame(GetNthServerInitiatedBidirectionalId(1),
/* fin = */ false, /* offset = */ 0,
- quiche::QuicheStringPiece("foo"));
+ absl::string_view("foo"));
session_.OnStreamFrame(frame);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_socket_address_coder_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_socket_address_coder_test.cc
index cbfe04f7d86..4f3c3fe26b3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_socket_address_coder_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_socket_address_coder_test.cc
@@ -6,8 +6,8 @@
#include <string>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -111,7 +111,7 @@ TEST_F(QuicSocketAddressCoderTest, EncodeAndDecode) {
{"::1", 65534},
};
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(test_case); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(test_case); i++) {
QuicIpAddress ip;
ASSERT_TRUE(ip.FromString(test_case[i].ip_literal));
QuicSocketAddressCoder encoder(QuicSocketAddress(ip, test_case[i].port));
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream.cc b/chromium/net/third_party/quiche/src/quic/core/quic_stream.cc
index d973549e555..aaef261106b 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream.cc
@@ -7,6 +7,8 @@
#include <limits>
#include <string>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_flow_controller.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
@@ -16,11 +18,8 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
-using quiche::QuicheOptional;
using spdy::SpdyPriority;
namespace quic {
@@ -109,6 +108,9 @@ QuicByteCount GetReceivedFlowControlWindow(QuicSession* session,
// static
const SpdyPriority QuicStream::kDefaultPriority;
+// static
+const int QuicStream::kDefaultUrgency;
+
PendingStream::PendingStream(QuicStreamId id, QuicSession* session)
: id_(id),
stream_delegate_(session),
@@ -281,7 +283,7 @@ QuicStream::QuicStream(PendingStream* pending,
namespace {
-QuicheOptional<QuicFlowController> FlowController(QuicStreamId id,
+absl::optional<QuicFlowController> FlowController(QuicStreamId id,
QuicSession* session,
StreamType type) {
if (type == CRYPTO) {
@@ -289,7 +291,7 @@ QuicheOptional<QuicFlowController> FlowController(QuicStreamId id,
// it is using crypto frames instead of stream frames. The QuicCryptoStream
// doesn't have any flow control in that case, so we don't create a
// QuicFlowController for it.
- return QuicheOptional<QuicFlowController>();
+ return absl::nullopt;
}
return QuicFlowController(
session, id,
@@ -324,7 +326,7 @@ QuicStream::QuicStream(QuicStreamId id,
StreamType type,
uint64_t stream_bytes_read,
bool fin_received,
- QuicheOptional<QuicFlowController> flow_controller,
+ absl::optional<QuicFlowController> flow_controller,
QuicFlowController* connection_flow_controller)
: sequencer_(std::move(sequencer)),
id_(id),
@@ -343,6 +345,7 @@ QuicStream::QuicStream(QuicStreamId id,
fin_received_(fin_received),
rst_sent_(false),
rst_received_(false),
+ stop_sending_sent_(false),
flow_controller_(std::move(flow_controller)),
connection_flow_controller_(connection_flow_controller),
stream_contributes_to_connection_flow_control_(true),
@@ -388,16 +391,6 @@ QuicStream::~QuicStream() {
}
}
-// static
-int QuicStream::DefaultUrgency() {
- if (GetQuicReloadableFlag(quic_http3_new_default_urgency_value)) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_http3_new_default_urgency_value);
- return 3;
- } else {
- return 1;
- }
-}
-
void QuicStream::OnStreamFrame(const QuicStreamFrame& frame) {
DCHECK_EQ(frame.stream_id, id_);
@@ -505,10 +498,15 @@ bool QuicStream::OnStopSending(QuicRstStreamErrorCode code) {
stream_error_ = code;
- session()->SendRstStream(id(), code, stream_bytes_written(),
- /*send_rst_only = */ true);
- rst_sent_ = true;
- CloseWriteSide();
+ if (session()->split_up_send_rst()) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_split_up_send_rst_2, 1, 3);
+ MaybeSendRstStream(code);
+ } else {
+ session()->SendRstStream(id(), code, stream_bytes_written(),
+ /*send_rst_only = */ true);
+ rst_sent_ = true;
+ CloseWriteSide();
+ }
return true;
}
@@ -594,15 +592,24 @@ void QuicStream::SetFinSent() {
void QuicStream::Reset(QuicRstStreamErrorCode error) {
stream_error_ = error;
- session()->SendRstStream(id(), error, stream_bytes_written(),
- /*send_rst_only = */ false);
- rst_sent_ = true;
+ if (session()->split_up_send_rst()) {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_split_up_send_rst_2, 2, 3);
+ QuicConnection::ScopedPacketFlusher flusher(session()->connection());
+ MaybeSendStopSending(error);
+ MaybeSendRstStream(error);
+ } else {
+ session()->SendRstStream(id(), error, stream_bytes_written(),
+ /*send_rst_only = */ false);
+ rst_sent_ = true;
+ }
if (read_side_closed_ && write_side_closed_ && !IsWaitingForAcks()) {
- session()->OnStreamDoneWaitingForAcks(id_);
+ session()->MaybeCloseZombieStream(id_);
return;
}
- CloseReadSide();
- CloseWriteSide();
+ if (!session()->split_up_send_rst()) {
+ CloseReadSide();
+ CloseWriteSide();
+ }
}
void QuicStream::OnUnrecoverableError(QuicErrorCode error,
@@ -623,9 +630,26 @@ void QuicStream::SetPriority(const spdy::SpdyStreamPrecedence& precedence) {
}
void QuicStream::WriteOrBufferData(
- quiche::QuicheStringPiece data,
+ absl::string_view data,
bool fin,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
+ if (session()->use_write_or_buffer_data_at_level()) {
+ QUIC_BUG_IF(QuicUtils::IsCryptoStreamId(transport_version(), id_))
+ << ENDPOINT
+ << "WriteOrBufferData is used to send application data, use "
+ "WriteOrBufferDataAtLevel to send crypto data.";
+ return WriteOrBufferDataAtLevel(
+ data, fin, session()->GetEncryptionLevelToSendApplicationData(),
+ ack_listener);
+ }
+ return WriteOrBufferDataInner(data, fin, absl::nullopt, ack_listener);
+}
+
+void QuicStream::WriteOrBufferDataInner(
+ absl::string_view data,
+ bool fin,
+ absl::optional<EncryptionLevel> level,
+ QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
if (data.empty() && !fin) {
QUIC_BUG << "data.empty() && !fin";
return;
@@ -665,10 +689,20 @@ void QuicStream::WriteOrBufferData(
}
if (!had_buffered_data && (HasBufferedData() || fin_buffered_)) {
// Write data if there is no buffered data before.
- WriteBufferedData();
+ WriteBufferedData(level);
}
}
+void QuicStream::WriteOrBufferDataAtLevel(
+ absl::string_view data,
+ bool fin,
+ EncryptionLevel level,
+ QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
+ DCHECK(session()->use_write_or_buffer_data_at_level());
+ QUIC_RELOADABLE_FLAG_COUNT(quic_use_write_or_buffer_data_at_level);
+ return WriteOrBufferDataInner(data, fin, level, ack_listener);
+}
+
void QuicStream::OnCanWrite() {
if (HasDeadlinePassed()) {
OnDeadlinePassed();
@@ -688,7 +722,11 @@ void QuicStream::OnCanWrite() {
return;
}
if (HasBufferedData() || (fin_buffered_ && !fin_sent_)) {
- WriteBufferedData();
+ absl::optional<EncryptionLevel> send_level = absl::nullopt;
+ if (session()->use_write_or_buffer_data_at_level()) {
+ send_level = session()->GetEncryptionLevelToSendApplicationData();
+ }
+ WriteBufferedData(send_level);
}
if (!fin_buffered_ && !fin_sent_ && CanWriteNewData()) {
// Notify upper layer to write new data when buffered data size is below
@@ -766,7 +804,11 @@ QuicConsumedData QuicStream::WriteMemSlices(QuicMemSliceSpan span, bool fin) {
if (!had_buffered_data && (HasBufferedData() || fin_buffered_)) {
// Write data if there is no buffered data before.
- WriteBufferedData();
+ absl::optional<EncryptionLevel> send_level = absl::nullopt;
+ if (session()->use_write_or_buffer_data_at_level()) {
+ send_level = session()->GetEncryptionLevelToSendApplicationData();
+ }
+ WriteBufferedData(send_level);
}
return consumed_data;
@@ -813,6 +855,44 @@ void QuicStream::CloseWriteSide() {
}
}
+void QuicStream::MaybeSendStopSending(QuicRstStreamErrorCode error) {
+ DCHECK(session()->split_up_send_rst());
+ if (stop_sending_sent_) {
+ return;
+ }
+
+ if (!session()->version().UsesHttp3() && error != QUIC_STREAM_NO_ERROR) {
+ // In gQUIC, RST with error closes both read and write side.
+ return;
+ }
+
+ if (session()->version().UsesHttp3()) {
+ session()->MaybeSendStopSendingFrame(id(), error);
+ } else {
+ DCHECK_EQ(QUIC_STREAM_NO_ERROR, error);
+ session()->MaybeSendRstStreamFrame(id(), QUIC_STREAM_NO_ERROR,
+ stream_bytes_written());
+ }
+ stop_sending_sent_ = true;
+ CloseReadSide();
+}
+
+void QuicStream::MaybeSendRstStream(QuicRstStreamErrorCode error) {
+ DCHECK(session()->split_up_send_rst());
+ if (rst_sent_) {
+ return;
+ }
+
+ if (!session()->version().UsesHttp3()) {
+ QUIC_BUG_IF(error == QUIC_STREAM_NO_ERROR);
+ stop_sending_sent_ = true;
+ CloseReadSide();
+ }
+ session()->MaybeSendRstStreamFrame(id(), error, stream_bytes_written());
+ rst_sent_ = true;
+ CloseWriteSide();
+}
+
bool QuicStream::HasBufferedData() const {
DCHECK_GE(send_buffer_.stream_offset(), stream_bytes_written());
return send_buffer_.stream_offset() > stream_bytes_written();
@@ -835,14 +915,25 @@ void QuicStream::OnClose() {
DCHECK(read_side_closed_ && write_side_closed_);
if (!fin_sent_ && !rst_sent_) {
- // For flow control accounting, tell the peer how many bytes have been
- // written on this stream before termination. Done here if needed, using a
- // RST_STREAM frame.
- QUIC_DLOG(INFO) << ENDPOINT << "Sending RST_STREAM in OnClose: " << id();
- session_->SendRstStream(id(), QUIC_RST_ACKNOWLEDGEMENT,
- stream_bytes_written(), /*send_rst_only = */ false);
- session_->OnStreamDoneWaitingForAcks(id_);
- rst_sent_ = true;
+ if (!session()->split_up_send_rst()) {
+ // For flow control accounting, tell the peer how many bytes have been
+ // written on this stream before termination. Done here if needed, using a
+ // RST_STREAM frame.
+ QUIC_DLOG(INFO) << ENDPOINT << "Sending RST_STREAM in OnClose: " << id();
+ session_->SendRstStream(id(), QUIC_RST_ACKNOWLEDGEMENT,
+ stream_bytes_written(),
+ /*send_rst_only = */ false);
+ session_->MaybeCloseZombieStream(id_);
+ rst_sent_ = true;
+ } else {
+ QUIC_RELOADABLE_FLAG_COUNT_N(quic_split_up_send_rst_2, 3, 3);
+ QUIC_BUG_IF(session()->connection()->connected() &&
+ session()->version().UsesHttp3())
+ << "The stream should've already sent RST in response to "
+ "STOP_SENDING";
+ MaybeSendRstStream(QUIC_RST_ACKNOWLEDGEMENT);
+ session_->MaybeCloseZombieStream(id_);
+ }
}
if (!flow_controller_.has_value() ||
@@ -1019,7 +1110,7 @@ bool QuicStream::OnStreamFrameAcked(QuicStreamOffset offset,
fin_lost_ = false;
}
if (!IsWaitingForAcks() && read_side_closed_ && write_side_closed_) {
- session_->OnStreamDoneWaitingForAcks(id_);
+ session_->MaybeCloseZombieStream(id_);
}
return new_data_acked;
}
@@ -1064,6 +1155,10 @@ bool QuicStream::RetransmitStreamData(QuicStreamOffset offset,
if (retransmission.Empty() && !retransmit_fin) {
return true;
}
+ absl::optional<EncryptionLevel> send_level = absl::nullopt;
+ if (session()->use_write_or_buffer_data_at_level()) {
+ send_level = session()->GetEncryptionLevelToSendApplicationData();
+ }
QuicConsumedData consumed(0, false);
for (const auto& interval : retransmission) {
QuicStreamOffset retransmission_offset = interval.min();
@@ -1073,7 +1168,7 @@ bool QuicStream::RetransmitStreamData(QuicStreamOffset offset,
stream_bytes_written());
consumed = stream_delegate_->WritevData(
id_, retransmission_length, retransmission_offset,
- can_bundle_fin ? FIN : NO_FIN, type, QUICHE_NULLOPT);
+ can_bundle_fin ? FIN : NO_FIN, type, send_level);
QUIC_DVLOG(1) << ENDPOINT << "stream " << id_
<< " is forced to retransmit stream data ["
<< retransmission_offset << ", "
@@ -1095,7 +1190,7 @@ bool QuicStream::RetransmitStreamData(QuicStreamOffset offset,
QUIC_DVLOG(1) << ENDPOINT << "stream " << id_
<< " retransmits fin only frame.";
consumed = stream_delegate_->WritevData(id_, 0, stream_bytes_written(), FIN,
- type, QUICHE_NULLOPT);
+ type, send_level);
if (!consumed.fin_consumed) {
return false;
}
@@ -1121,7 +1216,7 @@ bool QuicStream::WriteStreamData(QuicStreamOffset offset,
return send_buffer_.WriteStreamData(offset, data_length, writer);
}
-void QuicStream::WriteBufferedData() {
+void QuicStream::WriteBufferedData(absl::optional<EncryptionLevel> level) {
DCHECK(!write_side_closed_ && (HasBufferedData() || fin_buffered_));
if (session_->ShouldYield(id())) {
@@ -1173,7 +1268,7 @@ void QuicStream::WriteBufferedData() {
}
QuicConsumedData consumed_data =
stream_delegate_->WritevData(id(), write_length, stream_bytes_written(),
- state, NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ state, NOT_RETRANSMISSION, level);
OnStreamDataConsumed(consumed_data.bytes_consumed);
@@ -1244,12 +1339,15 @@ void QuicStream::OnStreamDataConsumed(QuicByteCount bytes_consumed) {
void QuicStream::WritePendingRetransmission() {
while (HasPendingRetransmission()) {
QuicConsumedData consumed(0, false);
+ absl::optional<EncryptionLevel> send_level = absl::nullopt;
+ if (session()->use_write_or_buffer_data_at_level()) {
+ send_level = session()->GetEncryptionLevelToSendApplicationData();
+ }
if (!send_buffer_.HasPendingRetransmission()) {
QUIC_DVLOG(1) << ENDPOINT << "stream " << id_
<< " retransmits fin only frame.";
- consumed =
- stream_delegate_->WritevData(id_, 0, stream_bytes_written(), FIN,
- LOSS_RETRANSMISSION, QUICHE_NULLOPT);
+ consumed = stream_delegate_->WritevData(
+ id_, 0, stream_bytes_written(), FIN, LOSS_RETRANSMISSION, send_level);
fin_lost_ = !consumed.fin_consumed;
if (fin_lost_) {
// Connection is write blocked.
@@ -1264,7 +1362,7 @@ void QuicStream::WritePendingRetransmission() {
(pending.offset + pending.length == stream_bytes_written());
consumed = stream_delegate_->WritevData(
id_, pending.length, pending.offset, can_bundle_fin ? FIN : NO_FIN,
- LOSS_RETRANSMISSION, QUICHE_NULLOPT);
+ LOSS_RETRANSMISSION, send_level);
QUIC_DVLOG(1) << ENDPOINT << "stream " << id_
<< " tries to retransmit stream data [" << pending.offset
<< ", " << pending.offset + pending.length
@@ -1341,7 +1439,7 @@ void QuicStream::UpdateReceiveWindowSize(QuicStreamOffset size) {
spdy::SpdyStreamPrecedence QuicStream::CalculateDefaultPriority(
const QuicSession* session) {
if (VersionUsesHttp3(session->transport_version())) {
- return spdy::SpdyStreamPrecedence(DefaultUrgency());
+ return spdy::SpdyStreamPrecedence(kDefaultUrgency);
}
if (session->use_http2_priority_write_scheduler()) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream.h b/chromium/net/third_party/quiche/src/quic/core/quic_stream.h
index f0a5a714a21..50fc5e1a182 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream.h
@@ -22,6 +22,8 @@
#include <list>
#include <string>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/quic_flow_controller.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_stream_send_buffer.h"
@@ -32,8 +34,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_reference_counted.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
namespace quic {
@@ -142,9 +142,7 @@ class QUIC_EXPORT_PRIVATE QuicStream
// Default priority for IETF QUIC, defined by the priority extension at
// https://httpwg.org/http-extensions/draft-ietf-httpbis-priority.html#urgency.
- // TODO(bnc): Remove this method and reinstate static const int
- // kDefaultUrgency member when removing quic_http3_new_default_urgency_value.
- static int DefaultUrgency();
+ static const int kDefaultUrgency = 3;
// QuicStreamSequencer::StreamInterface implementation.
QuicStreamId id() const override { return id_; }
@@ -206,6 +204,7 @@ class QUIC_EXPORT_PRIVATE QuicStream
return sequencer_.ignore_read_data() || read_side_closed_;
}
bool write_side_closed() const { return write_side_closed_; }
+ bool read_side_closed() const { return read_side_closed_; }
bool IsZombie() const {
return read_side_closed_ && write_side_closed_ && IsWaitingForAcks();
@@ -274,15 +273,23 @@ class QUIC_EXPORT_PRIVATE QuicStream
// stop sending stream-level flow-control updates when this end sends FIN.
virtual void StopReading();
- // Sends as much of 'data' to the connection as the connection will consume,
- // and then buffers any remaining data in queued_data_.
- // If fin is true: if it is immediately passed on to the session,
- // write_side_closed() becomes true, otherwise fin_buffered_ becomes true.
+ // Sends as much of |data| to the connection on the application encryption
+ // level as the connection will consume, and then buffers any remaining data
+ // in the send buffer. If fin is true: if it is immediately passed on to the
+ // session, write_side_closed() becomes true, otherwise fin_buffered_ becomes
+ // true.
void WriteOrBufferData(
- quiche::QuicheStringPiece data,
+ absl::string_view data,
bool fin,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
+ // Sends |data| to connection with specified |level|.
+ void WriteOrBufferDataAtLevel(
+ absl::string_view data,
+ bool fin,
+ EncryptionLevel level,
+ QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
+
// Adds random padding after the fin is consumed for this stream.
void AddRandomPaddingAfterFin();
@@ -402,6 +409,12 @@ class QUIC_EXPORT_PRIVATE QuicStream
// empty.
void SetFinSent();
+ // Send STOP_SENDING if it hasn't been sent yet.
+ void MaybeSendStopSending(QuicRstStreamErrorCode error);
+
+ // Send RESET_STREAM if it hasn't been sent yet.
+ void MaybeSendRstStream(QuicRstStreamErrorCode error);
+
// Close the write side of the socket. Further writes will fail.
// Can be called by the subclass or internally.
// Does not send a FIN. May cause the stream to be closed.
@@ -439,7 +452,7 @@ class QUIC_EXPORT_PRIVATE QuicStream
StreamType type,
uint64_t stream_bytes_read,
bool fin_received,
- quiche::QuicheOptional<QuicFlowController> flow_controller,
+ absl::optional<QuicFlowController> flow_controller,
QuicFlowController* connection_flow_controller);
// Calls MaybeSendBlocked on the stream's flow controller and the connection
@@ -448,9 +461,10 @@ class QUIC_EXPORT_PRIVATE QuicStream
// controller, marks this stream as connection-level write blocked.
void MaybeSendBlocked();
- // Write buffered data in send buffer. TODO(fayang): Consider combine
- // WriteOrBufferData, Writev and WriteBufferedData.
- void WriteBufferedData();
+ // Write buffered data in send buffer.
+ // TODO(fayang): Change absl::optional<EncryptionLevel> to EncryptionLevel
+ // when deprecating quic_use_write_or_buffer_data_at_level.
+ void WriteBufferedData(absl::optional<EncryptionLevel> level);
// Close the read side of the stream. May cause the stream to be closed.
void CloseReadSide();
@@ -458,6 +472,14 @@ class QUIC_EXPORT_PRIVATE QuicStream
// Called when bytes are sent to the peer.
void AddBytesSent(QuicByteCount bytes);
+ // TODO(fayang): Inline this function when deprecating
+ // quic_use_write_or_buffer_data_at_level.
+ void WriteOrBufferDataInner(
+ absl::string_view data,
+ bool fin,
+ absl::optional<EncryptionLevel> level,
+ QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
+
// Returns true if deadline_ has passed.
bool HasDeadlinePassed() const;
@@ -508,7 +530,10 @@ class QUIC_EXPORT_PRIVATE QuicStream
// True if this stream has received a RST_STREAM frame.
bool rst_received_;
- quiche::QuicheOptional<QuicFlowController> flow_controller_;
+ // True if the stream has sent STOP_SENDING to the session.
+ bool stop_sending_sent_;
+
+ absl::optional<QuicFlowController> flow_controller_;
// The connection level flow controller. Not owned.
QuicFlowController* connection_flow_controller_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream_send_buffer_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_stream_send_buffer_test.cc
index 6232887d678..0d5471e2aee 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream_send_buffer_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream_send_buffer_test.cc
@@ -6,6 +6,7 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_simple_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -15,13 +16,12 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_test_mem_slice_vector.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_send_buffer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
namespace {
-struct iovec MakeIovec(quiche::QuicheStringPiece data) {
+struct iovec MakeIovec(absl::string_view data) {
struct iovec iov = {const_cast<char*>(data.data()),
static_cast<size_t>(data.size())};
return iov;
@@ -36,8 +36,8 @@ class QuicStreamSendBufferTest : public QuicTest {
std::string data1(1536, 'a');
std::string data2 = std::string(256, 'b') + std::string(256, 'c');
struct iovec iov[2];
- iov[0] = MakeIovec(quiche::QuicheStringPiece(data1));
- iov[1] = MakeIovec(quiche::QuicheStringPiece(data2));
+ iov[0] = MakeIovec(absl::string_view(data1));
+ iov[1] = MakeIovec(absl::string_view(data2));
QuicUniqueBufferPtr buffer1 = MakeUniqueBuffer(&allocator_, 1024);
memset(buffer1.get(), 'c', 1024);
@@ -88,23 +88,23 @@ TEST_F(QuicStreamSendBufferTest, CopyDataToBuffer) {
std::string copy4(768, 'd');
ASSERT_TRUE(send_buffer_.WriteStreamData(0, 1024, &writer));
- EXPECT_EQ(copy1, quiche::QuicheStringPiece(buf, 1024));
+ EXPECT_EQ(copy1, absl::string_view(buf, 1024));
ASSERT_TRUE(send_buffer_.WriteStreamData(1024, 1024, &writer));
- EXPECT_EQ(copy2, quiche::QuicheStringPiece(buf + 1024, 1024));
+ EXPECT_EQ(copy2, absl::string_view(buf + 1024, 1024));
ASSERT_TRUE(send_buffer_.WriteStreamData(2048, 1024, &writer));
- EXPECT_EQ(copy3, quiche::QuicheStringPiece(buf + 2048, 1024));
+ EXPECT_EQ(copy3, absl::string_view(buf + 2048, 1024));
ASSERT_TRUE(send_buffer_.WriteStreamData(3072, 768, &writer));
- EXPECT_EQ(copy4, quiche::QuicheStringPiece(buf + 3072, 768));
+ EXPECT_EQ(copy4, absl::string_view(buf + 3072, 768));
// Test data piece across boundries.
QuicDataWriter writer2(4000, buf, quiche::HOST_BYTE_ORDER);
std::string copy5 =
std::string(536, 'a') + std::string(256, 'b') + std::string(232, 'c');
ASSERT_TRUE(send_buffer_.WriteStreamData(1000, 1024, &writer2));
- EXPECT_EQ(copy5, quiche::QuicheStringPiece(buf, 1024));
+ EXPECT_EQ(copy5, absl::string_view(buf, 1024));
ASSERT_TRUE(send_buffer_.WriteStreamData(2500, 1024, &writer2));
std::string copy6 = std::string(572, 'c') + std::string(452, 'd');
- EXPECT_EQ(copy6, quiche::QuicheStringPiece(buf + 1024, 1024));
+ EXPECT_EQ(copy6, absl::string_view(buf + 1024, 1024));
// Invalid data copy.
QuicDataWriter writer3(4000, buf, quiche::HOST_BYTE_ORDER);
@@ -129,21 +129,20 @@ TEST_F(QuicStreamSendBufferTest,
// Write more than one slice.
EXPECT_EQ(0, QuicStreamSendBufferPeer::write_index(&send_buffer_));
ASSERT_TRUE(send_buffer_.WriteStreamData(0, 1024, &writer));
- EXPECT_EQ(copy1, quiche::QuicheStringPiece(buf, 1024));
+ EXPECT_EQ(copy1, absl::string_view(buf, 1024));
EXPECT_EQ(1, QuicStreamSendBufferPeer::write_index(&send_buffer_));
// Retransmit the first frame and also send new data.
ASSERT_TRUE(send_buffer_.WriteStreamData(0, 2048, &writer));
- EXPECT_EQ(copy1 + copy2, quiche::QuicheStringPiece(buf + 1024, 2048));
+ EXPECT_EQ(copy1 + copy2, absl::string_view(buf + 1024, 2048));
// Write new data.
EXPECT_EQ(2048u, QuicStreamSendBufferPeer::EndOffset(&send_buffer_));
ASSERT_TRUE(send_buffer_.WriteStreamData(2048, 50, &writer));
- EXPECT_EQ(std::string(50, 'c'),
- quiche::QuicheStringPiece(buf + 1024 + 2048, 50));
+ EXPECT_EQ(std::string(50, 'c'), absl::string_view(buf + 1024 + 2048, 50));
EXPECT_EQ(3072u, QuicStreamSendBufferPeer::EndOffset(&send_buffer_));
ASSERT_TRUE(send_buffer_.WriteStreamData(2048, 1124, &writer));
- EXPECT_EQ(copy3, quiche::QuicheStringPiece(buf + 1024 + 2048 + 50, 1124));
+ EXPECT_EQ(copy3, absl::string_view(buf + 1024 + 2048 + 50, 1124));
EXPECT_EQ(3840u, QuicStreamSendBufferPeer::EndOffset(&send_buffer_));
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer.cc b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer.cc
index 0dfc8f7c103..7d1c237bb40 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer.cc
@@ -10,6 +10,7 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_clock.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -65,8 +65,8 @@ void QuicStreamSequencer::OnFrameData(QuicStreamOffset byte_offset,
size_t bytes_written;
std::string error_details;
QuicErrorCode result = buffered_frames_.OnStreamData(
- byte_offset, quiche::QuicheStringPiece(data_buffer, data_len),
- &bytes_written, &error_details);
+ byte_offset, absl::string_view(data_buffer, data_len), &bytes_written,
+ &error_details);
if (result != QUIC_NO_ERROR) {
std::string details = quiche::QuicheStrCat("Stream ", stream_->id(), ": ",
QuicErrorCodeToString(result),
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.cc b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.cc
index 8a26521a4da..6f399381a4d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.cc
@@ -4,8 +4,12 @@
#include "net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.h"
+#include <algorithm>
+#include <cstddef>
+#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_constants.h"
#include "net/third_party/quiche/src/quic/core/quic_interval.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
@@ -13,7 +17,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace {
@@ -28,13 +31,24 @@ size_t CalculateBlockCount(size_t max_capacity_bytes) {
// arrives.
const size_t kMaxNumDataIntervalsAllowed = 2 * kMaxPacketGap;
+// Number of blocks allocated initially.
+constexpr size_t kInitialBlockCount = 8u;
+
+// How fast block pointers container grow in size.
+// Choose 4 to reduce the amount of reallocation.
+constexpr int kBlocksGrowthFactor = 4;
+
} // namespace
QuicStreamSequencerBuffer::QuicStreamSequencerBuffer(size_t max_capacity_bytes)
: max_buffer_capacity_bytes_(max_capacity_bytes),
- blocks_count_(CalculateBlockCount(max_capacity_bytes)),
+ max_blocks_count_(CalculateBlockCount(max_capacity_bytes)),
+ current_blocks_count_(0u),
total_bytes_read_(0),
blocks_(nullptr) {
+ if (allocate_blocks_on_demand_) {
+ DCHECK_GE(max_blocks_count_, kInitialBlockCount);
+ }
Clear();
}
@@ -44,7 +58,9 @@ QuicStreamSequencerBuffer::~QuicStreamSequencerBuffer() {
void QuicStreamSequencerBuffer::Clear() {
if (blocks_ != nullptr) {
- for (size_t i = 0; i < blocks_count_; ++i) {
+ size_t blocks_to_clear =
+ allocate_blocks_on_demand_ ? current_blocks_count_ : max_blocks_count_;
+ for (size_t i = 0; i < blocks_to_clear; ++i) {
if (blocks_[i] != nullptr) {
RetireBlock(i);
}
@@ -66,9 +82,38 @@ bool QuicStreamSequencerBuffer::RetireBlock(size_t index) {
return true;
}
+void QuicStreamSequencerBuffer::MaybeAddMoreBlocks(size_t next_expected_byte) {
+ if (current_blocks_count_ == max_blocks_count_) {
+ return;
+ }
+ size_t last_byte = next_expected_byte - 1;
+ size_t num_of_blocks_needed;
+ // As long as last_byte does not wrap around, its index plus one blocks are
+ // needed. Otherwise, block_count_ blocks are needed.
+ if (last_byte < max_buffer_capacity_bytes_) {
+ num_of_blocks_needed =
+ std::max(GetBlockIndex(last_byte) + 1, kInitialBlockCount);
+ } else {
+ num_of_blocks_needed = max_blocks_count_;
+ }
+ if (current_blocks_count_ >= num_of_blocks_needed) {
+ return;
+ }
+ size_t new_block_count = kBlocksGrowthFactor * current_blocks_count_;
+ new_block_count = std::min(std::max(new_block_count, num_of_blocks_needed),
+ max_blocks_count_);
+ auto new_blocks = std::make_unique<BufferBlock*[]>(new_block_count);
+ if (blocks_ != nullptr) {
+ memcpy(new_blocks.get(), blocks_.get(),
+ current_blocks_count_ * sizeof(BufferBlock*));
+ }
+ blocks_ = std::move(new_blocks);
+ current_blocks_count_ = new_block_count;
+}
+
QuicErrorCode QuicStreamSequencerBuffer::OnStreamData(
QuicStreamOffset starting_offset,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
size_t* const bytes_buffered,
std::string* error_details) {
*bytes_buffered = 0;
@@ -83,6 +128,12 @@ QuicErrorCode QuicStreamSequencerBuffer::OnStreamData(
*error_details = "Received data beyond available range.";
return QUIC_INTERNAL_ERROR;
}
+ if (allocate_blocks_on_demand_) {
+ QUIC_RELOADABLE_FLAG_COUNT(
+ quic_allocate_stream_sequencer_buffer_blocks_on_demand);
+ MaybeAddMoreBlocks(starting_offset + size);
+ }
+
if (bytes_received_.Empty() ||
starting_offset >= bytes_received_.rbegin()->max() ||
bytes_received_.IsDisjoint(QuicInterval<QuicStreamOffset>(
@@ -135,7 +186,7 @@ QuicErrorCode QuicStreamSequencerBuffer::OnStreamData(
}
bool QuicStreamSequencerBuffer::CopyStreamData(QuicStreamOffset offset,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
size_t* bytes_copy,
std::string* error_details) {
*bytes_copy = 0;
@@ -150,7 +201,9 @@ bool QuicStreamSequencerBuffer::CopyStreamData(QuicStreamOffset offset,
while (source_remaining > 0) {
const size_t write_block_num = GetBlockIndex(offset);
const size_t write_block_offset = GetInBlockOffset(offset);
- DCHECK_GT(blocks_count_, write_block_num);
+ size_t current_blocks_count =
+ allocate_blocks_on_demand_ ? current_blocks_count_ : max_blocks_count_;
+ DCHECK_GT(current_blocks_count, write_block_num);
size_t block_capacity = GetBlockCapacity(write_block_num);
size_t bytes_avail = block_capacity - write_block_offset;
@@ -161,19 +214,21 @@ bool QuicStreamSequencerBuffer::CopyStreamData(QuicStreamOffset offset,
bytes_avail = total_bytes_read_ + max_buffer_capacity_bytes_ - offset;
}
- if (blocks_ == nullptr) {
- blocks_.reset(new BufferBlock*[blocks_count_]());
- for (size_t i = 0; i < blocks_count_; ++i) {
- blocks_[i] = nullptr;
+ if (!allocate_blocks_on_demand_) {
+ if (blocks_ == nullptr) {
+ blocks_.reset(new BufferBlock*[max_blocks_count_]());
+ for (size_t i = 0; i < max_blocks_count_; ++i) {
+ blocks_[i] = nullptr;
+ }
}
}
- if (write_block_num >= blocks_count_) {
+ if (write_block_num >= current_blocks_count) {
*error_details = quiche::QuicheStrCat(
"QuicStreamSequencerBuffer error: OnStreamData() exceed array bounds."
"write offset = ",
offset, " write_block_num = ", write_block_num,
- " blocks_count_ = ", blocks_count_);
+ " current_blocks_count_ = ", current_blocks_count);
return false;
}
if (blocks_ == nullptr) {
@@ -307,14 +362,14 @@ int QuicStreamSequencerBuffer::GetReadableRegions(struct iovec* iov,
// before gap is met or |iov| is filled. For these blocks, one whole block is
// a region.
int iov_used = 1;
- size_t block_idx = (start_block_idx + iov_used) % blocks_count_;
+ size_t block_idx = (start_block_idx + iov_used) % max_blocks_count_;
while (block_idx != end_block_idx && iov_used < iov_len) {
DCHECK(nullptr != blocks_[block_idx]);
iov[iov_used].iov_base = blocks_[block_idx]->buffer;
iov[iov_used].iov_len = GetBlockCapacity(block_idx);
QUIC_DVLOG(1) << "Got block with index: " << block_idx;
++iov_used;
- block_idx = (start_block_idx + iov_used) % blocks_count_;
+ block_idx = (start_block_idx + iov_used) % max_blocks_count_;
}
// Deal with last block if |iov| can hold more.
@@ -397,6 +452,7 @@ size_t QuicStreamSequencerBuffer::FlushBufferedFrames() {
void QuicStreamSequencerBuffer::ReleaseWholeBuffer() {
Clear();
+ current_blocks_count_ = 0;
blocks_.reset(nullptr);
}
@@ -472,7 +528,7 @@ bool QuicStreamSequencerBuffer::Empty() const {
}
size_t QuicStreamSequencerBuffer::GetBlockCapacity(size_t block_index) const {
- if ((block_index + 1) == blocks_count_) {
+ if ((block_index + 1) == max_blocks_count_) {
size_t result = max_buffer_capacity_bytes_ % kBlockSizeBytes;
if (result == 0) { // whole block
result = kBlockSizeBytes;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.h b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.h
index 0ad984117de..674e3d91dfb 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer.h
@@ -28,11 +28,11 @@
// Expected Use:
// QuicStreamSequencerBuffer buffer(2.5 * 8 * 1024);
// std::string source(1024, 'a');
-// quiche::QuicheStringPiece string_piece(source.data(), source.size());
+// absl::string_view string_piece(source.data(), source.size());
// size_t written = 0;
// buffer.OnStreamData(800, string_piece, GetEpollClockNow(), &written);
// source = std::string{800, 'b'};
-// quiche::QuicheStringPiece string_piece1(source.data(), 800);
+// absl::string_view string_piece1(source.data(), 800);
// // Try to write to [1, 801), but should fail due to overlapping,
// // res should be QUIC_INVALID_STREAM_DATA
// auto res = buffer.OnStreamData(1, string_piece1, &written));
@@ -64,12 +64,12 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_interval_set.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_iovec.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -107,7 +107,7 @@ class QUIC_EXPORT_PRIVATE QuicStreamSequencerBuffer {
// successfully buffered, returns QUIC_NO_ERROR and stores the number of
// bytes buffered in |bytes_buffered|. Returns an error otherwise.
QuicErrorCode OnStreamData(QuicStreamOffset offset,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
size_t* bytes_buffered,
std::string* error_details);
@@ -168,7 +168,7 @@ class QUIC_EXPORT_PRIVATE QuicStreamSequencerBuffer {
// Copies |data| to blocks_, sets |bytes_copy|. Returns true if the copy is
// successful. Otherwise, sets |error_details| and returns false.
bool CopyStreamData(QuicStreamOffset offset,
- quiche::QuicheStringPiece data,
+ absl::string_view data,
size_t* bytes_copy,
std::string* error_details);
@@ -212,17 +212,29 @@ class QUIC_EXPORT_PRIVATE QuicStreamSequencerBuffer {
// Return all received frames as a string.
std::string ReceivedFramesDebugString() const;
+ // Resize blocks_ if more blocks are needed to accomodate bytes before
+ // next_expected_byte.
+ void MaybeAddMoreBlocks(size_t next_expected_byte);
+
// The maximum total capacity of this buffer in byte, as constructed.
size_t max_buffer_capacity_bytes_;
- // How many blocks this buffer would need when it reaches full capacity.
- size_t blocks_count_;
+ // Number of blocks this buffer would have when it reaches full capacity,
+ // i.e., maximal number of blocks in blocks_.
+ size_t max_blocks_count_;
+
+ // Number of blocks this buffer currently has.
+ size_t current_blocks_count_;
// Number of bytes read out of buffer.
QuicStreamOffset total_bytes_read_;
+ // Whether size of blocks_ grows on demand.
+ bool allocate_blocks_on_demand_ = GetQuicReloadableFlag(
+ quic_allocate_stream_sequencer_buffer_blocks_on_demand);
+
// An ordered, variable-length list of blocks, with the length limited
- // such that the number of blocks never exceeds blocks_count_.
+ // such that the number of blocks never exceeds max_blocks_count_.
// Each list entry can hold up to kBlockSizeBytes bytes.
std::unique_ptr<BufferBlock*[]> blocks_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer_test.cc
index 7341983d4a5..0ad7244ea35 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_buffer_test.cc
@@ -11,20 +11,20 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
-quiche::QuicheStringPiece IovecToStringPiece(iovec iov) {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(iov.iov_base),
- iov.iov_len);
+absl::string_view IovecToStringPiece(iovec iov) {
+ return absl::string_view(reinterpret_cast<const char*>(iov.iov_base),
+ iov.iov_len);
}
char GetCharFromIOVecs(size_t offset, iovec iov[], size_t count) {
@@ -52,7 +52,7 @@ const size_t kMaxNumGapsAllowed = 2 * kMaxPacketGap;
static const size_t kBlockSizeBytes =
QuicStreamSequencerBuffer::kBlockSizeBytes;
-typedef QuicStreamSequencerBuffer::BufferBlock BufferBlock;
+using BufferBlock = QuicStreamSequencerBuffer::BufferBlock;
namespace {
@@ -72,10 +72,10 @@ class QuicStreamSequencerBufferTest : public QuicTest {
helper_ = std::make_unique<QuicStreamSequencerBufferPeer>((buffer_.get()));
}
- // Use 2.5 here to make sure the buffer has more than one block and its end
- // doesn't align with the end of a block in order to test all the offset
- // calculation.
- size_t max_capacity_bytes_ = 2.5 * kBlockSizeBytes;
+ // Use 8.5 here to make sure that the buffer has more than
+ // QuicStreamSequencerBuffer::kInitialBlockCount block and its end doesn't
+ // align with the end of a block in order to test all the offset calculation.
+ size_t max_capacity_bytes_ = 8.5 * kBlockSizeBytes;
std::unique_ptr<QuicStreamSequencerBuffer> buffer_;
std::unique_ptr<QuicStreamSequencerBufferPeer> helper_;
@@ -86,18 +86,18 @@ class QuicStreamSequencerBufferTest : public QuicTest {
TEST_F(QuicStreamSequencerBufferTest, InitializeWithMaxRecvWindowSize) {
ResetMaxCapacityBytes(16 * 1024 * 1024); // 16MB
EXPECT_EQ(2 * 1024u, // 16MB / 8KB = 2K
- helper_->block_count());
+ helper_->max_blocks_count());
EXPECT_EQ(max_capacity_bytes_, helper_->max_buffer_capacity());
EXPECT_TRUE(helper_->CheckInitialState());
}
TEST_F(QuicStreamSequencerBufferTest, InitializationWithDifferentSizes) {
- const size_t kCapacity = 2 * QuicStreamSequencerBuffer::kBlockSizeBytes;
+ const size_t kCapacity = 16 * QuicStreamSequencerBuffer::kBlockSizeBytes;
ResetMaxCapacityBytes(kCapacity);
EXPECT_EQ(max_capacity_bytes_, helper_->max_buffer_capacity());
EXPECT_TRUE(helper_->CheckInitialState());
- const size_t kCapacity1 = 8 * QuicStreamSequencerBuffer::kBlockSizeBytes;
+ const size_t kCapacity1 = 32 * QuicStreamSequencerBuffer::kBlockSizeBytes;
ResetMaxCapacityBytes(kCapacity1);
EXPECT_EQ(kCapacity1, helper_->max_buffer_capacity());
EXPECT_TRUE(helper_->CheckInitialState());
@@ -159,8 +159,8 @@ TEST_F(QuicStreamSequencerBufferTest, Move) {
TEST_F(QuicStreamSequencerBufferTest, OnStreamDataInvalidSource) {
// Pass in an invalid source, expects to return error.
- quiche::QuicheStringPiece source;
- source = quiche::QuicheStringPiece(nullptr, 1024);
+ absl::string_view source;
+ source = absl::string_view(nullptr, 1024);
EXPECT_THAT(buffer_->OnStreamData(800, source, &written_, &error_details_),
IsError(QUIC_STREAM_SEQUENCER_INVALID_STATE));
EXPECT_EQ(0u, error_details_.find(quiche::QuicheStrCat(
@@ -320,7 +320,7 @@ TEST_F(QuicStreamSequencerBufferTest, Readv100Bytes) {
QUIC_LOG(ERROR) << error_details_;
EXPECT_EQ(100u, read);
EXPECT_EQ(100u, buffer_->BytesConsumed());
- EXPECT_EQ(source, quiche::QuicheStringPiece(dest, read));
+ EXPECT_EQ(source, absl::string_view(dest, read));
// The first block should be released as its data has been read out.
EXPECT_EQ(nullptr, helper_->GetBlock(0));
EXPECT_TRUE(helper_->CheckBufferInvariants());
@@ -399,7 +399,7 @@ TEST_F(QuicStreamSequencerBufferTest,
// Try to write from [max_capacity_bytes_ - 0.5 * kBlockSizeBytes,
// max_capacity_bytes_ + 512 + 1). But last bytes exceeds current capacity.
source = std::string(0.5 * kBlockSizeBytes + 512 + 1, 'b');
- EXPECT_THAT(buffer_->OnStreamData(2 * kBlockSizeBytes, source, &written_,
+ EXPECT_THAT(buffer_->OnStreamData(8 * kBlockSizeBytes, source, &written_,
&error_details_),
IsError(QUIC_INTERNAL_ERROR));
EXPECT_TRUE(helper_->CheckBufferInvariants());
@@ -523,15 +523,15 @@ TEST_F(QuicStreamSequencerBufferTest,
TEST_F(QuicStreamSequencerBufferTest,
GetReadableRegionsWithMultipleIOVsAcrossEnd) {
- // Write into [0, 2 * kBlockSizeBytes + 1024) and then read out [0, 1024)
+ // Write into [0, 8.5 * kBlockSizeBytes - 1024) and then read out [0, 1024)
// and then append 1024 + 512 bytes.
- std::string source(2.5 * kBlockSizeBytes - 1024, 'a');
+ std::string source(8.5 * kBlockSizeBytes - 1024, 'a');
buffer_->OnStreamData(0, source, &written_, &error_details_);
char dest[1024];
helper_->Read(dest, 1024);
// Write across the end.
source = std::string(1024 + 512, 'b');
- buffer_->OnStreamData(2.5 * kBlockSizeBytes - 1024, source, &written_,
+ buffer_->OnStreamData(8.5 * kBlockSizeBytes - 1024, source, &written_,
&error_details_);
// Use short iovec's.
iovec iovs[2];
@@ -540,11 +540,11 @@ TEST_F(QuicStreamSequencerBufferTest,
EXPECT_EQ(kBlockSizeBytes - 1024, iovs[0].iov_len);
EXPECT_EQ(kBlockSizeBytes, iovs[1].iov_len);
// Use long iovec's and wrap the end of buffer.
- iovec iovs1[5];
- EXPECT_EQ(4, buffer_->GetReadableRegions(iovs1, 5));
- EXPECT_EQ(0.5 * kBlockSizeBytes, iovs1[2].iov_len);
- EXPECT_EQ(512u, iovs1[3].iov_len);
- EXPECT_EQ(std::string(512, 'b'), IovecToStringPiece(iovs1[3]));
+ iovec iovs1[11];
+ EXPECT_EQ(10, buffer_->GetReadableRegions(iovs1, 11));
+ EXPECT_EQ(0.5 * kBlockSizeBytes, iovs1[8].iov_len);
+ EXPECT_EQ(512u, iovs1[9].iov_len);
+ EXPECT_EQ(std::string(512, 'b'), IovecToStringPiece(iovs1[9]));
}
TEST_F(QuicStreamSequencerBufferTest, GetReadableRegionEmpty) {
@@ -610,8 +610,7 @@ TEST_F(QuicStreamSequencerBufferTest, PeekSingleBlock) {
// Peek at a different offset.
EXPECT_TRUE(buffer_->PeekRegion(100, &iov));
- EXPECT_EQ(quiche::QuicheStringPiece(source).substr(100),
- IovecToStringPiece(iov));
+ EXPECT_EQ(absl::string_view(source).substr(100), IovecToStringPiece(iov));
// Peeking at or after FirstMissingByte() returns false.
EXPECT_FALSE(buffer_->PeekRegion(kBlockSizeBytes, &iov));
@@ -638,15 +637,15 @@ TEST_F(QuicStreamSequencerBufferTest, PeekTwoWritesInSingleBlock) {
// Peek with an offset inside the first write.
const QuicStreamOffset offset1 = 500;
EXPECT_TRUE(buffer_->PeekRegion(offset1, &iov));
- EXPECT_EQ(quiche::QuicheStringPiece(source1).substr(offset1),
+ EXPECT_EQ(absl::string_view(source1).substr(offset1),
IovecToStringPiece(iov).substr(0, length1 - offset1));
- EXPECT_EQ(quiche::QuicheStringPiece(source2),
+ EXPECT_EQ(absl::string_view(source2),
IovecToStringPiece(iov).substr(length1 - offset1));
// Peek with an offset inside the second write.
const QuicStreamOffset offset2 = 1500;
EXPECT_TRUE(buffer_->PeekRegion(offset2, &iov));
- EXPECT_EQ(quiche::QuicheStringPiece(source2).substr(offset2 - length1),
+ EXPECT_EQ(absl::string_view(source2).substr(offset2 - length1),
IovecToStringPiece(iov));
// Peeking at or after FirstMissingByte() returns false.
@@ -671,19 +670,16 @@ TEST_F(QuicStreamSequencerBufferTest, PeekBufferWithMultipleBlocks) {
EXPECT_TRUE(buffer_->PeekRegion(0, &iov));
EXPECT_EQ(kBlockSizeBytes, iov.iov_len);
EXPECT_EQ(source1, IovecToStringPiece(iov).substr(0, length1));
- EXPECT_EQ(
- quiche::QuicheStringPiece(source2).substr(0, kBlockSizeBytes - length1),
- IovecToStringPiece(iov).substr(length1));
+ EXPECT_EQ(absl::string_view(source2).substr(0, kBlockSizeBytes - length1),
+ IovecToStringPiece(iov).substr(length1));
EXPECT_TRUE(buffer_->PeekRegion(length1, &iov));
- EXPECT_EQ(
- quiche::QuicheStringPiece(source2).substr(0, kBlockSizeBytes - length1),
- IovecToStringPiece(iov));
+ EXPECT_EQ(absl::string_view(source2).substr(0, kBlockSizeBytes - length1),
+ IovecToStringPiece(iov));
EXPECT_TRUE(buffer_->PeekRegion(kBlockSizeBytes, &iov));
- EXPECT_EQ(
- quiche::QuicheStringPiece(source2).substr(kBlockSizeBytes - length1),
- IovecToStringPiece(iov));
+ EXPECT_EQ(absl::string_view(source2).substr(kBlockSizeBytes - length1),
+ IovecToStringPiece(iov));
// Peeking at or after FirstMissingByte() returns false.
EXPECT_FALSE(buffer_->PeekRegion(length1 + length2, &iov));
@@ -706,12 +702,10 @@ TEST_F(QuicStreamSequencerBufferTest, PeekAfterConsumed) {
EXPECT_FALSE(buffer_->PeekRegion(512, &iov));
EXPECT_TRUE(buffer_->PeekRegion(1024, &iov));
- EXPECT_EQ(quiche::QuicheStringPiece(source1).substr(1024),
- IovecToStringPiece(iov));
+ EXPECT_EQ(absl::string_view(source1).substr(1024), IovecToStringPiece(iov));
EXPECT_TRUE(buffer_->PeekRegion(1500, &iov));
- EXPECT_EQ(quiche::QuicheStringPiece(source1).substr(1500),
- IovecToStringPiece(iov));
+ EXPECT_EQ(absl::string_view(source1).substr(1500), IovecToStringPiece(iov));
// Consume rest of block.
EXPECT_TRUE(buffer_->MarkConsumed(kBlockSizeBytes - 1024));
@@ -725,8 +719,7 @@ TEST_F(QuicStreamSequencerBufferTest, PeekAfterConsumed) {
EXPECT_EQ(source2, IovecToStringPiece(iov));
EXPECT_TRUE(buffer_->PeekRegion(kBlockSizeBytes + 128, &iov));
- EXPECT_EQ(quiche::QuicheStringPiece(source2).substr(128),
- IovecToStringPiece(iov));
+ EXPECT_EQ(absl::string_view(source2).substr(128), IovecToStringPiece(iov));
// Peeking into consumed data still fails.
EXPECT_FALSE(buffer_->PeekRegion(0, &iov));
@@ -802,20 +795,20 @@ TEST_F(QuicStreamSequencerBufferTest, MarkConsumedAcrossBlock) {
}
TEST_F(QuicStreamSequencerBufferTest, MarkConsumedAcrossEnd) {
- // Write into [0, 2.5 * kBlockSizeBytes - 1024) and then read out [0, 1024)
+ // Write into [0, 8.5 * kBlockSizeBytes - 1024) and then read out [0, 1024)
// and then append 1024 + 512 bytes.
- std::string source(2.5 * kBlockSizeBytes - 1024, 'a');
+ std::string source(8.5 * kBlockSizeBytes - 1024, 'a');
buffer_->OnStreamData(0, source, &written_, &error_details_);
char dest[1024];
helper_->Read(dest, 1024);
source = std::string(1024 + 512, 'b');
- buffer_->OnStreamData(2.5 * kBlockSizeBytes - 1024, source, &written_,
+ buffer_->OnStreamData(8.5 * kBlockSizeBytes - 1024, source, &written_,
&error_details_);
EXPECT_EQ(1024u, buffer_->BytesConsumed());
- // Consume to the end of 2nd block.
- buffer_->MarkConsumed(2 * kBlockSizeBytes - 1024);
- EXPECT_EQ(2 * kBlockSizeBytes, buffer_->BytesConsumed());
+ // Consume to the end of 8th block.
+ buffer_->MarkConsumed(8 * kBlockSizeBytes - 1024);
+ EXPECT_EQ(8 * kBlockSizeBytes, buffer_->BytesConsumed());
// Consume across the physical end of buffer
buffer_->MarkConsumed(0.5 * kBlockSizeBytes + 500);
EXPECT_EQ(max_capacity_bytes_ + 500, buffer_->BytesConsumed());
@@ -828,7 +821,7 @@ TEST_F(QuicStreamSequencerBufferTest, MarkConsumedAcrossEnd) {
}
TEST_F(QuicStreamSequencerBufferTest, FlushBufferedFrames) {
- // Write into [0, 2.5 * kBlockSizeBytes - 1024) and then read out [0, 1024).
+ // Write into [0, 8.5 * kBlockSizeBytes - 1024) and then read out [0, 1024).
std::string source(max_capacity_bytes_ - 1024, 'a');
buffer_->OnStreamData(0, source, &written_, &error_details_);
char dest[1024];
@@ -871,12 +864,12 @@ TEST_F(QuicStreamSequencerBufferTest, TooManyGaps) {
class QuicStreamSequencerBufferRandomIOTest
: public QuicStreamSequencerBufferTest {
public:
- typedef std::pair<QuicStreamOffset, size_t> OffsetSizePair;
+ using OffsetSizePair = std::pair<QuicStreamOffset, size_t>;
void SetUp() override {
// Test against a larger capacity then above tests. Also make sure the last
// block is partially available to use.
- max_capacity_bytes_ = 6.25 * kBlockSizeBytes;
+ max_capacity_bytes_ = 8.25 * kBlockSizeBytes;
// Stream to be buffered should be larger than the capacity to test wrap
// around.
bytes_to_buffer_ = 2 * max_capacity_bytes_;
@@ -933,7 +926,7 @@ class QuicStreamSequencerBufferRandomIOTest
for (size_t i = 0; i < num_to_write; ++i) {
write_buf[i] = (offset + i) % 256;
}
- quiche::QuicheStringPiece string_piece_w(write_buf.get(), num_to_write);
+ absl::string_view string_piece_w(write_buf.get(), num_to_write);
auto result = buffer_->OnStreamData(offset, string_piece_w, &written_,
&error_details_);
if (result == QUIC_NO_ERROR) {
@@ -1097,6 +1090,50 @@ TEST_F(QuicStreamSequencerBufferRandomIOTest, RandomWriteAndConsumeInPlace) {
EXPECT_LE(bytes_to_buffer_, total_bytes_written_);
}
+TEST_F(QuicStreamSequencerBufferTest, GrowBlockSizeOnDemand) {
+ SetQuicReloadableFlag(quic_allocate_stream_sequencer_buffer_blocks_on_demand,
+ true);
+ max_capacity_bytes_ = 1024 * kBlockSizeBytes;
+ std::string source_of_one_block(kBlockSizeBytes, 'a');
+ Initialize();
+
+ ASSERT_EQ(helper_->current_blocks_count(), 0u);
+
+ // A minimum of 8 blocks are allocated
+ buffer_->OnStreamData(0, source_of_one_block, &written_, &error_details_);
+ ASSERT_EQ(helper_->current_blocks_count(), 8u);
+
+ // Number of blocks doesn't grow if the data is within the capacity.
+ buffer_->OnStreamData(kBlockSizeBytes * 7, source_of_one_block, &written_,
+ &error_details_);
+ ASSERT_EQ(helper_->current_blocks_count(), 8u);
+
+ // Number of blocks grows by a factor of 4 normally.
+ buffer_->OnStreamData(kBlockSizeBytes * 8, "a", &written_, &error_details_);
+ ASSERT_EQ(helper_->current_blocks_count(), 32u);
+
+ // Number of blocks grow to the demanded size of 140 instead of 128 since
+ // that's not enough.
+ buffer_->OnStreamData(kBlockSizeBytes * 139, source_of_one_block, &written_,
+ &error_details_);
+ ASSERT_EQ(helper_->current_blocks_count(), 140u);
+
+ // Number of blocks grows by a factor of 4 normally.
+ buffer_->OnStreamData(kBlockSizeBytes * 140, source_of_one_block, &written_,
+ &error_details_);
+ ASSERT_EQ(helper_->current_blocks_count(), 560u);
+
+ // max_capacity_bytes is reached and number of blocks is capped.
+ buffer_->OnStreamData(kBlockSizeBytes * 560, source_of_one_block, &written_,
+ &error_details_);
+ ASSERT_EQ(helper_->current_blocks_count(), 1024u);
+
+ // max_capacity_bytes is reached and number of blocks is capped.
+ buffer_->OnStreamData(kBlockSizeBytes * 1025, source_of_one_block, &written_,
+ &error_details_);
+ ASSERT_EQ(helper_->current_blocks_count(), 1024u);
+}
+
} // anonymous namespace
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_test.cc
index bdf141267a7..a996ee21d64 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream_sequencer_test.cc
@@ -11,6 +11,8 @@
#include <utility>
#include <vector>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
@@ -19,8 +21,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using testing::_;
using testing::AnyNumber;
@@ -52,7 +52,7 @@ class QuicStreamSequencerTest : public QuicTest {
public:
void ConsumeData(size_t num_bytes) {
char buffer[1024];
- ASSERT_GT(QUICHE_ARRAYSIZE(buffer), num_bytes);
+ ASSERT_GT(ABSL_ARRAYSIZE(buffer), num_bytes);
struct iovec iov;
iov.iov_base = buffer;
iov.iov_len = num_bytes;
@@ -96,7 +96,7 @@ class QuicStreamSequencerTest : public QuicTest {
const std::vector<std::string>& expected) {
iovec iovecs[5];
size_t num_iovecs =
- sequencer.GetReadableRegions(iovecs, QUICHE_ARRAYSIZE(iovecs));
+ sequencer.GetReadableRegions(iovecs, ABSL_ARRAYSIZE(iovecs));
return VerifyReadableRegion(sequencer, expected) &&
VerifyIovecs(sequencer, iovecs, num_iovecs, expected);
}
@@ -116,7 +116,7 @@ class QuicStreamSequencerTest : public QuicTest {
return true;
}
- bool VerifyIovec(const iovec& iovec, quiche::QuicheStringPiece expected) {
+ bool VerifyIovec(const iovec& iovec, absl::string_view expected) {
if (iovec.iov_len != expected.length()) {
QUIC_LOG(ERROR) << "Invalid length: " << iovec.iov_len << " vs "
<< expected.length();
@@ -376,11 +376,11 @@ TEST_F(QuicStreamSequencerTest, MultipleOffsets) {
class QuicSequencerRandomTest : public QuicStreamSequencerTest {
public:
- typedef std::pair<int, std::string> Frame;
- typedef std::vector<Frame> FrameList;
+ using Frame = std::pair<int, std::string>;
+ using FrameList = std::vector<Frame>;
void CreateFrames() {
- int payload_size = QUICHE_ARRAYSIZE(kPayload) - 1;
+ int payload_size = ABSL_ARRAYSIZE(kPayload) - 1;
int remaining_payload = payload_size;
while (remaining_payload != 0) {
int size = std::min(OneToN(6), remaining_payload);
@@ -403,10 +403,10 @@ class QuicSequencerRandomTest : public QuicStreamSequencerTest {
void ReadAvailableData() {
// Read all available data
- char output[QUICHE_ARRAYSIZE(kPayload) + 1];
+ char output[ABSL_ARRAYSIZE(kPayload) + 1];
iovec iov;
iov.iov_base = output;
- iov.iov_len = QUICHE_ARRAYSIZE(output);
+ iov.iov_len = ABSL_ARRAYSIZE(output);
int bytes_read = sequencer_->Readv(&iov, 1);
EXPECT_NE(0, bytes_read);
output_.append(output, bytes_read);
@@ -442,9 +442,9 @@ TEST_F(QuicSequencerRandomTest, RandomFramesNoDroppingNoBackup) {
list_.erase(list_.begin() + index);
}
- ASSERT_EQ(QUICHE_ARRAYSIZE(kPayload) - 1, output_.size());
+ ASSERT_EQ(ABSL_ARRAYSIZE(kPayload) - 1, output_.size());
EXPECT_EQ(kPayload, output_);
- EXPECT_EQ(QUICHE_ARRAYSIZE(kPayload) - 1, total_bytes_consumed);
+ EXPECT_EQ(ABSL_ARRAYSIZE(kPayload) - 1, total_bytes_consumed);
}
TEST_F(QuicSequencerRandomTest, RandomFramesNoDroppingBackup) {
@@ -464,7 +464,7 @@ TEST_F(QuicSequencerRandomTest, RandomFramesNoDroppingBackup) {
total_bytes_consumed += bytes;
}));
- while (output_.size() != QUICHE_ARRAYSIZE(kPayload) - 1) {
+ while (output_.size() != ABSL_ARRAYSIZE(kPayload) - 1) {
if (!list_.empty() && OneToN(2) == 1) { // Send data
int index = OneToN(list_.size()) - 1;
OnFrame(list_[index].first, list_[index].second.data());
@@ -480,7 +480,7 @@ TEST_F(QuicSequencerRandomTest, RandomFramesNoDroppingBackup) {
ASSERT_EQ(0, iovs_peeked);
ASSERT_FALSE(sequencer_->GetReadableRegion(peek_iov));
}
- int total_bytes_to_peek = QUICHE_ARRAYSIZE(buffer);
+ int total_bytes_to_peek = ABSL_ARRAYSIZE(buffer);
for (int i = 0; i < iovs_peeked; ++i) {
int bytes_to_peek =
std::min<int>(peek_iov[i].iov_len, total_bytes_to_peek);
@@ -497,7 +497,7 @@ TEST_F(QuicSequencerRandomTest, RandomFramesNoDroppingBackup) {
}
EXPECT_EQ(std::string(kPayload), output_);
EXPECT_EQ(std::string(kPayload), peeked_);
- EXPECT_EQ(QUICHE_ARRAYSIZE(kPayload) - 1, total_bytes_consumed);
+ EXPECT_EQ(ABSL_ARRAYSIZE(kPayload) - 1, total_bytes_consumed);
}
// Same as above, just using a different method for reading.
@@ -600,10 +600,10 @@ TEST_F(QuicStreamSequencerTest, OverlappingFramesReceived) {
// overlapping byte ranges - if they do, we close the connection.
QuicStreamId id = 1;
- QuicStreamFrame frame1(id, false, 1, quiche::QuicheStringPiece("hello"));
+ QuicStreamFrame frame1(id, false, 1, absl::string_view("hello"));
sequencer_->OnStreamFrame(frame1);
- QuicStreamFrame frame2(id, false, 2, quiche::QuicheStringPiece("hello"));
+ QuicStreamFrame frame2(id, false, 2, absl::string_view("hello"));
EXPECT_CALL(stream_, OnUnrecoverableError(QUIC_OVERLAPPING_STREAM_DATA, _))
.Times(0);
sequencer_->OnStreamFrame(frame2);
@@ -635,7 +635,7 @@ TEST_F(QuicStreamSequencerTest, DataAvailableOnOverlappingFrames) {
EXPECT_EQ(0u, sequencer_->NumBytesBuffered());
// Received [1498, 1503).
- QuicStreamFrame frame3(id, false, 1498, quiche::QuicheStringPiece("hello"));
+ QuicStreamFrame frame3(id, false, 1498, absl::string_view("hello"));
EXPECT_CALL(stream_, OnDataAvailable());
sequencer_->OnStreamFrame(frame3);
EXPECT_CALL(stream_, AddBytesConsumed(3));
@@ -644,7 +644,7 @@ TEST_F(QuicStreamSequencerTest, DataAvailableOnOverlappingFrames) {
EXPECT_EQ(0u, sequencer_->NumBytesBuffered());
// Received [1000, 1005).
- QuicStreamFrame frame4(id, false, 1000, quiche::QuicheStringPiece("hello"));
+ QuicStreamFrame frame4(id, false, 1000, absl::string_view("hello"));
EXPECT_CALL(stream_, OnDataAvailable()).Times(0);
sequencer_->OnStreamFrame(frame4);
EXPECT_EQ(1503u, sequencer_->NumBytesConsumed());
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_stream_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_stream_test.cc
index f2b5563344b..d241dac9098 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_stream_test.cc
@@ -8,6 +8,10 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_rst_stream_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
#include "net/third_party/quiche/src/quic/core/quic_constants.h"
@@ -30,9 +34,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using testing::_;
using testing::AnyNumber;
@@ -72,6 +73,7 @@ class TestStream : public QuicStream {
using QuicStream::CanWriteNewDataAfterData;
using QuicStream::CloseWriteSide;
using QuicStream::fin_buffered;
+ using QuicStream::MaybeSendStopSending;
using QuicStream::OnClose;
using QuicStream::WriteMemSlices;
using QuicStream::WriteOrBufferData;
@@ -94,7 +96,9 @@ class QuicStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_);
session_->Initialize();
-
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
QuicConfigPeer::SetReceivedInitialSessionFlowControlWindow(
session_->config(), kMinimumFlowControlSendWindow);
QuicConfigPeer::SetReceivedInitialMaxStreamDataBytesUnidirectional(
@@ -112,8 +116,15 @@ class QuicStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
// session_ now owns stream_.
session_->ActivateStream(QuicWrapUnique(stream_));
// Ignore resetting when session_ is terminated.
- EXPECT_CALL(*session_, SendRstStream(kTestStreamId, _, _, _))
- .Times(AnyNumber());
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(kTestStreamId, _, _, _))
+ .Times(AnyNumber());
+ } else {
+ EXPECT_CALL(*session_, MaybeSendStopSendingFrame(kTestStreamId, _))
+ .Times(AnyNumber());
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(kTestStreamId, _, _))
+ .Times(AnyNumber());
+ }
write_blocked_list_ =
QuicSessionPeer::GetWriteBlockedStreams(session_.get());
}
@@ -132,7 +143,7 @@ class QuicStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
QuicStreamOffset /*offset*/,
StreamSendingState /*state*/,
TransmissionType /*type*/,
- quiche::QuicheOptional<EncryptionLevel> /*level*/) {
+ absl::optional<EncryptionLevel> /*level*/) {
session_->ResetStream(id, QUIC_STREAM_CANCELLED);
return QuicConsumedData(1, false);
}
@@ -295,8 +306,7 @@ TEST_P(QuicStreamTest, NoBlockingIfNoDataOrFin) {
// Write no data and no fin. If we consume nothing we should not be write
// blocked.
EXPECT_QUIC_BUG(
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(), false, nullptr),
- "");
+ stream_->WriteOrBufferData(absl::string_view(), false, nullptr), "");
EXPECT_FALSE(HasWriteBlockedStreams());
}
@@ -308,10 +318,9 @@ TEST_P(QuicStreamTest, BlockIfOnlySomeDataConsumed) {
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 1u, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(kData1, 2), false,
- nullptr);
+ stream_->WriteOrBufferData(absl::string_view(kData1, 2), false, nullptr);
EXPECT_TRUE(session_->HasUnackedStreamData());
ASSERT_EQ(1u, write_blocked_list_->NumBlockedStreams());
EXPECT_EQ(1u, stream_->BufferedDataBytes());
@@ -327,10 +336,9 @@ TEST_P(QuicStreamTest, BlockIfFinNotConsumedWithData) {
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 2u, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(kData1, 2), true,
- nullptr);
+ stream_->WriteOrBufferData(absl::string_view(kData1, 2), true, nullptr);
EXPECT_TRUE(session_->HasUnackedStreamData());
ASSERT_EQ(1u, write_blocked_list_->NumBlockedStreams());
}
@@ -342,7 +350,7 @@ TEST_P(QuicStreamTest, BlockIfSoloFinNotConsumed) {
// as the fin was not consumed.
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(Return(QuicConsumedData(0, false)));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(), true, nullptr);
+ stream_->WriteOrBufferData(absl::string_view(), true, nullptr);
ASSERT_EQ(1u, write_blocked_list_->NumBlockedStreams());
}
@@ -354,8 +362,7 @@ TEST_P(QuicStreamTest, CloseOnPartialWrite) {
// crash with an unknown stream.
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(Invoke(this, &QuicStreamTest::CloseStreamOnWriteError));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(kData1, 2), false,
- nullptr);
+ stream_->WriteOrBufferData(absl::string_view(kData1, 2), false, nullptr);
ASSERT_EQ(0u, write_blocked_list_->NumBlockedStreams());
}
@@ -375,7 +382,7 @@ TEST_P(QuicStreamTest, WriteOrBufferData) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), kDataLen - 1, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
stream_->WriteOrBufferData(kData1, false, nullptr);
@@ -391,8 +398,7 @@ TEST_P(QuicStreamTest, WriteOrBufferData) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), kDataLen - 1, kDataLen - 1,
- NO_FIN, NOT_RETRANSMISSION,
- QUICHE_NULLOPT);
+ NO_FIN, NOT_RETRANSMISSION, absl::nullopt);
}));
EXPECT_CALL(*stream_, OnCanWriteNewData());
stream_->OnCanWrite();
@@ -402,8 +408,7 @@ TEST_P(QuicStreamTest, WriteOrBufferData) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 2u, 2 * kDataLen - 2,
- NO_FIN, NOT_RETRANSMISSION,
- QUICHE_NULLOPT);
+ NO_FIN, NOT_RETRANSMISSION, absl::nullopt);
}));
EXPECT_CALL(*stream_, OnCanWriteNewData());
stream_->OnCanWrite();
@@ -427,13 +432,21 @@ TEST_P(QuicStreamTest, WriteOrBufferDataReachStreamLimit) {
TEST_P(QuicStreamTest, ConnectionCloseAfterStreamClose) {
Initialize();
- QuicStreamPeer::CloseReadSide(stream_);
- stream_->CloseWriteSide();
- EXPECT_THAT(stream_->stream_error(), IsQuicStreamNoError());
+ QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
+ QUIC_STREAM_CANCELLED, 1234);
+ stream_->OnStreamReset(rst_frame);
+ if (VersionHasIetfQuicFrames(session_->transport_version())) {
+ // Create and inject a STOP SENDING frame to complete the close
+ // of the stream. This is only needed for version 99/IETF QUIC.
+ QuicStopSendingFrame stop_sending(kInvalidControlFrameId, stream_->id(),
+ QUIC_STREAM_CANCELLED);
+ session_->OnStopSendingFrame(stop_sending);
+ }
+ EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_STREAM_CANCELLED));
EXPECT_THAT(stream_->connection_error(), IsQuicNoError());
stream_->OnConnectionClosed(QUIC_INTERNAL_ERROR,
ConnectionCloseSource::FROM_SELF);
- EXPECT_THAT(stream_->stream_error(), IsQuicStreamNoError());
+ EXPECT_THAT(stream_->stream_error(), IsStreamError(QUIC_STREAM_CANCELLED));
EXPECT_THAT(stream_->connection_error(), IsQuicNoError());
}
@@ -450,18 +463,29 @@ TEST_P(QuicStreamTest, RstAlwaysSentIfNoFinSent) {
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 1u, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(kData1, 1), false,
- nullptr);
+ stream_->WriteOrBufferData(absl::string_view(kData1, 1), false, nullptr);
EXPECT_TRUE(session_->HasUnackedStreamData());
EXPECT_FALSE(fin_sent());
EXPECT_FALSE(rst_sent());
// Now close the stream, and expect that we send a RST.
- EXPECT_CALL(*session_, SendRstStream(_, _, _, _));
- QuicStreamPeer::CloseReadSide(stream_);
- stream_->CloseWriteSide();
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(kTestStreamId, _, _, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(kTestStreamId, _, _));
+ }
+ QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
+ QUIC_STREAM_CANCELLED, 1234);
+ stream_->OnStreamReset(rst_frame);
+ if (VersionHasIetfQuicFrames(session_->transport_version())) {
+ // Create and inject a STOP SENDING frame to complete the close
+ // of the stream. This is only needed for version 99/IETF QUIC.
+ QuicStopSendingFrame stop_sending(kInvalidControlFrameId, stream_->id(),
+ QUIC_STREAM_CANCELLED);
+ session_->OnStopSendingFrame(stop_sending);
+ }
EXPECT_FALSE(session_->HasUnackedStreamData());
EXPECT_FALSE(fin_sent());
EXPECT_TRUE(rst_sent());
@@ -480,10 +504,9 @@ TEST_P(QuicStreamTest, RstNotSentIfFinSent) {
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 1u, 0u, FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(kData1, 1), true,
- nullptr);
+ stream_->WriteOrBufferData(absl::string_view(kData1, 1), true, nullptr);
EXPECT_TRUE(fin_sent());
EXPECT_FALSE(rst_sent());
@@ -505,8 +528,12 @@ TEST_P(QuicStreamTest, OnlySendOneRst) {
EXPECT_FALSE(rst_sent());
// Reset the stream.
- const int expected_resets = 1;
- EXPECT_CALL(*session_, SendRstStream(_, _, _, _)).Times(expected_resets);
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(kTestStreamId, _, _, _)).Times(1);
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(kTestStreamId, _, _))
+ .Times(1);
+ }
stream_->Reset(QUIC_STREAM_CANCELLED);
EXPECT_FALSE(fin_sent());
EXPECT_TRUE(rst_sent());
@@ -597,9 +624,9 @@ TEST_P(QuicStreamTest, StopReadingSendsFlowControl) {
EXPECT_CALL(*connection_,
CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _))
.Times(0);
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(AtLeast(1))
- .WillRepeatedly(Invoke(&ClearControlFrame));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
std::string data(1000, 'x');
for (QuicStreamOffset offset = 0;
@@ -647,8 +674,6 @@ TEST_P(QuicStreamTest, InvalidFinalByteOffsetFromRst) {
CloseConnection(QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA, _, _));
stream_->OnStreamReset(rst_frame);
EXPECT_TRUE(stream_->HasReceivedFinalOffset());
- QuicStreamPeer::CloseReadSide(stream_);
- stream_->CloseWriteSide();
}
TEST_P(QuicStreamTest, FinalByteOffsetFromZeroLengthStreamFrame) {
@@ -673,7 +698,7 @@ TEST_P(QuicStreamTest, FinalByteOffsetFromZeroLengthStreamFrame) {
current_connection_flow_control_offset);
QuicStreamFrame zero_length_stream_frame_with_fin(
stream_->id(), /*fin=*/true, kByteOffsetExceedingFlowControlWindow,
- quiche::QuicheStringPiece());
+ absl::string_view());
EXPECT_EQ(0, zero_length_stream_frame_with_fin.data_length);
EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0);
@@ -744,10 +769,9 @@ TEST_P(QuicStreamTest, SetDrainingIncomingOutgoing) {
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 2u, 0u, FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(kData1, 2), true,
- nullptr);
+ stream_->WriteOrBufferData(absl::string_view(kData1, 2), true, nullptr);
EXPECT_TRUE(stream_->write_side_closed());
EXPECT_EQ(1u, QuicSessionPeer::GetNumDrainingStreams(session_.get()));
@@ -762,10 +786,9 @@ TEST_P(QuicStreamTest, SetDrainingOutgoingIncoming) {
EXPECT_CALL(*session_, WritevData(kTestStreamId, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 2u, 0u, FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
- stream_->WriteOrBufferData(quiche::QuicheStringPiece(kData1, 2), true,
- nullptr);
+ stream_->WriteOrBufferData(absl::string_view(kData1, 2), true, nullptr);
EXPECT_TRUE(stream_->write_side_closed());
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
@@ -920,22 +943,35 @@ TEST_P(QuicStreamTest, CancelStream) {
EXPECT_TRUE(session_->HasUnackedStreamData());
EXPECT_EQ(1u, QuicStreamPeer::SendBuffer(stream_).size());
// Cancel stream.
- stream_->Reset(QUIC_STREAM_NO_ERROR);
+ if (session_->split_up_send_rst()) {
+ stream_->MaybeSendStopSending(QUIC_STREAM_NO_ERROR);
+ } else {
+ stream_->Reset(QUIC_STREAM_NO_ERROR);
+ }
// stream still waits for acks as the error code is QUIC_STREAM_NO_ERROR, and
// data is going to be retransmitted.
EXPECT_TRUE(stream_->IsWaitingForAcks());
EXPECT_TRUE(session_->HasUnackedStreamData());
EXPECT_CALL(*connection_,
OnStreamReset(stream_->id(), QUIC_STREAM_CANCELLED));
- EXPECT_CALL(*connection_, SendControlFrame(_))
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
.Times(AtLeast(1))
- .WillRepeatedly(Invoke(&ClearControlFrame));
- EXPECT_CALL(*session_,
- SendRstStream(stream_->id(), QUIC_STREAM_CANCELLED, 9, _))
- .WillOnce(InvokeWithoutArgs([this]() {
- session_->ReallySendRstStream(stream_->id(), QUIC_STREAM_CANCELLED,
- stream_->stream_bytes_written(), false);
- }));
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(stream_->id(), QUIC_STREAM_CANCELLED, 9, _))
+ .WillOnce(InvokeWithoutArgs([this]() {
+ session_->ReallySendRstStream(stream_->id(), QUIC_STREAM_CANCELLED,
+ stream_->stream_bytes_written(), false);
+ }));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(_, _, _))
+ .WillOnce(InvokeWithoutArgs([this]() {
+ session_->ReallyMaybeSendRstStreamFrame(
+ stream_->id(), QUIC_STREAM_CANCELLED,
+ stream_->stream_bytes_written());
+ }));
+ }
stream_->Reset(QUIC_STREAM_CANCELLED);
EXPECT_EQ(1u, QuicStreamPeer::SendBuffer(stream_).size());
@@ -966,8 +1002,14 @@ TEST_P(QuicStreamTest, RstFrameReceivedStreamNotFinishSending) {
// RST_STREAM received.
QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
QUIC_STREAM_CANCELLED, 9);
- EXPECT_CALL(*session_,
- SendRstStream(stream_->id(), QUIC_RST_ACKNOWLEDGEMENT, 9, _));
+
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(stream_->id(), QUIC_RST_ACKNOWLEDGEMENT, 9, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(
+ stream_->id(), QUIC_RST_ACKNOWLEDGEMENT, 9));
+ }
stream_->OnStreamReset(rst_frame);
EXPECT_EQ(1u, QuicStreamPeer::SendBuffer(stream_).size());
// Stream stops waiting for acks as it does not finish sending and rst is
@@ -1010,8 +1052,14 @@ TEST_P(QuicStreamTest, ConnectionClosed) {
stream_->WriteOrBufferData(kData1, false, nullptr);
EXPECT_TRUE(stream_->IsWaitingForAcks());
EXPECT_TRUE(session_->HasUnackedStreamData());
- EXPECT_CALL(*session_,
- SendRstStream(stream_->id(), QUIC_RST_ACKNOWLEDGEMENT, 9, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(stream_->id(), QUIC_RST_ACKNOWLEDGEMENT, 9, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(
+ stream_->id(), QUIC_RST_ACKNOWLEDGEMENT, 9));
+ }
+ QuicConnectionPeer::SetConnectionClose(connection_);
stream_->OnConnectionClosed(QUIC_INTERNAL_ERROR,
ConnectionCloseSource::FROM_SELF);
EXPECT_EQ(1u, QuicStreamPeer::SendBuffer(stream_).size());
@@ -1039,7 +1087,7 @@ TEST_P(QuicStreamTest, WriteBufferedData) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 100u, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
stream_->WriteOrBufferData(data, false, nullptr);
stream_->WriteOrBufferData(data, false, nullptr);
@@ -1052,7 +1100,7 @@ TEST_P(QuicStreamTest, WriteBufferedData) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 100, 100u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
// Buffered data size > threshold, do not ask upper layer for more data.
EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(0);
@@ -1067,7 +1115,7 @@ TEST_P(QuicStreamTest, WriteBufferedData) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this, data_to_write]() {
return session_->ConsumeData(stream_->id(), data_to_write, 200u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
// Buffered data size < threshold, ask upper layer for more data.
EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(1);
@@ -1117,7 +1165,7 @@ TEST_P(QuicStreamTest, WriteBufferedData) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this, data_to_write]() {
return session_->ConsumeData(stream_->id(), data_to_write, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(1);
@@ -1169,8 +1217,8 @@ TEST_P(QuicStreamTest, WriteMemSlices) {
Initialize();
char data[1024];
std::vector<std::pair<char*, size_t>> buffers;
- buffers.push_back(std::make_pair(data, QUICHE_ARRAYSIZE(data)));
- buffers.push_back(std::make_pair(data, QUICHE_ARRAYSIZE(data)));
+ buffers.push_back(std::make_pair(data, ABSL_ARRAYSIZE(data)));
+ buffers.push_back(std::make_pair(data, ABSL_ARRAYSIZE(data)));
QuicTestMemSliceVector vector1(buffers);
QuicTestMemSliceVector vector2(buffers);
QuicMemSliceSpan span1 = vector1.span();
@@ -1179,13 +1227,13 @@ TEST_P(QuicStreamTest, WriteMemSlices) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 100u, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
// There is no buffered data before, all data should be consumed.
QuicConsumedData consumed = stream_->WriteMemSlices(span1, false);
EXPECT_EQ(2048u, consumed.bytes_consumed);
EXPECT_FALSE(consumed.fin_consumed);
- EXPECT_EQ(2 * QUICHE_ARRAYSIZE(data) - 100, stream_->BufferedDataBytes());
+ EXPECT_EQ(2 * ABSL_ARRAYSIZE(data) - 100, stream_->BufferedDataBytes());
EXPECT_FALSE(stream_->fin_buffered());
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _)).Times(0);
@@ -1193,16 +1241,16 @@ TEST_P(QuicStreamTest, WriteMemSlices) {
consumed = stream_->WriteMemSlices(span2, true);
EXPECT_EQ(0u, consumed.bytes_consumed);
EXPECT_FALSE(consumed.fin_consumed);
- EXPECT_EQ(2 * QUICHE_ARRAYSIZE(data) - 100, stream_->BufferedDataBytes());
+ EXPECT_EQ(2 * ABSL_ARRAYSIZE(data) - 100, stream_->BufferedDataBytes());
EXPECT_FALSE(stream_->fin_buffered());
QuicByteCount data_to_write =
- 2 * QUICHE_ARRAYSIZE(data) - 100 -
+ 2 * ABSL_ARRAYSIZE(data) - 100 -
GetQuicFlag(FLAGS_quic_buffered_data_threshold) + 1;
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this, data_to_write]() {
return session_->ConsumeData(stream_->id(), data_to_write, 100u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(1);
stream_->OnCanWrite();
@@ -1214,7 +1262,7 @@ TEST_P(QuicStreamTest, WriteMemSlices) {
consumed = stream_->WriteMemSlices(span2, true);
EXPECT_EQ(2048u, consumed.bytes_consumed);
EXPECT_TRUE(consumed.fin_consumed);
- EXPECT_EQ(2 * QUICHE_ARRAYSIZE(data) +
+ EXPECT_EQ(2 * ABSL_ARRAYSIZE(data) +
GetQuicFlag(FLAGS_quic_buffered_data_threshold) - 1,
stream_->BufferedDataBytes());
EXPECT_TRUE(stream_->fin_buffered());
@@ -1233,13 +1281,13 @@ TEST_P(QuicStreamTest, WriteMemSlicesReachStreamLimit) {
QuicStreamPeer::SetStreamBytesWritten(kMaxStreamLength - 5u, stream_);
char data[5];
std::vector<std::pair<char*, size_t>> buffers;
- buffers.push_back(std::make_pair(data, QUICHE_ARRAYSIZE(data)));
+ buffers.push_back(std::make_pair(data, ABSL_ARRAYSIZE(data)));
QuicTestMemSliceVector vector1(buffers);
QuicMemSliceSpan span1 = vector1.span();
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 5u, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
// There is no buffered data before, all data should be consumed.
QuicConsumedData consumed = stream_->WriteMemSlices(span1, false);
@@ -1377,7 +1425,7 @@ TEST_P(QuicStreamTest, OnStreamFrameLost) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 9u, 18u, FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
stream_->OnCanWrite();
EXPECT_FALSE(stream_->HasPendingRetransmission());
@@ -1407,7 +1455,7 @@ TEST_P(QuicStreamTest, CannotBundleLostFin) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 9u, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillOnce(Return(QuicConsumedData(0, true)));
@@ -1430,8 +1478,8 @@ TEST_P(QuicStreamTest, MarkConnectionLevelWriteBlockedOnWindowUpdateFrame) {
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillRepeatedly(Invoke(session_.get(), &MockQuicSession::ConsumeData));
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
std::string data(1024, '.');
stream->WriteOrBufferData(data, false, nullptr);
EXPECT_FALSE(HasWriteBlockedStreams());
@@ -1464,8 +1512,8 @@ TEST_P(QuicStreamTest,
std::string data(100, '.');
EXPECT_CALL(*session_, WritevData(_, _, _, _, _, _))
.WillRepeatedly(Invoke(session_.get(), &MockQuicSession::ConsumeData));
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
stream->WriteOrBufferData(data, false, nullptr);
EXPECT_FALSE(HasWriteBlockedStreams());
@@ -1496,7 +1544,7 @@ TEST_P(QuicStreamTest, RetransmitStreamData) {
EXPECT_CALL(*session_, WritevData(stream_->id(), 10, 0, NO_FIN, _, _))
.WillOnce(InvokeWithoutArgs([this]() {
return session_->ConsumeData(stream_->id(), 8, 0u, NO_FIN,
- NOT_RETRANSMISSION, QUICHE_NULLOPT);
+ NOT_RETRANSMISSION, absl::nullopt);
}));
EXPECT_FALSE(stream_->RetransmitStreamData(0, 18, true, PTO_RETRANSMISSION));
@@ -1535,8 +1583,19 @@ TEST_P(QuicStreamTest, ResetStreamOnTtlExpiresRetransmitLostData) {
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
// Verify stream gets reset because TTL expires.
- EXPECT_CALL(*session_, SendRstStream(_, QUIC_STREAM_TTL_EXPIRED, _, _))
- .Times(1);
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(_, QUIC_STREAM_TTL_EXPIRED, _, _))
+ .Times(1);
+ } else {
+ if (session_->version().UsesHttp3()) {
+ EXPECT_CALL(*session_,
+ MaybeSendStopSendingFrame(_, QUIC_STREAM_TTL_EXPIRED))
+ .Times(1);
+ }
+ EXPECT_CALL(*session_,
+ MaybeSendRstStreamFrame(_, QUIC_STREAM_TTL_EXPIRED, _))
+ .Times(1);
+ }
stream_->OnCanWrite();
}
@@ -1554,8 +1613,19 @@ TEST_P(QuicStreamTest, ResetStreamOnTtlExpiresEarlyRetransmitData) {
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
// Verify stream gets reset because TTL expires.
- EXPECT_CALL(*session_, SendRstStream(_, QUIC_STREAM_TTL_EXPIRED, _, _))
- .Times(1);
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_, SendRstStream(_, QUIC_STREAM_TTL_EXPIRED, _, _))
+ .Times(1);
+ } else {
+ if (session_->version().UsesHttp3()) {
+ EXPECT_CALL(*session_,
+ MaybeSendStopSendingFrame(_, QUIC_STREAM_TTL_EXPIRED))
+ .Times(1);
+ }
+ EXPECT_CALL(*session_,
+ MaybeSendRstStreamFrame(_, QUIC_STREAM_TTL_EXPIRED, _))
+ .Times(1);
+ }
stream_->RetransmitStreamData(0, 100, false, PTO_RETRANSMISSION);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_tag.cc b/chromium/net/third_party/quiche/src/quic/core/quic_tag.cc
index d6c2f6c25de..5b38a8b3a78 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_tag.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_tag.cc
@@ -7,9 +7,11 @@
#include <algorithm>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/escaping.h"
+#include "absl/strings/str_split.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -43,10 +45,10 @@ std::string QuicTagToString(QuicTag tag) {
bool ascii = true;
const QuicTag orig_tag = tag;
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(chars); i++) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(chars); i++) {
chars[i] = static_cast<char>(tag);
if ((chars[i] == 0 || chars[i] == '\xff') &&
- i == QUICHE_ARRAYSIZE(chars) - 1) {
+ i == ABSL_ARRAYSIZE(chars) - 1) {
chars[i] = ' ';
}
if (!isprint(static_cast<unsigned char>(chars[i]))) {
@@ -60,8 +62,8 @@ std::string QuicTagToString(QuicTag tag) {
return std::string(chars, sizeof(chars));
}
- return quiche::QuicheTextUtils::HexEncode(
- reinterpret_cast<const char*>(&orig_tag), sizeof(orig_tag));
+ return absl::BytesToHexString(absl::string_view(
+ reinterpret_cast<const char*>(&orig_tag), sizeof(orig_tag)));
}
uint32_t MakeQuicTag(char a, char b, char c, char d) {
@@ -74,11 +76,11 @@ bool ContainsQuicTag(const QuicTagVector& tag_vector, QuicTag tag) {
tag_vector.end();
}
-QuicTag ParseQuicTag(quiche::QuicheStringPiece tag_string) {
+QuicTag ParseQuicTag(absl::string_view tag_string) {
quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&tag_string);
std::string tag_bytes;
if (tag_string.length() == 8) {
- tag_bytes = quiche::QuicheTextUtils::HexDecode(tag_string);
+ tag_bytes = absl::HexStringToBytes(tag_string);
tag_string = tag_bytes;
}
QuicTag tag = 0;
@@ -92,13 +94,13 @@ QuicTag ParseQuicTag(quiche::QuicheStringPiece tag_string) {
return tag;
}
-QuicTagVector ParseQuicTagVector(quiche::QuicheStringPiece tags_string) {
+QuicTagVector ParseQuicTagVector(absl::string_view tags_string) {
QuicTagVector tag_vector;
quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&tags_string);
if (!tags_string.empty()) {
- std::vector<quiche::QuicheStringPiece> tag_strings =
- quiche::QuicheTextUtils::Split(tags_string, ',');
- for (quiche::QuicheStringPiece tag_string : tag_strings) {
+ std::vector<absl::string_view> tag_strings =
+ absl::StrSplit(tags_string, ',');
+ for (absl::string_view tag_string : tag_strings) {
tag_vector.push_back(ParseQuicTag(tag_string));
}
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_tag.h b/chromium/net/third_party/quiche/src/quic/core/quic_tag.h
index 7ba6cfc5f39..606d89d16ad 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_tag.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_tag.h
@@ -9,8 +9,8 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -22,9 +22,9 @@ namespace quic {
// Tags will often be referred to by their ASCII equivalent, e.g. EXMP. This is
// just a mnemonic for the value 0x504d5845 (little-endian version of the ASCII
// string E X M P).
-typedef uint32_t QuicTag;
-typedef std::map<QuicTag, std::string> QuicTagValueMap;
-typedef std::vector<QuicTag> QuicTagVector;
+using QuicTag = uint32_t;
+using QuicTagValueMap = std::map<QuicTag, std::string>;
+using QuicTagVector = std::vector<QuicTag>;
// MakeQuicTag returns a value given the four bytes. For example:
// MakeQuicTag('C', 'H', 'L', 'O');
@@ -53,12 +53,12 @@ QUIC_EXPORT_PRIVATE std::string QuicTagToString(QuicTag tag);
// corresponding QuicTag. Note that tags that are less than four characters
// long are right-padded with zeroes. Tags that contain non-ASCII characters
// are represented as 8-character-long hexadecimal strings.
-QUIC_EXPORT_PRIVATE QuicTag ParseQuicTag(quiche::QuicheStringPiece tag_string);
+QUIC_EXPORT_PRIVATE QuicTag ParseQuicTag(absl::string_view tag_string);
// Utility function that converts a string of the form "ABCD,EFGH" to a vector
// of the form {kABCD,kEFGH}. Note the caveats on ParseQuicTag.
QUIC_EXPORT_PRIVATE QuicTagVector
-ParseQuicTagVector(quiche::QuicheStringPiece tags_string);
+ParseQuicTagVector(absl::string_view tags_string);
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.cc b/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.cc
index a09caac5ee2..769a9c5c43f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.cc
@@ -9,6 +9,7 @@
#include <memory>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -239,7 +239,7 @@ void QuicTimeWaitListManager::SendVersionNegotiationPacket(
<< (ietf_quic ? "" : "!") << "ietf_quic, "
<< (use_length_prefix ? "" : "!")
<< "use_length_prefix:" << std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
+ << quiche::QuicheTextUtils::HexDump(absl::string_view(
version_packet->data(), version_packet->length()));
SendOrQueuePacket(std::make_unique<QueuedPacket>(self_address, peer_address,
std::move(version_packet)),
@@ -263,9 +263,9 @@ void QuicTimeWaitListManager::SendPublicReset(
BuildIetfStatelessResetPacket(connection_id);
QUIC_DVLOG(2) << "Dispatcher sending IETF reset packet for "
<< connection_id << std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
- ietf_reset_packet->data(),
- ietf_reset_packet->length()));
+ << quiche::QuicheTextUtils::HexDump(
+ absl::string_view(ietf_reset_packet->data(),
+ ietf_reset_packet->length()));
SendOrQueuePacket(
std::make_unique<QueuedPacket>(self_address, peer_address,
std::move(ietf_reset_packet)),
@@ -283,7 +283,7 @@ void QuicTimeWaitListManager::SendPublicReset(
std::unique_ptr<QuicEncryptedPacket> reset_packet = BuildPublicReset(packet);
QUIC_DVLOG(2) << "Dispatcher sending reset packet for " << connection_id
<< std::endl
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
+ << quiche::QuicheTextUtils::HexDump(absl::string_view(
reset_packet->data(), reset_packet->length()));
SendOrQueuePacket(std::make_unique<QueuedPacket>(self_address, peer_address,
std::move(reset_packet)),
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.h b/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.h
index 6fd2041e8cb..d1286919ed5 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_time_wait_list_manager.h
@@ -275,10 +275,9 @@ class QUIC_NO_EXPORT QuicTimeWaitListManager
};
// QuicLinkedHashMap allows lookup by ConnectionId and traversal in add order.
- typedef QuicLinkedHashMap<QuicConnectionId,
- ConnectionIdData,
- QuicConnectionIdHash>
- ConnectionIdMap;
+ using ConnectionIdMap = QuicLinkedHashMap<QuicConnectionId,
+ ConnectionIdData,
+ QuicConnectionIdHash>;
ConnectionIdMap connection_id_map_;
// Pending termination packets that need to be sent out to the peer when we
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_trace_visitor.cc b/chromium/net/third_party/quiche/src/quic/core/quic_trace_visitor.cc
index bf352f363ad..7ac7b7bd29d 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_trace_visitor.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_trace_visitor.cc
@@ -7,7 +7,7 @@
#include <string>
#include "net/third_party/quiche/src/quic/core/quic_types.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.cc b/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.cc
index 02b34b57a14..3d33c998d27 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.cc
@@ -7,9 +7,9 @@
namespace quic {
QuicTransmissionInfo::QuicTransmissionInfo()
- : encryption_level(ENCRYPTION_INITIAL),
+ : sent_time(QuicTime::Zero()),
bytes_sent(0),
- sent_time(QuicTime::Zero()),
+ encryption_level(ENCRYPTION_INITIAL),
transmission_type(NOT_RETRANSMISSION),
in_flight(false),
state(OUTSTANDING),
@@ -22,9 +22,9 @@ QuicTransmissionInfo::QuicTransmissionInfo(EncryptionLevel level,
QuicPacketLength bytes_sent,
bool has_crypto_handshake,
bool has_ack_frequency)
- : encryption_level(level),
+ : sent_time(sent_time),
bytes_sent(bytes_sent),
- sent_time(sent_time),
+ encryption_level(level),
transmission_type(transmission_type),
in_flight(false),
state(OUTSTANDING),
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.h b/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.h
index acc5667e9fd..61d1ad028cb 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_transmission_info.h
@@ -33,9 +33,9 @@ struct QUIC_EXPORT_PRIVATE QuicTransmissionInfo {
~QuicTransmissionInfo();
QuicFrames retransmittable_frames;
- EncryptionLevel encryption_level;
- QuicPacketLength bytes_sent;
QuicTime sent_time;
+ QuicPacketLength bytes_sent;
+ EncryptionLevel encryption_level;
// Reason why this packet was transmitted.
TransmissionType transmission_type;
// In flight packets have not been abandoned or lost.
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_types.cc b/chromium/net/third_party/quiche/src/quic/core/quic_types.cc
index 4027ffa60ee..9eb0a2752c8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_types.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_types.cc
@@ -363,6 +363,29 @@ std::ostream& operator<<(std::ostream& os, AddressChangeType type) {
return os;
}
+std::string KeyUpdateReasonString(KeyUpdateReason reason) {
+#define RETURN_REASON_LITERAL(x) \
+ case KeyUpdateReason::x: \
+ return #x
+ switch (reason) {
+ RETURN_REASON_LITERAL(kInvalid);
+ RETURN_REASON_LITERAL(kRemote);
+ RETURN_REASON_LITERAL(kLocalForTests);
+ RETURN_REASON_LITERAL(kLocalForInteropRunner);
+ RETURN_REASON_LITERAL(kLocalAeadConfidentialityLimit);
+ RETURN_REASON_LITERAL(kLocalKeyUpdateLimitOverride);
+ default:
+ return quiche::QuicheStrCat("Unknown(", static_cast<int>(reason), ")");
+ break;
+ }
+#undef RETURN_REASON_LITERAL
+}
+
+std::ostream& operator<<(std::ostream& os, const KeyUpdateReason reason) {
+ os << KeyUpdateReasonString(reason);
+ return os;
+}
+
#undef RETURN_STRING_LITERAL // undef for jumbo builds
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_types.h b/chromium/net/third_party/quiche/src/quic/core/quic_types.h
index 13307bb9d6f..5152a158055 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_types.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_types.h
@@ -602,8 +602,8 @@ QUIC_EXPORT_PRIVATE std::string QuicLongHeaderTypeToString(
QuicLongHeaderType type);
enum QuicPacketHeaderTypeFlags : uint8_t {
- // Bit 2: Reserved for experimentation for short header.
- FLAGS_EXPERIMENTATION_BIT = 1 << 2,
+ // Bit 2: Key phase bit for IETF QUIC short header packets.
+ FLAGS_KEY_PHASE_BIT = 1 << 2,
// Bit 3: Google QUIC Demultiplexing bit, the short header always sets this
// bit to 0, allowing to distinguish Google QUIC packets from short header
// packets.
@@ -798,6 +798,22 @@ struct QUIC_NO_EXPORT QuicOwnedPacketBuffer : public QuicPacketBuffer {
}
};
+// These values must remain stable as they are uploaded to UMA histograms.
+enum class KeyUpdateReason {
+ kInvalid = 0,
+ kRemote = 1,
+ kLocalForTests = 2,
+ kLocalForInteropRunner = 3,
+ kLocalAeadConfidentialityLimit = 4,
+ kLocalKeyUpdateLimitOverride = 5,
+ kMaxValue = kLocalKeyUpdateLimitOverride,
+};
+
+QUIC_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
+ const KeyUpdateReason reason);
+
+QUIC_EXPORT_PRIVATE std::string KeyUpdateReasonString(KeyUpdateReason reason);
+
} // namespace quic
#endif // QUICHE_QUIC_CORE_QUIC_TYPES_H_
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.cc b/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.cc
index 3e377cfa21b..852a0df2dc2 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.cc
@@ -4,10 +4,12 @@
#include "net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h"
+#include <cstddef>
#include <limits>
#include <type_traits>
#include "net/third_party/quiche/src/quic/core/quic_connection_stats.h"
+#include "net/third_party/quiche/src/quic/core/quic_packet_number.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
@@ -120,11 +122,21 @@ QuicUnackedPacketMap::QuicUnackedPacketMap(Perspective perspective)
{QuicTime::Zero()}},
last_crypto_packet_sent_time_(QuicTime::Zero()),
session_notifier_(nullptr),
- supports_multiple_packet_number_spaces_(false) {}
+ supports_multiple_packet_number_spaces_(false) {
+ if (use_circular_deque_) {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_use_circular_deque_for_unacked_packets);
+ }
+}
QuicUnackedPacketMap::~QuicUnackedPacketMap() {
- for (QuicTransmissionInfo& transmission_info : unacked_packets_) {
- DeleteFrames(&(transmission_info.retransmittable_frames));
+ if (use_circular_deque_) {
+ for (QuicTransmissionInfo& transmission_info : unacked_packets_) {
+ DeleteFrames(&(transmission_info.retransmittable_frames));
+ }
+ } else {
+ for (QuicTransmissionInfo& transmission_info : unacked_packets_deque_) {
+ DeleteFrames(&(transmission_info.retransmittable_frames));
+ }
}
}
@@ -140,10 +152,10 @@ void QuicUnackedPacketMap::AddSentPacket(SerializedPacket* mutable_packet,
largest_sent_packet_ >= packet_number)
<< "largest_sent_packet_: " << largest_sent_packet_
<< ", packet_number: " << packet_number;
- DCHECK_GE(packet_number, least_unacked_ + unacked_packets_.size());
- while (least_unacked_ + unacked_packets_.size() < packet_number) {
- unacked_packets_.push_back(QuicTransmissionInfo());
- unacked_packets_.back().state = NEVER_SENT;
+ DCHECK_GE(packet_number, least_unacked_ + unacked_packets_size());
+ while (least_unacked_ + unacked_packets_size() < packet_number) {
+ unacked_packets_push_back(QuicTransmissionInfo());
+ unacked_packets_back().state = NEVER_SENT;
}
const bool has_crypto_handshake = packet.has_crypto_handshake == IS_HANDSHAKE;
@@ -170,7 +182,7 @@ void QuicUnackedPacketMap::AddSentPacket(SerializedPacket* mutable_packet,
last_inflight_packet_sent_time_ = sent_time;
last_inflight_packets_sent_time_[packet_number_space] = sent_time;
}
- unacked_packets_.push_back(info);
+ unacked_packets_push_back(info);
// Swap the retransmittable frames to avoid allocations.
// TODO(ianswett): Could use emplace_back when Chromium can.
if (has_crypto_handshake) {
@@ -178,16 +190,16 @@ void QuicUnackedPacketMap::AddSentPacket(SerializedPacket* mutable_packet,
}
mutable_packet->retransmittable_frames.swap(
- unacked_packets_.back().retransmittable_frames);
+ unacked_packets_back().retransmittable_frames);
}
void QuicUnackedPacketMap::RemoveObsoletePackets() {
- while (!unacked_packets_.empty()) {
- if (!IsPacketUseless(least_unacked_, unacked_packets_.front())) {
+ while (!unacked_packets_empty()) {
+ if (!IsPacketUseless(least_unacked_, unacked_packets_front())) {
break;
}
- DeleteFrames(&unacked_packets_.front().retransmittable_frames);
- unacked_packets_.pop_front();
+ DeleteFrames(&unacked_packets_front().retransmittable_frames);
+ unacked_packets_pop_front();
++least_unacked_;
}
}
@@ -195,9 +207,9 @@ void QuicUnackedPacketMap::RemoveObsoletePackets() {
bool QuicUnackedPacketMap::HasRetransmittableFrames(
QuicPacketNumber packet_number) const {
DCHECK_GE(packet_number, least_unacked_);
- DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size());
+ DCHECK_LT(packet_number, least_unacked_ + unacked_packets_size());
return HasRetransmittableFrames(
- unacked_packets_[packet_number - least_unacked_]);
+ unacked_packets_at(packet_number - least_unacked_));
}
bool QuicUnackedPacketMap::HasRetransmittableFrames(
@@ -223,9 +235,9 @@ void QuicUnackedPacketMap::RemoveRetransmittability(
void QuicUnackedPacketMap::RemoveRetransmittability(
QuicPacketNumber packet_number) {
DCHECK_GE(packet_number, least_unacked_);
- DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size());
+ DCHECK_LT(packet_number, least_unacked_ + unacked_packets_size());
QuicTransmissionInfo* info =
- &unacked_packets_[packet_number - least_unacked_];
+ &unacked_packets_at(packet_number - least_unacked_);
RemoveRetransmittability(info);
}
@@ -275,11 +287,11 @@ bool QuicUnackedPacketMap::IsPacketUseless(
bool QuicUnackedPacketMap::IsUnacked(QuicPacketNumber packet_number) const {
if (packet_number < least_unacked_ ||
- packet_number >= least_unacked_ + unacked_packets_.size()) {
+ packet_number >= least_unacked_ + unacked_packets_size()) {
return false;
}
return !IsPacketUseless(packet_number,
- unacked_packets_[packet_number - least_unacked_]);
+ unacked_packets_at(packet_number - least_unacked_));
}
void QuicUnackedPacketMap::RemoveFromInFlight(QuicTransmissionInfo* info) {
@@ -313,9 +325,9 @@ void QuicUnackedPacketMap::RemoveFromInFlight(QuicTransmissionInfo* info) {
void QuicUnackedPacketMap::RemoveFromInFlight(QuicPacketNumber packet_number) {
DCHECK_GE(packet_number, least_unacked_);
- DCHECK_LT(packet_number, least_unacked_ + unacked_packets_.size());
+ DCHECK_LT(packet_number, least_unacked_ + unacked_packets_size());
QuicTransmissionInfo* info =
- &unacked_packets_[packet_number - least_unacked_];
+ &unacked_packets_at(packet_number - least_unacked_);
RemoveFromInFlight(info);
}
@@ -323,8 +335,8 @@ QuicInlinedVector<QuicPacketNumber, 2>
QuicUnackedPacketMap::NeuterUnencryptedPackets() {
QuicInlinedVector<QuicPacketNumber, 2> neutered_packets;
QuicPacketNumber packet_number = GetLeastUnacked();
- for (QuicUnackedPacketMap::iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
+ for (QuicUnackedPacketMap::iterator it = begin(); it != end();
+ ++it, ++packet_number) {
if (!it->retransmittable_frames.empty() &&
it->encryption_level == ENCRYPTION_INITIAL) {
QUIC_DVLOG(2) << "Neutering unencrypted packet " << packet_number;
@@ -350,8 +362,8 @@ QuicInlinedVector<QuicPacketNumber, 2>
QuicUnackedPacketMap::NeuterHandshakePackets() {
QuicInlinedVector<QuicPacketNumber, 2> neutered_packets;
QuicPacketNumber packet_number = GetLeastUnacked();
- for (QuicUnackedPacketMap::iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it, ++packet_number) {
+ for (QuicUnackedPacketMap::iterator it = begin(); it != end();
+ ++it, ++packet_number) {
if (!it->retransmittable_frames.empty() &&
GetPacketNumberSpace(it->encryption_level) == HANDSHAKE_DATA) {
QUIC_DVLOG(2) << "Neutering handshake packet " << packet_number;
@@ -375,12 +387,12 @@ bool QuicUnackedPacketMap::HasInFlightPackets() const {
const QuicTransmissionInfo& QuicUnackedPacketMap::GetTransmissionInfo(
QuicPacketNumber packet_number) const {
- return unacked_packets_[packet_number - least_unacked_];
+ return unacked_packets_at(packet_number - least_unacked_);
}
QuicTransmissionInfo* QuicUnackedPacketMap::GetMutableTransmissionInfo(
QuicPacketNumber packet_number) {
- return &unacked_packets_[packet_number - least_unacked_];
+ return &unacked_packets_at(packet_number - least_unacked_);
}
QuicTime QuicUnackedPacketMap::GetLastInFlightPacketSentTime() const {
@@ -394,8 +406,7 @@ QuicTime QuicUnackedPacketMap::GetLastCryptoPacketSentTime() const {
size_t QuicUnackedPacketMap::GetNumUnackedPacketsDebugOnly() const {
size_t unacked_packet_count = 0;
QuicPacketNumber packet_number = least_unacked_;
- for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
- ++it, ++packet_number) {
+ for (auto it = begin(); it != end(); ++it, ++packet_number) {
if (!IsPacketUseless(packet_number, *it)) {
++unacked_packet_count;
}
@@ -408,8 +419,7 @@ bool QuicUnackedPacketMap::HasMultipleInFlightPackets() const {
return true;
}
size_t num_in_flight = 0;
- for (auto it = unacked_packets_.rbegin(); it != unacked_packets_.rend();
- ++it) {
+ for (auto it = rbegin(); it != rend(); ++it) {
if (it->in_flight) {
++num_in_flight;
}
@@ -425,8 +435,7 @@ bool QuicUnackedPacketMap::HasPendingCryptoPackets() const {
}
bool QuicUnackedPacketMap::HasUnackedRetransmittableFrames() const {
- for (auto it = unacked_packets_.rbegin(); it != unacked_packets_.rend();
- ++it) {
+ for (auto it = rbegin(); it != rend(); ++it) {
if (it->in_flight && HasRetransmittableFrames(*it)) {
return true;
}
@@ -584,7 +593,7 @@ QuicUnackedPacketMap::GetLargestSentRetransmittableOfPacketNumberSpace(
const QuicTransmissionInfo*
QuicUnackedPacketMap::GetFirstInFlightTransmissionInfo() const {
DCHECK(HasInFlightPackets());
- for (auto it = unacked_packets_.begin(); it != unacked_packets_.end(); ++it) {
+ for (auto it = begin(); it != end(); ++it) {
if (it->in_flight) {
return &(*it);
}
@@ -598,7 +607,7 @@ QuicUnackedPacketMap::GetFirstInFlightTransmissionInfoOfSpace(
PacketNumberSpace packet_number_space) const {
// TODO(fayang): Optimize this part if arm 1st PTO with first in flight sent
// time works.
- for (auto it = unacked_packets_.begin(); it != unacked_packets_.end(); ++it) {
+ for (auto it = begin(); it != end(); ++it) {
if (it->in_flight &&
GetPacketNumberSpace(it->encryption_level) == packet_number_space) {
return &(*it);
@@ -628,7 +637,7 @@ int32_t QuicUnackedPacketMap::GetLastPacketContent() const {
return -1;
}
int32_t content = 0;
- const QuicTransmissionInfo& last_packet = unacked_packets_.back();
+ const QuicTransmissionInfo& last_packet = unacked_packets_back();
for (const auto& frame : last_packet.retransmittable_frames) {
content |= GetFrameTypeBitfield(frame.type);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h b/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h
index 595f435e0fc..45413510a28 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h
@@ -6,12 +6,15 @@
#define QUICHE_QUIC_CORE_QUIC_UNACKED_PACKET_MAP_H_
#include <cstddef>
+#include <cstdint>
#include <deque>
+#include "net/third_party/quiche/src/quic/core/quic_circular_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_transmission_info.h"
#include "net/third_party/quiche/src/quic/core/session_notifier_interface.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
namespace quic {
@@ -90,7 +93,9 @@ class QUIC_EXPORT_PRIVATE QuicUnackedPacketMap {
bool HasUnackedRetransmittableFrames() const;
// Returns true if there are no packets present in the unacked packet map.
- bool empty() const { return unacked_packets_.empty(); }
+ bool empty() const { return unacked_packets_empty(); }
+
+ bool use_circular_deque() const { return use_circular_deque_; }
// Returns the largest packet number that has been sent.
QuicPacketNumber largest_sent_packet() const { return largest_sent_packet_; }
@@ -110,20 +115,83 @@ class QUIC_EXPORT_PRIVATE QuicUnackedPacketMap {
// been acked by the peer. If there are no unacked packets, returns 0.
QuicPacketNumber GetLeastUnacked() const;
- // This can not be a QuicCircularDeque since pointers into this are
- // assumed to be stable.
- typedef std::deque<QuicTransmissionInfo> UnackedPacketMap;
-
- typedef UnackedPacketMap::const_iterator const_iterator;
- typedef UnackedPacketMap::const_reverse_iterator const_reverse_iterator;
- typedef UnackedPacketMap::iterator iterator;
-
- const_iterator begin() const { return unacked_packets_.begin(); }
- const_iterator end() const { return unacked_packets_.end(); }
- const_reverse_iterator rbegin() const { return unacked_packets_.rbegin(); }
- const_reverse_iterator rend() const { return unacked_packets_.rend(); }
- iterator begin() { return unacked_packets_.begin(); }
- iterator end() { return unacked_packets_.end(); }
+ template <typename Itr1, typename Itr2>
+ class QUIC_EXPORT_PRIVATE IteratorWrapper {
+ public:
+ explicit IteratorWrapper(Itr1 itr1) {
+ itr_.template emplace<0>(std::move(itr1));
+ }
+ explicit IteratorWrapper(Itr2 itr2) {
+ itr_.template emplace<1>(std::move(itr2));
+ }
+
+ auto& operator*() const {
+ return absl::visit(
+ [](const auto& itr) -> auto& { return *itr; }, itr_);
+ }
+
+ auto* operator->() const {
+ return absl::visit([](const auto& itr) { return &*itr; }, itr_);
+ }
+
+ IteratorWrapper& operator++() {
+ absl::visit([](auto& itr) { ++itr; }, itr_);
+ return *this;
+ }
+
+ IteratorWrapper& operator+=(int difference) {
+ absl::visit([difference](auto& itr) { itr += difference; }, itr_);
+ return *this;
+ }
+
+ IteratorWrapper operator++(int) {
+ return absl::visit([](auto& itr) { IteratorWrapper(itr++); }, itr_);
+ }
+
+ bool operator!=(const IteratorWrapper& other) const {
+ return itr_ != other.itr_;
+ }
+
+ private:
+ absl::variant<Itr1, Itr2> itr_;
+ };
+
+ using const_iterator =
+ IteratorWrapper<std::deque<QuicTransmissionInfo>::const_iterator,
+ QuicCircularDeque<QuicTransmissionInfo>::const_iterator>;
+ using const_reverse_iterator = IteratorWrapper<
+ std::deque<QuicTransmissionInfo>::const_reverse_iterator,
+ QuicCircularDeque<QuicTransmissionInfo>::const_reverse_iterator>;
+ using iterator =
+ IteratorWrapper<std::deque<QuicTransmissionInfo>::iterator,
+ QuicCircularDeque<QuicTransmissionInfo>::iterator>;
+
+ const_iterator begin() const {
+ return use_circular_deque_ ? const_iterator(unacked_packets_.begin())
+ : const_iterator(unacked_packets_deque_.begin());
+ }
+ const_iterator end() const {
+ return use_circular_deque_ ? const_iterator(unacked_packets_.end())
+ : const_iterator(unacked_packets_deque_.end());
+ }
+ const_reverse_iterator rbegin() const {
+ return use_circular_deque_
+ ? const_reverse_iterator(unacked_packets_.rbegin())
+ : const_reverse_iterator(unacked_packets_deque_.rbegin());
+ }
+ const_reverse_iterator rend() const {
+ return use_circular_deque_
+ ? const_reverse_iterator(unacked_packets_.rend())
+ : const_reverse_iterator(unacked_packets_deque_.rend());
+ }
+ iterator begin() {
+ return use_circular_deque_ ? iterator(unacked_packets_.begin())
+ : iterator(unacked_packets_deque_.begin());
+ }
+ iterator end() {
+ return use_circular_deque_ ? iterator(unacked_packets_.end())
+ : iterator(unacked_packets_deque_.end());
+ }
// Returns true if there are unacked packets that are in flight.
bool HasInFlightPackets() const;
@@ -244,9 +312,73 @@ class QUIC_EXPORT_PRIVATE QuicUnackedPacketMap {
return supports_multiple_packet_number_spaces_;
}
+ void ReserveInitialCapacity(size_t initial_capacity) {
+ if (use_circular_deque_) {
+ unacked_packets_.reserve(initial_capacity);
+ }
+ }
+
private:
friend class test::QuicUnackedPacketMapPeer;
+ // TODO(haoyuewang) Remove these methods when deprecate
+ // quic_use_circular_deque_for_unacked_packets flag.
+ size_t unacked_packets_size() const {
+ return use_circular_deque_ ? unacked_packets_.size()
+ : unacked_packets_deque_.size();
+ }
+
+ const QuicTransmissionInfo& unacked_packets_at(int index) const {
+ return use_circular_deque_ ? unacked_packets_[index]
+ : unacked_packets_deque_[index];
+ }
+
+ QuicTransmissionInfo& unacked_packets_at(int index) {
+ return use_circular_deque_ ? unacked_packets_[index]
+ : unacked_packets_deque_[index];
+ }
+
+ const QuicTransmissionInfo& unacked_packets_front() const {
+ return use_circular_deque_ ? unacked_packets_.front()
+ : unacked_packets_deque_.front();
+ }
+
+ QuicTransmissionInfo& unacked_packets_front() {
+ return use_circular_deque_ ? unacked_packets_.front()
+ : unacked_packets_deque_.front();
+ }
+
+ const QuicTransmissionInfo& unacked_packets_back() const {
+ return use_circular_deque_ ? unacked_packets_.back()
+ : unacked_packets_deque_.back();
+ }
+
+ QuicTransmissionInfo& unacked_packets_back() {
+ return use_circular_deque_ ? unacked_packets_.back()
+ : unacked_packets_deque_.back();
+ }
+
+ void unacked_packets_push_back(QuicTransmissionInfo info) {
+ if (use_circular_deque_) {
+ unacked_packets_.push_back(std::move(info));
+ } else {
+ unacked_packets_deque_.push_back(std::move(info));
+ }
+ }
+
+ void unacked_packets_pop_front() {
+ if (use_circular_deque_) {
+ unacked_packets_.pop_front();
+ } else {
+ unacked_packets_deque_.pop_front();
+ }
+ }
+
+ bool unacked_packets_empty() const {
+ return use_circular_deque_ ? unacked_packets_.empty()
+ : unacked_packets_deque_.empty();
+ }
+
// Returns true if packet may be useful for an RTT measurement.
bool IsPacketUsefulForMeasuringRtt(QuicPacketNumber packet_number,
const QuicTransmissionInfo& info) const;
@@ -286,7 +418,12 @@ class QUIC_EXPORT_PRIVATE QuicUnackedPacketMap {
// If the old packet is acked before the new packet, then the old entry will
// be removed from the map and the new entry's retransmittable frames will be
// set to nullptr.
- UnackedPacketMap unacked_packets_;
+ QuicCircularDeque<QuicTransmissionInfo> unacked_packets_;
+ std::deque<QuicTransmissionInfo> unacked_packets_deque_;
+
+ const bool use_circular_deque_ =
+ GetQuicReloadableFlag(quic_use_circular_deque_for_unacked_packets);
+
// The packet at the 0th index of unacked_packets_.
QuicPacketNumber least_unacked_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map_test.cc
index 96ba08acb35..02821083e31 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_unacked_packet_map_test.cc
@@ -3,15 +3,17 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/core/quic_unacked_packet_map.h"
+#include <cstddef>
#include <limits>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h"
+#include "net/third_party/quiche/src/quic/core/quic_packet_number.h"
#include "net/third_party/quiche/src/quic/core/quic_transmission_info.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
using testing::_;
using testing::Return;
@@ -84,8 +86,8 @@ class QuicUnackedPacketMapTest : public QuicTestWithParam<Perspective> {
.in_flight);
}
size_t in_flight_count = 0;
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it) {
+ for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
+ ++it) {
if (it->in_flight) {
++in_flight_count;
}
@@ -111,8 +113,8 @@ class QuicUnackedPacketMapTest : public QuicTestWithParam<Perspective> {
void VerifyRetransmittablePackets(uint64_t* packets, size_t num_packets) {
unacked_packets_.RemoveObsoletePackets();
size_t num_retransmittable_packets = 0;
- for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it) {
+ for (auto it = unacked_packets_.begin(); it != unacked_packets_.end();
+ ++it) {
if (unacked_packets_.HasRetransmittableFrames(*it)) {
++num_retransmittable_packets;
}
@@ -174,7 +176,7 @@ TEST_P(QuicUnackedPacketMapTest, RttOnly) {
true);
uint64_t unacked[] = {1};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyInFlightPackets(nullptr, 0);
VerifyRetransmittablePackets(nullptr, 0);
@@ -190,18 +192,18 @@ TEST_P(QuicUnackedPacketMapTest, RetransmittableInflightAndRtt) {
unacked_packets_.AddSentPacket(&packet, NOT_RETRANSMISSION, now_, true, true);
uint64_t unacked[] = {1};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyRetransmittablePackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyRetransmittablePackets(unacked, ABSL_ARRAYSIZE(unacked));
unacked_packets_.RemoveRetransmittability(QuicPacketNumber(1));
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
unacked_packets_.IncreaseLargestAcked(QuicPacketNumber(1));
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
unacked_packets_.RemoveFromInFlight(QuicPacketNumber(1));
@@ -216,15 +218,15 @@ TEST_P(QuicUnackedPacketMapTest, StopRetransmission) {
unacked_packets_.AddSentPacket(&packet, NOT_RETRANSMISSION, now_, true, true);
uint64_t unacked[] = {1};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
uint64_t retransmittable[] = {1};
VerifyRetransmittablePackets(retransmittable,
- QUICHE_ARRAYSIZE(retransmittable));
+ ABSL_ARRAYSIZE(retransmittable));
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
}
@@ -234,16 +236,16 @@ TEST_P(QuicUnackedPacketMapTest, StopRetransmissionOnOtherStream) {
unacked_packets_.AddSentPacket(&packet, NOT_RETRANSMISSION, now_, true, true);
uint64_t unacked[] = {1};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
uint64_t retransmittable[] = {1};
VerifyRetransmittablePackets(retransmittable,
- QUICHE_ARRAYSIZE(retransmittable));
+ ABSL_ARRAYSIZE(retransmittable));
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(retransmittable,
- QUICHE_ARRAYSIZE(retransmittable));
+ ABSL_ARRAYSIZE(retransmittable));
}
TEST_P(QuicUnackedPacketMapTest, StopRetransmissionAfterRetransmission) {
@@ -254,14 +256,14 @@ TEST_P(QuicUnackedPacketMapTest, StopRetransmissionAfterRetransmission) {
RetransmitAndSendPacket(1, 2, LOSS_RETRANSMISSION);
uint64_t unacked[] = {1, 2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
std::vector<uint64_t> retransmittable = {1, 2};
VerifyRetransmittablePackets(&retransmittable[0], retransmittable.size());
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
}
@@ -274,26 +276,26 @@ TEST_P(QuicUnackedPacketMapTest, RetransmittedPacket) {
RetransmitAndSendPacket(1, 2, LOSS_RETRANSMISSION);
uint64_t unacked[] = {1, 2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
std::vector<uint64_t> retransmittable = {1, 2};
VerifyRetransmittablePackets(&retransmittable[0], retransmittable.size());
EXPECT_CALL(notifier_, IsFrameOutstanding(_)).WillRepeatedly(Return(false));
unacked_packets_.RemoveRetransmittability(QuicPacketNumber(1));
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
unacked_packets_.IncreaseLargestAcked(QuicPacketNumber(2));
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
VerifyRetransmittablePackets(nullptr, 0);
unacked_packets_.RemoveFromInFlight(QuicPacketNumber(2));
uint64_t unacked2[] = {1};
- VerifyUnackedPackets(unacked2, QUICHE_ARRAYSIZE(unacked2));
- VerifyInFlightPackets(unacked2, QUICHE_ARRAYSIZE(unacked2));
+ VerifyUnackedPackets(unacked2, ABSL_ARRAYSIZE(unacked2));
+ VerifyInFlightPackets(unacked2, ABSL_ARRAYSIZE(unacked2));
VerifyRetransmittablePackets(nullptr, 0);
unacked_packets_.RemoveFromInFlight(QuicPacketNumber(1));
@@ -312,11 +314,11 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitThreeTimes) {
true);
uint64_t unacked[] = {1, 2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
uint64_t retransmittable[] = {1, 2};
VerifyRetransmittablePackets(retransmittable,
- QUICHE_ARRAYSIZE(retransmittable));
+ ABSL_ARRAYSIZE(retransmittable));
// Early retransmit 1 as 3 and send new data as 4.
unacked_packets_.IncreaseLargestAcked(QuicPacketNumber(2));
@@ -329,9 +331,9 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitThreeTimes) {
true);
uint64_t unacked2[] = {1, 3, 4};
- VerifyUnackedPackets(unacked2, QUICHE_ARRAYSIZE(unacked2));
+ VerifyUnackedPackets(unacked2, ABSL_ARRAYSIZE(unacked2));
uint64_t pending2[] = {3, 4};
- VerifyInFlightPackets(pending2, QUICHE_ARRAYSIZE(pending2));
+ VerifyInFlightPackets(pending2, ABSL_ARRAYSIZE(pending2));
std::vector<uint64_t> retransmittable2 = {1, 3, 4};
VerifyRetransmittablePackets(&retransmittable2[0], retransmittable2.size());
@@ -349,7 +351,7 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitThreeTimes) {
VerifyUnackedPackets(&unacked3[0], unacked3.size());
VerifyRetransmittablePackets(&retransmittable3[0], retransmittable3.size());
uint64_t pending3[] = {3, 5, 6};
- VerifyInFlightPackets(pending3, QUICHE_ARRAYSIZE(pending3));
+ VerifyInFlightPackets(pending3, ABSL_ARRAYSIZE(pending3));
// Early retransmit 5 as 7 and ensure in flight packet 3 is not removed.
unacked_packets_.IncreaseLargestAcked(QuicPacketNumber(6));
@@ -362,13 +364,13 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitThreeTimes) {
VerifyUnackedPackets(&unacked4[0], unacked4.size());
VerifyRetransmittablePackets(&retransmittable4[0], retransmittable4.size());
uint64_t pending4[] = {3, 5, 7};
- VerifyInFlightPackets(pending4, QUICHE_ARRAYSIZE(pending4));
+ VerifyInFlightPackets(pending4, ABSL_ARRAYSIZE(pending4));
// Remove the older two transmissions from in flight.
unacked_packets_.RemoveFromInFlight(QuicPacketNumber(3));
unacked_packets_.RemoveFromInFlight(QuicPacketNumber(5));
uint64_t pending5[] = {7};
- VerifyInFlightPackets(pending5, QUICHE_ARRAYSIZE(pending5));
+ VerifyInFlightPackets(pending5, ABSL_ARRAYSIZE(pending5));
}
TEST_P(QuicUnackedPacketMapTest, RetransmitFourTimes) {
@@ -381,11 +383,11 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitFourTimes) {
true);
uint64_t unacked[] = {1, 2};
- VerifyUnackedPackets(unacked, QUICHE_ARRAYSIZE(unacked));
- VerifyInFlightPackets(unacked, QUICHE_ARRAYSIZE(unacked));
+ VerifyUnackedPackets(unacked, ABSL_ARRAYSIZE(unacked));
+ VerifyInFlightPackets(unacked, ABSL_ARRAYSIZE(unacked));
uint64_t retransmittable[] = {1, 2};
VerifyRetransmittablePackets(retransmittable,
- QUICHE_ARRAYSIZE(retransmittable));
+ ABSL_ARRAYSIZE(retransmittable));
// Early retransmit 1 as 3.
unacked_packets_.IncreaseLargestAcked(QuicPacketNumber(2));
@@ -395,9 +397,9 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitFourTimes) {
RetransmitAndSendPacket(1, 3, LOSS_RETRANSMISSION);
uint64_t unacked2[] = {1, 3};
- VerifyUnackedPackets(unacked2, QUICHE_ARRAYSIZE(unacked2));
+ VerifyUnackedPackets(unacked2, ABSL_ARRAYSIZE(unacked2));
uint64_t pending2[] = {3};
- VerifyInFlightPackets(pending2, QUICHE_ARRAYSIZE(pending2));
+ VerifyInFlightPackets(pending2, ABSL_ARRAYSIZE(pending2));
std::vector<uint64_t> retransmittable2 = {1, 3};
VerifyRetransmittablePackets(&retransmittable2[0], retransmittable2.size());
@@ -408,9 +410,9 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitFourTimes) {
true);
uint64_t unacked3[] = {1, 3, 4, 5};
- VerifyUnackedPackets(unacked3, QUICHE_ARRAYSIZE(unacked3));
+ VerifyUnackedPackets(unacked3, ABSL_ARRAYSIZE(unacked3));
uint64_t pending3[] = {3, 4, 5};
- VerifyInFlightPackets(pending3, QUICHE_ARRAYSIZE(pending3));
+ VerifyInFlightPackets(pending3, ABSL_ARRAYSIZE(pending3));
std::vector<uint64_t> retransmittable3 = {1, 3, 4, 5};
VerifyRetransmittablePackets(&retransmittable3[0], retransmittable3.size());
@@ -425,7 +427,7 @@ TEST_P(QuicUnackedPacketMapTest, RetransmitFourTimes) {
std::vector<uint64_t> unacked4 = {4, 6};
VerifyUnackedPackets(&unacked4[0], unacked4.size());
uint64_t pending4[] = {6};
- VerifyInFlightPackets(pending4, QUICHE_ARRAYSIZE(pending4));
+ VerifyInFlightPackets(pending4, ABSL_ARRAYSIZE(pending4));
std::vector<uint64_t> retransmittable4 = {4, 6};
VerifyRetransmittablePackets(&retransmittable4[0], retransmittable4.size());
}
@@ -655,6 +657,18 @@ TEST_P(QuicUnackedPacketMapTest, LargestSentPacketMultiplePacketNumberSpaces) {
EXPECT_FALSE(unacked_packets_.GetLastPacketContent() & (1 << ACK_FRAME));
}
+TEST_P(QuicUnackedPacketMapTest, ReserveInitialCapacityTest) {
+ SetQuicReloadableFlag(quic_use_circular_deque_for_unacked_packets, true);
+ QuicUnackedPacketMap unacked_packets(GetParam());
+ ASSERT_EQ(QuicUnackedPacketMapPeer::GetCapacity(unacked_packets), 0u);
+ unacked_packets.ReserveInitialCapacity(16);
+ QuicStreamId stream_id(1);
+ SerializedPacket packet(CreateRetransmittablePacketForStream(1, stream_id));
+ unacked_packets.AddSentPacket(&packet, TransmissionType::NOT_RETRANSMISSION,
+ now_, true, true);
+ ASSERT_EQ(QuicUnackedPacketMapPeer::GetCapacity(unacked_packets), 16u);
+}
+
} // namespace
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_utils.cc b/chromium/net/third_party/quiche/src/quic/core/quic_utils.cc
index b6619d4398e..3322fedd906 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_utils.cc
@@ -9,19 +9,19 @@
#include <cstring>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/base/optimization.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_constants.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_aligned.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_prefetch.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
namespace {
@@ -36,8 +36,7 @@ namespace {
#endif
#ifdef QUIC_UTIL_HAS_UINT128
-QuicUint128 IncrementalHashFast(QuicUint128 uhash,
- quiche::QuicheStringPiece data) {
+QuicUint128 IncrementalHashFast(QuicUint128 uhash, absl::string_view data) {
// This code ends up faster than the naive implementation for 2 reasons:
// 1. QuicUint128 is sufficiently complicated that the compiler
// cannot transform the multiplication by kPrime into a shift-multiply-add;
@@ -60,8 +59,7 @@ QuicUint128 IncrementalHashFast(QuicUint128 uhash,
#ifndef QUIC_UTIL_HAS_UINT128
// Slow implementation of IncrementalHash. In practice, only used by Chromium.
-QuicUint128 IncrementalHashSlow(QuicUint128 hash,
- quiche::QuicheStringPiece data) {
+QuicUint128 IncrementalHashSlow(QuicUint128 hash, absl::string_view data) {
// kPrime = 309485009821345068724781371
static const QuicUint128 kPrime = MakeQuicUint128(16777216, 315);
const uint8_t* octets = reinterpret_cast<const uint8_t*>(data.data());
@@ -73,7 +71,7 @@ QuicUint128 IncrementalHashSlow(QuicUint128 hash,
}
#endif
-QuicUint128 IncrementalHash(QuicUint128 hash, quiche::QuicheStringPiece data) {
+QuicUint128 IncrementalHash(QuicUint128 hash, absl::string_view data) {
#ifdef QUIC_UTIL_HAS_UINT128
return IncrementalHashFast(hash, data);
#else
@@ -84,7 +82,7 @@ QuicUint128 IncrementalHash(QuicUint128 hash, quiche::QuicheStringPiece data) {
} // namespace
// static
-uint64_t QuicUtils::FNV1a_64_Hash(quiche::QuicheStringPiece data) {
+uint64_t QuicUtils::FNV1a_64_Hash(absl::string_view data) {
static const uint64_t kOffset = UINT64_C(14695981039346656037);
static const uint64_t kPrime = UINT64_C(1099511628211);
@@ -101,21 +99,20 @@ uint64_t QuicUtils::FNV1a_64_Hash(quiche::QuicheStringPiece data) {
}
// static
-QuicUint128 QuicUtils::FNV1a_128_Hash(quiche::QuicheStringPiece data) {
- return FNV1a_128_Hash_Three(data, quiche::QuicheStringPiece(),
- quiche::QuicheStringPiece());
+QuicUint128 QuicUtils::FNV1a_128_Hash(absl::string_view data) {
+ return FNV1a_128_Hash_Three(data, absl::string_view(), absl::string_view());
}
// static
-QuicUint128 QuicUtils::FNV1a_128_Hash_Two(quiche::QuicheStringPiece data1,
- quiche::QuicheStringPiece data2) {
- return FNV1a_128_Hash_Three(data1, data2, quiche::QuicheStringPiece());
+QuicUint128 QuicUtils::FNV1a_128_Hash_Two(absl::string_view data1,
+ absl::string_view data2) {
+ return FNV1a_128_Hash_Three(data1, data2, absl::string_view());
}
// static
-QuicUint128 QuicUtils::FNV1a_128_Hash_Three(quiche::QuicheStringPiece data1,
- quiche::QuicheStringPiece data2,
- quiche::QuicheStringPiece data3) {
+QuicUint128 QuicUtils::FNV1a_128_Hash_Three(absl::string_view data1,
+ absl::string_view data2,
+ absl::string_view data3) {
// The two constants are defined as part of the hash algorithm.
// see http://www.isthe.com/chongo/tech/comp/fnv/
// kOffset = 144066263297769815596495629667062367629
@@ -268,7 +265,7 @@ void QuicUtils::CopyToBuffer(const struct iovec* iov,
// it to the hardware prefetcher after that.
QuicPrefetchT0(next_base);
if (iov[iovnum + 1].iov_len >= 64) {
- QuicPrefetchT0(next_base + QUIC_CACHELINE_SIZE);
+ QuicPrefetchT0(next_base + ABSL_CACHELINE_SIZE);
}
}
@@ -287,7 +284,7 @@ void QuicUtils::CopyToBuffer(const struct iovec* iov,
}
// static
-struct iovec QuicUtils::MakeIovec(quiche::QuicheStringPiece data) {
+struct iovec QuicUtils::MakeIovec(absl::string_view data) {
struct iovec iov = {const_cast<char*>(data.data()),
static_cast<size_t>(data.size())};
return iov;
@@ -497,6 +494,18 @@ QuicStreamId QuicUtils::GetFirstUnidirectionalStreamId(
}
// static
+QuicStreamId QuicUtils::GetMaxClientInitiatedBidirectionalStreamId(
+ QuicTransportVersion version) {
+ if (VersionHasIetfQuicFrames(version)) {
+ // Client initiated bidirectional streams have stream IDs divisible by 4.
+ return std::numeric_limits<QuicStreamId>::max() - 3;
+ }
+
+ // Client initiated bidirectional streams have odd stream IDs.
+ return std::numeric_limits<QuicStreamId>::max();
+}
+
+// static
QuicConnectionId QuicUtils::CreateReplacementConnectionId(
const QuicConnectionId& connection_id) {
return CreateReplacementConnectionId(connection_id,
@@ -511,7 +520,7 @@ QuicConnectionId QuicUtils::CreateReplacementConnectionId(
return EmptyQuicConnectionId();
}
const uint64_t connection_id_hash64 = FNV1a_64_Hash(
- quiche::QuicheStringPiece(connection_id.data(), connection_id.length()));
+ absl::string_view(connection_id.data(), connection_id.length()));
if (expected_connection_id_length <= sizeof(uint64_t)) {
return QuicConnectionId(
reinterpret_cast<const char*>(&connection_id_hash64),
@@ -519,7 +528,7 @@ QuicConnectionId QuicUtils::CreateReplacementConnectionId(
}
char new_connection_id_data[255] = {};
const QuicUint128 connection_id_hash128 = FNV1a_128_Hash(
- quiche::QuicheStringPiece(connection_id.data(), connection_id.length()));
+ absl::string_view(connection_id.data(), connection_id.length()));
static_assert(sizeof(connection_id_hash64) + sizeof(connection_id_hash128) <=
sizeof(new_connection_id_data),
"bad size");
@@ -566,7 +575,7 @@ QuicConnectionId QuicUtils::CreateZeroConnectionId(
if (!VersionAllowsVariableLengthConnectionIds(version)) {
char connection_id_bytes[8] = {0, 0, 0, 0, 0, 0, 0, 0};
return QuicConnectionId(static_cast<char*>(connection_id_bytes),
- QUICHE_ARRAYSIZE(connection_id_bytes));
+ ABSL_ARRAYSIZE(connection_id_bytes));
}
return EmptyQuicConnectionId();
}
@@ -615,7 +624,7 @@ bool QuicUtils::IsConnectionIdValidForVersion(
QuicUint128 QuicUtils::GenerateStatelessResetToken(
QuicConnectionId connection_id) {
return FNV1a_128_Hash(
- quiche::QuicheStringPiece(connection_id.data(), connection_id.length()));
+ absl::string_view(connection_id.data(), connection_id.length()));
}
// static
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_utils.h b/chromium/net/third_party/quiche/src/quic/core/quic_utils.h
index 05c7124194a..c1a19a830e4 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_utils.h
@@ -11,6 +11,7 @@
#include <string>
#include <type_traits>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
@@ -21,7 +22,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_iovec.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_uint128.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -31,22 +31,22 @@ class QUIC_EXPORT_PRIVATE QuicUtils {
// Returns the 64 bit FNV1a hash of the data. See
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
- static uint64_t FNV1a_64_Hash(quiche::QuicheStringPiece data);
+ static uint64_t FNV1a_64_Hash(absl::string_view data);
// Returns the 128 bit FNV1a hash of the data. See
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
- static QuicUint128 FNV1a_128_Hash(quiche::QuicheStringPiece data);
+ static QuicUint128 FNV1a_128_Hash(absl::string_view data);
// Returns the 128 bit FNV1a hash of the two sequences of data. See
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
- static QuicUint128 FNV1a_128_Hash_Two(quiche::QuicheStringPiece data1,
- quiche::QuicheStringPiece data2);
+ static QuicUint128 FNV1a_128_Hash_Two(absl::string_view data1,
+ absl::string_view data2);
// Returns the 128 bit FNV1a hash of the three sequences of data. See
// http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param
- static QuicUint128 FNV1a_128_Hash_Three(quiche::QuicheStringPiece data1,
- quiche::QuicheStringPiece data2,
- quiche::QuicheStringPiece data3);
+ static QuicUint128 FNV1a_128_Hash_Three(absl::string_view data1,
+ absl::string_view data2,
+ absl::string_view data3);
// SerializeUint128 writes the first 96 bits of |v| in little-endian form
// to |out|.
@@ -80,7 +80,7 @@ class QUIC_EXPORT_PRIVATE QuicUtils {
char* buffer);
// Creates an iovec pointing to the same data as |data|.
- static struct iovec MakeIovec(quiche::QuicheStringPiece data);
+ static struct iovec MakeIovec(absl::string_view data);
// Returns the opposite Perspective of the |perspective| passed in.
static constexpr Perspective InvertPerspective(Perspective perspective) {
@@ -170,6 +170,10 @@ class QUIC_EXPORT_PRIVATE QuicUtils {
QuicTransportVersion version,
Perspective perspective);
+ // Returns the largest possible client initiated bidirectional stream ID.
+ static QuicStreamId GetMaxClientInitiatedBidirectionalStreamId(
+ QuicTransportVersion version);
+
// Generates a connection ID of length |expected_connection_id_length|
// derived from |connection_id|.
// This is guaranteed to be deterministic (calling this method with two
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_utils_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_utils_test.cc
index 041cd9856a1..efcdb7e4293 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_utils_test.cc
@@ -6,12 +6,12 @@
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_protocol.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -100,7 +100,7 @@ TEST_F(QuicUtilsTest, ReferenceTest) {
data[i] = i % 255;
}
EXPECT_EQ(IncrementalHashReference(data.data(), data.size()),
- QuicUtils::FNV1a_128_Hash(quiche::QuicheStringPiece(
+ QuicUtils::FNV1a_128_Hash(absl::string_view(
reinterpret_cast<const char*>(data.data()), data.size())));
}
@@ -257,10 +257,10 @@ TEST_F(QuicUtilsTest, RandomConnectionId) {
QuicConnectionId connection_id = QuicUtils::CreateRandomConnectionId(&random);
EXPECT_EQ(connection_id.length(), sizeof(uint64_t));
char connection_id_bytes[sizeof(uint64_t)];
- random.RandBytes(connection_id_bytes, QUICHE_ARRAYSIZE(connection_id_bytes));
+ random.RandBytes(connection_id_bytes, ABSL_ARRAYSIZE(connection_id_bytes));
EXPECT_EQ(connection_id,
QuicConnectionId(static_cast<char*>(connection_id_bytes),
- QUICHE_ARRAYSIZE(connection_id_bytes)));
+ ABSL_ARRAYSIZE(connection_id_bytes)));
EXPECT_NE(connection_id, EmptyQuicConnectionId());
EXPECT_NE(connection_id, TestConnectionId());
EXPECT_NE(connection_id, TestConnectionId(1));
@@ -276,10 +276,10 @@ TEST_F(QuicUtilsTest, RandomConnectionIdVariableLength) {
QuicUtils::CreateRandomConnectionId(connection_id_length, &random);
EXPECT_EQ(connection_id.length(), connection_id_length);
char connection_id_bytes[connection_id_length];
- random.RandBytes(connection_id_bytes, QUICHE_ARRAYSIZE(connection_id_bytes));
+ random.RandBytes(connection_id_bytes, ABSL_ARRAYSIZE(connection_id_bytes));
EXPECT_EQ(connection_id,
QuicConnectionId(static_cast<char*>(connection_id_bytes),
- QUICHE_ARRAYSIZE(connection_id_bytes)));
+ ABSL_ARRAYSIZE(connection_id_bytes)));
EXPECT_NE(connection_id, EmptyQuicConnectionId());
EXPECT_NE(connection_id, TestConnectionId());
EXPECT_NE(connection_id, TestConnectionId(1));
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_version_manager.cc b/chromium/net/third_party/quiche/src/quic/core/quic_version_manager.cc
index 7cf6a1d8c24..9ca86f960de 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_version_manager.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_version_manager.cc
@@ -6,10 +6,10 @@
#include <algorithm>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_version_manager_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_version_manager_test.cc
index c91ad99d4af..487471f0e19 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_version_manager_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_version_manager_test.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/quic/core/quic_version_manager.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
using ::testing::ElementsAre;
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_versions.cc b/chromium/net/third_party/quiche/src/quic/core/quic_versions.cc
index d3f707bdda7..6bda82be251 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_versions.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_versions.cc
@@ -6,6 +6,9 @@
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_split.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_tag.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -13,10 +16,9 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
namespace {
@@ -328,14 +330,12 @@ ParsedQuicVersion ParseQuicVersionLabel(QuicVersionLabel version_label) {
return UnsupportedQuicVersion();
}
-ParsedQuicVersion ParseQuicVersionString(
- quiche::QuicheStringPiece version_string) {
+ParsedQuicVersion ParseQuicVersionString(absl::string_view version_string) {
if (version_string.empty()) {
return UnsupportedQuicVersion();
}
int quic_version_number = 0;
- if (quiche::QuicheTextUtils::StringToInt(version_string,
- &quic_version_number) &&
+ if (absl::SimpleAtoi(version_string, &quic_version_number) &&
quic_version_number > 0) {
QuicTransportVersion transport_version =
static_cast<QuicTransportVersion>(quic_version_number);
@@ -374,11 +374,11 @@ ParsedQuicVersion ParseQuicVersionString(
}
ParsedQuicVersionVector ParseQuicVersionVectorString(
- quiche::QuicheStringPiece versions_string) {
+ absl::string_view versions_string) {
ParsedQuicVersionVector versions;
- std::vector<quiche::QuicheStringPiece> version_strings =
- quiche::QuicheTextUtils::Split(versions_string, ',');
- for (quiche::QuicheStringPiece version_string : version_strings) {
+ std::vector<absl::string_view> version_strings =
+ absl::StrSplit(versions_string, ',');
+ for (absl::string_view version_string : version_strings) {
quiche::QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(
&version_string);
ParsedQuicVersion version = ParseQuicVersionString(version_string);
@@ -664,6 +664,9 @@ std::string AlpnForVersion(ParsedQuicVersion parsed_version) {
void QuicVersionInitializeSupportForIetfDraft() {
// Enable necessary flags.
SetQuicRestartFlag(quic_enable_zero_rtt_for_tls_v2, true);
+ SetQuicReloadableFlag(quic_key_update_supported, true);
+ SetQuicReloadableFlag(quic_send_version_negotiation_for_short_connection_ids,
+ true);
}
void QuicEnableVersion(const ParsedQuicVersion& version) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_versions.h b/chromium/net/third_party/quiche/src/quic/core/quic_versions.h
index 77b33594f79..c29b715f288 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_versions.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_versions.h
@@ -26,10 +26,10 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_tag.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -198,6 +198,7 @@ QUIC_EXPORT_PRIVATE constexpr bool ParsedQuicVersionIsValid(
return transport_version == QUIC_VERSION_UNSUPPORTED;
case PROTOCOL_QUIC_CRYPTO:
return transport_version != QUIC_VERSION_UNSUPPORTED &&
+ transport_version != QUIC_VERSION_RESERVED_FOR_NEGOTIATION &&
transport_version != QUIC_VERSION_51 &&
transport_version != QUIC_VERSION_IETF_DRAFT_27 &&
transport_version != QUIC_VERSION_IETF_DRAFT_29;
@@ -281,7 +282,7 @@ struct QUIC_EXPORT_PRIVATE ParsedQuicVersion {
}
static constexpr ParsedQuicVersion ReservedForNegotiation() {
- return ParsedQuicVersion(PROTOCOL_QUIC_CRYPTO,
+ return ParsedQuicVersion(PROTOCOL_TLS1_3,
QUIC_VERSION_RESERVED_FOR_NEGOTIATION);
}
@@ -496,13 +497,13 @@ ParseQuicVersionLabel(QuicVersionLabel version_label);
// ALPN such as "h3-29" or "h3-Q050". For PROTOCOL_QUIC_CRYPTO versions, also
// supports parsing numbers such as "46".
QUIC_EXPORT_PRIVATE ParsedQuicVersion
-ParseQuicVersionString(quiche::QuicheStringPiece version_string);
+ParseQuicVersionString(absl::string_view version_string);
// Parses a comma-separated list of QUIC version strings. Supports parsing by
// label, ALPN and numbers for PROTOCOL_QUIC_CRYPTO. Skips unknown versions.
// For example: "h3-29,Q050,46".
QUIC_EXPORT_PRIVATE ParsedQuicVersionVector
-ParseQuicVersionVectorString(quiche::QuicheStringPiece versions_string);
+ParseQuicVersionVectorString(absl::string_view versions_string);
// Constructs a QuicVersionLabel from the provided ParsedQuicVersion.
QUIC_EXPORT_PRIVATE QuicVersionLabel
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_versions_test.cc b/chromium/net/third_party/quiche/src/quic/core/quic_versions_test.cc
index fa32de3f9b8..452f3f8e345 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_versions_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_versions_test.cc
@@ -4,12 +4,12 @@
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mock_log.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -332,16 +332,16 @@ TEST_F(QuicVersionsTest, CreateQuicVersionLabel) {
CreateQuicVersionLabel(ParsedQuicVersion::T050()));
// Make sure the negotiation reserved version is in the IETF reserved space.
- EXPECT_EQ(MakeVersionLabel(0xda, 0x5a, 0x3a, 0x3a) & 0x0f0f0f0f,
- CreateQuicVersionLabel(ParsedQuicVersion(
- PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_RESERVED_FOR_NEGOTIATION)) &
- 0x0f0f0f0f);
+ EXPECT_EQ(
+ MakeVersionLabel(0xda, 0x5a, 0x3a, 0x3a) & 0x0f0f0f0f,
+ CreateQuicVersionLabel(ParsedQuicVersion::ReservedForNegotiation()) &
+ 0x0f0f0f0f);
// Make sure that disabling randomness works.
SetQuicFlag(FLAGS_quic_disable_version_negotiation_grease_randomness, true);
- EXPECT_EQ(MakeVersionLabel(0xda, 0x5a, 0x3a, 0x3a),
- CreateQuicVersionLabel(ParsedQuicVersion(
- PROTOCOL_QUIC_CRYPTO, QUIC_VERSION_RESERVED_FOR_NEGOTIATION)));
+ EXPECT_EQ(
+ MakeVersionLabel(0xda, 0x5a, 0x3a, 0x3a),
+ CreateQuicVersionLabel(ParsedQuicVersion::ReservedForNegotiation()));
}
TEST_F(QuicVersionsTest, QuicVersionLabelToString) {
@@ -371,7 +371,7 @@ TEST_F(QuicVersionsTest, QuicVersionToString) {
QuicTransportVersion single_version[] = {QUIC_VERSION_43};
QuicTransportVersionVector versions_vector;
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(single_version); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(single_version); ++i) {
versions_vector.push_back(single_version[i]);
}
EXPECT_EQ("QUIC_VERSION_43",
@@ -380,7 +380,7 @@ TEST_F(QuicVersionsTest, QuicVersionToString) {
QuicTransportVersion multiple_versions[] = {QUIC_VERSION_UNSUPPORTED,
QUIC_VERSION_43};
versions_vector.clear();
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(multiple_versions); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(multiple_versions); ++i) {
versions_vector.push_back(multiple_versions[i]);
}
EXPECT_EQ("QUIC_VERSION_UNSUPPORTED,QUIC_VERSION_43",
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.cc b/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.cc
index b3602a6618a..eba6a2936b3 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.cc
@@ -149,17 +149,8 @@ void QuicWriteBlockedList::UpdateBytesForStream(QuicStreamId stream_id,
if (batch_write_stream_id_[last_priority_popped_] == stream_id) {
// If this was the last data stream popped by PopFront, update the
// bytes remaining in its batch write.
- if (fix_bytes_left_for_batch_write_) {
- QUIC_RELOADABLE_FLAG_COUNT(quic_fix_bytes_left_for_batch_write);
- // TODO(fayang): change this static_cast to static_cast<uint32_t> when
- // deprecating quic_fix_bytes_left_for_batch_write.
- bytes_left_for_batch_write_[last_priority_popped_] -=
- std::min(bytes_left_for_batch_write_[last_priority_popped_],
- static_cast<int32_t>(bytes));
- } else {
- bytes_left_for_batch_write_[last_priority_popped_] -=
- static_cast<int32_t>(bytes);
- }
+ bytes_left_for_batch_write_[last_priority_popped_] -=
+ std::min(bytes_left_for_batch_write_[last_priority_popped_], bytes);
}
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.h b/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.h
index 08f70b39515..930157b5197 100644
--- a/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.h
+++ b/chromium/net/third_party/quiche/src/quic/core/quic_write_blocked_list.h
@@ -27,7 +27,7 @@ namespace quic {
// Crypto stream > Headers stream > Data streams by requested priority.
class QUIC_EXPORT_PRIVATE QuicWriteBlockedList {
private:
- typedef spdy::WriteScheduler<QuicStreamId> QuicPriorityWriteScheduler;
+ using QuicPriorityWriteScheduler = spdy::WriteScheduler<QuicStreamId>;
public:
explicit QuicWriteBlockedList(QuicTransportVersion version);
@@ -104,9 +104,7 @@ class QUIC_EXPORT_PRIVATE QuicWriteBlockedList {
// Set to kBatchWriteSize when we set a new batch_write_stream_id_ for a given
// priority. This is decremented with each write the stream does until it is
// done with its batch write.
- // TODO(fayang): switch this to uint32_t when deprecating
- // quic_fix_bytes_left_for_batch_write.
- int32_t bytes_left_for_batch_write_[spdy::kV3LowestPriority + 1];
+ size_t bytes_left_for_batch_write_[spdy::kV3LowestPriority + 1];
// Tracks the last priority popped for UpdateBytesForStream.
spdy::SpdyPriority last_priority_popped_;
@@ -120,7 +118,7 @@ class QUIC_EXPORT_PRIVATE QuicWriteBlockedList {
};
// Optimized for the typical case of 2 static streams per session.
- typedef QuicInlinedVector<StreamIdBlockedPair, 2> StreamsVector;
+ using StreamsVector = QuicInlinedVector<StreamIdBlockedPair, 2>;
StreamsVector::const_iterator begin() const { return streams_.cbegin(); }
@@ -156,9 +154,6 @@ class QUIC_EXPORT_PRIVATE QuicWriteBlockedList {
StaticStreamCollection static_stream_collection_;
spdy::WriteSchedulerType scheduler_type_;
-
- const bool fix_bytes_left_for_batch_write_ =
- GetQuicReloadableFlag(quic_fix_bytes_left_for_batch_write);
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/stream_delegate_interface.h b/chromium/net/third_party/quiche/src/quic/core/stream_delegate_interface.h
index 9f271475939..dc932999f2c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/stream_delegate_interface.h
+++ b/chromium/net/third_party/quiche/src/quic/core/stream_delegate_interface.h
@@ -6,8 +6,8 @@
#define QUICHE_QUIC_CORE_STREAM_DELEGATE_INTERFACE_H_
#include <cstddef>
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
namespace quic {
@@ -26,13 +26,15 @@ class QUIC_EXPORT_PRIVATE StreamDelegateInterface {
// Called when the stream needs to write data. If |level| is present, the data
// will be written at the specified |level|. The data will be written
// at specified transmission |type|.
+ // TODO(fayang): Change absl::optional<EncryptionLevel> to EncryptionLevel
+ // when deprecating quic_use_write_or_buffer_data_at_level.
virtual QuicConsumedData WritevData(
QuicStreamId id,
size_t write_length,
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level) = 0;
+ absl::optional<EncryptionLevel> level) = 0;
// Called to write crypto data.
virtual size_t SendCryptoData(EncryptionLevel level,
size_t write_length,
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.cc b/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.cc
index 7c10d2c8e0b..06ed1c8a4da 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.cc
@@ -6,6 +6,7 @@
#include <cstring>
#include <memory>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_crypto_frame.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
@@ -16,7 +17,6 @@
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -280,14 +280,14 @@ void TlsChloExtractor::HandleParsedChlo(const SSL_CLIENT_HELLO* client_hello) {
if (rv == 1) {
QuicDataReader alpns_reader(reinterpret_cast<const char*>(alpn_data),
alpn_len);
- quiche::QuicheStringPiece alpns_payload;
+ absl::string_view alpns_payload;
if (!alpns_reader.ReadStringPiece16(&alpns_payload)) {
HandleUnrecoverableError("Failed to read alpns_payload");
return;
}
QuicDataReader alpns_payload_reader(alpns_payload);
while (!alpns_payload_reader.IsDoneReading()) {
- quiche::QuicheStringPiece alpn_payload;
+ absl::string_view alpn_payload;
if (!alpns_payload_reader.ReadStringPiece8(&alpn_payload)) {
HandleUnrecoverableError("Failed to read alpn_payload");
return;
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.h b/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.h
index b50d2e236ab..718e5fa09eb 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.h
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor.h
@@ -67,10 +67,9 @@ class QUIC_NO_EXPORT TlsChloExtractor
const QuicVersionNegotiationPacket& /*packet*/) override {}
void OnRetryPacket(QuicConnectionId /*original_connection_id*/,
QuicConnectionId /*new_connection_id*/,
- quiche::QuicheStringPiece /*retry_token*/,
- quiche::QuicheStringPiece /*retry_integrity_tag*/,
- quiche::QuicheStringPiece /*retry_without_tag*/) override {
- }
+ absl::string_view /*retry_token*/,
+ absl::string_view /*retry_integrity_tag*/,
+ absl::string_view /*retry_without_tag*/) override {}
bool OnUnauthenticatedPublicHeader(const QuicPacketHeader& header) override;
bool OnUnauthenticatedHeader(const QuicPacketHeader& /*header*/) override {
return true;
@@ -161,6 +160,15 @@ class QUIC_NO_EXPORT TlsChloExtractor
}
void OnAuthenticatedIetfStatelessResetPacket(
const QuicIetfStatelessResetPacket& /*packet*/) override {}
+ void OnKeyUpdate(KeyUpdateReason /*reason*/) override {}
+ void OnDecryptedFirstPacketInKeyPhase() override {}
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
// Methods from QuicStreamSequencer::StreamInterface.
void OnDataAvailable() override;
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor_test.cc b/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor_test.cc
index 955e58c0ee6..db926b422c2 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_chlo_extractor_test.cc
@@ -31,7 +31,7 @@ class TlsChloExtractorTest : public QuicTestWithParam<ParsedQuicVersion> {
QuicSocketAddress(TestPeerIPAddress(), kTestPort), *packet);
std::string detailed_error;
bool retry_token_present;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
const QuicErrorCode error = QuicFramer::ParsePublicHeaderDispatcher(
*packet, /*expected_destination_connection_id_length=*/0,
&packet_info.form, &packet_info.long_packet_type,
@@ -128,7 +128,7 @@ TEST_P(TlsChloExtractorTest, MoveAssignmentBetweenPackets) {
QuicSocketAddress(TestPeerIPAddress(), kTestPort), *packets_[0]);
std::string detailed_error;
bool retry_token_present;
- quiche::QuicheStringPiece retry_token;
+ absl::string_view retry_token;
const QuicErrorCode error = QuicFramer::ParsePublicHeaderDispatcher(
*packets_[0], /*expected_destination_connection_id_length=*/0,
&packet_info.form, &packet_info.long_packet_type,
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.cc b/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.cc
index ba3f9d4de4a..6ea06b83b3c 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.cc
@@ -7,6 +7,7 @@
#include <cstring>
#include <string>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
@@ -15,40 +16,10 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
-TlsClientHandshaker::ProofVerifierCallbackImpl::ProofVerifierCallbackImpl(
- TlsClientHandshaker* parent)
- : parent_(parent) {}
-
-TlsClientHandshaker::ProofVerifierCallbackImpl::~ProofVerifierCallbackImpl() {}
-
-void TlsClientHandshaker::ProofVerifierCallbackImpl::Run(
- bool ok,
- const std::string& /*error_details*/,
- std::unique_ptr<ProofVerifyDetails>* details) {
- if (parent_ == nullptr) {
- return;
- }
-
- parent_->verify_details_ = std::move(*details);
- parent_->verify_result_ = ok ? ssl_verify_ok : ssl_verify_invalid;
- parent_->state_ = STATE_HANDSHAKE_RUNNING;
- parent_->proof_verify_callback_ = nullptr;
- if (parent_->verify_details_) {
- parent_->proof_handler_->OnProofVerifyDetailsAvailable(
- *parent_->verify_details_);
- }
- parent_->AdvanceHandshake();
-}
-
-void TlsClientHandshaker::ProofVerifierCallbackImpl::Cancel() {
- parent_ = nullptr;
-}
-
TlsClientHandshaker::TlsClientHandshaker(
const QuicServerId& server_id,
QuicCryptoStream* stream,
@@ -70,15 +41,9 @@ TlsClientHandshaker::TlsClientHandshaker(
has_application_state_(has_application_state),
tls_connection_(crypto_config->ssl_ctx(), this) {}
-TlsClientHandshaker::~TlsClientHandshaker() {
- if (proof_verify_callback_) {
- proof_verify_callback_->Cancel();
- }
-}
+TlsClientHandshaker::~TlsClientHandshaker() {}
bool TlsClientHandshaker::CryptoConnect() {
- state_ = STATE_HANDSHAKE_RUNNING;
-
if (!pre_shared_key_.empty()) {
// TODO(b/154162689) add PSK support to QUIC+TLS.
std::string error_details =
@@ -189,7 +154,7 @@ bool TlsClientHandshaker::SetAlpn() {
success && (SSL_set_alpn_protos(ssl(), alpn, alpn_writer.length()) == 0);
if (!success) {
QUIC_BUG << "Failed to set ALPN: "
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
+ << quiche::QuicheTextUtils::HexDump(absl::string_view(
alpn_writer.data(), alpn_writer.length()));
return false;
}
@@ -273,7 +238,7 @@ bool TlsClientHandshaker::ProcessTransportParameters(
}
session()->OnConfigNegotiated();
- if (state_ == STATE_CONNECTION_CLOSED) {
+ if (is_connection_closed()) {
*error_details =
"Session closed the connection when parsing negotiated config.";
return false;
@@ -286,12 +251,12 @@ int TlsClientHandshaker::num_sent_client_hellos() const {
}
bool TlsClientHandshaker::IsResumption() const {
- QUIC_BUG_IF(!one_rtt_keys_available_);
+ QUIC_BUG_IF(!one_rtt_keys_available());
return SSL_session_reused(ssl()) == 1;
}
bool TlsClientHandshaker::EarlyDataAccepted() const {
- QUIC_BUG_IF(!one_rtt_keys_available_);
+ QUIC_BUG_IF(!one_rtt_keys_available());
return SSL_early_data_accepted(ssl()) == 1;
}
@@ -300,7 +265,7 @@ ssl_early_data_reason_t TlsClientHandshaker::EarlyDataReason() const {
}
bool TlsClientHandshaker::ReceivedInchoateReject() const {
- QUIC_BUG_IF(!one_rtt_keys_available_);
+ QUIC_BUG_IF(!one_rtt_keys_available());
// REJ messages are a QUIC crypto feature, so TLS always returns false.
return false;
}
@@ -319,7 +284,7 @@ bool TlsClientHandshaker::encryption_established() const {
}
bool TlsClientHandshaker::one_rtt_keys_available() const {
- return one_rtt_keys_available_;
+ return state_ >= HANDSHAKE_COMPLETE;
}
const QuicCryptoNegotiatedParameters&
@@ -332,16 +297,7 @@ CryptoMessageParser* TlsClientHandshaker::crypto_message_parser() {
}
HandshakeState TlsClientHandshaker::GetHandshakeState() const {
- if (handshake_confirmed_) {
- return HANDSHAKE_CONFIRMED;
- }
- if (one_rtt_keys_available_) {
- return HANDSHAKE_COMPLETE;
- }
- if (state_ >= STATE_ENCRYPTION_HANDSHAKE_DATA_SENT) {
- return HANDSHAKE_PROCESSED;
- }
- return HANDSHAKE_START;
+ return state_;
}
size_t TlsClientHandshaker::BufferSizeLimitForLevel(
@@ -349,6 +305,20 @@ size_t TlsClientHandshaker::BufferSizeLimitForLevel(
return TlsHandshaker::BufferSizeLimitForLevel(level);
}
+bool TlsClientHandshaker::KeyUpdateSupportedLocally() const {
+ return true;
+}
+
+std::unique_ptr<QuicDecrypter>
+TlsClientHandshaker::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ return TlsHandshaker::AdvanceKeysAndCreateCurrentOneRttDecrypter();
+}
+
+std::unique_ptr<QuicEncrypter>
+TlsClientHandshaker::CreateCurrentOneRttEncrypter() {
+ return TlsHandshaker::CreateCurrentOneRttEncrypter();
+}
+
void TlsClientHandshaker::OnOneRttPacketAcknowledged() {
OnHandshakeConfirmed();
}
@@ -362,13 +332,13 @@ void TlsClientHandshaker::OnHandshakePacketSent() {
handshaker_delegate()->DiscardOldDecryptionKey(ENCRYPTION_INITIAL);
}
-void TlsClientHandshaker::OnConnectionClosed(QuicErrorCode /*error*/,
- ConnectionCloseSource /*source*/) {
- state_ = STATE_CONNECTION_CLOSED;
+void TlsClientHandshaker::OnConnectionClosed(QuicErrorCode error,
+ ConnectionCloseSource source) {
+ TlsHandshaker::OnConnectionClosed(error, source);
}
void TlsClientHandshaker::OnHandshakeDoneReceived() {
- if (!one_rtt_keys_available_) {
+ if (!one_rtt_keys_available()) {
CloseConnection(QUIC_HANDSHAKE_FAILED,
"Unexpected handshake done received");
return;
@@ -380,89 +350,54 @@ void TlsClientHandshaker::SetWriteSecret(
EncryptionLevel level,
const SSL_CIPHER* cipher,
const std::vector<uint8_t>& write_secret) {
- if (state_ == STATE_CONNECTION_CLOSED) {
+ if (is_connection_closed()) {
return;
}
if (level == ENCRYPTION_FORWARD_SECURE || level == ENCRYPTION_ZERO_RTT) {
encryption_established_ = true;
}
- const bool postpone_discarding_zero_rtt_keys =
- GetQuicReloadableFlag(quic_postpone_discarding_zero_rtt_keys);
- if (!postpone_discarding_zero_rtt_keys &&
- level == ENCRYPTION_FORWARD_SECURE) {
- handshaker_delegate()->DiscardOldEncryptionKey(ENCRYPTION_ZERO_RTT);
- }
TlsHandshaker::SetWriteSecret(level, cipher, write_secret);
- if (postpone_discarding_zero_rtt_keys && level == ENCRYPTION_FORWARD_SECURE) {
+ if (level == ENCRYPTION_FORWARD_SECURE) {
handshaker_delegate()->DiscardOldEncryptionKey(ENCRYPTION_ZERO_RTT);
}
}
void TlsClientHandshaker::OnHandshakeConfirmed() {
- DCHECK(one_rtt_keys_available_);
- if (handshake_confirmed_) {
+ DCHECK(one_rtt_keys_available());
+ if (state_ >= HANDSHAKE_CONFIRMED) {
return;
}
- handshake_confirmed_ = true;
+ state_ = HANDSHAKE_CONFIRMED;
handshaker_delegate()->DiscardOldEncryptionKey(ENCRYPTION_HANDSHAKE);
handshaker_delegate()->DiscardOldDecryptionKey(ENCRYPTION_HANDSHAKE);
}
-void TlsClientHandshaker::AdvanceHandshake() {
- if (state_ == STATE_CONNECTION_CLOSED) {
- QUIC_LOG(INFO)
- << "TlsClientHandshaker received message after connection closed";
- return;
- }
- if (state_ == STATE_IDLE) {
- CloseConnection(QUIC_HANDSHAKE_FAILED,
- "Client observed TLS handshake idle failure");
- return;
- }
- if (state_ == STATE_HANDSHAKE_COMPLETE) {
- int rv = SSL_process_quic_post_handshake(ssl());
- if (rv != 1) {
- CloseConnection(QUIC_HANDSHAKE_FAILED, "Unexpected post-handshake data");
- }
- return;
- }
+QuicAsyncStatus TlsClientHandshaker::VerifyCertChain(
+ const std::vector<std::string>& certs,
+ std::string* error_details,
+ std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
+ std::unique_ptr<ProofVerifierCallback> callback) {
+ const uint8_t* ocsp_response_raw;
+ size_t ocsp_response_len;
+ SSL_get0_ocsp_response(ssl(), &ocsp_response_raw, &ocsp_response_len);
+ std::string ocsp_response(reinterpret_cast<const char*>(ocsp_response_raw),
+ ocsp_response_len);
+ const uint8_t* sct_list_raw;
+ size_t sct_list_len;
+ SSL_get0_signed_cert_timestamp_list(ssl(), &sct_list_raw, &sct_list_len);
+ std::string sct_list(reinterpret_cast<const char*>(sct_list_raw),
+ sct_list_len);
- QUIC_LOG(INFO) << "TlsClientHandshaker: continuing handshake";
- int rv = SSL_do_handshake(ssl());
- if (rv == 1) {
- FinishHandshake();
- return;
- }
- int ssl_error = SSL_get_error(ssl(), rv);
- bool should_close = true;
- if (ssl_error == SSL_ERROR_EARLY_DATA_REJECTED) {
- HandleZeroRttReject();
- return;
- }
- switch (state_) {
- case STATE_HANDSHAKE_RUNNING:
- should_close = ssl_error != SSL_ERROR_WANT_READ;
- break;
- case STATE_CERT_VERIFY_PENDING:
- should_close = ssl_error != SSL_ERROR_WANT_CERTIFICATE_VERIFY;
- break;
- default:
- should_close = true;
- }
- if (should_close && state_ != STATE_CONNECTION_CLOSED) {
- // TODO(nharper): Surface error details from the error queue when ssl_error
- // is SSL_ERROR_SSL.
- QUIC_LOG(WARNING) << "SSL_do_handshake failed; closing connection";
- CloseConnection(QUIC_HANDSHAKE_FAILED,
- "Client observed TLS handshake failure");
- }
+ return proof_verifier_->VerifyCertChain(
+ server_id_.host(), server_id_.port(), certs, ocsp_response, sct_list,
+ verify_context_.get(), error_details, details, out_alert,
+ std::move(callback));
}
-void TlsClientHandshaker::CloseConnection(QuicErrorCode error,
- const std::string& reason_phrase) {
- DCHECK(!reason_phrase.empty());
- state_ = STATE_CONNECTION_CLOSED;
- stream()->OnUnrecoverableError(error, reason_phrase);
+void TlsClientHandshaker::OnProofVerifyDetailsAvailable(
+ const ProofVerifyDetails& verify_details) {
+ proof_handler_->OnProofVerifyDetailsAvailable(verify_details);
}
void TlsClientHandshaker::FinishHandshake() {
@@ -487,7 +422,6 @@ void TlsClientHandshaker::FinishHandshake() {
return;
}
QUIC_LOG(INFO) << "Client: handshake finished";
- state_ = STATE_HANDSHAKE_COMPLETE;
std::string error_details;
if (!ProcessTransportParameters(&error_details)) {
@@ -523,10 +457,26 @@ void TlsClientHandshaker::FinishHandshake() {
session()->OnAlpnSelected(received_alpn_string);
QUIC_DLOG(INFO) << "Client: server selected ALPN: '" << received_alpn_string
<< "'";
- one_rtt_keys_available_ = true;
+ state_ = HANDSHAKE_COMPLETE;
handshaker_delegate()->OnTlsHandshakeComplete();
}
+void TlsClientHandshaker::ProcessPostHandshakeMessage() {
+ int rv = SSL_process_quic_post_handshake(ssl());
+ if (rv != 1) {
+ CloseConnection(QUIC_HANDSHAKE_FAILED, "Unexpected post-handshake data");
+ }
+}
+
+bool TlsClientHandshaker::ShouldCloseConnectionOnUnexpectedError(
+ int ssl_error) {
+ if (ssl_error != SSL_ERROR_EARLY_DATA_REJECTED) {
+ return true;
+ }
+ HandleZeroRttReject();
+ return false;
+}
+
void TlsClientHandshaker::HandleZeroRttReject() {
QUIC_LOG(INFO) << "0-RTT handshake attempted but was rejected by the server";
DCHECK(session_cache_);
@@ -538,61 +488,6 @@ void TlsClientHandshaker::HandleZeroRttReject() {
AdvanceHandshake();
}
-enum ssl_verify_result_t TlsClientHandshaker::VerifyCert(uint8_t* out_alert) {
- if (verify_result_ != ssl_verify_retry ||
- state_ == STATE_CERT_VERIFY_PENDING) {
- enum ssl_verify_result_t result = verify_result_;
- verify_result_ = ssl_verify_retry;
- return result;
- }
- const STACK_OF(CRYPTO_BUFFER)* cert_chain = SSL_get0_peer_certificates(ssl());
- if (cert_chain == nullptr) {
- *out_alert = SSL_AD_INTERNAL_ERROR;
- return ssl_verify_invalid;
- }
- // TODO(nharper): Pass the CRYPTO_BUFFERs into the QUIC stack to avoid copies.
- std::vector<std::string> certs;
- for (CRYPTO_BUFFER* cert : cert_chain) {
- certs.push_back(
- std::string(reinterpret_cast<const char*>(CRYPTO_BUFFER_data(cert)),
- CRYPTO_BUFFER_len(cert)));
- }
- const uint8_t* ocsp_response_raw;
- size_t ocsp_response_len;
- SSL_get0_ocsp_response(ssl(), &ocsp_response_raw, &ocsp_response_len);
- std::string ocsp_response(reinterpret_cast<const char*>(ocsp_response_raw),
- ocsp_response_len);
- const uint8_t* sct_list_raw;
- size_t sct_list_len;
- SSL_get0_signed_cert_timestamp_list(ssl(), &sct_list_raw, &sct_list_len);
- std::string sct_list(reinterpret_cast<const char*>(sct_list_raw),
- sct_list_len);
-
- ProofVerifierCallbackImpl* proof_verify_callback =
- new ProofVerifierCallbackImpl(this);
-
- QuicAsyncStatus verify_result = proof_verifier_->VerifyCertChain(
- server_id_.host(), server_id_.port(), certs, ocsp_response, sct_list,
- verify_context_.get(), &cert_verify_error_details_, &verify_details_,
- std::unique_ptr<ProofVerifierCallback>(proof_verify_callback));
- switch (verify_result) {
- case QUIC_SUCCESS:
- if (verify_details_) {
- proof_handler_->OnProofVerifyDetailsAvailable(*verify_details_);
- }
- return ssl_verify_ok;
- case QUIC_PENDING:
- proof_verify_callback_ = proof_verify_callback;
- state_ = STATE_CERT_VERIFY_PENDING;
- return ssl_verify_retry;
- case QUIC_FAILURE:
- default:
- QUIC_LOG(INFO) << "Cert chain verification failed: "
- << cert_verify_error_details_;
- return ssl_verify_invalid;
- }
-}
-
void TlsClientHandshaker::InsertSession(bssl::UniquePtr<SSL_SESSION> session) {
if (!received_transport_params_) {
QUIC_BUG << "Transport parameters isn't received";
@@ -616,17 +511,16 @@ void TlsClientHandshaker::InsertSession(bssl::UniquePtr<SSL_SESSION> session) {
}
void TlsClientHandshaker::WriteMessage(EncryptionLevel level,
- quiche::QuicheStringPiece data) {
- if (level == ENCRYPTION_HANDSHAKE &&
- state_ < STATE_ENCRYPTION_HANDSHAKE_DATA_SENT) {
- state_ = STATE_ENCRYPTION_HANDSHAKE_DATA_SENT;
+ absl::string_view data) {
+ if (level == ENCRYPTION_HANDSHAKE && state_ < HANDSHAKE_PROCESSED) {
+ state_ = HANDSHAKE_PROCESSED;
}
TlsHandshaker::WriteMessage(level, data);
}
void TlsClientHandshaker::SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> application_state) {
- DCHECK_EQ(STATE_HANDSHAKE_COMPLETE, state_);
+ DCHECK(one_rtt_keys_available());
received_application_state_ = std::move(application_state);
// At least one tls session is cached before application state is received. So
// insert now.
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.h b/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.h
index 2a09fb83818..aadfa0bf541 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.h
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker.h
@@ -9,8 +9,8 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
-#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h"
#include "net/third_party/quiche/src/quic/core/crypto/tls_client_connection.h"
#include "net/third_party/quiche/src/quic/core/crypto/transport_parameters.h"
@@ -18,7 +18,6 @@
#include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
#include "net/third_party/quiche/src/quic/core/tls_handshaker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -59,6 +58,10 @@ class QUIC_EXPORT_PRIVATE TlsClientHandshaker
CryptoMessageParser* crypto_message_parser() override;
HandshakeState GetHandshakeState() const override;
size_t BufferSizeLimitForLevel(EncryptionLevel level) const override;
+ bool KeyUpdateSupportedLocally() const override;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
void OnOneRttPacketAcknowledged() override;
void OnHandshakePacketSent() override;
void OnConnectionClosed(QuicErrorCode error,
@@ -69,8 +72,7 @@ class QUIC_EXPORT_PRIVATE TlsClientHandshaker
const std::vector<uint8_t>& write_secret) override;
// Override to drop initial keys if trying to write ENCRYPTION_HANDSHAKE data.
- void WriteMessage(EncryptionLevel level,
- quiche::QuicheStringPiece data) override;
+ void WriteMessage(EncryptionLevel level, absl::string_view data) override;
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> application_state) override;
@@ -83,48 +85,25 @@ class QUIC_EXPORT_PRIVATE TlsClientHandshaker
return &tls_connection_;
}
- void AdvanceHandshake() override;
- void CloseConnection(QuicErrorCode error,
- const std::string& reason_phrase) override;
+ void FinishHandshake() override;
+ void ProcessPostHandshakeMessage() override;
+ bool ShouldCloseConnectionOnUnexpectedError(int ssl_error) override;
+ QuicAsyncStatus VerifyCertChain(
+ const std::vector<std::string>& certs,
+ std::string* error_details,
+ std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
+ std::unique_ptr<ProofVerifierCallback> callback) override;
+ void OnProofVerifyDetailsAvailable(
+ const ProofVerifyDetails& verify_details) override;
// TlsClientConnection::Delegate implementation:
- enum ssl_verify_result_t VerifyCert(uint8_t* out_alert) override;
TlsConnection::Delegate* ConnectionDelegate() override { return this; }
private:
- // ProofVerifierCallbackImpl handles the result of an asynchronous certificate
- // verification operation.
- class QUIC_EXPORT_PRIVATE ProofVerifierCallbackImpl
- : public ProofVerifierCallback {
- public:
- explicit ProofVerifierCallbackImpl(TlsClientHandshaker* parent);
- ~ProofVerifierCallbackImpl() override;
-
- // ProofVerifierCallback interface.
- void Run(bool ok,
- const std::string& error_details,
- std::unique_ptr<ProofVerifyDetails>* details) override;
-
- // If called, Cancel causes the pending callback to be a no-op.
- void Cancel();
-
- private:
- TlsClientHandshaker* parent_;
- };
-
- enum State {
- STATE_IDLE,
- STATE_HANDSHAKE_RUNNING,
- STATE_CERT_VERIFY_PENDING,
- STATE_ENCRYPTION_HANDSHAKE_DATA_SENT,
- STATE_HANDSHAKE_COMPLETE,
- STATE_CONNECTION_CLOSED,
- } state_ = STATE_IDLE;
-
bool SetAlpn();
bool SetTransportParameters();
bool ProcessTransportParameters(std::string* error_details);
- void FinishHandshake();
void HandleZeroRttReject();
// Called when server completes handshake (i.e., either handshake done is
@@ -141,10 +120,10 @@ class QUIC_EXPORT_PRIVATE TlsClientHandshaker
QuicServerId server_id_;
// Objects used for verifying the server's certificate chain.
- // |proof_verifier_| is owned by the caller of TlsClientHandshaker's
- // constructor.
+ // |proof_verifier_| is owned by the caller of TlsHandshaker's constructor.
ProofVerifier* proof_verifier_;
std::unique_ptr<ProofVerifyContext> verify_context_;
+
// Unowned pointer to the proof handler which has the
// OnProofVerifyDetailsAvailable callback to use for notifying the result of
// certificate verification.
@@ -159,17 +138,9 @@ class QUIC_EXPORT_PRIVATE TlsClientHandshaker
// Pre-shared key used during the handshake.
std::string pre_shared_key_;
- // ProofVerifierCallback used for async certificate verification. This object
- // is owned by |proof_verifier_|.
- ProofVerifierCallbackImpl* proof_verify_callback_ = nullptr;
- std::unique_ptr<ProofVerifyDetails> verify_details_;
- enum ssl_verify_result_t verify_result_ = ssl_verify_retry;
- std::string cert_verify_error_details_;
-
+ HandshakeState state_ = HANDSHAKE_START;
bool encryption_established_ = false;
bool initial_keys_dropped_ = false;
- bool one_rtt_keys_available_ = false;
- bool handshake_confirmed_ = false;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters>
crypto_negotiated_params_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker_test.cc b/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker_test.cc
index 132e6365786..2488426167f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_client_handshaker_test.cc
@@ -6,6 +6,7 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
@@ -24,7 +25,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_session_cache.h"
#include "net/third_party/quiche/src/quic/tools/fake_proof_verifier.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
using testing::_;
@@ -52,7 +52,7 @@ class TestProofVerifier : public ProofVerifier {
const uint16_t port,
const std::string& server_config,
QuicTransportVersion quic_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -74,15 +74,16 @@ class TestProofVerifier : public ProofVerifier {
const ProofVerifyContext* context,
std::string* error_details,
std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
std::unique_ptr<ProofVerifierCallback> callback) override {
if (!active_) {
- return verifier_->VerifyCertChain(hostname, port, certs, ocsp_response,
- cert_sct, context, error_details,
- details, std::move(callback));
+ return verifier_->VerifyCertChain(
+ hostname, port, certs, ocsp_response, cert_sct, context,
+ error_details, details, out_alert, std::move(callback));
}
pending_ops_.push_back(std::make_unique<VerifyChainPendingOp>(
hostname, port, certs, ocsp_response, cert_sct, context, error_details,
- details, std::move(callback), verifier_.get()));
+ details, out_alert, std::move(callback), verifier_.get()));
return QUIC_PENDING;
}
@@ -123,6 +124,7 @@ class TestProofVerifier : public ProofVerifier {
const ProofVerifyContext* context,
std::string* error_details,
std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
std::unique_ptr<ProofVerifierCallback> callback,
ProofVerifier* delegate)
: hostname_(hostname),
@@ -133,6 +135,7 @@ class TestProofVerifier : public ProofVerifier {
context_(context),
error_details_(error_details),
details_(details),
+ out_alert_(out_alert),
callback_(std::move(callback)),
delegate_(delegate) {}
@@ -143,7 +146,7 @@ class TestProofVerifier : public ProofVerifier {
// synchronously.
QuicAsyncStatus status = delegate_->VerifyCertChain(
hostname_, port_, certs_, ocsp_response_, cert_sct_, context_,
- error_details_, details_,
+ error_details_, details_, out_alert_,
std::make_unique<FailingProofVerifierCallback>());
ASSERT_NE(status, QUIC_PENDING);
callback_->Run(status == QUIC_SUCCESS, *error_details_, details_);
@@ -158,6 +161,7 @@ class TestProofVerifier : public ProofVerifier {
const ProofVerifyContext* context_;
std::string* error_details_;
std::unique_ptr<ProofVerifyDetails>* details_;
+ uint8_t* out_alert_;
std::unique_ptr<ProofVerifierCallback> callback_;
ProofVerifier* delegate_;
};
@@ -233,10 +237,9 @@ class TlsClientHandshakerTest : public QuicTestWithParam<ParsedQuicVersion> {
server_session_.reset(server_session);
std::string alpn = AlpnForVersion(connection_->version());
EXPECT_CALL(*server_session_, SelectAlpn(_))
- .WillRepeatedly(
- [alpn](const std::vector<quiche::QuicheStringPiece>& alpns) {
- return std::find(alpns.cbegin(), alpns.cend(), alpn);
- });
+ .WillRepeatedly([alpn](const std::vector<absl::string_view>& alpns) {
+ return std::find(alpns.cbegin(), alpns.cend(), alpn);
+ });
}
MockQuicConnectionHelper server_helper_;
@@ -286,8 +289,8 @@ TEST_P(TlsClientHandshakerTest, ConnectionClosedOnTlsError) {
0, 0, 0, // uint24 length
};
stream()->crypto_message_parser()->ProcessInput(
- quiche::QuicheStringPiece(bogus_handshake_message,
- QUICHE_ARRAYSIZE(bogus_handshake_message)),
+ absl::string_view(bogus_handshake_message,
+ ABSL_ARRAYSIZE(bogus_handshake_message)),
ENCRYPTION_INITIAL);
EXPECT_FALSE(stream()->one_rtt_keys_available());
@@ -556,10 +559,9 @@ TEST_P(TlsClientHandshakerTest, ServerRequiresCustomALPN) {
InitializeFakeServer();
const std::string kTestAlpn = "An ALPN That Client Did Not Offer";
EXPECT_CALL(*server_session_, SelectAlpn(_))
- .WillOnce(
- [kTestAlpn](const std::vector<quiche::QuicheStringPiece>& alpns) {
- return std::find(alpns.cbegin(), alpns.cend(), kTestAlpn);
- });
+ .WillOnce([kTestAlpn](const std::vector<absl::string_view>& alpns) {
+ return std::find(alpns.cbegin(), alpns.cend(), kTestAlpn);
+ });
EXPECT_CALL(*server_connection_,
CloseConnection(QUIC_HANDSHAKE_FAILED,
"TLS handshake failure (ENCRYPTION_INITIAL) 120: "
@@ -634,7 +636,7 @@ TEST_P(TlsClientHandshakerTest, BadTransportParams) {
CreateConnection();
stream()->CryptoConnect();
- auto* id_manager = QuicSessionPeer::v99_streamid_manager(session_.get());
+ auto* id_manager = QuicSessionPeer::ietf_streamid_manager(session_.get());
EXPECT_EQ(kDefaultMaxStreamsPerConnection,
id_manager->max_outgoing_bidirectional_streams());
QuicConfig config;
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.cc b/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.cc
index 04fab15201a..bfe35455f2e 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.cc
@@ -4,23 +4,55 @@
#include "net/third_party/quiche/src/quic/core/tls_handshaker.h"
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/crypto.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
#include "net/third_party/quiche/src/quic/core/tls_client_handshaker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
+TlsHandshaker::ProofVerifierCallbackImpl::ProofVerifierCallbackImpl(
+ TlsHandshaker* parent)
+ : parent_(parent) {}
+
+TlsHandshaker::ProofVerifierCallbackImpl::~ProofVerifierCallbackImpl() {}
+
+void TlsHandshaker::ProofVerifierCallbackImpl::Run(
+ bool ok,
+ const std::string& /*error_details*/,
+ std::unique_ptr<ProofVerifyDetails>* details) {
+ if (parent_ == nullptr) {
+ return;
+ }
+
+ parent_->verify_details_ = std::move(*details);
+ parent_->verify_result_ = ok ? ssl_verify_ok : ssl_verify_invalid;
+ parent_->set_expected_ssl_error(SSL_ERROR_WANT_READ);
+ parent_->proof_verify_callback_ = nullptr;
+ if (parent_->verify_details_) {
+ parent_->OnProofVerifyDetailsAvailable(*parent_->verify_details_);
+ }
+ parent_->AdvanceHandshake();
+}
+
+void TlsHandshaker::ProofVerifierCallbackImpl::Cancel() {
+ parent_ = nullptr;
+}
+
TlsHandshaker::TlsHandshaker(QuicCryptoStream* stream, QuicSession* session)
: stream_(stream), handshaker_delegate_(session) {}
-TlsHandshaker::~TlsHandshaker() {}
+TlsHandshaker::~TlsHandshaker() {
+ if (proof_verify_callback_) {
+ proof_verify_callback_->Cancel();
+ }
+}
-bool TlsHandshaker::ProcessInput(quiche::QuicheStringPiece input,
+bool TlsHandshaker::ProcessInput(absl::string_view input,
EncryptionLevel level) {
if (parser_error_ != QUIC_NO_ERROR) {
return false;
@@ -52,6 +84,50 @@ bool TlsHandshaker::ProcessInput(quiche::QuicheStringPiece input,
return true;
}
+void TlsHandshaker::AdvanceHandshake() {
+ if (is_connection_closed_) {
+ return;
+ }
+ if (GetHandshakeState() >= HANDSHAKE_COMPLETE) {
+ ProcessPostHandshakeMessage();
+ return;
+ }
+
+ QUIC_VLOG(1) << "TlsHandshaker: continuing handshake";
+ int rv = SSL_do_handshake(ssl());
+ if (rv == 1) {
+ FinishHandshake();
+ return;
+ }
+ int ssl_error = SSL_get_error(ssl(), rv);
+ if (ssl_error == expected_ssl_error_) {
+ return;
+ }
+ if (ShouldCloseConnectionOnUnexpectedError(ssl_error) &&
+ !is_connection_closed_) {
+ QUIC_VLOG(1) << "SSL_do_handshake failed; SSL_get_error returns "
+ << ssl_error;
+ ERR_print_errors_fp(stderr);
+ CloseConnection(QUIC_HANDSHAKE_FAILED, "TLS handshake failed");
+ }
+}
+
+void TlsHandshaker::CloseConnection(QuicErrorCode error,
+ const std::string& reason_phrase) {
+ DCHECK(!reason_phrase.empty());
+ stream()->OnUnrecoverableError(error, reason_phrase);
+ is_connection_closed_ = true;
+}
+
+void TlsHandshaker::OnConnectionClosed(QuicErrorCode /*error*/,
+ ConnectionCloseSource /*source*/) {
+ is_connection_closed_ = true;
+}
+
+bool TlsHandshaker::ShouldCloseConnectionOnUnexpectedError(int /*ssl_error*/) {
+ return true;
+}
+
size_t TlsHandshaker::BufferSizeLimitForLevel(EncryptionLevel level) const {
return SSL_quic_max_handshake_flight_len(
ssl(), TlsConnection::BoringEncryptionLevel(level));
@@ -65,12 +141,73 @@ const EVP_MD* TlsHandshaker::Prf(const SSL_CIPHER* cipher) {
return EVP_get_digestbynid(SSL_CIPHER_get_prf_nid(cipher));
}
+enum ssl_verify_result_t TlsHandshaker::VerifyCert(uint8_t* out_alert) {
+ if (verify_result_ != ssl_verify_retry ||
+ expected_ssl_error() == SSL_ERROR_WANT_CERTIFICATE_VERIFY) {
+ enum ssl_verify_result_t result = verify_result_;
+ verify_result_ = ssl_verify_retry;
+ *out_alert = cert_verify_tls_alert_;
+ return result;
+ }
+ const STACK_OF(CRYPTO_BUFFER)* cert_chain = SSL_get0_peer_certificates(ssl());
+ if (cert_chain == nullptr) {
+ *out_alert = SSL_AD_INTERNAL_ERROR;
+ return ssl_verify_invalid;
+ }
+ // TODO(nharper): Pass the CRYPTO_BUFFERs into the QUIC stack to avoid copies.
+ std::vector<std::string> certs;
+ for (CRYPTO_BUFFER* cert : cert_chain) {
+ certs.push_back(
+ std::string(reinterpret_cast<const char*>(CRYPTO_BUFFER_data(cert)),
+ CRYPTO_BUFFER_len(cert)));
+ }
+
+ ProofVerifierCallbackImpl* proof_verify_callback =
+ new ProofVerifierCallbackImpl(this);
+
+ cert_verify_tls_alert_ = *out_alert;
+ QuicAsyncStatus verify_result = VerifyCertChain(
+ certs, &cert_verify_error_details_, &verify_details_,
+ &cert_verify_tls_alert_,
+ std::unique_ptr<ProofVerifierCallback>(proof_verify_callback));
+ switch (verify_result) {
+ case QUIC_SUCCESS:
+ if (verify_details_) {
+ OnProofVerifyDetailsAvailable(*verify_details_);
+ }
+ return ssl_verify_ok;
+ case QUIC_PENDING:
+ proof_verify_callback_ = proof_verify_callback;
+ set_expected_ssl_error(SSL_ERROR_WANT_CERTIFICATE_VERIFY);
+ return ssl_verify_retry;
+ case QUIC_FAILURE:
+ default:
+ *out_alert = cert_verify_tls_alert_;
+ QUIC_LOG(INFO) << "Cert chain verification failed: "
+ << cert_verify_error_details_;
+ return ssl_verify_invalid;
+ }
+}
+
void TlsHandshaker::SetWriteSecret(EncryptionLevel level,
const SSL_CIPHER* cipher,
const std::vector<uint8_t>& write_secret) {
+ QUIC_DVLOG(1) << "SetWriteSecret level=" << level;
std::unique_ptr<QuicEncrypter> encrypter =
QuicEncrypter::CreateFromCipherSuite(SSL_CIPHER_get_id(cipher));
- CryptoUtils::SetKeyAndIV(Prf(cipher), write_secret, encrypter.get());
+ const EVP_MD* prf = Prf(cipher);
+ CryptoUtils::SetKeyAndIV(prf, write_secret, encrypter.get());
+ std::vector<uint8_t> header_protection_key =
+ CryptoUtils::GenerateHeaderProtectionKey(prf, write_secret,
+ encrypter->GetKeySize());
+ encrypter->SetHeaderProtectionKey(
+ absl::string_view(reinterpret_cast<char*>(header_protection_key.data()),
+ header_protection_key.size()));
+ if (level == ENCRYPTION_FORWARD_SECURE) {
+ DCHECK(latest_write_secret_.empty());
+ latest_write_secret_ = write_secret;
+ one_rtt_write_header_protection_key_ = header_protection_key;
+ }
handshaker_delegate_->OnNewEncryptionKeyAvailable(level,
std::move(encrypter));
}
@@ -78,17 +215,75 @@ void TlsHandshaker::SetWriteSecret(EncryptionLevel level,
bool TlsHandshaker::SetReadSecret(EncryptionLevel level,
const SSL_CIPHER* cipher,
const std::vector<uint8_t>& read_secret) {
+ QUIC_DVLOG(1) << "SetReadSecret level=" << level;
std::unique_ptr<QuicDecrypter> decrypter =
QuicDecrypter::CreateFromCipherSuite(SSL_CIPHER_get_id(cipher));
- CryptoUtils::SetKeyAndIV(Prf(cipher), read_secret, decrypter.get());
+ const EVP_MD* prf = Prf(cipher);
+ CryptoUtils::SetKeyAndIV(prf, read_secret, decrypter.get());
+ std::vector<uint8_t> header_protection_key =
+ CryptoUtils::GenerateHeaderProtectionKey(prf, read_secret,
+ decrypter->GetKeySize());
+ decrypter->SetHeaderProtectionKey(
+ absl::string_view(reinterpret_cast<char*>(header_protection_key.data()),
+ header_protection_key.size()));
+ if (level == ENCRYPTION_FORWARD_SECURE) {
+ DCHECK(latest_read_secret_.empty());
+ latest_read_secret_ = read_secret;
+ one_rtt_read_header_protection_key_ = header_protection_key;
+ }
return handshaker_delegate_->OnNewDecryptionKeyAvailable(
level, std::move(decrypter),
/*set_alternative_decrypter=*/false,
/*latch_once_used=*/false);
}
+std::unique_ptr<QuicDecrypter>
+TlsHandshaker::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ if (latest_read_secret_.empty() || latest_write_secret_.empty() ||
+ one_rtt_read_header_protection_key_.empty() ||
+ one_rtt_write_header_protection_key_.empty()) {
+ std::string error_details = "1-RTT secret(s) not set yet.";
+ QUIC_BUG << error_details;
+ CloseConnection(QUIC_INTERNAL_ERROR, error_details);
+ return nullptr;
+ }
+ const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl());
+ const EVP_MD* prf = Prf(cipher);
+ latest_read_secret_ =
+ CryptoUtils::GenerateNextKeyPhaseSecret(prf, latest_read_secret_);
+ latest_write_secret_ =
+ CryptoUtils::GenerateNextKeyPhaseSecret(prf, latest_write_secret_);
+
+ std::unique_ptr<QuicDecrypter> decrypter =
+ QuicDecrypter::CreateFromCipherSuite(SSL_CIPHER_get_id(cipher));
+ CryptoUtils::SetKeyAndIV(prf, latest_read_secret_, decrypter.get());
+ decrypter->SetHeaderProtectionKey(absl::string_view(
+ reinterpret_cast<char*>(one_rtt_read_header_protection_key_.data()),
+ one_rtt_read_header_protection_key_.size()));
+
+ return decrypter;
+}
+
+std::unique_ptr<QuicEncrypter> TlsHandshaker::CreateCurrentOneRttEncrypter() {
+ if (latest_write_secret_.empty() ||
+ one_rtt_write_header_protection_key_.empty()) {
+ std::string error_details = "1-RTT write secret not set yet.";
+ QUIC_BUG << error_details;
+ CloseConnection(QUIC_INTERNAL_ERROR, error_details);
+ return nullptr;
+ }
+ const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl());
+ std::unique_ptr<QuicEncrypter> encrypter =
+ QuicEncrypter::CreateFromCipherSuite(SSL_CIPHER_get_id(cipher));
+ CryptoUtils::SetKeyAndIV(Prf(cipher), latest_write_secret_, encrypter.get());
+ encrypter->SetHeaderProtectionKey(absl::string_view(
+ reinterpret_cast<char*>(one_rtt_write_header_protection_key_.data()),
+ one_rtt_write_header_protection_key_.size()));
+ return encrypter;
+}
+
void TlsHandshaker::WriteMessage(EncryptionLevel level,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
stream_->WriteCryptoData(level, data);
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.h b/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.h
index 2b3c9fc20a1..12b27f1b00f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.h
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_handshaker.h
@@ -5,16 +5,17 @@
#ifndef QUICHE_QUIC_CORE_TLS_HANDSHAKER_H_
#define QUICHE_QUIC_CORE_TLS_HANDSHAKER_H_
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/base.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_message_parser.h"
+#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/tls_connection.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,8 +37,7 @@ class QUIC_EXPORT_PRIVATE TlsHandshaker : public TlsConnection::Delegate,
~TlsHandshaker() override;
// From CryptoMessageParser
- bool ProcessInput(quiche::QuicheStringPiece input,
- EncryptionLevel level) override;
+ bool ProcessInput(absl::string_view input, EncryptionLevel level) override;
size_t InputBytesRemaining() const override { return 0; }
QuicErrorCode error() const override { return parser_error_; }
const std::string& error_detail() const override {
@@ -49,12 +49,61 @@ class QUIC_EXPORT_PRIVATE TlsHandshaker : public TlsConnection::Delegate,
CryptoMessageParser* crypto_message_parser() { return this; }
size_t BufferSizeLimitForLevel(EncryptionLevel level) const;
ssl_early_data_reason_t EarlyDataReason() const;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter();
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter();
+ virtual HandshakeState GetHandshakeState() const = 0;
protected:
- virtual void AdvanceHandshake() = 0;
+ // Called when a new message is received on the crypto stream and is available
+ // for the TLS stack to read.
+ void AdvanceHandshake();
- virtual void CloseConnection(QuicErrorCode error,
- const std::string& reason_phrase) = 0;
+ void CloseConnection(QuicErrorCode error, const std::string& reason_phrase);
+
+ void OnConnectionClosed(QuicErrorCode error, ConnectionCloseSource source);
+
+ bool is_connection_closed() const { return is_connection_closed_; }
+
+ // Called when |SSL_do_handshake| returns 1, indicating that the handshake has
+ // finished. Note that due to 0-RTT, the handshake may "finish" twice;
+ // |SSL_in_early_data| can be used to determine whether the handshake is truly
+ // done.
+ virtual void FinishHandshake() = 0;
+
+ // Called when a handshake message is received after the handshake is
+ // complete.
+ virtual void ProcessPostHandshakeMessage() = 0;
+
+ // Called when an unexpected error code is received from |SSL_get_error|. If a
+ // subclass can expect more than just a single error (as provided by
+ // |set_expected_ssl_error|), it can override this method to handle that case.
+ virtual bool ShouldCloseConnectionOnUnexpectedError(int ssl_error);
+
+ void set_expected_ssl_error(int ssl_error) {
+ expected_ssl_error_ = ssl_error;
+ }
+ int expected_ssl_error() const { return expected_ssl_error_; }
+
+ // Called to verify a cert chain. This is a simple wrapper around
+ // ProofVerifier or ServerProofVerifier, which optionally gathers additional
+ // arguments to pass into their VerifyCertChain method. This class retains a
+ // non-owning pointer to |callback|; the callback must live until this
+ // function returns QUIC_SUCCESS or QUIC_FAILURE, or until the callback is
+ // run.
+ //
+ // If certificate verification fails, |*out_alert| may be set to a TLS alert
+ // that will be sent when closing the connection; it defaults to
+ // certificate_unknown. Implementations of VerifyCertChain may retain the
+ // |out_alert| pointer while performing an async operation.
+ virtual QuicAsyncStatus VerifyCertChain(
+ const std::vector<std::string>& certs,
+ std::string* error_details,
+ std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
+ std::unique_ptr<ProofVerifierCallback> callback) = 0;
+ // Called when certificate verification is completed.
+ virtual void OnProofVerifyDetailsAvailable(
+ const ProofVerifyDetails& verify_details) = 0;
// Returns the PRF used by the cipher suite negotiated in the TLS handshake.
const EVP_MD* Prf(const SSL_CIPHER* cipher);
@@ -68,6 +117,8 @@ class QUIC_EXPORT_PRIVATE TlsHandshaker : public TlsConnection::Delegate,
return handshaker_delegate_;
}
+ enum ssl_verify_result_t VerifyCert(uint8_t* out_alert) override;
+
// SetWriteSecret provides the encryption secret used to encrypt messages at
// encryption level |level|. The secret provided here is the one from the TLS
// 1.3 key schedule (RFC 8446 section 7.1), in particular the handshake
@@ -88,8 +139,7 @@ class QUIC_EXPORT_PRIVATE TlsHandshaker : public TlsConnection::Delegate,
// WriteMessage is called when there is |data| from the TLS stack ready for
// the QUIC stack to write in a crypto frame. The data must be transmitted at
// encryption level |level|.
- void WriteMessage(EncryptionLevel level,
- quiche::QuicheStringPiece data) override;
+ void WriteMessage(EncryptionLevel level, absl::string_view data) override;
// FlushFlight is called to signal that the current flight of
// messages have all been written (via calls to WriteMessage) and can be
@@ -101,11 +151,53 @@ class QUIC_EXPORT_PRIVATE TlsHandshaker : public TlsConnection::Delegate,
void SendAlert(EncryptionLevel level, uint8_t desc) override;
private:
+ // ProofVerifierCallbackImpl handles the result of an asynchronous certificate
+ // verification operation.
+ class QUIC_EXPORT_PRIVATE ProofVerifierCallbackImpl
+ : public ProofVerifierCallback {
+ public:
+ explicit ProofVerifierCallbackImpl(TlsHandshaker* parent);
+ ~ProofVerifierCallbackImpl() override;
+
+ // ProofVerifierCallback interface.
+ void Run(bool ok,
+ const std::string& error_details,
+ std::unique_ptr<ProofVerifyDetails>* details) override;
+
+ // If called, Cancel causes the pending callback to be a no-op.
+ void Cancel();
+
+ private:
+ // Non-owning pointer to the TlsHandshaker responsible for this callback.
+ // |parent_| must be valid for the life of this callback or until |Cancel|
+ // is called.
+ TlsHandshaker* parent_;
+ };
+
+ // ProofVerifierCallback used for async certificate verification. Ownership of
+ // this object is transferred to |VerifyCertChain|;
+ ProofVerifierCallbackImpl* proof_verify_callback_ = nullptr;
+ std::unique_ptr<ProofVerifyDetails> verify_details_;
+ enum ssl_verify_result_t verify_result_ = ssl_verify_retry;
+ uint8_t cert_verify_tls_alert_ = SSL_AD_CERTIFICATE_UNKNOWN;
+ std::string cert_verify_error_details_;
+
+ int expected_ssl_error_ = SSL_ERROR_WANT_READ;
+ bool is_connection_closed_ = false;
+
QuicCryptoStream* stream_;
HandshakerDelegateInterface* handshaker_delegate_;
QuicErrorCode parser_error_ = QUIC_NO_ERROR;
std::string parser_error_detail_;
+
+ // The most recently derived 1-RTT read and write secrets, which are updated
+ // on each key update.
+ std::vector<uint8_t> latest_read_secret_;
+ std::vector<uint8_t> latest_write_secret_;
+ // 1-RTT header protection keys, which are not changed during key update.
+ std::vector<uint8_t> one_rtt_read_header_protection_key_;
+ std::vector<uint8_t> one_rtt_write_header_protection_key_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.cc b/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.cc
index a8f926ea457..e0fe84d9c52 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.cc
@@ -7,14 +7,16 @@
#include <memory>
#include <string>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/pool.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
#include "net/third_party/quiche/src/quic/core/crypto/transport_parameters.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h"
+#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -34,11 +36,11 @@ void TlsServerHandshaker::SignatureCallback::Run(
handshaker_->cert_verify_sig_ = std::move(signature);
handshaker_->proof_source_details_ = std::move(details);
}
- State last_state = handshaker_->state_;
- handshaker_->state_ = STATE_SIGNATURE_COMPLETE;
+ int last_expected_ssl_error = handshaker_->expected_ssl_error();
+ handshaker_->set_expected_ssl_error(SSL_ERROR_WANT_READ);
handshaker_->signature_callback_ = nullptr;
- if (last_state == STATE_SIGNATURE_PENDING) {
- handshaker_->AdvanceHandshake();
+ if (last_expected_ssl_error == SSL_ERROR_WANT_PRIVATE_KEY_OPERATION) {
+ handshaker_->AdvanceHandshakeFromCallback();
}
}
@@ -67,8 +69,8 @@ void TlsServerHandshaker::DecryptCallback::Run(std::vector<uint8_t> plaintext) {
// pending), TlsServerHandshaker is not actively processing handshake
// messages. We need to have it resume processing handshake messages by
// calling AdvanceHandshake.
- if (handshaker_->state_ == STATE_TICKET_DECRYPTION_PENDING) {
- handshaker_->AdvanceHandshake();
+ if (handshaker_->expected_ssl_error() == SSL_ERROR_PENDING_TICKET) {
+ handshaker_->AdvanceHandshakeFromCallback();
}
// The TicketDecrypter took ownership of this callback when Decrypt was
// called. Once the callback returns, it will be deleted. Remove the
@@ -96,6 +98,10 @@ TlsServerHandshaker::TlsServerHandshaker(
// Configure the SSL to be a server.
SSL_set_accept_state(ssl());
+
+ if (GetQuicFlag(FLAGS_quic_disable_server_tls_resumption)) {
+ SSL_set_options(ssl(), SSL_OP_NO_TICKET);
+ }
}
TlsServerHandshaker::~TlsServerHandshaker() {
@@ -150,9 +156,8 @@ void TlsServerHandshaker::SetPreviousCachedNetworkParams(
CachedNetworkParameters /*cached_network_params*/) {}
void TlsServerHandshaker::OnPacketDecrypted(EncryptionLevel level) {
- if (level == ENCRYPTION_HANDSHAKE &&
- state_ < STATE_ENCRYPTION_HANDSHAKE_DATA_PROCESSED) {
- state_ = STATE_ENCRYPTION_HANDSHAKE_DATA_PROCESSED;
+ if (level == ENCRYPTION_HANDSHAKE && state_ < HANDSHAKE_PROCESSED) {
+ state_ = HANDSHAKE_PROCESSED;
handshaker_delegate()->DiscardOldEncryptionKey(ENCRYPTION_INITIAL);
handshaker_delegate()->DiscardOldDecryptionKey(ENCRYPTION_INITIAL);
}
@@ -170,9 +175,9 @@ const ProofSource::Details* TlsServerHandshaker::ProofSourceDetails() const {
return proof_source_details_.get();
}
-void TlsServerHandshaker::OnConnectionClosed(QuicErrorCode /*error*/,
- ConnectionCloseSource /*source*/) {
- state_ = STATE_CONNECTION_CLOSED;
+void TlsServerHandshaker::OnConnectionClosed(QuicErrorCode error,
+ ConnectionCloseSource source) {
+ TlsHandshaker::OnConnectionClosed(error, source);
}
ssl_early_data_reason_t TlsServerHandshaker::EarlyDataReason() const {
@@ -184,7 +189,7 @@ bool TlsServerHandshaker::encryption_established() const {
}
bool TlsServerHandshaker::one_rtt_keys_available() const {
- return one_rtt_keys_available_;
+ return state_ == HANDSHAKE_CONFIRMED;
}
const QuicCryptoNegotiatedParameters&
@@ -197,13 +202,7 @@ CryptoMessageParser* TlsServerHandshaker::crypto_message_parser() {
}
HandshakeState TlsServerHandshaker::GetHandshakeState() const {
- if (one_rtt_keys_available_) {
- return HANDSHAKE_CONFIRMED;
- }
- if (state_ >= STATE_ENCRYPTION_HANDSHAKE_DATA_PROCESSED) {
- return HANDSHAKE_PROCESSED;
- }
- return HANDSHAKE_START;
+ return state_;
}
void TlsServerHandshaker::SetServerApplicationStateForResumption(
@@ -216,54 +215,31 @@ size_t TlsServerHandshaker::BufferSizeLimitForLevel(
return TlsHandshaker::BufferSizeLimitForLevel(level);
}
-void TlsServerHandshaker::OverrideQuicConfigDefaults(QuicConfig* /*config*/) {}
-
-void TlsServerHandshaker::AdvanceHandshake() {
- if (state_ == STATE_CONNECTION_CLOSED) {
- QUIC_LOG(INFO) << "TlsServerHandshaker received handshake message after "
- "connection was closed";
- return;
- }
- if (state_ == STATE_HANDSHAKE_COMPLETE) {
- // TODO(nharper): Handle post-handshake messages.
- return;
- }
+bool TlsServerHandshaker::KeyUpdateSupportedLocally() const {
+ return true;
+}
- int rv = SSL_do_handshake(ssl());
- if (rv == 1) {
- FinishHandshake();
- return;
- }
+std::unique_ptr<QuicDecrypter>
+TlsServerHandshaker::AdvanceKeysAndCreateCurrentOneRttDecrypter() {
+ return TlsHandshaker::AdvanceKeysAndCreateCurrentOneRttDecrypter();
+}
- int ssl_error = SSL_get_error(ssl(), rv);
- bool should_close = true;
- switch (state_) {
- case STATE_LISTENING:
- case STATE_SIGNATURE_COMPLETE:
- should_close = ssl_error != SSL_ERROR_WANT_READ;
- break;
- case STATE_SIGNATURE_PENDING:
- should_close = ssl_error != SSL_ERROR_WANT_PRIVATE_KEY_OPERATION;
- break;
- case STATE_TICKET_DECRYPTION_PENDING:
- should_close = ssl_error != SSL_ERROR_PENDING_TICKET;
- break;
- default:
- should_close = true;
- }
- if (should_close && state_ != STATE_CONNECTION_CLOSED) {
- QUIC_VLOG(1) << "SSL_do_handshake failed; SSL_get_error returns "
- << ssl_error << ", state_ = " << state_;
- ERR_print_errors_fp(stderr);
- CloseConnection(QUIC_HANDSHAKE_FAILED,
- "Server observed TLS handshake failure");
- }
+std::unique_ptr<QuicEncrypter>
+TlsServerHandshaker::CreateCurrentOneRttEncrypter() {
+ return TlsHandshaker::CreateCurrentOneRttEncrypter();
}
-void TlsServerHandshaker::CloseConnection(QuicErrorCode error,
- const std::string& reason_phrase) {
- state_ = STATE_CONNECTION_CLOSED;
- stream()->OnUnrecoverableError(error, reason_phrase);
+void TlsServerHandshaker::OverrideQuicConfigDefaults(QuicConfig* /*config*/) {}
+
+void TlsServerHandshaker::AdvanceHandshakeFromCallback() {
+ AdvanceHandshake();
+ if (GetQuicReloadableFlag(
+ quic_process_undecryptable_packets_after_async_decrypt_callback) &&
+ !is_connection_closed()) {
+ QUIC_RELOADABLE_FLAG_COUNT(
+ quic_process_undecryptable_packets_after_async_decrypt_callback);
+ handshaker_delegate()->OnHandshakeCallbackDone();
+ }
}
bool TlsServerHandshaker::ProcessTransportParameters(
@@ -368,7 +344,7 @@ void TlsServerHandshaker::SetWriteSecret(
EncryptionLevel level,
const SSL_CIPHER* cipher,
const std::vector<uint8_t>& write_secret) {
- if (state_ == STATE_CONNECTION_CLOSED) {
+ if (is_connection_closed()) {
return;
}
if (level == ENCRYPTION_FORWARD_SECURE) {
@@ -409,8 +385,7 @@ void TlsServerHandshaker::FinishHandshake() {
QUIC_DLOG(INFO) << "Server: handshake finished. Early data reason "
<< reason_code << " ("
<< CryptoUtils::EarlyDataReasonToString(reason_code) << ")";
- state_ = STATE_HANDSHAKE_COMPLETE;
- one_rtt_keys_available_ = true;
+ state_ = HANDSHAKE_CONFIRMED;
handshaker_delegate()->OnTlsHandshakeComplete();
handshaker_delegate()->DiscardOldEncryptionKey(ENCRYPTION_HANDSHAKE);
@@ -418,29 +393,42 @@ void TlsServerHandshaker::FinishHandshake() {
handshaker_delegate()->DiscardOldDecryptionKey(ENCRYPTION_ZERO_RTT);
}
+QuicAsyncStatus TlsServerHandshaker::VerifyCertChain(
+ const std::vector<std::string>& /*certs*/,
+ std::string* /*error_details*/,
+ std::unique_ptr<ProofVerifyDetails>* /*details*/,
+ uint8_t* /*out_alert*/,
+ std::unique_ptr<ProofVerifierCallback> /*callback*/) {
+ QUIC_BUG << "Client certificates are not yet supported on the server";
+ return QUIC_FAILURE;
+}
+
+void TlsServerHandshaker::OnProofVerifyDetailsAvailable(
+ const ProofVerifyDetails& /*verify_details*/) {}
+
ssl_private_key_result_t TlsServerHandshaker::PrivateKeySign(
uint8_t* out,
size_t* out_len,
size_t max_out,
uint16_t sig_alg,
- quiche::QuicheStringPiece in) {
+ absl::string_view in) {
signature_callback_ = new SignatureCallback(this);
proof_source_->ComputeTlsSignature(
session()->connection()->self_address(),
session()->connection()->peer_address(), hostname_, sig_alg, in,
std::unique_ptr<SignatureCallback>(signature_callback_));
- if (state_ == STATE_SIGNATURE_COMPLETE) {
- return PrivateKeyComplete(out, out_len, max_out);
+ if (signature_callback_) {
+ set_expected_ssl_error(SSL_ERROR_WANT_PRIVATE_KEY_OPERATION);
+ return ssl_private_key_retry;
}
- state_ = STATE_SIGNATURE_PENDING;
- return ssl_private_key_retry;
+ return PrivateKeyComplete(out, out_len, max_out);
}
ssl_private_key_result_t TlsServerHandshaker::PrivateKeyComplete(
uint8_t* out,
size_t* out_len,
size_t max_out) {
- if (state_ == STATE_SIGNATURE_PENDING) {
+ if (expected_ssl_error() == SSL_ERROR_WANT_PRIVATE_KEY_OPERATION) {
return ssl_private_key_retry;
}
if (cert_verify_sig_.size() > max_out || cert_verify_sig_.empty()) {
@@ -461,7 +449,7 @@ size_t TlsServerHandshaker::SessionTicketMaxOverhead() {
int TlsServerHandshaker::SessionTicketSeal(uint8_t* out,
size_t* out_len,
size_t max_out_len,
- quiche::QuicheStringPiece in) {
+ absl::string_view in) {
DCHECK(proof_source_->GetTicketCrypter());
std::vector<uint8_t> ticket = proof_source_->GetTicketCrypter()->Encrypt(in);
if (max_out_len < ticket.size()) {
@@ -480,7 +468,7 @@ ssl_ticket_aead_result_t TlsServerHandshaker::SessionTicketOpen(
uint8_t* out,
size_t* out_len,
size_t max_out_len,
- quiche::QuicheStringPiece in) {
+ absl::string_view in) {
DCHECK(proof_source_->GetTicketCrypter());
if (!ticket_decryption_callback_) {
@@ -497,12 +485,12 @@ ssl_ticket_aead_result_t TlsServerHandshaker::SessionTicketOpen(
// and when the callback is complete this function will be run again to
// return the result.
if (ticket_decryption_callback_) {
- state_ = STATE_TICKET_DECRYPTION_PENDING;
+ set_expected_ssl_error(SSL_ERROR_PENDING_TICKET);
return ssl_ticket_aead_retry;
}
}
ticket_decryption_callback_ = nullptr;
- state_ = STATE_LISTENING;
+ set_expected_ssl_error(SSL_ERROR_WANT_READ);
if (decrypted_session_ticket_.empty()) {
QUIC_DLOG(ERROR) << "Session ticket decryption failed; ignoring ticket";
// Ticket decryption failed. Ignore the ticket.
@@ -586,7 +574,7 @@ int TlsServerHandshaker::SelectAlpn(const uint8_t** out,
CBS all_alpns;
CBS_init(&all_alpns, in, in_len);
- std::vector<quiche::QuicheStringPiece> alpns;
+ std::vector<absl::string_view> alpns;
while (CBS_len(&all_alpns) > 0) {
CBS alpn;
if (!CBS_get_u8_length_prefixed(&all_alpns, &alpn)) {
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.h b/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.h
index 063e5ca827b..4d12bf3ce27 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.h
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker.h
@@ -7,6 +7,7 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/pool.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
@@ -16,7 +17,6 @@
#include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
#include "net/third_party/quiche/src/quic/core/tls_handshaker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -66,6 +66,10 @@ class QUIC_EXPORT_PRIVATE TlsServerHandshaker
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> state) override;
size_t BufferSizeLimitForLevel(EncryptionLevel level) const override;
+ bool KeyUpdateSupportedLocally() const override;
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override;
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override;
void SetWriteSecret(EncryptionLevel level,
const SSL_CIPHER* cipher,
const std::vector<uint8_t>& write_secret) override;
@@ -82,11 +86,21 @@ class QUIC_EXPORT_PRIVATE TlsServerHandshaker
virtual void ProcessAdditionalTransportParameters(
const TransportParameters& /*params*/) {}
- // Called when a new message is received on the crypto stream and is available
- // for the TLS stack to read.
- void AdvanceHandshake() override;
- void CloseConnection(QuicErrorCode error,
- const std::string& reason_phrase) override;
+ // Called when a potentially async operation is done and the done callback
+ // needs to advance the handshake.
+ void AdvanceHandshakeFromCallback();
+
+ // TlsHandshaker implementation:
+ void FinishHandshake() override;
+ void ProcessPostHandshakeMessage() override {}
+ QuicAsyncStatus VerifyCertChain(
+ const std::vector<std::string>& certs,
+ std::string* error_details,
+ std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
+ std::unique_ptr<ProofVerifierCallback> callback) override;
+ void OnProofVerifyDetailsAvailable(
+ const ProofVerifyDetails& verify_details) override;
// TlsServerConnection::Delegate implementation:
int SelectCertificate(int* out_alert) override;
@@ -94,12 +108,11 @@ class QUIC_EXPORT_PRIVATE TlsServerHandshaker
uint8_t* out_len,
const uint8_t* in,
unsigned in_len) override;
- ssl_private_key_result_t PrivateKeySign(
- uint8_t* out,
- size_t* out_len,
- size_t max_out,
- uint16_t sig_alg,
- quiche::QuicheStringPiece in) override;
+ ssl_private_key_result_t PrivateKeySign(uint8_t* out,
+ size_t* out_len,
+ size_t max_out,
+ uint16_t sig_alg,
+ absl::string_view in) override;
ssl_private_key_result_t PrivateKeyComplete(uint8_t* out,
size_t* out_len,
size_t max_out) override;
@@ -107,12 +120,11 @@ class QUIC_EXPORT_PRIVATE TlsServerHandshaker
int SessionTicketSeal(uint8_t* out,
size_t* out_len,
size_t max_out_len,
- quiche::QuicheStringPiece in) override;
- ssl_ticket_aead_result_t SessionTicketOpen(
- uint8_t* out,
- size_t* out_len,
- size_t max_out_len,
- quiche::QuicheStringPiece in) override;
+ absl::string_view in) override;
+ ssl_ticket_aead_result_t SessionTicketOpen(uint8_t* out,
+ size_t* out_len,
+ size_t max_out_len,
+ absl::string_view in) override;
TlsConnection::Delegate* ConnectionDelegate() override { return this; }
private:
@@ -144,26 +156,9 @@ class QUIC_EXPORT_PRIVATE TlsServerHandshaker
TlsServerHandshaker* handshaker_;
};
- enum State {
- STATE_LISTENING,
- STATE_TICKET_DECRYPTION_PENDING,
- STATE_SIGNATURE_PENDING,
- STATE_SIGNATURE_COMPLETE,
- STATE_ENCRYPTION_HANDSHAKE_DATA_PROCESSED,
- STATE_HANDSHAKE_COMPLETE,
- STATE_CONNECTION_CLOSED,
- };
-
- // Called when the TLS handshake is complete.
- void FinishHandshake();
-
- void CloseConnection(const std::string& reason_phrase);
-
bool SetTransportParameters();
bool ProcessTransportParameters(std::string* error_details);
- State state_ = STATE_LISTENING;
-
ProofSource* proof_source_;
SignatureCallback* signature_callback_ = nullptr;
@@ -190,8 +185,8 @@ class QUIC_EXPORT_PRIVATE TlsServerHandshaker
// Pre-shared key used during the handshake.
std::string pre_shared_key_;
+ HandshakeState state_ = HANDSHAKE_START;
bool encryption_established_ = false;
- bool one_rtt_keys_available_ = false;
bool valid_alpn_received_ = false;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters>
crypto_negotiated_params_;
diff --git a/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker_test.cc b/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker_test.cc
index 295af9d6ee7..7411ba2027f 100644
--- a/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/tls_server_handshaker_test.cc
@@ -6,6 +6,8 @@
#include <utility>
#include <vector>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h"
@@ -22,8 +24,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_session_cache.h"
#include "net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
class QuicConnection;
@@ -42,14 +42,39 @@ namespace {
const char kServerHostname[] = "test.example.com";
const uint16_t kServerPort = 443;
-class TlsServerHandshakerTest : public QuicTestWithParam<ParsedQuicVersion> {
+struct TestParams {
+ ParsedQuicVersion version;
+ bool disable_resumption;
+};
+
+// Used by ::testing::PrintToStringParamName().
+std::string PrintToString(const TestParams& p) {
+ return quiche::QuicheStrCat(
+ ParsedQuicVersionToString(p.version), "_",
+ (p.disable_resumption ? "ResumptionDisabled" : "ResumptionEnabled"));
+}
+
+// Constructs test permutations.
+std::vector<TestParams> GetTestParams() {
+ std::vector<TestParams> params;
+ for (const auto& version : AllSupportedVersionsWithTls()) {
+ for (bool disable_resumption : {false, true}) {
+ params.push_back(TestParams{version, disable_resumption});
+ }
+ }
+ return params;
+}
+
+class TlsServerHandshakerTest : public QuicTestWithParam<TestParams> {
public:
TlsServerHandshakerTest()
: server_compressed_certs_cache_(
QuicCompressedCertsCache::kQuicCompressedCertsCacheSize),
server_id_(kServerHostname, kServerPort, false),
- supported_versions_({GetParam()}) {
+ supported_versions_({GetParam().version}) {
SetQuicRestartFlag(quic_enable_zero_rtt_for_tls_v2, true);
+ SetQuicFlag(FLAGS_quic_disable_server_tls_resumption,
+ GetParam().disable_resumption);
client_crypto_config_ = std::make_unique<QuicCryptoClientConfig>(
crypto_test_utils::ProofVerifierForTesting(),
std::make_unique<test::SimpleSessionCache>());
@@ -101,7 +126,7 @@ class TlsServerHandshakerTest : public QuicTestWithParam<ParsedQuicVersion> {
.Times(testing::AnyNumber());
EXPECT_CALL(*server_session_, SelectAlpn(_))
.WillRepeatedly(
- [this](const std::vector<quiche::QuicheStringPiece>& alpns) {
+ [this](const std::vector<absl::string_view>& alpns) {
return std::find(
alpns.cbegin(), alpns.cend(),
AlpnForVersion(server_session_->connection()->version()));
@@ -228,7 +253,7 @@ class TlsServerHandshakerTest : public QuicTestWithParam<ParsedQuicVersion> {
INSTANTIATE_TEST_SUITE_P(TlsServerHandshakerTests,
TlsServerHandshakerTest,
- ::testing::ValuesIn(AllSupportedVersionsWithTls()),
+ ::testing::ValuesIn(GetTestParams()),
::testing::PrintToStringParamName());
TEST_P(TlsServerHandshakerTest, NotInitiallyConected) {
@@ -295,8 +320,8 @@ TEST_P(TlsServerHandshakerTest, ConnectionClosedOnTlsError) {
0, 0, 0, // uint24 length
};
server_stream()->crypto_message_parser()->ProcessInput(
- quiche::QuicheStringPiece(bogus_handshake_message,
- QUICHE_ARRAYSIZE(bogus_handshake_message)),
+ absl::string_view(bogus_handshake_message,
+ ABSL_ARRAYSIZE(bogus_handshake_message)),
ENCRYPTION_INITIAL);
EXPECT_FALSE(server_stream()->one_rtt_keys_available());
@@ -330,15 +355,13 @@ TEST_P(TlsServerHandshakerTest, CustomALPNNegotiation) {
EXPECT_CALL(*client_session_, GetAlpnsToOffer())
.WillRepeatedly(Return(kTestAlpns));
EXPECT_CALL(*server_session_, SelectAlpn(_))
- .WillOnce([kTestAlpn, kTestAlpns](
- const std::vector<quiche::QuicheStringPiece>& alpns) {
- EXPECT_THAT(alpns, testing::ElementsAreArray(kTestAlpns));
- return std::find(alpns.cbegin(), alpns.cend(), kTestAlpn);
- });
- EXPECT_CALL(*client_session_,
- OnAlpnSelected(quiche::QuicheStringPiece(kTestAlpn)));
- EXPECT_CALL(*server_session_,
- OnAlpnSelected(quiche::QuicheStringPiece(kTestAlpn)));
+ .WillOnce(
+ [kTestAlpn, kTestAlpns](const std::vector<absl::string_view>& alpns) {
+ EXPECT_THAT(alpns, testing::ElementsAreArray(kTestAlpns));
+ return std::find(alpns.cbegin(), alpns.cend(), kTestAlpn);
+ });
+ EXPECT_CALL(*client_session_, OnAlpnSelected(absl::string_view(kTestAlpn)));
+ EXPECT_CALL(*server_session_, OnAlpnSelected(absl::string_view(kTestAlpn)));
CompleteCryptoHandshake();
ExpectHandshakeSuccessful();
@@ -371,9 +394,10 @@ TEST_P(TlsServerHandshakerTest, Resumption) {
InitializeFakeClient();
CompleteCryptoHandshake();
ExpectHandshakeSuccessful();
- EXPECT_TRUE(client_stream()->IsResumption());
- EXPECT_TRUE(server_stream()->IsResumption());
- EXPECT_TRUE(server_stream()->ResumptionAttempted());
+ EXPECT_NE(client_stream()->IsResumption(), GetParam().disable_resumption);
+ EXPECT_NE(server_stream()->IsResumption(), GetParam().disable_resumption);
+ EXPECT_NE(server_stream()->ResumptionAttempted(),
+ GetParam().disable_resumption);
}
TEST_P(TlsServerHandshakerTest, ResumptionWithAsyncDecryptCallback) {
@@ -388,6 +412,10 @@ TEST_P(TlsServerHandshakerTest, ResumptionWithAsyncDecryptCallback) {
InitializeFakeClient();
AdvanceHandshakeWithFakeClient();
+ if (GetParam().disable_resumption) {
+ ASSERT_EQ(ticket_crypter_->NumPendingCallbacks(), 0u);
+ return;
+ }
// Test that the DecryptCallback will be run asynchronously, and then run it.
ASSERT_EQ(ticket_crypter_->NumPendingCallbacks(), 1u);
ticket_crypter_->RunPendingCallback(0);
@@ -400,6 +428,10 @@ TEST_P(TlsServerHandshakerTest, ResumptionWithAsyncDecryptCallback) {
}
TEST_P(TlsServerHandshakerTest, ResumptionWithFailingDecryptCallback) {
+ if (GetParam().disable_resumption) {
+ return;
+ }
+
// Do the first handshake
InitializeFakeClient();
CompleteCryptoHandshake();
@@ -417,6 +449,10 @@ TEST_P(TlsServerHandshakerTest, ResumptionWithFailingDecryptCallback) {
}
TEST_P(TlsServerHandshakerTest, ResumptionWithFailingAsyncDecryptCallback) {
+ if (GetParam().disable_resumption) {
+ return;
+ }
+
// Do the first handshake
InitializeFakeClient();
CompleteCryptoHandshake();
@@ -471,8 +507,8 @@ TEST_P(TlsServerHandshakerTest, ZeroRttResumption) {
InitializeFakeClient();
CompleteCryptoHandshake();
ExpectHandshakeSuccessful();
- EXPECT_TRUE(client_stream()->IsResumption());
- EXPECT_TRUE(server_stream()->IsZeroRtt());
+ EXPECT_NE(client_stream()->IsResumption(), GetParam().disable_resumption);
+ EXPECT_NE(server_stream()->IsZeroRtt(), GetParam().disable_resumption);
}
TEST_P(TlsServerHandshakerTest, ZeroRttRejectOnApplicationStateChange) {
@@ -495,7 +531,7 @@ TEST_P(TlsServerHandshakerTest, ZeroRttRejectOnApplicationStateChange) {
InitializeFakeClient();
CompleteCryptoHandshake();
ExpectHandshakeSuccessful();
- EXPECT_TRUE(client_stream()->IsResumption());
+ EXPECT_NE(client_stream()->IsResumption(), GetParam().disable_resumption);
EXPECT_FALSE(server_stream()->IsZeroRtt());
}
diff --git a/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.cc b/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.cc
index 7b2b32f894f..025da645341 100644
--- a/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.cc
@@ -98,9 +98,15 @@ void UberReceivedPacketManager::ResetAckStates(
}
received_packet_managers_[QuicUtils::GetPacketNumberSpace(encryption_level)]
.ResetAckStates();
+ if (encryption_level == ENCRYPTION_INITIAL) {
+ // After one Initial ACK is sent, the others should be sent 'immediately'.
+ received_packet_managers_[INITIAL_DATA].set_local_max_ack_delay(
+ kAlarmGranularity);
+ }
}
-void UberReceivedPacketManager::EnableMultiplePacketNumberSpacesSupport() {
+void UberReceivedPacketManager::EnableMultiplePacketNumberSpacesSupport(
+ Perspective perspective) {
if (supports_multiple_packet_number_spaces_) {
QUIC_BUG << "Multiple packet number spaces has already been enabled";
return;
@@ -112,8 +118,15 @@ void UberReceivedPacketManager::EnableMultiplePacketNumberSpacesSupport() {
}
// In IETF QUIC, the peer is expected to acknowledge packets in Initial and
// Handshake packets with minimal delay.
- received_packet_managers_[INITIAL_DATA].set_local_max_ack_delay(
- kAlarmGranularity);
+ if (!GetQuicReloadableFlag(quic_delay_initial_ack) ||
+ perspective == Perspective::IS_CLIENT) {
+ // Delay the first server ACK, because server ACKs are padded to
+ // full size and count towards the amplification limit.
+ received_packet_managers_[INITIAL_DATA].set_local_max_ack_delay(
+ kAlarmGranularity);
+ } else {
+ QUIC_RELOADABLE_FLAG_COUNT(quic_delay_initial_ack);
+ }
received_packet_managers_[HANDSHAKE_DATA].set_local_max_ack_delay(
kAlarmGranularity);
diff --git a/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.h b/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.h
index 17b5e268063..a9f177592b6 100644
--- a/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.h
+++ b/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager.h
@@ -54,7 +54,7 @@ class QUIC_EXPORT_PRIVATE UberReceivedPacketManager {
void ResetAckStates(EncryptionLevel encryption_level);
// Called to enable multiple packet number support.
- void EnableMultiplePacketNumberSpacesSupport();
+ void EnableMultiplePacketNumberSpacesSupport(Perspective perspective);
// Returns true if ACK frame has been updated since GetUpdatedAckFrame was
// last called.
diff --git a/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager_test.cc b/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager_test.cc
index b7063d2fede..3a1531bcfa8 100644
--- a/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/core/uber_received_packet_manager_test.cc
@@ -439,7 +439,7 @@ TEST_F(UberReceivedPacketManagerTest, SendDelayedAckDecimationEighthRtt) {
TEST_F(UberReceivedPacketManagerTest,
DontWaitForPacketsBeforeMultiplePacketNumberSpaces) {
- manager_->EnableMultiplePacketNumberSpacesSupport();
+ manager_->EnableMultiplePacketNumberSpacesSupport(Perspective::IS_CLIENT);
EXPECT_FALSE(
manager_->GetLargestObserved(ENCRYPTION_HANDSHAKE).IsInitialized());
EXPECT_FALSE(
@@ -469,10 +469,42 @@ TEST_F(UberReceivedPacketManagerTest,
}
TEST_F(UberReceivedPacketManagerTest, AckSendingDifferentPacketNumberSpaces) {
- manager_->EnableMultiplePacketNumberSpacesSupport();
+ manager_->EnableMultiplePacketNumberSpacesSupport(Perspective::IS_SERVER);
EXPECT_FALSE(HasPendingAck());
EXPECT_FALSE(manager_->IsAckFrameUpdated());
+ RecordPacketReceipt(ENCRYPTION_INITIAL, 3);
+ EXPECT_TRUE(manager_->IsAckFrameUpdated());
+ MaybeUpdateAckTimeout(kInstigateAck, ENCRYPTION_INITIAL, 3);
+ EXPECT_TRUE(HasPendingAck());
+ // Delayed ack is scheduled.
+ if (GetQuicReloadableFlag(quic_delay_initial_ack)) {
+ CheckAckTimeout(clock_.ApproximateNow() +
+ QuicTime::Delta::FromMilliseconds(25));
+ // Send delayed handshake data ACK.
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(25));
+ } else {
+ CheckAckTimeout(clock_.ApproximateNow() +
+ QuicTime::Delta::FromMilliseconds(1));
+ // Send delayed handshake data ACK.
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
+ }
+ CheckAckTimeout(clock_.ApproximateNow());
+ EXPECT_FALSE(HasPendingAck());
+
+ // Second delayed ack should have a shorter delay.
+ RecordPacketReceipt(ENCRYPTION_INITIAL, 4);
+ EXPECT_TRUE(manager_->IsAckFrameUpdated());
+ MaybeUpdateAckTimeout(kInstigateAck, ENCRYPTION_INITIAL, 4);
+ EXPECT_TRUE(HasPendingAck());
+ // Delayed ack is scheduled.
+ CheckAckTimeout(clock_.ApproximateNow() +
+ QuicTime::Delta::FromMilliseconds(1));
+ // Send delayed handshake data ACK.
+ clock_.AdvanceTime(QuicTime::Delta::FromMilliseconds(1));
+ CheckAckTimeout(clock_.ApproximateNow());
+ EXPECT_FALSE(HasPendingAck());
+
RecordPacketReceipt(ENCRYPTION_HANDSHAKE, 3);
EXPECT_TRUE(manager_->IsAckFrameUpdated());
MaybeUpdateAckTimeout(kInstigateAck, ENCRYPTION_HANDSHAKE, 3);
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_client_bin.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_client_bin.cc
index 8bdeef5dc35..0e44092876b 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_client_bin.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_client_bin.cc
@@ -9,6 +9,7 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
#include "net/third_party/quiche/src/quic/masque/masque_client_tools.h"
#include "net/third_party/quiche/src/quic/masque/masque_encapsulated_epoll_client.h"
@@ -21,7 +22,6 @@
#include "net/third_party/quiche/src/quic/tools/fake_proof_verifier.h"
#include "net/third_party/quiche/src/quic/tools/quic_url.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
DEFINE_QUIC_COMMAND_LINE_FLAG(bool,
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.cc
index 3db36f3769a..4baf4ad26f0 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.cc
@@ -23,7 +23,7 @@ MasqueClientSession::MasqueClientSession(
owner_(owner),
compression_engine_(this) {}
-void MasqueClientSession::OnMessageReceived(quiche::QuicheStringPiece message) {
+void MasqueClientSession::OnMessageReceived(absl::string_view message) {
QUIC_DVLOG(1) << "Received DATAGRAM frame of length " << message.length();
QuicConnectionId client_connection_id, server_connection_id;
@@ -46,7 +46,7 @@ void MasqueClientSession::OnMessageReceived(quiche::QuicheStringPiece message) {
EncapsulatedClientSession* encapsulated_client_session =
connection_id_registration->second;
encapsulated_client_session->ProcessPacket(
- quiche::QuicheStringPiece(packet.data(), packet.size()), server_address);
+ absl::string_view(packet.data(), packet.size()), server_address);
QUIC_DVLOG(1) << "Sent " << packet.size() << " bytes to connection for "
<< client_connection_id;
@@ -63,7 +63,7 @@ void MasqueClientSession::OnMessageLost(QuicMessageId message_id) {
void MasqueClientSession::SendPacket(QuicConnectionId client_connection_id,
QuicConnectionId server_connection_id,
- quiche::QuicheStringPiece packet,
+ absl::string_view packet,
const QuicSocketAddress& server_address) {
compression_engine_.CompressAndSendPacket(
packet, client_connection_id, server_connection_id, server_address);
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.h b/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.h
index fee24c908ee..38fa929a591 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.h
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_client_session.h
@@ -5,11 +5,11 @@
#ifndef QUICHE_QUIC_MASQUE_MASQUE_CLIENT_SESSION_H_
#define QUICHE_QUIC_MASQUE_MASQUE_CLIENT_SESSION_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_session.h"
#include "net/third_party/quiche/src/quic/masque/masque_compression_engine.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -37,7 +37,7 @@ class QUIC_NO_EXPORT MasqueClientSession : public QuicSpdyClientSession {
virtual ~EncapsulatedClientSession() {}
// Process packet that was just decapsulated.
- virtual void ProcessPacket(quiche::QuicheStringPiece packet,
+ virtual void ProcessPacket(absl::string_view packet,
QuicSocketAddress server_address) = 0;
};
@@ -58,7 +58,7 @@ class QUIC_NO_EXPORT MasqueClientSession : public QuicSpdyClientSession {
MasqueClientSession& operator=(const MasqueClientSession&) = delete;
// From QuicSession.
- void OnMessageReceived(quiche::QuicheStringPiece message) override;
+ void OnMessageReceived(absl::string_view message) override;
void OnMessageAcked(QuicMessageId message_id,
QuicTime receive_timestamp) override;
@@ -68,7 +68,7 @@ class QUIC_NO_EXPORT MasqueClientSession : public QuicSpdyClientSession {
// Send encapsulated packet.
void SendPacket(QuicConnectionId client_connection_id,
QuicConnectionId server_connection_id,
- quiche::QuicheStringPiece packet,
+ absl::string_view packet,
const QuicSocketAddress& server_address);
// Register encapsulated client. This allows clients that are encapsulated
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_client_tools.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_client_tools.cc
index 7b96abe9758..e59204a9344 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_client_tools.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_client_tools.cc
@@ -69,7 +69,7 @@ bool SendEncapsulatedMasqueRequest(MasqueEpollClient* masque_client,
const std::string body = "";
// Construct a GET or POST request for supplied URL.
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
header_block[":method"] = "GET";
header_block[":scheme"] = url.scheme();
header_block[":authority"] = url.HostPort();
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.cc
index dbc4580c892..008e2b8bf01 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.cc
@@ -6,6 +6,7 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
@@ -14,7 +15,6 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -213,7 +213,7 @@ bool MasqueCompressionEngine::WriteCompressedPacketToSlice(
return false;
}
}
- quiche::QuicheStringPiece packet_payload = reader->ReadRemainingPayload();
+ absl::string_view packet_payload = reader->ReadRemainingPayload();
if (!writer->WriteStringPiece(packet_payload)) {
QUIC_BUG << "Failed to write packet_payload";
return false;
@@ -222,7 +222,7 @@ bool MasqueCompressionEngine::WriteCompressedPacketToSlice(
}
void MasqueCompressionEngine::CompressAndSendPacket(
- quiche::QuicheStringPiece packet,
+ absl::string_view packet,
QuicConnectionId client_connection_id,
QuicConnectionId server_connection_id,
const QuicSocketAddress& server_address) {
@@ -452,7 +452,7 @@ bool MasqueCompressionEngine::WriteDecompressedPacket(
return false;
}
}
- quiche::QuicheStringPiece payload = reader->ReadRemainingPayload();
+ absl::string_view payload = reader->ReadRemainingPayload();
if (!writer.WriteStringPiece(payload)) {
QUIC_BUG << "Failed to write payload";
return false;
@@ -461,7 +461,7 @@ bool MasqueCompressionEngine::WriteDecompressedPacket(
}
bool MasqueCompressionEngine::DecompressDatagram(
- quiche::QuicheStringPiece datagram,
+ absl::string_view datagram,
QuicConnectionId* client_connection_id,
QuicConnectionId* server_connection_id,
QuicSocketAddress* server_address,
@@ -514,8 +514,8 @@ bool MasqueCompressionEngine::DecompressDatagram(
QUIC_DVLOG(2) << "Decompressed client " << context.client_connection_id
<< " server " << context.server_connection_id << "\n"
- << quiche::QuicheTextUtils::HexDump(quiche::QuicheStringPiece(
- packet->data(), packet->size()));
+ << quiche::QuicheTextUtils::HexDump(
+ absl::string_view(packet->data(), packet->size()));
return true;
}
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.h b/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.h
index 5ab88bd9d7e..6eb7a444f64 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.h
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_compression_engine.h
@@ -5,13 +5,13 @@
#ifndef QUICHE_QUIC_MASQUE_MASQUE_PROTOCOL_H_
#define QUICHE_QUIC_MASQUE_MASQUE_PROTOCOL_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -47,7 +47,7 @@ class QUIC_NO_EXPORT MasqueCompressionEngine {
// hand off the uncompressed packet to an encapsulated session that will treat
// it as having come from the provided |server_address|.
// The connection IDs are the one used by the encapsulated |packet|.
- void CompressAndSendPacket(quiche::QuicheStringPiece packet,
+ void CompressAndSendPacket(absl::string_view packet,
QuicConnectionId client_connection_id,
QuicConnectionId server_connection_id,
const QuicSocketAddress& server_address);
@@ -58,7 +58,7 @@ class QUIC_NO_EXPORT MasqueCompressionEngine {
// |server_address| will be filled with the |server_address| passed to
// CompressAndSendPacket. |version_present| will contain whether the
// encapsulated |packet| contains a Version field.
- bool DecompressDatagram(quiche::QuicheStringPiece datagram,
+ bool DecompressDatagram(absl::string_view datagram,
QuicConnectionId* client_connection_id,
QuicConnectionId* server_connection_id,
QuicSocketAddress* server_address,
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.cc
index ff9d2cf4081..bc3b3beef7f 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.cc
@@ -28,15 +28,16 @@ MasqueDispatcher::MasqueDispatcher(
std::unique_ptr<QuicSession> MasqueDispatcher::CreateQuicSession(
QuicConnectionId connection_id,
- const QuicSocketAddress& /*self_address*/,
+ const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece /*alpn*/,
+ absl::string_view /*alpn*/,
const ParsedQuicVersion& version) {
// The MasqueServerSession takes ownership of |connection| below.
- QuicConnection* connection = new QuicConnection(
- connection_id, peer_address, helper(), alarm_factory(), writer(),
- /*owns_writer=*/false, Perspective::IS_SERVER,
- ParsedQuicVersionVector{version});
+ QuicConnection* connection =
+ new QuicConnection(connection_id, self_address, peer_address, helper(),
+ alarm_factory(), writer(),
+ /*owns_writer=*/false, Perspective::IS_SERVER,
+ ParsedQuicVersionVector{version});
auto session = std::make_unique<MasqueServerSession>(
config(), GetSupportedVersions(), connection, this, this,
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.h b/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.h
index e663b1cb89e..9ba52ef913d 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.h
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_dispatcher.h
@@ -36,7 +36,7 @@ class QUIC_NO_EXPORT MasqueDispatcher : public QuicSimpleDispatcher,
QuicConnectionId connection_id,
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece alpn,
+ absl::string_view alpn,
const ParsedQuicVersion& version) override;
bool OnFailedToDispatchPacket(const ReceivedPacketInfo& packet_info) override;
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.cc
index 818ff76c8dc..628e7c83b36 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.cc
@@ -23,7 +23,7 @@ MasqueEncapsulatedClientSession::MasqueEncapsulatedClientSession(
masque_client_session_(masque_client_session) {}
void MasqueEncapsulatedClientSession::ProcessPacket(
- quiche::QuicheStringPiece packet,
+ absl::string_view packet,
QuicSocketAddress server_address) {
QuicTime now = connection()->clock()->ApproximateNow();
QuicReceivedPacket received_packet(packet.data(), packet.length(), now);
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.h b/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.h
index 75ccc1f58ec..11e96011d96 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.h
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_client_session.h
@@ -42,7 +42,7 @@ class QUIC_NO_EXPORT MasqueEncapsulatedClientSession
const MasqueEncapsulatedClientSession&) = delete;
// From MasqueClientSession::EncapsulatedClientSession.
- void ProcessPacket(quiche::QuicheStringPiece packet,
+ void ProcessPacket(absl::string_view packet,
QuicSocketAddress server_address) override;
// From QuicSession.
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_epoll_client.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_epoll_client.cc
index 1f3986284ac..934a8e53ae3 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_epoll_client.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_encapsulated_epoll_client.cc
@@ -27,7 +27,7 @@ class MasquePacketWriter : public QuicPacketWriter {
DCHECK(peer_address.IsInitialized());
QUIC_DVLOG(1) << "MasquePacketWriter trying to write " << buf_len
<< " bytes to " << peer_address;
- quiche::QuicheStringPiece packet(buffer, buf_len);
+ absl::string_view packet(buffer, buf_len);
client_->masque_client()->masque_client_session()->SendPacket(
client_->session()->connection()->client_connection_id(),
client_->session()->connection()->connection_id(), packet,
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_epoll_client.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_epoll_client.cc
index 24cbaa6a75d..3b7c2011331 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_epoll_client.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_epoll_client.cc
@@ -82,7 +82,7 @@ std::unique_ptr<MasqueEpollClient> MasqueEpollClient::Create(
std::string body = "foo";
// Construct a GET or POST request for supplied URL.
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
header_block[":method"] = "POST";
header_block[":scheme"] = "https";
header_block[":authority"] = masque_client->authority_;
@@ -115,7 +115,7 @@ void MasqueEpollClient::UnregisterClientConnectionId(
std::string body(client_connection_id.data(), client_connection_id.length());
// Construct a GET or POST request for supplied URL.
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
header_block[":method"] = "POST";
header_block[":scheme"] = "https";
header_block[":authority"] = authority_;
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.cc
index a3c2b9725d0..fc2fdc08c41 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.cc
@@ -3,8 +3,8 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/masque/masque_server_backend.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -28,7 +28,7 @@ MasqueServerBackend::MasqueServerBackend(const std::string& server_authority,
}
bool MasqueServerBackend::MaybeHandleMasqueRequest(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* request_handler) {
auto path_pair = request_headers.find(":path");
@@ -40,9 +40,9 @@ bool MasqueServerBackend::MaybeHandleMasqueRequest(
// This request is missing required headers.
return false;
}
- quiche::QuicheStringPiece path = path_pair->second;
- quiche::QuicheStringPiece scheme = scheme_pair->second;
- quiche::QuicheStringPiece method = method_pair->second;
+ absl::string_view path = path_pair->second;
+ absl::string_view scheme = scheme_pair->second;
+ absl::string_view method = method_pair->second;
if (scheme != "https" || method != "POST" || request_body.empty()) {
// MASQUE requests MUST be a non-empty https POST.
return false;
@@ -60,7 +60,7 @@ bool MasqueServerBackend::MaybeHandleMasqueRequest(
// Cannot enforce missing authority.
return false;
}
- quiche::QuicheStringPiece authority = authority_pair->second;
+ absl::string_view authority = authority_pair->second;
if (server_authority_ != authority) {
// This request does not match server_authority.
return false;
@@ -100,7 +100,7 @@ bool MasqueServerBackend::MaybeHandleMasqueRequest(
}
void MasqueServerBackend::FetchResponseFromBackend(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* request_handler) {
if (MaybeHandleMasqueRequest(request_headers, request_body,
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.h b/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.h
index 481d90dde48..52260b72fbd 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.h
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_server_backend.h
@@ -20,7 +20,7 @@ class QUIC_NO_EXPORT MasqueServerBackend : public QuicMemoryCacheBackend {
public:
virtual std::unique_ptr<QuicBackendResponse> HandleMasqueRequest(
const std::string& masque_path,
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* request_handler) = 0;
virtual ~BackendClient() = default;
@@ -35,7 +35,7 @@ class QUIC_NO_EXPORT MasqueServerBackend : public QuicMemoryCacheBackend {
// From QuicMemoryCacheBackend.
void FetchResponseFromBackend(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* request_handler) override;
@@ -52,7 +52,7 @@ class QUIC_NO_EXPORT MasqueServerBackend : public QuicMemoryCacheBackend {
private:
// Handle MASQUE request.
bool MaybeHandleMasqueRequest(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* request_handler);
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.cc b/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.cc
index e884e416702..e6ca1f3c6d5 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.cc
@@ -30,7 +30,7 @@ MasqueServerSession::MasqueServerSession(
masque_server_backend_->RegisterBackendClient(connection_id(), this);
}
-void MasqueServerSession::OnMessageReceived(quiche::QuicheStringPiece message) {
+void MasqueServerSession::OnMessageReceived(absl::string_view message) {
QUIC_DVLOG(1) << "Received DATAGRAM frame of length " << message.length();
QuicConnectionId client_connection_id, server_connection_id;
@@ -81,7 +81,7 @@ void MasqueServerSession::OnConnectionClosed(
std::unique_ptr<QuicBackendResponse> MasqueServerSession::HandleMasqueRequest(
const std::string& masque_path,
- const spdy::SpdyHeaderBlock& /*request_headers*/,
+ const spdy::Http2HeaderBlock& /*request_headers*/,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* /*request_handler*/) {
QUIC_DLOG(INFO) << "MasqueServerSession handling MASQUE request";
@@ -107,7 +107,7 @@ std::unique_ptr<QuicBackendResponse> MasqueServerSession::HandleMasqueRequest(
// TODO(dschinazi) implement binary protocol sent in response body.
const std::string response_body = "";
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[":status"] = "200";
auto response = std::make_unique<QuicBackendResponse>();
response->set_response_type(QuicBackendResponse::REGULAR_RESPONSE);
diff --git a/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.h b/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.h
index bc70f5e49f5..63cadcd0aca 100644
--- a/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.h
+++ b/chromium/net/third_party/quiche/src/quic/masque/masque_server_session.h
@@ -48,7 +48,7 @@ class QUIC_NO_EXPORT MasqueServerSession
MasqueServerSession& operator=(const MasqueServerSession&) = delete;
// From QuicSession.
- void OnMessageReceived(quiche::QuicheStringPiece message) override;
+ void OnMessageReceived(absl::string_view message) override;
void OnMessageAcked(QuicMessageId message_id,
QuicTime receive_timestamp) override;
void OnMessageLost(QuicMessageId message_id) override;
@@ -58,7 +58,7 @@ class QUIC_NO_EXPORT MasqueServerSession
// From MasqueServerBackend::BackendClient.
std::unique_ptr<QuicBackendResponse> HandleMasqueRequest(
const std::string& masque_path,
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* request_handler) override;
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_aligned.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_aligned.h
deleted file mode 100644
index ecfa649f31c..00000000000
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_aligned.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_ALIGNED_H_
-#define QUICHE_QUIC_PLATFORM_API_QUIC_ALIGNED_H_
-
-#include "net/quic/platform/impl/quic_aligned_impl.h"
-
-#define QUIC_ALIGN_OF QUIC_ALIGN_OF_IMPL
-#define QUIC_ALIGNED(X) QUIC_ALIGNED_IMPL(X)
-#define QUIC_CACHELINE_ALIGNED QUIC_CACHELINE_ALIGNED_IMPL
-#define QUIC_CACHELINE_SIZE QUIC_CACHELINE_SIZE_IMPL
-
-#endif // QUICHE_QUIC_PLATFORM_API_QUIC_ALIGNED_H_
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_cert_utils.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_cert_utils.h
index a680dd6e00d..b2a5bc22b62 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_cert_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_cert_utils.h
@@ -5,17 +5,16 @@
#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_CERT_UTILS_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_CERT_UTILS_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/quic/platform/impl/quic_cert_utils_impl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
class QUIC_EXPORT_PRIVATE QuicCertUtils {
public:
- static bool ExtractSubjectNameFromDERCert(
- quiche::QuicheStringPiece cert,
- quiche::QuicheStringPiece* subject_out) {
+ static bool ExtractSubjectNameFromDERCert(absl::string_view cert,
+ absl::string_view* subject_out) {
return QuicCertUtilsImpl::ExtractSubjectNameFromDERCert(cert, subject_out);
}
};
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h
deleted file mode 100644
index 499b61abf74..00000000000
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_FALLTHROUGH_H_
-#define QUICHE_QUIC_PLATFORM_API_QUIC_FALLTHROUGH_H_
-
-#include "net/quic/platform/impl/quic_fallthrough_impl.h"
-
-#define QUIC_FALLTHROUGH_INTENDED QUIC_FALLTHROUGH_INTENDED_IMPL
-
-#endif // QUICHE_QUIC_PLATFORM_API_QUIC_FALLTHROUGH_H_
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.cc b/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.cc
index 40dea3ed1ca..a9901e14d86 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_file_utils.h"
+#include "absl/strings/string_view.h"
#include "net/quic/platform/impl/quic_file_utils_impl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -16,8 +16,7 @@ std::vector<std::string> ReadFileContents(const std::string& dirname) {
}
// Reads the contents of |filename| as a string into |contents|.
-void ReadFileContents(quiche::QuicheStringPiece filename,
- std::string* contents) {
+void ReadFileContents(absl::string_view filename, std::string* contents) {
ReadFileContentsImpl(filename, contents);
}
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.h
index 8191e0a5ace..6142feb3f95 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_file_utils.h
@@ -8,8 +8,8 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -18,7 +18,7 @@ QUIC_EXPORT_PRIVATE std::vector<std::string> ReadFileContents(
const std::string& dirname);
// Reads the contents of |filename| as a string into |contents|.
-QUIC_EXPORT_PRIVATE void ReadFileContents(quiche::QuicheStringPiece filename,
+QUIC_EXPORT_PRIVATE void ReadFileContents(absl::string_view filename,
std::string* contents);
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.cc b/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.cc
index 5a0ccc09ccb..d13339c4ca8 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.cc
@@ -3,18 +3,17 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
namespace quic {
// static
-bool QuicHostnameUtils::IsValidSNI(quiche::QuicheStringPiece sni) {
+bool QuicHostnameUtils::IsValidSNI(absl::string_view sni) {
return QuicHostnameUtilsImpl::IsValidSNI(sni);
}
// static
-std::string QuicHostnameUtils::NormalizeHostname(
- quiche::QuicheStringPiece hostname) {
+std::string QuicHostnameUtils::NormalizeHostname(absl::string_view hostname) {
return QuicHostnameUtilsImpl::NormalizeHostname(hostname);
}
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h
index 6a04044b714..a3c902ef55b 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h
@@ -7,9 +7,9 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/quic/platform/impl/quic_hostname_utils_impl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -21,12 +21,12 @@ class QUIC_EXPORT_PRIVATE QuicHostnameUtils {
// (1) disallow IP addresses;
// (2) check that the hostname contains valid characters only; and
// (3) contains at least one dot.
- static bool IsValidSNI(quiche::QuicheStringPiece sni);
+ static bool IsValidSNI(absl::string_view sni);
// Canonicalizes the specified hostname. This involves a wide variety of
// transformations, including lowercasing, removing trailing dots and IDNA
// conversion.
- static std::string NormalizeHostname(quiche::QuicheStringPiece hostname);
+ static std::string NormalizeHostname(absl::string_view hostname);
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils_test.cc b/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils_test.cc
index eba97c4cae5..d1808fb0b3c 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_hostname_utils_test.cc
@@ -6,8 +6,8 @@
#include <string>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -78,7 +78,7 @@ TEST_F(QuicHostnameUtilsTest, NormalizeHostname) {
};
// clang-format on
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(tests); ++i) {
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(tests); ++i) {
EXPECT_EQ(std::string(tests[i].expected),
QuicHostnameUtils::NormalizeHostname(tests[i].input));
}
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_macros.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_macros.h
deleted file mode 100644
index 7edeb6aa953..00000000000
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_macros.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2019 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_MACROS_H_
-#define QUICHE_QUIC_PLATFORM_API_QUIC_MACROS_H_
-
-#include "net/quic/platform/impl/quic_macros_impl.h"
-
-#define QUIC_MUST_USE_RESULT QUIC_MUST_USE_RESULT_IMPL
-#define QUIC_UNUSED QUIC_UNUSED_IMPL
-#define QUIC_CONST_INIT QUIC_CONST_INIT_IMPL
-
-#endif // QUICHE_QUIC_PLATFORM_API_QUIC_MACROS_H_
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h
index a1e0bd07433..741ecb19411 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_mem_slice_span.h
@@ -5,9 +5,9 @@
#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_MEM_SLICE_SPAN_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_MEM_SLICE_SPAN_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/quic/platform/impl/quic_mem_slice_span_impl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -39,8 +39,8 @@ class QUIC_EXPORT_PRIVATE QuicMemSliceSpan {
}
// Return data of the span at |index| by the form of a
- // quiche::QuicheStringPiece.
- quiche::QuicheStringPiece GetData(int index) { return impl_.GetData(index); }
+ // absl::string_view.
+ absl::string_view GetData(int index) { return impl_.GetData(index); }
// Return the total length of the data inside the span.
QuicByteCount total_length() { return impl_.total_length(); }
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_port_utils.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_port_utils.h
index 685be0a75bd..b1ddf6e069a 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_port_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_port_utils.h
@@ -5,22 +5,18 @@
#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_PORT_UTILS_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_PORT_UTILS_H_
-#include "net/quic/platform/impl/quic_port_utils_impl.h"
-
namespace quic {
// Returns a UDP port that is currently unused. Check-fails if none are
// available. May return 0 in which case the bind() call will cause the OS
// to use an unused port.
inline int QuicPickServerPortForTestsOrDie() {
- return QuicPickServerPortForTestsOrDieImpl();
+ return 0;
}
// Indicates that a specified port previously returned by
// QuicPickServerPortForTestsOrDie is no longer used.
-inline void QuicRecyclePort(int port) {
- return QuicRecyclePortImpl(port);
-}
+inline void QuicRecyclePort(int /*port*/) {}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_string_utils_test.cc b/chromium/net/third_party/quiche/src/quic/platform/api/quic_string_utils_test.cc
index 4f65b7d119b..e23b6ff4697 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_string_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_string_utils_test.cc
@@ -6,9 +6,9 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -21,14 +21,14 @@ TEST(QuicStringUtilsTest, QuicheStrCat) {
// Single string-like argument.
const char kFoo[] = "foo";
const std::string string_foo(kFoo);
- const quiche::QuicheStringPiece stringpiece_foo(string_foo);
+ const absl::string_view stringpiece_foo(string_foo);
EXPECT_EQ("foo", quiche::QuicheStrCat(kFoo));
EXPECT_EQ("foo", quiche::QuicheStrCat(string_foo));
EXPECT_EQ("foo", quiche::QuicheStrCat(stringpiece_foo));
// Two string-like arguments.
const char kBar[] = "bar";
- const quiche::QuicheStringPiece stringpiece_bar(kBar);
+ const absl::string_view stringpiece_bar(kBar);
const std::string string_bar(kBar);
EXPECT_EQ("foobar", quiche::QuicheStrCat(kFoo, kBar));
EXPECT_EQ("foobar", quiche::QuicheStrCat(kFoo, string_bar));
@@ -81,7 +81,7 @@ TEST(QuicStringUtilsTest, QuicStrAppend) {
// Single string-like argument.
const char kFoo[] = "foo";
const std::string string_foo(kFoo);
- const quiche::QuicheStringPiece stringpiece_foo(string_foo);
+ const absl::string_view stringpiece_foo(string_foo);
QuicStrAppend(&output, kFoo);
EXPECT_EQ("foo", output);
QuicStrAppend(&output, string_foo);
@@ -97,7 +97,7 @@ TEST(QuicStringUtilsTest, QuicStrAppend) {
// Two string-like arguments.
const char kBar[] = "bar";
- const quiche::QuicheStringPiece stringpiece_bar(kBar);
+ const absl::string_view stringpiece_bar(kBar);
const std::string string_bar(kBar);
QuicStrAppend(&output, kFoo, kBar);
EXPECT_EQ("foobar", output);
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_test_output.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_test_output.h
index 24998761832..f925db65985 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_test_output.h
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_test_output.h
@@ -5,22 +5,21 @@
#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TEST_OUTPUT_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_OUTPUT_H_
+#include "absl/strings/string_view.h"
#include "net/quic/platform/impl/quic_test_output_impl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
// Save |data| into ${QUIC_TEST_OUTPUT_DIR}/filename. If a file with the same
// path already exists, overwrite it.
-inline void QuicSaveTestOutput(quiche::QuicheStringPiece filename,
- quiche::QuicheStringPiece data) {
+inline void QuicSaveTestOutput(absl::string_view filename,
+ absl::string_view data) {
QuicSaveTestOutputImpl(filename, data);
}
// Load the content of ${QUIC_TEST_OUTPUT_DIR}/filename into |*data|.
// Return whether it is successfully loaded.
-inline bool QuicLoadTestOutput(quiche::QuicheStringPiece filename,
- std::string* data) {
+inline bool QuicLoadTestOutput(absl::string_view filename, std::string* data) {
return QuicLoadTestOutputImpl(filename, data);
}
@@ -31,8 +30,8 @@ inline bool QuicLoadTestOutput(quiche::QuicheStringPiece filename,
// The |identifier| is a human-readable identifier that will be combined with
// the name of the unit test and a timestamp. |data| is the serialized
// quic_trace.Trace protobuf that is being recorded into the file.
-inline void QuicRecordTrace(quiche::QuicheStringPiece identifier,
- quiche::QuicheStringPiece data) {
+inline void QuicRecordTrace(absl::string_view identifier,
+ absl::string_view data) {
QuicRecordTraceImpl(identifier, data);
}
diff --git a/chromium/net/third_party/quiche/src/quic/platform/api/quic_testvalue.h b/chromium/net/third_party/quiche/src/quic/platform/api/quic_testvalue.h
index 0df0c4050be..96ce96864a2 100644
--- a/chromium/net/third_party/quiche/src/quic/platform/api/quic_testvalue.h
+++ b/chromium/net/third_party/quiche/src/quic/platform/api/quic_testvalue.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TESTVALUE_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_TESTVALUE_H_
+#include "absl/strings/string_view.h"
#include "net/quic/platform/impl/quic_testvalue_impl.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -16,7 +16,7 @@ namespace quic {
//
// Note that this method does nothing in Chromium.
template <class T>
-void AdjustTestValue(quiche::QuicheStringPiece label, T* var) {
+void AdjustTestValue(absl::string_view label, T* var) {
AdjustTestValueImpl(label, var);
}
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.cc b/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.cc
index c6dd96d6b6c..a16b2fa61ca 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.cc
@@ -6,13 +6,13 @@
#include <netinet/ip6.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mutex.h"
#include "net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
namespace {
@@ -128,7 +128,7 @@ bool IcmpReachable::OnEvent(int fd) {
}
QUIC_VLOG(2) << quiche::QuicheTextUtils::HexDump(
- quiche::QuicheStringPiece(buffer, size));
+ absl::string_view(buffer, size));
auto* header = reinterpret_cast<const icmp6_hdr*>(&buffer);
QuicWriterMutexLock mu(&header_lock_);
@@ -168,7 +168,7 @@ int64 /* allow-non-std-int */ IcmpReachable::OnAlarm() {
icmp_header_.icmp6_seq++;
CreateIcmpPacket(src_.sin6_addr, dst_.sin6_addr, icmp_header_, "",
- [this](quiche::QuicheStringPiece packet) {
+ [this](absl::string_view packet) {
QUIC_VLOG(2) << quiche::QuicheTextUtils::HexDump(packet);
ssize_t size = kernel_->sendto(
@@ -185,8 +185,7 @@ int64 /* allow-non-std-int */ IcmpReachable::OnAlarm() {
return absl::ToUnixMicros(absl::Now() + timeout_);
}
-quiche::QuicheStringPiece IcmpReachable::StatusName(
- IcmpReachable::Status status) {
+absl::string_view IcmpReachable::StatusName(IcmpReachable::Status status) {
switch (status) {
case REACHABLE:
return "REACHABLE";
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.h b/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.h
index f58efd08242..a3bc0900ead 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable.h
@@ -7,11 +7,11 @@
#include <netinet/icmp6.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mutex.h"
#include "net/third_party/quiche/src/quic/qbone/bonnet/icmp_reachable_interface.h"
#include "net/third_party/quiche/src/quic/qbone/platform/kernel_interface.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -80,7 +80,7 @@ class IcmpReachable : public IcmpReachableInterface {
int64 /* allow-non-std-int */ OnAlarm()
QUIC_LOCKS_EXCLUDED(header_lock_) override;
- static quiche::QuicheStringPiece StatusName(Status status);
+ static absl::string_view StatusName(Status status);
private:
class EpollCallback : public QuicEpollCallbackInterface {
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_client.h b/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_client.h
index 3170b7ed4b1..c5ec95bd2c7 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_client.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_client.h
@@ -5,9 +5,9 @@
#ifndef QUICHE_QUIC_QBONE_MOCK_QBONE_CLIENT_H_
#define QUICHE_QUIC_QBONE_MOCK_QBONE_CLIENT_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_client_interface.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -15,7 +15,7 @@ class MockQboneClient : public QboneClientInterface {
public:
MOCK_METHOD(void,
ProcessPacketFromNetwork,
- (quiche::QuicheStringPiece packet),
+ (absl::string_view packet),
(override));
};
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_server_session.h b/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_server_session.h
index 0781e7f6b4d..d398ba57d6c 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_server_session.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/mock_qbone_server_session.h
@@ -27,14 +27,8 @@ class MockQboneServerSession : public QboneServerSession {
MOCK_METHOD(bool, SendClientRequest, (const QboneClientRequest&), (override));
- MOCK_METHOD(void,
- ProcessPacketFromNetwork,
- (quiche::QuicheStringPiece),
- (override));
- MOCK_METHOD(void,
- ProcessPacketFromPeer,
- (quiche::QuicheStringPiece),
- (override));
+ MOCK_METHOD(void, ProcessPacketFromNetwork, (absl::string_view), (override));
+ MOCK_METHOD(void, ProcessPacketFromPeer, (absl::string_view), (override));
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.cc b/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.cc
index e64dbbaf8f4..68d15010675 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.cc
@@ -6,9 +6,9 @@
#include <netinet/ip6.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/qbone/platform/internet_checksum.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
namespace {
@@ -36,12 +36,11 @@ struct IPv6PseudoHeader {
} // namespace
-void CreateIcmpPacket(
- in6_addr src,
- in6_addr dst,
- const icmp6_hdr& icmp_header,
- quiche::QuicheStringPiece body,
- const std::function<void(quiche::QuicheStringPiece)>& cb) {
+void CreateIcmpPacket(in6_addr src,
+ in6_addr dst,
+ const icmp6_hdr& icmp_header,
+ absl::string_view body,
+ const std::function<void(absl::string_view)>& cb) {
const size_t body_size = std::min(body.size(), kICMPv6BodyMaxSize);
const size_t payload_size = kICMPv6HeaderSize + body_size;
@@ -82,7 +81,7 @@ void CreateIcmpPacket(
const char* packet = reinterpret_cast<char*>(&icmp_packet);
const size_t packet_size = offsetof(ICMPv6Packet, body) + body_size;
- cb(quiche::QuicheStringPiece(packet, packet_size));
+ cb(absl::string_view(packet, packet_size));
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h b/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h
index a76267968fc..ca3fc436832 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h
@@ -10,8 +10,8 @@
#include <functional>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -21,8 +21,8 @@ namespace quic {
void CreateIcmpPacket(in6_addr src,
in6_addr dst,
const icmp6_hdr& icmp_header,
- quiche::QuicheStringPiece body,
- const std::function<void(quiche::QuicheStringPiece)>& cb);
+ absl::string_view body,
+ const std::function<void(absl::string_view)>& cb);
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet_test.cc b/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet_test.cc
index 30fbe21ecbc..08623e1ce5d 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/icmp_packet_test.cc
@@ -8,8 +8,8 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -85,12 +85,12 @@ TEST(IcmpPacketTest, CreatedPacketMatchesReference) {
icmp_header.icmp6_id = 0x82cb;
icmp_header.icmp6_seq = 0x0100;
- quiche::QuicheStringPiece message_body = quiche::QuicheStringPiece(
+ absl::string_view message_body = absl::string_view(
reinterpret_cast<const char*>(kReferenceICMPMessageBody), 56);
- quiche::QuicheStringPiece expected_packet = quiche::QuicheStringPiece(
+ absl::string_view expected_packet = absl::string_view(
reinterpret_cast<const char*>(kReferenceICMPPacket), 104);
CreateIcmpPacket(src_addr, dst_addr, icmp_header, message_body,
- [&expected_packet](quiche::QuicheStringPiece packet) {
+ [&expected_packet](absl::string_view packet) {
QUIC_LOG(INFO) << quiche::QuicheTextUtils::HexDump(packet);
ASSERT_EQ(packet, expected_packet);
});
@@ -114,12 +114,12 @@ TEST(IcmpPacketTest, NonZeroChecksumIsIgnored) {
// Set the checksum to a bogus value
icmp_header.icmp6_cksum = 0x1234;
- quiche::QuicheStringPiece message_body = quiche::QuicheStringPiece(
+ absl::string_view message_body = absl::string_view(
reinterpret_cast<const char*>(kReferenceICMPMessageBody), 56);
- quiche::QuicheStringPiece expected_packet = quiche::QuicheStringPiece(
+ absl::string_view expected_packet = absl::string_view(
reinterpret_cast<const char*>(kReferenceICMPPacket), 104);
CreateIcmpPacket(src_addr, dst_addr, icmp_header, message_body,
- [&expected_packet](quiche::QuicheStringPiece packet) {
+ [&expected_packet](absl::string_view packet) {
QUIC_LOG(INFO) << quiche::QuicheTextUtils::HexDump(packet);
ASSERT_EQ(packet, expected_packet);
});
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/ip_range.cc b/chromium/net/third_party/quiche/src/quic/qbone/platform/ip_range.cc
index 04198d0cf7d..cb9f4a1ab04 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/ip_range.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/ip_range.cc
@@ -4,7 +4,7 @@
#include "net/third_party/quiche/src/quic/qbone/platform/ip_range.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/netlink.cc b/chromium/net/third_party/quiche/src/quic/qbone/platform/netlink.cc
index 719551d1e00..d19c28b5fda 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/netlink.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/netlink.cc
@@ -7,8 +7,8 @@
#include <linux/fib_rules.h>
#include <utility>
+#include "absl/base/attributes.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_fallthrough.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/quic/platform/impl/quic_ip_address_impl.h"
@@ -259,7 +259,7 @@ class LocalAddressParser : public NetlinkParserInterface {
switch (interface_address->ifa_family) {
case AF_INET:
- QUIC_FALLTHROUGH_INTENDED;
+ ABSL_FALLTHROUGH_INTENDED;
case AF_INET6:
// QuicIpAddress knows how to parse ip from raw bytes as long as they
// are in network byte order.
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.cc b/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.cc
index 6da9faa749e..1b0103e3336 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.cc
@@ -6,10 +6,10 @@
#include <netinet/ip6.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/qbone/platform/internet_checksum.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
namespace {
@@ -30,9 +30,8 @@ struct TCPv6PseudoHeader {
} // namespace
-void CreateTcpResetPacket(
- quiche::QuicheStringPiece original_packet,
- const std::function<void(quiche::QuicheStringPiece)>& cb) {
+void CreateTcpResetPacket(absl::string_view original_packet,
+ const std::function<void(absl::string_view)>& cb) {
// By the time this method is called, original_packet should be fairly
// strongly validated. However, it's better to be more paranoid than not, so
// here are a bunch of very obvious checks.
@@ -121,7 +120,7 @@ void CreateTcpResetPacket(
const char* packet = reinterpret_cast<char*>(&tcp_packet);
- cb(quiche::QuicheStringPiece(packet, sizeof(tcp_packet)));
+ cb(absl::string_view(packet, sizeof(tcp_packet)));
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.h b/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.h
index bb1364b41be..2038fab09ec 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet.h
@@ -10,16 +10,15 @@
#include <functional>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
// Creates an TCPv6 RST packet, returning a packed string representation of the
// packet to |cb|.
-void CreateTcpResetPacket(
- quiche::QuicheStringPiece original_packet,
- const std::function<void(quiche::QuicheStringPiece)>& cb);
+void CreateTcpResetPacket(absl::string_view original_packet,
+ const std::function<void(absl::string_view)>& cb);
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet_test.cc b/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet_test.cc
index 84645c8a209..a1431952199 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/platform/tcp_packet_test.cc
@@ -8,8 +8,8 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -102,17 +102,16 @@ constexpr uint8_t kReferenceTCPRSTPacket[] = {
} // namespace
TEST(TcpPacketTest, CreatedPacketMatchesReference) {
- quiche::QuicheStringPiece syn = quiche::QuicheStringPiece(
- reinterpret_cast<const char*>(kReferenceTCPSYNPacket),
- sizeof(kReferenceTCPSYNPacket));
- quiche::QuicheStringPiece expected_packet = quiche::QuicheStringPiece(
- reinterpret_cast<const char*>(kReferenceTCPRSTPacket),
- sizeof(kReferenceTCPRSTPacket));
- CreateTcpResetPacket(
- syn, [&expected_packet](quiche::QuicheStringPiece packet) {
- QUIC_LOG(INFO) << quiche::QuicheTextUtils::HexDump(packet);
- ASSERT_EQ(packet, expected_packet);
- });
+ absl::string_view syn =
+ absl::string_view(reinterpret_cast<const char*>(kReferenceTCPSYNPacket),
+ sizeof(kReferenceTCPSYNPacket));
+ absl::string_view expected_packet =
+ absl::string_view(reinterpret_cast<const char*>(kReferenceTCPRSTPacket),
+ sizeof(kReferenceTCPRSTPacket));
+ CreateTcpResetPacket(syn, [&expected_packet](absl::string_view packet) {
+ QUIC_LOG(INFO) << quiche::QuicheTextUtils::HexDump(packet);
+ ASSERT_EQ(packet, expected_packet);
+ });
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.cc
index a2ba1175ab4..44aec9c27f0 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.cc
@@ -6,12 +6,12 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_alarm_factory.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_connection_helper.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_epoll.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_exported_stats.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace {
@@ -58,7 +58,7 @@ QboneClientSession* QboneClient::qbone_session() {
return static_cast<QboneClientSession*>(QuicClientBase::session());
}
-void QboneClient::ProcessPacketFromNetwork(quiche::QuicheStringPiece packet) {
+void QboneClient::ProcessPacketFromNetwork(absl::string_view packet) {
qbone_session()->ProcessPacketFromNetwork(packet);
}
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.h
index 209511023d9..7fbba4b7b44 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client.h
@@ -5,12 +5,12 @@
#ifndef QUICHE_QUIC_QBONE_QBONE_CLIENT_H_
#define QUICHE_QUIC_QBONE_QBONE_CLIENT_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_client_interface.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_client_session.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_packet_writer.h"
#include "net/third_party/quiche/src/quic/tools/quic_client_base.h"
#include "net/third_party/quiche/src/quic/tools/quic_client_epoll_network_helper.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
// A QboneClient encapsulates connecting to a server via an epoll server
@@ -34,7 +34,7 @@ class QboneClient : public QuicClientBase, public QboneClientInterface {
// From QboneClientInterface. Accepts a given packet from the network and
// sends the packet down to the QBONE connection.
- void ProcessPacketFromNetwork(quiche::QuicheStringPiece packet) override;
+ void ProcessPacketFromNetwork(absl::string_view packet) override;
bool EarlyDataAccepted() override;
bool ReceivedInchoateReject() override;
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_interface.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_interface.h
index aec3a8fac89..8b31cceb65d 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_interface.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_interface.h
@@ -7,7 +7,7 @@
#include <cstdint>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
namespace quic {
@@ -17,7 +17,7 @@ class QboneClientInterface {
virtual ~QboneClientInterface() {}
// Accepts a given packet from the network and sends the packet down to the
// QBONE connection.
- virtual void ProcessPacketFromNetwork(quiche::QuicheStringPiece packet) = 0;
+ virtual void ProcessPacketFromNetwork(absl::string_view packet) = 0;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.cc
index f375e0a403d..4697fcccc52 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.cc
@@ -6,9 +6,9 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_constants.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -77,13 +77,11 @@ bool QboneClientSession::SendServerRequest(const QboneServerRequest& request) {
return control_stream_->SendRequest(request);
}
-void QboneClientSession::ProcessPacketFromNetwork(
- quiche::QuicheStringPiece packet) {
+void QboneClientSession::ProcessPacketFromNetwork(absl::string_view packet) {
SendPacketToPeer(packet);
}
-void QboneClientSession::ProcessPacketFromPeer(
- quiche::QuicheStringPiece packet) {
+void QboneClientSession::ProcessPacketFromPeer(absl::string_view packet) {
writer_->WritePacketToNetwork(packet.data(), packet.size());
}
@@ -94,7 +92,7 @@ void QboneClientSession::OnProofVerifyDetailsAvailable(
const ProofVerifyDetails& verify_details) {}
bool QboneClientSession::HasActiveRequests() const {
- return (stream_map_size() - num_static_streams() - num_zombie_streams()) > 0;
+ return GetNumActiveStreams() + num_draining_streams() > 0;
}
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.h
index 4eeb7b171f7..f3cd0202ba2 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_session.h
@@ -5,13 +5,13 @@
#ifndef QUICHE_QUIC_QBONE_QBONE_CLIENT_SESSION_H_
#define QUICHE_QUIC_QBONE_QBONE_CLIENT_SESSION_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_control.pb.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_control_stream.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_packet_writer.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_session_base.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -55,8 +55,8 @@ class QUIC_EXPORT_PRIVATE QboneClientSession
bool SendServerRequest(const QboneServerRequest& request);
- void ProcessPacketFromNetwork(quiche::QuicheStringPiece packet) override;
- void ProcessPacketFromPeer(quiche::QuicheStringPiece packet) override;
+ void ProcessPacketFromNetwork(absl::string_view packet) override;
+ void ProcessPacketFromPeer(absl::string_view packet) override;
// Returns true if there are active requests on this session.
bool HasActiveRequests() const;
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_test.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_test.cc
index cfe6c46abfd..98b1a2e59ba 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_client_test.cc
@@ -6,6 +6,7 @@
#include "net/third_party/quiche/src/quic/qbone/qbone_client.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_alarm_factory.h"
#include "net/third_party/quiche/src/quic/core/quic_default_packet_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_dispatcher.h"
@@ -26,7 +27,6 @@
#include "net/third_party/quiche/src/quic/test_tools/server_thread.h"
#include "net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h"
#include "net/third_party/quiche/src/quic/tools/quic_server.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -123,13 +123,13 @@ class QuicQboneDispatcher : public QuicDispatcher {
std::unique_ptr<QuicSession> CreateQuicSession(
QuicConnectionId id,
- const QuicSocketAddress& /*self_address*/,
+ const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece alpn,
+ absl::string_view alpn,
const quic::ParsedQuicVersion& version) override {
CHECK_EQ(alpn, "qbone");
QuicConnection* connection = new QuicConnection(
- id, peer_address, helper(), alarm_factory(), writer(),
+ id, self_address, peer_address, helper(), alarm_factory(), writer(),
/* owns_writer= */ false, Perspective::IS_SERVER,
ParsedQuicVersionVector{version});
// The connection owning wrapper owns the connection created.
@@ -232,6 +232,8 @@ TEST_P(QboneClientTest, SendDataFromClient) {
QuicPickServerPortForTestsOrDie());
ServerThread server_thread(server, server_address);
server_thread.Initialize();
+ server_address =
+ QuicSocketAddress(server_address.host(), server_thread.GetPort());
server_thread.Start();
QuicEpollServer epoll_server;
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_control_stream.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_control_stream.cc
index 0b453a7a954..04f074c30a7 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_control_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_control_stream.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/quic/qbone/qbone_control_stream.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_constants.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -59,8 +59,8 @@ bool QboneControlStreamBase::SendMessage(const proto2::Message& proto) {
uint16_t size = tmp.size();
char size_str[kRequestSizeBytes];
memcpy(size_str, &size, kRequestSizeBytes);
- WriteOrBufferData(quiche::QuicheStringPiece(size_str, kRequestSizeBytes),
- false, nullptr);
+ WriteOrBufferData(absl::string_view(size_str, kRequestSizeBytes), false,
+ nullptr);
WriteOrBufferData(tmp, false, nullptr);
return true;
}
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.cc
index ef78efaef73..5fbf63dfc2d 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.cc
@@ -6,13 +6,13 @@
#include <cstring>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h"
#include "net/third_party/quiche/src/quic/qbone/platform/internet_checksum.h"
#include "net/third_party/quiche/src/quic/qbone/platform/tcp_packet.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace {
@@ -51,12 +51,11 @@ QbonePacketProcessor::StatsInterface::~StatsInterface() {}
QbonePacketProcessor::Filter::~Filter() {}
QbonePacketProcessor::ProcessingResult
-QbonePacketProcessor::Filter::FilterPacket(
- Direction direction,
- quiche::QuicheStringPiece full_packet,
- quiche::QuicheStringPiece payload,
- icmp6_hdr* icmp_header,
- OutputInterface* output) {
+QbonePacketProcessor::Filter::FilterPacket(Direction direction,
+ absl::string_view full_packet,
+ absl::string_view payload,
+ icmp6_hdr* icmp_header,
+ OutputInterface* output) {
return ProcessingResult::OK;
}
@@ -128,8 +127,7 @@ QbonePacketProcessor::ProcessIPv6HeaderAndFilter(std::string* packet,
result = filter_->FilterPacket(
direction, *packet,
- quiche::QuicheStringPiece(*transport_data,
- packet->size() - header_size),
+ absl::string_view(*transport_data, packet->size() - header_size),
icmp_header, output_);
}
@@ -237,32 +235,29 @@ QbonePacketProcessor::ProcessingResult QbonePacketProcessor::ProcessIPv6Header(
return ProcessingResult::OK;
}
-void QbonePacketProcessor::SendIcmpResponse(
- icmp6_hdr* icmp_header,
- quiche::QuicheStringPiece original_packet,
- Direction original_direction) {
+void QbonePacketProcessor::SendIcmpResponse(icmp6_hdr* icmp_header,
+ absl::string_view original_packet,
+ Direction original_direction) {
in6_addr dst;
// TODO(b/70339814): ensure this is actually a unicast address.
memcpy(dst.s6_addr, &original_packet[8], kIPv6AddressSize);
- CreateIcmpPacket(
- self_ip_, dst, *icmp_header, original_packet,
- [this, original_direction](quiche::QuicheStringPiece packet) {
- SendResponse(original_direction, packet);
- });
+ CreateIcmpPacket(self_ip_, dst, *icmp_header, original_packet,
+ [this, original_direction](absl::string_view packet) {
+ SendResponse(original_direction, packet);
+ });
}
-void QbonePacketProcessor::SendTcpReset(
- quiche::QuicheStringPiece original_packet,
- Direction original_direction) {
- CreateTcpResetPacket(original_packet, [this, original_direction](
- quiche::QuicheStringPiece packet) {
- SendResponse(original_direction, packet);
- });
+void QbonePacketProcessor::SendTcpReset(absl::string_view original_packet,
+ Direction original_direction) {
+ CreateTcpResetPacket(original_packet,
+ [this, original_direction](absl::string_view packet) {
+ SendResponse(original_direction, packet);
+ });
}
void QbonePacketProcessor::SendResponse(Direction original_direction,
- quiche::QuicheStringPiece packet) {
+ absl::string_view packet) {
switch (original_direction) {
case Direction::FROM_OFF_NETWORK:
output_->SendPacketToClient(packet);
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.h
index 130770d3c67..bb5e8163f04 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor.h
@@ -8,9 +8,9 @@
#include <netinet/icmp6.h>
#include <netinet/ip6.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ip_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -52,8 +52,8 @@ class QbonePacketProcessor {
public:
virtual ~OutputInterface();
- virtual void SendPacketToClient(quiche::QuicheStringPiece packet) = 0;
- virtual void SendPacketToNetwork(quiche::QuicheStringPiece packet) = 0;
+ virtual void SendPacketToClient(absl::string_view packet) = 0;
+ virtual void SendPacketToNetwork(absl::string_view packet) = 0;
};
class StatsInterface {
@@ -94,8 +94,8 @@ class QbonePacketProcessor {
// Note that |output| should not be used except in the DEFER case, as the
// processor will perform the necessary writes itself.
virtual ProcessingResult FilterPacket(Direction direction,
- quiche::QuicheStringPiece full_packet,
- quiche::QuicheStringPiece payload,
+ absl::string_view full_packet,
+ absl::string_view payload,
icmp6_hdr* icmp_header,
OutputInterface* output);
@@ -104,19 +104,17 @@ class QbonePacketProcessor {
// for filtering from the |ipv6_header| argument. All of those assume that
// the header is of valid size, which is true for everything passed into
// FilterPacket().
- inline uint8_t TransportProtocolFromHeader(
- quiche::QuicheStringPiece ipv6_header) {
+ inline uint8_t TransportProtocolFromHeader(absl::string_view ipv6_header) {
return ipv6_header[6];
}
- inline QuicIpAddress SourceIpFromHeader(
- quiche::QuicheStringPiece ipv6_header) {
+ inline QuicIpAddress SourceIpFromHeader(absl::string_view ipv6_header) {
QuicIpAddress address;
address.FromPackedString(&ipv6_header[8],
QuicIpAddress::kIPv6AddressSize);
return address;
}
inline QuicIpAddress DestinationIpFromHeader(
- quiche::QuicheStringPiece ipv6_header) {
+ absl::string_view ipv6_header) {
QuicIpAddress address;
address.FromPackedString(&ipv6_header[24],
QuicIpAddress::kIPv6AddressSize);
@@ -167,10 +165,10 @@ class QbonePacketProcessor {
icmp6_hdr* icmp_header);
void SendIcmpResponse(icmp6_hdr* icmp_header,
- quiche::QuicheStringPiece original_packet,
+ absl::string_view original_packet,
Direction original_direction);
- void SendTcpReset(quiche::QuicheStringPiece original_packet,
+ void SendTcpReset(absl::string_view original_packet,
Direction original_direction);
inline bool IsValid() const { return client_ip_ != kInvalidIpAddress; }
@@ -194,8 +192,7 @@ class QbonePacketProcessor {
char** transport_data,
icmp6_hdr* icmp_header);
- void SendResponse(Direction original_direction,
- quiche::QuicheStringPiece packet);
+ void SendResponse(Direction original_direction, absl::string_view packet);
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test.cc
index 2820a7a1f70..569df911229 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test.cc
@@ -6,9 +6,9 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test_tools.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace {
@@ -101,15 +101,15 @@ static const char kReferenceClientSubnetPacketData[] = {
// clang-format on
-static const quiche::QuicheStringPiece kReferenceClientPacket(
+static const absl::string_view kReferenceClientPacket(
kReferenceClientPacketData,
arraysize(kReferenceClientPacketData));
-static const quiche::QuicheStringPiece kReferenceNetworkPacket(
+static const absl::string_view kReferenceNetworkPacket(
kReferenceNetworkPacketData,
arraysize(kReferenceNetworkPacketData));
-static const quiche::QuicheStringPiece kReferenceClientSubnetPacket(
+static const absl::string_view kReferenceClientSubnetPacket(
kReferenceClientSubnetPacketData,
arraysize(kReferenceClientSubnetPacketData));
@@ -128,8 +128,8 @@ class MockPacketFilter : public QbonePacketProcessor::Filter {
MOCK_METHOD(ProcessingResult,
FilterPacket,
(Direction,
- quiche::QuicheStringPiece,
- quiche::QuicheStringPiece,
+ absl::string_view,
+ absl::string_view,
icmp6_hdr*,
OutputInterface*),
(override));
@@ -147,12 +147,12 @@ class QbonePacketProcessorTest : public QuicTest {
&stats_);
}
- void SendPacketFromClient(quiche::QuicheStringPiece packet) {
+ void SendPacketFromClient(absl::string_view packet) {
std::string packet_buffer(packet.data(), packet.size());
processor_->ProcessPacket(&packet_buffer, Direction::FROM_OFF_NETWORK);
}
- void SendPacketFromNetwork(quiche::QuicheStringPiece packet) {
+ void SendPacketFromNetwork(absl::string_view packet) {
std::string packet_buffer(packet.data(), packet.size());
processor_->ProcessPacket(&packet_buffer, Direction::FROM_NETWORK);
}
@@ -249,8 +249,8 @@ class TestFilter : public QbonePacketProcessor::Filter {
TestFilter(QuicIpAddress client_ip, QuicIpAddress network_ip)
: client_ip_(client_ip), network_ip_(network_ip) {}
ProcessingResult FilterPacket(Direction direction,
- quiche::QuicheStringPiece full_packet,
- quiche::QuicheStringPiece payload,
+ absl::string_view full_packet,
+ absl::string_view payload,
icmp6_hdr* icmp_header,
OutputInterface* output) override {
EXPECT_EQ(kIPv6HeaderSize, full_packet.size() - payload.size());
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test_tools.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test_tools.h
index 72030506399..8384821882d 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test_tools.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_packet_processor_test_tools.h
@@ -5,9 +5,9 @@
#ifndef QUICHE_QUIC_QBONE_QBONE_PACKET_PROCESSOR_TEST_TOOLS_H_
#define QUICHE_QUIC_QBONE_QBONE_PACKET_PROCESSOR_TEST_TOOLS_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_packet_processor.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -15,14 +15,8 @@ class MockPacketProcessorOutput : public QbonePacketProcessor::OutputInterface {
public:
MockPacketProcessorOutput() {}
- MOCK_METHOD(void,
- SendPacketToClient,
- (quiche::QuicheStringPiece),
- (override));
- MOCK_METHOD(void,
- SendPacketToNetwork,
- (quiche::QuicheStringPiece),
- (override));
+ MOCK_METHOD(void, SendPacketToClient, (absl::string_view), (override));
+ MOCK_METHOD(void, SendPacketToNetwork, (absl::string_view), (override));
};
class MockPacketProcessorStats : public QbonePacketProcessor::StatsInterface {
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.cc
index 6561f57c24a..7f83381c875 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.cc
@@ -6,11 +6,11 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_constants.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -20,7 +20,7 @@ bool QboneCryptoServerStreamHelper::CanAcceptClientHello(
const QuicSocketAddress& peer_address,
const QuicSocketAddress& self_address,
std::string* error_details) const {
- quiche::QuicheStringPiece alpn;
+ absl::string_view alpn;
chlo.GetStringPiece(quic::kALPN, &alpn);
if (alpn != QboneConstants::kQboneAlpn) {
*error_details = "ALPN-indicated protocol is not qbone";
@@ -72,25 +72,23 @@ bool QboneServerSession::SendClientRequest(const QboneClientRequest& request) {
return control_stream_->SendRequest(request);
}
-void QboneServerSession::ProcessPacketFromNetwork(
- quiche::QuicheStringPiece packet) {
+void QboneServerSession::ProcessPacketFromNetwork(absl::string_view packet) {
std::string buffer = std::string(packet);
processor_.ProcessPacket(&buffer,
QbonePacketProcessor::Direction::FROM_NETWORK);
}
-void QboneServerSession::ProcessPacketFromPeer(
- quiche::QuicheStringPiece packet) {
+void QboneServerSession::ProcessPacketFromPeer(absl::string_view packet) {
std::string buffer = std::string(packet);
processor_.ProcessPacket(&buffer,
QbonePacketProcessor::Direction::FROM_OFF_NETWORK);
}
-void QboneServerSession::SendPacketToClient(quiche::QuicheStringPiece packet) {
+void QboneServerSession::SendPacketToClient(absl::string_view packet) {
SendPacketToPeer(packet);
}
-void QboneServerSession::SendPacketToNetwork(quiche::QuicheStringPiece packet) {
+void QboneServerSession::SendPacketToNetwork(absl::string_view packet) {
DCHECK(writer_ != nullptr);
writer_->WritePacketToNetwork(packet.data(), packet.size());
}
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.h
index fee1c743784..63a0d8d954c 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_server_session.h
@@ -5,6 +5,7 @@
#ifndef QUICHE_QUIC_QBONE_QBONE_SERVER_SESSION_H_
#define QUICHE_QUIC_QBONE_QBONE_SERVER_SESSION_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_server_stream_base.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
@@ -13,7 +14,6 @@
#include "net/third_party/quiche/src/quic/qbone/qbone_packet_processor.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_packet_writer.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_session_base.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -53,12 +53,12 @@ class QUIC_EXPORT_PRIVATE QboneServerSession
virtual bool SendClientRequest(const QboneClientRequest& request);
- void ProcessPacketFromNetwork(quiche::QuicheStringPiece packet) override;
- void ProcessPacketFromPeer(quiche::QuicheStringPiece packet) override;
+ void ProcessPacketFromNetwork(absl::string_view packet) override;
+ void ProcessPacketFromPeer(absl::string_view packet) override;
// QbonePacketProcessor::OutputInterface implementation.
- void SendPacketToClient(quiche::QuicheStringPiece packet) override;
- void SendPacketToNetwork(quiche::QuicheStringPiece packet) override;
+ void SendPacketToClient(absl::string_view packet) override;
+ void SendPacketToNetwork(absl::string_view packet) override;
// QbonePacketProcessor::StatsInterface implementation.
void OnPacketForwarded(QbonePacketProcessor::Direction direction) override {}
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.cc
index e534398e7b3..d2d2ab4a24b 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.cc
@@ -9,6 +9,7 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
@@ -16,7 +17,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/qbone/platform/icmp_packet.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_constants.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
ABSL_FLAG(
bool,
@@ -79,7 +79,7 @@ void QboneSessionBase::OnStreamFrame(const QuicStreamFrame& frame) {
if (frame.offset == 0 && frame.fin && frame.data_length > 0) {
++num_ephemeral_packets_;
ProcessPacketFromPeer(
- quiche::QuicheStringPiece(frame.data_buffer, frame.data_length));
+ absl::string_view(frame.data_buffer, frame.data_length));
flow_controller()->AddBytesConsumed(frame.data_length);
// TODO(b/147817422): Add a counter for how many streams were actually
// closed here.
@@ -91,7 +91,7 @@ void QboneSessionBase::OnStreamFrame(const QuicStreamFrame& frame) {
QuicSession::OnStreamFrame(frame);
}
-void QboneSessionBase::OnMessageReceived(quiche::QuicheStringPiece message) {
+void QboneSessionBase::OnMessageReceived(absl::string_view message) {
++num_message_packets_;
ProcessPacketFromPeer(message);
}
@@ -136,7 +136,7 @@ QuicStream* QboneSessionBase::ActivateDataStream(
return raw;
}
-void QboneSessionBase::SendPacketToPeer(quiche::QuicheStringPiece packet) {
+void QboneSessionBase::SendPacketToPeer(absl::string_view packet) {
if (crypto_stream_ == nullptr) {
QUIC_BUG << "Attempting to send packet before encryption established";
return;
@@ -162,7 +162,7 @@ void QboneSessionBase::SendPacketToPeer(quiche::QuicheStringPiece packet) {
connection()->GetGuaranteedLargestMessagePayload();
CreateIcmpPacket(header->ip6_dst, header->ip6_src, icmp_header, packet,
- [this](quiche::QuicheStringPiece icmp_packet) {
+ [this](absl::string_view icmp_packet) {
writer_->WritePacketToNetwork(icmp_packet.data(),
icmp_packet.size());
});
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.h
index 4b9513088c4..222999b4868 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_base.h
@@ -5,6 +5,7 @@
#ifndef QUICHE_QUIC_QBONE_QBONE_SESSION_BASE_H_
#define QUICHE_QUIC_QBONE_QBONE_SESSION_BASE_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_server_stream_base.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
@@ -13,7 +14,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_packet_writer.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -34,10 +34,10 @@ class QUIC_EXPORT_PRIVATE QboneSessionBase : public QuicSession {
// This will check if the packet is wholly contained.
void OnStreamFrame(const QuicStreamFrame& frame) override;
// Called whenever a MESSAGE frame is received.
- void OnMessageReceived(quiche::QuicheStringPiece message) override;
+ void OnMessageReceived(absl::string_view message) override;
- virtual void ProcessPacketFromNetwork(quiche::QuicheStringPiece packet) = 0;
- virtual void ProcessPacketFromPeer(quiche::QuicheStringPiece packet) = 0;
+ virtual void ProcessPacketFromNetwork(absl::string_view packet) = 0;
+ virtual void ProcessPacketFromPeer(absl::string_view packet) = 0;
// Returns the number of QBONE network packets that were received
// that fit into a single QuicStreamFrame and elided the creation of
@@ -86,7 +86,7 @@ class QUIC_EXPORT_PRIVATE QboneSessionBase : public QuicSession {
// packet. This function will return true if a stream was created
// and the packet sent. It will return false if the stream could not
// be created.
- void SendPacketToPeer(quiche::QuicheStringPiece packet);
+ void SendPacketToPeer(absl::string_view packet);
QbonePacketWriter* writer_;
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_test.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_test.cc
index 243a5c535d5..505927421bd 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_session_test.cc
@@ -4,6 +4,7 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/proto/crypto_server_config_proto.h"
#include "net/third_party/quiche/src/quic/core/quic_alarm_factory.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_alarm_factory.h"
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_session_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -77,7 +77,7 @@ class IndirectionProofSource : public ProofSource {
const std::string& hostname,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<Callback> callback) override {
if (!proof_source_) {
QuicReferenceCountedPointer<ProofSource::Chain> chain =
@@ -107,7 +107,7 @@ class IndirectionProofSource : public ProofSource {
const QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<SignatureCallback> callback) override {
if (!proof_source_) {
callback->Run(/*ok=*/true, "Signature", /*details=*/nullptr);
@@ -141,7 +141,7 @@ class IndirectionProofVerifier : public ProofVerifier {
const uint16_t port,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -167,13 +167,14 @@ class IndirectionProofVerifier : public ProofVerifier {
const ProofVerifyContext* context,
std::string* error_details,
std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
std::unique_ptr<ProofVerifierCallback> callback) override {
if (!proof_verifier_) {
return QUIC_FAILURE;
}
return proof_verifier_->VerifyCertChain(
hostname, port, certs, ocsp_response, cert_sct, context, error_details,
- details, std::move(callback));
+ details, out_alert, std::move(callback));
}
std::unique_ptr<ProofVerifyContext> CreateDefaultContext() override {
@@ -318,9 +319,9 @@ class QboneSessionTest : public QuicTestWithParam<ParsedQuicVersion> {
{
client_connection_ = new QuicConnection(
- TestConnectionId(), server_address, &helper_, alarm_factory_.get(),
- new NiceMock<MockPacketWriter>(), true, Perspective::IS_CLIENT,
- supported_versions_);
+ TestConnectionId(), client_address, server_address, &helper_,
+ alarm_factory_.get(), new NiceMock<MockPacketWriter>(), true,
+ Perspective::IS_CLIENT, supported_versions_);
client_connection_->SetSelfAddress(client_address);
QuicConfig config;
client_crypto_config_ = std::make_unique<QuicCryptoClientConfig>(
@@ -337,9 +338,9 @@ class QboneSessionTest : public QuicTestWithParam<ParsedQuicVersion> {
{
server_connection_ = new QuicConnection(
- TestConnectionId(), client_address, &helper_, alarm_factory_.get(),
- new NiceMock<MockPacketWriter>(), true, Perspective::IS_SERVER,
- supported_versions_);
+ TestConnectionId(), server_address, client_address, &helper_,
+ alarm_factory_.get(), new NiceMock<MockPacketWriter>(), true,
+ Perspective::IS_SERVER, supported_versions_);
server_connection_->SetSelfAddress(server_address);
QuicConfig config;
server_crypto_config_ = std::make_unique<QuicCryptoServerConfig>(
@@ -416,7 +417,7 @@ class QboneSessionTest : public QuicTestWithParam<ParsedQuicVersion> {
std::string expected;
CreateIcmpPacket(header->ip6_dst, header->ip6_src, icmp_header, packet,
- [&expected](quiche::QuicheStringPiece icmp_packet) {
+ [&expected](absl::string_view icmp_packet) {
expected = std::string(icmp_packet);
});
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.cc
index 4d1888928f6..db499bab55a 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.cc
@@ -4,12 +4,12 @@
#include "net/third_party/quiche/src/quic/qbone/qbone_stream.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_data_reader.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_constants.h"
#include "net/third_party/quiche/src/quic/qbone/qbone_session_base.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
ABSL_FLAG(int, qbone_stream_ttl_secs, 3, "The QBONE Stream TTL in seconds.");
@@ -24,8 +24,7 @@ QboneWriteOnlyStream::QboneWriteOnlyStream(QuicStreamId id,
QuicTime::Delta::FromSeconds(GetQuicFlag(FLAGS_qbone_stream_ttl_secs)));
}
-void QboneWriteOnlyStream::WritePacketToQuicStream(
- quiche::QuicheStringPiece packet) {
+void QboneWriteOnlyStream::WritePacketToQuicStream(absl::string_view packet) {
// Streams are one way and ephemeral. This function should only be
// called once.
WriteOrBufferData(packet, /* fin= */ true, nullptr);
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.h b/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.h
index 8a6313bc0c2..c27a91ab702 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream.h
@@ -5,10 +5,10 @@
#ifndef QUICHE_QUIC_QBONE_QBONE_STREAM_H_
#define QUICHE_QUIC_QBONE_QBONE_STREAM_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
#include "net/third_party/quiche/src/quic/core/quic_stream.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -26,7 +26,7 @@ class QUIC_EXPORT_PRIVATE QboneWriteOnlyStream : public QuicStream {
void OnDataAvailable() override {}
// Write a network packet over the quic stream.
- void WritePacketToQuicStream(quiche::QuicheStringPiece packet);
+ void WritePacketToQuicStream(absl::string_view packet);
};
// QboneReadOnlyStream will be used if we find an incoming stream that
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream_test.cc b/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream_test.cc
index cfe9645c1d4..18f48f7331b 100644
--- a/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/qbone/qbone_stream_test.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
#include "net/third_party/quiche/src/quic/core/quic_simple_buffer_allocator.h"
@@ -16,7 +17,6 @@
#include "net/third_party/quiche/src/quic/qbone/qbone_session_base.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
namespace quic {
@@ -40,13 +40,12 @@ class MockQuicSession : public QboneSessionBase {
~MockQuicSession() override {}
// Writes outgoing data from QuicStream to a string.
- QuicConsumedData WritevData(
- QuicStreamId id,
- size_t write_length,
- QuicStreamOffset offset,
- StreamSendingState state,
- TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level) override {
+ QuicConsumedData WritevData(QuicStreamId id,
+ size_t write_length,
+ QuicStreamOffset offset,
+ StreamSendingState state,
+ TransmissionType type,
+ absl::optional<EncryptionLevel> level) override {
if (!writable_) {
return QuicConsumedData(0, false);
}
@@ -58,14 +57,21 @@ class MockQuicSession : public QboneSessionBase {
return nullptr;
}
- const QuicCryptoStream* GetCryptoStream() const override { return nullptr; }
- QuicCryptoStream* GetMutableCryptoStream() override { return nullptr; }
-
// Called by QuicStream when they want to close stream.
MOCK_METHOD(void,
SendRstStream,
(QuicStreamId, QuicRstStreamErrorCode, QuicStreamOffset, bool),
(override));
+ MOCK_METHOD(void,
+ MaybeSendRstStreamFrame,
+ (QuicStreamId stream_id,
+ QuicRstStreamErrorCode error,
+ QuicStreamOffset bytes_written),
+ (override));
+ MOCK_METHOD(void,
+ MaybeSendStopSendingFrame,
+ (QuicStreamId stream_id, QuicRstStreamErrorCode error),
+ (override));
// Sets whether data is written to buffer, or else if this is write blocked.
void set_writable(bool writable) { writable_ = writable; }
@@ -86,17 +92,11 @@ class MockQuicSession : public QboneSessionBase {
}
std::unique_ptr<QuicCryptoStream> CreateCryptoStream() override {
- return nullptr;
+ return std::make_unique<test::MockQuicCryptoStream>(this);
}
- MOCK_METHOD(void,
- ProcessPacketFromPeer,
- (quiche::QuicheStringPiece),
- (override));
- MOCK_METHOD(void,
- ProcessPacketFromNetwork,
- (quiche::QuicheStringPiece),
- (override));
+ MOCK_METHOD(void, ProcessPacketFromPeer, (absl::string_view), (override));
+ MOCK_METHOD(void, ProcessPacketFromNetwork, (absl::string_view), (override));
private:
// Whether data is written to write_buffer_.
@@ -152,12 +152,14 @@ class QboneReadOnlyStreamTest : public ::testing::Test,
connection_.reset(new QuicConnection(
test::TestConnectionId(0), QuicSocketAddress(TestLoopback(), 0),
+ QuicSocketAddress(TestLoopback(), 0),
this /*QuicConnectionHelperInterface*/, alarm_factory_.get(),
new DummyPacketWriter(), owns_writer, perspective,
ParsedVersionOfIndex(CurrentSupportedVersions(), 0)));
clock_.AdvanceTime(QuicTime::Delta::FromSeconds(1));
session_ = std::make_unique<StrictMock<MockQuicSession>>(connection_.get(),
QuicConfig());
+ session_->Initialize();
stream_ = new QboneReadOnlyStream(kStreamId, session_.get());
session_->ActivateReliableStream(
std::unique_ptr<QboneReadOnlyStream>(stream_));
@@ -243,8 +245,15 @@ TEST_F(QboneReadOnlyStreamTest, ReadBufferedTooLarge) {
CreateReliableQuicStream();
std::string packet = "0123456789";
int iterations = (QboneConstants::kMaxQbonePacketBytes / packet.size()) + 2;
- EXPECT_CALL(*session_,
- SendRstStream(kStreamId, QUIC_BAD_APPLICATION_PAYLOAD, _, _));
+ if (!session_->split_up_send_rst()) {
+ EXPECT_CALL(*session_,
+ SendRstStream(kStreamId, QUIC_BAD_APPLICATION_PAYLOAD, _, _));
+ } else {
+ EXPECT_CALL(*session_, MaybeSendStopSendingFrame(
+ kStreamId, QUIC_BAD_APPLICATION_PAYLOAD));
+ EXPECT_CALL(*session_, MaybeSendRstStreamFrame(
+ kStreamId, QUIC_BAD_APPLICATION_PAYLOAD, _));
+ }
for (int i = 0; i < iterations; ++i) {
QuicStreamFrame frame(kStreamId, i == (iterations - 1), i * packet.size(),
packet);
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.cc
index 4d5da07bff3..f38d6b3462b 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.cc
@@ -10,6 +10,7 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
#include "net/third_party/quiche/src/quic/core/quic_constants.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_client_stream.h"
@@ -22,7 +23,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_protocol.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -53,8 +53,7 @@ QuicTransportClientSession::QuicTransportClientSession(
/*proof_handler=*/this, /*has_application_state = */ true);
}
-void QuicTransportClientSession::OnAlpnSelected(
- quiche::QuicheStringPiece alpn) {
+void QuicTransportClientSession::OnAlpnSelected(absl::string_view alpn) {
// Defense in-depth: ensure the ALPN selected is the desired one.
if (alpn != QuicTransportAlpn()) {
QUIC_BUG << "QuicTransport negotiated non-QuicTransport ALPN: " << alpn;
@@ -237,8 +236,7 @@ void QuicTransportClientSession::SendClientIndication() {
visitor_->OnSessionReady();
}
-void QuicTransportClientSession::OnMessageReceived(
- quiche::QuicheStringPiece message) {
+void QuicTransportClientSession::OnMessageReceived(absl::string_view message) {
visitor_->OnDatagramReceived(message);
}
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.h b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.h
index 6fe26195127..c4f417fcbb8 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.h
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session.h
@@ -8,6 +8,7 @@
#include <cstdint>
#include <memory>
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h"
@@ -24,7 +25,6 @@
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_protocol.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_session_interface.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -49,7 +49,7 @@ class QUIC_EXPORT_PRIVATE QuicTransportClientSession
virtual void OnIncomingUnidirectionalStreamAvailable() = 0;
// Notifies the visitor when a new datagram has been received.
- virtual void OnDatagramReceived(quiche::QuicheStringPiece datagram) = 0;
+ virtual void OnDatagramReceived(absl::string_view datagram) = 0;
// Notifies the visitor that a new outgoing stream can now be created.
virtual void OnCanCreateNewOutgoingBidirectionalStream() = 0;
@@ -68,7 +68,7 @@ class QUIC_EXPORT_PRIVATE QuicTransportClientSession
std::vector<std::string> GetAlpnsToOffer() const override {
return std::vector<std::string>({QuicTransportAlpn()});
}
- void OnAlpnSelected(quiche::QuicheStringPiece alpn) override;
+ void OnAlpnSelected(absl::string_view alpn) override;
bool alpn_received() const { return alpn_received_; }
void CryptoConnect() { crypto_stream_->CryptoConnect(); }
@@ -97,7 +97,7 @@ class QUIC_EXPORT_PRIVATE QuicTransportClientSession
void SetDefaultEncryptionLevel(EncryptionLevel level) override;
void OnTlsHandshakeComplete() override;
- void OnMessageReceived(quiche::QuicheStringPiece message) override;
+ void OnMessageReceived(absl::string_view message) override;
// Return the earliest incoming stream that has been received by the session
// but has not been accepted. Returns nullptr if there are no incoming
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session_test.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session_test.cc
index fe855765940..129c87ee662 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_client_session_test.cc
@@ -7,6 +7,7 @@
#include <memory>
#include <utility>
+#include "absl/base/macros.h"
#include "url/gurl.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
@@ -19,7 +20,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -116,7 +116,7 @@ TEST_F(QuicTransportClientSessionTest, SuccessfulConnection) {
const std::string client_indication = DataInStream(client_indication_stream);
const std::string expected_client_indication{
kTestOriginClientIndication,
- QUICHE_ARRAYSIZE(kTestOriginClientIndication) - 1};
+ ABSL_ARRAYSIZE(kTestOriginClientIndication) - 1};
EXPECT_EQ(client_indication, expected_client_indication);
}
@@ -142,7 +142,7 @@ TEST_F(QuicTransportClientSessionTest, SuccessfulConnectionWithPath) {
const std::string client_indication = DataInStream(client_indication_stream);
const std::string expected_client_indication{
kTestOriginClientIndication,
- QUICHE_ARRAYSIZE(kTestOriginClientIndication) - 1};
+ ABSL_ARRAYSIZE(kTestOriginClientIndication) - 1};
EXPECT_EQ(client_indication, expected_client_indication);
}
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_integration_test.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_integration_test.cc
index f1912e2f33c..1965c6d56e2 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_integration_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_integration_test.cc
@@ -8,6 +8,7 @@
#include <memory>
#include <vector>
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_client_config.h"
@@ -31,7 +32,6 @@
#include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h"
#include "net/third_party/quiche/src/quic/test_tools/simulator/switch.h"
#include "net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -62,8 +62,9 @@ class QuicTransportEndpointBase : public QuicEndpointBase {
: QuicEndpointBase(simulator, name, peer_name) {
QuicEnableVersion(DefaultVersionForQuicTransport());
connection_ = std::make_unique<QuicConnection>(
- TestConnectionId(0x10), simulator::GetAddressFromName(peer_name),
- simulator, simulator->GetAlarmFactory(), &writer_,
+ TestConnectionId(0x10), simulator::GetAddressFromName(name),
+ simulator::GetAddressFromName(peer_name), simulator,
+ simulator->GetAlarmFactory(), &writer_,
/*owns_writer=*/false, perspective, GetVersions());
connection_->SetSelfAddress(simulator::GetAddressFromName(name));
}
@@ -376,7 +377,7 @@ TEST_F(QuicTransportIntegrationTest, EchoALotOfDatagrams) {
size_t received = 0;
EXPECT_CALL(*client_->visitor(), OnDatagramReceived(_))
.WillRepeatedly(
- [&received](quiche::QuicheStringPiece /*datagram*/) { received++; });
+ [&received](absl::string_view /*datagram*/) { received++; });
ASSERT_TRUE(simulator_.RunUntilOrTimeout(
[this]() { return client_->session()->datagram_queue()->empty(); },
3 * kServerBandwidth.TransferTime(1000 * kMaxOutgoingPacketSize)));
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.cc
index c2de6590b0e..083e6fcd315 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.cc
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
#include "url/url_constants.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
@@ -16,7 +17,6 @@
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_protocol.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -109,7 +109,7 @@ bool QuicTransportServerSession::ClientIndicationParser::Parse() {
return false;
}
- quiche::QuicheStringPiece value;
+ absl::string_view value;
if (!reader_.ReadStringPiece16(&value)) {
ParseError(quiche::QuicheStrCat("Failed to read value for key ", key));
return false;
@@ -160,7 +160,7 @@ bool QuicTransportServerSession::ClientIndicationParser::Parse() {
}
bool QuicTransportServerSession::ClientIndicationParser::ProcessPath(
- quiche::QuicheStringPiece path) {
+ absl::string_view path) {
if (path.empty() || path[0] != '/') {
// https://tools.ietf.org/html/draft-vvv-webtransport-quic-01#section-3.2.2
Error("Path must begin with a '/'");
@@ -193,13 +193,13 @@ void QuicTransportServerSession::ClientIndicationParser::Error(
}
void QuicTransportServerSession::ClientIndicationParser::ParseError(
- quiche::QuicheStringPiece error_message) {
+ absl::string_view error_message) {
Error(quiche::QuicheStrCat("Failed to parse the client indication stream: ",
error_message, reader_.DebugString()));
}
void QuicTransportServerSession::ProcessClientIndication(
- quiche::QuicheStringPiece indication) {
+ absl::string_view indication) {
ClientIndicationParser parser(this, indication);
if (!parser.Parse()) {
return;
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.h b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.h
index 1b9dda03538..4085998003d 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.h
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session.h
@@ -5,6 +5,7 @@
#ifndef QUICHE_QUIC_QUIC_TRANSPORT_QUIC_TRANSPORT_SERVER_SESSION_H_
#define QUICHE_QUIC_QUIC_TRANSPORT_QUIC_TRANSPORT_SERVER_SESSION_H_
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
@@ -13,7 +14,6 @@
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_protocol.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_session_interface.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -44,8 +44,8 @@ class QUIC_EXPORT_PRIVATE QuicTransportServerSession
QuicCompressedCertsCache* compressed_certs_cache,
ServerVisitor* visitor);
- std::vector<quiche::QuicheStringPiece>::const_iterator SelectAlpn(
- const std::vector<quiche::QuicheStringPiece>& alpns) const override {
+ std::vector<absl::string_view>::const_iterator SelectAlpn(
+ const std::vector<absl::string_view>& alpns) const override {
return std::find(alpns.cbegin(), alpns.cend(), QuicTransportAlpn());
}
@@ -86,7 +86,7 @@ class QUIC_EXPORT_PRIVATE QuicTransportServerSession
class QUIC_EXPORT_PRIVATE ClientIndicationParser {
public:
ClientIndicationParser(QuicTransportServerSession* session,
- quiche::QuicheStringPiece indication)
+ absl::string_view indication)
: session_(session), reader_(indication) {}
// Parses the specified indication. Automatically closes the connection
@@ -96,10 +96,10 @@ class QUIC_EXPORT_PRIVATE QuicTransportServerSession
private:
void Error(const std::string& error_message);
- void ParseError(quiche::QuicheStringPiece error_message);
+ void ParseError(absl::string_view error_message);
// Processes the path portion of the client indication.
- bool ProcessPath(quiche::QuicheStringPiece path);
+ bool ProcessPath(absl::string_view path);
QuicTransportServerSession* session_;
QuicDataReader reader_;
@@ -107,7 +107,7 @@ class QUIC_EXPORT_PRIVATE QuicTransportServerSession
// Parses and processes the client indication as described in
// https://vasilvv.github.io/webtransport/draft-vvv-webtransport-quic.html#rfc.section.3.2
- void ProcessClientIndication(quiche::QuicheStringPiece indication);
+ void ProcessClientIndication(absl::string_view indication);
virtual void OnIncomingDataStream(QuicTransportStream* /*stream*/) {}
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session_test.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session_test.cc
index 8176b03d156..c4e40d5f1b5 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_server_session_test.cc
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_compressed_certs_cache.h"
@@ -20,7 +21,6 @@
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -88,7 +88,7 @@ class QuicTransportServerSessionTest : public QuicTest {
QuicServerId("test.example.com", 443), options, QuicTransportAlpn());
}
- void ReceiveIndication(quiche::QuicheStringPiece indication) {
+ void ReceiveIndication(absl::string_view indication) {
QUIC_LOG(INFO) << "Receiving indication: "
<< quiche::QuicheTextUtils::HexDump(indication);
constexpr size_t kChunkSize = 1024;
@@ -101,10 +101,10 @@ class QuicTransportServerSessionTest : public QuicTest {
}
session_->OnStreamFrame(QuicStreamFrame(ClientIndicationStream(),
/*fin=*/true, indication.size(),
- quiche::QuicheStringPiece()));
+ absl::string_view()));
}
- void ReceiveIndicationWithPath(quiche::QuicheStringPiece path) {
+ void ReceiveIndicationWithPath(absl::string_view path) {
constexpr char kTestOriginClientIndicationPrefix[] =
"\0\0" // key (0x0000, origin)
"\0\x18" // length
@@ -149,14 +149,14 @@ TEST_F(QuicTransportServerSessionTest, PiecewiseClientIndication) {
for (; i < sizeof(kTestOriginClientIndication) - 2; i++) {
QuicStreamFrame frame(
ClientIndicationStream(), false, i,
- quiche::QuicheStringPiece(&kTestOriginClientIndication[i], 1));
+ absl::string_view(&kTestOriginClientIndication[i], 1));
session_->OnStreamFrame(frame);
}
EXPECT_CALL(visitor_, CheckOrigin(_)).WillOnce(Return(true));
QuicStreamFrame last_frame(
ClientIndicationStream(), true, i,
- quiche::QuicheStringPiece(&kTestOriginClientIndication[i], 1));
+ absl::string_view(&kTestOriginClientIndication[i], 1));
session_->OnStreamFrame(last_frame);
EXPECT_TRUE(session_->IsSessionReady());
}
@@ -170,7 +170,7 @@ TEST_F(QuicTransportServerSessionTest, OriginRejected) {
EXPECT_FALSE(session_->IsSessionReady());
}
-std::string MakeUnknownField(quiche::QuicheStringPiece payload) {
+std::string MakeUnknownField(absl::string_view payload) {
std::string buffer;
buffer.resize(payload.size() + 4);
QuicDataWriter writer(buffer.size(), &buffer[0]);
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.cc
index 0fb988aed37..38614e185a0 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.cc
@@ -6,11 +6,11 @@
#include <sys/types.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -52,7 +52,7 @@ size_t QuicTransportStream::Read(std::string* output) {
return bytes_read;
}
-bool QuicTransportStream::Write(quiche::QuicheStringPiece data) {
+bool QuicTransportStream::Write(absl::string_view data) {
if (!CanWrite()) {
return false;
}
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h
index f2bac887a40..dfe943f67d3 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream.h
@@ -8,12 +8,12 @@
#include <cstddef>
#include <memory>
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_session.h"
#include "net/third_party/quiche/src/quic/core/quic_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
#include "net/third_party/quiche/src/quic/quic_transport/quic_transport_session_interface.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -40,9 +40,9 @@ class QUIC_EXPORT_PRIVATE QuicTransportStream : public QuicStream {
// Reads all available data and appends it to the end of |output|.
size_t Read(std::string* output);
// Writes |data| into the stream. Returns true on success.
- QUIC_MUST_USE_RESULT bool Write(quiche::QuicheStringPiece data);
+ ABSL_MUST_USE_RESULT bool Write(absl::string_view data);
// Sends the FIN on the stream. Returns true on success.
- QUIC_MUST_USE_RESULT bool SendFin();
+ ABSL_MUST_USE_RESULT bool SendFin();
// Indicates whether it is possible to write into stream right now.
bool CanWrite() const;
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream_test.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream_test.cc
index 0f0d770ecc5..82cd9149f7f 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/quic_transport_stream_test.cc
@@ -6,6 +6,8 @@
#include <memory>
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/frames/quic_window_update_frame.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
@@ -14,7 +16,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_config_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -42,7 +43,9 @@ class QuicTransportStreamTest : public QuicTest {
session_(connection_) {
QuicEnableVersion(DefaultVersionForQuicTransport());
session_.Initialize();
-
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
stream_ = new QuicTransportStream(0, &session_, &interface_);
session_.ActivateStream(QuicWrapUnique(stream_));
@@ -51,8 +54,7 @@ class QuicTransportStreamTest : public QuicTest {
stream_->set_visitor(std::move(visitor));
}
- void ReceiveStreamData(quiche::QuicheStringPiece data,
- QuicStreamOffset offset) {
+ void ReceiveStreamData(absl::string_view data, QuicStreamOffset offset) {
QuicStreamFrame frame(0, false, offset, data);
stream_->OnStreamFrame(frame);
}
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.cc
index 81466de1240..5932b9c6b2b 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.cc
@@ -7,13 +7,13 @@
#include <cstdint>
#include <memory>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
#include "net/third_party/quiche/src/quic/core/crypto/certificate_view.h"
#include "net/third_party/quiche/src/quic/core/quic_time.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -39,7 +39,7 @@ void NormalizeFingerprint(CertificateFingerprint& fingerprint) {
constexpr char CertificateFingerprint::kSha256[];
-std::string ComputeSha256Fingerprint(quiche::QuicheStringPiece input) {
+std::string ComputeSha256Fingerprint(absl::string_view input) {
std::vector<uint8_t> raw_hash;
raw_hash.resize(SHA256_DIGEST_LENGTH);
SHA256(reinterpret_cast<const uint8_t*>(input.data()), input.size(),
@@ -114,7 +114,7 @@ QuicAsyncStatus WebTransportFingerprintProofVerifier::VerifyProof(
const uint16_t /*port*/,
const std::string& /*server_config*/,
QuicTransportVersion /*transport_version*/,
- quiche::QuicheStringPiece /*chlo_hash*/,
+ absl::string_view /*chlo_hash*/,
const std::vector<std::string>& /*certs*/,
const std::string& /*cert_sct*/,
const std::string& /*signature*/,
@@ -139,6 +139,7 @@ QuicAsyncStatus WebTransportFingerprintProofVerifier::VerifyCertChain(
const ProofVerifyContext* /*context*/,
std::string* error_details,
std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* /*out_alert*/,
std::unique_ptr<ProofVerifierCallback> /*callback*/) {
if (certs.empty()) {
*details = std::make_unique<Details>(Status::kInternalError);
@@ -185,7 +186,7 @@ WebTransportFingerprintProofVerifier::CreateDefaultContext() {
}
bool WebTransportFingerprintProofVerifier::HasKnownFingerprint(
- quiche::QuicheStringPiece der_certificate) {
+ absl::string_view der_certificate) {
// https://wicg.github.io/web-transport/#verify-a-certificate-fingerprint
const std::string fingerprint = ComputeSha256Fingerprint(der_certificate);
for (const CertificateFingerprint& reference : fingerprints_) {
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.h b/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.h
index 7e4358de60d..ad83788ecff 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.h
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier.h
@@ -7,10 +7,10 @@
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/certificate_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h"
#include "net/third_party/quiche/src/quic/core/quic_clock.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -30,7 +30,7 @@ struct QUIC_EXPORT_PRIVATE CertificateFingerprint {
// Computes a SHA-256 fingerprint of the specified input formatted in the same
// format as CertificateFingerprint::fingerprint would contain.
QUIC_EXPORT_PRIVATE std::string ComputeSha256Fingerprint(
- quiche::QuicheStringPiece input);
+ absl::string_view input);
// WebTransportFingerprintProofVerifier verifies the server leaf certificate
// against a supplied list of certificate fingerprints following the procedure
@@ -83,7 +83,7 @@ class QUIC_EXPORT_PRIVATE WebTransportFingerprintProofVerifier
const uint16_t port,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -100,11 +100,12 @@ class QUIC_EXPORT_PRIVATE WebTransportFingerprintProofVerifier
const ProofVerifyContext* context,
std::string* error_details,
std::unique_ptr<ProofVerifyDetails>* details,
+ uint8_t* out_alert,
std::unique_ptr<ProofVerifierCallback> callback) override;
std::unique_ptr<ProofVerifyContext> CreateDefaultContext() override;
private:
- bool HasKnownFingerprint(quiche::QuicheStringPiece der_certificate);
+ bool HasKnownFingerprint(absl::string_view der_certificate);
bool HasValidExpiry(const CertificateView& certificate);
bool IsWithinValidityPeriod(const CertificateView& certificate);
diff --git a/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier_test.cc b/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier_test.cc
index f9f27e5db69..a84a8a53497 100644
--- a/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/quic_transport/web_transport_fingerprint_proof_verifier_test.cc
@@ -6,11 +6,11 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
#include "net/third_party/quiche/src/quic/test_tools/test_certificates.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -37,15 +37,16 @@ class WebTransportFingerprintProofVerifierTest : public QuicTest {
}
protected:
- VerifyResult Verify(quiche::QuicheStringPiece certificate) {
+ VerifyResult Verify(absl::string_view certificate) {
VerifyResult result;
std::unique_ptr<ProofVerifyDetails> details;
+ uint8_t tls_alert;
result.status = verifier_->VerifyCertChain(
/*hostname=*/"", /*port=*/0,
std::vector<std::string>{std::string(certificate)},
/*ocsp_response=*/"",
/*cert_sct=*/"",
- /*context=*/nullptr, &result.error, &details,
+ /*context=*/nullptr, &result.error, &details, &tls_alert,
/*callback=*/nullptr);
result.detailed_status =
static_cast<WebTransportFingerprintProofVerifier::Details*>(
@@ -136,7 +137,7 @@ TEST_F(WebTransportFingerprintProofVerifierTest, MaxValidity) {
}
TEST_F(WebTransportFingerprintProofVerifierTest, InvalidCertificate) {
- constexpr quiche::QuicheStringPiece kInvalidCertificate = "Hello, world!";
+ constexpr absl::string_view kInvalidCertificate = "Hello, world!";
ASSERT_TRUE(verifier_->AddFingerprint(
{CertificateFingerprint::kSha256,
ComputeSha256Fingerprint(kInvalidCertificate)}));
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.cc b/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.cc
index eacbca5287c..00f7f1b4cd7 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.cc
@@ -9,6 +9,8 @@
#include <string>
#include <utility>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/bn.h"
#include "third_party/boringssl/src/include/openssl/ec.h"
#include "third_party/boringssl/src/include/openssl/ecdsa.h"
@@ -38,7 +40,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_quic_framer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/common/test_tools/quiche_test_utils.h"
@@ -182,15 +183,15 @@ class FullChloGenerator {
EXPECT_THAT(rej->tag(), testing::Eq(kREJ));
QUIC_VLOG(1) << "Extract valid STK and SCID from\n" << rej->DebugString();
- quiche::QuicheStringPiece srct;
+ absl::string_view srct;
ASSERT_TRUE(rej->GetStringPiece(kSourceAddressTokenTag, &srct));
- quiche::QuicheStringPiece scfg;
+ absl::string_view scfg;
ASSERT_TRUE(rej->GetStringPiece(kSCFG, &scfg));
std::unique_ptr<CryptoHandshakeMessage> server_config(
CryptoFramer::ParseMessage(scfg));
- quiche::QuicheStringPiece scid;
+ absl::string_view scid;
ASSERT_TRUE(server_config->GetStringPiece(kSCID, &scid));
*out_ = result_->client_hello;
@@ -257,10 +258,9 @@ int HandshakeWithFakeServer(QuicConfig* server_quic_config,
EXPECT_CALL(*server_conn, SendCryptoData(_, _, _))
.Times(testing::AnyNumber());
EXPECT_CALL(server_session, SelectAlpn(_))
- .WillRepeatedly(
- [alpn](const std::vector<quiche::QuicheStringPiece>& alpns) {
- return std::find(alpns.cbegin(), alpns.cend(), alpn);
- });
+ .WillRepeatedly([alpn](const std::vector<absl::string_view>& alpns) {
+ return std::find(alpns.cbegin(), alpns.cend(), alpn);
+ });
// The client's handshake must have been started already.
CHECK_NE(0u, client_conn->encrypted_packets_.size());
@@ -464,26 +464,23 @@ uint64_t LeafCertHashForTesting() {
class MockCommonCertSets : public CommonCertSets {
public:
- MockCommonCertSets(quiche::QuicheStringPiece cert,
- uint64_t hash,
- uint32_t index)
+ MockCommonCertSets(absl::string_view cert, uint64_t hash, uint32_t index)
: cert_(cert), hash_(hash), index_(index) {}
- quiche::QuicheStringPiece GetCommonHashes() const override {
+ absl::string_view GetCommonHashes() const override {
QUIC_BUG << "not implemented";
- return quiche::QuicheStringPiece();
+ return absl::string_view();
}
- quiche::QuicheStringPiece GetCert(uint64_t hash,
- uint32_t index) const override {
+ absl::string_view GetCert(uint64_t hash, uint32_t index) const override {
if (hash == hash_ && index == index_) {
return cert_;
}
- return quiche::QuicheStringPiece();
+ return absl::string_view();
}
- bool MatchCert(quiche::QuicheStringPiece cert,
- quiche::QuicheStringPiece common_set_hashes,
+ bool MatchCert(absl::string_view cert,
+ absl::string_view common_set_hashes,
uint64_t* out_hash,
uint32_t* out_index) const override {
if (cert != cert_) {
@@ -518,7 +515,7 @@ class MockCommonCertSets : public CommonCertSets {
const uint32_t index_;
};
-CommonCertSets* MockCommonCertSets(quiche::QuicheStringPiece cert,
+CommonCertSets* MockCommonCertSets(absl::string_view cert,
uint64_t hash,
uint32_t index) {
return new class MockCommonCertSets(cert, hash, index);
@@ -579,10 +576,10 @@ void CompareCrypters(const QuicEncrypter* encrypter,
<< decrypter << " for " << label;
return;
}
- quiche::QuicheStringPiece encrypter_key = encrypter->GetKey();
- quiche::QuicheStringPiece encrypter_iv = encrypter->GetNoncePrefix();
- quiche::QuicheStringPiece decrypter_key = decrypter->GetKey();
- quiche::QuicheStringPiece decrypter_iv = decrypter->GetNoncePrefix();
+ absl::string_view encrypter_key = encrypter->GetKey();
+ absl::string_view encrypter_iv = encrypter->GetNoncePrefix();
+ absl::string_view decrypter_key = decrypter->GetKey();
+ absl::string_view decrypter_iv = decrypter->GetNoncePrefix();
quiche::test::CompareCharArraysWithHexError(
label + " key", encrypter_key.data(), encrypter_key.length(),
decrypter_key.data(), decrypter_key.length());
@@ -626,9 +623,9 @@ void CompareClientAndServerKeys(QuicCryptoClientStream* client,
}
}
- quiche::QuicheStringPiece client_subkey_secret =
+ absl::string_view client_subkey_secret =
client->crypto_negotiated_params().subkey_secret;
- quiche::QuicheStringPiece server_subkey_secret =
+ absl::string_view server_subkey_secret =
server->crypto_negotiated_params().subkey_secret;
quiche::test::CompareCharArraysWithHexError(
"subkey secret", client_subkey_secret.data(),
@@ -708,8 +705,8 @@ CryptoHandshakeMessage CreateCHLO(
size_t value_len = value.length();
if (value_len > 0 && value[0] == '#') {
// This is ascii encoded hex.
- std::string hex_value = quiche::QuicheTextUtils::HexDecode(
- quiche::QuicheStringPiece(&value[1]));
+ std::string hex_value =
+ absl::HexStringToBytes(absl::string_view(&value[1]));
msg.SetStringPiece(quic_tag, hex_value);
continue;
}
@@ -798,7 +795,7 @@ void MovePackets(PacketSavingConnection* source_conn,
*inout_packet_index = index;
QuicConnectionPeer::SetCurrentPacket(dest_conn,
- quiche::QuicheStringPiece(nullptr, 0));
+ absl::string_view(nullptr, 0));
}
CryptoHandshakeMessage GenerateDefaultInchoateCHLO(
@@ -830,19 +827,19 @@ std::string GenerateClientNonceHex(const QuicClock* clock,
primary_config.set_primary_time(clock->WallNow().ToUNIXSeconds());
std::unique_ptr<CryptoHandshakeMessage> msg =
crypto_config->AddConfig(primary_config, clock->WallNow());
- quiche::QuicheStringPiece orbit;
+ absl::string_view orbit;
CHECK(msg->GetStringPiece(kORBT, &orbit));
std::string nonce;
CryptoUtils::GenerateNonce(clock->WallNow(), QuicRandom::GetInstance(), orbit,
&nonce);
- return ("#" + quiche::QuicheTextUtils::HexEncode(nonce));
+ return ("#" + absl::BytesToHexString(nonce));
}
std::string GenerateClientPublicValuesHex() {
char public_value[32];
memset(public_value, 42, sizeof(public_value));
- return ("#" + quiche::QuicheTextUtils::HexEncode(public_value,
- sizeof(public_value)));
+ return ("#" + absl::BytesToHexString(
+ absl::string_view(public_value, sizeof(public_value))));
}
void GenerateFullCHLO(
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h b/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h
index 3d58837a813..32d761fabe4 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h
@@ -11,12 +11,12 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -136,7 +136,7 @@ std::unique_ptr<ProofVerifyContext> ProofVerifyContextForTesting();
// MockCommonCertSets returns a CommonCertSets that contains a single set with
// hash |hash|, consisting of the certificate |cert| at index |index|.
-CommonCertSets* MockCommonCertSets(quiche::QuicheStringPiece cert,
+CommonCertSets* MockCommonCertSets(absl::string_view cert,
uint64_t hash,
uint32_t index);
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils_test.cc b/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils_test.cc
index a21b43ab109..0769da4efdd 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/crypto_test_utils_test.cc
@@ -6,11 +6,12 @@
#include <utility>
+#include "absl/strings/escaping.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/proto/crypto_server_config_proto.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -134,17 +135,17 @@ TEST_F(CryptoTestUtilsTest, TestGenerateFullCHLO) {
primary_config.set_primary_time(clock.WallNow().ToUNIXSeconds());
std::unique_ptr<CryptoHandshakeMessage> msg =
crypto_config.AddConfig(primary_config, clock.WallNow());
- quiche::QuicheStringPiece orbit;
+ absl::string_view orbit;
ASSERT_TRUE(msg->GetStringPiece(kORBT, &orbit));
std::string nonce;
CryptoUtils::GenerateNonce(clock.WallNow(), QuicRandom::GetInstance(), orbit,
&nonce);
- std::string nonce_hex = "#" + quiche::QuicheTextUtils::HexEncode(nonce);
+ std::string nonce_hex = "#" + absl::BytesToHexString(nonce);
char public_value[32];
memset(public_value, 42, sizeof(public_value));
- std::string pub_hex = "#" + quiche::QuicheTextUtils::HexEncode(
- public_value, sizeof(public_value));
+ std::string pub_hex = "#" + absl::BytesToHexString(absl::string_view(
+ public_value, sizeof(public_value)));
// The methods below use a PROTOCOL_QUIC_CRYPTO version so we pick the
// first one from the list of supported versions.
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.cc b/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.cc
index 98e18fcea13..576791c2b46 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.cc
@@ -4,7 +4,7 @@
#include "net/third_party/quiche/src/quic/test_tools/failing_proof_source.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
namespace quic {
namespace test {
@@ -14,7 +14,7 @@ void FailingProofSource::GetProof(const QuicSocketAddress& /*server_address*/,
const std::string& /*hostname*/,
const std::string& /*server_config*/,
QuicTransportVersion /*transport_version*/,
- quiche::QuicheStringPiece /*chlo_hash*/,
+ absl::string_view /*chlo_hash*/,
std::unique_ptr<Callback> callback) {
callback->Run(false, nullptr, QuicCryptoProof(), nullptr);
}
@@ -31,7 +31,7 @@ void FailingProofSource::ComputeTlsSignature(
const QuicSocketAddress& /*client_address*/,
const std::string& /*hostname*/,
uint16_t /*signature_algorithm*/,
- quiche::QuicheStringPiece /*in*/,
+ absl::string_view /*in*/,
std::unique_ptr<SignatureCallback> callback) {
callback->Run(false, "", nullptr);
}
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.h b/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.h
index 6ea303d1df8..b63a952dc1f 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/failing_proof_source.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_TEST_TOOLS_FAILING_PROOF_SOURCE_H_
#define QUICHE_QUIC_TEST_TOOLS_FAILING_PROOF_SOURCE_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -18,7 +18,7 @@ class FailingProofSource : public ProofSource {
const std::string& hostname,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<Callback> callback) override;
QuicReferenceCountedPointer<Chain> GetCertChain(
@@ -31,7 +31,7 @@ class FailingProofSource : public ProofSource {
const QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<SignatureCallback> callback) override;
TicketCrypter* GetTicketCrypter() override { return nullptr; }
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.cc b/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.cc
index 9619fad5523..00af20e01e2 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.cc
@@ -6,9 +6,9 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -52,7 +52,7 @@ FakeProofSource::ComputeSignatureOp::ComputeSignatureOp(
const QuicSocketAddress& client_address,
std::string hostname,
uint16_t sig_alg,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<ProofSource::SignatureCallback> callback,
ProofSource* delegate)
: server_address_(server_address),
@@ -80,7 +80,7 @@ void FakeProofSource::GetProof(
const std::string& hostname,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<ProofSource::Callback> callback) {
if (!active_) {
delegate_->GetProof(server_address, client_address, hostname, server_config,
@@ -106,7 +106,7 @@ void FakeProofSource::ComputeTlsSignature(
const QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<ProofSource::SignatureCallback> callback) {
QUIC_LOG(INFO) << "FakeProofSource::ComputeTlsSignature";
if (!active_) {
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.h b/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.h
index 94dede6b385..fc99974c32b 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/fake_proof_source.h
@@ -9,8 +9,8 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_source.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -39,7 +39,7 @@ class FakeProofSource : public ProofSource {
const std::string& hostname,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
std::unique_ptr<ProofSource::Callback> callback) override;
QuicReferenceCountedPointer<Chain> GetCertChain(
const QuicSocketAddress& server_address,
@@ -50,7 +50,7 @@ class FakeProofSource : public ProofSource {
const QuicSocketAddress& client_address,
const std::string& hostname,
uint16_t signature_algorithm,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<ProofSource::SignatureCallback> callback) override;
TicketCrypter* GetTicketCrypter() override;
@@ -107,7 +107,7 @@ class FakeProofSource : public ProofSource {
const QuicSocketAddress& client_address,
std::string hostname,
uint16_t sig_alg,
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<ProofSource::SignatureCallback> callback,
ProofSource* delegate);
~ComputeSignatureOp() override;
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/first_flight.cc b/chromium/net/third_party/quiche/src/quic/test_tools/first_flight.cc
index e4d28161ac2..665f479fb5b 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/first_flight.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/first_flight.cc
@@ -46,6 +46,7 @@ class FirstFlightExtractor : public DelegatedPacketWriter::Delegate {
crypto_config_.set_alpn(AlpnForVersion(version_));
connection_ =
new QuicConnection(server_connection_id_,
+ /*initial_self_address=*/QuicSocketAddress(),
QuicSocketAddress(TestPeerIPAddress(), kTestPort),
&connection_helper_, &alarm_factory_, &writer_,
/*owns_writer=*/false, Perspective::IS_CLIENT,
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/packet_dropping_test_writer.h b/chromium/net/third_party/quiche/src/quic/test_tools/packet_dropping_test_writer.h
index 47a3216eebe..01a07ce1a1f 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/packet_dropping_test_writer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/packet_dropping_test_writer.h
@@ -9,10 +9,10 @@
#include <list>
#include <memory>
+#include "absl/base/attributes.h"
#include "net/third_party/quiche/src/quic/core/quic_alarm.h"
#include "net/third_party/quiche/src/quic/core/quic_clock.h"
#include "net/third_party/quiche/src/quic/core/quic_packet_writer_wrapper.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_client.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
@@ -126,7 +126,9 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
}
// Useful for reproducing very flaky issues.
- QUIC_UNUSED void set_seed(uint64_t seed) { simple_random_.set_seed(seed); }
+ ABSL_ATTRIBUTE_UNUSED void set_seed(uint64_t seed) {
+ simple_random_.set_seed(seed);
+ }
private:
// Writes out the next packet to the contained writer and returns the time
@@ -155,7 +157,7 @@ class PacketDroppingTestWriter : public QuicPacketWriterWrapper {
QuicTime send_time;
};
- typedef std::list<DelayedWrite> DelayedPacketList;
+ using DelayedPacketList = std::list<DelayedWrite>;
const QuicClock* clock_;
std::unique_ptr<QuicAlarm> write_unblocked_alarm_;
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.cc b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.cc
index 4189290eebf..9a79515ceea 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.cc
@@ -8,20 +8,21 @@
#include <cstddef>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
void NoopEncoderStreamErrorDelegate::OnEncoderStreamError(
- quiche::QuicheStringPiece /*error_message*/) {}
+ QuicErrorCode /* error_code */,
+ absl::string_view /*error_message*/) {}
TestHeadersHandler::TestHeadersHandler()
: decoding_completed_(false), decoding_error_detected_(false) {}
-void TestHeadersHandler::OnHeaderDecoded(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+void TestHeadersHandler::OnHeaderDecoded(absl::string_view name,
+ absl::string_view value) {
ASSERT_FALSE(decoding_completed_);
ASSERT_FALSE(decoding_error_detected_);
@@ -36,7 +37,7 @@ void TestHeadersHandler::OnDecodingCompleted() {
}
void TestHeadersHandler::OnDecodingErrorDetected(
- quiche::QuicheStringPiece error_message) {
+ absl::string_view error_message) {
ASSERT_FALSE(decoding_completed_);
ASSERT_FALSE(decoding_error_detected_);
@@ -44,7 +45,7 @@ void TestHeadersHandler::OnDecodingErrorDetected(
error_message_.assign(error_message.data(), error_message.size());
}
-spdy::SpdyHeaderBlock TestHeadersHandler::ReleaseHeaderList() {
+spdy::Http2HeaderBlock TestHeadersHandler::ReleaseHeaderList() {
DCHECK(decoding_completed_);
DCHECK(!decoding_error_detected_);
@@ -71,7 +72,7 @@ void QpackDecode(
QpackStreamSenderDelegate* decoder_stream_sender_delegate,
QpackProgressiveDecoder::HeadersHandlerInterface* handler,
const FragmentSizeGenerator& fragment_size_generator,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
QpackDecoder decoder(maximum_dynamic_table_capacity, maximum_blocked_streams,
encoder_stream_error_delegate);
decoder.set_qpack_stream_sender_delegate(decoder_stream_sender_delegate);
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h
index 9741b05bdf5..f38bf987de9 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h
@@ -7,11 +7,11 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_progressive_decoder.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace quic {
@@ -23,7 +23,8 @@ class NoopEncoderStreamErrorDelegate
public:
~NoopEncoderStreamErrorDelegate() override = default;
- void OnEncoderStreamError(quiche::QuicheStringPiece error_message) override;
+ void OnEncoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) override;
};
// Mock QpackDecoder::EncoderStreamErrorDelegate implementation.
@@ -34,12 +35,12 @@ class MockEncoderStreamErrorDelegate
MOCK_METHOD(void,
OnEncoderStreamError,
- (quiche::QuicheStringPiece error_message),
+ (QuicErrorCode error_code, absl::string_view error_message),
(override));
};
// HeadersHandlerInterface implementation that collects decoded headers
-// into a SpdyHeaderBlock.
+// into a Http2HeaderBlock.
class TestHeadersHandler
: public QpackProgressiveDecoder::HeadersHandlerInterface {
public:
@@ -47,22 +48,21 @@ class TestHeadersHandler
~TestHeadersHandler() override = default;
// HeadersHandlerInterface implementation:
- void OnHeaderDecoded(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) override;
+ void OnHeaderDecoded(absl::string_view name,
+ absl::string_view value) override;
void OnDecodingCompleted() override;
- void OnDecodingErrorDetected(
- quiche::QuicheStringPiece error_message) override;
+ void OnDecodingErrorDetected(absl::string_view error_message) override;
// Release decoded header list. Must only be called if decoding is complete
// and no errors have been detected.
- spdy::SpdyHeaderBlock ReleaseHeaderList();
+ spdy::Http2HeaderBlock ReleaseHeaderList();
bool decoding_completed() const;
bool decoding_error_detected() const;
const std::string& error_message() const;
private:
- spdy::SpdyHeaderBlock header_list_;
+ spdy::Http2HeaderBlock header_list_;
bool decoding_completed_;
bool decoding_error_detected_;
std::string error_message_;
@@ -78,12 +78,12 @@ class MockHeadersHandler
MOCK_METHOD(void,
OnHeaderDecoded,
- (quiche::QuicheStringPiece name, quiche::QuicheStringPiece value),
+ (absl::string_view name, absl::string_view value),
(override));
MOCK_METHOD(void, OnDecodingCompleted, (), (override));
MOCK_METHOD(void,
OnDecodingErrorDetected,
- (quiche::QuicheStringPiece error_message),
+ (absl::string_view error_message),
(override));
};
@@ -92,11 +92,10 @@ class NoOpHeadersHandler
public:
~NoOpHeadersHandler() override = default;
- void OnHeaderDecoded(quiche::QuicheStringPiece /*name*/,
- quiche::QuicheStringPiece /*value*/) override {}
+ void OnHeaderDecoded(absl::string_view /*name*/,
+ absl::string_view /*value*/) override {}
void OnDecodingCompleted() override {}
- void OnDecodingErrorDetected(
- quiche::QuicheStringPiece /*error_message*/) override {}
+ void OnDecodingErrorDetected(absl::string_view /*error_message*/) override {}
};
void QpackDecode(
@@ -106,7 +105,7 @@ void QpackDecode(
QpackStreamSenderDelegate* decoder_stream_sender_delegate,
QpackProgressiveDecoder::HeadersHandlerInterface* handler,
const FragmentSizeGenerator& fragment_size_generator,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.cc b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.cc
index 1303511e2d8..9c8fd922ccf 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.cc
@@ -4,14 +4,15 @@
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h"
namespace quic {
namespace test {
void NoopDecoderStreamErrorDelegate::OnDecoderStreamError(
- quiche::QuicheStringPiece /*error_message*/) {}
+ QuicErrorCode /*error_code*/,
+ absl::string_view /*error_message*/) {}
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h
index 9b188150796..9d4e23e421a 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_encoder_test_utils.h
@@ -7,10 +7,10 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_encoder.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace quic {
@@ -22,7 +22,8 @@ class NoopDecoderStreamErrorDelegate
public:
~NoopDecoderStreamErrorDelegate() override = default;
- void OnDecoderStreamError(quiche::QuicheStringPiece error_message) override;
+ void OnDecoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) override;
};
// Mock QpackEncoder::DecoderStreamErrorDelegate implementation.
@@ -33,7 +34,7 @@ class MockDecoderStreamErrorDelegate
MOCK_METHOD(void,
OnDecoderStreamError,
- (quiche::QuicheStringPiece error_message),
+ (QuicErrorCode error_code, absl::string_view error_message),
(override));
};
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.cc b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.cc
index a7ba9e48876..267fad320df 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.cc
@@ -30,13 +30,16 @@
#include <string>
#include <utility>
+#include "absl/strings/match.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/str_split.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_file_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace quic {
@@ -44,8 +47,8 @@ QpackOfflineDecoder::QpackOfflineDecoder()
: encoder_stream_error_detected_(false) {}
bool QpackOfflineDecoder::DecodeAndVerifyOfflineData(
- quiche::QuicheStringPiece input_filename,
- quiche::QuicheStringPiece expected_headers_filename) {
+ absl::string_view input_filename,
+ absl::string_view expected_headers_filename) {
if (!ParseInputFilename(input_filename)) {
QUIC_LOG(ERROR) << "Error parsing input filename " << input_filename;
return false;
@@ -67,14 +70,15 @@ bool QpackOfflineDecoder::DecodeAndVerifyOfflineData(
}
void QpackOfflineDecoder::OnEncoderStreamError(
- quiche::QuicheStringPiece error_message) {
- QUIC_LOG(ERROR) << "Encoder stream error: " << error_message;
+ QuicErrorCode error_code,
+ absl::string_view error_message) {
+ QUIC_LOG(ERROR) << "Encoder stream error: "
+ << QuicErrorCodeToString(error_code) << " " << error_message;
encoder_stream_error_detected_ = true;
}
-bool QpackOfflineDecoder::ParseInputFilename(
- quiche::QuicheStringPiece input_filename) {
- auto pieces = quiche::QuicheTextUtils::Split(input_filename, '.');
+bool QpackOfflineDecoder::ParseInputFilename(absl::string_view input_filename) {
+ std::vector<absl::string_view> pieces = absl::StrSplit(input_filename, '.');
if (pieces.size() < 3) {
QUIC_LOG(ERROR) << "Not enough fields in input filename " << input_filename;
@@ -100,8 +104,7 @@ bool QpackOfflineDecoder::ParseInputFilename(
// Maximum allowed number of blocked streams.
uint64_t max_blocked_streams = 0;
- if (!quiche::QuicheTextUtils::StringToUint64(*piece_it,
- &max_blocked_streams)) {
+ if (!absl::SimpleAtoi(*piece_it, &max_blocked_streams)) {
QUIC_LOG(ERROR) << "Error parsing part of input filename \"" << *piece_it
<< "\" as an integer.";
return false;
@@ -111,8 +114,7 @@ bool QpackOfflineDecoder::ParseInputFilename(
// Maximum Dynamic Table Capacity in bytes
uint64_t maximum_dynamic_table_capacity = 0;
- if (!quiche::QuicheTextUtils::StringToUint64(
- *piece_it, &maximum_dynamic_table_capacity)) {
+ if (!absl::SimpleAtoi(*piece_it, &maximum_dynamic_table_capacity)) {
QUIC_LOG(ERROR) << "Error parsing part of input filename \"" << *piece_it
<< "\" as an integer.";
return false;
@@ -132,12 +134,12 @@ bool QpackOfflineDecoder::ParseInputFilename(
}
bool QpackOfflineDecoder::DecodeHeaderBlocksFromFile(
- quiche::QuicheStringPiece input_filename) {
- // Store data in |input_data_storage|; use a quiche::QuicheStringPiece to
+ absl::string_view input_filename) {
+ // Store data in |input_data_storage|; use a absl::string_view to
// efficiently keep track of remaining portion yet to be decoded.
std::string input_data_storage;
ReadFileContents(input_filename, &input_data_storage);
- quiche::QuicheStringPiece input_data(input_data_storage);
+ absl::string_view input_data(input_data_storage);
while (!input_data.empty()) {
// Parse stream_id and length.
@@ -160,7 +162,7 @@ bool QpackOfflineDecoder::DecodeHeaderBlocksFromFile(
}
// Parse data.
- quiche::QuicheStringPiece data = input_data.substr(0, length);
+ absl::string_view data = input_data.substr(0, length);
input_data = input_data.substr(length);
// Process data.
@@ -228,21 +230,20 @@ bool QpackOfflineDecoder::DecodeHeaderBlocksFromFile(
}
bool QpackOfflineDecoder::VerifyDecodedHeaderLists(
- quiche::QuicheStringPiece expected_headers_filename) {
+ absl::string_view expected_headers_filename) {
// Store data in |expected_headers_data_storage|; use a
- // quiche::QuicheStringPiece to efficiently keep track of remaining portion
+ // absl::string_view to efficiently keep track of remaining portion
// yet to be decoded.
std::string expected_headers_data_storage;
ReadFileContents(expected_headers_filename, &expected_headers_data_storage);
- quiche::QuicheStringPiece expected_headers_data(
- expected_headers_data_storage);
+ absl::string_view expected_headers_data(expected_headers_data_storage);
while (!decoded_header_lists_.empty()) {
- spdy::SpdyHeaderBlock decoded_header_list =
+ spdy::Http2HeaderBlock decoded_header_list =
std::move(decoded_header_lists_.front());
decoded_header_lists_.pop_front();
- spdy::SpdyHeaderBlock expected_header_list;
+ spdy::Http2HeaderBlock expected_header_list;
if (!ReadNextExpectedHeaderList(&expected_headers_data,
&expected_header_list)) {
QUIC_LOG(ERROR)
@@ -268,14 +269,13 @@ bool QpackOfflineDecoder::VerifyDecodedHeaderLists(
}
bool QpackOfflineDecoder::ReadNextExpectedHeaderList(
- quiche::QuicheStringPiece* expected_headers_data,
- spdy::SpdyHeaderBlock* expected_header_list) {
+ absl::string_view* expected_headers_data,
+ spdy::Http2HeaderBlock* expected_header_list) {
while (true) {
- quiche::QuicheStringPiece::size_type endline =
- expected_headers_data->find('\n');
+ absl::string_view::size_type endline = expected_headers_data->find('\n');
// Even last header list must be followed by an empty line.
- if (endline == quiche::QuicheStringPiece::npos) {
+ if (endline == absl::string_view::npos) {
QUIC_LOG(ERROR) << "Unexpected end of expected header list file.";
return false;
}
@@ -286,9 +286,8 @@ bool QpackOfflineDecoder::ReadNextExpectedHeaderList(
return true;
}
- quiche::QuicheStringPiece header_field =
- expected_headers_data->substr(0, endline);
- auto pieces = quiche::QuicheTextUtils::Split(header_field, '\t');
+ absl::string_view header_field = expected_headers_data->substr(0, endline);
+ std::vector<absl::string_view> pieces = absl::StrSplit(header_field, '\t');
if (pieces.size() != 2) {
QUIC_LOG(ERROR) << "Header key and value must be separated by TAB.";
@@ -302,8 +301,8 @@ bool QpackOfflineDecoder::ReadNextExpectedHeaderList(
}
bool QpackOfflineDecoder::CompareHeaderBlocks(
- spdy::SpdyHeaderBlock decoded_header_list,
- spdy::SpdyHeaderBlock expected_header_list) {
+ spdy::Http2HeaderBlock decoded_header_list,
+ spdy::Http2HeaderBlock expected_header_list) {
if (decoded_header_list == expected_header_list) {
return true;
}
@@ -314,15 +313,15 @@ bool QpackOfflineDecoder::CompareHeaderBlocks(
// Remove such headers one by one if they match.
const char* kContentLength = "content-length";
const char* kPseudoHeaderPrefix = ":";
- for (spdy::SpdyHeaderBlock::iterator decoded_it = decoded_header_list.begin();
+ for (spdy::Http2HeaderBlock::iterator decoded_it =
+ decoded_header_list.begin();
decoded_it != decoded_header_list.end();) {
- const quiche::QuicheStringPiece key = decoded_it->first;
- if (key != kContentLength &&
- !quiche::QuicheTextUtils::StartsWith(key, kPseudoHeaderPrefix)) {
+ const absl::string_view key = decoded_it->first;
+ if (key != kContentLength && !absl::StartsWith(key, kPseudoHeaderPrefix)) {
++decoded_it;
continue;
}
- spdy::SpdyHeaderBlock::iterator expected_it =
+ spdy::Http2HeaderBlock::iterator expected_it =
expected_header_list.find(key);
if (expected_it == expected_header_list.end() ||
decoded_it->second != expected_it->second) {
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.h b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.h
index f90b2c736eb..eea0b064d12 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_offline_decoder.h
@@ -7,10 +7,11 @@
#include <list>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_decoder.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_decoder_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace quic {
@@ -29,12 +30,12 @@ class QpackOfflineDecoder : public QpackDecoder::EncoderStreamErrorDelegate {
// |expected_headers_filename|, and compare decoded header lists to expected
// ones. Returns true if there is an equal number of them and the
// corresponding ones match, false otherwise.
- bool DecodeAndVerifyOfflineData(
- quiche::QuicheStringPiece input_filename,
- quiche::QuicheStringPiece expected_headers_filename);
+ bool DecodeAndVerifyOfflineData(absl::string_view input_filename,
+ absl::string_view expected_headers_filename);
// QpackDecoder::EncoderStreamErrorDelegate implementation:
- void OnEncoderStreamError(quiche::QuicheStringPiece error_message) override;
+ void OnEncoderStreamError(QuicErrorCode error_code,
+ absl::string_view error_message) override;
private:
// Data structure to hold TestHeadersHandler and QpackProgressiveDecoder until
@@ -48,30 +49,28 @@ class QpackOfflineDecoder : public QpackDecoder::EncoderStreamErrorDelegate {
// Parse decoder parameters from |input_filename| and set up |qpack_decoder_|
// accordingly.
- bool ParseInputFilename(quiche::QuicheStringPiece input_filename);
+ bool ParseInputFilename(absl::string_view input_filename);
// Read encoded header blocks and encoder stream data from |input_filename|,
// pass them to |qpack_decoder_| for decoding, and add decoded header lists to
// |decoded_header_lists_|.
- bool DecodeHeaderBlocksFromFile(quiche::QuicheStringPiece input_filename);
+ bool DecodeHeaderBlocksFromFile(absl::string_view input_filename);
// Read expected header lists from |expected_headers_filename| and verify
// decoded header lists in |decoded_header_lists_| against them.
- bool VerifyDecodedHeaderLists(
- quiche::QuicheStringPiece expected_headers_filename);
+ bool VerifyDecodedHeaderLists(absl::string_view expected_headers_filename);
// Parse next header list from |*expected_headers_data| into
// |*expected_header_list|, removing consumed data from the beginning of
// |*expected_headers_data|. Returns true on success, false if parsing fails.
- bool ReadNextExpectedHeaderList(
- quiche::QuicheStringPiece* expected_headers_data,
- spdy::SpdyHeaderBlock* expected_header_list);
+ bool ReadNextExpectedHeaderList(absl::string_view* expected_headers_data,
+ spdy::Http2HeaderBlock* expected_header_list);
// Compare two header lists. Allow for different orders of certain headers as
// described at
// https://github.com/qpackers/qifs/blob/master/encoded/qpack-03/h2o/README.md.
- bool CompareHeaderBlocks(spdy::SpdyHeaderBlock decoded_header_list,
- spdy::SpdyHeaderBlock expected_header_list);
+ bool CompareHeaderBlocks(spdy::Http2HeaderBlock decoded_header_list,
+ spdy::Http2HeaderBlock expected_header_list);
bool encoder_stream_error_detected_;
test::NoopQpackStreamSenderDelegate decoder_stream_sender_delegate_;
@@ -81,7 +80,7 @@ class QpackOfflineDecoder : public QpackDecoder::EncoderStreamErrorDelegate {
std::list<Decoder> decoders_;
// Decoded header lists.
- std::list<spdy::SpdyHeaderBlock> decoded_header_lists_;
+ std::list<spdy::Http2HeaderBlock> decoded_header_lists_;
};
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.cc b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.cc
index faaddcb2187..65636d50f1d 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.cc
@@ -5,6 +5,7 @@
#include "net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h"
#include <limits>
+#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
namespace quic {
namespace test {
@@ -17,6 +18,8 @@ FragmentSizeGenerator FragmentModeToFragmentSizeGenerator(
case FragmentMode::kOctetByOctet:
return []() { return 1; };
}
+ QUIC_BUG << "Unknown FragmentMode " << static_cast<int>(fragment_mode);
+ return []() { return 0; };
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h
index b9f4adfb6d9..0d0594df945 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/qpack/qpack_test_utils.h
@@ -8,9 +8,9 @@
#include <cstddef>
#include <functional>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/qpack/qpack_stream_sender_delegate.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -32,17 +32,14 @@ class MockQpackStreamSenderDelegate : public QpackStreamSenderDelegate {
public:
~MockQpackStreamSenderDelegate() override = default;
- MOCK_METHOD(void,
- WriteStreamData,
- (quiche::QuicheStringPiece data),
- (override));
+ MOCK_METHOD(void, WriteStreamData, (absl::string_view data), (override));
};
class NoopQpackStreamSenderDelegate : public QpackStreamSenderDelegate {
public:
~NoopQpackStreamSenderDelegate() override = default;
- void WriteStreamData(quiche::QuicheStringPiece /*data*/) override {}
+ void WriteStreamData(absl::string_view /*data*/) override {}
};
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.cc
index 52325d16650..b10453ec399 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.cc
@@ -99,6 +99,12 @@ void QuicConfigPeer::SetReceivedMaxPacketSize(QuicConfig* config,
}
// static
+void QuicConfigPeer::SetReceivedMinAckDelayMs(QuicConfig* config,
+ uint32_t min_ack_delay_ms) {
+ config->min_ack_delay_ms_.SetReceivedValue(min_ack_delay_ms);
+}
+
+// static
void QuicConfigPeer::SetNegotiated(QuicConfig* config, bool negotiated) {
config->negotiated_ = negotiated;
}
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.h
index 109bd6453b3..98c35a175e3 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_config_peer.h
@@ -60,6 +60,9 @@ class QuicConfigPeer {
static void SetReceivedMaxPacketSize(QuicConfig* config,
uint32_t max_udp_payload_size);
+ static void SetReceivedMinAckDelayMs(QuicConfig* config,
+ uint32_t min_ack_delay_ms);
+
static void SetNegotiated(QuicConfig* config, bool negotiated);
static void SetReceivedOriginalConnectionId(
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.cc
index 1949df17a85..30ed4fd6914 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.cc
@@ -4,13 +4,13 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h"
#include "net/third_party/quiche/src/quic/core/quic_packet_writer.h"
#include "net/third_party/quiche/src/quic/core/quic_received_packet_manager.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_framer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_sent_packet_manager_peer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -94,9 +94,8 @@ void QuicConnectionPeer::SwapCrypters(QuicConnection* connection,
}
// static
-void QuicConnectionPeer::SetCurrentPacket(
- QuicConnection* connection,
- quiche::QuicheStringPiece current_packet) {
+void QuicConnectionPeer::SetCurrentPacket(QuicConnection* connection,
+ absl::string_view current_packet) {
connection->current_packet_data_ = current_packet.data();
connection->last_size_ = current_packet.size();
}
@@ -152,6 +151,12 @@ QuicAlarm* QuicConnectionPeer::GetProcessUndecryptablePacketsAlarm(
}
// static
+QuicAlarm* QuicConnectionPeer::GetDiscardPreviousOneRttKeysAlarm(
+ QuicConnection* connection) {
+ return connection->discard_previous_one_rtt_keys_alarm_.get();
+}
+
+// static
QuicPacketWriter* QuicConnectionPeer::GetWriter(QuicConnection* connection) {
return connection->writer_;
}
@@ -292,6 +297,12 @@ void QuicConnectionPeer::SetAddressValidated(QuicConnection* connection) {
}
// static
+void QuicConnectionPeer::SetEnableAeadLimits(QuicConnection* connection,
+ bool enabled) {
+ connection->enable_aead_limits_ = enabled;
+}
+
+// static
void QuicConnectionPeer::SendConnectionClosePacket(QuicConnection* connection,
QuicErrorCode error,
const std::string& details) {
@@ -379,5 +390,14 @@ QuicConnectionPeer::pending_path_challenge_payloads(
return connection->pending_path_challenge_payloads_;
}
+void QuicConnectionPeer::SetConnectionClose(QuicConnection* connection) {
+ connection->connected_ = false;
+}
+
+// static
+void QuicConnectionPeer::SendPing(QuicConnection* connection) {
+ connection->SendPingAtLevel(connection->encryption_level());
+}
+
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h
index b470653b793..8859a58f515 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h
@@ -5,11 +5,11 @@
#ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_CONNECTION_PEER_H_
#define QUICHE_QUIC_TEST_TOOLS_QUIC_CONNECTION_PEER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_stats.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -67,7 +67,7 @@ class QuicConnectionPeer {
static void SwapCrypters(QuicConnection* connection, QuicFramer* framer);
static void SetCurrentPacket(QuicConnection* connection,
- quiche::QuicheStringPiece current_packet);
+ absl::string_view current_packet);
static QuicConnectionHelperInterface* GetHelper(QuicConnection* connection);
@@ -82,6 +82,8 @@ class QuicConnectionPeer {
static QuicAlarm* GetMtuDiscoveryAlarm(QuicConnection* connection);
static QuicAlarm* GetProcessUndecryptablePacketsAlarm(
QuicConnection* connection);
+ static QuicAlarm* GetDiscardPreviousOneRttKeysAlarm(
+ QuicConnection* connection);
static QuicPacketWriter* GetWriter(QuicConnection* connection);
// If |owns_writer| is true, takes ownership of |writer|.
@@ -122,6 +124,7 @@ class QuicConnectionPeer {
PacketHeaderFormat format);
static void AddBytesReceived(QuicConnection* connection, size_t length);
static void SetAddressValidated(QuicConnection* connection);
+ static void SetEnableAeadLimits(QuicConnection* connection, bool enabled);
static void SendConnectionClosePacket(QuicConnection* connection,
QuicErrorCode error,
@@ -157,6 +160,10 @@ class QuicConnectionPeer {
static const QuicCircularDeque<
std::pair<QuicPathFrameBuffer, QuicSocketAddress>>&
pending_path_challenge_payloads(QuicConnection* connection);
+
+ static void SetConnectionClose(QuicConnection* connection);
+
+ static void SendPing(QuicConnection* connection);
};
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.cc
index 3893448931c..64fd271a3af 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.cc
@@ -4,10 +4,10 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_clock.h"
#include "net/third_party/quiche/src/quic/test_tools/mock_random.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -53,7 +53,7 @@ std::string QuicCryptoServerConfigPeer::NewSourceAddressToken(
HandshakeFailureReason QuicCryptoServerConfigPeer::ValidateSourceAddressTokens(
std::string config_id,
- quiche::QuicheStringPiece srct,
+ absl::string_view srct,
const QuicIpAddress& ip,
QuicWallTime now,
CachedNetworkParameters* cached_network_params) {
@@ -70,7 +70,7 @@ HandshakeFailureReason QuicCryptoServerConfigPeer::ValidateSourceAddressTokens(
HandshakeFailureReason
QuicCryptoServerConfigPeer::ValidateSingleSourceAddressToken(
- quiche::QuicheStringPiece token,
+ absl::string_view token,
const QuicIpAddress& ip,
QuicWallTime now) {
SourceAddressTokens tokens;
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h
index 270321f8ff1..9366eae1440 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_crypto_server_config_peer.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_
#define QUICHE_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -43,14 +43,14 @@ class QuicCryptoServerConfigPeer {
// Attempts to validate the tokens in |tokens|.
HandshakeFailureReason ValidateSourceAddressTokens(
std::string config_id,
- quiche::QuicheStringPiece tokens,
+ absl::string_view tokens,
const QuicIpAddress& ip,
QuicWallTime now,
CachedNetworkParameters* cached_network_params);
// Attempts to validate the single source address token in |token|.
HandshakeFailureReason ValidateSingleSourceAddressToken(
- quiche::QuicheStringPiece token,
+ absl::string_view token,
const QuicIpAddress& ip,
QuicWallTime now);
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.cc
new file mode 100644
index 00000000000..54d97d02527
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.cc
@@ -0,0 +1,15 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.h"
+
+namespace quic {
+namespace test {
+// static
+QuicAlarm* QuicPathValidatorPeer::retry_timer(QuicPathValidator* validator) {
+ return validator->retry_timer_.get();
+}
+
+} // namespace test
+} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.h
new file mode 100644
index 00000000000..5b2b56c7e63
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_path_validator_peer.h
@@ -0,0 +1,20 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef QUICHE_QUIC_TEST_TOOLS_QUIC_PATH_VALIDATOR_PEER_H_
+#define QUICHE_QUIC_TEST_TOOLS_QUIC_PATH_VALIDATOR_PEER_H_
+
+#include "net/third_party/quiche/src/quic/core/quic_path_validator.h"
+
+namespace quic {
+namespace test {
+
+class QuicPathValidatorPeer {
+ public:
+ static QuicAlarm* retry_timer(QuicPathValidator* validator);
+};
+
+} // namespace test
+} // namespace quic
+#endif // QUICHE_QUIC_TEST_TOOLS_QUIC_PATH_VALIDATOR_PEER_H_
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.cc
index 05d74d75701..a57840e2157 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.cc
@@ -28,7 +28,7 @@ QuicStreamId QuicSessionPeer::GetNextOutgoingUnidirectionalStreamId(
void QuicSessionPeer::SetNextOutgoingBidirectionalStreamId(QuicSession* session,
QuicStreamId id) {
if (VersionHasIetfQuicFrames(session->transport_version())) {
- session->v99_streamid_manager_.bidirectional_stream_id_manager_
+ session->ietf_streamid_manager_.bidirectional_stream_id_manager_
.next_outgoing_stream_id_ = id;
return;
}
@@ -40,9 +40,9 @@ void QuicSessionPeer::SetMaxOpenIncomingStreams(QuicSession* session,
uint32_t max_streams) {
if (VersionHasIetfQuicFrames(session->transport_version())) {
QUIC_BUG << "SetmaxOpenIncomingStreams deprecated for IETF QUIC";
- session->v99_streamid_manager_.SetMaxOpenIncomingUnidirectionalStreams(
+ session->ietf_streamid_manager_.SetMaxOpenIncomingUnidirectionalStreams(
max_streams);
- session->v99_streamid_manager_.SetMaxOpenIncomingBidirectionalStreams(
+ session->ietf_streamid_manager_.SetMaxOpenIncomingBidirectionalStreams(
max_streams);
return;
}
@@ -56,7 +56,7 @@ void QuicSessionPeer::SetMaxOpenIncomingBidirectionalStreams(
DCHECK(VersionHasIetfQuicFrames(session->transport_version()))
<< "SetmaxOpenIncomingBidirectionalStreams not supported for Google "
"QUIC";
- session->v99_streamid_manager_.SetMaxOpenIncomingBidirectionalStreams(
+ session->ietf_streamid_manager_.SetMaxOpenIncomingBidirectionalStreams(
max_streams);
}
// static
@@ -66,7 +66,7 @@ void QuicSessionPeer::SetMaxOpenIncomingUnidirectionalStreams(
DCHECK(VersionHasIetfQuicFrames(session->transport_version()))
<< "SetmaxOpenIncomingUnidirectionalStreams not supported for Google "
"QUIC";
- session->v99_streamid_manager_.SetMaxOpenIncomingUnidirectionalStreams(
+ session->ietf_streamid_manager_.SetMaxOpenIncomingUnidirectionalStreams(
max_streams);
}
@@ -87,7 +87,7 @@ void QuicSessionPeer::SetMaxOpenOutgoingBidirectionalStreams(
DCHECK(VersionHasIetfQuicFrames(session->transport_version()))
<< "SetmaxOpenOutgoingBidirectionalStreams not supported for Google "
"QUIC";
- session->v99_streamid_manager_.MaybeAllowNewOutgoingBidirectionalStreams(
+ session->ietf_streamid_manager_.MaybeAllowNewOutgoingBidirectionalStreams(
max_streams);
}
// static
@@ -97,7 +97,7 @@ void QuicSessionPeer::SetMaxOpenOutgoingUnidirectionalStreams(
DCHECK(VersionHasIetfQuicFrames(session->transport_version()))
<< "SetmaxOpenOutgoingUnidirectionalStreams not supported for Google "
"QUIC";
- session->v99_streamid_manager_.MaybeAllowNewOutgoingUnidirectionalStreams(
+ session->ietf_streamid_manager_.MaybeAllowNewOutgoingUnidirectionalStreams(
max_streams);
}
@@ -157,12 +157,12 @@ bool QuicSessionPeer::IsStreamAvailable(QuicSession* session, QuicStreamId id) {
if (VersionHasIetfQuicFrames(session->transport_version())) {
if (id % QuicUtils::StreamIdDelta(session->transport_version()) < 2) {
return QuicContainsKey(
- session->v99_streamid_manager_.bidirectional_stream_id_manager_
+ session->ietf_streamid_manager_.bidirectional_stream_id_manager_
.available_streams_,
id);
}
return QuicContainsKey(
- session->v99_streamid_manager_.unidirectional_stream_id_manager_
+ session->ietf_streamid_manager_.unidirectional_stream_id_manager_
.available_streams_,
id);
}
@@ -192,21 +192,21 @@ LegacyQuicStreamIdManager* QuicSessionPeer::GetStreamIdManager(
}
// static
-UberQuicStreamIdManager* QuicSessionPeer::v99_streamid_manager(
+UberQuicStreamIdManager* QuicSessionPeer::ietf_streamid_manager(
QuicSession* session) {
- return &session->v99_streamid_manager_;
+ return &session->ietf_streamid_manager_;
}
// static
-QuicStreamIdManager* QuicSessionPeer::v99_bidirectional_stream_id_manager(
+QuicStreamIdManager* QuicSessionPeer::ietf_bidirectional_stream_id_manager(
QuicSession* session) {
- return &session->v99_streamid_manager_.bidirectional_stream_id_manager_;
+ return &session->ietf_streamid_manager_.bidirectional_stream_id_manager_;
}
// static
-QuicStreamIdManager* QuicSessionPeer::v99_unidirectional_stream_id_manager(
+QuicStreamIdManager* QuicSessionPeer::ietf_unidirectional_stream_id_manager(
QuicSession* session) {
- return &session->v99_streamid_manager_.unidirectional_stream_id_manager_;
+ return &session->ietf_streamid_manager_.unidirectional_stream_id_manager_;
}
// static
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.h
index ffd6c6f300f..fdcb4431ff6 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_session_peer.h
@@ -71,10 +71,10 @@ class QuicSessionPeer {
static bool IsStreamWriteBlocked(QuicSession* session, QuicStreamId id);
static QuicAlarm* GetCleanUpClosedStreamsAlarm(QuicSession* session);
static LegacyQuicStreamIdManager* GetStreamIdManager(QuicSession* session);
- static UberQuicStreamIdManager* v99_streamid_manager(QuicSession* session);
- static QuicStreamIdManager* v99_bidirectional_stream_id_manager(
+ static UberQuicStreamIdManager* ietf_streamid_manager(QuicSession* session);
+ static QuicStreamIdManager* ietf_bidirectional_stream_id_manager(
QuicSession* session);
- static QuicStreamIdManager* v99_unidirectional_stream_id_manager(
+ static QuicStreamIdManager* ietf_unidirectional_stream_id_manager(
QuicSession* session);
static PendingStream* GetPendingStream(QuicSession* session,
QuicStreamId stream_id);
@@ -82,6 +82,10 @@ class QuicSessionPeer {
static void SetPerspective(QuicSession* session, Perspective perspective);
static size_t GetNumOpenDynamicStreams(QuicSession* session);
static size_t GetNumDrainingStreams(QuicSession* session);
+ static QuicStreamId GetLargestPeerCreatedStreamId(QuicSession* session,
+ bool unidirectional) {
+ return session->GetLargestPeerCreatedStreamId(unidirectional);
+ }
};
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.cc
index b3bf224df4e..8f5553ac9dd 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.cc
@@ -3,13 +3,14 @@
// found in the LICENSE file.
#include "net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.h"
+#include <cstddef>
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
-typedef quic::QuicStreamSequencerBuffer::BufferBlock BufferBlock;
+using BufferBlock = quic::QuicStreamSequencerBuffer::BufferBlock;
static const size_t kBlockSizeBytes =
quic::QuicStreamSequencerBuffer::kBlockSizeBytes;
@@ -45,7 +46,8 @@ bool QuicStreamSequencerBufferPeer::IsBlockArrayEmpty() {
return true;
}
- size_t count = buffer_->blocks_count_;
+ size_t count = buffer_->allocate_blocks_on_demand_ ? current_blocks_count()
+ : max_blocks_count();
for (size_t i = 0; i < count; i++) {
if (buffer_->blocks_[i] != nullptr) {
return false;
@@ -79,10 +81,11 @@ bool QuicStreamSequencerBufferPeer::CheckBufferInvariants() {
if (!capacity_sane) {
QUIC_LOG(ERROR) << "read offset go beyond 1st block";
}
- bool block_match_capacity = (buffer_->max_buffer_capacity_bytes_ <=
- buffer_->blocks_count_ * kBlockSizeBytes) &&
- (buffer_->max_buffer_capacity_bytes_ >
- (buffer_->blocks_count_ - 1) * kBlockSizeBytes);
+ bool block_match_capacity =
+ (buffer_->max_buffer_capacity_bytes_ <=
+ buffer_->max_blocks_count_ * kBlockSizeBytes) &&
+ (buffer_->max_buffer_capacity_bytes_ >
+ (buffer_->max_blocks_count_ - 1) * kBlockSizeBytes);
if (!capacity_sane) {
QUIC_LOG(ERROR) << "block number not match capcaity.";
}
@@ -143,8 +146,12 @@ bool QuicStreamSequencerBufferPeer::IsBufferAllocated() {
return buffer_->blocks_ != nullptr;
}
-size_t QuicStreamSequencerBufferPeer::block_count() {
- return buffer_->blocks_count_;
+size_t QuicStreamSequencerBufferPeer::max_blocks_count() {
+ return buffer_->max_blocks_count_;
+}
+
+size_t QuicStreamSequencerBufferPeer::current_blocks_count() {
+ return buffer_->current_blocks_count_;
}
const QuicIntervalSet<QuicStreamOffset>&
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.h
index da2d054bbd3..4cac6f10dd8 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_stream_sequencer_buffer_peer.h
@@ -49,7 +49,9 @@ class QuicStreamSequencerBufferPeer {
bool IsBufferAllocated();
- size_t block_count();
+ size_t max_blocks_count();
+
+ size_t current_blocks_count();
const QuicIntervalSet<QuicStreamOffset>& bytes_received();
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.cc
index 56dc1ec24c2..5b93de5f64f 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.cc
@@ -8,6 +8,8 @@
#include <utility>
#include <vector>
+#include "absl/strings/match.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/x509.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h"
@@ -27,7 +29,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_spdy_stream_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h"
#include "net/third_party/quiche/src/quic/tools/quic_url.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -49,7 +50,7 @@ class RecordingProofVerifier : public ProofVerifier {
const uint16_t port,
const std::string& server_config,
QuicTransportVersion transport_version,
- quiche::QuicheStringPiece chlo_hash,
+ absl::string_view chlo_hash,
const std::vector<std::string>& certs,
const std::string& cert_sct,
const std::string& signature,
@@ -81,6 +82,7 @@ class RecordingProofVerifier : public ProofVerifier {
const ProofVerifyContext* /*context*/,
std::string* /*error_details*/,
std::unique_ptr<ProofVerifyDetails>* /*details*/,
+ uint8_t* /*out_alert*/,
std::unique_ptr<ProofVerifierCallback> /*callback*/) override {
return ProcessCerts(certs, cert_sct);
}
@@ -438,7 +440,7 @@ void QuicTestClient::SendRequestsAndWaitForResponses(
ssize_t QuicTestClient::GetOrCreateStreamAndSendRequest(
const spdy::SpdyHeaderBlock* headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
if (headers) {
@@ -482,18 +484,18 @@ ssize_t QuicTestClient::GetOrCreateStreamAndSendRequest(
}
ssize_t QuicTestClient::SendMessage(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body) {
+ absl::string_view body) {
return SendMessage(headers, body, /*fin=*/true);
}
ssize_t QuicTestClient::SendMessage(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin) {
return SendMessage(headers, body, fin, /*flush=*/true);
}
ssize_t QuicTestClient::SendMessage(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin,
bool flush) {
// Always force creation of a stream for SendMessage.
@@ -515,8 +517,7 @@ ssize_t QuicTestClient::SendData(
const std::string& data,
bool last_data,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener) {
- return GetOrCreateStreamAndSendRequest(nullptr,
- quiche::QuicheStringPiece(data),
+ return GetOrCreateStreamAndSendRequest(nullptr, absl::string_view(data),
last_data, std::move(ack_listener));
}
@@ -702,14 +703,13 @@ bool QuicTestClient::WaitUntil(int timeout_ms, std::function<bool()> trigger) {
epoll_server()->set_timeout_in_us(old_timeout_us);
}
if (trigger && !trigger()) {
- QUIC_VLOG(1) << "Client WaitUntil returning with trigger returning false."
- << QuicStackTrace();
+ QUIC_VLOG(1) << "Client WaitUntil returning with trigger returning false.";
return false;
}
return true;
}
-ssize_t QuicTestClient::Send(quiche::QuicheStringPiece data) {
+ssize_t QuicTestClient::Send(absl::string_view data) {
return SendData(std::string(data), false);
}
@@ -884,7 +884,7 @@ void QuicTestClient::WaitForWriteToFlush() {
QuicTestClient::TestClientDataToResend::TestClientDataToResend(
std::unique_ptr<spdy::SpdyHeaderBlock> headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin,
QuicTestClient* test_client,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener)
@@ -940,8 +940,7 @@ bool QuicTestClient::PopulateHeaderBlockFromUrl(
const std::string& uri,
spdy::SpdyHeaderBlock* headers) {
std::string url;
- if (quiche::QuicheTextUtils::StartsWith(uri, "https://") ||
- quiche::QuicheTextUtils::StartsWith(uri, "http://")) {
+ if (absl::StartsWith(uri, "https://") || absl::StartsWith(uri, "http://")) {
url = uri;
} else if (uri[0] == '/') {
url = "https://" + client_->server_id().host() + uri;
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.h
index 1bd0247be6e..b4d8f467c51 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_client.h
@@ -9,6 +9,7 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/proto/cached_network_parameters_proto.h"
#include "net/third_party/quiche/src/quic/core/quic_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_packet_creator.h"
@@ -18,7 +19,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/tools/quic_client.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -141,19 +141,19 @@ class QuicTestClient : public QuicSpdyStream::Visitor,
// Sends a request containing |headers| and |body| and returns the number of
// bytes sent (the size of the serialized request headers and body).
ssize_t SendMessage(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body);
+ absl::string_view body);
// Sends a request containing |headers| and |body| with the fin bit set to
// |fin| and returns the number of bytes sent (the size of the serialized
// request headers and body).
ssize_t SendMessage(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin);
// Sends a request containing |headers| and |body| with the fin bit set to
// |fin| and returns the number of bytes sent (the size of the serialized
// request headers and body). If |flush| is true, will wait for the message to
// be flushed before returning.
ssize_t SendMessage(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin,
bool flush);
// Sends a request containing |headers| and |body|, waits for the response,
@@ -170,7 +170,7 @@ class QuicTestClient : public QuicSpdyStream::Visitor,
QuicSocketAddress local_address() const;
void ClearPerRequestState();
bool WaitUntil(int timeout_ms, std::function<bool()> trigger);
- ssize_t Send(quiche::QuicheStringPiece data);
+ ssize_t Send(absl::string_view data);
bool connected() const;
bool buffer_body() const;
void set_buffer_body(bool buffer_body);
@@ -264,7 +264,7 @@ class QuicTestClient : public QuicSpdyStream::Visitor,
// null, only the body will be sent on the stream.
ssize_t GetOrCreateStreamAndSendRequest(
const spdy::SpdyHeaderBlock* headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
@@ -342,7 +342,7 @@ class QuicTestClient : public QuicSpdyStream::Visitor,
public:
TestClientDataToResend(
std::unique_ptr<spdy::SpdyHeaderBlock> headers,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
bool fin,
QuicTestClient* test_client,
QuicReferenceCountedPointer<QuicAckListenerInterface> ack_listener);
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_server.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_server.cc
index f311079a350..c69ec29f48c 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_server.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_server.cc
@@ -6,13 +6,13 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_alarm_factory.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_connection_helper.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_crypto_server_stream_helper.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -97,7 +97,7 @@ class QuicTestDispatcher : public QuicSimpleDispatcher {
QuicConnectionId id,
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece alpn,
+ absl::string_view alpn,
const ParsedQuicVersion& version) override {
QuicReaderMutexLock lock(&factory_lock_);
if (session_factory_ == nullptr && stream_factory_ == nullptr &&
@@ -106,7 +106,7 @@ class QuicTestDispatcher : public QuicSimpleDispatcher {
id, self_address, peer_address, alpn, version);
}
QuicConnection* connection = new QuicConnection(
- id, peer_address, helper(), alarm_factory(), writer(),
+ id, self_address, peer_address, helper(), alarm_factory(), writer(),
/* owns_writer= */ false, Perspective::IS_SERVER,
ParsedQuicVersionVector{version});
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.cc
index ed7dc7592f3..8bf49d97be3 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.cc
@@ -9,6 +9,8 @@
#include <memory>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
#include "third_party/boringssl/src/include/openssl/chacha.h"
#include "third_party/boringssl/src/include/openssl/sha.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_framer.h"
@@ -34,9 +36,7 @@
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_config_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_endian.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/spdy_frame_builder.h"
using testing::_;
@@ -202,11 +202,11 @@ std::unique_ptr<QuicPacket> BuildUnsizedDataPacket(
header.length_length);
}
-std::string Sha1Hash(quiche::QuicheStringPiece data) {
+std::string Sha1Hash(absl::string_view data) {
char buffer[SHA_DIGEST_LENGTH];
SHA1(reinterpret_cast<const uint8_t*>(data.data()), data.size(),
reinterpret_cast<uint8_t*>(buffer));
- return std::string(buffer, QUICHE_ARRAYSIZE(buffer));
+ return std::string(buffer, ABSL_ARRAYSIZE(buffer));
}
bool ClearControlFrame(const QuicFrame& frame) {
@@ -214,6 +214,11 @@ bool ClearControlFrame(const QuicFrame& frame) {
return true;
}
+bool ClearControlFrameWithTransmissionType(const QuicFrame& frame,
+ TransmissionType /*type*/) {
+ return ClearControlFrame(frame);
+}
+
uint64_t SimpleRandom::RandUint64() {
uint64_t result;
RandBytes(&result, sizeof(result));
@@ -525,19 +530,21 @@ MockQuicConnection::MockQuicConnection(
MockQuicConnection::MockQuicConnection(
QuicConnectionId connection_id,
- QuicSocketAddress address,
+ QuicSocketAddress initial_peer_address,
MockQuicConnectionHelper* helper,
MockAlarmFactory* alarm_factory,
Perspective perspective,
const ParsedQuicVersionVector& supported_versions)
- : QuicConnection(connection_id,
- address,
- helper,
- alarm_factory,
- new testing::NiceMock<MockPacketWriter>(),
- /* owns_writer= */ true,
- perspective,
- supported_versions) {
+ : QuicConnection(
+ connection_id,
+ /*initial_self_address=*/QuicSocketAddress(QuicIpAddress::Any4(), 5),
+ initial_peer_address,
+ helper,
+ alarm_factory,
+ new testing::NiceMock<MockPacketWriter>(),
+ /* owns_writer= */ true,
+ perspective,
+ supported_versions) {
ON_CALL(*this, OnError(_))
.WillByDefault(
Invoke(this, &PacketSavingConnection::QuicConnection_OnError));
@@ -627,7 +634,7 @@ QuicConsumedData MockQuicSession::ConsumeData(
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType /*type*/,
- quiche::QuicheOptional<EncryptionLevel> /*level*/) {
+ absl::optional<EncryptionLevel> /*level*/) {
if (write_length > 0) {
auto buf = std::make_unique<char[]>(write_length);
QuicStream* stream = GetOrCreateStream(id);
@@ -716,7 +723,7 @@ QuicConsumedData MockQuicSpdySession::ConsumeData(
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType /*type*/,
- quiche::QuicheOptional<EncryptionLevel> /*level*/) {
+ absl::optional<EncryptionLevel> /*level*/) {
if (write_length > 0) {
auto buf = std::make_unique<char[]>(write_length);
QuicStream* stream = GetOrCreateStream(id);
@@ -989,7 +996,7 @@ QuicEncryptedPacket* ConstructEncryptedPacket(
if (!QuicVersionUsesCryptoFrames(version.transport_version)) {
QuicFrame frame(
QuicStreamFrame(QuicUtils::GetCryptoStreamId(version.transport_version),
- false, 0, quiche::QuicheStringPiece(data)));
+ false, 0, absl::string_view(data)));
frames.push_back(frame);
} else {
QuicFrame frame(new QuicCryptoFrame(level, 0, data));
@@ -1100,8 +1107,7 @@ QuicEncryptedPacket* ConstructMisFramedEncryptedPacket(
header.retry_token_length_length = VARIABLE_LENGTH_INTEGER_LENGTH_1;
header.length_length = VARIABLE_LENGTH_INTEGER_LENGTH_2;
}
- QuicFrame frame(
- QuicStreamFrame(1, false, 0, quiche::QuicheStringPiece(data)));
+ QuicFrame frame(QuicStreamFrame(1, false, 0, absl::string_view(data)));
QuicFrames frames;
frames.push_back(frame);
QuicFramer framer({version}, QuicTime::Zero(), perspective,
@@ -1295,7 +1301,7 @@ StreamType DetermineStreamType(QuicStreamId id,
}
QuicMemSliceSpan MakeSpan(QuicBufferAllocator* allocator,
- quiche::QuicheStringPiece message_data,
+ absl::string_view message_data,
QuicMemSliceStorage* storage) {
if (message_data.length() == 0) {
*storage =
@@ -1308,20 +1314,19 @@ QuicMemSliceSpan MakeSpan(QuicBufferAllocator* allocator,
return storage->ToSpan();
}
-QuicMemSlice MemSliceFromString(quiche::QuicheStringPiece data) {
+QuicMemSlice MemSliceFromString(absl::string_view data) {
static SimpleBufferAllocator* allocator = new SimpleBufferAllocator();
QuicUniqueBufferPtr buffer = MakeUniqueBuffer(allocator, data.size());
memcpy(buffer.get(), data.data(), data.size());
return QuicMemSlice(std::move(buffer), data.size());
}
-bool TaggingEncrypter::EncryptPacket(
- uint64_t /*packet_number*/,
- quiche::QuicheStringPiece /*associated_data*/,
- quiche::QuicheStringPiece plaintext,
- char* output,
- size_t* output_length,
- size_t max_output_length) {
+bool TaggingEncrypter::EncryptPacket(uint64_t /*packet_number*/,
+ absl::string_view /*associated_data*/,
+ absl::string_view plaintext,
+ char* output,
+ size_t* output_length,
+ size_t max_output_length) {
const size_t len = plaintext.size() + kTagSize;
if (max_output_length < len) {
return false;
@@ -1334,13 +1339,12 @@ bool TaggingEncrypter::EncryptPacket(
return true;
}
-bool TaggingDecrypter::DecryptPacket(
- uint64_t /*packet_number*/,
- quiche::QuicheStringPiece /*associated_data*/,
- quiche::QuicheStringPiece ciphertext,
- char* output,
- size_t* output_length,
- size_t /*max_output_length*/) {
+bool TaggingDecrypter::DecryptPacket(uint64_t /*packet_number*/,
+ absl::string_view /*associated_data*/,
+ absl::string_view ciphertext,
+ char* output,
+ size_t* output_length,
+ size_t /*max_output_length*/) {
if (ciphertext.size() < kTagSize) {
return false;
}
@@ -1352,8 +1356,7 @@ bool TaggingDecrypter::DecryptPacket(
return true;
}
-bool TaggingDecrypter::CheckTag(quiche::QuicheStringPiece ciphertext,
- uint8_t tag) {
+bool TaggingDecrypter::CheckTag(absl::string_view ciphertext, uint8_t tag) {
for (size_t i = ciphertext.size() - kTagSize; i < ciphertext.size(); i++) {
if (ciphertext.data()[i] != tag) {
return false;
@@ -1394,9 +1397,10 @@ TestPacketWriter::~TestPacketWriter() {
WriteResult TestPacketWriter::WritePacket(const char* buffer,
size_t buf_len,
- const QuicIpAddress& /*self_address*/,
+ const QuicIpAddress& self_address,
const QuicSocketAddress& peer_address,
PerPacketOptions* /*options*/) {
+ last_write_source_address_ = self_address;
last_write_peer_address_ = peer_address;
// If the buffer is allocated from the pool, return it back to the pool.
// Note the buffer content doesn't change.
@@ -1517,5 +1521,96 @@ void TestPacketWriter::FreePacketBuffer(const char* buffer) {
packet_buffer_free_list_.push_back(p);
}
+bool WriteServerVersionNegotiationProbeResponse(
+ char* packet_bytes,
+ size_t* packet_length_out,
+ const char* source_connection_id_bytes,
+ uint8_t source_connection_id_length) {
+ if (packet_bytes == nullptr) {
+ QUIC_BUG << "Invalid packet_bytes";
+ return false;
+ }
+ if (packet_length_out == nullptr) {
+ QUIC_BUG << "Invalid packet_length_out";
+ return false;
+ }
+ QuicConnectionId source_connection_id(source_connection_id_bytes,
+ source_connection_id_length);
+ std::unique_ptr<QuicEncryptedPacket> encrypted_packet =
+ QuicFramer::BuildVersionNegotiationPacket(
+ source_connection_id, EmptyQuicConnectionId(),
+ /*ietf_quic=*/true, /*use_length_prefix=*/true,
+ ParsedQuicVersionVector{});
+ if (!encrypted_packet) {
+ QUIC_BUG << "Failed to create version negotiation packet";
+ return false;
+ }
+ if (*packet_length_out < encrypted_packet->length()) {
+ QUIC_BUG << "Invalid *packet_length_out " << *packet_length_out << " < "
+ << encrypted_packet->length();
+ return false;
+ }
+ *packet_length_out = encrypted_packet->length();
+ memcpy(packet_bytes, encrypted_packet->data(), *packet_length_out);
+ return true;
+}
+
+bool ParseClientVersionNegotiationProbePacket(
+ const char* packet_bytes,
+ size_t packet_length,
+ char* destination_connection_id_bytes,
+ uint8_t* destination_connection_id_length_out) {
+ if (packet_bytes == nullptr) {
+ QUIC_BUG << "Invalid packet_bytes";
+ return false;
+ }
+ if (packet_length < kMinPacketSizeForVersionNegotiation ||
+ packet_length > 65535) {
+ QUIC_BUG << "Invalid packet_length";
+ return false;
+ }
+ if (destination_connection_id_bytes == nullptr) {
+ QUIC_BUG << "Invalid destination_connection_id_bytes";
+ return false;
+ }
+ if (destination_connection_id_length_out == nullptr) {
+ QUIC_BUG << "Invalid destination_connection_id_length_out";
+ return false;
+ }
+
+ QuicEncryptedPacket encrypted_packet(packet_bytes, packet_length);
+ PacketHeaderFormat format;
+ QuicLongHeaderType long_packet_type;
+ bool version_present, has_length_prefix, retry_token_present;
+ QuicVersionLabel version_label;
+ ParsedQuicVersion parsed_version = ParsedQuicVersion::Unsupported();
+ QuicConnectionId destination_connection_id, source_connection_id;
+ absl::string_view retry_token;
+ std::string detailed_error;
+ QuicErrorCode error = QuicFramer::ParsePublicHeaderDispatcher(
+ encrypted_packet,
+ /*expected_destination_connection_id_length=*/0, &format,
+ &long_packet_type, &version_present, &has_length_prefix, &version_label,
+ &parsed_version, &destination_connection_id, &source_connection_id,
+ &retry_token_present, &retry_token, &detailed_error);
+ if (error != QUIC_NO_ERROR) {
+ QUIC_BUG << "Failed to parse packet: " << detailed_error;
+ return false;
+ }
+ if (!version_present) {
+ QUIC_BUG << "Packet is not a long header";
+ return false;
+ }
+ if (*destination_connection_id_length_out <
+ destination_connection_id.length()) {
+ QUIC_BUG << "destination_connection_id_length_out too small";
+ return false;
+ }
+ *destination_connection_id_length_out = destination_connection_id.length();
+ memcpy(destination_connection_id_bytes, destination_connection_id.data(),
+ *destination_connection_id_length_out);
+ return true;
+}
+
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.h
index 457663e8817..f05859d9317 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_test_utils.h
@@ -13,6 +13,7 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/loss_detection_interface.h"
#include "net/third_party/quiche/src/quic/core/congestion_control/send_algorithm_interface.h"
#include "net/third_party/quiche/src/quic/core/crypto/transport_parameters.h"
@@ -23,6 +24,7 @@
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_framer.h"
#include "net/third_party/quiche/src/quic/core/quic_packet_writer.h"
+#include "net/third_party/quiche/src/quic/core/quic_path_validator.h"
#include "net/third_party/quiche/src/quic/core/quic_sent_packet_manager.h"
#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
#include "net/third_party/quiche/src/quic/core/quic_simple_buffer_allocator.h"
@@ -36,7 +38,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_framer_peer.h"
#include "net/third_party/quiche/src/quic/test_tools/simple_quic_framer.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -249,10 +250,12 @@ std::unique_ptr<QuicPacket> BuildUnsizedDataPacket(
size_t packet_size);
// Compute SHA-1 hash of the supplied std::string.
-std::string Sha1Hash(quiche::QuicheStringPiece data);
+std::string Sha1Hash(absl::string_view data);
// Delete |frame| and return true.
bool ClearControlFrame(const QuicFrame& frame);
+bool ClearControlFrameWithTransmissionType(const QuicFrame& frame,
+ TransmissionType type);
// Simple random number generator used to compute random numbers suitable
// for pseudo-randomly dropping packets in tests.
@@ -304,9 +307,9 @@ class MockFramerVisitor : public QuicFramerVisitorInterface {
OnRetryPacket,
(QuicConnectionId original_connection_id,
QuicConnectionId new_connection_id,
- quiche::QuicheStringPiece retry_token,
- quiche::QuicheStringPiece retry_integrity_tag,
- quiche::QuicheStringPiece retry_without_tag),
+ absl::string_view retry_token,
+ absl::string_view retry_integrity_tag,
+ absl::string_view retry_without_tag),
(override));
// The constructor sets this up to return true by default.
MOCK_METHOD(bool,
@@ -424,6 +427,16 @@ class MockFramerVisitor : public QuicFramerVisitorInterface {
OnAuthenticatedIetfStatelessResetPacket,
(const QuicIetfStatelessResetPacket&),
(override));
+ MOCK_METHOD(void, OnKeyUpdate, (KeyUpdateReason), (override));
+ MOCK_METHOD(void, OnDecryptedFirstPacketInKeyPhase, (), (override));
+ MOCK_METHOD(std::unique_ptr<QuicDecrypter>,
+ AdvanceKeysAndCreateCurrentOneRttDecrypter,
+ (),
+ (override));
+ MOCK_METHOD(std::unique_ptr<QuicEncrypter>,
+ CreateCurrentOneRttEncrypter,
+ (),
+ (override));
};
class NoOpFramerVisitor : public QuicFramerVisitorInterface {
@@ -439,10 +452,9 @@ class NoOpFramerVisitor : public QuicFramerVisitorInterface {
const QuicVersionNegotiationPacket& /*packet*/) override {}
void OnRetryPacket(QuicConnectionId /*original_connection_id*/,
QuicConnectionId /*new_connection_id*/,
- quiche::QuicheStringPiece /*retry_token*/,
- quiche::QuicheStringPiece /*retry_integrity_tag*/,
- quiche::QuicheStringPiece /*retry_without_tag*/) override {
- }
+ absl::string_view /*retry_token*/,
+ absl::string_view /*retry_integrity_tag*/,
+ absl::string_view /*retry_without_tag*/) override {}
bool OnProtocolVersionMismatch(ParsedQuicVersion version) override;
bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override;
bool OnUnauthenticatedPublicHeader(const QuicPacketHeader& header) override;
@@ -484,6 +496,15 @@ class NoOpFramerVisitor : public QuicFramerVisitorInterface {
bool IsValidStatelessResetToken(QuicUint128 token) const override;
void OnAuthenticatedIetfStatelessResetPacket(
const QuicIetfStatelessResetPacket& /*packet*/) override {}
+ void OnKeyUpdate(KeyUpdateReason /*reason*/) override {}
+ void OnDecryptedFirstPacketInKeyPhase() override {}
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
};
class MockQuicConnectionVisitor : public QuicConnectionVisitorInterface {
@@ -506,10 +527,7 @@ class MockQuicConnectionVisitor : public QuicConnectionVisitorInterface {
(override));
MOCK_METHOD(void, OnRstStream, (const QuicRstStreamFrame& frame), (override));
MOCK_METHOD(void, OnGoAway, (const QuicGoAwayFrame& frame), (override));
- MOCK_METHOD(void,
- OnMessageReceived,
- (quiche::QuicheStringPiece message),
- (override));
+ MOCK_METHOD(void, OnMessageReceived, (absl::string_view message), (override));
MOCK_METHOD(void, OnHandshakeDoneReceived, (), (override));
MOCK_METHOD(void,
OnConnectionClosed,
@@ -545,6 +563,10 @@ class MockQuicConnectionVisitor : public QuicConnectionVisitorInterface {
(override));
MOCK_METHOD(void, OnAckNeedsRetransmittableFrame, (), (override));
MOCK_METHOD(void, SendPing, (), (override));
+ MOCK_METHOD(void,
+ SendAckFrequency,
+ (const QuicAckFrequencyFrame& frame),
+ (override));
MOCK_METHOD(bool, AllowSelfAddressChange, (), (const, override));
MOCK_METHOD(HandshakeState, GetHandshakeState, (), (const, override));
MOCK_METHOD(bool,
@@ -562,6 +584,16 @@ class MockQuicConnectionVisitor : public QuicConnectionVisitorInterface {
MOCK_METHOD(void, OnPacketDecrypted, (EncryptionLevel), (override));
MOCK_METHOD(void, OnOneRttPacketAcknowledged, (), (override));
MOCK_METHOD(void, OnHandshakePacketSent, (), (override));
+ MOCK_METHOD(void, OnKeyUpdate, (KeyUpdateReason), (override));
+ MOCK_METHOD(std::unique_ptr<QuicDecrypter>,
+ AdvanceKeysAndCreateCurrentOneRttDecrypter,
+ (),
+ (override));
+ MOCK_METHOD(std::unique_ptr<QuicEncrypter>,
+ CreateCurrentOneRttEncrypter,
+ (),
+ (override));
+ MOCK_METHOD(void, BeforeConnectionCloseSent, (), (override));
};
class MockQuicConnectionHelper : public QuicConnectionHelperInterface {
@@ -706,6 +738,11 @@ class MockQuicConnection : public QuicConnection {
QuicConnection::CloseConnection(error, details, connection_close_behavior);
}
+ void ReallySendConnectionClosePacket(QuicErrorCode error,
+ const std::string& details) {
+ QuicConnection::SendConnectionClosePacket(error, details);
+ }
+
void ReallyProcessUdpPacket(const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
const QuicReceivedPacket& packet) {
@@ -803,7 +840,11 @@ class MockQuicSession : public QuicSession {
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level),
+ absl::optional<EncryptionLevel> level),
+ (override));
+ MOCK_METHOD(bool,
+ WriteControlFrame,
+ (const QuicFrame& frame, TransmissionType type),
(override));
MOCK_METHOD(void,
@@ -813,6 +854,16 @@ class MockQuicSession : public QuicSession {
QuicStreamOffset bytes_written,
bool send_rst_only),
(override));
+ MOCK_METHOD(void,
+ MaybeSendRstStreamFrame,
+ (QuicStreamId stream_id,
+ QuicRstStreamErrorCode error,
+ QuicStreamOffset bytes_written),
+ (override));
+ MOCK_METHOD(void,
+ MaybeSendStopSendingFrame,
+ (QuicStreamId stream_id, QuicRstStreamErrorCode error),
+ (override));
MOCK_METHOD(bool, ShouldKeepConnectionAlive, (), (const, override));
MOCK_METHOD(void,
@@ -820,11 +871,11 @@ class MockQuicSession : public QuicSession {
(QuicRstStreamErrorCode code, QuicStreamId stream_id),
(override));
MOCK_METHOD(std::vector<std::string>, GetAlpnsToOffer, (), (const, override));
- MOCK_METHOD(std::vector<quiche::QuicheStringPiece>::const_iterator,
+ MOCK_METHOD(std::vector<absl::string_view>::const_iterator,
SelectAlpn,
- (const std::vector<quiche::QuicheStringPiece>&),
+ (const std::vector<absl::string_view>&),
(const, override));
- MOCK_METHOD(void, OnAlpnSelected, (quiche::QuicheStringPiece), (override));
+ MOCK_METHOD(void, OnAlpnSelected, (absl::string_view), (override));
using QuicSession::ActivateStream;
@@ -835,7 +886,7 @@ class MockQuicSession : public QuicSession {
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level);
+ absl::optional<EncryptionLevel> level);
void ReallySendRstStream(QuicStreamId id,
QuicRstStreamErrorCode error,
@@ -844,6 +895,12 @@ class MockQuicSession : public QuicSession {
QuicSession::SendRstStream(id, error, bytes_written, send_rst_only);
}
+ void ReallyMaybeSendRstStreamFrame(QuicStreamId id,
+ QuicRstStreamErrorCode error,
+ QuicStreamOffset bytes_written) {
+ QuicSession::MaybeSendRstStreamFrame(id, error, bytes_written);
+ }
+
private:
std::unique_ptr<QuicCryptoStream> crypto_stream_;
};
@@ -869,6 +926,14 @@ class MockQuicCryptoStream : public QuicCryptoStream {
HandshakeState GetHandshakeState() const override { return HANDSHAKE_START; }
void SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> /*application_state*/) override {}
+ bool KeyUpdateSupportedLocally() const override { return false; }
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
private:
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_;
@@ -927,7 +992,7 @@ class MockQuicSpdySession : public QuicSpdySession {
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level),
+ absl::optional<EncryptionLevel> level),
(override));
MOCK_METHOD(void,
SendRstStream,
@@ -937,6 +1002,16 @@ class MockQuicSpdySession : public QuicSpdySession {
bool send_rst_only),
(override));
MOCK_METHOD(void,
+ MaybeSendRstStreamFrame,
+ (QuicStreamId stream_id,
+ QuicRstStreamErrorCode error,
+ QuicStreamOffset bytes_written),
+ (override));
+ MOCK_METHOD(void,
+ MaybeSendStopSendingFrame,
+ (QuicStreamId stream_id, QuicRstStreamErrorCode error),
+ (override));
+ MOCK_METHOD(void,
SendWindowUpdate,
(QuicStreamId id, QuicStreamOffset byte_offset),
(override));
@@ -973,7 +1048,7 @@ class MockQuicSpdySession : public QuicSpdySession {
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level);
+ absl::optional<EncryptionLevel> level);
using QuicSession::ActivateStream;
@@ -1087,11 +1162,11 @@ class TestQuicSpdyServerSession : public QuicServerSessionBase {
CreateOutgoingUnidirectionalStream,
(),
(override));
- MOCK_METHOD(std::vector<quiche::QuicheStringPiece>::const_iterator,
+ MOCK_METHOD(std::vector<absl::string_view>::const_iterator,
SelectAlpn,
- (const std::vector<quiche::QuicheStringPiece>&),
+ (const std::vector<absl::string_view>&),
(const, override));
- MOCK_METHOD(void, OnAlpnSelected, (quiche::QuicheStringPiece), (override));
+ MOCK_METHOD(void, OnAlpnSelected, (absl::string_view), (override));
std::unique_ptr<QuicCryptoServerStreamBase> CreateQuicCryptoServerStream(
const QuicCryptoServerConfig* crypto_config,
QuicCompressedCertsCache* compressed_certs_cache) override;
@@ -1174,7 +1249,7 @@ class TestQuicSpdyClientSession : public QuicSpdyClientSessionBase {
MOCK_METHOD(bool, ShouldCreateOutgoingBidirectionalStream, (), (override));
MOCK_METHOD(bool, ShouldCreateOutgoingUnidirectionalStream, (), (override));
MOCK_METHOD(std::vector<std::string>, GetAlpnsToOffer, (), (const, override));
- MOCK_METHOD(void, OnAlpnSelected, (quiche::QuicheStringPiece), (override));
+ MOCK_METHOD(void, OnAlpnSelected, (absl::string_view), (override));
MOCK_METHOD(void, OnConfigNegotiated, (), (override));
QuicCryptoClientStream* GetMutableCryptoStream() override;
@@ -1409,7 +1484,9 @@ class MockQuicConnectionDebugVisitor : public QuicConnectionDebugVisitor {
MOCK_METHOD(void,
OnPacketHeader,
- (const QuicPacketHeader& header),
+ (const QuicPacketHeader& header,
+ QuicTime receive_time,
+ EncryptionLevel level),
(override));
MOCK_METHOD(void,
@@ -1557,6 +1634,33 @@ class MockSessionNotifier : public SessionNotifierInterface {
MOCK_METHOD(bool, HasUnackedStreamData, (), (const, override));
};
+class MockQuicPathValidationContext : public QuicPathValidationContext {
+ public:
+ MockQuicPathValidationContext(const QuicSocketAddress& self_address,
+ const QuicSocketAddress& peer_address,
+ QuicPacketWriter* writer)
+ : QuicPathValidationContext(self_address, peer_address),
+ writer_(writer) {}
+ QuicPacketWriter* WriterToUse() override { return writer_; }
+
+ private:
+ QuicPacketWriter* writer_;
+};
+
+class MockQuicPathValidationResultDelegate
+ : public QuicPathValidator::ResultDelegate {
+ public:
+ MOCK_METHOD(void,
+ OnPathValidationSuccess,
+ (std::unique_ptr<QuicPathValidationContext>),
+ (override));
+
+ MOCK_METHOD(void,
+ OnPathValidationFailure,
+ (std::unique_ptr<QuicPathValidationContext>),
+ (override));
+};
+
class QuicCryptoClientStreamPeer {
public:
QuicCryptoClientStreamPeer() = delete;
@@ -1653,7 +1757,7 @@ QuicHeaderList AsHeaderList(const T& container) {
}
// Utility function that stores |str|'s data in |iov|.
-inline void MakeIOVector(quiche::QuicheStringPiece str, struct iovec* iov) {
+inline void MakeIOVector(absl::string_view str, struct iovec* iov) {
iov->iov_base = const_cast<char*>(str.data());
iov->iov_len = static_cast<size_t>(str.size());
}
@@ -1683,12 +1787,12 @@ StreamType DetermineStreamType(QuicStreamId id,
// Utility function that stores message_data in |storage| and returns a
// QuicMemSliceSpan.
QuicMemSliceSpan MakeSpan(QuicBufferAllocator* allocator,
- quiche::QuicheStringPiece message_data,
+ absl::string_view message_data,
QuicMemSliceStorage* storage);
// Creates a MemSlice using a singleton trivial buffer allocator. Performs a
// copy.
-QuicMemSlice MemSliceFromString(quiche::QuicheStringPiece data);
+QuicMemSlice MemSliceFromString(absl::string_view data);
// Used to compare ReceivedPacketInfo.
MATCHER_P(ReceivedPacketInfoEquals, info, "") {
@@ -1754,27 +1858,27 @@ class TaggingEncrypter : public QuicEncrypter {
~TaggingEncrypter() override {}
// QuicEncrypter interface.
- bool SetKey(quiche::QuicheStringPiece /*key*/) override { return true; }
+ bool SetKey(absl::string_view /*key*/) override { return true; }
- bool SetNoncePrefix(quiche::QuicheStringPiece /*nonce_prefix*/) override {
+ bool SetNoncePrefix(absl::string_view /*nonce_prefix*/) override {
return true;
}
- bool SetIV(quiche::QuicheStringPiece /*iv*/) override { return true; }
+ bool SetIV(absl::string_view /*iv*/) override { return true; }
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece /*key*/) override {
+ bool SetHeaderProtectionKey(absl::string_view /*key*/) override {
return true;
}
bool EncryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece plaintext,
+ absl::string_view associated_data,
+ absl::string_view plaintext,
char* output,
size_t* output_length,
size_t max_output_length) override;
std::string GenerateHeaderProtectionMask(
- quiche::QuicheStringPiece /*sample*/) override {
+ absl::string_view /*sample*/) override {
return std::string(5, 0);
}
@@ -1790,12 +1894,14 @@ class TaggingEncrypter : public QuicEncrypter {
return plaintext_size + kTagSize;
}
- quiche::QuicheStringPiece GetKey() const override {
- return quiche::QuicheStringPiece();
+ QuicPacketCount GetConfidentialityLimit() const override {
+ return std::numeric_limits<QuicPacketCount>::max();
}
- quiche::QuicheStringPiece GetNoncePrefix() const override {
- return quiche::QuicheStringPiece();
+ absl::string_view GetKey() const override { return absl::string_view(); }
+
+ absl::string_view GetNoncePrefix() const override {
+ return absl::string_view();
}
private:
@@ -1813,19 +1919,19 @@ class TaggingDecrypter : public QuicDecrypter {
~TaggingDecrypter() override {}
// QuicDecrypter interface
- bool SetKey(quiche::QuicheStringPiece /*key*/) override { return true; }
+ bool SetKey(absl::string_view /*key*/) override { return true; }
- bool SetNoncePrefix(quiche::QuicheStringPiece /*nonce_prefix*/) override {
+ bool SetNoncePrefix(absl::string_view /*nonce_prefix*/) override {
return true;
}
- bool SetIV(quiche::QuicheStringPiece /*iv*/) override { return true; }
+ bool SetIV(absl::string_view /*iv*/) override { return true; }
- bool SetHeaderProtectionKey(quiche::QuicheStringPiece /*key*/) override {
+ bool SetHeaderProtectionKey(absl::string_view /*key*/) override {
return true;
}
- bool SetPreliminaryKey(quiche::QuicheStringPiece /*key*/) override {
+ bool SetPreliminaryKey(absl::string_view /*key*/) override {
QUIC_BUG << "should not be called";
return false;
}
@@ -1835,8 +1941,8 @@ class TaggingDecrypter : public QuicDecrypter {
}
bool DecryptPacket(uint64_t packet_number,
- quiche::QuicheStringPiece associated_data,
- quiche::QuicheStringPiece ciphertext,
+ absl::string_view associated_data,
+ absl::string_view ciphertext,
char* output,
size_t* output_length,
size_t max_output_length) override;
@@ -1849,17 +1955,18 @@ class TaggingDecrypter : public QuicDecrypter {
size_t GetKeySize() const override { return 0; }
size_t GetNoncePrefixSize() const override { return 0; }
size_t GetIVSize() const override { return 0; }
- quiche::QuicheStringPiece GetKey() const override {
- return quiche::QuicheStringPiece();
- }
- quiche::QuicheStringPiece GetNoncePrefix() const override {
- return quiche::QuicheStringPiece();
+ absl::string_view GetKey() const override { return absl::string_view(); }
+ absl::string_view GetNoncePrefix() const override {
+ return absl::string_view();
}
// Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
uint32_t cipher_id() const override { return 0xFFFFFFF0; }
+ QuicPacketCount GetIntegrityLimit() const override {
+ return std::numeric_limits<QuicPacketCount>::max();
+ }
protected:
- virtual uint8_t GetTag(quiche::QuicheStringPiece ciphertext) {
+ virtual uint8_t GetTag(absl::string_view ciphertext) {
return ciphertext.data()[ciphertext.size() - 1];
}
@@ -1868,12 +1975,29 @@ class TaggingDecrypter : public QuicDecrypter {
kTagSize = 12,
};
- bool CheckTag(quiche::QuicheStringPiece ciphertext, uint8_t tag);
+ bool CheckTag(absl::string_view ciphertext, uint8_t tag);
+};
+
+// StringTaggingDecrypter ensures that the final kTagSize bytes of the message
+// match the expected value.
+class StrictTaggingDecrypter : public TaggingDecrypter {
+ public:
+ explicit StrictTaggingDecrypter(uint8_t tag) : tag_(tag) {}
+ ~StrictTaggingDecrypter() override {}
+
+ // TaggingQuicDecrypter
+ uint8_t GetTag(absl::string_view /*ciphertext*/) override { return tag_; }
+
+ // Use a distinct value starting with 0xFFFFFF, which is never used by TLS.
+ uint32_t cipher_id() const override { return 0xFFFFFFF1; }
+
+ private:
+ const uint8_t tag_;
};
class TestPacketWriter : public QuicPacketWriter {
struct PacketBuffer {
- QUIC_CACHELINE_ALIGNED char buffer[1500];
+ ABSL_CACHELINE_ALIGNED char buffer[1500];
bool in_use = false;
};
@@ -2049,6 +2173,10 @@ class TestPacketWriter : public QuicPacketWriter {
SimpleQuicFramer* framer() { return &framer_; }
+ const QuicIpAddress& last_write_source_address() const {
+ return last_write_source_address_;
+ }
+
const QuicSocketAddress& last_write_peer_address() const {
return last_write_peer_address_;
}
@@ -2092,10 +2220,40 @@ class TestPacketWriter : public QuicPacketWriter {
QuicHashMap<char*, PacketBuffer*> packet_buffer_pool_index_;
// Indices in packet_buffer_pool_ that are not allocated.
std::list<PacketBuffer*> packet_buffer_free_list_;
- // The peer address passed into WritePacket().
+ // The soruce/peer address passed into WritePacket().
+ QuicIpAddress last_write_source_address_;
QuicSocketAddress last_write_peer_address_;
};
+// Parses a packet generated by
+// QuicFramer::WriteClientVersionNegotiationProbePacket.
+// |packet_bytes| must point to |packet_length| bytes in memory which represent
+// the packet. This method will fill in |destination_connection_id_bytes|
+// which must point to at least |*destination_connection_id_length_out| bytes in
+// memory. |*destination_connection_id_length_out| will contain the length of
+// the received destination connection ID, which on success will match the
+// contents of the destination connection ID passed in to
+// WriteClientVersionNegotiationProbePacket.
+bool ParseClientVersionNegotiationProbePacket(
+ const char* packet_bytes,
+ size_t packet_length,
+ char* destination_connection_id_bytes,
+ uint8_t* destination_connection_id_length_out);
+
+// Writes an array of bytes that correspond to a QUIC version negotiation packet
+// that a QUIC server would send in response to a probe created by
+// QuicFramer::WriteClientVersionNegotiationProbePacket.
+// The bytes will be written to |packet_bytes|, which must point to
+// |*packet_length_out| bytes of memory. |*packet_length_out| will contain the
+// length of the created packet. |source_connection_id_bytes| will be sent as
+// the source connection ID, and must point to |source_connection_id_length|
+// bytes of memory.
+bool WriteServerVersionNegotiationProbeResponse(
+ char* packet_bytes,
+ size_t* packet_length_out,
+ const char* source_connection_id_bytes,
+ uint8_t source_connection_id_length);
+
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h
index 50db80aec5d..ba0cc39f924 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_transport_test_tools.h
@@ -17,10 +17,7 @@ class MockClientVisitor : public QuicTransportClientSession::ClientVisitor {
MOCK_METHOD(void, OnSessionReady, (), (override));
MOCK_METHOD(void, OnIncomingBidirectionalStreamAvailable, (), (override));
MOCK_METHOD(void, OnIncomingUnidirectionalStreamAvailable, (), (override));
- MOCK_METHOD(void,
- OnDatagramReceived,
- (quiche::QuicheStringPiece),
- (override));
+ MOCK_METHOD(void, OnDatagramReceived, (absl::string_view), (override));
MOCK_METHOD(void, OnCanCreateNewOutgoingBidirectionalStream, (), (override));
MOCK_METHOD(void, OnCanCreateNewOutgoingUnidirectionalStream, (), (override));
};
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.cc
index 1ecc65f2480..fa3408c0bb7 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.cc
@@ -20,5 +20,11 @@ void QuicUnackedPacketMapPeer::SetPerspective(
*const_cast<Perspective*>(&unacked_packets->perspective_) = perspective;
}
+// static
+size_t QuicUnackedPacketMapPeer::GetCapacity(
+ const QuicUnackedPacketMap& unacked_packets) {
+ return unacked_packets.unacked_packets_.capacity();
+}
+
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.h b/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.h
index 3bba0b6ced4..17c88fe93bb 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/quic_unacked_packet_map_peer.h
@@ -17,6 +17,8 @@ class QuicUnackedPacketMapPeer {
static void SetPerspective(QuicUnackedPacketMap* unacked_packets,
Perspective perspective);
+
+ static size_t GetCapacity(const QuicUnackedPacketMap& unacked_packets);
};
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.cc
index 0d5fa5b37a6..619051d4e7d 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.cc
@@ -6,11 +6,11 @@
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_data_writer.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,7 +36,7 @@ void SimpleDataProducer::SaveStreamData(QuicStreamId id,
void SimpleDataProducer::SaveCryptoData(EncryptionLevel level,
QuicStreamOffset offset,
- quiche::QuicheStringPiece data) {
+ absl::string_view data) {
auto key = std::make_pair(level, offset);
crypto_buffer_map_[key] = data;
}
@@ -65,7 +65,7 @@ bool SimpleDataProducer::WriteCryptoData(EncryptionLevel level,
return false;
}
return writer->WriteStringPiece(
- quiche::QuicheStringPiece(it->second.data(), data_length));
+ absl::string_view(it->second.data(), data_length));
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.h b/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.h
index 626d1e991ea..4904dd35a41 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/simple_data_producer.h
@@ -5,11 +5,11 @@
#ifndef QUICHE_QUIC_TEST_TOOLS_SIMPLE_DATA_PRODUCER_H_
#define QUICHE_QUIC_TEST_TOOLS_SIMPLE_DATA_PRODUCER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_simple_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/core/quic_stream_frame_data_producer.h"
#include "net/third_party/quiche/src/quic/core/quic_stream_send_buffer.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,7 +36,7 @@ class SimpleDataProducer : public QuicStreamFrameDataProducer {
void SaveCryptoData(EncryptionLevel level,
QuicStreamOffset offset,
- quiche::QuicheStringPiece data);
+ absl::string_view data);
// QuicStreamFrameDataProducer
WriteStreamDataResult WriteStreamData(QuicStreamId id,
@@ -63,7 +63,7 @@ class SimpleDataProducer : public QuicStreamFrameDataProducer {
using CryptoBufferMap =
QuicHashMap<std::pair<EncryptionLevel, QuicStreamOffset>,
- quiche::QuicheStringPiece,
+ absl::string_view,
PairHash>;
SimpleBufferAllocator allocator_;
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/simple_quic_framer.cc b/chromium/net/third_party/quiche/src/quic/test_tools/simple_quic_framer.cc
index 8ec56dc9ed8..ccce52b9eba 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/simple_quic_framer.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/simple_quic_framer.cc
@@ -7,10 +7,10 @@
#include <memory>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_ptr_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace test {
@@ -41,10 +41,9 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
void OnRetryPacket(QuicConnectionId /*original_connection_id*/,
QuicConnectionId /*new_connection_id*/,
- quiche::QuicheStringPiece /*retry_token*/,
- quiche::QuicheStringPiece /*retry_integrity_tag*/,
- quiche::QuicheStringPiece /*retry_without_tag*/) override {
- }
+ absl::string_view /*retry_token*/,
+ absl::string_view /*retry_integrity_tag*/,
+ absl::string_view /*retry_without_tag*/) override {}
bool OnUnauthenticatedPublicHeader(
const QuicPacketHeader& /*header*/) override {
@@ -78,7 +77,7 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
// TODO(ianswett): A pointer isn't necessary with emplace_back.
stream_frames_.push_back(std::make_unique<QuicStreamFrame>(
frame.stream_id, frame.fin, frame.offset,
- quiche::QuicheStringPiece(*string_data)));
+ absl::string_view(*string_data)));
return true;
}
@@ -88,7 +87,7 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
new std::string(frame.data_buffer, frame.data_length);
crypto_data_.push_back(QuicWrapUnique(string_data));
crypto_frames_.push_back(std::make_unique<QuicCryptoFrame>(
- frame.level, frame.offset, quiche::QuicheStringPiece(*string_data)));
+ frame.level, frame.offset, absl::string_view(*string_data)));
return true;
}
@@ -221,6 +220,16 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
std::make_unique<QuicIetfStatelessResetPacket>(packet);
}
+ void OnKeyUpdate(KeyUpdateReason /*reason*/) override {}
+ void OnDecryptedFirstPacketInKeyPhase() override {}
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
+
const QuicPacketHeader& header() const { return header_; }
const std::vector<QuicAckFrame>& ack_frames() const { return ack_frames_; }
const std::vector<QuicConnectionCloseFrame>& connection_close_frames() const {
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/queue.h b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/queue.h
index 6c3c6b0ef17..f9a75607911 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/queue.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/queue.h
@@ -55,7 +55,7 @@ class Queue : public Actor, public UnconstrainedPortInterface {
QuicTime::Delta aggregation_timeout);
private:
- typedef uint64_t AggregationBundleNumber;
+ using AggregationBundleNumber = uint64_t;
// In order to implement packet aggregation, each packet is tagged with a
// bundle number. The queue keeps a bundle counter, and whenever a bundle is
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.cc b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.cc
index 0f04427522c..c02ac7e83b6 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.cc
@@ -34,10 +34,9 @@ QuicEndpoint::QuicEndpoint(Simulator* simulator,
wrong_data_received_(false),
notifier_(nullptr) {
connection_ = std::make_unique<QuicConnection>(
- connection_id, GetAddressFromName(peer_name), simulator,
- simulator->GetAlarmFactory(), &writer_, false, perspective,
+ connection_id, GetAddressFromName(name), GetAddressFromName(peer_name),
+ simulator, simulator->GetAlarmFactory(), &writer_, false, perspective,
ParsedVersionOfIndex(CurrentSupportedVersions(), 0));
- connection_->SetSelfAddress(GetAddressFromName(name));
connection_->set_visitor(this);
connection_->SetEncrypter(ENCRYPTION_FORWARD_SECURE,
std::make_unique<NullEncrypter>(perspective));
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.h b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.h
index ff9b680f58f..681cd33c93d 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.h
@@ -5,6 +5,7 @@
#ifndef QUICHE_QUIC_TEST_TOOLS_SIMULATOR_QUIC_ENDPOINT_H_
#define QUICHE_QUIC_TEST_TOOLS_SIMULATOR_QUIC_ENDPOINT_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_decrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
@@ -17,7 +18,6 @@
#include "net/third_party/quiche/src/quic/test_tools/simulator/link.h"
#include "net/third_party/quiche/src/quic/test_tools/simulator/queue.h"
#include "net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint_base.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
namespace simulator {
@@ -64,7 +64,7 @@ class QuicEndpoint : public QuicEndpointBase,
void OnBlockedFrame(const QuicBlockedFrame& /*frame*/) override {}
void OnRstStream(const QuicRstStreamFrame& /*frame*/) override {}
void OnGoAway(const QuicGoAwayFrame& /*frame*/) override {}
- void OnMessageReceived(quiche::QuicheStringPiece /*message*/) override {}
+ void OnMessageReceived(absl::string_view /*message*/) override {}
void OnHandshakeDoneReceived() override {}
void OnConnectionClosed(const QuicConnectionCloseFrame& /*frame*/,
ConnectionCloseSource /*source*/) override {}
@@ -80,6 +80,7 @@ class QuicEndpoint : public QuicEndpointBase,
void OnForwardProgressMadeAfterPathDegrading() override {}
void OnAckNeedsRetransmittableFrame() override {}
void SendPing() override {}
+ void SendAckFrequency(const QuicAckFrequencyFrame& /*frame*/) override {}
bool AllowSelfAddressChange() const override;
HandshakeState GetHandshakeState() const override;
bool OnMaxStreamsFrame(const QuicMaxStreamsFrame& /*frame*/) override {
@@ -93,6 +94,15 @@ class QuicEndpoint : public QuicEndpointBase,
void OnPacketDecrypted(EncryptionLevel /*level*/) override {}
void OnOneRttPacketAcknowledged() override {}
void OnHandshakePacketSent() override {}
+ void OnKeyUpdate(KeyUpdateReason /*reason*/) override {}
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ return nullptr;
+ }
+ void BeforeConnectionCloseSent() override {}
// End QuicConnectionVisitorInterface implementation.
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/switch.h b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/switch.h
index 3e4cc205bd7..750b24b93f3 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/simulator/switch.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/simulator/switch.h
@@ -13,7 +13,7 @@
namespace quic {
namespace simulator {
-typedef size_t SwitchPortNumber;
+using SwitchPortNumber = size_t;
// Simulates a network switch with simple persistent learning scheme and queues
// on every output port.
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.cc b/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.cc
index 025a81608e7..acbea922274 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.cc
@@ -8,7 +8,7 @@ namespace quic {
namespace test {
// A test certificate generated by //net/tools/quic/certs/generate-certs.sh.
-QUIC_CONST_INIT const char kTestCertificateRaw[] = {
+ABSL_CONST_INIT const char kTestCertificateRaw[] = {
'\x30', '\x82', '\x03', '\xb4', '\x30', '\x82', '\x02', '\x9c', '\xa0',
'\x03', '\x02', '\x01', '\x02', '\x02', '\x01', '\x01', '\x30', '\x0d',
'\x06', '\x09', '\x2a', '\x86', '\x48', '\x86', '\xf7', '\x0d', '\x01',
@@ -116,11 +116,11 @@ QUIC_CONST_INIT const char kTestCertificateRaw[] = {
'\xd3', '\xfb', '\xba', '\xaf', '\xd9', '\x61', '\x14', '\x3c', '\xe0',
'\xa1', '\xa9', '\x51', '\x51', '\x0f', '\xad', '\x60'};
-QUIC_CONST_INIT const quiche::QuicheStringPiece kTestCertificate(
+ABSL_CONST_INIT const absl::string_view kTestCertificate(
kTestCertificateRaw,
sizeof(kTestCertificateRaw));
-QUIC_CONST_INIT const char kTestCertificatePem[] =
+ABSL_CONST_INIT const char kTestCertificatePem[] =
R"(Certificate:
Data:
Version: 3 (0x2)
@@ -206,7 +206,7 @@ iwl0hHL9kWiTV55wRk3kMIRfIAet/YYy0/u6r9lhFDzgoalRUQ+tYA==
-----END CERTIFICATE-----)";
// Same leaf as above, but with an intermediary attached.
-QUIC_CONST_INIT const char kTestCertificateChainPem[] =
+ABSL_CONST_INIT const char kTestCertificateChainPem[] =
R"(-----BEGIN CERTIFICATE-----
MIIDtDCCApygAwIBAgIBATANBgkqhkiG9w0BAQsFADAeMRwwGgYDVQQDDBNRVUlD
IFNlcnZlciBSb290IENBMB4XDTIwMDEzMDE4MTM1OVoXDTIwMDIwMjE4MTM1OVow
@@ -249,7 +249,7 @@ hTXMooR/wD7an6gtnXD8ixCh7bP0TyPiBhNsUb12WrvSEAm/UyciQbQlR7P+K0Z7
Cmn1Mj4hQ+pT0t+pw/DMOw==
-----END CERTIFICATE-----)";
-QUIC_CONST_INIT const char kTestCertWithUnknownSanTypePem[] =
+ABSL_CONST_INIT const char kTestCertWithUnknownSanTypePem[] =
R"(-----BEGIN CERTIFICATE-----
MIIEYTCCA0mgAwIBAgIJAILStmLgUUcVMA0GCSqGSIb3DQEBCwUAMHYxCzAJBgNV
BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNp
@@ -277,7 +277,7 @@ FmKuuGZamCCj6F1QF2IjMVM8evl84hEnN0ajdkA/QWnil9kcWvBm15Ho+oTvvJ7s
M8MD3RDSq/90FSiME4vbyNEyTmj0
-----END CERTIFICATE-----)";
-QUIC_CONST_INIT const char kTestCertificatePrivateKeyRaw[] = {
+ABSL_CONST_INIT const char kTestCertificatePrivateKeyRaw[] = {
'\x30', '\x82', '\x04', '\xbc', '\x02', '\x01', '\x00', '\x30', '\x0d',
'\x06', '\x09', '\x2a', '\x86', '\x48', '\x86', '\xf7', '\x0d', '\x01',
'\x01', '\x01', '\x05', '\x00', '\x04', '\x82', '\x04', '\xa6', '\x30',
@@ -415,11 +415,11 @@ QUIC_CONST_INIT const char kTestCertificatePrivateKeyRaw[] = {
'\x3e', '\x6b', '\x2e', '\xfa', '\x4f', '\x4d', '\xe6', '\xbe', '\xd3',
'\x59'};
-QUIC_CONST_INIT const quiche::QuicheStringPiece kTestCertificatePrivateKey(
+ABSL_CONST_INIT const absl::string_view kTestCertificatePrivateKey(
kTestCertificatePrivateKeyRaw,
sizeof(kTestCertificatePrivateKeyRaw));
-QUIC_CONST_INIT const char kTestCertificatePrivateKeyPem[] =
+ABSL_CONST_INIT const char kTestCertificatePrivateKeyPem[] =
R"(-----BEGIN PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDF4lFtP9Yo8q00
c4dkyjMZM7d1kasxGSvjpCYJKYst91J1p1UV8BHHwsTtGBszC3Ey5jWJzS1aBVdO
@@ -450,7 +450,7 @@ K6WjyPfTPmsu+k9N5r7TWQ==
-----END PRIVATE KEY-----)";
// The legacy version was manually generated from the one above using der2ascii.
-QUIC_CONST_INIT const char kTestCertificatePrivateKeyLegacyPem[] =
+ABSL_CONST_INIT const char kTestCertificatePrivateKeyLegacyPem[] =
R"(-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAxeJRbT/WKPKtNHOHZMozGTO3dZGrMRkr46QmCSmLLfdSdadVFfARx8LE7Rgb
MwtxMuY1ic0tWgVXTsJ4dWVyLYoXg9YykIX4IuJlqeCg/hmyOS0UAxAvzIteqiUnDaM3EAwX7PCL
@@ -475,7 +475,7 @@ DtM+YIvvZU1YJToItSG2YQz68Gl4Tmg220FLUNjTjj10gI6g5trscIl3sp3WbgrEvfaaBxW6VZ/U
TToPURKk2cKYdsW3KUDK9Lt0LXEDTecFdcCNln5ZoYs7oyulo8j30z5rLvpPTea+01k=
-----END RSA PRIVATE KEY-----)";
-QUIC_CONST_INIT const char kWildcardCertificateRaw[] = {
+ABSL_CONST_INIT const char kWildcardCertificateRaw[] = {
'\x30', '\x82', '\x03', '\x5f', '\x30', '\x82', '\x02', '\x47', '\xa0',
'\x03', '\x02', '\x01', '\x02', '\x02', '\x14', '\x36', '\x1d', '\xe3',
'\xd2', '\x39', '\x35', '\x20', '\xb1', '\xae', '\x18', '\xdd', '\x71',
@@ -574,11 +574,11 @@ QUIC_CONST_INIT const char kWildcardCertificateRaw[] = {
'\xf0', '\xb7', '\xbb', '\x58', '\x4c', '\x8f', '\x6a', '\x5d', '\x8e',
'\x93', '\x5f', '\x35'};
-QUIC_CONST_INIT const quiche::QuicheStringPiece kWildcardCertificate(
+ABSL_CONST_INIT const absl::string_view kWildcardCertificate(
kWildcardCertificateRaw,
sizeof(kWildcardCertificateRaw));
-QUIC_CONST_INIT const char kWildcardCertificatePrivateKeyRaw[] = {
+ABSL_CONST_INIT const char kWildcardCertificatePrivateKeyRaw[] = {
'\x30', '\x82', '\x04', '\xbe', '\x02', '\x01', '\x00', '\x30', '\x0d',
'\x06', '\x09', '\x2a', '\x86', '\x48', '\x86', '\xf7', '\x0d', '\x01',
'\x01', '\x01', '\x05', '\x00', '\x04', '\x82', '\x04', '\xa8', '\x30',
@@ -716,11 +716,11 @@ QUIC_CONST_INIT const char kWildcardCertificatePrivateKeyRaw[] = {
'\x47', '\xca', '\x21', '\x30', '\x65', '\xa4', '\xe5', '\xaa', '\x4e',
'\x9c', '\xbc', '\xa5'};
-QUIC_CONST_INIT const quiche::QuicheStringPiece kWildcardCertificatePrivateKey(
+ABSL_CONST_INIT const absl::string_view kWildcardCertificatePrivateKey(
kWildcardCertificatePrivateKeyRaw,
sizeof(kWildcardCertificatePrivateKeyRaw));
-QUIC_CONST_INIT const char kTestEcPrivateKeyLegacyPem[] =
+ABSL_CONST_INIT const char kTestEcPrivateKeyLegacyPem[] =
R"(-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.h b/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.h
index f6179419d35..6a7eba768f1 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/test_certificates.h
@@ -5,46 +5,44 @@
#ifndef QUICHE_QUIC_TEST_TOOLS_TEST_CERTIFICATES_H_
#define QUICHE_QUIC_TEST_TOOLS_TEST_CERTIFICATES_H_
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
namespace quic {
namespace test {
// A test certificate generated by //net/tools/quic/certs/generate-certs.sh.
-QUIC_CONST_INIT extern const quiche::QuicheStringPiece kTestCertificate;
+ABSL_CONST_INIT extern const absl::string_view kTestCertificate;
// PEM-encoded version of |kTestCertificate|.
-QUIC_CONST_INIT extern const char kTestCertificatePem[];
+ABSL_CONST_INIT extern const char kTestCertificatePem[];
// |kTestCertificatePem| with a PEM-encoded root appended to the end.
-QUIC_CONST_INIT extern const char kTestCertificateChainPem[];
+ABSL_CONST_INIT extern const char kTestCertificateChainPem[];
// PEM-encoded certificate that contains a subjectAltName with an
// unknown/unsupported type.
-QUIC_CONST_INIT extern const char kTestCertWithUnknownSanTypePem[];
+ABSL_CONST_INIT extern const char kTestCertWithUnknownSanTypePem[];
// DER-encoded private key for |kTestCertificate|.
-QUIC_CONST_INIT extern const quiche::QuicheStringPiece
- kTestCertificatePrivateKey;
+ABSL_CONST_INIT extern const absl::string_view kTestCertificatePrivateKey;
// PEM-encoded version of |kTestCertificatePrivateKey|.
-QUIC_CONST_INIT extern const char kTestCertificatePrivateKeyPem[];
+ABSL_CONST_INIT extern const char kTestCertificatePrivateKeyPem[];
// The legacy PEM-encoded version of |kTestCertificatePrivateKey| manually
// generated from the one above using der2ascii.
-QUIC_CONST_INIT extern const char kTestCertificatePrivateKeyLegacyPem[];
+ABSL_CONST_INIT extern const char kTestCertificatePrivateKeyLegacyPem[];
// Another DER-encoded test certificate, valid for foo.test, www.foo.test and
// *.wildcard.test.
-QUIC_CONST_INIT extern const quiche::QuicheStringPiece kWildcardCertificate;
+ABSL_CONST_INIT extern const absl::string_view kWildcardCertificate;
// DER-encoded private key for |kWildcardCertificate|.
-QUIC_CONST_INIT extern const quiche::QuicheStringPiece
- kWildcardCertificatePrivateKey;
+ABSL_CONST_INIT extern const absl::string_view kWildcardCertificatePrivateKey;
// PEM-encoded P-256 private key using legacy OpenSSL encoding.
-QUIC_CONST_INIT extern const char kTestEcPrivateKeyLegacyPem[];
+ABSL_CONST_INIT extern const char kTestEcPrivateKeyLegacyPem[];
} // namespace test
} // namespace quic
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.cc b/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.cc
index 4d0d93e8f17..40f28d2c125 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.cc
@@ -6,7 +6,8 @@
#include <cstring>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "absl/base/macros.h"
+#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
namespace quic {
namespace test {
@@ -25,29 +26,36 @@ constexpr char kTicketPrefix[] = "TEST TICKET";
} // namespace
+TestTicketCrypter::TestTicketCrypter()
+ : ticket_prefix_(ABSL_ARRAYSIZE(kTicketPrefix) + 16) {
+ memcpy(ticket_prefix_.data(), kTicketPrefix, ABSL_ARRAYSIZE(kTicketPrefix));
+ QuicRandom::GetInstance()->RandBytes(
+ ticket_prefix_.data() + ABSL_ARRAYSIZE(kTicketPrefix), 16);
+}
+
size_t TestTicketCrypter::MaxOverhead() {
- return QUICHE_ARRAYSIZE(kTicketPrefix);
+ return ticket_prefix_.size();
}
-std::vector<uint8_t> TestTicketCrypter::Encrypt(quiche::QuicheStringPiece in) {
- size_t prefix_len = QUICHE_ARRAYSIZE(kTicketPrefix);
+std::vector<uint8_t> TestTicketCrypter::Encrypt(absl::string_view in) {
+ size_t prefix_len = ticket_prefix_.size();
std::vector<uint8_t> out(prefix_len + in.size());
- memcpy(out.data(), kTicketPrefix, prefix_len);
+ memcpy(out.data(), ticket_prefix_.data(), prefix_len);
memcpy(out.data() + prefix_len, in.data(), in.size());
return out;
}
-std::vector<uint8_t> TestTicketCrypter::Decrypt(quiche::QuicheStringPiece in) {
- size_t prefix_len = QUICHE_ARRAYSIZE(kTicketPrefix);
+std::vector<uint8_t> TestTicketCrypter::Decrypt(absl::string_view in) {
+ size_t prefix_len = ticket_prefix_.size();
if (fail_decrypt_ || in.size() < prefix_len ||
- memcmp(kTicketPrefix, in.data(), prefix_len) != 0) {
+ memcmp(ticket_prefix_.data(), in.data(), prefix_len) != 0) {
return std::vector<uint8_t>();
}
return std::vector<uint8_t>(in.begin() + prefix_len, in.end());
}
void TestTicketCrypter::Decrypt(
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<ProofSource::DecryptCallback> callback) {
auto decrypted_ticket = Decrypt(in);
if (run_async_) {
diff --git a/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.h b/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.h
index b59634856c0..5785463b604 100644
--- a/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.h
+++ b/chromium/net/third_party/quiche/src/quic/test_tools/test_ticket_crypter.h
@@ -14,12 +14,13 @@ namespace test {
// THIS IMPLEMENTATION IS NOT SECURE. It is only intended for testing purposes.
class TestTicketCrypter : public ProofSource::TicketCrypter {
public:
+ TestTicketCrypter();
~TestTicketCrypter() override = default;
// TicketCrypter interface
size_t MaxOverhead() override;
- std::vector<uint8_t> Encrypt(quiche::QuicheStringPiece in) override;
- void Decrypt(quiche::QuicheStringPiece in,
+ std::vector<uint8_t> Encrypt(absl::string_view in) override;
+ void Decrypt(absl::string_view in,
std::unique_ptr<ProofSource::DecryptCallback> callback) override;
void SetRunCallbacksAsync(bool run_async);
@@ -31,7 +32,7 @@ class TestTicketCrypter : public ProofSource::TicketCrypter {
private:
// Performs the Decrypt operation synchronously.
- std::vector<uint8_t> Decrypt(quiche::QuicheStringPiece in);
+ std::vector<uint8_t> Decrypt(absl::string_view in);
struct PendingCallback {
std::unique_ptr<ProofSource::DecryptCallback> callback;
@@ -41,6 +42,7 @@ class TestTicketCrypter : public ProofSource::TicketCrypter {
bool fail_decrypt_ = false;
bool run_async_ = false;
std::vector<PendingCallback> pending_callbacks_;
+ std::vector<uint8_t> ticket_prefix_;
};
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/quic/tools/fake_proof_verifier.h b/chromium/net/third_party/quiche/src/quic/tools/fake_proof_verifier.h
index 7f4a38ea5ec..87078798edf 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/fake_proof_verifier.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/fake_proof_verifier.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_TOOLS_FAKE_PROOF_VERIFIER_H_
#define QUICHE_QUIC_TOOLS_FAKE_PROOF_VERIFIER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/proof_verifier.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -19,7 +19,7 @@ class FakeProofVerifier : public ProofVerifier {
const uint16_t /*port*/,
const std::string& /*server_config*/,
QuicTransportVersion /*quic_version*/,
- quiche::QuicheStringPiece /*chlo_hash*/,
+ absl::string_view /*chlo_hash*/,
const std::vector<std::string>& /*certs*/,
const std::string& /*cert_sct*/,
const std::string& /*signature*/,
@@ -38,6 +38,7 @@ class FakeProofVerifier : public ProofVerifier {
const ProofVerifyContext* /*context*/,
std::string* /*error_details*/,
std::unique_ptr<ProofVerifyDetails>* /*details*/,
+ uint8_t* /*out_alert*/,
std::unique_ptr<ProofVerifierCallback> /*callback*/) override {
return QUIC_SUCCESS;
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.cc
index 7900683913d..defa9bfec02 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.cc
@@ -8,7 +8,7 @@ namespace quic {
QuicBackendResponse::ServerPushInfo::ServerPushInfo(
QuicUrl request_url,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
spdy::SpdyPriority priority,
std::string body)
: request_url(request_url),
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.h b/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.h
index af6cf84ee0c..9209038f4b3 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_backend_response.h
@@ -5,8 +5,8 @@
#ifndef QUICHE_QUIC_TOOLS_QUIC_BACKEND_RESPONSE_H_
#define QUICHE_QUIC_TOOLS_QUIC_BACKEND_RESPONSE_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/tools/quic_url.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
namespace quic {
@@ -19,13 +19,13 @@ class QuicBackendResponse {
// comprising a response for the push request.
struct ServerPushInfo {
ServerPushInfo(QuicUrl request_url,
- spdy::SpdyHeaderBlock headers,
+ spdy::Http2HeaderBlock headers,
spdy::SpdyPriority priority,
std::string body);
ServerPushInfo(const ServerPushInfo& other);
QuicUrl request_url;
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
spdy::SpdyPriority priority;
std::string body;
};
@@ -51,30 +51,28 @@ class QuicBackendResponse {
~QuicBackendResponse();
SpecialResponseType response_type() const { return response_type_; }
- const spdy::SpdyHeaderBlock& headers() const { return headers_; }
- const spdy::SpdyHeaderBlock& trailers() const { return trailers_; }
- const quiche::QuicheStringPiece body() const {
- return quiche::QuicheStringPiece(body_);
- }
+ const spdy::Http2HeaderBlock& headers() const { return headers_; }
+ const spdy::Http2HeaderBlock& trailers() const { return trailers_; }
+ const absl::string_view body() const { return absl::string_view(body_); }
void set_response_type(SpecialResponseType response_type) {
response_type_ = response_type;
}
- void set_headers(spdy::SpdyHeaderBlock headers) {
+ void set_headers(spdy::Http2HeaderBlock headers) {
headers_ = std::move(headers);
}
- void set_trailers(spdy::SpdyHeaderBlock trailers) {
+ void set_trailers(spdy::Http2HeaderBlock trailers) {
trailers_ = std::move(trailers);
}
- void set_body(quiche::QuicheStringPiece body) {
+ void set_body(absl::string_view body) {
body_.assign(body.data(), body.size());
}
private:
SpecialResponseType response_type_;
- spdy::SpdyHeaderBlock headers_;
- spdy::SpdyHeaderBlock trailers_;
+ spdy::Http2HeaderBlock headers_;
+ spdy::Http2HeaderBlock trailers_;
std::string body_;
};
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.cc
index c1d2ea2103c..5d89797f8c9 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.cc
@@ -121,8 +121,8 @@ void QuicClientBase::StartConnect() {
session_ = CreateQuicClientSession(
client_supported_versions,
- new QuicConnection(GetNextConnectionId(), server_address(), helper(),
- alarm_factory(), writer,
+ new QuicConnection(GetNextConnectionId(), QuicSocketAddress(),
+ server_address(), helper(), alarm_factory(), writer,
/* owns_writer= */ false, Perspective::IS_CLIENT,
client_supported_versions));
if (connection_debug_visitor_ != nullptr) {
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.h b/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.h
index 4df3a2bb927..ce2444ce925 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_client_base.h
@@ -10,14 +10,14 @@
#include <string>
+#include "absl/base/attributes.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/http/quic_client_push_promise_index.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_session.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_config.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_macros.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -104,12 +104,12 @@ class QuicClientBase {
// Wait for 1-RTT keys become available.
// Returns true once 1-RTT keys are available, false otherwise.
- QUIC_MUST_USE_RESULT bool WaitForOneRttKeysAvailable();
+ ABSL_MUST_USE_RESULT bool WaitForOneRttKeysAvailable();
// Wait for handshake state proceeds to HANDSHAKE_CONFIRMED.
// In QUIC crypto, this does the same as WaitForOneRttKeysAvailable, while in
// TLS, this waits for HANDSHAKE_DONE frame is received.
- QUIC_MUST_USE_RESULT bool WaitForHandshakeConfirmed();
+ ABSL_MUST_USE_RESULT bool WaitForHandshakeConfirmed();
// Wait up to 50ms, and handle any events which occur.
// Returns true if there are any outstanding requests.
@@ -227,7 +227,7 @@ class QuicClientBase {
bool initialized() const { return initialized_; }
- void SetPreSharedKey(quiche::QuicheStringPiece key) {
+ void SetPreSharedKey(absl::string_view key) {
crypto_config_.set_pre_shared_key(key);
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_client_interop_test_bin.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_client_interop_test_bin.cc
index 80dfd3b2139..e16afe686cf 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_client_interop_test_bin.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_client_interop_test_bin.cc
@@ -52,6 +52,8 @@ enum class Feature {
// Second row of features (anything else protocol-related)
// We switched to a different port and the server migrated to it.
kRebinding,
+ // One endpoint can update keys and its peer responds correctly.
+ kKeyUpdate,
// Third row of features (H3 tests)
// An H3 transaction succeeded.
@@ -81,6 +83,8 @@ char MatrixLetter(Feature f) {
return 'Q';
case Feature::kRebinding:
return 'B';
+ case Feature::kKeyUpdate:
+ return 'U';
case Feature::kHttp3:
return '3';
case Feature::kDynamicEntryReferenced:
@@ -107,15 +111,16 @@ class QuicClientInteropRunner : QuicConnectionDebugVisitor {
ParsedQuicVersion version,
bool test_version_negotiation,
bool attempt_rebind,
- bool attempt_multi_packet_chlo);
+ bool attempt_multi_packet_chlo,
+ bool attempt_key_update);
// Constructs a SpdyHeaderBlock containing the pseudo-headers needed to make a
// GET request to "/" on the hostname |authority|.
- spdy::SpdyHeaderBlock ConstructHeaderBlock(const std::string& authority);
+ spdy::Http2HeaderBlock ConstructHeaderBlock(const std::string& authority);
// Sends an HTTP request represented by |header_block| using |client|.
void SendRequest(QuicClient* client,
- const spdy::SpdyHeaderBlock& header_block);
+ const spdy::Http2HeaderBlock& header_block);
void OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override {
switch (frame.close_type) {
@@ -165,7 +170,7 @@ void QuicClientInteropRunner::AttemptResumption(QuicClient* client,
bool zero_rtt_attempt = !client->session()->OneRttKeysAvailable();
- spdy::SpdyHeaderBlock header_block = ConstructHeaderBlock(authority);
+ spdy::Http2HeaderBlock header_block = ConstructHeaderBlock(authority);
SendRequest(client, header_block);
if (!client->session()->OneRttKeysAvailable()) {
@@ -191,7 +196,8 @@ void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
ParsedQuicVersion version,
bool test_version_negotiation,
bool attempt_rebind,
- bool attempt_multi_packet_chlo) {
+ bool attempt_multi_packet_chlo,
+ bool attempt_key_update) {
ParsedQuicVersionVector versions = {version};
if (test_version_negotiation) {
versions.insert(versions.begin(), QuicVersionReservedForNegotiation());
@@ -238,7 +244,7 @@ void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
// Failed to negotiate version, retry without version negotiation.
AttemptRequest(addr, authority, server_id, version,
/*test_version_negotiation=*/false, attempt_rebind,
- attempt_multi_packet_chlo);
+ attempt_multi_packet_chlo, attempt_key_update);
return;
}
if (!client->session()->OneRttKeysAvailable()) {
@@ -246,7 +252,7 @@ void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
// Failed to handshake with multi-packet client hello, retry without it.
AttemptRequest(addr, authority, server_id, version,
test_version_negotiation, attempt_rebind,
- /*attempt_multi_packet_chlo=*/false);
+ /*attempt_multi_packet_chlo=*/false, attempt_key_update);
return;
}
return;
@@ -256,7 +262,7 @@ void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
InsertFeature(Feature::kQuantum);
}
- spdy::SpdyHeaderBlock header_block = ConstructHeaderBlock(authority);
+ spdy::Http2HeaderBlock header_block = ConstructHeaderBlock(authority);
SendRequest(client.get(), header_block);
if (!client->connected()) {
@@ -278,7 +284,7 @@ void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
// Rebinding does not work, retry without attempting it.
AttemptRequest(addr, authority, server_id, version,
test_version_negotiation, /*attempt_rebind=*/false,
- attempt_multi_packet_chlo);
+ attempt_multi_packet_chlo, attempt_key_update);
return;
}
InsertFeature(Feature::kRebinding);
@@ -290,6 +296,28 @@ void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
QUIC_LOG(ERROR) << "Failed to change ephemeral port";
}
}
+
+ if (attempt_key_update) {
+ if (connection->IsKeyUpdateAllowed()) {
+ if (connection->InitiateKeyUpdate(
+ KeyUpdateReason::kLocalForInteropRunner)) {
+ client->SendRequestAndWaitForResponse(header_block, "", /*fin=*/true);
+ if (!client->connected()) {
+ // Key update does not work, retry without attempting it.
+ AttemptRequest(addr, authority, server_id, version,
+ test_version_negotiation, attempt_rebind,
+ attempt_multi_packet_chlo,
+ /*attempt_key_update=*/false);
+ return;
+ }
+ InsertFeature(Feature::kKeyUpdate);
+ } else {
+ QUIC_LOG(ERROR) << "Failed to initiate key update";
+ }
+ } else {
+ QUIC_LOG(ERROR) << "Key update not allowed";
+ }
+ }
}
if (connection->connected()) {
@@ -302,10 +330,10 @@ void QuicClientInteropRunner::AttemptRequest(QuicSocketAddress addr,
AttemptResumption(client.get(), authority);
}
-spdy::SpdyHeaderBlock QuicClientInteropRunner::ConstructHeaderBlock(
+spdy::Http2HeaderBlock QuicClientInteropRunner::ConstructHeaderBlock(
const std::string& authority) {
// Construct and send a request.
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
header_block[":method"] = "GET";
header_block[":scheme"] = "https";
header_block[":authority"] = authority;
@@ -315,7 +343,7 @@ spdy::SpdyHeaderBlock QuicClientInteropRunner::ConstructHeaderBlock(
void QuicClientInteropRunner::SendRequest(
QuicClient* client,
- const spdy::SpdyHeaderBlock& header_block) {
+ const spdy::Http2HeaderBlock& header_block) {
client->set_store_response(true);
client->SendRequestAndWaitForResponse(header_block, "", /*fin=*/true);
@@ -368,7 +396,8 @@ std::set<Feature> ServerSupport(std::string dns_host,
runner.AttemptRequest(addr, authority, server_id, version,
/*test_version_negotiation=*/true,
/*attempt_rebind=*/true,
- /*attempt_multi_packet_chlo=*/true);
+ /*attempt_multi_packet_chlo=*/true,
+ /*attempt_key_update=*/true);
return runner.features();
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_client_test.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_client_test.cc
index b1923b67c7c..034c4dda6ca 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_client_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_client_test.cc
@@ -10,13 +10,14 @@
#include <memory>
#include <utility>
+#include "absl/strings/match.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_epoll.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_port_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test_loopback.h"
#include "net/third_party/quiche/src/quic/test_tools/crypto_test_utils.h"
#include "net/third_party/quiche/src/quic/test_tools/quic_client_peer.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace quic {
@@ -40,13 +41,13 @@ size_t NumOpenSocketFDs() {
std::unique_ptr<DIR, int (*)(DIR*)> fd_directory(opendir(kPathToFds),
closedir);
while ((file = readdir(fd_directory.get())) != nullptr) {
- quiche::QuicheStringPiece name(file->d_name);
+ absl::string_view name(file->d_name);
if (name == "." || name == "..") {
continue;
}
std::string fd_path = ReadLink(quiche::QuicheStrCat(kPathToFds, "/", name));
- if (quiche::QuicheTextUtils::StartsWith(fd_path, "socket:")) {
+ if (absl::StartsWith(fd_path, "socket:")) {
socket_count++;
}
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.cc
index 370eb4aaedb..465e0a9f8bc 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.cc
@@ -6,16 +6,18 @@
#include <utility>
+#include "absl/strings/match.h"
+#include "absl/strings/numbers.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_bug_tracker.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_file_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
+using spdy::Http2HeaderBlock;
using spdy::kV3LowestPriority;
-using spdy::SpdyHeaderBlock;
namespace quic {
@@ -40,7 +42,7 @@ void QuicMemoryCacheBackend::ResourceFile::Read() {
if (file_contents_[pos - 1] == '\r') {
len -= 1;
}
- quiche::QuicheStringPiece line(file_contents_.data() + start, len);
+ absl::string_view line(file_contents_.data() + start, len);
start = pos + 1;
// Headers end with an empty line.
if (line.empty()) {
@@ -83,30 +85,29 @@ void QuicMemoryCacheBackend::ResourceFile::Read() {
// stuff as described in https://w3c.github.io/preload/.
it = spdy_headers_.find("x-push-url");
if (it != spdy_headers_.end()) {
- quiche::QuicheStringPiece push_urls = it->second;
+ absl::string_view push_urls = it->second;
size_t start = 0;
while (start < push_urls.length()) {
size_t pos = push_urls.find('\0', start);
if (pos == std::string::npos) {
- push_urls_.push_back(quiche::QuicheStringPiece(
- push_urls.data() + start, push_urls.length() - start));
+ push_urls_.push_back(absl::string_view(push_urls.data() + start,
+ push_urls.length() - start));
break;
}
- push_urls_.push_back(
- quiche::QuicheStringPiece(push_urls.data() + start, pos));
+ push_urls_.push_back(absl::string_view(push_urls.data() + start, pos));
start += pos + 1;
}
}
- body_ = quiche::QuicheStringPiece(file_contents_.data() + start,
- file_contents_.size() - start);
+ body_ = absl::string_view(file_contents_.data() + start,
+ file_contents_.size() - start);
}
void QuicMemoryCacheBackend::ResourceFile::SetHostPathFromBase(
- quiche::QuicheStringPiece base) {
+ absl::string_view base) {
DCHECK(base[0] != '/') << base;
size_t path_start = base.find_first_of('/');
- if (path_start == quiche::QuicheStringPiece::npos) {
+ if (path_start == absl::string_view::npos) {
host_ = std::string(base);
path_ = "";
return;
@@ -121,33 +122,32 @@ void QuicMemoryCacheBackend::ResourceFile::SetHostPathFromBase(
}
}
-quiche::QuicheStringPiece QuicMemoryCacheBackend::ResourceFile::RemoveScheme(
- quiche::QuicheStringPiece url) {
- if (quiche::QuicheTextUtils::StartsWith(url, "https://")) {
+absl::string_view QuicMemoryCacheBackend::ResourceFile::RemoveScheme(
+ absl::string_view url) {
+ if (absl::StartsWith(url, "https://")) {
url.remove_prefix(8);
- } else if (quiche::QuicheTextUtils::StartsWith(url, "http://")) {
+ } else if (absl::StartsWith(url, "http://")) {
url.remove_prefix(7);
}
return url;
}
void QuicMemoryCacheBackend::ResourceFile::HandleXOriginalUrl() {
- quiche::QuicheStringPiece url(x_original_url_);
+ absl::string_view url(x_original_url_);
SetHostPathFromBase(RemoveScheme(url));
}
const QuicBackendResponse* QuicMemoryCacheBackend::GetResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path) const {
+ absl::string_view host,
+ absl::string_view path) const {
QuicWriterMutexLock lock(&response_mutex_);
auto it = responses_.find(GetKey(host, path));
if (it == responses_.end()) {
uint64_t ignored = 0;
if (generate_bytes_response_) {
- if (quiche::QuicheTextUtils::StringToUint64(
- quiche::QuicheStringPiece(path.data() + 1, path.size() - 1),
- &ignored)) {
+ if (absl::SimpleAtoi(absl::string_view(path.data() + 1, path.size() - 1),
+ &ignored)) {
// The actual parsed length is ignored here and will be recomputed
// by the caller.
return generate_bytes_response_.get();
@@ -163,14 +163,14 @@ const QuicBackendResponse* QuicMemoryCacheBackend::GetResponse(
return it->second.get();
}
-typedef QuicBackendResponse::ServerPushInfo ServerPushInfo;
-typedef QuicBackendResponse::SpecialResponseType SpecialResponseType;
+using ServerPushInfo = QuicBackendResponse::ServerPushInfo;
+using SpecialResponseType = QuicBackendResponse::SpecialResponseType;
-void QuicMemoryCacheBackend::AddSimpleResponse(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+void QuicMemoryCacheBackend::AddSimpleResponse(absl::string_view host,
+ absl::string_view path,
int response_code,
- quiche::QuicheStringPiece body) {
- SpdyHeaderBlock response_headers;
+ absl::string_view body) {
+ Http2HeaderBlock response_headers;
response_headers[":status"] =
quiche::QuicheTextUtils::Uint64ToString(response_code);
response_headers["content-length"] =
@@ -179,10 +179,10 @@ void QuicMemoryCacheBackend::AddSimpleResponse(quiche::QuicheStringPiece host,
}
void QuicMemoryCacheBackend::AddSimpleResponseWithServerPushResources(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+ absl::string_view host,
+ absl::string_view path,
int response_code,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
std::list<ServerPushInfo> push_resources) {
AddSimpleResponse(host, path, response_code, body);
MaybeAddServerPushResources(host, path, push_resources);
@@ -193,43 +193,41 @@ void QuicMemoryCacheBackend::AddDefaultResponse(QuicBackendResponse* response) {
default_response_.reset(response);
}
-void QuicMemoryCacheBackend::AddResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body) {
+void QuicMemoryCacheBackend::AddResponse(absl::string_view host,
+ absl::string_view path,
+ Http2HeaderBlock response_headers,
+ absl::string_view response_body) {
AddResponseImpl(host, path, QuicBackendResponse::REGULAR_RESPONSE,
std::move(response_headers), response_body,
- SpdyHeaderBlock());
+ Http2HeaderBlock());
}
-void QuicMemoryCacheBackend::AddResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
- SpdyHeaderBlock response_trailers) {
+void QuicMemoryCacheBackend::AddResponse(absl::string_view host,
+ absl::string_view path,
+ Http2HeaderBlock response_headers,
+ absl::string_view response_body,
+ Http2HeaderBlock response_trailers) {
AddResponseImpl(host, path, QuicBackendResponse::REGULAR_RESPONSE,
std::move(response_headers), response_body,
std::move(response_trailers));
}
void QuicMemoryCacheBackend::AddSpecialResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+ absl::string_view host,
+ absl::string_view path,
SpecialResponseType response_type) {
- AddResponseImpl(host, path, response_type, SpdyHeaderBlock(), "",
- SpdyHeaderBlock());
+ AddResponseImpl(host, path, response_type, Http2HeaderBlock(), "",
+ Http2HeaderBlock());
}
void QuicMemoryCacheBackend::AddSpecialResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
+ absl::string_view host,
+ absl::string_view path,
+ spdy::Http2HeaderBlock response_headers,
+ absl::string_view response_body,
SpecialResponseType response_type) {
AddResponseImpl(host, path, response_type, std::move(response_headers),
- response_body, SpdyHeaderBlock());
+ response_body, Http2HeaderBlock());
}
QuicMemoryCacheBackend::QuicMemoryCacheBackend() : cache_initialized_(false) {}
@@ -294,7 +292,7 @@ bool QuicMemoryCacheBackend::InitializeBackend(
void QuicMemoryCacheBackend::GenerateDynamicResponses() {
QuicWriterMutexLock lock(&response_mutex_);
// Add a generate bytes response.
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[":status"] = "200";
generate_bytes_response_ = std::make_unique<QuicBackendResponse>();
generate_bytes_response_->set_headers(std::move(response_headers));
@@ -307,7 +305,7 @@ bool QuicMemoryCacheBackend::IsBackendInitialized() const {
}
void QuicMemoryCacheBackend::FetchResponseFromBackend(
- const SpdyHeaderBlock& request_headers,
+ const Http2HeaderBlock& request_headers,
const std::string& /*request_body*/,
QuicSimpleServerBackend::RequestHandler* quic_stream) {
const QuicBackendResponse* quic_response = nullptr;
@@ -353,12 +351,12 @@ QuicMemoryCacheBackend::~QuicMemoryCacheBackend() {
}
void QuicMemoryCacheBackend::AddResponseImpl(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+ absl::string_view host,
+ absl::string_view path,
SpecialResponseType response_type,
- SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
- SpdyHeaderBlock response_trailers) {
+ Http2HeaderBlock response_headers,
+ absl::string_view response_body,
+ Http2HeaderBlock response_trailers) {
QuicWriterMutexLock lock(&response_mutex_);
DCHECK(!host.empty()) << "Host must be populated, e.g. \"www.google.com\"";
@@ -376,9 +374,8 @@ void QuicMemoryCacheBackend::AddResponseImpl(
responses_[key] = std::move(new_response);
}
-std::string QuicMemoryCacheBackend::GetKey(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path) const {
+std::string QuicMemoryCacheBackend::GetKey(absl::string_view host,
+ absl::string_view path) const {
std::string host_string = std::string(host);
size_t port = host_string.find(':');
if (port != std::string::npos)
@@ -387,8 +384,8 @@ std::string QuicMemoryCacheBackend::GetKey(
}
void QuicMemoryCacheBackend::MaybeAddServerPushResources(
- quiche::QuicheStringPiece request_host,
- quiche::QuicheStringPiece request_path,
+ absl::string_view request_host,
+ absl::string_view request_path,
std::list<ServerPushInfo> push_resources) {
std::string request_url = GetKey(request_host, request_path);
@@ -418,7 +415,7 @@ void QuicMemoryCacheBackend::MaybeAddServerPushResources(
}
if (!found_existing_response) {
// Add a server push response to responses map, if it is not in the map.
- quiche::QuicheStringPiece body = push_resource.body;
+ absl::string_view body = push_resource.body;
QUIC_DVLOG(1) << "Add response for push resource: host " << host
<< " path " << path;
AddResponse(host, path, push_resource.headers.Clone(), body);
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h b/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h
index 1c56ce6355e..e43bf60f823 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h
@@ -10,13 +10,13 @@
#include <memory>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_mutex.h"
#include "net/third_party/quiche/src/quic/tools/quic_backend_response.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h"
#include "net/third_party/quiche/src/quic/tools/quic_url.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
namespace quic {
@@ -40,32 +40,30 @@ class QuicMemoryCacheBackend : public QuicSimpleServerBackend {
void Read();
// |base| is |file_name_| with |cache_directory| prefix stripped.
- void SetHostPathFromBase(quiche::QuicheStringPiece base);
+ void SetHostPathFromBase(absl::string_view base);
const std::string& file_name() { return file_name_; }
- quiche::QuicheStringPiece host() { return host_; }
+ absl::string_view host() { return host_; }
- quiche::QuicheStringPiece path() { return path_; }
+ absl::string_view path() { return path_; }
- const spdy::SpdyHeaderBlock& spdy_headers() { return spdy_headers_; }
+ const spdy::Http2HeaderBlock& spdy_headers() { return spdy_headers_; }
- quiche::QuicheStringPiece body() { return body_; }
+ absl::string_view body() { return body_; }
- const std::vector<quiche::QuicheStringPiece>& push_urls() {
- return push_urls_;
- }
+ const std::vector<absl::string_view>& push_urls() { return push_urls_; }
private:
void HandleXOriginalUrl();
- quiche::QuicheStringPiece RemoveScheme(quiche::QuicheStringPiece url);
+ absl::string_view RemoveScheme(absl::string_view url);
std::string file_name_;
std::string file_contents_;
- quiche::QuicheStringPiece body_;
- spdy::SpdyHeaderBlock spdy_headers_;
- quiche::QuicheStringPiece x_original_url_;
- std::vector<quiche::QuicheStringPiece> push_urls_;
+ absl::string_view body_;
+ spdy::Http2HeaderBlock spdy_headers_;
+ absl::string_view x_original_url_;
+ std::vector<absl::string_view> push_urls_;
std::string host_;
std::string path_;
};
@@ -77,51 +75,51 @@ class QuicMemoryCacheBackend : public QuicSimpleServerBackend {
// Retrieve a response from this cache for a given host and path..
// If no appropriate response exists, nullptr is returned.
- const QuicBackendResponse* GetResponse(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path) const;
+ const QuicBackendResponse* GetResponse(absl::string_view host,
+ absl::string_view path) const;
// Adds a simple response to the cache. The response headers will
// only contain the "content-length" header with the length of |body|.
- void AddSimpleResponse(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+ void AddSimpleResponse(absl::string_view host,
+ absl::string_view path,
int response_code,
- quiche::QuicheStringPiece body);
+ absl::string_view body);
// Add a simple response to the cache as AddSimpleResponse() does, and add
// some server push resources(resource path, corresponding response status and
// path) associated with it.
// Push resource implicitly come from the same host.
void AddSimpleResponseWithServerPushResources(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+ absl::string_view host,
+ absl::string_view path,
int response_code,
- quiche::QuicheStringPiece body,
+ absl::string_view body,
std::list<QuicBackendResponse::ServerPushInfo> push_resources);
// Add a response to the cache.
- void AddResponse(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body);
+ void AddResponse(absl::string_view host,
+ absl::string_view path,
+ spdy::Http2HeaderBlock response_headers,
+ absl::string_view response_body);
// Add a response, with trailers, to the cache.
- void AddResponse(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
- spdy::SpdyHeaderBlock response_trailers);
+ void AddResponse(absl::string_view host,
+ absl::string_view path,
+ spdy::Http2HeaderBlock response_headers,
+ absl::string_view response_body,
+ spdy::Http2HeaderBlock response_trailers);
// Simulate a special behavior at a particular path.
void AddSpecialResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+ absl::string_view host,
+ absl::string_view path,
QuicBackendResponse::SpecialResponseType response_type);
void AddSpecialResponse(
- quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
- spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
+ absl::string_view host,
+ absl::string_view path,
+ spdy::Http2HeaderBlock response_headers,
+ absl::string_view response_body,
QuicBackendResponse::SpecialResponseType response_type);
// Sets a default response in case of cache misses. Takes ownership of
@@ -141,28 +139,27 @@ class QuicMemoryCacheBackend : public QuicSimpleServerBackend {
bool InitializeBackend(const std::string& cache_directory) override;
bool IsBackendInitialized() const override;
void FetchResponseFromBackend(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* quic_server_stream) override;
void CloseBackendResponseStream(
QuicSimpleServerBackend::RequestHandler* quic_server_stream) override;
private:
- void AddResponseImpl(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path,
+ void AddResponseImpl(absl::string_view host,
+ absl::string_view path,
QuicBackendResponse::SpecialResponseType response_type,
- spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece response_body,
- spdy::SpdyHeaderBlock response_trailers);
+ spdy::Http2HeaderBlock response_headers,
+ absl::string_view response_body,
+ spdy::Http2HeaderBlock response_trailers);
- std::string GetKey(quiche::QuicheStringPiece host,
- quiche::QuicheStringPiece path) const;
+ std::string GetKey(absl::string_view host, absl::string_view path) const;
// Add some server push urls with given responses for specified
// request if these push resources are not associated with this request yet.
void MaybeAddServerPushResources(
- quiche::QuicheStringPiece request_host,
- quiche::QuicheStringPiece request_path,
+ absl::string_view request_host,
+ absl::string_view request_path,
std::list<QuicBackendResponse::ServerPushInfo> push_resources);
// Check if push resource(push_host/push_path) associated with given request
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend_test.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend_test.cc
index e4b8d8e1f38..5940baaf849 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_memory_cache_backend_test.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h"
+#include "absl/strings/match.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_file_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_test.h"
@@ -15,15 +16,15 @@ namespace quic {
namespace test {
namespace {
-typedef QuicBackendResponse Response;
-typedef QuicBackendResponse::ServerPushInfo ServerPushInfo;
+using Response = QuicBackendResponse;
+using ServerPushInfo = QuicBackendResponse::ServerPushInfo;
} // namespace
class QuicMemoryCacheBackendTest : public QuicTest {
protected:
void CreateRequest(std::string host,
std::string path,
- spdy::SpdyHeaderBlock* headers) {
+ spdy::Http2HeaderBlock* headers) {
(*headers)[":method"] = "GET";
(*headers)[":path"] = path;
(*headers)[":authority"] = host;
@@ -45,7 +46,7 @@ TEST_F(QuicMemoryCacheBackendTest, AddSimpleResponseGetResponse) {
std::string response_body("hello response");
cache_.AddSimpleResponse("www.google.com", "/", 200, response_body);
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
CreateRequest("www.google.com", "/", &request_headers);
const Response* response = cache_.GetResponse("www.google.com", "/");
ASSERT_TRUE(response);
@@ -59,12 +60,12 @@ TEST_F(QuicMemoryCacheBackendTest, AddResponse) {
const std::string kRequestPath = "/";
const std::string kResponseBody("hello response");
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[":status"] = "200";
response_headers["content-length"] =
quiche::QuicheTextUtils::Uint64ToString(kResponseBody.size());
- spdy::SpdyHeaderBlock response_trailers;
+ spdy::Http2HeaderBlock response_trailers;
response_trailers["key-1"] = "value-1";
response_trailers["key-2"] = "value-2";
response_trailers["key-3"] = "value-3";
@@ -123,7 +124,7 @@ TEST_F(QuicMemoryCacheBackendTest, UsesOriginalUrlOnly) {
std::string dir;
std::string path = "map.html";
for (const std::string& file : ReadFileContents(CacheDirectory())) {
- if (quiche::QuicheTextUtils::EndsWithIgnoreCase(file, "map.html")) {
+ if (absl::EndsWithIgnoreCase(file, "map.html")) {
dir = file;
dir.erase(dir.length() - path.length() - 1);
break;
@@ -148,7 +149,7 @@ TEST_F(QuicMemoryCacheBackendTest, DefaultResponse) {
ASSERT_FALSE(response);
// Add a default response.
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[":status"] = "200";
response_headers["content-length"] = "0";
Response* default_response = new Response;
@@ -189,7 +190,7 @@ TEST_F(QuicMemoryCacheBackendTest, AddSimpleResponseWithServerPushResources) {
QuicUrl resource_url(url);
std::string body =
quiche::QuicheStrCat("This is server push response body for ", path);
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[":status"] = "200";
response_headers["content-length"] =
quiche::QuicheTextUtils::Uint64ToString(body.size());
@@ -228,7 +229,7 @@ TEST_F(QuicMemoryCacheBackendTest, GetServerPushResourcesAndPushResponses) {
std::string url = scheme + "://" + request_host + path;
QuicUrl resource_url(url);
std::string body = "This is server push response body for " + path;
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[":status"] = push_response_status[i];
response_headers["content-length"] =
quiche::QuicheTextUtils::Uint64ToString(body.size());
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_packet_printer_bin.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_packet_printer_bin.cc
index 3efeddec2fb..cfe0b8d0d8c 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_packet_printer_bin.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_packet_printer_bin.cc
@@ -32,7 +32,8 @@
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
+#include "absl/strings/escaping.h"
DEFINE_QUIC_COMMAND_LINE_FLAG(std::string,
quic_version,
@@ -65,9 +66,9 @@ class QuicPacketPrinter : public QuicFramerVisitorInterface {
}
void OnRetryPacket(QuicConnectionId /*original_connection_id*/,
QuicConnectionId /*new_connection_id*/,
- quiche::QuicheStringPiece /*retry_token*/,
- quiche::QuicheStringPiece /*retry_integrity_tag*/,
- quiche::QuicheStringPiece /*retry_without_tag*/) override {
+ absl::string_view /*retry_token*/,
+ absl::string_view /*retry_integrity_tag*/,
+ absl::string_view /*retry_without_tag*/) override {
std::cerr << "OnRetryPacket\n";
}
bool OnUnauthenticatedPublicHeader(
@@ -99,16 +100,16 @@ class QuicPacketPrinter : public QuicFramerVisitorInterface {
bool OnStreamFrame(const QuicStreamFrame& frame) override {
std::cerr << "OnStreamFrame: " << frame;
std::cerr << " data: { "
- << quiche::QuicheTextUtils::HexEncode(frame.data_buffer,
- frame.data_length)
+ << absl::BytesToHexString(
+ absl::string_view(frame.data_buffer, frame.data_length))
<< " }\n";
return true;
}
bool OnCryptoFrame(const QuicCryptoFrame& frame) override {
std::cerr << "OnCryptoFrame: " << frame;
std::cerr << " data: { "
- << quiche::QuicheTextUtils::HexEncode(frame.data_buffer,
- frame.data_length)
+ << absl::BytesToHexString(
+ absl::string_view(frame.data_buffer, frame.data_length))
<< " }\n";
return true;
}
@@ -220,6 +221,21 @@ class QuicPacketPrinter : public QuicFramerVisitorInterface {
const QuicIetfStatelessResetPacket& /*packet*/) override {
std::cerr << "OnAuthenticatedIetfStatelessResetPacket\n";
}
+ void OnKeyUpdate(KeyUpdateReason reason) override {
+ std::cerr << "OnKeyUpdate: " << reason << "\n";
+ }
+ void OnDecryptedFirstPacketInKeyPhase() override {
+ std::cerr << "OnDecryptedFirstPacketInKeyPhase\n";
+ }
+ std::unique_ptr<QuicDecrypter> AdvanceKeysAndCreateCurrentOneRttDecrypter()
+ override {
+ std::cerr << "AdvanceKeysAndCreateCurrentOneRttDecrypter\n";
+ return nullptr;
+ }
+ std::unique_ptr<QuicEncrypter> CreateCurrentOneRttEncrypter() override {
+ std::cerr << "CreateCurrentOneRttEncrypter\n";
+ return nullptr;
+ }
private:
QuicFramer* framer_; // Unowned.
@@ -248,7 +264,7 @@ int main(int argc, char* argv[]) {
quic::QuicPrintCommandLineFlagHelp(usage);
return 1;
}
- std::string hex = quiche::QuicheTextUtils::HexDecode(args[1]);
+ std::string hex = absl::HexStringToBytes(args[1]);
quic::ParsedQuicVersionVector versions = quic::AllSupportedVersions();
// Fake a time since we're not actually generating acks.
quic::QuicTime start(quic::QuicTime::Zero());
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_reject_reason_decoder_bin.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_reject_reason_decoder_bin.cc
index f7e3b75eaac..f17cd031715 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_reject_reason_decoder_bin.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_reject_reason_decoder_bin.cc
@@ -7,6 +7,7 @@
#include <iostream>
+#include "absl/strings/numbers.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
@@ -27,7 +28,7 @@ int main(int argc, char* argv[]) {
}
uint32_t packed_error = 0;
- if (!quiche::QuicheTextUtils::StringToUint32(args[0], &packed_error)) {
+ if (!absl::SimpleAtoi(args[0], &packed_error)) {
std::cerr << "Unable to parse: " << args[0] << "\n";
return 2;
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_server.h b/chromium/net/third_party/quiche/src/quic/tools/quic_server.h
index 6059ea08746..bf1555ce3ef 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_server.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_server.h
@@ -13,6 +13,7 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
#include "net/third_party/quiche/src/quic/core/quic_config.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_connection_helper.h"
@@ -24,7 +25,6 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h"
#include "net/third_party/quiche/src/quic/tools/quic_spdy_server_base.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -81,7 +81,7 @@ class QuicServer : public QuicSpdyServerBase,
crypto_config_.set_chlo_multiplier(multiplier);
}
- void SetPreSharedKey(quiche::QuicheStringPiece key) {
+ void SetPreSharedKey(absl::string_view key) {
crypto_config_.set_pre_shared_key(key);
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_server_test.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_server_test.cc
index 3c4372018fb..06aa105dd78 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_server_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_server_test.cc
@@ -4,6 +4,7 @@
#include "net/third_party/quiche/src/quic/tools/quic_server.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_alarm_factory.h"
#include "net/third_party/quiche/src/quic/core/quic_epoll_connection_helper.h"
@@ -19,7 +20,6 @@
#include "net/third_party/quiche/src/quic/test_tools/quic_server_peer.h"
#include "net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_crypto_server_stream_helper.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
namespace quic {
namespace test {
@@ -136,9 +136,9 @@ TEST_F(QuicServerEpollInTest, ProcessBufferedCHLOsOnEpollin) {
ASSERT_LT(0, fd);
char buf[1024];
- memset(buf, 0, QUICHE_ARRAYSIZE(buf));
+ memset(buf, 0, ABSL_ARRAYSIZE(buf));
sockaddr_storage storage = server_address_.generic_address();
- int rc = sendto(fd, buf, QUICHE_ARRAYSIZE(buf), 0,
+ int rc = sendto(fd, buf, ABSL_ARRAYSIZE(buf), 0,
reinterpret_cast<sockaddr*>(&storage), sizeof(storage));
if (rc < 0) {
QUIC_DLOG(INFO) << errno << " " << strerror(errno);
@@ -202,7 +202,7 @@ TEST_F(QuicServerDispatchPacketTest, DispatchPacket) {
};
// clang-format on
QuicReceivedPacket encrypted_valid_packet(
- reinterpret_cast<char*>(valid_packet), QUICHE_ARRAYSIZE(valid_packet),
+ reinterpret_cast<char*>(valid_packet), ABSL_ARRAYSIZE(valid_packet),
QuicTime::Zero(), false);
EXPECT_CALL(dispatcher_, ProcessPacket(_, _, _)).Times(1);
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.cc
index eb06dd5a0f0..95d507155d5 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -50,15 +50,16 @@ void QuicSimpleDispatcher::OnRstStreamReceived(
std::unique_ptr<QuicSession> QuicSimpleDispatcher::CreateQuicSession(
QuicConnectionId connection_id,
- const QuicSocketAddress& /*self_address*/,
+ const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece /*alpn*/,
+ absl::string_view /*alpn*/,
const ParsedQuicVersion& version) {
// The QuicServerSessionBase takes ownership of |connection| below.
- QuicConnection* connection = new QuicConnection(
- connection_id, peer_address, helper(), alarm_factory(), writer(),
- /* owns_writer= */ false, Perspective::IS_SERVER,
- ParsedQuicVersionVector{version});
+ QuicConnection* connection =
+ new QuicConnection(connection_id, self_address, peer_address, helper(),
+ alarm_factory(), writer(),
+ /* owns_writer= */ false, Perspective::IS_SERVER,
+ ParsedQuicVersionVector{version});
auto session = std::make_unique<QuicSimpleServerSession>(
config(), GetSupportedVersions(), connection, this, session_helper(),
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h
index c01359d8498..d213814e295 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_dispatcher.h
@@ -5,10 +5,10 @@
#ifndef QUICHE_QUIC_TOOLS_QUIC_SIMPLE_DISPATCHER_H_
#define QUICHE_QUIC_TOOLS_QUIC_SIMPLE_DISPATCHER_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/quic_server_session_base.h"
#include "net/third_party/quiche/src/quic/core/quic_dispatcher.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -35,7 +35,7 @@ class QuicSimpleDispatcher : public QuicDispatcher {
QuicConnectionId connection_id,
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece alpn,
+ absl::string_view alpn,
const ParsedQuicVersion& version) override;
QuicSimpleServerBackend* server_backend() {
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h
index 968ec66dd09..fad30415a37 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h
@@ -7,10 +7,7 @@
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/tools/quic_backend_response.h"
-
-namespace spdy {
-class SpdyHeaderBlock;
-} // namespace spdy
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
namespace quic {
@@ -49,7 +46,7 @@ class QuicSimpleServerBackend {
// If the response has to be fetched over the network, the function
// asynchronously calls |request_handler| with the HTTP response.
virtual void FetchResponseFromBackend(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& request_body,
RequestHandler* request_handler) = 0;
// Clears the state of the backend instance
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.cc
index 0637109d5c0..72d6259fdff 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.cc
@@ -66,13 +66,13 @@ void QuicSimpleServerSession::PromisePushResources(
const std::list<QuicBackendResponse::ServerPushInfo>& resources,
QuicStreamId original_stream_id,
const spdy::SpdyStreamPrecedence& original_precedence,
- const spdy::SpdyHeaderBlock& original_request_headers) {
+ const spdy::Http2HeaderBlock& original_request_headers) {
if (!server_push_enabled()) {
return;
}
for (const QuicBackendResponse::ServerPushInfo& resource : resources) {
- spdy::SpdyHeaderBlock headers = SynthesizePushRequestHeaders(
+ spdy::Http2HeaderBlock headers = SynthesizePushRequestHeaders(
request_url, resource, original_request_headers);
// TODO(b/136295430): Use sequential push IDs for IETF QUIC.
auto new_highest_promised_stream_id =
@@ -171,13 +171,13 @@ void QuicSimpleServerSession::HandleRstOnValidNonexistentStream(
}
}
-spdy::SpdyHeaderBlock QuicSimpleServerSession::SynthesizePushRequestHeaders(
+spdy::Http2HeaderBlock QuicSimpleServerSession::SynthesizePushRequestHeaders(
std::string request_url,
QuicBackendResponse::ServerPushInfo resource,
- const spdy::SpdyHeaderBlock& original_request_headers) {
+ const spdy::Http2HeaderBlock& original_request_headers) {
QuicUrl push_request_url = resource.request_url;
- spdy::SpdyHeaderBlock spdy_headers = original_request_headers.Clone();
+ spdy::Http2HeaderBlock spdy_headers = original_request_headers.Clone();
// :authority could be different from original request.
spdy_headers[":authority"] = push_request_url.host();
spdy_headers[":path"] = push_request_url.path();
@@ -196,7 +196,7 @@ spdy::SpdyHeaderBlock QuicSimpleServerSession::SynthesizePushRequestHeaders(
void QuicSimpleServerSession::SendPushPromise(QuicStreamId original_stream_id,
QuicStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers) {
+ spdy::Http2HeaderBlock headers) {
QUIC_DLOG(INFO) << "stream " << original_stream_id
<< " send PUSH_PROMISE for promised stream "
<< promised_stream_id;
@@ -226,7 +226,7 @@ void QuicSimpleServerSession::HandlePromisedPushRequests() {
promised_stream->SetPriority(promised_info.precedence);
- spdy::SpdyHeaderBlock request_headers(
+ spdy::Http2HeaderBlock request_headers(
std::move(promised_info.request_headers));
promised_streams_.pop_front();
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.h b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.h
index 9942c7d80ad..6d1bc81e64c 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session.h
@@ -38,14 +38,14 @@ class QuicSimpleServerSession : public QuicServerSessionBase {
// stream id with its priority and the headers sent out in PUSH_PROMISE.
struct PromisedStreamInfo {
public:
- PromisedStreamInfo(spdy::SpdyHeaderBlock request_headers,
+ PromisedStreamInfo(spdy::Http2HeaderBlock request_headers,
QuicStreamId stream_id,
const spdy::SpdyStreamPrecedence& precedence)
: request_headers(std::move(request_headers)),
stream_id(stream_id),
precedence(precedence),
is_cancelled(false) {}
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
QuicStreamId stream_id;
spdy::SpdyStreamPrecedence precedence;
bool is_cancelled;
@@ -77,7 +77,7 @@ class QuicSimpleServerSession : public QuicServerSessionBase {
const std::list<QuicBackendResponse::ServerPushInfo>& resources,
QuicStreamId original_stream_id,
const spdy::SpdyStreamPrecedence& original_precedence,
- const spdy::SpdyHeaderBlock& original_request_headers);
+ const spdy::Http2HeaderBlock& original_request_headers);
void OnCanCreateNewOutgoingStream(bool unidirectional) override;
@@ -113,15 +113,15 @@ class QuicSimpleServerSession : public QuicServerSessionBase {
// :authority, :path, :method, :scheme, referer.
// Copying the rest headers ensures they are the same as the original
// request, especially cookies.
- spdy::SpdyHeaderBlock SynthesizePushRequestHeaders(
+ spdy::Http2HeaderBlock SynthesizePushRequestHeaders(
std::string request_url,
QuicBackendResponse::ServerPushInfo resource,
- const spdy::SpdyHeaderBlock& original_request_headers);
+ const spdy::Http2HeaderBlock& original_request_headers);
// Send PUSH_PROMISE frame on headers stream.
void SendPushPromise(QuicStreamId original_stream_id,
QuicStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers);
+ spdy::Http2HeaderBlock headers);
// Fetch response from cache for request headers enqueued into
// promised_headers_and_streams_ and send them on dedicated stream until
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session_test.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session_test.cc
index 780ff9df099..66ee8c4591a 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_session_test.cc
@@ -8,6 +8,8 @@
#include <memory>
#include <utility>
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/http/http_encoder.h"
@@ -35,7 +37,6 @@
#include "net/third_party/quiche/src/quic/tools/quic_backend_response.h"
#include "net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
using testing::_;
@@ -50,7 +51,7 @@ namespace quic {
namespace test {
namespace {
-typedef QuicSimpleServerSession::PromisedStreamInfo PromisedStreamInfo;
+using PromisedStreamInfo = QuicSimpleServerSession::PromisedStreamInfo;
const QuicByteCount kHeadersFrameHeaderLength = 2;
const QuicByteCount kHeadersFramePayloadLength = 9;
@@ -187,11 +188,11 @@ class MockQuicSimpleServerSession : public QuicSimpleServerSession {
crypto_config,
compressed_certs_cache,
quic_simple_server_backend) {}
- // Methods taking non-copyable types like SpdyHeaderBlock by value cannot be
+ // Methods taking non-copyable types like Http2HeaderBlock by value cannot be
// mocked directly.
void WritePushPromise(QuicStreamId original_stream_id,
QuicStreamId promised_stream_id,
- spdy::SpdyHeaderBlock headers) override {
+ spdy::Http2HeaderBlock headers) override {
return WritePushPromiseMock(original_stream_id, promised_stream_id,
headers);
}
@@ -199,10 +200,14 @@ class MockQuicSimpleServerSession : public QuicSimpleServerSession {
WritePushPromiseMock,
(QuicStreamId original_stream_id,
QuicStreamId promised_stream_id,
- const spdy::SpdyHeaderBlock& headers),
+ const spdy::Http2HeaderBlock& headers),
());
MOCK_METHOD(void, SendBlocked, (QuicStreamId), (override));
+ MOCK_METHOD(bool,
+ WriteControlFrame,
+ (const QuicFrame& frame, TransmissionType type),
+ (override));
};
class QuicSimpleServerSessionTest
@@ -256,6 +261,9 @@ class QuicSimpleServerSessionTest
connection_ = new StrictMock<MockQuicConnectionWithSendStreamData>(
&helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions);
connection_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
session_ = std::make_unique<MockQuicSimpleServerSession>(
config_, connection_, &owner_, &stream_helper_, &crypto_config_,
&compressed_certs_cache_, &memory_cache_backend_);
@@ -266,9 +274,8 @@ class QuicSimpleServerSessionTest
session_->Initialize();
if (VersionHasIetfQuicFrames(transport_version())) {
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillRepeatedly(Invoke(
- this, &QuicSimpleServerSessionTest::ClearMaxStreamsControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
}
session_->OnConfigNegotiated();
}
@@ -326,7 +333,7 @@ TEST_P(QuicSimpleServerSessionTest, CloseStreamDueToReset) {
// Open a stream, then reset it.
// Send two bytes of payload to open it.
QuicStreamFrame data1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
session_->OnStreamFrame(data1);
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
@@ -335,7 +342,8 @@ TEST_P(QuicSimpleServerSessionTest, CloseStreamDueToReset) {
GetNthClientInitiatedBidirectionalId(0),
QUIC_ERROR_PROCESSING_STREAM, 0);
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
+
if (!VersionHasIetfQuicFrames(transport_version())) {
// For version 99, this is covered in InjectStopSending()
EXPECT_CALL(*connection_,
@@ -365,7 +373,7 @@ TEST_P(QuicSimpleServerSessionTest, NeverOpenStreamDueToReset) {
QUIC_ERROR_PROCESSING_STREAM, 0);
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
if (!VersionHasIetfQuicFrames(transport_version())) {
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
// For version 99, this is covered in InjectStopSending()
EXPECT_CALL(*connection_,
OnStreamReset(GetNthClientInitiatedBidirectionalId(0),
@@ -382,7 +390,7 @@ TEST_P(QuicSimpleServerSessionTest, NeverOpenStreamDueToReset) {
// Send two bytes of payload.
QuicStreamFrame data1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
session_->OnStreamFrame(data1);
// The stream should never be opened, now that the reset is received.
@@ -393,9 +401,9 @@ TEST_P(QuicSimpleServerSessionTest, NeverOpenStreamDueToReset) {
TEST_P(QuicSimpleServerSessionTest, AcceptClosedStream) {
// Send (empty) compressed headers followed by two bytes of data.
QuicStreamFrame frame1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("\1\0\0\0\0\0\0\0HT"));
+ absl::string_view("\1\0\0\0\0\0\0\0HT"));
QuicStreamFrame frame2(GetNthClientInitiatedBidirectionalId(1), false, 0,
- quiche::QuicheStringPiece("\2\0\0\0\0\0\0\0HT"));
+ absl::string_view("\3\0\0\0\0\0\0\0HT"));
session_->OnStreamFrame(frame1);
session_->OnStreamFrame(frame2);
EXPECT_EQ(2u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
@@ -406,7 +414,7 @@ TEST_P(QuicSimpleServerSessionTest, AcceptClosedStream) {
QUIC_ERROR_PROCESSING_STREAM, 0);
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
if (!VersionHasIetfQuicFrames(transport_version())) {
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
// For version 99, this is covered in InjectStopSending()
EXPECT_CALL(*connection_,
OnStreamReset(GetNthClientInitiatedBidirectionalId(0),
@@ -423,9 +431,9 @@ TEST_P(QuicSimpleServerSessionTest, AcceptClosedStream) {
// past the reset point of stream 3. As it's a closed stream we just drop the
// data on the floor, but accept the packet because it has data for stream 5.
QuicStreamFrame frame3(GetNthClientInitiatedBidirectionalId(0), false, 2,
- quiche::QuicheStringPiece("TP"));
+ absl::string_view("TP"));
QuicStreamFrame frame4(GetNthClientInitiatedBidirectionalId(1), false, 2,
- quiche::QuicheStringPiece("TP"));
+ absl::string_view("TP"));
session_->OnStreamFrame(frame3);
session_->OnStreamFrame(frame4);
// The stream should never be opened, now that the reset is received.
@@ -502,7 +510,7 @@ TEST_P(QuicSimpleServerSessionTest, CreateOutgoingDynamicStreamUptoLimit) {
// Receive some data to initiate a incoming stream which should not effect
// creating outgoing streams.
QuicStreamFrame data1(GetNthClientInitiatedBidirectionalId(0), false, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
session_->OnStreamFrame(data1);
EXPECT_EQ(1u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()));
EXPECT_EQ(0u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()) -
@@ -551,7 +559,7 @@ TEST_P(QuicSimpleServerSessionTest, CreateOutgoingDynamicStreamUptoLimit) {
// Create peer initiated stream should have no problem.
QuicStreamFrame data2(GetNthClientInitiatedBidirectionalId(1), false, 0,
- quiche::QuicheStringPiece("HT"));
+ absl::string_view("HT"));
session_->OnStreamFrame(data2);
EXPECT_EQ(2u, QuicSessionPeer::GetNumOpenDynamicStreams(session_.get()) -
/*outcoming=*/kMaxStreamsForTest);
@@ -559,7 +567,7 @@ TEST_P(QuicSimpleServerSessionTest, CreateOutgoingDynamicStreamUptoLimit) {
TEST_P(QuicSimpleServerSessionTest, OnStreamFrameWithEvenStreamId) {
QuicStreamFrame frame(GetNthServerInitiatedUnidirectionalId(0), false, 0,
- quiche::QuicheStringPiece());
+ absl::string_view());
EXPECT_CALL(*connection_,
CloseConnection(QUIC_INVALID_STREAM_ID,
"Client sent data on server push stream", _));
@@ -622,6 +630,9 @@ class QuicSimpleServerSessionServerPushTest
ParsedQuicVersionVector supported_versions = SupportedVersions(GetParam());
connection_ = new StrictMock<MockQuicConnectionWithSendStreamData>(
&helper_, &alarm_factory_, Perspective::IS_SERVER, supported_versions);
+ connection_->SetEncrypter(
+ ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<NullEncrypter>(connection_->perspective()));
session_ = std::make_unique<MockQuicSimpleServerSession>(
config_, connection_, &owner_, &stream_helper_, &crypto_config_,
&compressed_certs_cache_, &memory_cache_backend_);
@@ -629,9 +640,8 @@ class QuicSimpleServerSessionServerPushTest
// Needed to make new session flow control window and server push work.
if (VersionHasIetfQuicFrames(transport_version())) {
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillRepeatedly(Invoke(this, &QuicSimpleServerSessionServerPushTest::
- ClearMaxStreamsControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillRepeatedly(Invoke(&ClearControlFrameWithTransmissionType));
}
session_->OnConfigNegotiated();
@@ -676,7 +686,7 @@ class QuicSimpleServerSessionServerPushTest
size_t body_size = 2 * kStreamFlowControlWindowSize; // 64KB.
std::string request_url = "mail.google.com/";
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
std::string resource_host = "www.google.com";
std::string partial_push_resource_path = "/server_push_src";
std::list<QuicBackendResponse::ServerPushInfo> push_resources;
@@ -708,7 +718,7 @@ class QuicSimpleServerSessionServerPushTest
memory_cache_backend_.AddSimpleResponse(resource_host, path, 200, data);
push_resources.push_back(QuicBackendResponse::ServerPushInfo(
- resource_url, spdy::SpdyHeaderBlock(), QuicStream::kDefaultPriority,
+ resource_url, spdy::Http2HeaderBlock(), QuicStream::kDefaultPriority,
body));
// PUSH_PROMISED are sent for all the resources.
EXPECT_CALL(*session_,
@@ -881,8 +891,8 @@ TEST_P(QuicSimpleServerSessionServerPushTest,
// V99 will send out a STREAMS_BLOCKED frame when it tries to exceed the
// limit. This will clear the frames so that they do not block the later
// rst-stream frame.
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
}
QuicByteCount data_frame_header_length = PromisePushResources(num_resources);
@@ -898,8 +908,8 @@ TEST_P(QuicSimpleServerSessionServerPushTest,
QuicRstStreamFrame rst(kInvalidControlFrameId, stream_got_reset,
QUIC_STREAM_CANCELLED, 0);
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
EXPECT_CALL(*connection_,
OnStreamReset(stream_got_reset, QUIC_RST_ACKNOWLEDGEMENT));
session_->OnRstStream(rst);
@@ -968,8 +978,8 @@ TEST_P(QuicSimpleServerSessionServerPushTest,
// V99 will send out a stream-id-blocked frame when the we desired to exceed
// the limit. This will clear the frames so that they do not block the later
// rst-stream frame.
- EXPECT_CALL(*connection_, SendControlFrame(_))
- .WillOnce(Invoke(&ClearControlFrame));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _))
+ .WillOnce(Invoke(&ClearControlFrameWithTransmissionType));
}
QuicByteCount data_frame_header_length = PromisePushResources(num_resources);
QuicStreamId stream_to_open;
@@ -983,7 +993,7 @@ TEST_P(QuicSimpleServerSessionServerPushTest,
// Resetting an open stream will close the stream and give space for extra
// stream to be opened.
QuicStreamId stream_got_reset = GetNthServerInitiatedUnidirectionalId(3);
- EXPECT_CALL(*connection_, SendControlFrame(_));
+ EXPECT_CALL(*session_, WriteControlFrame(_, _));
if (!VersionHasIetfQuicFrames(transport_version())) {
EXPECT_CALL(owner_, OnRstStreamReceived(_)).Times(1);
// For version 99, this is covered in InjectStopSending()
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.cc
index 84ddb055aa7..93b43562842 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.cc
@@ -7,6 +7,8 @@
#include <list>
#include <utility>
+#include "absl/strings/numbers.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_stream.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -15,11 +17,10 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_map_util.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
-using spdy::SpdyHeaderBlock;
+using spdy::Http2HeaderBlock;
namespace quic {
@@ -109,7 +110,7 @@ void QuicSimpleServerStream::OnBodyAvailable() {
}
void QuicSimpleServerStream::PushResponse(
- SpdyHeaderBlock push_request_headers) {
+ Http2HeaderBlock push_request_headers) {
if (QuicUtils::IsClientInitiatedStreamId(session()->transport_version(),
id())) {
QUIC_BUG << "Client initiated stream shouldn't be used as promised stream.";
@@ -208,7 +209,7 @@ void QuicSimpleServerStream::OnResponseBackendComplete(
std::string request_url = request_headers_[":authority"].as_string() +
request_headers_[":path"].as_string();
int response_code;
- const SpdyHeaderBlock& response_headers = response->headers();
+ const Http2HeaderBlock& response_headers = response->headers();
if (!ParseHeaderStatusCode(response_headers, &response_code)) {
auto status = response_headers.find(":status");
if (status == response_headers.end()) {
@@ -257,13 +258,12 @@ void QuicSimpleServerStream::OnResponseBackendComplete(
if (response->response_type() == QuicBackendResponse::GENERATE_BYTES) {
QUIC_DVLOG(1) << "Stream " << id() << " sending a generate bytes response.";
std::string path = request_headers_[":path"].as_string().substr(1);
- if (!quiche::QuicheTextUtils::StringToUint64(path,
- &generate_bytes_length_)) {
+ if (!absl::SimpleAtoi(path, &generate_bytes_length_)) {
QUIC_LOG(ERROR) << "Path is not a number.";
SendNotFoundResponse();
return;
}
- SpdyHeaderBlock headers = response->headers().Clone();
+ Http2HeaderBlock headers = response->headers().Clone();
headers["content-length"] =
quiche::QuicheTextUtils::Uint64ToString(generate_bytes_length_);
@@ -297,7 +297,7 @@ void QuicSimpleServerStream::WriteGeneratedBytes() {
void QuicSimpleServerStream::SendNotFoundResponse() {
QUIC_DVLOG(1) << "Stream " << id() << " sending not found response.";
- SpdyHeaderBlock headers;
+ Http2HeaderBlock headers;
headers[":status"] = "404";
headers["content-length"] =
quiche::QuicheTextUtils::Uint64ToString(strlen(kNotFoundResponseBody));
@@ -310,7 +310,7 @@ void QuicSimpleServerStream::SendErrorResponse() {
void QuicSimpleServerStream::SendErrorResponse(int resp_code) {
QUIC_DVLOG(1) << "Stream " << id() << " sending error response.";
- SpdyHeaderBlock headers;
+ Http2HeaderBlock headers;
if (resp_code <= 0) {
headers[":status"] = "500";
} else {
@@ -322,8 +322,8 @@ void QuicSimpleServerStream::SendErrorResponse(int resp_code) {
}
void QuicSimpleServerStream::SendIncompleteResponse(
- SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece body) {
+ Http2HeaderBlock response_headers,
+ absl::string_view body) {
QUIC_DLOG(INFO) << "Stream " << id() << " writing headers (fin = false) : "
<< response_headers.DebugString();
WriteHeaders(std::move(response_headers), /*fin=*/false, nullptr);
@@ -336,16 +336,16 @@ void QuicSimpleServerStream::SendIncompleteResponse(
}
void QuicSimpleServerStream::SendHeadersAndBody(
- SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece body) {
+ Http2HeaderBlock response_headers,
+ absl::string_view body) {
SendHeadersAndBodyAndTrailers(std::move(response_headers), body,
- SpdyHeaderBlock());
+ Http2HeaderBlock());
}
void QuicSimpleServerStream::SendHeadersAndBodyAndTrailers(
- SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece body,
- SpdyHeaderBlock response_trailers) {
+ Http2HeaderBlock response_headers,
+ absl::string_view body,
+ Http2HeaderBlock response_trailers) {
// Send the headers, with a FIN if there's nothing else to send.
bool send_fin = (body.empty() && response_trailers.empty());
QUIC_DLOG(INFO) << "Stream " << id() << " writing headers (fin = " << send_fin
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h
index add4a12875d..6b8826cd866 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream.h
@@ -5,11 +5,11 @@
#ifndef QUICHE_QUIC_TOOLS_QUIC_SIMPLE_SERVER_STREAM_H_
#define QUICHE_QUIC_TOOLS_QUIC_SIMPLE_SERVER_STREAM_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_server_stream_base.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/tools/quic_backend_response.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_backend.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_framer.h"
namespace quic {
@@ -47,7 +47,7 @@ class QuicSimpleServerStream : public QuicSpdyServerStreamBase,
// Make this stream start from as if it just finished parsing an incoming
// request whose headers are equivalent to |push_request_headers|.
// Doing so will trigger this toy stream to fetch response and send it back.
- virtual void PushResponse(spdy::SpdyHeaderBlock push_request_headers);
+ virtual void PushResponse(spdy::Http2HeaderBlock push_request_headers);
// The response body of error responses.
static const char* const kErrorResponseBody;
@@ -76,16 +76,16 @@ class QuicSimpleServerStream : public QuicSpdyServerStreamBase,
void SendNotFoundResponse();
// Sends the response header and body, but not the fin.
- void SendIncompleteResponse(spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece body);
+ void SendIncompleteResponse(spdy::Http2HeaderBlock response_headers,
+ absl::string_view body);
- void SendHeadersAndBody(spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece body);
- void SendHeadersAndBodyAndTrailers(spdy::SpdyHeaderBlock response_headers,
- quiche::QuicheStringPiece body,
- spdy::SpdyHeaderBlock response_trailers);
+ void SendHeadersAndBody(spdy::Http2HeaderBlock response_headers,
+ absl::string_view body);
+ void SendHeadersAndBodyAndTrailers(spdy::Http2HeaderBlock response_headers,
+ absl::string_view body,
+ spdy::Http2HeaderBlock response_trailers);
- spdy::SpdyHeaderBlock* request_headers() { return &request_headers_; }
+ spdy::Http2HeaderBlock* request_headers() { return &request_headers_; }
const std::string& body() { return body_; }
@@ -93,7 +93,7 @@ class QuicSimpleServerStream : public QuicSpdyServerStreamBase,
void WriteGeneratedBytes();
// The parsed headers received from the client.
- spdy::SpdyHeaderBlock request_headers_;
+ spdy::Http2HeaderBlock request_headers_;
int64_t content_length_;
std::string body_;
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream_test.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream_test.cc
index f5c1b53dde1..4b21ccaded1 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_simple_server_stream_test.cc
@@ -8,8 +8,13 @@
#include <memory>
#include <utility>
+#include "absl/base/macros.h"
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
+#include "net/third_party/quiche/src/quic/core/crypto/null_encrypter.h"
#include "net/third_party/quiche/src/quic/core/http/http_encoder.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
+#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_expect_bug.h"
@@ -26,9 +31,6 @@
#include "net/third_party/quiche/src/quic/tools/quic_backend_response.h"
#include "net/third_party/quiche/src/quic/tools/quic_memory_cache_backend.h"
#include "net/third_party/quiche/src/quic/tools/quic_simple_server_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
using testing::_;
using testing::AnyNumber;
@@ -58,7 +60,7 @@ class TestStream : public QuicSimpleServerStream {
MOCK_METHOD(void, WriteHeadersMock, (bool fin), ());
- size_t WriteHeaders(spdy::SpdyHeaderBlock /*header_block*/,
+ size_t WriteHeaders(spdy::Http2HeaderBlock /*header_block*/,
bool fin,
QuicReferenceCountedPointer<QuicAckListenerInterface>
/*ack_listener*/) override {
@@ -70,12 +72,12 @@ class TestStream : public QuicSimpleServerStream {
void DoSendResponse() { SendResponse(); }
void DoSendErrorResponse() { SendErrorResponse(); }
- spdy::SpdyHeaderBlock* mutable_headers() { return &request_headers_; }
+ spdy::Http2HeaderBlock* mutable_headers() { return &request_headers_; }
void set_body(std::string body) { body_ = std::move(body); }
const std::string& body() const { return body_; }
int content_length() const { return content_length_; }
- quiche::QuicheStringPiece GetHeader(quiche::QuicheStringPiece key) const {
+ absl::string_view GetHeader(absl::string_view key) const {
auto it = request_headers_.find(key);
DCHECK(it != request_headers_.end());
return it->second;
@@ -137,7 +139,7 @@ class MockQuicSimpleServerSession : public QuicSimpleServerSession {
QuicStreamOffset offset,
StreamSendingState state,
TransmissionType type,
- quiche::QuicheOptional<EncryptionLevel> level),
+ absl::optional<EncryptionLevel> level),
(override));
MOCK_METHOD(void,
OnStreamHeaderList,
@@ -158,13 +160,23 @@ class MockQuicSimpleServerSession : public QuicSimpleServerSession {
QuicStreamOffset bytes_written,
bool send_rst_only),
(override));
- // Matchers cannot be used on non-copyable types like SpdyHeaderBlock.
+ MOCK_METHOD(void,
+ MaybeSendRstStreamFrame,
+ (QuicStreamId stream_id,
+ QuicRstStreamErrorCode error,
+ QuicStreamOffset bytes_written),
+ (override));
+ MOCK_METHOD(void,
+ MaybeSendStopSendingFrame,
+ (QuicStreamId stream_id, QuicRstStreamErrorCode error),
+ (override));
+ // Matchers cannot be used on non-copyable types like Http2HeaderBlock.
void PromisePushResources(
const std::string& request_url,
const std::list<QuicBackendResponse::ServerPushInfo>& resources,
QuicStreamId original_stream_id,
const spdy::SpdyStreamPrecedence& original_precedence,
- const spdy::SpdyHeaderBlock& original_request_headers) override {
+ const spdy::Http2HeaderBlock& original_request_headers) override {
original_request_headers_ = original_request_headers.Clone();
PromisePushResourcesMock(request_url, resources, original_stream_id,
original_precedence, original_request_headers);
@@ -175,18 +187,17 @@ class MockQuicSimpleServerSession : public QuicSimpleServerSession {
const std::list<QuicBackendResponse::ServerPushInfo>&,
QuicStreamId,
const spdy::SpdyStreamPrecedence&,
- const spdy::SpdyHeaderBlock&),
+ const spdy::Http2HeaderBlock&),
());
using QuicSession::ActivateStream;
- QuicConsumedData ConsumeData(
- QuicStreamId id,
- size_t write_length,
- QuicStreamOffset offset,
- StreamSendingState state,
- TransmissionType /*type*/,
- quiche::QuicheOptional<EncryptionLevel> /*level*/) {
+ QuicConsumedData ConsumeData(QuicStreamId id,
+ size_t write_length,
+ QuicStreamOffset offset,
+ StreamSendingState state,
+ TransmissionType /*type*/,
+ absl::optional<EncryptionLevel> /*level*/) {
if (write_length > 0) {
auto buf = std::make_unique<char[]>(write_length);
QuicStream* stream = GetOrCreateStream(id);
@@ -199,7 +210,7 @@ class MockQuicSimpleServerSession : public QuicSimpleServerSession {
return QuicConsumedData(write_length, state != NO_FIN);
}
- spdy::SpdyHeaderBlock original_request_headers_;
+ spdy::Http2HeaderBlock original_request_headers_;
};
class QuicSimpleServerStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
@@ -241,6 +252,9 @@ class QuicSimpleServerStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
session_.config()->SetInitialSessionFlowControlWindowToSend(
kInitialSessionFlowControlWindowForTest);
session_.Initialize();
+ connection_->SetEncrypter(
+ quic::ENCRYPTION_FORWARD_SECURE,
+ std::make_unique<quic::NullEncrypter>(connection_->perspective()));
if (connection_->version().SupportsAntiAmplificationLimit()) {
QuicConnectionPeer::SetAddressValidated(connection_);
}
@@ -273,7 +287,7 @@ class QuicSimpleServerStreamTest : public QuicTestWithParam<ParsedQuicVersion> {
return VersionUsesHttp3(connection_->transport_version());
}
- spdy::SpdyHeaderBlock response_headers_;
+ spdy::Http2HeaderBlock response_headers_;
MockQuicConnectionHelper helper_;
MockAlarmFactory alarm_factory_;
StrictMock<MockQuicConnection>* connection_;
@@ -342,7 +356,18 @@ TEST_P(QuicSimpleServerStreamTest, SendQuicRstStreamNoErrorInStopReading) {
QuicStreamPeer::SetFinSent(stream_);
stream_->CloseWriteSide();
- EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _)).Times(1);
+ if (!session_.split_up_send_rst()) {
+ EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _))
+ .Times(1);
+ } else {
+ if (session_.version().UsesHttp3()) {
+ EXPECT_CALL(session_, MaybeSendStopSendingFrame(_, QUIC_STREAM_NO_ERROR))
+ .Times(1);
+ } else {
+ EXPECT_CALL(session_, MaybeSendRstStreamFrame(_, QUIC_STREAM_NO_ERROR, _))
+ .Times(1);
+ }
+ }
stream_->StopReading();
}
@@ -384,7 +409,7 @@ TEST_P(QuicSimpleServerStreamTest, TestFramingExtraData) {
TEST_P(QuicSimpleServerStreamTest, SendResponseWithIllegalResponseStatus) {
// Send an illegal response with response status not supported by HTTP/2.
- spdy::SpdyHeaderBlock* request_headers = stream_->mutable_headers();
+ spdy::Http2HeaderBlock* request_headers = stream_->mutable_headers();
(*request_headers)[":path"] = "/bar";
(*request_headers)[":authority"] = "www.google.com";
(*request_headers)[":method"] = "GET";
@@ -416,7 +441,7 @@ TEST_P(QuicSimpleServerStreamTest, SendResponseWithIllegalResponseStatus) {
TEST_P(QuicSimpleServerStreamTest, SendResponseWithIllegalResponseStatus2) {
// Send an illegal response with response status not supported by HTTP/2.
- spdy::SpdyHeaderBlock* request_headers = stream_->mutable_headers();
+ spdy::Http2HeaderBlock* request_headers = stream_->mutable_headers();
(*request_headers)[":path"] = "/bar";
(*request_headers)[":authority"] = "www.google.com";
(*request_headers)[":method"] = "GET";
@@ -457,7 +482,7 @@ TEST_P(QuicSimpleServerStreamTest, SendPushResponseWith404Response) {
// Send a push response with response status 404, which will be regarded as
// invalid server push response.
- spdy::SpdyHeaderBlock* request_headers = promised_stream->mutable_headers();
+ spdy::Http2HeaderBlock* request_headers = promised_stream->mutable_headers();
(*request_headers)[":path"] = "/bar";
(*request_headers)[":authority"] = "www.google.com";
(*request_headers)[":method"] = "GET";
@@ -470,15 +495,23 @@ TEST_P(QuicSimpleServerStreamTest, SendPushResponseWith404Response) {
std::move(response_headers_), body);
InSequence s;
- EXPECT_CALL(session_, SendRstStream(promised_stream->id(),
- QUIC_STREAM_CANCELLED, 0, _));
+ if (!session_.split_up_send_rst()) {
+ EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_CANCELLED, 0, _));
+ } else {
+ if (session_.version().UsesHttp3()) {
+ EXPECT_CALL(session_, MaybeSendStopSendingFrame(promised_stream->id(),
+ QUIC_STREAM_CANCELLED));
+ }
+ EXPECT_CALL(session_, MaybeSendRstStreamFrame(promised_stream->id(),
+ QUIC_STREAM_CANCELLED, 0));
+ }
promised_stream->DoSendResponse();
}
TEST_P(QuicSimpleServerStreamTest, SendResponseWithValidHeaders) {
// Add a request and response with valid headers.
- spdy::SpdyHeaderBlock* request_headers = stream_->mutable_headers();
+ spdy::Http2HeaderBlock* request_headers = stream_->mutable_headers();
(*request_headers)[":path"] = "/bar";
(*request_headers)[":authority"] = "www.google.com";
(*request_headers)[":method"] = "GET";
@@ -519,14 +552,14 @@ TEST_P(QuicSimpleServerStreamTest, SendResponseWithPushResources) {
QuicByteCount header_length =
HttpEncoder::SerializeDataFrameHeader(body.length(), &buffer);
QuicBackendResponse::ServerPushInfo push_info(
- QuicUrl(host, "/bar"), spdy::SpdyHeaderBlock(),
+ QuicUrl(host, "/bar"), spdy::Http2HeaderBlock(),
QuicStream::kDefaultPriority, "Push body");
std::list<QuicBackendResponse::ServerPushInfo> push_resources;
push_resources.push_back(push_info);
memory_cache_backend_.AddSimpleResponseWithServerPushResources(
host, request_path, 200, body, push_resources);
- spdy::SpdyHeaderBlock* request_headers = stream_->mutable_headers();
+ spdy::Http2HeaderBlock* request_headers = stream_->mutable_headers();
(*request_headers)[":path"] = request_path;
(*request_headers)[":authority"] = host;
(*request_headers)[":method"] = "GET";
@@ -555,7 +588,7 @@ TEST_P(QuicSimpleServerStreamTest, PushResponseOnClientInitiatedStream) {
// Calling PushResponse() on a client initialted stream is never supposed to
// happen.
- EXPECT_QUIC_BUG(stream_->PushResponse(spdy::SpdyHeaderBlock()),
+ EXPECT_QUIC_BUG(stream_->PushResponse(spdy::Http2HeaderBlock()),
"Client initiated stream"
" shouldn't be used as promised stream.");
}
@@ -576,7 +609,7 @@ TEST_P(QuicSimpleServerStreamTest, PushResponseOnServerInitiatedStream) {
const std::string kHost = "www.foo.com";
const std::string kPath = "/bar";
- spdy::SpdyHeaderBlock headers;
+ spdy::Http2HeaderBlock headers;
headers[":path"] = kPath;
headers[":authority"] = kHost;
headers[":method"] = "GET";
@@ -627,10 +660,9 @@ TEST_P(QuicSimpleServerStreamTest, TestSendErrorResponse) {
TEST_P(QuicSimpleServerStreamTest, InvalidMultipleContentLength) {
EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _)).Times(0);
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
// \000 is a way to write the null byte when followed by a literal digit.
- header_list_.OnHeader("content-length",
- quiche::QuicheStringPiece("11\00012", 5));
+ header_list_.OnHeader("content-length", absl::string_view("11\00012", 5));
EXPECT_CALL(*stream_, WriteHeadersMock(false));
EXPECT_CALL(session_, WritevData(_, _, _, _, _, _))
@@ -646,10 +678,9 @@ TEST_P(QuicSimpleServerStreamTest, InvalidMultipleContentLength) {
TEST_P(QuicSimpleServerStreamTest, InvalidLeadingNullContentLength) {
EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _)).Times(0);
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
// \000 is a way to write the null byte when followed by a literal digit.
- header_list_.OnHeader("content-length",
- quiche::QuicheStringPiece("\00012", 3));
+ header_list_.OnHeader("content-length", absl::string_view("\00012", 3));
EXPECT_CALL(*stream_, WriteHeadersMock(false));
EXPECT_CALL(session_, WritevData(_, _, _, _, _, _))
@@ -663,10 +694,9 @@ TEST_P(QuicSimpleServerStreamTest, InvalidLeadingNullContentLength) {
}
TEST_P(QuicSimpleServerStreamTest, ValidMultipleContentLength) {
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
// \000 is a way to write the null byte when followed by a literal digit.
- header_list_.OnHeader("content-length",
- quiche::QuicheStringPiece("11\00011", 5));
+ header_list_.OnHeader("content-length", absl::string_view("11\00011", 5));
stream_->OnStreamHeaderList(false, kFakeFrameLen, header_list_);
@@ -678,7 +708,6 @@ TEST_P(QuicSimpleServerStreamTest, ValidMultipleContentLength) {
TEST_P(QuicSimpleServerStreamTest,
DoNotSendQuicRstStreamNoErrorWithRstReceived) {
- InSequence s;
EXPECT_FALSE(stream_->reading_stopped());
EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _, _)).Times(0);
@@ -691,16 +720,33 @@ TEST_P(QuicSimpleServerStreamTest,
EXPECT_CALL(session_, WritevData(qpack_decoder_stream->id(), _, _, _, _, _))
.Times(AnyNumber());
}
- EXPECT_CALL(session_, SendRstStream(_, QUIC_RST_ACKNOWLEDGEMENT, _, _))
- .Times(1);
+
+ if (!session_.split_up_send_rst()) {
+ EXPECT_CALL(session_, SendRstStream(_,
+ session_.version().UsesHttp3()
+ ? QUIC_STREAM_CANCELLED
+ : QUIC_RST_ACKNOWLEDGEMENT,
+ _, _))
+ .Times(1);
+ } else {
+ EXPECT_CALL(session_,
+ MaybeSendRstStreamFrame(_,
+ session_.version().UsesHttp3()
+ ? QUIC_STREAM_CANCELLED
+ : QUIC_RST_ACKNOWLEDGEMENT,
+ _))
+ .Times(1);
+ }
QuicRstStreamFrame rst_frame(kInvalidControlFrameId, stream_->id(),
QUIC_STREAM_CANCELLED, 1234);
stream_->OnStreamReset(rst_frame);
if (VersionHasIetfQuicFrames(connection_->transport_version())) {
- // For V99 receiving a RST_STREAM causes a 1-way close; the test requires
- // a full close. A CloseWriteSide closes the other half of the stream.
- // Everything should then work properly.
- stream_->CloseWriteSide();
+ EXPECT_CALL(session_owner_, OnStopSendingReceived(_));
+ // Create and inject a STOP SENDING frame to complete the close
+ // of the stream. This is only needed for version 99/IETF QUIC.
+ QuicStopSendingFrame stop_sending(kInvalidControlFrameId, stream_->id(),
+ QUIC_STREAM_CANCELLED);
+ session_.OnStopSendingFrame(stop_sending);
}
EXPECT_TRUE(stream_->reading_stopped());
EXPECT_TRUE(stream_->write_side_closed());
@@ -730,7 +776,7 @@ TEST_P(QuicSimpleServerStreamTest, InvalidHeadersWithFin) {
0x54, 0x54, 0x50, 0x2f, // TTP/
0x31, 0x2e, 0x31, // 1.1
};
- quiche::QuicheStringPiece data(arr, QUICHE_ARRAYSIZE(arr));
+ absl::string_view data(arr, ABSL_ARRAYSIZE(arr));
QuicStreamFrame frame(stream_->id(), true, 0, data);
// Verify that we don't crash when we get a invalid headers in stream frame.
stream_->OnStreamFrame(frame);
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.cc
index 212e605f298..134e673dd9f 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.cc
@@ -6,15 +6,16 @@
#include <utility>
+#include "absl/strings/numbers.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/quic_random.h"
#include "net/third_party/quiche/src/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_flags.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_logging.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
-using spdy::SpdyHeaderBlock;
+using spdy::Http2HeaderBlock;
namespace quic {
@@ -24,8 +25,8 @@ void QuicSpdyClientBase::ClientQuicDataToResend::Resend() {
}
QuicSpdyClientBase::QuicDataToResend::QuicDataToResend(
- std::unique_ptr<SpdyHeaderBlock> headers,
- quiche::QuicheStringPiece body,
+ std::unique_ptr<Http2HeaderBlock> headers,
+ absl::string_view body,
bool fin)
: headers_(std::move(headers)), body_(body), fin_(fin) {}
@@ -80,7 +81,7 @@ void QuicSpdyClientBase::OnClose(QuicSpdyStream* stream) {
QuicSpdyClientStream* client_stream =
static_cast<QuicSpdyClientStream*>(stream);
- const SpdyHeaderBlock& response_headers = client_stream->response_headers();
+ const Http2HeaderBlock& response_headers = client_stream->response_headers();
if (response_listener_ != nullptr) {
response_listener_->OnCompleteResponse(stream->id(), response_headers,
client_stream->data());
@@ -91,8 +92,7 @@ void QuicSpdyClientBase::OnClose(QuicSpdyStream* stream) {
auto status = response_headers.find(":status");
if (status == response_headers.end()) {
QUIC_LOG(ERROR) << "Missing :status response header";
- } else if (!quiche::QuicheTextUtils::StringToInt(status->second,
- &latest_response_code_)) {
+ } else if (!absl::SimpleAtoi(status->second, &latest_response_code_)) {
QUIC_LOG(ERROR) << "Invalid :status response header: " << status->second;
}
latest_response_headers_ = response_headers.DebugString();
@@ -113,12 +113,12 @@ std::unique_ptr<QuicSession> QuicSpdyClientBase::CreateQuicClientSession(
&push_promise_index_);
}
-void QuicSpdyClientBase::SendRequest(const SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+void QuicSpdyClientBase::SendRequest(const Http2HeaderBlock& headers,
+ absl::string_view body,
bool fin) {
if (GetQuicFlag(FLAGS_quic_client_convert_http_header_name_to_lowercase)) {
QUIC_CODE_COUNT(quic_client_convert_http_header_name_to_lowercase);
- SpdyHeaderBlock sanitized_headers;
+ Http2HeaderBlock sanitized_headers;
for (const auto& p : headers) {
sanitized_headers[quiche::QuicheTextUtils::ToLower(p.first)] = p.second;
}
@@ -129,8 +129,8 @@ void QuicSpdyClientBase::SendRequest(const SpdyHeaderBlock& headers,
}
}
-void QuicSpdyClientBase::SendRequestInternal(SpdyHeaderBlock sanitized_headers,
- quiche::QuicheStringPiece body,
+void QuicSpdyClientBase::SendRequestInternal(Http2HeaderBlock sanitized_headers,
+ absl::string_view body,
bool fin) {
QuicClientPushPromiseIndex::TryHandle* handle;
QuicAsyncStatus rv =
@@ -153,8 +153,8 @@ void QuicSpdyClientBase::SendRequestInternal(SpdyHeaderBlock sanitized_headers,
}
void QuicSpdyClientBase::SendRequestAndWaitForResponse(
- const SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ const Http2HeaderBlock& headers,
+ absl::string_view body,
bool fin) {
SendRequest(headers, body, fin);
while (WaitForEvents()) {
@@ -164,7 +164,7 @@ void QuicSpdyClientBase::SendRequestAndWaitForResponse(
void QuicSpdyClientBase::SendRequestsAndWaitForResponse(
const std::vector<std::string>& url_list) {
for (size_t i = 0; i < url_list.size(); ++i) {
- SpdyHeaderBlock headers;
+ Http2HeaderBlock headers;
if (!SpdyUtils::PopulateHeaderBlockFromUrl(url_list[i], &headers)) {
QUIC_BUG << "Unable to create request";
continue;
@@ -232,19 +232,19 @@ void QuicSpdyClientBase::ResendSavedData() {
}
}
-void QuicSpdyClientBase::AddPromiseDataToResend(const SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+void QuicSpdyClientBase::AddPromiseDataToResend(const Http2HeaderBlock& headers,
+ absl::string_view body,
bool fin) {
- std::unique_ptr<SpdyHeaderBlock> new_headers(
- new SpdyHeaderBlock(headers.Clone()));
+ std::unique_ptr<Http2HeaderBlock> new_headers(
+ new Http2HeaderBlock(headers.Clone()));
push_promise_data_to_resend_.reset(
new ClientQuicDataToResend(std::move(new_headers), body, fin, this));
}
bool QuicSpdyClientBase::CheckVary(
- const SpdyHeaderBlock& /*client_request*/,
- const SpdyHeaderBlock& /*promise_request*/,
- const SpdyHeaderBlock& /*promise_response*/) {
+ const Http2HeaderBlock& /*client_request*/,
+ const Http2HeaderBlock& /*promise_request*/,
+ const Http2HeaderBlock& /*promise_response*/) {
return true;
}
@@ -274,7 +274,7 @@ const std::string& QuicSpdyClientBase::preliminary_response_headers() const {
return preliminary_response_headers_;
}
-const SpdyHeaderBlock& QuicSpdyClientBase::latest_response_header_block()
+const Http2HeaderBlock& QuicSpdyClientBase::latest_response_header_block()
const {
QUIC_BUG_IF(!store_response_) << "Response not stored!";
return latest_response_header_block_;
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.h b/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.h
index fdd67fbc3b5..90dfe8a92d2 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_spdy_client_base.h
@@ -10,6 +10,7 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/crypto/crypto_handshake.h"
#include "net/third_party/quiche/src/quic/core/http/quic_client_push_promise_index.h"
#include "net/third_party/quiche/src/quic/core/http/quic_spdy_client_session.h"
@@ -17,7 +18,6 @@
#include "net/third_party/quiche/src/quic/core/quic_config.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/tools/quic_client_base.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,7 +36,7 @@ class QuicSpdyClientBase : public QuicClientBase,
virtual ~ResponseListener() {}
virtual void OnCompleteResponse(
QuicStreamId id,
- const spdy::SpdyHeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock& response_headers,
const std::string& response_body) = 0;
};
@@ -46,8 +46,8 @@ class QuicSpdyClientBase : public QuicClientBase,
class QuicDataToResend {
public:
// |headers| may be null, since it's possible to send data without headers.
- QuicDataToResend(std::unique_ptr<spdy::SpdyHeaderBlock> headers,
- quiche::QuicheStringPiece body,
+ QuicDataToResend(std::unique_ptr<spdy::Http2HeaderBlock> headers,
+ absl::string_view body,
bool fin);
QuicDataToResend(const QuicDataToResend&) = delete;
QuicDataToResend& operator=(const QuicDataToResend&) = delete;
@@ -59,8 +59,8 @@ class QuicSpdyClientBase : public QuicClientBase,
virtual void Resend() = 0;
protected:
- std::unique_ptr<spdy::SpdyHeaderBlock> headers_;
- quiche::QuicheStringPiece body_;
+ std::unique_ptr<spdy::Http2HeaderBlock> headers_;
+ absl::string_view body_;
bool fin_;
};
@@ -85,13 +85,13 @@ class QuicSpdyClientBase : public QuicClientBase,
void InitializeSession() override;
// Sends an HTTP request and does not wait for response before returning.
- void SendRequest(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ void SendRequest(const spdy::Http2HeaderBlock& headers,
+ absl::string_view body,
bool fin);
// Sends an HTTP request and waits for response before returning.
- void SendRequestAndWaitForResponse(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ void SendRequestAndWaitForResponse(const spdy::Http2HeaderBlock& headers,
+ absl::string_view body,
bool fin);
// Sends a request simple GET for each URL in |url_list|, and then waits for
@@ -110,9 +110,9 @@ class QuicSpdyClientBase : public QuicClientBase,
return &push_promise_index_;
}
- bool CheckVary(const spdy::SpdyHeaderBlock& client_request,
- const spdy::SpdyHeaderBlock& promise_request,
- const spdy::SpdyHeaderBlock& promise_response) override;
+ bool CheckVary(const spdy::Http2HeaderBlock& client_request,
+ const spdy::Http2HeaderBlock& promise_request,
+ const spdy::Http2HeaderBlock& promise_response) override;
void OnRendezvousResult(QuicSpdyStream*) override;
// If the crypto handshake has not yet been confirmed, adds the data to the
@@ -126,7 +126,7 @@ class QuicSpdyClientBase : public QuicClientBase,
int latest_response_code() const;
const std::string& latest_response_headers() const;
const std::string& preliminary_response_headers() const;
- const spdy::SpdyHeaderBlock& latest_response_header_block() const;
+ const spdy::Http2HeaderBlock& latest_response_header_block() const;
const std::string& latest_response_body() const;
const std::string& latest_response_trailers() const;
@@ -161,8 +161,8 @@ class QuicSpdyClientBase : public QuicClientBase,
void ResendSavedData() override;
- void AddPromiseDataToResend(const spdy::SpdyHeaderBlock& headers,
- quiche::QuicheStringPiece body,
+ void AddPromiseDataToResend(const spdy::Http2HeaderBlock& headers,
+ absl::string_view body,
bool fin);
bool HasActiveRequests() override;
@@ -170,8 +170,8 @@ class QuicSpdyClientBase : public QuicClientBase,
// Specific QuicClient class for storing data to resend.
class ClientQuicDataToResend : public QuicDataToResend {
public:
- ClientQuicDataToResend(std::unique_ptr<spdy::SpdyHeaderBlock> headers,
- quiche::QuicheStringPiece body,
+ ClientQuicDataToResend(std::unique_ptr<spdy::Http2HeaderBlock> headers,
+ absl::string_view body,
bool fin,
QuicSpdyClientBase* client)
: QuicDataToResend(std::move(headers), body, fin), client_(client) {
@@ -189,8 +189,8 @@ class QuicSpdyClientBase : public QuicClientBase,
QuicSpdyClientBase* client_;
};
- void SendRequestInternal(spdy::SpdyHeaderBlock sanitized_headers,
- quiche::QuicheStringPiece body,
+ void SendRequestInternal(spdy::Http2HeaderBlock sanitized_headers,
+ absl::string_view body,
bool fin);
// Index of pending promised streams. Must outlive |session_|.
@@ -205,7 +205,7 @@ class QuicSpdyClientBase : public QuicClientBase,
// preliminary 100 Continue HTTP/2 headers from most recent response, if any.
std::string preliminary_response_headers_;
// HTTP/2 headers from most recent response.
- spdy::SpdyHeaderBlock latest_response_header_block_;
+ spdy::Http2HeaderBlock latest_response_header_block_;
// Body of most recent response.
std::string latest_response_body_;
// HTTP/2 trailers from most recent response.
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_toy_client.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_toy_client.cc
index 582f3c7cd4a..c25411d9bb5 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_toy_client.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_toy_client.cc
@@ -48,6 +48,9 @@
#include <utility>
#include <vector>
+#include "absl/strings/escaping.h"
+#include "absl/strings/str_split.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_packets.h"
#include "net/third_party/quiche/src/quic/core/quic_server_id.h"
#include "net/third_party/quiche/src/quic/core/quic_utils.h"
@@ -58,13 +61,11 @@
#include "net/third_party/quiche/src/quic/platform/api/quic_system_event_loop.h"
#include "net/third_party/quiche/src/quic/tools/fake_proof_verifier.h"
#include "net/third_party/quiche/src/quic/tools/quic_url.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_text_utils.h"
namespace {
using quic::QuicUrl;
-using quiche::QuicheStringPiece;
using quiche::QuicheTextUtils;
} // namespace
@@ -322,11 +323,11 @@ int QuicToyClient::SendRequestsAndPrintResponses(
if (!GetQuicFlag(FLAGS_body_hex).empty()) {
DCHECK(GetQuicFlag(FLAGS_body).empty())
<< "Only set one of --body and --body_hex.";
- body = QuicheTextUtils::HexDecode(GetQuicFlag(FLAGS_body_hex));
+ body = absl::HexStringToBytes(GetQuicFlag(FLAGS_body_hex));
}
// Construct a GET or POST request for supplied URL.
- spdy::SpdyHeaderBlock header_block;
+ spdy::Http2HeaderBlock header_block;
header_block[":method"] = body.empty() ? "GET" : "POST";
header_block[":scheme"] = url.scheme();
header_block[":authority"] = url.HostPort();
@@ -334,12 +335,12 @@ int QuicToyClient::SendRequestsAndPrintResponses(
// Append any additional headers supplied on the command line.
const std::string headers = GetQuicFlag(FLAGS_headers);
- for (QuicheStringPiece sp : QuicheTextUtils::Split(headers, ';')) {
+ for (absl::string_view sp : absl::StrSplit(headers, ';')) {
QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&sp);
if (sp.empty()) {
continue;
}
- std::vector<QuicheStringPiece> kv = QuicheTextUtils::Split(sp, ':');
+ std::vector<absl::string_view> kv = absl::StrSplit(sp, ':');
QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&kv[0]);
QuicheTextUtils::RemoveLeadingAndTrailingWhitespace(&kv[1]);
header_block[kv[0]] = kv[1];
@@ -359,8 +360,8 @@ int QuicToyClient::SendRequestsAndPrintResponses(
if (!GetQuicFlag(FLAGS_body_hex).empty()) {
// Print the user provided hex, rather than binary body.
std::cout << "body:\n"
- << QuicheTextUtils::HexDump(QuicheTextUtils::HexDecode(
- GetQuicFlag(FLAGS_body_hex)))
+ << QuicheTextUtils::HexDump(
+ absl::HexStringToBytes(GetQuicFlag(FLAGS_body_hex)))
<< std::endl;
} else {
std::cout << "body: " << body << std::endl;
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.cc
index d445b548a8c..ec52d3a35ca 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.cc
@@ -6,12 +6,12 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
#include "net/third_party/quiche/src/quic/core/quic_dispatcher.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -36,12 +36,13 @@ QuicTransportSimpleServerDispatcher::QuicTransportSimpleServerDispatcher(
std::unique_ptr<QuicSession>
QuicTransportSimpleServerDispatcher::CreateQuicSession(
QuicConnectionId server_connection_id,
- const QuicSocketAddress& /*self_address*/,
+ const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece /*alpn*/,
+ absl::string_view /*alpn*/,
const ParsedQuicVersion& version) {
auto connection = std::make_unique<QuicConnection>(
- server_connection_id, peer_address, helper(), alarm_factory(), writer(),
+ server_connection_id, self_address, peer_address, helper(),
+ alarm_factory(), writer(),
/*owns_writer=*/false, Perspective::IS_SERVER,
ParsedQuicVersionVector{version});
auto session = std::make_unique<QuicTransportSimpleServerSession>(
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.h b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.h
index da27585e28c..62e4432a2d6 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_dispatcher.h
@@ -5,10 +5,10 @@
#ifndef QUICHE_QUIC_TOOLS_QUIC_TRANSPORT_SIMPLE_SERVER_DISPATCHER_H_
#define QUICHE_QUIC_TOOLS_QUIC_TRANSPORT_SIMPLE_SERVER_DISPATCHER_H_
+#include "absl/strings/string_view.h"
#include "url/origin.h"
#include "net/third_party/quiche/src/quic/core/quic_dispatcher.h"
#include "net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -31,7 +31,7 @@ class QuicTransportSimpleServerDispatcher : public QuicDispatcher {
QuicConnectionId server_connection_id,
const QuicSocketAddress& self_address,
const QuicSocketAddress& peer_address,
- quiche::QuicheStringPiece alpn,
+ absl::string_view alpn,
const ParsedQuicVersion& version) override;
std::vector<url::Origin> accepted_origins_;
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.cc
index d07da11672b..386bd0056fa 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.cc
@@ -226,7 +226,7 @@ bool QuicTransportSimpleServerSession::ProcessPath(const GURL& url) {
}
void QuicTransportSimpleServerSession::OnMessageReceived(
- quiche::QuicheStringPiece message) {
+ absl::string_view message) {
if (mode_ != ECHO) {
return;
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h
index 7cfd1975c4e..fc018fbd5a1 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_transport_simple_server_session.h
@@ -58,7 +58,7 @@ class QuicTransportSimpleServerSession
void OnCanCreateNewOutgoingStream(bool unidirectional) override;
bool CheckOrigin(url::Origin origin) override;
bool ProcessPath(const GURL& url) override;
- void OnMessageReceived(quiche::QuicheStringPiece message) override;
+ void OnMessageReceived(absl::string_view message) override;
void EchoStreamBack(const std::string& data) {
streams_to_echo_back_.push_back(data);
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_url.cc b/chromium/net/third_party/quiche/src/quic/tools/quic_url.cc
index 438847c35f8..9f9e98aeaf5 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_url.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_url.cc
@@ -4,18 +4,16 @@
#include "net/third_party/quiche/src/quic/tools/quic_url.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
static constexpr size_t kMaxHostNameLength = 256;
-QuicUrl::QuicUrl(quiche::QuicheStringPiece url)
- : url_(static_cast<std::string>(url)) {}
+QuicUrl::QuicUrl(absl::string_view url) : url_(static_cast<std::string>(url)) {}
-QuicUrl::QuicUrl(quiche::QuicheStringPiece url,
- quiche::QuicheStringPiece default_scheme)
+QuicUrl::QuicUrl(absl::string_view url, absl::string_view default_scheme)
: QuicUrl(url) {
if (url_.has_scheme()) {
return;
diff --git a/chromium/net/third_party/quiche/src/quic/tools/quic_url.h b/chromium/net/third_party/quiche/src/quic/tools/quic_url.h
index 4b057db3b3a..ca4ac8e346f 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/quic_url.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/quic_url.h
@@ -7,9 +7,9 @@
#include <string>
+#include "absl/strings/string_view.h"
#include "url/gurl.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace quic {
@@ -24,12 +24,11 @@ class QuicUrl {
// NOTE: If |url| doesn't have a scheme, it will have an empty scheme
// field. If that's not what you want, use the QuicUrlImpl(url,
// default_scheme) form below.
- explicit QuicUrl(quiche::QuicheStringPiece url);
+ explicit QuicUrl(absl::string_view url);
// Constructs a QuicUrlImpl from |url|, assuming that the scheme for the URL
// is |default_scheme| if there is no scheme specified in |url|.
- QuicUrl(quiche::QuicheStringPiece url,
- quiche::QuicheStringPiece default_scheme);
+ QuicUrl(absl::string_view url, absl::string_view default_scheme);
// Returns false if the URL is not valid.
bool IsValid() const;
diff --git a/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.cc b/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.cc
index 3da114e5526..b742dbff322 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.cc
@@ -38,8 +38,7 @@ size_t SimpleTicketCrypter::MaxOverhead() {
return kEpochSize + kIVSize + kAuthTagSize;
}
-std::vector<uint8_t> SimpleTicketCrypter::Encrypt(
- quiche::QuicheStringPiece in) {
+std::vector<uint8_t> SimpleTicketCrypter::Encrypt(absl::string_view in) {
MaybeRotateKeys();
std::vector<uint8_t> out(in.size() + MaxOverhead());
out[0] = key_epoch_;
@@ -56,8 +55,7 @@ std::vector<uint8_t> SimpleTicketCrypter::Encrypt(
return out;
}
-std::vector<uint8_t> SimpleTicketCrypter::Decrypt(
- quiche::QuicheStringPiece in) {
+std::vector<uint8_t> SimpleTicketCrypter::Decrypt(absl::string_view in) {
MaybeRotateKeys();
if (in.size() < kMessageOffset) {
return std::vector<uint8_t>();
@@ -83,7 +81,7 @@ std::vector<uint8_t> SimpleTicketCrypter::Decrypt(
}
void SimpleTicketCrypter::Decrypt(
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<quic::ProofSource::DecryptCallback> callback) {
callback->Run(Decrypt(in));
}
diff --git a/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.h b/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.h
index 330c5091094..c150ae24579 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.h
+++ b/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter.h
@@ -24,13 +24,13 @@ class QUIC_NO_EXPORT SimpleTicketCrypter
~SimpleTicketCrypter() override;
size_t MaxOverhead() override;
- std::vector<uint8_t> Encrypt(quiche::QuicheStringPiece in) override;
+ std::vector<uint8_t> Encrypt(absl::string_view in) override;
void Decrypt(
- quiche::QuicheStringPiece in,
+ absl::string_view in,
std::unique_ptr<quic::ProofSource::DecryptCallback> callback) override;
private:
- std::vector<uint8_t> Decrypt(quiche::QuicheStringPiece in);
+ std::vector<uint8_t> Decrypt(absl::string_view in);
void MaybeRotateKeys();
diff --git a/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter_test.cc b/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter_test.cc
index e609dc03571..568fa2b846c 100644
--- a/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter_test.cc
+++ b/chromium/net/third_party/quiche/src/quic/tools/simple_ticket_crypter_test.cc
@@ -26,9 +26,8 @@ class DecryptCallback : public quic::ProofSource::DecryptCallback {
std::vector<uint8_t>* out_;
};
-quiche::QuicheStringPiece StringPiece(const std::vector<uint8_t>& in) {
- return quiche::QuicheStringPiece(reinterpret_cast<const char*>(in.data()),
- in.size());
+absl::string_view StringPiece(const std::vector<uint8_t>& in) {
+ return absl::string_view(reinterpret_cast<const char*>(in.data()), in.size());
}
class SimpleTicketCrypterTest : public QuicTest {
@@ -81,7 +80,7 @@ TEST_F(SimpleTicketCrypterTest, DecryptionFailureWithModifiedCiphertext) {
TEST_F(SimpleTicketCrypterTest, DecryptionFailureWithEmptyCiphertext) {
std::vector<uint8_t> out_plaintext;
- ticket_crypter_.Decrypt(quiche::QuicheStringPiece(),
+ ticket_crypter_.Decrypt(absl::string_view(),
std::make_unique<DecryptCallback>(&out_plaintext));
EXPECT_TRUE(out_plaintext.empty());
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_constants.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_constants.cc
index 71ac1395e94..8d60d5e86d1 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_constants.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_constants.cc
@@ -8,7 +8,7 @@
#include <memory>
#include <vector>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
@@ -290,7 +290,7 @@ const std::vector<HpackHuffmanSymbol>& HpackHuffmanCodeVector() {
// The "constructor" for a HpackStaticEntry that computes the lengths at
// compile time.
#define STATIC_ENTRY(name, value) \
- { name, QUICHE_ARRAYSIZE(name) - 1, value, QUICHE_ARRAYSIZE(value) - 1 }
+ { name, ABSL_ARRAYSIZE(name) - 1, value, ABSL_ARRAYSIZE(value) - 1 }
const std::vector<HpackStaticEntry>& HpackStaticTableVector() {
static const auto* kHpackStaticTable = new std::vector<HpackStaticEntry>{
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.cc
index cf9a0e79b35..fa54464ed94 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.cc
@@ -185,7 +185,7 @@ void HpackDecoderAdapter::ListenerAdapter::OnHeaderListEnd() {
}
void HpackDecoderAdapter::ListenerAdapter::OnHeaderErrorDetected(
- quiche::QuicheStringPiece error_message) {
+ absl::string_view error_message) {
SPDY_VLOG(1) << error_message;
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h
index f521ee12cd5..36f42b7b749 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h
@@ -13,13 +13,13 @@
#include <cstdint>
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_listener.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
#include "net/third_party/quiche/src/http2/hpack/hpack_string.h"
#include "net/third_party/quiche/src/http2/hpack/http2_hpack_constants.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
#include "net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h"
@@ -113,8 +113,7 @@ class QUICHE_EXPORT_PRIVATE HpackDecoderAdapter {
void OnHeader(const http2::HpackString& name,
const http2::HpackString& value) override;
void OnHeaderListEnd() override;
- void OnHeaderErrorDetected(
- quiche::QuicheStringPiece error_message) override;
+ void OnHeaderErrorDetected(absl::string_view error_message) override;
// Override the HpackDecoderTablesDebugListener methods:
int64_t OnEntryInserted(const http2::HpackStringPair& entry,
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter_test.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter_test.cc
index 2fe01fcf7cd..5a69a126a59 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter_test.cc
@@ -13,15 +13,16 @@
#include <utility>
#include <vector>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_state.h"
#include "net/third_party/quiche/src/http2/hpack/decoder/hpack_decoder_tables.h"
#include "net/third_party/quiche/src/http2/hpack/tools/hpack_block_builder.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h"
+#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h"
@@ -65,8 +66,8 @@ class HpackDecoderAdapterPeer {
explicit HpackDecoderAdapterPeer(HpackDecoderAdapter* decoder)
: decoder_(decoder) {}
- void HandleHeaderRepresentation(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ void HandleHeaderRepresentation(absl::string_view name,
+ absl::string_view value) {
decoder_->listener_adapter_.OnHeader(HpackString(name), HpackString(value));
}
@@ -133,7 +134,7 @@ class HpackDecoderAdapterTest
}
}
- bool HandleControlFrameHeadersData(quiche::QuicheStringPiece str) {
+ bool HandleControlFrameHeadersData(absl::string_view str) {
SPDY_VLOG(3) << "HandleControlFrameHeadersData:\n" << SpdyHexDump(str);
bytes_passed_in_ += str.size();
return decoder_.HandleControlFrameHeadersData(str.data(), str.size());
@@ -147,7 +148,7 @@ class HpackDecoderAdapterTest
return rc;
}
- bool DecodeHeaderBlock(quiche::QuicheStringPiece str,
+ bool DecodeHeaderBlock(absl::string_view str,
bool check_decoded_size = true) {
// Don't call this again if HandleControlFrameHeadersData failed previously.
EXPECT_FALSE(decode_has_failed_);
@@ -178,7 +179,7 @@ class HpackDecoderAdapterTest
decode_has_failed_ = true;
return false;
}
- total_hpack_bytes = handler_.compressed_header_bytes_parsed();
+ total_hpack_bytes = handler_.compressed_header_bytes();
} else {
if (!HandleControlFrameHeadersComplete(&total_hpack_bytes)) {
decode_has_failed_ = true;
@@ -187,7 +188,8 @@ class HpackDecoderAdapterTest
}
EXPECT_EQ(total_hpack_bytes, bytes_passed_in_);
if (check_decoded_size && start_choice_ == START_WITH_HANDLER) {
- EXPECT_EQ(handler_.header_bytes_parsed(), SizeOfHeaders(decoded_block()));
+ EXPECT_EQ(handler_.uncompressed_header_bytes(),
+ SizeOfHeaders(decoded_block()));
}
return true;
}
@@ -225,8 +227,7 @@ class HpackDecoderAdapterTest
return size;
}
- const SpdyHeaderBlock& DecodeBlockExpectingSuccess(
- quiche::QuicheStringPiece str) {
+ const SpdyHeaderBlock& DecodeBlockExpectingSuccess(absl::string_view str) {
EXPECT_TRUE(DecodeHeaderBlock(str));
return decoded_block();
}
@@ -253,7 +254,7 @@ class HpackDecoderAdapterTest
http2::test::Http2Random random_;
HpackDecoderAdapter decoder_;
test::HpackDecoderAdapterPeer decoder_peer_;
- TestHeadersHandler handler_;
+ RecordingHeadersHandler handler_;
StartChoice start_choice_;
bool randomly_split_input_buffer_;
bool decode_has_failed_ = false;
@@ -434,11 +435,10 @@ TEST_P(HpackDecoderAdapterTest, HandleHeaderRepresentation) {
decoded_block(),
ElementsAre(
Pair("cookie", " part 1; part 2 ; part3; fin!"),
- Pair("passed-through", quiche::QuicheStringPiece("foo\0baz", 7)),
- Pair("joined",
- quiche::QuicheStringPiece("joined\0value 1\0value 2", 22)),
+ Pair("passed-through", absl::string_view("foo\0baz", 7)),
+ Pair("joined", absl::string_view("joined\0value 1\0value 2", 22)),
Pair("empty", ""),
- Pair("empty-joined", quiche::QuicheStringPiece("\0foo\0\0", 6))));
+ Pair("empty-joined", absl::string_view("\0foo\0\0", 6))));
}
// Decoding indexed static table field should work.
@@ -503,7 +503,7 @@ TEST_P(HpackDecoderAdapterTest, ContextUpdateMaximumSize) {
output_stream.AppendUint32(126);
output_stream.TakeString(&input);
- EXPECT_TRUE(DecodeHeaderBlock(quiche::QuicheStringPiece(input)));
+ EXPECT_TRUE(DecodeHeaderBlock(absl::string_view(input)));
EXPECT_EQ(126u, decoder_peer_.header_table_size_limit());
}
{
@@ -513,7 +513,7 @@ TEST_P(HpackDecoderAdapterTest, ContextUpdateMaximumSize) {
output_stream.AppendUint32(kDefaultHeaderTableSizeSetting);
output_stream.TakeString(&input);
- EXPECT_TRUE(DecodeHeaderBlock(quiche::QuicheStringPiece(input)));
+ EXPECT_TRUE(DecodeHeaderBlock(absl::string_view(input)));
EXPECT_EQ(kDefaultHeaderTableSizeSetting,
decoder_peer_.header_table_size_limit());
}
@@ -524,7 +524,7 @@ TEST_P(HpackDecoderAdapterTest, ContextUpdateMaximumSize) {
output_stream.AppendUint32(kDefaultHeaderTableSizeSetting + 1);
output_stream.TakeString(&input);
- EXPECT_FALSE(DecodeHeaderBlock(quiche::QuicheStringPiece(input)));
+ EXPECT_FALSE(DecodeHeaderBlock(absl::string_view(input)));
EXPECT_EQ(kDefaultHeaderTableSizeSetting,
decoder_peer_.header_table_size_limit());
}
@@ -542,7 +542,7 @@ TEST_P(HpackDecoderAdapterTest, TwoTableSizeUpdates) {
output_stream.AppendUint32(122);
output_stream.TakeString(&input);
- EXPECT_TRUE(DecodeHeaderBlock(quiche::QuicheStringPiece(input)));
+ EXPECT_TRUE(DecodeHeaderBlock(absl::string_view(input)));
EXPECT_EQ(122u, decoder_peer_.header_table_size_limit());
}
}
@@ -562,7 +562,7 @@ TEST_P(HpackDecoderAdapterTest, ThreeTableSizeUpdatesError) {
output_stream.TakeString(&input);
- EXPECT_FALSE(DecodeHeaderBlock(quiche::QuicheStringPiece(input)));
+ EXPECT_FALSE(DecodeHeaderBlock(absl::string_view(input)));
EXPECT_EQ(10u, decoder_peer_.header_table_size_limit());
}
}
@@ -581,7 +581,7 @@ TEST_P(HpackDecoderAdapterTest, TableSizeUpdateSecondError) {
output_stream.TakeString(&input);
- EXPECT_FALSE(DecodeHeaderBlock(quiche::QuicheStringPiece(input)));
+ EXPECT_FALSE(DecodeHeaderBlock(absl::string_view(input)));
EXPECT_EQ(kDefaultHeaderTableSizeSetting,
decoder_peer_.header_table_size_limit());
}
@@ -604,7 +604,7 @@ TEST_P(HpackDecoderAdapterTest, TableSizeUpdateFirstThirdError) {
output_stream.TakeString(&input);
- EXPECT_FALSE(DecodeHeaderBlock(quiche::QuicheStringPiece(input)));
+ EXPECT_FALSE(DecodeHeaderBlock(absl::string_view(input)));
EXPECT_EQ(60u, decoder_peer_.header_table_size_limit());
}
}
@@ -616,7 +616,7 @@ TEST_P(HpackDecoderAdapterTest, LiteralHeaderNoIndexing) {
// name.
const char input[] = "\x04\x0c/sample/path\x00\x06:path2\x0e/sample/path/2";
const SpdyHeaderBlock& header_set = DecodeBlockExpectingSuccess(
- quiche::QuicheStringPiece(input, QUICHE_ARRAYSIZE(input) - 1));
+ absl::string_view(input, ABSL_ARRAYSIZE(input) - 1));
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
@@ -629,7 +629,7 @@ TEST_P(HpackDecoderAdapterTest, LiteralHeaderNoIndexing) {
TEST_P(HpackDecoderAdapterTest, LiteralHeaderIncrementalIndexing) {
const char input[] = "\x44\x0c/sample/path\x40\x06:path2\x0e/sample/path/2";
const SpdyHeaderBlock& header_set = DecodeBlockExpectingSuccess(
- quiche::QuicheStringPiece(input, QUICHE_ARRAYSIZE(input) - 1));
+ absl::string_view(input, ABSL_ARRAYSIZE(input) - 1));
SpdyHeaderBlock expected_header_set;
expected_header_set[":path"] = "/sample/path";
@@ -642,23 +642,23 @@ TEST_P(HpackDecoderAdapterTest, LiteralHeaderWithIndexingInvalidNameIndex) {
EXPECT_TRUE(EncodeAndDecodeDynamicTableSizeUpdates(0, 0));
// Name is the last static index. Works.
- EXPECT_TRUE(DecodeHeaderBlock(quiche::QuicheStringPiece("\x7d\x03ooo")));
+ EXPECT_TRUE(DecodeHeaderBlock(absl::string_view("\x7d\x03ooo")));
// Name is one beyond the last static index. Fails.
- EXPECT_FALSE(DecodeHeaderBlock(quiche::QuicheStringPiece("\x7e\x03ooo")));
+ EXPECT_FALSE(DecodeHeaderBlock(absl::string_view("\x7e\x03ooo")));
}
TEST_P(HpackDecoderAdapterTest, LiteralHeaderNoIndexingInvalidNameIndex) {
// Name is the last static index. Works.
- EXPECT_TRUE(DecodeHeaderBlock(quiche::QuicheStringPiece("\x0f\x2e\x03ooo")));
+ EXPECT_TRUE(DecodeHeaderBlock(absl::string_view("\x0f\x2e\x03ooo")));
// Name is one beyond the last static index. Fails.
- EXPECT_FALSE(DecodeHeaderBlock(quiche::QuicheStringPiece("\x0f\x2f\x03ooo")));
+ EXPECT_FALSE(DecodeHeaderBlock(absl::string_view("\x0f\x2f\x03ooo")));
}
TEST_P(HpackDecoderAdapterTest, LiteralHeaderNeverIndexedInvalidNameIndex) {
// Name is the last static index. Works.
- EXPECT_TRUE(DecodeHeaderBlock(quiche::QuicheStringPiece("\x1f\x2e\x03ooo")));
+ EXPECT_TRUE(DecodeHeaderBlock(absl::string_view("\x1f\x2e\x03ooo")));
// Name is one beyond the last static index. Fails.
- EXPECT_FALSE(DecodeHeaderBlock(quiche::QuicheStringPiece("\x1f\x2f\x03ooo")));
+ EXPECT_FALSE(DecodeHeaderBlock(absl::string_view("\x1f\x2f\x03ooo")));
}
TEST_P(HpackDecoderAdapterTest, TruncatedIndex) {
@@ -710,7 +710,7 @@ TEST_P(HpackDecoderAdapterTest, HuffmanEOSError) {
// Round-tripping the header set from RFC 7541 C.3.1 should work.
// http://httpwg.org/specs/rfc7541.html#rfc.section.C.3.1
TEST_P(HpackDecoderAdapterTest, BasicC31) {
- HpackEncoder encoder(ObtainHpackHuffmanTable());
+ HpackEncoder encoder;
SpdyHeaderBlock expected_header_set;
expected_header_set[":method"] = "GET";
@@ -1055,10 +1055,10 @@ TEST_P(HpackDecoderAdapterTest, ReuseNameOfEvictedEntry) {
hbb.AppendDynamicTableSizeUpdate(0);
hbb.AppendDynamicTableSizeUpdate(63);
- const quiche::QuicheStringPiece name("some-name");
- const quiche::QuicheStringPiece value1("some-value");
- const quiche::QuicheStringPiece value2("another-value");
- const quiche::QuicheStringPiece value3("yet-another-value");
+ const absl::string_view name("some-name");
+ const absl::string_view value1("some-value");
+ const absl::string_view value2("another-value");
+ const absl::string_view value3("yet-another-value");
// Add an entry that will become the first in the dynamic table, entry 62.
hbb.AppendLiteralNameAndValue(HpackEntryType::kIndexedLiteralHeader, false,
@@ -1106,7 +1106,7 @@ TEST_P(HpackDecoderAdapterTest, ReuseNameOfEvictedEntry) {
EXPECT_EQ(expected_header_set, decoded_block());
if (start_choice_ == START_WITH_HANDLER) {
- EXPECT_EQ(handler_.header_bytes_parsed(),
+ EXPECT_EQ(handler_.uncompressed_header_bytes(),
6 * name.size() + 2 * value1.size() + 2 * value2.size() +
2 * value3.size());
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.cc
index 71b94a37f3f..c0d2ec6f8c8 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.cc
@@ -8,6 +8,7 @@
#include <limits>
#include <utility>
+#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h"
@@ -57,12 +58,10 @@ class HpackEncoder::RepresentationIterator {
namespace {
// The default header listener.
-void NoOpListener(quiche::QuicheStringPiece /*name*/,
- quiche::QuicheStringPiece /*value*/) {}
+void NoOpListener(absl::string_view /*name*/, absl::string_view /*value*/) {}
// The default HPACK indexing policy.
-bool DefaultPolicy(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece /* value */) {
+bool DefaultPolicy(absl::string_view name, absl::string_view /* value */) {
if (name.empty()) {
return false;
}
@@ -77,14 +76,16 @@ bool DefaultPolicy(quiche::QuicheStringPiece name,
} // namespace
-HpackEncoder::HpackEncoder(const HpackHuffmanTable& table)
+HpackEncoder::HpackEncoder()
: output_stream_(),
- huffman_table_(table),
+ huffman_table_(ObtainHpackHuffmanTable()),
min_table_size_setting_received_(std::numeric_limits<size_t>::max()),
listener_(NoOpListener),
should_index_(DefaultPolicy),
enable_compression_(true),
- should_emit_table_size_(false) {}
+ should_emit_table_size_(false),
+ use_fast_huffman_encoder_(
+ GetSpdyReloadableFlag(http2_use_fast_huffman_encoder)) {}
HpackEncoder::~HpackEncoder() = default;
@@ -197,15 +198,24 @@ void HpackEncoder::EmitLiteral(const Representation& representation) {
EmitString(representation.second);
}
-void HpackEncoder::EmitString(quiche::QuicheStringPiece str) {
+void HpackEncoder::EmitString(absl::string_view str) {
size_t encoded_size =
- enable_compression_ ? huffman_table_.EncodedSize(str) : str.size();
+ enable_compression_
+ ? (use_fast_huffman_encoder_ ? http2::HuffmanSize(str)
+ : huffman_table_.EncodedSize(str))
+ : str.size();
if (encoded_size < str.size()) {
SPDY_DVLOG(2) << "Emitted Huffman-encoded string of length "
<< encoded_size;
output_stream_.AppendPrefix(kStringLiteralHuffmanEncoded);
output_stream_.AppendUint32(encoded_size);
- huffman_table_.EncodeString(str, &output_stream_);
+ if (use_fast_huffman_encoder_) {
+ SPDY_CODE_COUNT(http2_use_fast_huffman_encoder);
+ http2::HuffmanEncodeFast(str, encoded_size,
+ output_stream_.MutableString());
+ } else {
+ huffman_table_.EncodeString(str, &output_stream_);
+ }
} else {
SPDY_DVLOG(2) << "Emitted literal string of length " << str.size();
output_stream_.AppendPrefix(kStringLiteralIdentityEncoded);
@@ -238,21 +248,19 @@ void HpackEncoder::CookieToCrumbs(const Representation& cookie,
// See Section 8.1.2.5. "Compressing the Cookie Header Field" in the HTTP/2
// specification at https://tools.ietf.org/html/draft-ietf-httpbis-http2-14.
// Cookie values are split into individually-encoded HPACK representations.
- quiche::QuicheStringPiece cookie_value = cookie.second;
+ absl::string_view cookie_value = cookie.second;
// Consume leading and trailing whitespace if present.
- quiche::QuicheStringPiece::size_type first =
- cookie_value.find_first_not_of(" \t");
- quiche::QuicheStringPiece::size_type last =
- cookie_value.find_last_not_of(" \t");
- if (first == quiche::QuicheStringPiece::npos) {
- cookie_value = quiche::QuicheStringPiece();
+ absl::string_view::size_type first = cookie_value.find_first_not_of(" \t");
+ absl::string_view::size_type last = cookie_value.find_last_not_of(" \t");
+ if (first == absl::string_view::npos) {
+ cookie_value = absl::string_view();
} else {
cookie_value = cookie_value.substr(first, (last - first) + 1);
}
for (size_t pos = 0;;) {
size_t end = cookie_value.find(";", pos);
- if (end == quiche::QuicheStringPiece::npos) {
+ if (end == absl::string_view::npos) {
out->push_back(std::make_pair(cookie.first, cookie_value.substr(pos)));
break;
}
@@ -272,12 +280,12 @@ void HpackEncoder::DecomposeRepresentation(const Representation& header_field,
Representations* out) {
size_t pos = 0;
size_t end = 0;
- while (end != quiche::QuicheStringPiece::npos) {
+ while (end != absl::string_view::npos) {
end = header_field.second.find('\0', pos);
out->push_back(std::make_pair(
header_field.first,
header_field.second.substr(
- pos, end == quiche::QuicheStringPiece::npos ? end : end - pos)));
+ pos, end == absl::string_view::npos ? end : end - pos)));
pos = end + 1;
}
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h
index 534b9e6c086..f9cc0d10f10 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h
@@ -14,8 +14,8 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
@@ -33,23 +33,20 @@ class HpackEncoderPeer;
class QUICHE_EXPORT_PRIVATE HpackEncoder {
public:
- using Representation =
- std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>;
+ using Representation = std::pair<absl::string_view, absl::string_view>;
using Representations = std::vector<Representation>;
// Callers may provide a HeaderListener to be informed of header name-value
// pairs processed by this encoder.
using HeaderListener =
- std::function<void(quiche::QuicheStringPiece, quiche::QuicheStringPiece)>;
+ std::function<void(absl::string_view, absl::string_view)>;
// An indexing policy should return true if the provided header name-value
// pair should be inserted into the HPACK dynamic table.
using IndexingPolicy =
- std::function<bool(quiche::QuicheStringPiece, quiche::QuicheStringPiece)>;
+ std::function<bool(absl::string_view, absl::string_view)>;
- // |table| is an initialized HPACK Huffman table, having an
- // externally-managed lifetime which spans beyond HpackEncoder.
- explicit HpackEncoder(const HpackHuffmanTable& table);
+ HpackEncoder();
HpackEncoder(const HpackEncoder&) = delete;
HpackEncoder& operator=(const HpackEncoder&) = delete;
~HpackEncoder();
@@ -127,7 +124,7 @@ class QUICHE_EXPORT_PRIVATE HpackEncoder {
void EmitLiteral(const Representation& representation);
// Emits a Huffman or identity string (whichever is smaller).
- void EmitString(quiche::QuicheStringPiece str);
+ void EmitString(absl::string_view str);
// Emits the current dynamic table size if the table size was recently
// updated and we have not yet emitted it (Section 6.3).
@@ -150,6 +147,8 @@ class QUICHE_EXPORT_PRIVATE HpackEncoder {
IndexingPolicy should_index_;
bool enable_compression_;
bool should_emit_table_size_;
+ // Latched value of gfe2_reloadable_flag_http2_use_fast_huffman_encoder.
+ const bool use_fast_huffman_encoder_;
};
} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder_test.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder_test.cc
index f6f9f87a1c0..52693dbbab4 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_encoder_test.cc
@@ -5,8 +5,9 @@
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h"
#include <cstdint>
-#include <map>
+#include <utility>
+#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_encoder.h"
#include "net/third_party/quiche/src/http2/test_tools/http2_random.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h"
@@ -39,15 +40,12 @@ class HpackEncoderPeer {
bool compression_enabled() const { return encoder_->enable_compression_; }
HpackHeaderTable* table() { return &encoder_->header_table_; }
HpackHeaderTablePeer table_peer() { return HpackHeaderTablePeer(table()); }
- const HpackHuffmanTable& huffman_table() const {
- return encoder_->huffman_table_;
- }
- void EmitString(quiche::QuicheStringPiece str) { encoder_->EmitString(str); }
+ void EmitString(absl::string_view str) { encoder_->EmitString(str); }
void TakeString(std::string* out) {
encoder_->output_stream_.TakeString(out);
}
- static void CookieToCrumbs(quiche::QuicheStringPiece cookie,
- std::vector<quiche::QuicheStringPiece>* out) {
+ static void CookieToCrumbs(absl::string_view cookie,
+ std::vector<absl::string_view>* out) {
Representations tmp;
HpackEncoder::CookieToCrumbs(std::make_pair("", cookie), &tmp);
@@ -56,9 +54,8 @@ class HpackEncoderPeer {
out->push_back(tmp[i].second);
}
}
- static void DecomposeRepresentation(
- quiche::QuicheStringPiece value,
- std::vector<quiche::QuicheStringPiece>* out) {
+ static void DecomposeRepresentation(absl::string_view value,
+ std::vector<absl::string_view>* out) {
Representations tmp;
HpackEncoder::DecomposeRepresentation(std::make_pair("foobar", value),
&tmp);
@@ -128,15 +125,17 @@ enum EncodeStrategy {
kRepresentations,
};
-class HpackEncoderTestBase : public QuicheTest {
+class HpackEncoderTest
+ : public QuicheTestWithParam<std::tuple<EncodeStrategy, bool>> {
protected:
typedef test::HpackEncoderPeer::Representations Representations;
- HpackEncoderTestBase()
- : encoder_(ObtainHpackHuffmanTable()),
- peer_(&encoder_),
+ HpackEncoderTest()
+ : peer_(&encoder_),
static_(peer_.table()->GetByIndex(1)),
- headers_storage_(1024 /* block size */) {}
+ headers_storage_(1024 /* block size */),
+ strategy_(std::get<0>(GetParam())),
+ use_fast_huffman_encoder_(std::get<1>(GetParam())) {}
void SetUp() override {
// Populate dynamic entries into the table fixture. For simplicity each
@@ -150,12 +149,11 @@ class HpackEncoderTestBase : public QuicheTest {
peer_.table()->SetMaxSize(peer_.table()->size());
}
- void SaveHeaders(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
- quiche::QuicheStringPiece n(
- headers_storage_.Memdup(name.data(), name.size()), name.size());
- quiche::QuicheStringPiece v(
- headers_storage_.Memdup(value.data(), value.size()), value.size());
+ void SaveHeaders(absl::string_view name, absl::string_view value) {
+ absl::string_view n(headers_storage_.Memdup(name.data(), name.size()),
+ name.size());
+ absl::string_view v(headers_storage_.Memdup(value.data(), value.size()),
+ value.size());
headers_observed_.push_back(std::make_pair(n, v));
}
@@ -164,40 +162,45 @@ class HpackEncoderTestBase : public QuicheTest {
expected_.AppendUint32(index);
}
void ExpectIndexedLiteral(const HpackEntry* key_entry,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
expected_.AppendPrefix(kLiteralIncrementalIndexOpcode);
expected_.AppendUint32(IndexOf(key_entry));
ExpectString(&expected_, value);
}
- void ExpectIndexedLiteral(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ void ExpectIndexedLiteral(absl::string_view name, absl::string_view value) {
expected_.AppendPrefix(kLiteralIncrementalIndexOpcode);
expected_.AppendUint32(0);
ExpectString(&expected_, name);
ExpectString(&expected_, value);
}
- void ExpectNonIndexedLiteral(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ void ExpectNonIndexedLiteral(absl::string_view name,
+ absl::string_view value) {
expected_.AppendPrefix(kLiteralNoIndexOpcode);
expected_.AppendUint32(0);
ExpectString(&expected_, name);
ExpectString(&expected_, value);
}
void ExpectNonIndexedLiteralWithNameIndex(const HpackEntry* key_entry,
- quiche::QuicheStringPiece value) {
+ absl::string_view value) {
expected_.AppendPrefix(kLiteralNoIndexOpcode);
expected_.AppendUint32(IndexOf(key_entry));
ExpectString(&expected_, value);
}
- void ExpectString(HpackOutputStream* stream, quiche::QuicheStringPiece str) {
- const HpackHuffmanTable& huffman_table = peer_.huffman_table();
- size_t encoded_size = peer_.compression_enabled()
- ? huffman_table.EncodedSize(str)
- : str.size();
+ void ExpectString(HpackOutputStream* stream, absl::string_view str) {
+ const HpackHuffmanTable& huffman_table = ObtainHpackHuffmanTable();
+ size_t encoded_size =
+ peer_.compression_enabled()
+ ? (use_fast_huffman_encoder_ ? http2::HuffmanSize(str)
+ : huffman_table.EncodedSize(str))
+ : str.size();
if (encoded_size < str.size()) {
expected_.AppendPrefix(kStringLiteralHuffmanEncoded);
expected_.AppendUint32(encoded_size);
- huffman_table.EncodeString(str, stream);
+ if (use_fast_huffman_encoder_) {
+ http2::HuffmanEncodeFast(str, encoded_size, stream->MutableString());
+ } else {
+ huffman_table.EncodeString(str, stream);
+ }
} else {
expected_.AppendPrefix(kStringLiteralIdentityEncoded);
expected_.AppendUint32(str.size());
@@ -255,25 +258,32 @@ class HpackEncoderTestBase : public QuicheTest {
const HpackEntry* cookie_c_;
SpdySimpleArena headers_storage_;
- std::vector<std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>>
+ std::vector<std::pair<absl::string_view, absl::string_view>>
headers_observed_;
HpackOutputStream expected_;
- EncodeStrategy strategy_ = kDefault;
+ const EncodeStrategy strategy_;
+ const bool use_fast_huffman_encoder_;
};
-TEST_F(HpackEncoderTestBase, EncodeRepresentations) {
+using HpackEncoderTestWithDefaultStrategy = HpackEncoderTest;
+
+INSTANTIATE_TEST_SUITE_P(HpackEncoderTests,
+ HpackEncoderTestWithDefaultStrategy,
+ ::testing::Combine(::testing::Values(kDefault),
+ ::testing::Bool()));
+
+TEST_P(HpackEncoderTestWithDefaultStrategy, EncodeRepresentations) {
encoder_.SetHeaderListener(
- [this](quiche::QuicheStringPiece name, quiche::QuicheStringPiece value) {
+ [this](absl::string_view name, absl::string_view value) {
this->SaveHeaders(name, value);
});
- const std::vector<
- std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>>
+ const std::vector<std::pair<absl::string_view, absl::string_view>>
header_list = {{"cookie", "val1; val2;val3"},
{":path", "/home"},
{"accept", "text/html, text/plain,application/xml"},
{"cookie", "val4"},
- {"withnul", quiche::QuicheStringPiece("one\0two", 7)}};
+ {"withnul", absl::string_view("one\0two", 7)}};
ExpectNonIndexedLiteralWithNameIndex(peer_.table()->GetByName(":path"),
"/home");
ExpectIndexedLiteral(peer_.table()->GetByName("cookie"), "val1");
@@ -282,7 +292,7 @@ TEST_F(HpackEncoderTestBase, EncodeRepresentations) {
ExpectIndexedLiteral(peer_.table()->GetByName("accept"),
"text/html, text/plain,application/xml");
ExpectIndexedLiteral(peer_.table()->GetByName("cookie"), "val4");
- ExpectIndexedLiteral("withnul", quiche::QuicheStringPiece("one\0two", 7));
+ ExpectIndexedLiteral("withnul", absl::string_view("one\0two", 7));
CompareWithExpectedEncoding(header_list);
EXPECT_THAT(
@@ -291,27 +301,19 @@ TEST_F(HpackEncoderTestBase, EncodeRepresentations) {
Pair("cookie", "val2"), Pair("cookie", "val3"),
Pair("accept", "text/html, text/plain,application/xml"),
Pair("cookie", "val4"),
- Pair("withnul", quiche::QuicheStringPiece("one\0two", 7))));
+ Pair("withnul", absl::string_view("one\0two", 7))));
}
-class HpackEncoderTest : public HpackEncoderTestBase,
- public ::testing::WithParamInterface<EncodeStrategy> {
- protected:
- void SetUp() override {
- strategy_ = GetParam();
- HpackEncoderTestBase::SetUp();
- }
-};
-
INSTANTIATE_TEST_SUITE_P(HpackEncoderTests,
HpackEncoderTest,
- ::testing::Values(kDefault,
- kIncremental,
- kRepresentations));
+ ::testing::Combine(::testing::Values(kDefault,
+ kIncremental,
+ kRepresentations),
+ ::testing::Bool()));
TEST_P(HpackEncoderTest, SingleDynamicIndex) {
encoder_.SetHeaderListener(
- [this](quiche::QuicheStringPiece name, quiche::QuicheStringPiece value) {
+ [this](absl::string_view name, absl::string_view value) {
this->SaveHeaders(name, value);
});
@@ -432,7 +434,7 @@ TEST_P(HpackEncoderTest, StringsDynamicallySelectHuffmanCoding) {
TEST_P(HpackEncoderTest, EncodingWithoutCompression) {
encoder_.SetHeaderListener(
- [this](quiche::QuicheStringPiece name, quiche::QuicheStringPiece value) {
+ [this](absl::string_view name, absl::string_view value) {
this->SaveHeaders(name, value);
});
encoder_.DisableCompression();
@@ -460,11 +462,10 @@ TEST_P(HpackEncoderTest, EncodingWithoutCompression) {
if (strategy_ == kRepresentations) {
EXPECT_THAT(
headers_observed_,
- ElementsAre(
- Pair(":path", "/index.html"), Pair("cookie", "foo=bar"),
- Pair("cookie", "baz=bing"),
- Pair("hello", quiche::QuicheStringPiece("goodbye\0aloha", 13)),
- Pair("multivalue", "value1, value2")));
+ ElementsAre(Pair(":path", "/index.html"), Pair("cookie", "foo=bar"),
+ Pair("cookie", "baz=bing"),
+ Pair("hello", absl::string_view("goodbye\0aloha", 13)),
+ Pair("multivalue", "value1, value2")));
} else {
EXPECT_THAT(
headers_observed_,
@@ -477,7 +478,7 @@ TEST_P(HpackEncoderTest, EncodingWithoutCompression) {
TEST_P(HpackEncoderTest, MultipleEncodingPasses) {
encoder_.SetHeaderListener(
- [this](quiche::QuicheStringPiece name, quiche::QuicheStringPiece value) {
+ [this](absl::string_view name, absl::string_view value) {
this->SaveHeaders(name, value);
});
@@ -574,7 +575,7 @@ TEST_P(HpackEncoderTest, PseudoHeadersFirst) {
TEST_P(HpackEncoderTest, CookieToCrumbs) {
test::HpackEncoderPeer peer(nullptr);
- std::vector<quiche::QuicheStringPiece> out;
+ std::vector<absl::string_view> out;
// Leading and trailing whitespace is consumed. A space after ';' is consumed.
// All other spaces remain. ';' at beginning and end of string produce empty
@@ -608,7 +609,7 @@ TEST_P(HpackEncoderTest, CookieToCrumbs) {
TEST_P(HpackEncoderTest, DecomposeRepresentation) {
test::HpackEncoderPeer peer(nullptr);
- std::vector<quiche::QuicheStringPiece> out;
+ std::vector<absl::string_view> out;
peer.DecomposeRepresentation("", &out);
EXPECT_THAT(out, ElementsAre(""));
@@ -616,19 +617,16 @@ TEST_P(HpackEncoderTest, DecomposeRepresentation) {
peer.DecomposeRepresentation("foobar", &out);
EXPECT_THAT(out, ElementsAre("foobar"));
- peer.DecomposeRepresentation(quiche::QuicheStringPiece("foo\0bar", 7), &out);
+ peer.DecomposeRepresentation(absl::string_view("foo\0bar", 7), &out);
EXPECT_THAT(out, ElementsAre("foo", "bar"));
- peer.DecomposeRepresentation(quiche::QuicheStringPiece("\0foo\0bar", 8),
- &out);
+ peer.DecomposeRepresentation(absl::string_view("\0foo\0bar", 8), &out);
EXPECT_THAT(out, ElementsAre("", "foo", "bar"));
- peer.DecomposeRepresentation(quiche::QuicheStringPiece("foo\0bar\0", 8),
- &out);
+ peer.DecomposeRepresentation(absl::string_view("foo\0bar\0", 8), &out);
EXPECT_THAT(out, ElementsAre("foo", "bar", ""));
- peer.DecomposeRepresentation(quiche::QuicheStringPiece("\0foo\0bar\0", 9),
- &out);
+ peer.DecomposeRepresentation(absl::string_view("\0foo\0bar\0", 9), &out);
EXPECT_THAT(out, ElementsAre("", "foo", "bar", ""));
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.cc
index 586f3216d24..7f251e6e1ff 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.cc
@@ -12,8 +12,8 @@ namespace spdy {
const size_t HpackEntry::kSizeOverhead = 32;
-HpackEntry::HpackEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value,
+HpackEntry::HpackEntry(absl::string_view name,
+ absl::string_view value,
bool is_static,
size_t insertion_index)
: name_(name.data(), name.size()),
@@ -24,8 +24,7 @@ HpackEntry::HpackEntry(quiche::QuicheStringPiece name,
type_(is_static ? STATIC : DYNAMIC),
time_added_(0) {}
-HpackEntry::HpackEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value)
+HpackEntry::HpackEntry(absl::string_view name, absl::string_view value)
: name_ref_(name),
value_ref_(value),
insertion_index_(0),
@@ -44,8 +43,8 @@ HpackEntry::HpackEntry(const HpackEntry& other)
} else {
name_ = other.name_;
value_ = other.value_;
- name_ref_ = quiche::QuicheStringPiece(name_.data(), name_.size());
- value_ref_ = quiche::QuicheStringPiece(value_.data(), value_.size());
+ name_ref_ = absl::string_view(name_.data(), name_.size());
+ value_ref_ = absl::string_view(value_.data(), value_.size());
}
}
@@ -61,16 +60,15 @@ HpackEntry& HpackEntry::operator=(const HpackEntry& other) {
}
name_ = other.name_;
value_ = other.value_;
- name_ref_ = quiche::QuicheStringPiece(name_.data(), name_.size());
- value_ref_ = quiche::QuicheStringPiece(value_.data(), value_.size());
+ name_ref_ = absl::string_view(name_.data(), name_.size());
+ value_ref_ = absl::string_view(value_.data(), value_.size());
return *this;
}
HpackEntry::~HpackEntry() = default;
// static
-size_t HpackEntry::Size(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+size_t HpackEntry::Size(absl::string_view name, absl::string_view value) {
return name.size() + value.size() + kSizeOverhead;
}
size_t HpackEntry::Size() const {
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h
index 750c7e61782..e9c4efcfc96 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h
@@ -9,8 +9,8 @@
#include <cstdint>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
// All section references below are to
// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-08
@@ -34,15 +34,15 @@ class QUICHE_EXPORT_PRIVATE HpackEntry {
// The combination of |is_static| and |insertion_index| allows an
// HpackEntryTable to determine the index of an HpackEntry in O(1) time.
// Copies |name| and |value|.
- HpackEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value,
+ HpackEntry(absl::string_view name,
+ absl::string_view value,
bool is_static,
size_t insertion_index);
// Create a 'lookup' entry (only) suitable for querying a HpackEntrySet. The
// instance InsertionIndex() always returns 0 and IsLookup() returns true.
// The memory backing |name| and |value| must outlive this object.
- HpackEntry(quiche::QuicheStringPiece name, quiche::QuicheStringPiece value);
+ HpackEntry(absl::string_view name, absl::string_view value);
HpackEntry(const HpackEntry& other);
HpackEntry& operator=(const HpackEntry& other);
@@ -53,8 +53,8 @@ class QUICHE_EXPORT_PRIVATE HpackEntry {
~HpackEntry();
- quiche::QuicheStringPiece name() const { return name_ref_; }
- quiche::QuicheStringPiece value() const { return value_ref_; }
+ absl::string_view name() const { return name_ref_; }
+ absl::string_view value() const { return value_ref_; }
// Returns whether this entry is a member of the static (as opposed to
// dynamic) table.
@@ -67,8 +67,7 @@ class QUICHE_EXPORT_PRIVATE HpackEntry {
size_t InsertionIndex() const { return insertion_index_; }
// Returns the size of an entry as defined in 5.1.
- static size_t Size(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ static size_t Size(absl::string_view name, absl::string_view value);
size_t Size() const;
std::string GetDebugString() const;
@@ -92,8 +91,8 @@ class QUICHE_EXPORT_PRIVATE HpackEntry {
// These members are always valid. For DYNAMIC and STATIC entries, they
// always point to |name_| and |value_|.
- quiche::QuicheStringPiece name_ref_;
- quiche::QuicheStringPiece value_ref_;
+ absl::string_view name_ref_;
+ absl::string_view value_ref_;
// The entry's index in the total set of entries ever inserted into the header
// table.
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.cc
index 67a0a5f443f..8adbf43aad3 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h"
@@ -60,7 +61,7 @@ const HpackEntry* HpackHeaderTable::GetByIndex(size_t index) {
return nullptr;
}
-const HpackEntry* HpackHeaderTable::GetByName(quiche::QuicheStringPiece name) {
+const HpackEntry* HpackHeaderTable::GetByName(absl::string_view name) {
{
auto it = static_name_index_.find(name);
if (it != static_name_index_.end()) {
@@ -80,9 +81,8 @@ const HpackEntry* HpackHeaderTable::GetByName(quiche::QuicheStringPiece name) {
return nullptr;
}
-const HpackEntry* HpackHeaderTable::GetByNameAndValue(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+const HpackEntry* HpackHeaderTable::GetByNameAndValue(absl::string_view name,
+ absl::string_view value) {
HpackEntry query(name, value);
{
auto it = static_index_.find(&query);
@@ -128,8 +128,8 @@ void HpackHeaderTable::SetSettingsHeaderTableSize(size_t settings_size) {
SetMaxSize(settings_size_bound_);
}
-void HpackHeaderTable::EvictionSet(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value,
+void HpackHeaderTable::EvictionSet(absl::string_view name,
+ absl::string_view value,
EntryTable::iterator* begin_out,
EntryTable::iterator* end_out) {
size_t eviction_count = EvictionCountForEntry(name, value);
@@ -137,9 +137,8 @@ void HpackHeaderTable::EvictionSet(quiche::QuicheStringPiece name,
*end_out = dynamic_entries_.end();
}
-size_t HpackHeaderTable::EvictionCountForEntry(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) const {
+size_t HpackHeaderTable::EvictionCountForEntry(absl::string_view name,
+ absl::string_view value) const {
size_t available_size = max_size_ - size_;
size_t entry_size = HpackEntry::Size(name, value);
@@ -185,9 +184,8 @@ void HpackHeaderTable::Evict(size_t count) {
}
}
-const HpackEntry* HpackHeaderTable::TryAddEntry(
- quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+const HpackEntry* HpackHeaderTable::TryAddEntry(absl::string_view name,
+ absl::string_view value) {
Evict(EvictionCountForEntry(name, value));
size_t entry_size = HpackEntry::Size(name, value);
@@ -255,7 +253,7 @@ void HpackHeaderTable::DebugLogTableState() const {
SPDY_DVLOG(2) << " " << entry->GetDebugString();
}
SPDY_DVLOG(2) << "Full Static Name Index:";
- for (const auto it : static_name_index_) {
+ for (const auto& it : static_name_index_) {
SPDY_DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString();
}
SPDY_DVLOG(2) << "Full Dynamic Index:";
@@ -263,7 +261,7 @@ void HpackHeaderTable::DebugLogTableState() const {
SPDY_DVLOG(2) << " " << entry->GetDebugString();
}
SPDY_DVLOG(2) << "Full Dynamic Name Index:";
- for (const auto it : dynamic_name_index_) {
+ for (const auto& it : dynamic_name_index_) {
SPDY_DVLOG(2) << " " << it.first << ": " << it.second->GetDebugString();
}
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h
index 88ef6d7b73a..f835ae72874 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h
@@ -10,8 +10,9 @@
#include <deque>
#include <memory>
+#include "absl/hash/hash.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_macros.h"
@@ -67,9 +68,9 @@ class QUICHE_EXPORT_PRIVATE HpackHeaderTable {
bool operator()(const HpackEntry* lhs, const HpackEntry* rhs) const;
};
using UnorderedEntrySet = SpdyHashSet<HpackEntry*, EntryHasher, EntriesEq>;
- using NameToEntryMap = SpdyHashMap<quiche::QuicheStringPiece,
+ using NameToEntryMap = SpdyHashMap<absl::string_view,
const HpackEntry*,
- quiche::QuicheStringPieceHash>;
+ absl::Hash<absl::string_view>>;
HpackHeaderTable();
HpackHeaderTable(const HpackHeaderTable&) = delete;
@@ -89,11 +90,11 @@ class QUICHE_EXPORT_PRIVATE HpackHeaderTable {
const HpackEntry* GetByIndex(size_t index);
// Returns the lowest-value entry having |name|, or NULL.
- const HpackEntry* GetByName(quiche::QuicheStringPiece name);
+ const HpackEntry* GetByName(absl::string_view name);
// Returns the lowest-index matching entry, or NULL.
- const HpackEntry* GetByNameAndValue(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ const HpackEntry* GetByNameAndValue(absl::string_view name,
+ absl::string_view value);
// Returns the index of an entry within this header table.
size_t IndexOf(const HpackEntry* entry) const;
@@ -109,8 +110,8 @@ class QUICHE_EXPORT_PRIVATE HpackHeaderTable {
// Determine the set of entries which would be evicted by the insertion
// of |name| & |value| into the table, as per section 4.4. No eviction
// actually occurs. The set is returned via range [begin_out, end_out).
- void EvictionSet(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value,
+ void EvictionSet(absl::string_view name,
+ absl::string_view value,
EntryTable::iterator* begin_out,
EntryTable::iterator* end_out);
@@ -118,8 +119,8 @@ class QUICHE_EXPORT_PRIVATE HpackHeaderTable {
// and |value| must not be owned by an entry which could be evicted. The
// added HpackEntry is returned, or NULL is returned if all entries were
// evicted and the empty table is of insufficent size for the representation.
- const HpackEntry* TryAddEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value);
+ const HpackEntry* TryAddEntry(absl::string_view name,
+ absl::string_view value);
void DebugLogTableState() const SPDY_UNUSED;
@@ -132,8 +133,8 @@ class QUICHE_EXPORT_PRIVATE HpackHeaderTable {
private:
// Returns number of evictions required to enter |name| & |value|.
- size_t EvictionCountForEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) const;
+ size_t EvictionCountForEntry(absl::string_view name,
+ absl::string_view value) const;
// Returns number of evictions required to reclaim |reclaim_size| table size.
size_t EvictionCountToReclaim(size_t reclaim_size) const;
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table_test.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table_test.cc
index cc5674f137f..0b6799eb958 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_header_table_test.cc
@@ -33,8 +33,8 @@ class HpackHeaderTablePeer {
size_t index_size() {
return table_->static_index_.size() + table_->dynamic_index_.size();
}
- std::vector<HpackEntry*> EvictionSet(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ std::vector<HpackEntry*> EvictionSet(absl::string_view name,
+ absl::string_view value) {
HpackHeaderTable::EntryTable::iterator begin, end;
table_->EvictionSet(name, value, &begin, &end);
std::vector<HpackEntry*> result;
@@ -45,8 +45,8 @@ class HpackHeaderTablePeer {
}
size_t total_insertions() { return table_->total_insertions_; }
size_t dynamic_entries_count() { return table_->dynamic_entries_.size(); }
- size_t EvictionCountForEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ size_t EvictionCountForEntry(absl::string_view name,
+ absl::string_view value) {
return table_->EvictionCountForEntry(name, value);
}
size_t EvictionCountToReclaim(size_t reclaim_size) {
@@ -54,8 +54,7 @@ class HpackHeaderTablePeer {
}
void Evict(size_t count) { return table_->Evict(count); }
- void AddDynamicEntry(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ void AddDynamicEntry(absl::string_view name, absl::string_view value) {
table_->dynamic_entries_.push_back(
HpackEntry(name, value, false, table_->total_insertions_++));
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.cc
index eb799d08728..aac6d1b8d10 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.cc
@@ -96,7 +96,7 @@ bool HpackHuffmanTable::IsInitialized() const {
return !code_by_id_.empty();
}
-void HpackHuffmanTable::EncodeString(quiche::QuicheStringPiece in,
+void HpackHuffmanTable::EncodeString(absl::string_view in,
HpackOutputStream* out) const {
size_t bit_remnant = 0;
for (size_t i = 0; i != in.size(); i++) {
@@ -129,7 +129,7 @@ void HpackHuffmanTable::EncodeString(quiche::QuicheStringPiece in,
}
}
-size_t HpackHuffmanTable::EncodedSize(quiche::QuicheStringPiece in) const {
+size_t HpackHuffmanTable::EncodedSize(absl::string_view in) const {
size_t bit_count = 0;
for (size_t i = 0; i != in.size(); i++) {
uint16_t symbol_id = static_cast<uint8_t>(in[i]);
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h
index b7c264933b3..81af770afb5 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h
@@ -9,8 +9,8 @@
#include <cstdint>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
namespace spdy {
@@ -45,10 +45,10 @@ class QUICHE_EXPORT_PRIVATE HpackHuffmanTable {
// Encodes the input string to the output stream using the table's Huffman
// context.
- void EncodeString(quiche::QuicheStringPiece in, HpackOutputStream* out) const;
+ void EncodeString(absl::string_view in, HpackOutputStream* out) const;
// Returns the encoded size of the input string.
- size_t EncodedSize(quiche::QuicheStringPiece in) const;
+ size_t EncodedSize(absl::string_view in) const;
// Returns the estimate of dynamically allocated memory in bytes.
size_t EstimateMemoryUsage() const;
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_benchmark.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_benchmark.cc
deleted file mode 100644
index aeea7268965..00000000000
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_benchmark.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2020 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-//
-// $ blaze run -c opt --dynamic_mode=off \
-// -- //net/third_party/quiche/src/spdy/core/hpack:hpack_huffman_table_benchmark \
-// --benchmarks=all --benchmark_memory_usage --benchmark_repetitions=1
-//
-// Benchmark Time(ns) CPU(ns) Allocs Iterations
-// -----------------------------------------------------------------------------
-// BM_EncodeSmallStrings 463 441 0 100000 0.000B peak-mem
-// BM_EncodeLargeString/1k 9003 9069 5 4861 1.125kB peak-mem
-// BM_EncodeLargeString/4k 34808 35157 7 1597 4.500kB peak-mem
-// BM_EncodeLargeString/32k 275973 270741 10 207 36.000kB peak-mem
-// BM_EncodeLargeString/256k 2234748 2236850 13 29 288.000kB peak-mem
-// BM_EncodeLargeString/2M 18248449 18717995 16 3 2.250MB peak-mem
-// BM_EncodeLargeString/16M 144944895 144415061 19 1 18.000MB peak-mem
-// BM_EncodeLargeString/128M 1200907841 1207238809 86 1 144.009MB peak-mem
-//
-
-#include <string>
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Weverything"
-// This header has multiple DCHECK_* macros with signed-unsigned comparison.
-#include "testing/base/public/benchmark.h"
-#pragma clang diagnostic pop
-
-#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
-#include "net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table.h"
-#include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h"
-
-namespace spdy {
-namespace {
-
-void BM_EncodeSmallStrings(benchmark::State& state) {
- const HpackHuffmanTable& table = ObtainHpackHuffmanTable();
- const std::vector<const std::string> inputs{
- ":method", ":path", "cookie", "set-cookie", "vary", "accept-encoding"};
- for (auto s : state) {
- for (const auto& input : inputs) {
- HpackOutputStream output_stream;
- table.EncodedSize(input);
- table.EncodeString(input, &output_stream);
- }
- }
-}
-
-void BM_EncodeLargeString(benchmark::State& state) {
- const HpackHuffmanTable& table = ObtainHpackHuffmanTable();
- const std::string input(state.range(0), 'a');
- for (auto s : state) {
- HpackOutputStream output_stream;
- table.EncodedSize(input);
- table.EncodeString(input, &output_stream);
- }
-}
-
-BENCHMARK(BM_EncodeSmallStrings);
-BENCHMARK(BM_EncodeLargeString)->Range(1024, 128 * 1024 * 1024);
-
-} // namespace
-} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_test.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_test.cc
index f49c73daab6..6c3e288ad20 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_huffman_table_test.cc
@@ -7,8 +7,8 @@
#include <string>
#include <utility>
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/http2/hpack/huffman/hpack_huffman_decoder.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h"
@@ -42,7 +42,7 @@ class GenericHuffmanTableTest : public QuicheTest {
protected:
GenericHuffmanTableTest() : table_(), peer_(table_) {}
- std::string EncodeString(quiche::QuicheStringPiece input) {
+ std::string EncodeString(absl::string_view input) {
std::string result;
HpackOutputStream output_stream;
table_.EncodeString(input, &output_stream);
@@ -69,7 +69,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b11000000000000000000000000000000, 3, 6},
{0b11100000000000000000000000000000, 8, 7}};
HpackHuffmanTable table;
- EXPECT_TRUE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_TRUE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
}
{
// But using 2 bits with one symbol overflows the code.
@@ -83,7 +83,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b11100000000000000000000000000000, 3, 6},
{0b00000000000000000000000000000000, 8, 7}}; // Overflow.
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(7, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -93,7 +93,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b11000000000000000000000000000000, 3, 2},
{0b11100000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_TRUE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_TRUE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
}
{
// But repeating a length overflows the code.
@@ -103,7 +103,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b11000000000000000000000000000000, 2, 2},
{0b00000000000000000000000000000000, 8, 3}}; // Overflow.
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(3, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -114,7 +114,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b11000000000000000000000000000000, 3, 1}, // Repeat.
{0b11100000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -124,7 +124,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b10100000000000000000000000000000, 4, 2},
{0b10110000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(0, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -135,7 +135,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b11000000000000000000000000000000, 2, 2}, // Code not canonical.
{0b10000000000000000000000000000000, 8, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
}
{
@@ -145,7 +145,7 @@ TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
{0b11000000000000000000000000000000, 3, 2},
{0b11100000000000000000000000000000, 7, 3}};
HpackHuffmanTable table;
- EXPECT_FALSE(table.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_FALSE(table.Initialize(code, ABSL_ARRAYSIZE(code)));
}
}
@@ -159,11 +159,11 @@ TEST_F(GenericHuffmanTableTest, ValidateInternalsWithSmallCode) {
{0b10001000000000000000000000000000, 5, 5}, // 6th.
{0b10011000000000000000000000000000, 8, 6}, // 8th.
{0b10010000000000000000000000000000, 5, 7}}; // 7th.
- EXPECT_TRUE(table_.Initialize(code, QUICHE_ARRAYSIZE(code)));
+ EXPECT_TRUE(table_.Initialize(code, ABSL_ARRAYSIZE(code)));
- ASSERT_EQ(QUICHE_ARRAYSIZE(code), peer_.code_by_id().size());
- ASSERT_EQ(QUICHE_ARRAYSIZE(code), peer_.length_by_id().size());
- for (size_t i = 0; i < QUICHE_ARRAYSIZE(code); ++i) {
+ ASSERT_EQ(ABSL_ARRAYSIZE(code), peer_.code_by_id().size());
+ ASSERT_EQ(ABSL_ARRAYSIZE(code), peer_.length_by_id().size());
+ for (size_t i = 0; i < ABSL_ARRAYSIZE(code); ++i) {
EXPECT_EQ(code[i].code, peer_.code_by_id()[i]);
EXPECT_EQ(code[i].length, peer_.length_by_id()[i]);
}
@@ -171,12 +171,10 @@ TEST_F(GenericHuffmanTableTest, ValidateInternalsWithSmallCode) {
EXPECT_EQ(0b10011000, peer_.pad_bits());
char input_storage[] = {2, 3, 2, 7, 4};
- quiche::QuicheStringPiece input(input_storage,
- QUICHE_ARRAYSIZE(input_storage));
+ absl::string_view input(input_storage, ABSL_ARRAYSIZE(input_storage));
// By symbol: (2) 00 (3) 010 (2) 00 (7) 10010 (4) 10000 (6 as pad) 1001100.
char expect_storage[] = {0b00010001, 0b00101000, 0b01001100};
- quiche::QuicheStringPiece expect(expect_storage,
- QUICHE_ARRAYSIZE(expect_storage));
+ absl::string_view expect(expect_storage, ABSL_ARRAYSIZE(expect_storage));
EXPECT_EQ(expect, EncodeString(input));
}
@@ -215,7 +213,7 @@ TEST_F(HpackHuffmanTableTest, SpecRequestExamples) {
"custom-value",
};
// Round-trip each test example.
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& encodedFixture(test_table[i]);
const std::string& decodedFixture(test_table[i + 1]);
DecodeString(encodedFixture, &buffer);
@@ -244,7 +242,7 @@ TEST_F(HpackHuffmanTableTest, SpecResponseExamples) {
"foo=ASDJKHQKBZXOQWEOPIUAXQWEOIU; max-age=3600; version=1",
};
// Round-trip each test example.
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); i += 2) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); i += 2) {
const std::string& encodedFixture(test_table[i]);
const std::string& decodedFixture(test_table[i + 1]);
DecodeString(encodedFixture, &buffer);
@@ -258,7 +256,7 @@ TEST_F(HpackHuffmanTableTest, RoundTripIndividualSymbols) {
for (size_t i = 0; i != 256; i++) {
char c = static_cast<char>(i);
char storage[3] = {c, c, c};
- quiche::QuicheStringPiece input(storage, QUICHE_ARRAYSIZE(storage));
+ absl::string_view input(storage, ABSL_ARRAYSIZE(storage));
std::string buffer_in = EncodeString(input);
std::string buffer_out;
DecodeString(buffer_in, &buffer_out);
@@ -272,7 +270,7 @@ TEST_F(HpackHuffmanTableTest, RoundTripSymbolSequence) {
storage[i] = static_cast<char>(i);
storage[511 - i] = static_cast<char>(i);
}
- quiche::QuicheStringPiece input(storage, QUICHE_ARRAYSIZE(storage));
+ absl::string_view input(storage, ABSL_ARRAYSIZE(storage));
std::string buffer_in = EncodeString(input);
std::string buffer_out;
DecodeString(buffer_in, &buffer_out);
@@ -291,12 +289,12 @@ TEST_F(HpackHuffmanTableTest, EncodedSizeAgreesWithEncodeString) {
};
for (size_t i = 0; i != 256; ++i) {
// Expand last |test_table| entry to cover all codes.
- test_table[QUICHE_ARRAYSIZE(test_table) - 1][i] = static_cast<char>(i);
+ test_table[ABSL_ARRAYSIZE(test_table) - 1][i] = static_cast<char>(i);
}
HpackOutputStream output_stream;
std::string encoding;
- for (size_t i = 0; i != QUICHE_ARRAYSIZE(test_table); ++i) {
+ for (size_t i = 0; i != ABSL_ARRAYSIZE(test_table); ++i) {
table_.EncodeString(test_table[i], &output_stream);
output_stream.TakeString(&encoding);
EXPECT_EQ(encoding.size(), table_.EncodedSize(test_table[i]));
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.cc
index 5c2dd683f1c..a532f0b379e 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.cc
@@ -41,7 +41,7 @@ void HpackOutputStream::AppendPrefix(HpackPrefix prefix) {
AppendBits(prefix.bits, prefix.bit_size);
}
-void HpackOutputStream::AppendBytes(quiche::QuicheStringPiece buffer) {
+void HpackOutputStream::AppendBytes(absl::string_view buffer) {
DCHECK_EQ(bit_offset_, 0u);
buffer_.append(buffer.data(), buffer.size());
}
@@ -61,6 +61,12 @@ void HpackOutputStream::AppendUint32(uint32_t I) {
}
AppendBits(static_cast<uint8_t>(I), 8);
}
+ DCHECK_EQ(bit_offset_, 0u);
+}
+
+std::string* HpackOutputStream::MutableString() {
+ DCHECK_EQ(bit_offset_, 0u);
+ return &buffer_;
}
void HpackOutputStream::TakeString(std::string* output) {
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h
index f7e71f1fb2a..b94aa0c91c6 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream.h
@@ -9,8 +9,8 @@
#include <map>
#include <string>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
// All section references below are to
@@ -37,7 +37,7 @@ class QUICHE_EXPORT_PRIVATE HpackOutputStream {
void AppendPrefix(HpackPrefix prefix);
// Directly appends |buffer|.
- void AppendBytes(quiche::QuicheStringPiece buffer);
+ void AppendBytes(absl::string_view buffer);
// Appends the given integer using the representation described in
// 6.1. If the internal buffer ends on a byte boundary, the prefix
@@ -48,6 +48,9 @@ class QUICHE_EXPORT_PRIVATE HpackOutputStream {
// boundary after this function is called.
void AppendUint32(uint32_t I);
+ // Return pointer to internal buffer. |bit_offset_| needs to be zero.
+ std::string* MutableString();
+
// Swaps the internal buffer with |output|, then resets state.
void TakeString(std::string* output);
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream_test.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream_test.cc
index 21e6947de1c..20d320c902c 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_output_stream_test.cc
@@ -271,6 +271,20 @@ TEST(HpackOutputStreamTest, BoundedTakeString) {
EXPECT_EQ("\x10", str);
}
+TEST(HpackOutputStreamTest, MutableString) {
+ HpackOutputStream output_stream;
+
+ output_stream.AppendBytes("1");
+ output_stream.MutableString()->append("2");
+
+ output_stream.AppendBytes("foo");
+ output_stream.MutableString()->append("bar");
+
+ std::string str;
+ output_stream.TakeString(&str);
+ EXPECT_EQ("12foobar", str);
+}
+
} // namespace
} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_round_trip_test.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_round_trip_test.cc
index c4bf0371884..4b5dd5b395f 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_round_trip_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_round_trip_test.cc
@@ -24,8 +24,6 @@ enum InputSizeParam { ALL_INPUT, ONE_BYTE, ZERO_THEN_ONE_BYTE };
class HpackRoundTripTest : public QuicheTestWithParam<InputSizeParam> {
protected:
- HpackRoundTripTest() : encoder_(ObtainHpackHuffmanTable()), decoder_() {}
-
void SetUp() override {
// Use a small table size to tickle eviction handling.
encoder_.ApplyHeaderTableSizeSetting(256);
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.cc
index e8b07f1ccbc..c0815ce159b 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.cc
@@ -4,7 +4,7 @@
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_static_table.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_entry.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h"
@@ -24,8 +24,8 @@ void HpackStaticTable::Initialize(const HpackStaticEntry* static_entry_table,
for (const HpackStaticEntry* it = static_entry_table;
it != static_entry_table + static_entry_count; ++it) {
static_entries_.push_back(
- HpackEntry(quiche::QuicheStringPiece(it->name, it->name_len),
- quiche::QuicheStringPiece(it->value, it->value_len),
+ HpackEntry(absl::string_view(it->name, it->name_len),
+ absl::string_view(it->value, it->value_len),
true, // is_static
total_insertions));
HpackEntry* entry = &static_entries_.back();
diff --git a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table_test.cc b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table_test.cc
index 42c62548224..36eb8315a2d 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/hpack/hpack_static_table_test.cc
@@ -7,7 +7,7 @@
#include <set>
#include <vector>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
@@ -39,7 +39,7 @@ TEST_F(HpackStaticTableTest, Initialize) {
HpackHeaderTable::NameToEntryMap static_name_index =
table_.GetStaticNameIndex();
- std::set<quiche::QuicheStringPiece> names;
+ std::set<absl::string_view> names;
for (auto* entry : static_index) {
names.insert(entry->name());
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.cc b/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.cc
index 8f62a93a734..1313c7d3bfc 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.cc
@@ -21,6 +21,7 @@
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder_listener.h"
#include "net/third_party/quiche/src/http2/http2_constants.h"
#include "net/third_party/quiche/src/http2/http2_structures.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h"
#include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h"
@@ -28,7 +29,6 @@
#include "net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_estimate_memory_usage.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_flags.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
@@ -67,7 +67,7 @@ SpdyFrameType ToSpdyFrameType(Http2FrameType type) {
uint64_t ToSpdyPingId(const Http2PingFields& ping) {
uint64_t v;
std::memcpy(&v, ping.opaque_bytes, Http2PingFields::EncodedSize());
- return spdy::SpdyNetToHost64(v);
+ return quiche::QuicheEndian::NetToHost64(v);
}
// Overwrites the fields of the header with invalid values, for the purpose
diff --git a/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h b/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h
index 1ac20c28b76..89d7fdc011a 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h
@@ -11,10 +11,10 @@
#include <memory>
#include <string>
+#include "absl/strings/string_view.h"
+#include "absl/types/optional.h"
#include "net/third_party/quiche/src/http2/decoder/http2_frame_decoder.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_optional.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_header_table.h"
#include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h"
@@ -269,7 +269,7 @@ class QUICHE_EXPORT_PRIVATE Http2DecoderAdapter
// Amount of trailing padding. Currently used just as an indicator of whether
// OnPadLength has been called.
- quiche::QuicheOptional<size_t> opt_pad_length_;
+ absl::optional<size_t> opt_pad_length_;
// Temporary buffers for the AltSvc fields.
std::string alt_svc_origin_;
@@ -494,7 +494,7 @@ class QUICHE_EXPORT_PRIVATE SpdyFramerVisitorInterface {
// Called when an ALTSVC frame has been parsed.
virtual void OnAltSvc(
SpdyStreamId /*stream_id*/,
- quiche::QuicheStringPiece /*origin*/,
+ absl::string_view /*origin*/,
const SpdyAltSvcWireFormat::AlternativeServiceVector& /*altsvc_vector*/) {
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h b/chromium/net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h
index e54c869212b..5faf2fb2da1 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h
@@ -9,9 +9,10 @@
#include <memory>
#include <utility>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
+#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
namespace spdy {
@@ -90,7 +91,7 @@ class MockSpdyFramerVisitor : public SpdyFramerVisitorInterface {
void,
OnAltSvc,
(SpdyStreamId stream_id,
- quiche::QuicheStringPiece origin,
+ absl::string_view origin,
const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector),
(override));
MOCK_METHOD(void,
@@ -117,7 +118,7 @@ class MockSpdyFramerVisitor : public SpdyFramerVisitorInterface {
SpdyHeadersHandlerInterface* ReturnTestHeadersHandler(
SpdyStreamId /* stream_id */) {
if (headers_handler_ == nullptr) {
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
}
return headers_handler_.get();
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.cc b/chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.cc
new file mode 100644
index 00000000000..02e5edeed2e
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.cc
@@ -0,0 +1,38 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
+
+namespace spdy {
+
+RecordingHeadersHandler::RecordingHeadersHandler(
+ SpdyHeadersHandlerInterface* wrapped)
+ : wrapped_(wrapped) {}
+
+void RecordingHeadersHandler::OnHeaderBlockStart() {
+ block_.clear();
+ if (wrapped_ != nullptr) {
+ wrapped_->OnHeaderBlockStart();
+ }
+}
+
+void RecordingHeadersHandler::OnHeader(absl::string_view key,
+ absl::string_view value) {
+ block_.AppendValueOrAddHeader(key, value);
+ if (wrapped_ != nullptr) {
+ wrapped_->OnHeader(key, value);
+ }
+}
+
+void RecordingHeadersHandler::OnHeaderBlockEnd(size_t uncompressed_header_bytes,
+ size_t compressed_header_bytes) {
+ uncompressed_header_bytes_ = uncompressed_header_bytes;
+ compressed_header_bytes_ = compressed_header_bytes;
+ if (wrapped_ != nullptr) {
+ wrapped_->OnHeaderBlockEnd(uncompressed_header_bytes,
+ compressed_header_bytes);
+ }
+}
+
+} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.h b/chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.h
new file mode 100644
index 00000000000..a61670ef8d8
--- /dev/null
+++ b/chromium/net/third_party/quiche/src/spdy/core/recording_headers_handler.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2020 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef QUICHE_SPDY_CORE_RECORDING_HEADERS_HANDLER_H_
+#define QUICHE_SPDY_CORE_RECORDING_HEADERS_HANDLER_H_
+
+#include <cstddef>
+#include <cstdint>
+#include <string>
+
+#include "absl/strings/string_view.h"
+#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
+#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
+#include "net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h"
+
+namespace spdy {
+
+// RecordingHeadersHandler copies the headers emitted from the deframer, and
+// when needed can forward events to another wrapped handler.
+class QUICHE_EXPORT_PRIVATE RecordingHeadersHandler
+ : public SpdyHeadersHandlerInterface {
+ public:
+ explicit RecordingHeadersHandler(
+ SpdyHeadersHandlerInterface* wrapped = nullptr);
+ RecordingHeadersHandler(const RecordingHeadersHandler&) = delete;
+ RecordingHeadersHandler& operator=(const RecordingHeadersHandler&) = delete;
+
+ void OnHeaderBlockStart() override;
+
+ void OnHeader(absl::string_view key, absl::string_view value) override;
+
+ void OnHeaderBlockEnd(size_t uncompressed_header_bytes,
+ size_t compressed_header_bytes) override;
+
+ const Http2HeaderBlock& decoded_block() const { return block_; }
+ size_t uncompressed_header_bytes() const {
+ return uncompressed_header_bytes_;
+ }
+ size_t compressed_header_bytes() const { return compressed_header_bytes_; }
+
+ private:
+ SpdyHeadersHandlerInterface* wrapped_ = nullptr;
+ Http2HeaderBlock block_;
+ size_t uncompressed_header_bytes_ = 0;
+ size_t compressed_header_bytes_ = 0;
+};
+
+} // namespace spdy
+
+#endif // QUICHE_SPDY_CORE_RECORDING_HEADERS_HANDLER_H_
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.cc
index 7f7ca298ab7..ac85b9c4f59 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.cc
@@ -17,8 +17,8 @@ namespace spdy {
namespace {
template <class T>
-bool ParsePositiveIntegerImpl(quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+bool ParsePositiveIntegerImpl(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
T* value) {
*value = 0;
for (; c != end && std::isdigit(*c); ++c) {
@@ -57,20 +57,20 @@ SpdyAltSvcWireFormat::AlternativeService::AlternativeService(
// static
bool SpdyAltSvcWireFormat::ParseHeaderFieldValue(
- quiche::QuicheStringPiece value,
+ absl::string_view value,
AlternativeServiceVector* altsvc_vector) {
// Empty value is invalid according to the specification.
if (value.empty()) {
return false;
}
altsvc_vector->clear();
- if (value == quiche::QuicheStringPiece("clear")) {
+ if (value == absl::string_view("clear")) {
return true;
}
- quiche::QuicheStringPiece::const_iterator c = value.begin();
+ absl::string_view::const_iterator c = value.begin();
while (c != value.end()) {
// Parse protocol-id.
- quiche::QuicheStringPiece::const_iterator percent_encoded_protocol_id_end =
+ absl::string_view::const_iterator percent_encoded_protocol_id_end =
std::find(c, value.end(), '=');
std::string protocol_id;
if (percent_encoded_protocol_id_end == c ||
@@ -91,7 +91,7 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue(
return false;
}
++c;
- quiche::QuicheStringPiece::const_iterator alt_authority_begin = c;
+ absl::string_view::const_iterator alt_authority_begin = c;
for (; c != value.end() && *c != '"'; ++c) {
// Decode backslash encoding.
if (*c != '\\') {
@@ -115,7 +115,7 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue(
// Parse parameters.
uint32_t max_age = 86400;
VersionVector version;
- quiche::QuicheStringPiece::const_iterator parameters_end =
+ absl::string_view::const_iterator parameters_end =
std::find(c, value.end(), ',');
while (c != parameters_end) {
SkipWhiteSpace(&c, parameters_end);
@@ -140,7 +140,7 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue(
}
++c;
SkipWhiteSpace(&c, parameters_end);
- quiche::QuicheStringPiece::const_iterator parameter_value_begin = c;
+ absl::string_view::const_iterator parameter_value_begin = c;
for (; c != parameters_end && *c != ';' && *c != ' ' && *c != '\t'; ++c) {
}
if (c == parameter_value_begin) {
@@ -164,10 +164,9 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue(
}
++c;
parameters_end = std::find(c, value.end(), ',');
- quiche::QuicheStringPiece::const_iterator v_begin =
- parameter_value_begin + 1;
+ absl::string_view::const_iterator v_begin = parameter_value_begin + 1;
while (v_begin < c) {
- quiche::QuicheStringPiece::const_iterator v_end = v_begin;
+ absl::string_view::const_iterator v_end = v_begin;
while (v_end < c - 1 && *v_end != ',') {
++v_end;
}
@@ -196,10 +195,9 @@ bool SpdyAltSvcWireFormat::ParseHeaderFieldValue(
// hq=":443";quic=51303338
// ... will be stored in |versions| as 0x51303338.
uint32_t quic_version;
- if (!SpdyHexDecodeToUInt32(
- quiche::QuicheStringPiece(&*parameter_value_begin,
- c - parameter_value_begin),
- &quic_version) ||
+ if (!SpdyHexDecodeToUInt32(absl::string_view(&*parameter_value_begin,
+ c - parameter_value_begin),
+ &quic_version) ||
quic_version == 0) {
return false;
}
@@ -295,17 +293,16 @@ std::string SpdyAltSvcWireFormat::SerializeHeaderFieldValue(
// static
void SpdyAltSvcWireFormat::SkipWhiteSpace(
- quiche::QuicheStringPiece::const_iterator* c,
- quiche::QuicheStringPiece::const_iterator end) {
+ absl::string_view::const_iterator* c,
+ absl::string_view::const_iterator end) {
for (; *c != end && (**c == ' ' || **c == '\t'); ++*c) {
}
}
// static
-bool SpdyAltSvcWireFormat::PercentDecode(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
- std::string* output) {
+bool SpdyAltSvcWireFormat::PercentDecode(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
+ std::string* output) {
output->clear();
for (; c != end; ++c) {
if (*c != '%') {
@@ -331,8 +328,8 @@ bool SpdyAltSvcWireFormat::PercentDecode(
// static
bool SpdyAltSvcWireFormat::ParseAltAuthority(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+ absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
std::string* host,
uint16_t* port) {
host->clear();
@@ -378,16 +375,16 @@ bool SpdyAltSvcWireFormat::ParseAltAuthority(
// static
bool SpdyAltSvcWireFormat::ParsePositiveInteger16(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+ absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
uint16_t* value) {
return ParsePositiveIntegerImpl<uint16_t>(c, end, value);
}
// static
bool SpdyAltSvcWireFormat::ParsePositiveInteger32(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+ absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
uint32_t* value) {
return ParsePositiveIntegerImpl<uint32_t>(c, end, value);
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h
index 4d2545035b1..30462feb031 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h"
namespace spdy {
@@ -60,29 +60,27 @@ class QUICHE_EXPORT_PRIVATE SpdyAltSvcWireFormat {
typedef std::vector<AlternativeService> AlternativeServiceVector;
friend class test::SpdyAltSvcWireFormatPeer;
- static bool ParseHeaderFieldValue(quiche::QuicheStringPiece value,
+ static bool ParseHeaderFieldValue(absl::string_view value,
AlternativeServiceVector* altsvc_vector);
static std::string SerializeHeaderFieldValue(
const AlternativeServiceVector& altsvc_vector);
private:
- static void SkipWhiteSpace(quiche::QuicheStringPiece::const_iterator* c,
- quiche::QuicheStringPiece::const_iterator end);
- static bool PercentDecode(quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+ static void SkipWhiteSpace(absl::string_view::const_iterator* c,
+ absl::string_view::const_iterator end);
+ static bool PercentDecode(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
std::string* output);
- static bool ParseAltAuthority(quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+ static bool ParseAltAuthority(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
std::string* host,
uint16_t* port);
- static bool ParsePositiveInteger16(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
- uint16_t* value);
- static bool ParsePositiveInteger32(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
- uint32_t* value);
+ static bool ParsePositiveInteger16(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
+ uint16_t* value);
+ static bool ParsePositiveInteger32(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
+ uint32_t* value);
};
} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format_test.cc
index d80de7df00e..a4127c8dc65 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format_test.cc
@@ -14,31 +14,29 @@ namespace test {
// Expose all private methods of class SpdyAltSvcWireFormat.
class SpdyAltSvcWireFormatPeer {
public:
- static void SkipWhiteSpace(quiche::QuicheStringPiece::const_iterator* c,
- quiche::QuicheStringPiece::const_iterator end) {
+ static void SkipWhiteSpace(absl::string_view::const_iterator* c,
+ absl::string_view::const_iterator end) {
SpdyAltSvcWireFormat::SkipWhiteSpace(c, end);
}
- static bool PercentDecode(quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+ static bool PercentDecode(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
std::string* output) {
return SpdyAltSvcWireFormat::PercentDecode(c, end, output);
}
- static bool ParseAltAuthority(quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
+ static bool ParseAltAuthority(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
std::string* host,
uint16_t* port) {
return SpdyAltSvcWireFormat::ParseAltAuthority(c, end, host, port);
}
- static bool ParsePositiveInteger16(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
- uint16_t* max_age) {
+ static bool ParsePositiveInteger16(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
+ uint16_t* max_age) {
return SpdyAltSvcWireFormat::ParsePositiveInteger16(c, end, max_age);
}
- static bool ParsePositiveInteger32(
- quiche::QuicheStringPiece::const_iterator c,
- quiche::QuicheStringPiece::const_iterator end,
- uint32_t* max_age) {
+ static bool ParsePositiveInteger32(absl::string_view::const_iterator c,
+ absl::string_view::const_iterator end,
+ uint32_t* max_age) {
return SpdyAltSvcWireFormat::ParsePositiveInteger32(c, end, max_age);
}
};
@@ -389,8 +387,8 @@ TEST(SpdyAltSvcWireFormatTest, ParseTruncatedHeaderFieldValue) {
// Test SkipWhiteSpace().
TEST(SpdyAltSvcWireFormatTest, SkipWhiteSpace) {
- quiche::QuicheStringPiece input("a \tb ");
- quiche::QuicheStringPiece::const_iterator c = input.begin();
+ absl::string_view input("a \tb ");
+ absl::string_view::const_iterator c = input.begin();
test::SpdyAltSvcWireFormatPeer::SkipWhiteSpace(&c, input.end());
ASSERT_EQ(input.begin(), c);
++c;
@@ -403,19 +401,19 @@ TEST(SpdyAltSvcWireFormatTest, SkipWhiteSpace) {
// Test PercentDecode() on valid input.
TEST(SpdyAltSvcWireFormatTest, PercentDecodeValid) {
- quiche::QuicheStringPiece input("");
+ absl::string_view input("");
std::string output;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::PercentDecode(
input.begin(), input.end(), &output));
EXPECT_EQ("", output);
- input = quiche::QuicheStringPiece("foo");
+ input = absl::string_view("foo");
output.clear();
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::PercentDecode(
input.begin(), input.end(), &output));
EXPECT_EQ("foo", output);
- input = quiche::QuicheStringPiece("%2ca%5Cb");
+ input = absl::string_view("%2ca%5Cb");
output.clear();
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::PercentDecode(
input.begin(), input.end(), &output));
@@ -426,7 +424,7 @@ TEST(SpdyAltSvcWireFormatTest, PercentDecodeValid) {
TEST(SpdyAltSvcWireFormatTest, PercentDecodeInvalid) {
const char* invalid_input_array[] = {"a%", "a%x", "a%b", "%J22", "%9z"};
for (const char* invalid_input : invalid_input_array) {
- quiche::QuicheStringPiece input(invalid_input);
+ absl::string_view input(invalid_input);
std::string output;
EXPECT_FALSE(test::SpdyAltSvcWireFormatPeer::PercentDecode(
input.begin(), input.end(), &output))
@@ -436,7 +434,7 @@ TEST(SpdyAltSvcWireFormatTest, PercentDecodeInvalid) {
// Test ParseAltAuthority() on valid input.
TEST(SpdyAltSvcWireFormatTest, ParseAltAuthorityValid) {
- quiche::QuicheStringPiece input(":42");
+ absl::string_view input(":42");
std::string host;
uint16_t port;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParseAltAuthority(
@@ -444,13 +442,13 @@ TEST(SpdyAltSvcWireFormatTest, ParseAltAuthorityValid) {
EXPECT_TRUE(host.empty());
EXPECT_EQ(42, port);
- input = quiche::QuicheStringPiece("foo:137");
+ input = absl::string_view("foo:137");
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParseAltAuthority(
input.begin(), input.end(), &host, &port));
EXPECT_EQ("foo", host);
EXPECT_EQ(137, port);
- input = quiche::QuicheStringPiece("[2003:8:0:16::509d:9615]:443");
+ input = absl::string_view("[2003:8:0:16::509d:9615]:443");
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParseAltAuthority(
input.begin(), input.end(), &host, &port));
EXPECT_EQ("[2003:8:0:16::509d:9615]", host);
@@ -477,7 +475,7 @@ TEST(SpdyAltSvcWireFormatTest, ParseAltAuthorityInvalid) {
"[2003:8:0:16::509d:9615:443",
"2003:8:0:16::509d:9615]:443"};
for (const char* invalid_input : invalid_input_array) {
- quiche::QuicheStringPiece input(invalid_input);
+ absl::string_view input(invalid_input);
std::string host;
uint16_t port;
EXPECT_FALSE(test::SpdyAltSvcWireFormatPeer::ParseAltAuthority(
@@ -488,13 +486,13 @@ TEST(SpdyAltSvcWireFormatTest, ParseAltAuthorityInvalid) {
// Test ParseInteger() on valid input.
TEST(SpdyAltSvcWireFormatTest, ParseIntegerValid) {
- quiche::QuicheStringPiece input("3");
+ absl::string_view input("3");
uint16_t value;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value));
EXPECT_EQ(3, value);
- input = quiche::QuicheStringPiece("1337");
+ input = absl::string_view("1337");
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value));
EXPECT_EQ(1337, value);
@@ -505,7 +503,7 @@ TEST(SpdyAltSvcWireFormatTest, ParseIntegerValid) {
TEST(SpdyAltSvcWireFormatTest, ParseIntegerInvalid) {
const char* invalid_input_array[] = {"", " ", "a", "0", "00", "1 ", "12b"};
for (const char* invalid_input : invalid_input_array) {
- quiche::QuicheStringPiece input(invalid_input);
+ absl::string_view input(invalid_input);
uint16_t value;
EXPECT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value))
@@ -516,39 +514,39 @@ TEST(SpdyAltSvcWireFormatTest, ParseIntegerInvalid) {
// Test ParseIntegerValid() around overflow limit.
TEST(SpdyAltSvcWireFormatTest, ParseIntegerOverflow) {
// Largest possible uint16_t value.
- quiche::QuicheStringPiece input("65535");
+ absl::string_view input("65535");
uint16_t value16;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value16));
EXPECT_EQ(65535, value16);
// Overflow uint16_t, ParsePositiveInteger16() should return false.
- input = quiche::QuicheStringPiece("65536");
+ input = absl::string_view("65536");
ASSERT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value16));
// However, even if overflow is not checked for, 65536 overflows to 0, which
// returns false anyway. Check for a larger number which overflows to 1.
- input = quiche::QuicheStringPiece("65537");
+ input = absl::string_view("65537");
ASSERT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger16(
input.begin(), input.end(), &value16));
// Largest possible uint32_t value.
- input = quiche::QuicheStringPiece("4294967295");
+ input = absl::string_view("4294967295");
uint32_t value32;
ASSERT_TRUE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger32(
input.begin(), input.end(), &value32));
EXPECT_EQ(4294967295, value32);
// Overflow uint32_t, ParsePositiveInteger32() should return false.
- input = quiche::QuicheStringPiece("4294967296");
+ input = absl::string_view("4294967296");
ASSERT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger32(
input.begin(), input.end(), &value32));
// However, even if overflow is not checked for, 4294967296 overflows to 0,
// which returns false anyway. Check for a larger number which overflows to
// 1.
- input = quiche::QuicheStringPiece("4294967297");
+ input = absl::string_view("4294967297");
ASSERT_FALSE(test::SpdyAltSvcWireFormatPeer::ParsePositiveInteger32(
input.begin(), input.end(), &value32));
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.cc
index 9e20e3e0188..835fea9d354 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.cc
@@ -11,10 +11,11 @@
#include <limits>
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h"
+#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
#include "net/third_party/quiche/src/spdy/core/spdy_frame_reader.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/core/spdy_test_utils.h"
@@ -138,7 +139,7 @@ class SpdyTestDeframerImpl : public SpdyTestDeframer,
// alphabetical order for ease of navigation, and are not in same order
// as in SpdyFramerVisitorInterface.
void OnAltSvc(SpdyStreamId stream_id,
- quiche::QuicheStringPiece origin,
+ absl::string_view origin,
const SpdyAltSvcWireFormat::AlternativeServiceVector&
altsvc_vector) override;
void OnContinuation(SpdyStreamId stream_id, bool end) override;
@@ -185,8 +186,7 @@ class SpdyTestDeframerImpl : public SpdyTestDeframer,
// Callbacks defined in SpdyHeadersHandlerInterface.
void OnHeaderBlockStart() override;
- void OnHeader(quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece value) override;
+ void OnHeader(absl::string_view key, absl::string_view value) override;
void OnHeaderBlockEnd(size_t header_bytes_parsed,
size_t compressed_header_bytes_parsed) override;
@@ -227,7 +227,7 @@ class SpdyTestDeframerImpl : public SpdyTestDeframer,
std::unique_ptr<std::string> goaway_description_;
std::unique_ptr<StringPairVector> headers_;
std::unique_ptr<SettingVector> settings_;
- std::unique_ptr<TestHeadersHandler> headers_handler_;
+ std::unique_ptr<RecordingHeadersHandler> headers_handler_;
std::unique_ptr<SpdyGoAwayIR> goaway_ir_;
std::unique_ptr<SpdyHeadersIR> headers_ir_;
@@ -411,7 +411,7 @@ bool SpdyTestDeframerImpl::AtFrameEnd() {
void SpdyTestDeframerImpl::OnAltSvc(
SpdyStreamId stream_id,
- quiche::QuicheStringPiece origin,
+ absl::string_view origin,
const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector) {
SPDY_DVLOG(1) << "OnAltSvc stream_id: " << stream_id;
CHECK_EQ(frame_type_, UNSET)
@@ -532,7 +532,7 @@ void SpdyTestDeframerImpl::OnHeaders(SpdyStreamId stream_id,
end_ = end;
headers_ = std::make_unique<StringPairVector>();
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
headers_ir_ = std::make_unique<SpdyHeadersIR>(stream_id);
headers_ir_->set_fin(fin);
if (has_priority) {
@@ -588,7 +588,7 @@ void SpdyTestDeframerImpl::OnPushPromise(SpdyStreamId stream_id,
end_ = end;
headers_ = std::make_unique<StringPairVector>();
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
push_promise_ir_ =
std::make_unique<SpdyPushPromiseIR>(stream_id, promised_stream_id);
}
@@ -757,8 +757,8 @@ void SpdyTestDeframerImpl::OnHeaderBlockStart() {
got_hpack_end_ = false;
}
-void SpdyTestDeframerImpl::OnHeader(quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece value) {
+void SpdyTestDeframerImpl::OnHeader(absl::string_view key,
+ absl::string_view value) {
CHECK(frame_type_ == HEADERS || frame_type_ == CONTINUATION ||
frame_type_ == PUSH_PROMISE)
<< " frame_type_=" << Http2FrameTypeToString(frame_type_);
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.h
index 27535236aef..f17df98720f 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_deframer_visitor.h
@@ -45,7 +45,7 @@
// framer.set_visitor(the_deframer.get());
//
// // Process frames.
-// QuicheStringPiece input = ...
+// absl::string_view input = ...
// while (!input.empty() && !framer.HasError()) {
// size_t consumed = framer.ProcessInput(input.data(), input.size());
// input.remove_prefix(consumed);
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.cc
index 492cd438d4c..93fb2843a38 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.cc
@@ -120,8 +120,7 @@ bool SpdyFrameBuilder::BeginNewFrameInternal(uint8_t raw_frame_type,
return success;
}
-bool SpdyFrameBuilder::WriteStringPiece32(
- const quiche::QuicheStringPiece value) {
+bool SpdyFrameBuilder::WriteStringPiece32(const absl::string_view value) {
if (!WriteUInt32(value.size())) {
return false;
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.h
index 4853d44eff3..9079a72ad14 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder.h
@@ -9,12 +9,12 @@
#include <cstdint>
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
#include "net/third_party/quiche/src/spdy/core/zero_copy_output_buffer.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h"
namespace spdy {
@@ -83,24 +83,26 @@ class QUICHE_EXPORT_PRIVATE SpdyFrameBuilder {
// host to network form.
bool WriteUInt8(uint8_t value) { return WriteBytes(&value, sizeof(value)); }
bool WriteUInt16(uint16_t value) {
- value = SpdyHostToNet16(value);
+ value = quiche::QuicheEndian::HostToNet16(value);
return WriteBytes(&value, sizeof(value));
}
bool WriteUInt24(uint32_t value) {
- value = SpdyHostToNet32(value);
+ value = quiche::QuicheEndian::HostToNet32(value);
return WriteBytes(reinterpret_cast<char*>(&value) + 1, sizeof(value) - 1);
}
bool WriteUInt32(uint32_t value) {
- value = SpdyHostToNet32(value);
+ value = quiche::QuicheEndian::HostToNet32(value);
return WriteBytes(&value, sizeof(value));
}
bool WriteUInt64(uint64_t value) {
- uint32_t upper = SpdyHostToNet32(static_cast<uint32_t>(value >> 32));
- uint32_t lower = SpdyHostToNet32(static_cast<uint32_t>(value));
+ uint32_t upper =
+ quiche::QuicheEndian::HostToNet32(static_cast<uint32_t>(value >> 32));
+ uint32_t lower =
+ quiche::QuicheEndian::HostToNet32(static_cast<uint32_t>(value));
return (WriteBytes(&upper, sizeof(upper)) &&
WriteBytes(&lower, sizeof(lower)));
}
- bool WriteStringPiece32(const quiche::QuicheStringPiece value);
+ bool WriteStringPiece32(const absl::string_view value);
bool WriteBytes(const void* data, uint32_t data_len);
private:
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder_test.cc
index b10932334cc..8f6a7b40551 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_builder_test.cc
@@ -48,8 +48,8 @@ TEST(SpdyFrameBuilderTest, GetWritableBuffer) {
SpdySerializedFrame frame(builder.take());
char expected[kBuilderSize];
memset(expected, ~1, kBuilderSize);
- EXPECT_EQ(quiche::QuicheStringPiece(expected, kBuilderSize),
- quiche::QuicheStringPiece(frame.data(), kBuilderSize));
+ EXPECT_EQ(absl::string_view(expected, kBuilderSize),
+ absl::string_view(frame.data(), kBuilderSize));
}
// Verifies that SpdyFrameBuilder::GetWritableBuffer() can be used to build a
@@ -66,8 +66,8 @@ TEST(SpdyFrameBuilderTest, GetWritableOutput) {
SpdySerializedFrame frame(output.Begin(), kBuilderSize, false);
char expected[kBuilderSize];
memset(expected, ~1, kBuilderSize);
- EXPECT_EQ(quiche::QuicheStringPiece(expected, kBuilderSize),
- quiche::QuicheStringPiece(frame.data(), kBuilderSize));
+ EXPECT_EQ(absl::string_view(expected, kBuilderSize),
+ absl::string_view(frame.data(), kBuilderSize));
}
// Verifies the case that the buffer's capacity is too small.
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.cc
index 253f90639de..a53a8acb9a2 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.cc
@@ -4,8 +4,8 @@
#include "net/third_party/quiche/src/spdy/core/spdy_frame_reader.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h"
namespace spdy {
@@ -36,7 +36,8 @@ bool SpdyFrameReader::ReadUInt16(uint16_t* result) {
}
// Read into result.
- *result = SpdyNetToHost16(*(reinterpret_cast<const uint16_t*>(data_ + ofs_)));
+ *result = quiche::QuicheEndian::NetToHost16(
+ *(reinterpret_cast<const uint16_t*>(data_ + ofs_)));
// Iterate.
ofs_ += 2;
@@ -52,7 +53,8 @@ bool SpdyFrameReader::ReadUInt32(uint32_t* result) {
}
// Read into result.
- *result = SpdyNetToHost32(*(reinterpret_cast<const uint32_t*>(data_ + ofs_)));
+ *result = quiche::QuicheEndian::NetToHost32(
+ *(reinterpret_cast<const uint32_t*>(data_ + ofs_)));
// Iterate.
ofs_ += 4;
@@ -68,10 +70,10 @@ bool SpdyFrameReader::ReadUInt64(uint64_t* result) {
}
// Read into result. Network byte order is big-endian.
- uint64_t upper =
- SpdyNetToHost32(*(reinterpret_cast<const uint32_t*>(data_ + ofs_)));
- uint64_t lower =
- SpdyNetToHost32(*(reinterpret_cast<const uint32_t*>(data_ + ofs_ + 4)));
+ uint64_t upper = quiche::QuicheEndian::NetToHost32(
+ *(reinterpret_cast<const uint32_t*>(data_ + ofs_)));
+ uint64_t lower = quiche::QuicheEndian::NetToHost32(
+ *(reinterpret_cast<const uint32_t*>(data_ + ofs_ + 4)));
*result = (upper << 32) + lower;
// Iterate.
@@ -101,7 +103,7 @@ bool SpdyFrameReader::ReadUInt24(uint32_t* result) {
// Read into result.
*result = 0;
memcpy(reinterpret_cast<char*>(result) + 1, data_ + ofs_, 3);
- *result = SpdyNetToHost32(*result);
+ *result = quiche::QuicheEndian::NetToHost32(*result);
// Iterate.
ofs_ += 3;
@@ -109,7 +111,7 @@ bool SpdyFrameReader::ReadUInt24(uint32_t* result) {
return true;
}
-bool SpdyFrameReader::ReadStringPiece16(quiche::QuicheStringPiece* result) {
+bool SpdyFrameReader::ReadStringPiece16(absl::string_view* result) {
// Read resultant length.
uint16_t result_len;
if (!ReadUInt16(&result_len)) {
@@ -124,7 +126,7 @@ bool SpdyFrameReader::ReadStringPiece16(quiche::QuicheStringPiece* result) {
}
// Set result.
- *result = quiche::QuicheStringPiece(data_ + ofs_, result_len);
+ *result = absl::string_view(data_ + ofs_, result_len);
// Iterate.
ofs_ += result_len;
@@ -132,7 +134,7 @@ bool SpdyFrameReader::ReadStringPiece16(quiche::QuicheStringPiece* result) {
return true;
}
-bool SpdyFrameReader::ReadStringPiece32(quiche::QuicheStringPiece* result) {
+bool SpdyFrameReader::ReadStringPiece32(absl::string_view* result) {
// Read resultant length.
uint32_t result_len;
if (!ReadUInt32(&result_len)) {
@@ -147,7 +149,7 @@ bool SpdyFrameReader::ReadStringPiece32(quiche::QuicheStringPiece* result) {
}
// Set result.
- *result = quiche::QuicheStringPiece(data_ + ofs_, result_len);
+ *result = absl::string_view(data_ + ofs_, result_len);
// Iterate.
ofs_ += result_len;
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.h
index 0ed5be48884..e097ee33905 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader.h
@@ -7,8 +7,8 @@
#include <cstdint>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace spdy {
@@ -73,7 +73,7 @@ class QUICHE_EXPORT_PRIVATE SpdyFrameReader {
//
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadStringPiece16(quiche::QuicheStringPiece* result);
+ bool ReadStringPiece16(absl::string_view* result);
// Reads a string prefixed with 32-bit length into the given output parameter.
//
@@ -82,7 +82,7 @@ class QUICHE_EXPORT_PRIVATE SpdyFrameReader {
//
// Forwards the internal iterator on success.
// Returns true on success, false otherwise.
- bool ReadStringPiece32(quiche::QuicheStringPiece* result);
+ bool ReadStringPiece32(absl::string_view* result);
// Reads a given number of bytes into the given buffer. The buffer
// must be of adequate size.
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader_test.cc
index 0bbe7f62cf2..1e46c48f9af 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_frame_reader_test.cc
@@ -6,17 +6,17 @@
#include <cstdint>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
namespace spdy {
TEST(SpdyFrameReaderTest, ReadUInt16) {
// Frame data in network byte order.
const uint16_t kFrameData[] = {
- SpdyHostToNet16(1),
- SpdyHostToNet16(1 << 15),
+ quiche::QuicheEndian::HostToNet16(1),
+ quiche::QuicheEndian::HostToNet16(1 << 15),
};
SpdyFrameReader frame_reader(reinterpret_cast<const char*>(kFrameData),
@@ -36,12 +36,12 @@ TEST(SpdyFrameReaderTest, ReadUInt16) {
TEST(SpdyFrameReaderTest, ReadUInt32) {
// Frame data in network byte order.
const uint32_t kFrameData[] = {
- SpdyHostToNet32(1),
- SpdyHostToNet32(0x80000000),
+ quiche::QuicheEndian::HostToNet32(1),
+ quiche::QuicheEndian::HostToNet32(0x80000000),
};
SpdyFrameReader frame_reader(reinterpret_cast<const char*>(kFrameData),
- QUICHE_ARRAYSIZE(kFrameData) * sizeof(uint32_t));
+ ABSL_ARRAYSIZE(kFrameData) * sizeof(uint32_t));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint32_t uint32_val;
@@ -64,10 +64,10 @@ TEST(SpdyFrameReaderTest, ReadStringPiece16) {
0x20, 0x31, 0x2c, 0x20, 0x32, 0x2c, 0x20, 0x33, // "Testing, 1, 2, 3"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- quiche::QuicheStringPiece stringpiece_val;
+ absl::string_view stringpiece_val;
EXPECT_TRUE(frame_reader.ReadStringPiece16(&stringpiece_val));
EXPECT_FALSE(frame_reader.IsDoneReading());
EXPECT_EQ(0, stringpiece_val.compare("Hi"));
@@ -87,10 +87,10 @@ TEST(SpdyFrameReaderTest, ReadStringPiece32) {
0x20, 0x34, 0x2c, 0x20, 0x35, 0x2c, 0x20, 0x36, // "Testing, 4, 5, 6"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- quiche::QuicheStringPiece stringpiece_val;
+ absl::string_view stringpiece_val;
EXPECT_TRUE(frame_reader.ReadStringPiece32(&stringpiece_val));
EXPECT_FALSE(frame_reader.IsDoneReading());
EXPECT_EQ(0, stringpiece_val.compare("foo"));
@@ -106,7 +106,7 @@ TEST(SpdyFrameReaderTest, ReadUInt16WithBufferTooSmall) {
0x00, // part of a uint16_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint16_t uint16_val;
@@ -119,7 +119,7 @@ TEST(SpdyFrameReaderTest, ReadUInt32WithBufferTooSmall) {
0x00, 0x00, 0x00, // part of a uint32_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
uint32_t uint32_val;
@@ -139,10 +139,10 @@ TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferTooSmall) {
0x48, 0x69, // "Hi"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- quiche::QuicheStringPiece stringpiece_val;
+ absl::string_view stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val));
// Also make sure that trying to read a uint16_t, which technically could
@@ -158,10 +158,10 @@ TEST(SpdyFrameReaderTest, ReadStringPiece16WithBufferWayTooSmall) {
0x00, // part of a uint16_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- quiche::QuicheStringPiece stringpiece_val;
+ absl::string_view stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece16(&stringpiece_val));
// Also make sure that trying to read a uint16_t, which technically could
@@ -178,10 +178,10 @@ TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferTooSmall) {
0x48, 0x69, // "Hi"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- quiche::QuicheStringPiece stringpiece_val;
+ absl::string_view stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val));
// Also make sure that trying to read a uint16_t, which technically could
@@ -197,10 +197,10 @@ TEST(SpdyFrameReaderTest, ReadStringPiece32WithBufferWayTooSmall) {
0x00, 0x00, 0x00, // part of a uint32_t
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- quiche::QuicheStringPiece stringpiece_val;
+ absl::string_view stringpiece_val;
EXPECT_FALSE(frame_reader.ReadStringPiece32(&stringpiece_val));
// Also make sure that trying to read a uint16_t, which technically could
@@ -216,18 +216,18 @@ TEST(SpdyFrameReaderTest, ReadBytes) {
0x48, 0x69, // "Hi"
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
char dest1[3] = {};
- EXPECT_TRUE(frame_reader.ReadBytes(&dest1, QUICHE_ARRAYSIZE(dest1)));
+ EXPECT_TRUE(frame_reader.ReadBytes(&dest1, ABSL_ARRAYSIZE(dest1)));
EXPECT_FALSE(frame_reader.IsDoneReading());
- EXPECT_EQ("foo", quiche::QuicheStringPiece(dest1, QUICHE_ARRAYSIZE(dest1)));
+ EXPECT_EQ("foo", absl::string_view(dest1, ABSL_ARRAYSIZE(dest1)));
char dest2[2] = {};
- EXPECT_TRUE(frame_reader.ReadBytes(&dest2, QUICHE_ARRAYSIZE(dest2)));
+ EXPECT_TRUE(frame_reader.ReadBytes(&dest2, ABSL_ARRAYSIZE(dest2)));
EXPECT_TRUE(frame_reader.IsDoneReading());
- EXPECT_EQ("Hi", quiche::QuicheStringPiece(dest2, QUICHE_ARRAYSIZE(dest2)));
+ EXPECT_EQ("Hi", absl::string_view(dest2, ABSL_ARRAYSIZE(dest2)));
}
TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) {
@@ -236,11 +236,11 @@ TEST(SpdyFrameReaderTest, ReadBytesWithBufferTooSmall) {
0x01,
};
- SpdyFrameReader frame_reader(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ SpdyFrameReader frame_reader(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_FALSE(frame_reader.IsDoneReading());
- char dest[QUICHE_ARRAYSIZE(kFrameData) + 2] = {};
- EXPECT_FALSE(frame_reader.ReadBytes(&dest, QUICHE_ARRAYSIZE(kFrameData) + 1));
+ char dest[ABSL_ARRAYSIZE(kFrameData) + 2] = {};
+ EXPECT_FALSE(frame_reader.ReadBytes(&dest, ABSL_ARRAYSIZE(kFrameData) + 1));
EXPECT_STREQ("", dest);
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.cc
index 7b3d388cfb4..d425bddaf09 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.cc
@@ -11,9 +11,8 @@
#include <new>
#include <utility>
+#include "absl/memory/memory.h"
#include "net/third_party/quiche/src/http2/platform/api/http2_macros.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_ptr_util.h"
-#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/spdy_bitmasks.h"
#include "net/third_party/quiche/src/spdy/core/spdy_frame_builder.h"
#include "net/third_party/quiche/src/spdy/core/spdy_frame_reader.h"
@@ -46,7 +45,7 @@ const size_t kPadLengthFieldSize = 1;
// The size of one parameter in SETTINGS frame.
const size_t kOneSettingParameterSize = 6;
-size_t GetUncompressedSerializedLength(const SpdyHeaderBlock& headers) {
+size_t GetUncompressedSerializedLength(const Http2HeaderBlock& headers) {
const size_t num_name_value_pairs_size = sizeof(uint32_t);
const size_t length_of_name_size = num_name_value_pairs_size;
const size_t length_of_value_size = num_name_value_pairs_size;
@@ -414,12 +413,12 @@ std::unique_ptr<SpdyFrameSequence> SpdyFramer::CreateIterator(
switch (frame_ir->frame_type()) {
case SpdyFrameType::HEADERS: {
return std::make_unique<SpdyHeaderFrameIterator>(
- framer, quiche::QuicheWrapUnique(
+ framer, absl::WrapUnique(
static_cast<const SpdyHeadersIR*>(frame_ir.release())));
}
case SpdyFrameType::PUSH_PROMISE: {
return std::make_unique<SpdyPushPromiseFrameIterator>(
- framer, quiche::QuicheWrapUnique(
+ framer, absl::WrapUnique(
static_cast<const SpdyPushPromiseIR*>(frame_ir.release())));
}
case SpdyFrameType::DATA: {
@@ -1269,7 +1268,7 @@ size_t SpdyFramer::SerializeFrame(const SpdyFrameIR& frame,
HpackEncoder* SpdyFramer::GetHpackEncoder() {
if (hpack_encoder_ == nullptr) {
- hpack_encoder_ = std::make_unique<HpackEncoder>(ObtainHpackHuffmanTable());
+ hpack_encoder_ = std::make_unique<HpackEncoder>();
if (!compression_enabled()) {
hpack_encoder_->DisableCompression();
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.h
index f16e3bd1916..99c20376830 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_framer.h
@@ -13,8 +13,8 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/hpack/hpack_encoder.h"
#include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_framer_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_framer_test.cc
index e36a17e6591..6a14d0c436c 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_framer_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_framer_test.cc
@@ -13,11 +13,11 @@
#include <utility>
#include <vector>
-#include "net/third_party/quiche/src/common/platform/api/quiche_arraysize.h"
+#include "absl/base/macros.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
#include "net/third_party/quiche/src/spdy/core/array_output_buffer.h"
-#include "net/third_party/quiche/src/spdy/core/hpack/hpack_constants.h"
#include "net/third_party/quiche/src/spdy/core/mock_spdy_framer_visitor.h"
+#include "net/third_party/quiche/src/spdy/core/recording_headers_handler.h"
#include "net/third_party/quiche/src/spdy/core/spdy_bitmasks.h"
#include "net/third_party/quiche/src/spdy/core/spdy_frame_builder.h"
#include "net/third_party/quiche/src/spdy/core/spdy_frame_reader.h"
@@ -288,7 +288,7 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
SPDY_VLOG(1) << "OnStreamFrameData(" << stream_id << ", data, " << len
<< ", "
<< ") data:\n"
- << SpdyHexDump(quiche::QuicheStringPiece(data, len));
+ << SpdyHexDump(absl::string_view(data, len));
EXPECT_EQ(header_stream_id_, stream_id);
data_bytes_ += len;
@@ -316,7 +316,7 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
SpdyHeadersHandlerInterface* OnHeaderFrameStart(
SpdyStreamId /*stream_id*/) override {
if (headers_handler_ == nullptr) {
- headers_handler_ = std::make_unique<TestHeadersHandler>();
+ headers_handler_ = std::make_unique<RecordingHeadersHandler>();
}
return headers_handler_.get();
}
@@ -324,7 +324,7 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
void OnHeaderFrameEnd(SpdyStreamId /*stream_id*/) override {
CHECK(headers_handler_ != nullptr);
headers_ = headers_handler_->decoded_block().Clone();
- header_bytes_received_ = headers_handler_->header_bytes_parsed();
+ header_bytes_received_ = headers_handler_->uncompressed_header_bytes();
headers_handler_.reset();
}
@@ -404,7 +404,7 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
}
void OnAltSvc(SpdyStreamId stream_id,
- quiche::QuicheStringPiece origin,
+ absl::string_view origin,
const SpdyAltSvcWireFormat::AlternativeServiceVector&
altsvc_vector) override {
SPDY_VLOG(1) << "OnAltSvc(" << stream_id << ", \"" << origin
@@ -532,8 +532,8 @@ class TestSpdyVisitor : public SpdyFramerVisitorInterface,
SpdyStreamId header_stream_id_;
SpdyFrameType header_control_type_;
bool header_buffer_valid_;
- std::unique_ptr<TestHeadersHandler> headers_handler_;
- SpdyHeaderBlock headers_;
+ std::unique_ptr<RecordingHeadersHandler> headers_handler_;
+ Http2HeaderBlock headers_;
bool header_has_priority_;
SpdyStreamId header_parent_stream_id_;
bool header_exclusive_;
@@ -1103,10 +1103,10 @@ TEST_P(SpdyFramerTest, MultiValueHeader) {
SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION);
std::string value("value1\0value2", 13);
// TODO(jgraettinger): If this pattern appears again, move to test class.
- SpdyHeaderBlock header_set;
+ Http2HeaderBlock header_set;
header_set["name"] = value;
std::string buffer;
- HpackEncoder encoder(ObtainHpackHuffmanTable());
+ HpackEncoder encoder;
encoder.DisableCompression();
encoder.EncodeHeaderSet(header_set, &buffer);
// Frame builder with plentiful buffer size.
@@ -1126,7 +1126,7 @@ TEST_P(SpdyFramerTest, MultiValueHeader) {
control_frame.size());
EXPECT_THAT(visitor.headers_, testing::ElementsAre(testing::Pair(
- "name", quiche::QuicheStringPiece(value))));
+ "name", absl::string_view(value))));
}
TEST_P(SpdyFramerTest, CompressEmptyHeaders) {
@@ -1316,7 +1316,7 @@ TEST_P(SpdyFramerTest, UnclosedStreamDataCompressorsOneByteAtATime) {
const char bytes[] = "this is a test test test test test!";
SpdyDataIR data_ir(/* stream_id = */ 1,
- quiche::QuicheStringPiece(bytes, QUICHE_ARRAYSIZE(bytes)));
+ absl::string_view(bytes, ABSL_ARRAYSIZE(bytes)));
data_ir.set_fin(true);
SpdySerializedFrame send_frame(framer_.SerializeData(data_ir));
@@ -1336,8 +1336,7 @@ TEST_P(SpdyFramerTest, UnclosedStreamDataCompressorsOneByteAtATime) {
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(1, visitor.headers_frame_count_);
- EXPECT_EQ(QUICHE_ARRAYSIZE(bytes),
- static_cast<unsigned>(visitor.data_bytes_));
+ EXPECT_EQ(ABSL_ARRAYSIZE(bytes), static_cast<unsigned>(visitor.data_bytes_));
EXPECT_EQ(0, visitor.fin_frame_count_);
EXPECT_EQ(0, visitor.fin_flag_count_);
EXPECT_EQ(1, visitor.end_of_stream_count_);
@@ -1362,8 +1361,7 @@ TEST_P(SpdyFramerTest, WindowUpdateFrame) {
0x12, 0x34, 0x56, 0x78, // Increment: 305419896
};
- CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ CompareFrame(kDescription, frame, kH2FrameData, ABSL_ARRAYSIZE(kH2FrameData));
}
TEST_P(SpdyFramerTest, CreateDataFrame) {
@@ -1384,7 +1382,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
SpdyDataIR data_ir(/* stream_id = */ 1, bytes);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
SpdyDataIR data_header_ir(/* stream_id = */ 1);
data_header_ir.SetDataShallow(bytes);
@@ -1440,7 +1438,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
data_ir.set_padding_len(248);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1470,7 +1468,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
data_ir.set_padding_len(8);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1500,7 +1498,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
data_ir.set_padding_len(1);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1520,7 +1518,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
SpdyDataIR data_ir(/* stream_id = */ 1, "\xff");
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1537,7 +1535,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
data_ir.set_fin(true);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1551,7 +1549,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
SpdyDataIR data_ir(/* stream_id = */ 1, "");
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
frame = framer_.SerializeDataFrameHeaderWithPaddingLengthField(data_ir);
CompareCharArraysWithHexError(
@@ -1573,7 +1571,7 @@ TEST_P(SpdyFramerTest, CreateDataFrame) {
data_ir.set_fin(true);
SpdySerializedFrame frame(framer_.SerializeData(data_ir));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1594,7 +1592,7 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1615,7 +1613,7 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1636,7 +1634,7 @@ TEST_P(SpdyFramerTest, CreateRstStream) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1664,7 +1662,7 @@ TEST_P(SpdyFramerTest, CreateSettings) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1700,7 +1698,7 @@ TEST_P(SpdyFramerTest, CreateSettings) {
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1720,7 +1718,7 @@ TEST_P(SpdyFramerTest, CreateSettings) {
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1753,7 +1751,7 @@ TEST_P(SpdyFramerTest, CreatePingFrame) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
// Tests SpdyPingIR when the ping is an ack.
ping_ir.set_is_ack(true);
@@ -1764,7 +1762,7 @@ TEST_P(SpdyFramerTest, CreatePingFrame) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameDataWithAck,
- QUICHE_ARRAYSIZE(kH2FrameDataWithAck));
+ ABSL_ARRAYSIZE(kH2FrameDataWithAck));
}
}
@@ -1788,7 +1786,7 @@ TEST_P(SpdyFramerTest, CreateGoAway) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1811,7 +1809,7 @@ TEST_P(SpdyFramerTest, CreateGoAway) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -1846,7 +1844,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1878,7 +1876,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1910,7 +1908,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1947,7 +1945,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -1987,7 +1985,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData,
- QUICHE_ARRAYSIZE(kV4FrameData));
+ ABSL_ARRAYSIZE(kV4FrameData));
}
{
@@ -2027,7 +2025,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kV4FrameData,
- QUICHE_ARRAYSIZE(kV4FrameData));
+ ABSL_ARRAYSIZE(kV4FrameData));
}
{
@@ -2065,7 +2063,7 @@ TEST_P(SpdyFramerTest, CreateHeadersUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
&framer, headers_ir, use_output_ ? &output_ : nullptr));
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -2088,7 +2086,7 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -2110,7 +2108,7 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
{
@@ -2132,7 +2130,7 @@ TEST_P(SpdyFramerTest, CreateWindowUpdate) {
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
CompareFrame(kDescription, frame, kH2FrameData,
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
}
}
@@ -2170,7 +2168,7 @@ TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) {
push_promise.SetHeader("foo", "bar");
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
{
@@ -2210,7 +2208,7 @@ TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
{
@@ -2270,7 +2268,7 @@ TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) {
SpdySerializedFrame frame(SpdyFramerPeer::SerializePushPromise(
&framer, push_promise, use_output_ ? &output_ : nullptr));
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
}
@@ -2307,11 +2305,11 @@ TEST_P(SpdyFramerTest, CreateContinuationUncompressed) {
};
// frame-format on
- SpdyHeaderBlock header_block;
+ Http2HeaderBlock header_block;
header_block["bar"] = "foo";
header_block["foo"] = "bar";
auto buffer = std::make_unique<std::string>();
- HpackEncoder encoder(ObtainHpackHuffmanTable());
+ HpackEncoder encoder;
encoder.DisableCompression();
encoder.EncodeHeaderSet(header_block, buffer.get());
@@ -2324,7 +2322,7 @@ TEST_P(SpdyFramerTest, CreateContinuationUncompressed) {
ASSERT_TRUE(framer.SerializeContinuation(continuation, &output_));
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
// Test that if we send an unexpected CONTINUATION
@@ -2456,17 +2454,16 @@ TEST_P(SpdyFramerTest, CreatePushPromiseThenContinuationUncompressed) {
// Partially compare the PUSH_PROMISE frame against the template.
const unsigned char* frame_data =
reinterpret_cast<const unsigned char*>(frame.data());
- CompareCharArraysWithHexError(
- kDescription, frame_data,
- QUICHE_ARRAYSIZE(kPartialPushPromiseFrameData),
- kPartialPushPromiseFrameData,
- QUICHE_ARRAYSIZE(kPartialPushPromiseFrameData));
+ CompareCharArraysWithHexError(kDescription, frame_data,
+ ABSL_ARRAYSIZE(kPartialPushPromiseFrameData),
+ kPartialPushPromiseFrameData,
+ ABSL_ARRAYSIZE(kPartialPushPromiseFrameData));
// Compare the CONTINUATION frame against the template.
frame_data += kHttp2MaxControlFrameSendSize;
CompareCharArraysWithHexError(
- kDescription, frame_data, QUICHE_ARRAYSIZE(kContinuationFrameData),
- kContinuationFrameData, QUICHE_ARRAYSIZE(kContinuationFrameData));
+ kDescription, frame_data, ABSL_ARRAYSIZE(kContinuationFrameData),
+ kContinuationFrameData, ABSL_ARRAYSIZE(kContinuationFrameData));
}
}
@@ -2493,7 +2490,7 @@ TEST_P(SpdyFramerTest, CreateAltSvc) {
EXPECT_EQ(framer_.SerializeFrame(altsvc_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, CreatePriority) {
@@ -2515,7 +2512,7 @@ TEST_P(SpdyFramerTest, CreatePriority) {
EXPECT_EQ(framer_.SerializeFrame(priority_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, CreateUnknown) {
@@ -2542,7 +2539,7 @@ TEST_P(SpdyFramerTest, CreateUnknown) {
EXPECT_EQ(framer_.SerializeFrame(unknown_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
// Test serialization of a SpdyUnknownIR with a defined type, a length field
@@ -2574,7 +2571,7 @@ TEST_P(SpdyFramerTest, CreateUnknownUnchecked) {
EXPECT_EQ(framer_.SerializeFrame(unknown_ir, &output_), frame.size());
frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
}
- CompareFrame(kDescription, frame, kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ CompareFrame(kDescription, frame, kFrameData, ABSL_ARRAYSIZE(kFrameData));
}
TEST_P(SpdyFramerTest, ReadCompressedHeadersHeaderBlock) {
@@ -3610,7 +3607,7 @@ TEST_P(SpdyFramerTest, ReadUnknownExtensionFrame) {
// Simulate the case where the stream id validation checks out.
visitor.on_unknown_frame_result_ = true;
- visitor.SimulateInFramer(unknown_frame, QUICHE_ARRAYSIZE(unknown_frame));
+ visitor.SimulateInFramer(unknown_frame, ABSL_ARRAYSIZE(unknown_frame));
EXPECT_EQ(0, visitor.error_count_);
// Follow it up with a valid control frame to make sure we handle
@@ -3646,7 +3643,7 @@ TEST_P(SpdyFramerTest, ReadUnknownExtensionFrameWithExtension) {
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
TestExtension extension;
visitor.set_extension_visitor(&extension);
- visitor.SimulateInFramer(unknown_frame, QUICHE_ARRAYSIZE(unknown_frame));
+ visitor.SimulateInFramer(unknown_frame, ABSL_ARRAYSIZE(unknown_frame));
EXPECT_EQ(0, visitor.error_count_);
EXPECT_EQ(0x7fffffffu, extension.stream_id_);
EXPECT_EQ(20u, extension.length_);
@@ -3677,7 +3674,7 @@ TEST_P(SpdyFramerTest, ReadGarbageWithValidLength) {
0xff, 0xff, 0xff, 0xff, //
};
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
- visitor.SimulateInFramer(kFrameData, QUICHE_ARRAYSIZE(kFrameData));
+ visitor.SimulateInFramer(kFrameData, ABSL_ARRAYSIZE(kFrameData));
EXPECT_EQ(1, visitor.error_count_);
}
@@ -3696,7 +3693,7 @@ TEST_P(SpdyFramerTest, ReadGarbageHPACKEncoding) {
};
TestSpdyVisitor visitor(SpdyFramer::DISABLE_COMPRESSION);
- visitor.SimulateInFramer(kInput, QUICHE_ARRAYSIZE(kInput));
+ visitor.SimulateInFramer(kInput, ABSL_ARRAYSIZE(kInput));
EXPECT_EQ(1, visitor.error_count_);
}
@@ -4221,7 +4218,7 @@ TEST_P(SpdyFramerTest, RstStreamStatusBounds) {
EXPECT_CALL(visitor, OnRstStream(1, ERROR_CODE_NO_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2RstStreamInvalid),
- QUICHE_ARRAYSIZE(kH2RstStreamInvalid));
+ ABSL_ARRAYSIZE(kH2RstStreamInvalid));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4231,7 +4228,7 @@ TEST_P(SpdyFramerTest, RstStreamStatusBounds) {
EXPECT_CALL(visitor, OnRstStream(1, ERROR_CODE_INTERNAL_ERROR));
deframer_.ProcessInput(
reinterpret_cast<const char*>(kH2RstStreamNumStatusCodes),
- QUICHE_ARRAYSIZE(kH2RstStreamNumStatusCodes));
+ ABSL_ARRAYSIZE(kH2RstStreamNumStatusCodes));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4254,7 +4251,7 @@ TEST_P(SpdyFramerTest, GoAwayStatusBounds) {
EXPECT_CALL(visitor, OnGoAway(1, ERROR_CODE_INTERNAL_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2FrameData),
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4278,7 +4275,7 @@ TEST_P(SpdyFramerTest, GoAwayStreamIdBounds) {
EXPECT_CALL(visitor, OnGoAway(0x7fffffff, ERROR_CODE_NO_ERROR));
deframer_.ProcessInput(reinterpret_cast<const char*>(kH2FrameData),
- QUICHE_ARRAYSIZE(kH2FrameData));
+ ABSL_ARRAYSIZE(kH2FrameData));
EXPECT_EQ(Http2DecoderAdapter::SPDY_READY_FOR_FRAME, deframer_.state());
EXPECT_EQ(Http2DecoderAdapter::SPDY_NO_ERROR, deframer_.spdy_framer_error())
<< Http2DecoderAdapter::SpdyFramerErrorToString(
@@ -4299,8 +4296,8 @@ TEST_P(SpdyFramerTest, OnAltSvcWithOrigin) {
SpdyAltSvcWireFormat::AlternativeServiceVector altsvc_vector;
altsvc_vector.push_back(altsvc1);
altsvc_vector.push_back(altsvc2);
- EXPECT_CALL(visitor, OnAltSvc(kStreamId, quiche::QuicheStringPiece("o_r|g!n"),
- altsvc_vector));
+ EXPECT_CALL(visitor,
+ OnAltSvc(kStreamId, absl::string_view("o_r|g!n"), altsvc_vector));
SpdyAltSvcIR altsvc_ir(kStreamId);
altsvc_ir.set_origin("o_r|g!n");
@@ -4334,8 +4331,8 @@ TEST_P(SpdyFramerTest, OnAltSvcNoOrigin) {
SpdyAltSvcWireFormat::AlternativeServiceVector altsvc_vector;
altsvc_vector.push_back(altsvc1);
altsvc_vector.push_back(altsvc2);
- EXPECT_CALL(visitor, OnAltSvc(kStreamId, quiche::QuicheStringPiece(""),
- altsvc_vector));
+ EXPECT_CALL(visitor,
+ OnAltSvc(kStreamId, absl::string_view(""), altsvc_vector));
SpdyAltSvcIR altsvc_ir(kStreamId);
altsvc_ir.add_altsvc(altsvc1);
@@ -4771,8 +4768,7 @@ TEST_P(SpdyFramerTest, SpdyFrameIRSize) {
SpdyFramer framer(SpdyFramer::DISABLE_COMPRESSION);
const char bytes[] = "this is a very short data frame";
- SpdyDataIR data_ir(1,
- quiche::QuicheStringPiece(bytes, QUICHE_ARRAYSIZE(bytes)));
+ SpdyDataIR data_ir(1, absl::string_view(bytes, ABSL_ARRAYSIZE(bytes)));
CheckFrameAndIRSize(&data_ir, &framer, &output_);
SpdyRstStreamIR rst_ir(/* stream_id = */ 1, ERROR_CODE_PROTOCOL_ERROR);
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.cc
index d7e3faa9ba0..23dd9996c34 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.cc
@@ -27,35 +27,34 @@ const size_t kInitialMapBuckets = 11;
const char kCookieKey[] = "cookie";
const char kNullSeparator = 0;
-quiche::QuicheStringPiece SeparatorForKey(quiche::QuicheStringPiece key) {
+absl::string_view SeparatorForKey(absl::string_view key) {
if (key == kCookieKey) {
- static quiche::QuicheStringPiece cookie_separator = "; ";
+ static absl::string_view cookie_separator = "; ";
return cookie_separator;
} else {
- return quiche::QuicheStringPiece(&kNullSeparator, 1);
+ return absl::string_view(&kNullSeparator, 1);
}
}
} // namespace
-SpdyHeaderBlock::HeaderValue::HeaderValue(
- SpdyHeaderStorage* storage,
- quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece initial_value)
+Http2HeaderBlock::HeaderValue::HeaderValue(SpdyHeaderStorage* storage,
+ absl::string_view key,
+ absl::string_view initial_value)
: storage_(storage),
fragments_({initial_value}),
pair_({key, {}}),
size_(initial_value.size()),
separator_size_(SeparatorForKey(key).size()) {}
-SpdyHeaderBlock::HeaderValue::HeaderValue(HeaderValue&& other)
+Http2HeaderBlock::HeaderValue::HeaderValue(HeaderValue&& other)
: storage_(other.storage_),
fragments_(std::move(other.fragments_)),
pair_(std::move(other.pair_)),
size_(other.size_),
separator_size_(other.separator_size_) {}
-SpdyHeaderBlock::HeaderValue& SpdyHeaderBlock::HeaderValue::operator=(
+Http2HeaderBlock::HeaderValue& Http2HeaderBlock::HeaderValue::operator=(
HeaderValue&& other) {
storage_ = other.storage_;
fragments_ = std::move(other.fragments_);
@@ -65,16 +64,15 @@ SpdyHeaderBlock::HeaderValue& SpdyHeaderBlock::HeaderValue::operator=(
return *this;
}
-void SpdyHeaderBlock::HeaderValue::set_storage(SpdyHeaderStorage* storage) {
+void Http2HeaderBlock::HeaderValue::set_storage(SpdyHeaderStorage* storage) {
storage_ = storage;
}
-SpdyHeaderBlock::HeaderValue::~HeaderValue() = default;
+Http2HeaderBlock::HeaderValue::~HeaderValue() = default;
-quiche::QuicheStringPiece SpdyHeaderBlock::HeaderValue::ConsolidatedValue()
- const {
+absl::string_view Http2HeaderBlock::HeaderValue::ConsolidatedValue() const {
if (fragments_.empty()) {
- return quiche::QuicheStringPiece();
+ return absl::string_view();
}
if (fragments_.size() > 1) {
fragments_ = {
@@ -83,27 +81,27 @@ quiche::QuicheStringPiece SpdyHeaderBlock::HeaderValue::ConsolidatedValue()
return fragments_[0];
}
-void SpdyHeaderBlock::HeaderValue::Append(quiche::QuicheStringPiece fragment) {
+void Http2HeaderBlock::HeaderValue::Append(absl::string_view fragment) {
size_ += (fragment.size() + separator_size_);
fragments_.push_back(fragment);
}
-const std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>&
-SpdyHeaderBlock::HeaderValue::as_pair() const {
+const std::pair<absl::string_view, absl::string_view>&
+Http2HeaderBlock::HeaderValue::as_pair() const {
pair_.second = ConsolidatedValue();
return pair_;
}
-SpdyHeaderBlock::iterator::iterator(MapType::const_iterator it) : it_(it) {}
+Http2HeaderBlock::iterator::iterator(MapType::const_iterator it) : it_(it) {}
-SpdyHeaderBlock::iterator::iterator(const iterator& other) = default;
+Http2HeaderBlock::iterator::iterator(const iterator& other) = default;
-SpdyHeaderBlock::iterator::~iterator() = default;
+Http2HeaderBlock::iterator::~iterator() = default;
-SpdyHeaderBlock::ValueProxy::ValueProxy(
- SpdyHeaderBlock* block,
- SpdyHeaderBlock::MapType::iterator lookup_result,
- const quiche::QuicheStringPiece key,
+Http2HeaderBlock::ValueProxy::ValueProxy(
+ Http2HeaderBlock* block,
+ Http2HeaderBlock::MapType::iterator lookup_result,
+ const absl::string_view key,
size_t* spdy_header_block_value_size)
: block_(block),
lookup_result_(lookup_result),
@@ -111,7 +109,7 @@ SpdyHeaderBlock::ValueProxy::ValueProxy(
spdy_header_block_value_size_(spdy_header_block_value_size),
valid_(true) {}
-SpdyHeaderBlock::ValueProxy::ValueProxy(ValueProxy&& other)
+Http2HeaderBlock::ValueProxy::ValueProxy(ValueProxy&& other)
: block_(other.block_),
lookup_result_(other.lookup_result_),
key_(other.key_),
@@ -120,8 +118,8 @@ SpdyHeaderBlock::ValueProxy::ValueProxy(ValueProxy&& other)
other.valid_ = false;
}
-SpdyHeaderBlock::ValueProxy& SpdyHeaderBlock::ValueProxy::operator=(
- SpdyHeaderBlock::ValueProxy&& other) {
+Http2HeaderBlock::ValueProxy& Http2HeaderBlock::ValueProxy::operator=(
+ Http2HeaderBlock::ValueProxy&& other) {
block_ = other.block_;
lookup_result_ = other.lookup_result_;
key_ = other.key_;
@@ -131,18 +129,18 @@ SpdyHeaderBlock::ValueProxy& SpdyHeaderBlock::ValueProxy::operator=(
return *this;
}
-SpdyHeaderBlock::ValueProxy::~ValueProxy() {
+Http2HeaderBlock::ValueProxy::~ValueProxy() {
// If the ValueProxy is destroyed while lookup_result_ == block_->end(),
// the assignment operator was never used, and the block's SpdyHeaderStorage
// can reclaim the memory used by the key. This makes lookup-only access to
- // SpdyHeaderBlock through operator[] memory-neutral.
+ // Http2HeaderBlock through operator[] memory-neutral.
if (valid_ && lookup_result_ == block_->map_.end()) {
block_->storage_.Rewind(key_);
}
}
-SpdyHeaderBlock::ValueProxy& SpdyHeaderBlock::ValueProxy::operator=(
- quiche::QuicheStringPiece value) {
+Http2HeaderBlock::ValueProxy& Http2HeaderBlock::ValueProxy::operator=(
+ absl::string_view value) {
*spdy_header_block_value_size_ += value.size();
SpdyHeaderStorage* storage = &block_->storage_;
if (lookup_result_ == block_->map_.end()) {
@@ -160,8 +158,7 @@ SpdyHeaderBlock::ValueProxy& SpdyHeaderBlock::ValueProxy::operator=(
return *this;
}
-bool SpdyHeaderBlock::ValueProxy::operator==(
- quiche::QuicheStringPiece value) const {
+bool Http2HeaderBlock::ValueProxy::operator==(absl::string_view value) const {
if (lookup_result_ == block_->map_.end()) {
return false;
} else {
@@ -169,7 +166,7 @@ bool SpdyHeaderBlock::ValueProxy::operator==(
}
}
-std::string SpdyHeaderBlock::ValueProxy::as_string() const {
+std::string Http2HeaderBlock::ValueProxy::as_string() const {
if (lookup_result_ == block_->map_.end()) {
return "";
} else {
@@ -177,9 +174,9 @@ std::string SpdyHeaderBlock::ValueProxy::as_string() const {
}
}
-SpdyHeaderBlock::SpdyHeaderBlock() : map_(kInitialMapBuckets) {}
+Http2HeaderBlock::Http2HeaderBlock() : map_(kInitialMapBuckets) {}
-SpdyHeaderBlock::SpdyHeaderBlock(SpdyHeaderBlock&& other)
+Http2HeaderBlock::Http2HeaderBlock(Http2HeaderBlock&& other)
: map_(kInitialMapBuckets) {
map_.swap(other.map_);
storage_ = std::move(other.storage_);
@@ -190,9 +187,9 @@ SpdyHeaderBlock::SpdyHeaderBlock(SpdyHeaderBlock&& other)
value_size_ = other.value_size_;
}
-SpdyHeaderBlock::~SpdyHeaderBlock() = default;
+Http2HeaderBlock::~Http2HeaderBlock() = default;
-SpdyHeaderBlock& SpdyHeaderBlock::operator=(SpdyHeaderBlock&& other) {
+Http2HeaderBlock& Http2HeaderBlock::operator=(Http2HeaderBlock&& other) {
map_.swap(other.map_);
storage_ = std::move(other.storage_);
for (auto& p : map_) {
@@ -203,23 +200,23 @@ SpdyHeaderBlock& SpdyHeaderBlock::operator=(SpdyHeaderBlock&& other) {
return *this;
}
-SpdyHeaderBlock SpdyHeaderBlock::Clone() const {
- SpdyHeaderBlock copy;
+Http2HeaderBlock Http2HeaderBlock::Clone() const {
+ Http2HeaderBlock copy;
for (const auto& p : *this) {
copy.AppendHeader(p.first, p.second);
}
return copy;
}
-bool SpdyHeaderBlock::operator==(const SpdyHeaderBlock& other) const {
+bool Http2HeaderBlock::operator==(const Http2HeaderBlock& other) const {
return size() == other.size() && std::equal(begin(), end(), other.begin());
}
-bool SpdyHeaderBlock::operator!=(const SpdyHeaderBlock& other) const {
+bool Http2HeaderBlock::operator!=(const Http2HeaderBlock& other) const {
return !(operator==(other));
}
-std::string SpdyHeaderBlock::DebugString() const {
+std::string Http2HeaderBlock::DebugString() const {
if (empty()) {
return "{}";
}
@@ -232,7 +229,7 @@ std::string SpdyHeaderBlock::DebugString() const {
return output;
}
-void SpdyHeaderBlock::erase(quiche::QuicheStringPiece key) {
+void Http2HeaderBlock::erase(absl::string_view key) {
auto iter = map_.find(key);
if (iter != map_.end()) {
SPDY_DVLOG(1) << "Erasing header with name: " << key;
@@ -242,14 +239,14 @@ void SpdyHeaderBlock::erase(quiche::QuicheStringPiece key) {
}
}
-void SpdyHeaderBlock::clear() {
+void Http2HeaderBlock::clear() {
key_size_ = 0;
value_size_ = 0;
map_.clear();
storage_.Clear();
}
-void SpdyHeaderBlock::insert(const SpdyHeaderBlock::value_type& value) {
+void Http2HeaderBlock::insert(const Http2HeaderBlock::value_type& value) {
// TODO(birenroy): Write new value in place of old value, if it fits.
value_size_ += value.second.size();
@@ -267,14 +264,14 @@ void SpdyHeaderBlock::insert(const SpdyHeaderBlock::value_type& value) {
}
}
-SpdyHeaderBlock::ValueProxy SpdyHeaderBlock::operator[](
- const quiche::QuicheStringPiece key) {
+Http2HeaderBlock::ValueProxy Http2HeaderBlock::operator[](
+ const absl::string_view key) {
SPDY_DVLOG(2) << "Operator[] saw key: " << key;
- quiche::QuicheStringPiece out_key;
+ absl::string_view out_key;
auto iter = map_.find(key);
if (iter == map_.end()) {
// We write the key first, to assure that the ValueProxy has a
- // reference to a valid QuicheStringPiece in its operator=.
+ // reference to a valid absl::string_view in its operator=.
out_key = WriteKey(key);
SPDY_DVLOG(2) << "Key written as: " << std::hex
<< static_cast<const void*>(key.data()) << ", " << std::dec
@@ -285,9 +282,8 @@ SpdyHeaderBlock::ValueProxy SpdyHeaderBlock::operator[](
return ValueProxy(this, iter, out_key, &value_size_);
}
-void SpdyHeaderBlock::AppendValueOrAddHeader(
- const quiche::QuicheStringPiece key,
- const quiche::QuicheStringPiece value) {
+void Http2HeaderBlock::AppendValueOrAddHeader(const absl::string_view key,
+ const absl::string_view value) {
value_size_ += value.size();
auto iter = map_.find(key);
@@ -303,26 +299,25 @@ void SpdyHeaderBlock::AppendValueOrAddHeader(
iter->second.Append(storage_.Write(value));
}
-size_t SpdyHeaderBlock::EstimateMemoryUsage() const {
+size_t Http2HeaderBlock::EstimateMemoryUsage() const {
// TODO(xunjieli): https://crbug.com/669108. Also include |map_| when EMU()
// supports linked_hash_map.
return SpdyEstimateMemoryUsage(storage_);
}
-void SpdyHeaderBlock::AppendHeader(const quiche::QuicheStringPiece key,
- const quiche::QuicheStringPiece value) {
+void Http2HeaderBlock::AppendHeader(const absl::string_view key,
+ const absl::string_view value) {
auto backed_key = WriteKey(key);
map_.emplace(std::make_pair(
backed_key, HeaderValue(&storage_, backed_key, storage_.Write(value))));
}
-quiche::QuicheStringPiece SpdyHeaderBlock::WriteKey(
- const quiche::QuicheStringPiece key) {
+absl::string_view Http2HeaderBlock::WriteKey(const absl::string_view key) {
key_size_ += key.size();
return storage_.Write(key);
}
-size_t SpdyHeaderBlock::bytes_allocated() const {
+size_t Http2HeaderBlock::bytes_allocated() const {
return storage_.bytes_allocated();
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.h
index 2348551f567..8961b497e82 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block.h
@@ -13,8 +13,8 @@
#include <utility>
#include <vector>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_storage.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_containers.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_macros.h"
@@ -23,7 +23,7 @@
namespace spdy {
namespace test {
-class SpdyHeaderBlockPeer;
+class Http2HeaderBlockPeer;
class ValueProxyPeer;
} // namespace test
@@ -39,22 +39,22 @@ class ValueProxyPeer;
// names and values. This data structure preserves insertion order.
//
// Under the hood, this data structure uses large, contiguous blocks of memory
-// to store names and values. Lookups may be performed with QuicheStringPiece
-// keys, and values are returned as QuicheStringPieces (via ValueProxy, below).
-// Value QuicheStringPieces are valid as long as the SpdyHeaderBlock exists;
-// allocated memory is never freed until SpdyHeaderBlock's destruction.
+// to store names and values. Lookups may be performed with absl::string_view
+// keys, and values are returned as absl::string_views (via ValueProxy, below).
+// Value absl::string_views are valid as long as the Http2HeaderBlock exists;
+// allocated memory is never freed until Http2HeaderBlock's destruction.
//
// This implementation does not make much of an effort to minimize wasted space.
-// It's expected that keys are rarely deleted from a SpdyHeaderBlock.
-class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
+// It's expected that keys are rarely deleted from a Http2HeaderBlock.
+class QUICHE_EXPORT_PRIVATE Http2HeaderBlock {
private:
// Stores a list of value fragments that can be joined later with a
// key-dependent separator.
class QUICHE_EXPORT_PRIVATE HeaderValue {
public:
HeaderValue(SpdyHeaderStorage* storage,
- quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece initial_value);
+ absl::string_view key,
+ absl::string_view initial_value);
// Moves are allowed.
HeaderValue(HeaderValue&& other);
@@ -69,50 +69,46 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
~HeaderValue();
// Consumes at most |fragment.size()| bytes of memory.
- void Append(quiche::QuicheStringPiece fragment);
+ void Append(absl::string_view fragment);
- quiche::QuicheStringPiece value() const { return as_pair().second; }
- const std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>&
- as_pair() const;
+ absl::string_view value() const { return as_pair().second; }
+ const std::pair<absl::string_view, absl::string_view>& as_pair() const;
// Size estimate including separators. Used when keys are erased from
- // SpdyHeaderBlock.
+ // Http2HeaderBlock.
size_t SizeEstimate() const { return size_; }
private:
// May allocate a large contiguous region of memory to hold the concatenated
// fragments and separators.
- quiche::QuicheStringPiece ConsolidatedValue() const;
+ absl::string_view ConsolidatedValue() const;
mutable SpdyHeaderStorage* storage_;
- mutable std::vector<quiche::QuicheStringPiece> fragments_;
+ mutable std::vector<absl::string_view> fragments_;
// The first element is the key; the second is the consolidated value.
- mutable std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>
- pair_;
+ mutable std::pair<absl::string_view, absl::string_view> pair_;
size_t size_ = 0;
size_t separator_size_ = 0;
};
- typedef SpdyLinkedHashMap<quiche::QuicheStringPiece,
+ typedef SpdyLinkedHashMap<absl::string_view,
HeaderValue,
SpdyStringPieceCaseHash,
SpdyStringPieceCaseEq>
MapType;
public:
- typedef std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>
- value_type;
+ typedef std::pair<absl::string_view, absl::string_view> value_type;
- // Provides iteration over a sequence of std::pair<QuicheStringPiece,
- // QuicheStringPiece>, even though the underlying MapType::value_type is
+ // Provides iteration over a sequence of std::pair<absl::string_view,
+ // absl::string_view>, even though the underlying MapType::value_type is
// different. Dereferencing the iterator will result in memory allocation for
// multi-value headers.
class QUICHE_EXPORT_PRIVATE iterator {
public:
// The following type definitions fulfill the requirements for iterator
// implementations.
- typedef std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece>
- value_type;
+ typedef std::pair<absl::string_view, absl::string_view> value_type;
typedef value_type& reference;
typedef value_type* pointer;
typedef std::forward_iterator_tag iterator_category;
@@ -162,17 +158,17 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
};
typedef iterator const_iterator;
- SpdyHeaderBlock();
- SpdyHeaderBlock(const SpdyHeaderBlock& other) = delete;
- SpdyHeaderBlock(SpdyHeaderBlock&& other);
- ~SpdyHeaderBlock();
+ Http2HeaderBlock();
+ Http2HeaderBlock(const Http2HeaderBlock& other) = delete;
+ Http2HeaderBlock(Http2HeaderBlock&& other);
+ ~Http2HeaderBlock();
- SpdyHeaderBlock& operator=(const SpdyHeaderBlock& other) = delete;
- SpdyHeaderBlock& operator=(SpdyHeaderBlock&& other);
- SpdyHeaderBlock Clone() const;
+ Http2HeaderBlock& operator=(const Http2HeaderBlock& other) = delete;
+ Http2HeaderBlock& operator=(Http2HeaderBlock&& other);
+ Http2HeaderBlock Clone() const;
- bool operator==(const SpdyHeaderBlock& other) const;
- bool operator!=(const SpdyHeaderBlock& other) const;
+ bool operator==(const Http2HeaderBlock& other) const;
+ bool operator!=(const Http2HeaderBlock& other) const;
// Provides a human readable multi-line representation of the stored header
// keys and values.
@@ -184,13 +180,11 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
const_iterator end() const { return wrap_const_iterator(map_.end()); }
bool empty() const { return map_.empty(); }
size_t size() const { return map_.size(); }
- iterator find(quiche::QuicheStringPiece key) {
- return wrap_iterator(map_.find(key));
- }
- const_iterator find(quiche::QuicheStringPiece key) const {
+ iterator find(absl::string_view key) { return wrap_iterator(map_.find(key)); }
+ const_iterator find(absl::string_view key) const {
return wrap_const_iterator(map_.find(key));
}
- void erase(quiche::QuicheStringPiece key);
+ void erase(absl::string_view key);
// Clears both our MapType member and the memory used to hold headers.
void clear();
@@ -205,11 +199,11 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
// existing header value, NUL ("\0") separated unless the key is cookie, in
// which case the separator is "; ".
// If there is no such key, a new header with the key and value is added.
- void AppendValueOrAddHeader(const quiche::QuicheStringPiece key,
- const quiche::QuicheStringPiece value);
+ void AppendValueOrAddHeader(const absl::string_view key,
+ const absl::string_view value);
- // This object provides automatic conversions that allow SpdyHeaderBlock to be
- // nearly a drop-in replacement for
+ // This object provides automatic conversions that allow Http2HeaderBlock to
+ // be nearly a drop-in replacement for
// SpdyLinkedHashMap<std::string, std::string>.
// It reads data from or writes data to a SpdyHeaderStorage.
class QUICHE_EXPORT_PRIVATE ValueProxy {
@@ -224,33 +218,32 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
ValueProxy(const ValueProxy& other) = delete;
ValueProxy& operator=(const ValueProxy& other) = delete;
- // Assignment modifies the underlying SpdyHeaderBlock.
- ValueProxy& operator=(quiche::QuicheStringPiece value);
+ // Assignment modifies the underlying Http2HeaderBlock.
+ ValueProxy& operator=(absl::string_view value);
- // Provides easy comparison against QuicheStringPiece.
- bool operator==(quiche::QuicheStringPiece value) const;
+ // Provides easy comparison against absl::string_view.
+ bool operator==(absl::string_view value) const;
std::string as_string() const;
private:
- friend class SpdyHeaderBlock;
+ friend class Http2HeaderBlock;
friend class test::ValueProxyPeer;
- ValueProxy(SpdyHeaderBlock* block,
- SpdyHeaderBlock::MapType::iterator lookup_result,
- const quiche::QuicheStringPiece key,
+ ValueProxy(Http2HeaderBlock* block,
+ Http2HeaderBlock::MapType::iterator lookup_result,
+ const absl::string_view key,
size_t* spdy_header_block_value_size);
- SpdyHeaderBlock* block_;
- SpdyHeaderBlock::MapType::iterator lookup_result_;
- quiche::QuicheStringPiece key_;
+ Http2HeaderBlock* block_;
+ Http2HeaderBlock::MapType::iterator lookup_result_;
+ absl::string_view key_;
size_t* spdy_header_block_value_size_;
bool valid_;
};
// Allows either lookup or mutation of the value associated with a key.
- SPDY_MUST_USE_RESULT ValueProxy
- operator[](const quiche::QuicheStringPiece key);
+ SPDY_MUST_USE_RESULT ValueProxy operator[](const absl::string_view key);
// Returns the estimate of dynamically allocated memory in bytes.
size_t EstimateMemoryUsage() const;
@@ -258,7 +251,7 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
size_t TotalBytesUsed() const { return key_size_ + value_size_; }
private:
- friend class test::SpdyHeaderBlockPeer;
+ friend class test::Http2HeaderBlockPeer;
inline iterator wrap_iterator(MapType::const_iterator inner_iterator) const {
#if SPDY_HEADER_DEBUG
@@ -285,12 +278,11 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
#endif // SPDY_HEADER_DEBUG
}
- void AppendHeader(const quiche::QuicheStringPiece key,
- const quiche::QuicheStringPiece value);
- quiche::QuicheStringPiece WriteKey(const quiche::QuicheStringPiece key);
+ void AppendHeader(const absl::string_view key, const absl::string_view value);
+ absl::string_view WriteKey(const absl::string_view key);
size_t bytes_allocated() const;
- // QuicheStringPieces held by |map_| point to memory owned by |storage_|.
+ // absl::string_views held by |map_| point to memory owned by |storage_|.
MapType map_;
SpdyHeaderStorage storage_;
@@ -298,6 +290,9 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderBlock {
size_t value_size_ = 0;
};
+// TODO(b/156770486): Remove this alias when the rename is complete.
+using SpdyHeaderBlock = Http2HeaderBlock;
+
} // namespace spdy
#endif // QUICHE_SPDY_CORE_SPDY_HEADER_BLOCK_H_
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block_test.cc
index b670c2ae650..9fd7b6871c5 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_block_test.cc
@@ -17,20 +17,19 @@ namespace test {
class ValueProxyPeer {
public:
- static quiche::QuicheStringPiece key(SpdyHeaderBlock::ValueProxy* p) {
+ static absl::string_view key(Http2HeaderBlock::ValueProxy* p) {
return p->key_;
}
};
-std::pair<quiche::QuicheStringPiece, quiche::QuicheStringPiece> Pair(
- quiche::QuicheStringPiece k,
- quiche::QuicheStringPiece v) {
+std::pair<absl::string_view, absl::string_view> Pair(absl::string_view k,
+ absl::string_view v) {
return std::make_pair(k, v);
}
-// This test verifies that SpdyHeaderBlock behaves correctly when empty.
-TEST(SpdyHeaderBlockTest, EmptyBlock) {
- SpdyHeaderBlock block;
+// This test verifies that Http2HeaderBlock behaves correctly when empty.
+TEST(Http2HeaderBlockTest, EmptyBlock) {
+ Http2HeaderBlock block;
EXPECT_TRUE(block.empty());
EXPECT_EQ(0u, block.size());
EXPECT_EQ(block.end(), block.find("foo"));
@@ -40,21 +39,21 @@ TEST(SpdyHeaderBlockTest, EmptyBlock) {
block.erase("bar");
}
-TEST(SpdyHeaderBlockTest, KeyMemoryReclaimedOnLookup) {
- SpdyHeaderBlock block;
- quiche::QuicheStringPiece copied_key1;
+TEST(Http2HeaderBlockTest, KeyMemoryReclaimedOnLookup) {
+ Http2HeaderBlock block;
+ absl::string_view copied_key1;
{
auto proxy1 = block["some key name"];
copied_key1 = ValueProxyPeer::key(&proxy1);
}
- quiche::QuicheStringPiece copied_key2;
+ absl::string_view copied_key2;
{
auto proxy2 = block["some other key name"];
copied_key2 = ValueProxyPeer::key(&proxy2);
}
// Because proxy1 was never used to modify the block, the memory used for the
// key could be reclaimed and used for the second call to operator[].
- // Therefore, we expect the pointers of the two QuicheStringPieces to be
+ // Therefore, we expect the pointers of the two absl::string_views to be
// equal.
EXPECT_EQ(copied_key1.data(), copied_key2.data());
@@ -63,7 +62,7 @@ TEST(SpdyHeaderBlockTest, KeyMemoryReclaimedOnLookup) {
block["some other key name"] = "some value";
}
// Nothing should blow up when proxy1 is destructed, and we should be able to
- // modify and access the SpdyHeaderBlock.
+ // modify and access the Http2HeaderBlock.
block["key"] = "value";
EXPECT_EQ("value", block["key"]);
EXPECT_EQ("some value", block["some other key name"]);
@@ -71,8 +70,8 @@ TEST(SpdyHeaderBlockTest, KeyMemoryReclaimedOnLookup) {
}
// This test verifies that headers can be set in a variety of ways.
-TEST(SpdyHeaderBlockTest, AddHeaders) {
- SpdyHeaderBlock block;
+TEST(Http2HeaderBlockTest, AddHeaders) {
+ Http2HeaderBlock block;
block["foo"] = std::string(300, 'x');
block["bar"] = "baz";
block["qux"] = "qux1";
@@ -90,29 +89,29 @@ TEST(SpdyHeaderBlockTest, AddHeaders) {
EXPECT_EQ(block.end(), block.find("key"));
}
-// This test verifies that SpdyHeaderBlock can be copied using Clone().
-TEST(SpdyHeaderBlockTest, CopyBlocks) {
- SpdyHeaderBlock block1;
+// This test verifies that Http2HeaderBlock can be copied using Clone().
+TEST(Http2HeaderBlockTest, CopyBlocks) {
+ Http2HeaderBlock block1;
block1["foo"] = std::string(300, 'x');
block1["bar"] = "baz";
block1.insert(std::make_pair("qux", "qux1"));
- SpdyHeaderBlock block2 = block1.Clone();
- SpdyHeaderBlock block3(block1.Clone());
+ Http2HeaderBlock block2 = block1.Clone();
+ Http2HeaderBlock block3(block1.Clone());
EXPECT_EQ(block1, block2);
EXPECT_EQ(block1, block3);
}
-TEST(SpdyHeaderBlockTest, Equality) {
+TEST(Http2HeaderBlockTest, Equality) {
// Test equality and inequality operators.
- SpdyHeaderBlock block1;
+ Http2HeaderBlock block1;
block1["foo"] = "bar";
- SpdyHeaderBlock block2;
+ Http2HeaderBlock block2;
block2["foo"] = "bar";
- SpdyHeaderBlock block3;
+ Http2HeaderBlock block3;
block3["baz"] = "qux";
EXPECT_EQ(block1, block2);
@@ -122,28 +121,28 @@ TEST(SpdyHeaderBlockTest, Equality) {
EXPECT_NE(block1, block2);
}
-SpdyHeaderBlock ReturnTestHeaderBlock() {
- SpdyHeaderBlock block;
+Http2HeaderBlock ReturnTestHeaderBlock() {
+ Http2HeaderBlock block;
block["foo"] = "bar";
block.insert(std::make_pair("foo2", "baz"));
return block;
}
// Test that certain methods do not crash on moved-from instances.
-TEST(SpdyHeaderBlockTest, MovedFromIsValid) {
- SpdyHeaderBlock block1;
+TEST(Http2HeaderBlockTest, MovedFromIsValid) {
+ Http2HeaderBlock block1;
block1["foo"] = "bar";
- SpdyHeaderBlock block2(std::move(block1));
+ Http2HeaderBlock block2(std::move(block1));
EXPECT_THAT(block2, ElementsAre(Pair("foo", "bar")));
block1["baz"] = "qux"; // NOLINT testing post-move behavior
- SpdyHeaderBlock block3(std::move(block1));
+ Http2HeaderBlock block3(std::move(block1));
block1["foo"] = "bar"; // NOLINT testing post-move behavior
- SpdyHeaderBlock block4(std::move(block1));
+ Http2HeaderBlock block4(std::move(block1));
block1.clear(); // NOLINT testing post-move behavior
EXPECT_TRUE(block1.empty());
@@ -151,7 +150,7 @@ TEST(SpdyHeaderBlockTest, MovedFromIsValid) {
block1["foo"] = "bar";
EXPECT_THAT(block1, ElementsAre(Pair("foo", "bar")));
- SpdyHeaderBlock block5 = ReturnTestHeaderBlock();
+ Http2HeaderBlock block5 = ReturnTestHeaderBlock();
block5.AppendValueOrAddHeader("foo", "bar2");
EXPECT_THAT(block5, ElementsAre(Pair("foo", std::string("bar\0bar2", 8)),
Pair("foo2", "baz")));
@@ -159,8 +158,8 @@ TEST(SpdyHeaderBlockTest, MovedFromIsValid) {
// This test verifies that headers can be appended to no matter how they were
// added originally.
-TEST(SpdyHeaderBlockTest, AppendHeaders) {
- SpdyHeaderBlock block;
+TEST(Http2HeaderBlockTest, AppendHeaders) {
+ Http2HeaderBlock block;
block["foo"] = "foo";
block.AppendValueOrAddHeader("foo", "bar");
EXPECT_EQ(Pair("foo", std::string("foo\0bar", 7)), *block.find("foo"));
@@ -193,31 +192,31 @@ TEST(SpdyHeaderBlockTest, AppendHeaders) {
EXPECT_EQ("singleton", block["h4"]);
}
-TEST(SpdyHeaderBlockTest, CompareValueToStringPiece) {
- SpdyHeaderBlock block;
+TEST(Http2HeaderBlockTest, CompareValueToStringPiece) {
+ Http2HeaderBlock block;
block["foo"] = "foo";
block.AppendValueOrAddHeader("foo", "bar");
const auto& val = block["foo"];
const char expected[] = "foo\0bar";
- EXPECT_TRUE(quiche::QuicheStringPiece(expected, 7) == val);
- EXPECT_TRUE(val == quiche::QuicheStringPiece(expected, 7));
- EXPECT_FALSE(quiche::QuicheStringPiece(expected, 3) == val);
- EXPECT_FALSE(val == quiche::QuicheStringPiece(expected, 3));
+ EXPECT_TRUE(absl::string_view(expected, 7) == val);
+ EXPECT_TRUE(val == absl::string_view(expected, 7));
+ EXPECT_FALSE(absl::string_view(expected, 3) == val);
+ EXPECT_FALSE(val == absl::string_view(expected, 3));
const char not_expected[] = "foo\0barextra";
- EXPECT_FALSE(quiche::QuicheStringPiece(not_expected, 12) == val);
- EXPECT_FALSE(val == quiche::QuicheStringPiece(not_expected, 12));
+ EXPECT_FALSE(absl::string_view(not_expected, 12) == val);
+ EXPECT_FALSE(val == absl::string_view(not_expected, 12));
const auto& val2 = block["foo2"];
- EXPECT_FALSE(quiche::QuicheStringPiece(expected, 7) == val2);
- EXPECT_FALSE(val2 == quiche::QuicheStringPiece(expected, 7));
- EXPECT_FALSE(quiche::QuicheStringPiece("") == val2);
- EXPECT_FALSE(val2 == quiche::QuicheStringPiece(""));
+ EXPECT_FALSE(absl::string_view(expected, 7) == val2);
+ EXPECT_FALSE(val2 == absl::string_view(expected, 7));
+ EXPECT_FALSE(absl::string_view("") == val2);
+ EXPECT_FALSE(val2 == absl::string_view(""));
}
-// This test demonstrates that the SpdyHeaderBlock data structure does not place
-// any limitations on the characters present in the header names.
-TEST(SpdyHeaderBlockTest, UpperCaseNames) {
- SpdyHeaderBlock block;
+// This test demonstrates that the Http2HeaderBlock data structure does not
+// place any limitations on the characters present in the header names.
+TEST(Http2HeaderBlockTest, UpperCaseNames) {
+ Http2HeaderBlock block;
block["Foo"] = "foo";
block.AppendValueOrAddHeader("Foo", "bar");
EXPECT_NE(block.end(), block.find("foo"));
@@ -231,7 +230,7 @@ TEST(SpdyHeaderBlockTest, UpperCaseNames) {
}
namespace {
-size_t SpdyHeaderBlockSize(const SpdyHeaderBlock& block) {
+size_t Http2HeaderBlockSize(const Http2HeaderBlock& block) {
size_t size = 0;
for (const auto& pair : block) {
size += pair.first.size() + pair.second.size();
@@ -240,38 +239,38 @@ size_t SpdyHeaderBlockSize(const SpdyHeaderBlock& block) {
}
} // namespace
-// Tests SpdyHeaderBlock SizeEstimate().
-TEST(SpdyHeaderBlockTest, TotalBytesUsed) {
- SpdyHeaderBlock block;
+// Tests Http2HeaderBlock SizeEstimate().
+TEST(Http2HeaderBlockTest, TotalBytesUsed) {
+ Http2HeaderBlock block;
const size_t value_size = 300;
block["foo"] = std::string(value_size, 'x');
- EXPECT_EQ(block.TotalBytesUsed(), SpdyHeaderBlockSize(block));
+ EXPECT_EQ(block.TotalBytesUsed(), Http2HeaderBlockSize(block));
block.insert(std::make_pair("key", std::string(value_size, 'x')));
- EXPECT_EQ(block.TotalBytesUsed(), SpdyHeaderBlockSize(block));
+ EXPECT_EQ(block.TotalBytesUsed(), Http2HeaderBlockSize(block));
block.AppendValueOrAddHeader("abc", std::string(value_size, 'x'));
- EXPECT_EQ(block.TotalBytesUsed(), SpdyHeaderBlockSize(block));
+ EXPECT_EQ(block.TotalBytesUsed(), Http2HeaderBlockSize(block));
// Replace value for existing key.
block["foo"] = std::string(value_size, 'x');
- EXPECT_EQ(block.TotalBytesUsed(), SpdyHeaderBlockSize(block));
+ EXPECT_EQ(block.TotalBytesUsed(), Http2HeaderBlockSize(block));
block.insert(std::make_pair("key", std::string(value_size, 'x')));
- EXPECT_EQ(block.TotalBytesUsed(), SpdyHeaderBlockSize(block));
+ EXPECT_EQ(block.TotalBytesUsed(), Http2HeaderBlockSize(block));
// Add value for existing key.
block.AppendValueOrAddHeader("abc", std::string(value_size, 'x'));
- EXPECT_EQ(block.TotalBytesUsed(), SpdyHeaderBlockSize(block));
+ EXPECT_EQ(block.TotalBytesUsed(), Http2HeaderBlockSize(block));
- // Copies/clones SpdyHeaderBlock.
+ // Copies/clones Http2HeaderBlock.
size_t block_size = block.TotalBytesUsed();
- SpdyHeaderBlock block_copy = std::move(block);
+ Http2HeaderBlock block_copy = std::move(block);
EXPECT_EQ(block_size, block_copy.TotalBytesUsed());
// Erases key.
block_copy.erase("foo");
- EXPECT_EQ(block_copy.TotalBytesUsed(), SpdyHeaderBlockSize(block_copy));
+ EXPECT_EQ(block_copy.TotalBytesUsed(), Http2HeaderBlockSize(block_copy));
block_copy.erase("key");
- EXPECT_EQ(block_copy.TotalBytesUsed(), SpdyHeaderBlockSize(block_copy));
+ EXPECT_EQ(block_copy.TotalBytesUsed(), Http2HeaderBlockSize(block_copy));
block_copy.erase("abc");
- EXPECT_EQ(block_copy.TotalBytesUsed(), SpdyHeaderBlockSize(block_copy));
+ EXPECT_EQ(block_copy.TotalBytesUsed(), Http2HeaderBlockSize(block_copy));
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.cc
index 90493e11b5a..29ed0a45b87 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.cc
@@ -14,34 +14,33 @@ const size_t kDefaultStorageBlockSize = 2048;
SpdyHeaderStorage::SpdyHeaderStorage() : arena_(kDefaultStorageBlockSize) {}
-quiche::QuicheStringPiece SpdyHeaderStorage::Write(
- const quiche::QuicheStringPiece s) {
- return quiche::QuicheStringPiece(arena_.Memdup(s.data(), s.size()), s.size());
+absl::string_view SpdyHeaderStorage::Write(const absl::string_view s) {
+ return absl::string_view(arena_.Memdup(s.data(), s.size()), s.size());
}
-void SpdyHeaderStorage::Rewind(const quiche::QuicheStringPiece s) {
+void SpdyHeaderStorage::Rewind(const absl::string_view s) {
arena_.Free(const_cast<char*>(s.data()), s.size());
}
-quiche::QuicheStringPiece SpdyHeaderStorage::WriteFragments(
- const std::vector<quiche::QuicheStringPiece>& fragments,
- quiche::QuicheStringPiece separator) {
+absl::string_view SpdyHeaderStorage::WriteFragments(
+ const std::vector<absl::string_view>& fragments,
+ absl::string_view separator) {
if (fragments.empty()) {
- return quiche::QuicheStringPiece();
+ return absl::string_view();
}
size_t total_size = separator.size() * (fragments.size() - 1);
- for (const quiche::QuicheStringPiece& fragment : fragments) {
+ for (const absl::string_view& fragment : fragments) {
total_size += fragment.size();
}
char* dst = arena_.Alloc(total_size);
size_t written = Join(dst, fragments, separator);
DCHECK_EQ(written, total_size);
- return quiche::QuicheStringPiece(dst, total_size);
+ return absl::string_view(dst, total_size);
}
size_t Join(char* dst,
- const std::vector<quiche::QuicheStringPiece>& fragments,
- quiche::QuicheStringPiece separator) {
+ const std::vector<absl::string_view>& fragments,
+ absl::string_view separator) {
if (fragments.empty()) {
return 0;
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.h
index aace3c06ab4..4e5a6abe7ef 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage.h
@@ -1,15 +1,15 @@
#ifndef QUICHE_SPDY_CORE_SPDY_HEADER_STORAGE_H_
#define QUICHE_SPDY_CORE_SPDY_HEADER_STORAGE_H_
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_simple_arena.h"
namespace spdy {
-// This class provides a backing store for QuicheStringPieces. It previously
+// This class provides a backing store for absl::string_views. It previously
// used custom allocation logic, but now uses an UnsafeArena instead. It has the
-// property that QuicheStringPieces that refer to data in SpdyHeaderStorage are
+// property that absl::string_views that refer to data in SpdyHeaderStorage are
// never invalidated until the SpdyHeaderStorage is deleted or Clear() is
// called.
//
@@ -26,20 +26,20 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderStorage {
SpdyHeaderStorage(SpdyHeaderStorage&& other) = default;
SpdyHeaderStorage& operator=(SpdyHeaderStorage&& other) = default;
- quiche::QuicheStringPiece Write(quiche::QuicheStringPiece s);
+ absl::string_view Write(absl::string_view s);
// If |s| points to the most recent allocation from arena_, the arena will
// reclaim the memory. Otherwise, this method is a no-op.
- void Rewind(quiche::QuicheStringPiece s);
+ void Rewind(absl::string_view s);
void Clear() { arena_.Reset(); }
// Given a list of fragments and a separator, writes the fragments joined by
- // the separator to a contiguous region of memory. Returns a QuicheStringPiece
+ // the separator to a contiguous region of memory. Returns a absl::string_view
// pointing to the region of memory.
- quiche::QuicheStringPiece WriteFragments(
- const std::vector<quiche::QuicheStringPiece>& fragments,
- quiche::QuicheStringPiece separator);
+ absl::string_view WriteFragments(
+ const std::vector<absl::string_view>& fragments,
+ absl::string_view separator);
size_t bytes_allocated() const { return arena_.status().bytes_allocated(); }
@@ -53,8 +53,8 @@ class QUICHE_EXPORT_PRIVATE SpdyHeaderStorage {
// enough to hold the result. Returns the number of bytes written.
QUICHE_EXPORT_PRIVATE size_t
Join(char* dst,
- const std::vector<quiche::QuicheStringPiece>& fragments,
- quiche::QuicheStringPiece separator);
+ const std::vector<absl::string_view>& fragments,
+ absl::string_view separator);
} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage_test.cc
index 71af6be43aa..af8cd06bb5a 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_header_storage_test.cc
@@ -6,29 +6,29 @@ namespace spdy {
namespace test {
TEST(JoinTest, JoinEmpty) {
- std::vector<quiche::QuicheStringPiece> empty;
- quiche::QuicheStringPiece separator = ", ";
+ std::vector<absl::string_view> empty;
+ absl::string_view separator = ", ";
char buf[10] = "";
size_t written = Join(buf, empty, separator);
EXPECT_EQ(0u, written);
}
TEST(JoinTest, JoinOne) {
- std::vector<quiche::QuicheStringPiece> v = {"one"};
- quiche::QuicheStringPiece separator = ", ";
+ std::vector<absl::string_view> v = {"one"};
+ absl::string_view separator = ", ";
char buf[15];
size_t written = Join(buf, v, separator);
EXPECT_EQ(3u, written);
- EXPECT_EQ("one", quiche::QuicheStringPiece(buf, written));
+ EXPECT_EQ("one", absl::string_view(buf, written));
}
TEST(JoinTest, JoinMultiple) {
- std::vector<quiche::QuicheStringPiece> v = {"one", "two", "three"};
- quiche::QuicheStringPiece separator = ", ";
+ std::vector<absl::string_view> v = {"one", "two", "three"};
+ absl::string_view separator = ", ";
char buf[15];
size_t written = Join(buf, v, separator);
EXPECT_EQ(15u, written);
- EXPECT_EQ("one, two, three", quiche::QuicheStringPiece(buf, written));
+ EXPECT_EQ("one, two, three", absl::string_view(buf, written));
}
} // namespace test
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h
index 870997758be..39bda07dc6b 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h
@@ -7,8 +7,8 @@
#include <stddef.h>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace spdy {
@@ -25,8 +25,7 @@ class QUICHE_EXPORT_PRIVATE SpdyHeadersHandlerInterface {
// A callback method which notifies on a header key value pair. Multiple
// values for a given key will be emitted as multiple calls to OnHeader.
- virtual void OnHeader(quiche::QuicheStringPiece key,
- quiche::QuicheStringPiece value) = 0;
+ virtual void OnHeader(absl::string_view key, absl::string_view value) = 0;
// A callback method which notifies when the parser finishes handling a
// header block (i.e. the containing frame has the END_HEADERS flag set).
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_intrusive_list_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_intrusive_list_test.cc
index e158d44a7f3..5f5243bddb3 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_intrusive_list_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_intrusive_list_test.cc
@@ -409,8 +409,7 @@ TEST(NewIntrusiveListTest, HandleInheritanceHierarchies) {
}
}
-
-class IntrusiveListTagTypeTest : public testing::Test {
+class IntrusiveListTagTypeTest : public QuicheTest {
protected:
struct Tag {};
class Element : public SpdyIntrusiveLink<Element, Tag> {};
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_no_op_visitor.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_no_op_visitor.h
index 93a32357719..26bab9cba8b 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_no_op_visitor.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_no_op_visitor.h
@@ -11,7 +11,7 @@
#include <cstdint>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/spdy/core/http2_frame_decoder_adapter.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
@@ -61,7 +61,7 @@ class SpdyNoOpVisitor : public SpdyFramerVisitorInterface,
bool /*end*/) override {}
void OnContinuation(SpdyStreamId /*stream_id*/, bool /*end*/) override {}
void OnAltSvc(SpdyStreamId /*stream_id*/,
- quiche::QuicheStringPiece /*origin*/,
+ absl::string_view /*origin*/,
const SpdyAltSvcWireFormat::AlternativeServiceVector&
/*altsvc_vector*/) override {}
void OnPriority(SpdyStreamId /*stream_id*/,
@@ -82,8 +82,8 @@ class SpdyNoOpVisitor : public SpdyFramerVisitorInterface,
// SpdyHeadersHandlerInterface methods:
void OnHeaderBlockStart() override {}
- void OnHeader(quiche::QuicheStringPiece /*key*/,
- quiche::QuicheStringPiece /*value*/) override {}
+ void OnHeader(absl::string_view /*key*/,
+ absl::string_view /*value*/) override {}
void OnHeaderBlockEnd(size_t /* uncompressed_header_bytes */,
size_t /* compressed_header_bytes */) override {}
};
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece.h
index fe9639f73f2..2822410da55 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece.h
@@ -9,8 +9,8 @@
#include <memory>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
namespace spdy {
@@ -27,8 +27,8 @@ struct QUICHE_EXPORT_PRIVATE SpdyPinnableBufferPiece {
const char* buffer() const { return buffer_; }
- explicit operator quiche::QuicheStringPiece() const {
- return quiche::QuicheStringPiece(buffer_, length_);
+ explicit operator absl::string_view() const {
+ return absl::string_view(buffer_, length_);
}
// Allocates and copies the buffer to internal storage.
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece_test.cc
index b30a7c0d916..42329d788a3 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_pinnable_buffer_piece_test.cc
@@ -31,16 +31,14 @@ TEST_F(SpdyPinnableBufferPieceTest, Pin) {
EXPECT_TRUE(reader.ReadN(6, &piece));
// Piece points to underlying prefix storage.
- EXPECT_EQ(quiche::QuicheStringPiece("foobar"),
- quiche::QuicheStringPiece(piece));
+ EXPECT_EQ(absl::string_view("foobar"), absl::string_view(piece));
EXPECT_FALSE(piece.IsPinned());
EXPECT_EQ(prefix_.data(), piece.buffer());
piece.Pin();
// Piece now points to allocated storage.
- EXPECT_EQ(quiche::QuicheStringPiece("foobar"),
- quiche::QuicheStringPiece(piece));
+ EXPECT_EQ(absl::string_view("foobar"), absl::string_view(piece));
EXPECT_TRUE(piece.IsPinned());
EXPECT_NE(prefix_.data(), piece.buffer());
@@ -58,24 +56,22 @@ TEST_F(SpdyPinnableBufferPieceTest, Swap) {
piece1.Pin();
- EXPECT_EQ(quiche::QuicheStringPiece("foob"),
- quiche::QuicheStringPiece(piece1));
+ EXPECT_EQ(absl::string_view("foob"), absl::string_view(piece1));
EXPECT_TRUE(piece1.IsPinned());
- EXPECT_EQ(quiche::QuicheStringPiece("ar"), quiche::QuicheStringPiece(piece2));
+ EXPECT_EQ(absl::string_view("ar"), absl::string_view(piece2));
EXPECT_FALSE(piece2.IsPinned());
piece1.Swap(&piece2);
- EXPECT_EQ(quiche::QuicheStringPiece("ar"), quiche::QuicheStringPiece(piece1));
+ EXPECT_EQ(absl::string_view("ar"), absl::string_view(piece1));
EXPECT_FALSE(piece1.IsPinned());
- EXPECT_EQ(quiche::QuicheStringPiece("foob"),
- quiche::QuicheStringPiece(piece2));
+ EXPECT_EQ(absl::string_view("foob"), absl::string_view(piece2));
EXPECT_TRUE(piece2.IsPinned());
SpdyPinnableBufferPiece empty;
piece2.Swap(&empty);
- EXPECT_EQ(quiche::QuicheStringPiece(""), quiche::QuicheStringPiece(piece2));
+ EXPECT_EQ(absl::string_view(""), absl::string_view(piece2));
EXPECT_FALSE(piece2.IsPinned());
}
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_prefixed_buffer_reader_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_prefixed_buffer_reader_test.cc
index d48fde1abb7..83559567886 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_prefixed_buffer_reader_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_prefixed_buffer_reader_test.cc
@@ -6,7 +6,7 @@
#include <string>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace spdy {
@@ -46,8 +46,7 @@ TEST_F(SpdyPrefixedBufferReaderTest, ReadPieceFromPrefix) {
EXPECT_FALSE(reader.ReadN(10, &piece)); // Not enough buffer.
EXPECT_TRUE(reader.ReadN(6, &piece));
EXPECT_FALSE(piece.IsPinned());
- EXPECT_EQ(quiche::QuicheStringPiece("foobar"),
- quiche::QuicheStringPiece(piece));
+ EXPECT_EQ(absl::string_view("foobar"), absl::string_view(piece));
EXPECT_EQ(0u, reader.Available());
}
@@ -70,8 +69,7 @@ TEST_F(SpdyPrefixedBufferReaderTest, ReadPieceFromSuffix) {
EXPECT_FALSE(reader.ReadN(10, &piece)); // Not enough buffer.
EXPECT_TRUE(reader.ReadN(6, &piece));
EXPECT_FALSE(piece.IsPinned());
- EXPECT_EQ(quiche::QuicheStringPiece("foobar"),
- quiche::QuicheStringPiece(piece));
+ EXPECT_EQ(absl::string_view("foobar"), absl::string_view(piece));
EXPECT_EQ(0u, reader.Available());
}
@@ -94,8 +92,7 @@ TEST_F(SpdyPrefixedBufferReaderTest, ReadPieceSpanning) {
EXPECT_FALSE(reader.ReadN(10, &piece)); // Not enough buffer.
EXPECT_TRUE(reader.ReadN(6, &piece));
EXPECT_TRUE(piece.IsPinned());
- EXPECT_EQ(quiche::QuicheStringPiece("foobar"),
- quiche::QuicheStringPiece(piece));
+ EXPECT_EQ(absl::string_view("foobar"), absl::string_view(piece));
EXPECT_EQ(0u, reader.Available());
}
@@ -115,12 +112,12 @@ TEST_F(SpdyPrefixedBufferReaderTest, ReadMixed) {
EXPECT_EQ(6u, reader.Available());
EXPECT_TRUE(reader.ReadN(3, &piece));
- EXPECT_EQ(quiche::QuicheStringPiece("fhi"), quiche::QuicheStringPiece(piece));
+ EXPECT_EQ(absl::string_view("fhi"), absl::string_view(piece));
EXPECT_TRUE(piece.IsPinned());
EXPECT_EQ(3u, reader.Available());
EXPECT_TRUE(reader.ReadN(2, &piece));
- EXPECT_EQ(quiche::QuicheStringPiece("jk"), quiche::QuicheStringPiece(piece));
+ EXPECT_EQ(absl::string_view("jk"), absl::string_view(piece));
EXPECT_FALSE(piece.IsPinned());
EXPECT_EQ(1u, reader.Available());
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.cc
index a4a72d67325..f9a18007088 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.cc
@@ -276,12 +276,12 @@ bool SpdyFrameWithFinIR::fin() const {
SpdyFrameWithHeaderBlockIR::SpdyFrameWithHeaderBlockIR(
SpdyStreamId stream_id,
- SpdyHeaderBlock header_block)
+ Http2HeaderBlock header_block)
: SpdyFrameWithFinIR(stream_id), header_block_(std::move(header_block)) {}
SpdyFrameWithHeaderBlockIR::~SpdyFrameWithHeaderBlockIR() = default;
-SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, quiche::QuicheStringPiece data)
+SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, absl::string_view data)
: SpdyFrameWithFinIR(stream_id),
data_(nullptr),
data_len_(0),
@@ -291,7 +291,7 @@ SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, quiche::QuicheStringPiece data)
}
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, const char* data)
- : SpdyDataIR(stream_id, quiche::QuicheStringPiece(data)) {}
+ : SpdyDataIR(stream_id, absl::string_view(data)) {}
SpdyDataIR::SpdyDataIR(SpdyStreamId stream_id, std::string data)
: SpdyFrameWithFinIR(stream_id),
@@ -377,7 +377,7 @@ size_t SpdyPingIR::size() const {
SpdyGoAwayIR::SpdyGoAwayIR(SpdyStreamId last_good_stream_id,
SpdyErrorCode error_code,
- quiche::QuicheStringPiece description)
+ absl::string_view description)
: description_(description) {
set_last_good_stream_id(last_good_stream_id);
set_error_code(error_code);
@@ -388,7 +388,7 @@ SpdyGoAwayIR::SpdyGoAwayIR(SpdyStreamId last_good_stream_id,
const char* description)
: SpdyGoAwayIR(last_good_stream_id,
error_code,
- quiche::QuicheStringPiece(description)) {}
+ absl::string_view(description)) {}
SpdyGoAwayIR::SpdyGoAwayIR(SpdyStreamId last_good_stream_id,
SpdyErrorCode error_code,
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.h
index 0bf8bb9d69f..a2b9c4d39ca 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol.h
@@ -19,8 +19,8 @@
#include <string>
#include <utility>
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_export.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
#include "net/third_party/quiche/src/spdy/core/spdy_alt_svc_wire_format.h"
#include "net/third_party/quiche/src/spdy/core/spdy_bitmasks.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
@@ -492,31 +492,30 @@ class QUICHE_EXPORT_PRIVATE SpdyFrameWithHeaderBlockIR
public:
~SpdyFrameWithHeaderBlockIR() override;
- const SpdyHeaderBlock& header_block() const { return header_block_; }
- void set_header_block(SpdyHeaderBlock header_block) {
+ const Http2HeaderBlock& header_block() const { return header_block_; }
+ void set_header_block(Http2HeaderBlock header_block) {
// Deep copy.
header_block_ = std::move(header_block);
}
- void SetHeader(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
+ void SetHeader(absl::string_view name, absl::string_view value) {
header_block_[name] = value;
}
protected:
SpdyFrameWithHeaderBlockIR(SpdyStreamId stream_id,
- SpdyHeaderBlock header_block);
+ Http2HeaderBlock header_block);
SpdyFrameWithHeaderBlockIR(const SpdyFrameWithHeaderBlockIR&) = delete;
SpdyFrameWithHeaderBlockIR& operator=(const SpdyFrameWithHeaderBlockIR&) =
delete;
private:
- SpdyHeaderBlock header_block_;
+ Http2HeaderBlock header_block_;
};
class QUICHE_EXPORT_PRIVATE SpdyDataIR : public SpdyFrameWithFinIR {
public:
// Performs a deep copy on data.
- SpdyDataIR(SpdyStreamId stream_id, quiche::QuicheStringPiece data);
+ SpdyDataIR(SpdyStreamId stream_id, absl::string_view data);
// Performs a deep copy on data.
SpdyDataIR(SpdyStreamId stream_id, const char* data);
@@ -547,14 +546,14 @@ class QUICHE_EXPORT_PRIVATE SpdyDataIR : public SpdyFrameWithFinIR {
}
// Deep-copy of data (keep private copy).
- void SetDataDeep(quiche::QuicheStringPiece data) {
+ void SetDataDeep(absl::string_view data) {
data_store_ = std::make_unique<std::string>(data.data(), data.size());
data_ = data_store_->data();
data_len_ = data.size();
}
// Shallow-copy of data (do not keep private copy).
- void SetDataShallow(quiche::QuicheStringPiece data) {
+ void SetDataShallow(absl::string_view data) {
data_store_.reset();
data_ = data.data();
data_len_ = data.size();
@@ -660,7 +659,7 @@ class QUICHE_EXPORT_PRIVATE SpdyGoAwayIR : public SpdyFrameIR {
// this SpdyGoAwayIR.
SpdyGoAwayIR(SpdyStreamId last_good_stream_id,
SpdyErrorCode error_code,
- quiche::QuicheStringPiece description);
+ absl::string_view description);
// References description, doesn't copy it, so description must outlast
// this SpdyGoAwayIR.
@@ -689,7 +688,7 @@ class QUICHE_EXPORT_PRIVATE SpdyGoAwayIR : public SpdyFrameIR {
error_code_ = error_code;
}
- const quiche::QuicheStringPiece& description() const { return description_; }
+ const absl::string_view& description() const { return description_; }
void Visit(SpdyFrameVisitor* visitor) const override;
@@ -701,14 +700,14 @@ class QUICHE_EXPORT_PRIVATE SpdyGoAwayIR : public SpdyFrameIR {
SpdyStreamId last_good_stream_id_;
SpdyErrorCode error_code_;
const std::string description_store_;
- const quiche::QuicheStringPiece description_;
+ const absl::string_view description_;
};
class QUICHE_EXPORT_PRIVATE SpdyHeadersIR : public SpdyFrameWithHeaderBlockIR {
public:
explicit SpdyHeadersIR(SpdyStreamId stream_id)
- : SpdyHeadersIR(stream_id, SpdyHeaderBlock()) {}
- SpdyHeadersIR(SpdyStreamId stream_id, SpdyHeaderBlock header_block)
+ : SpdyHeadersIR(stream_id, Http2HeaderBlock()) {}
+ SpdyHeadersIR(SpdyStreamId stream_id, Http2HeaderBlock header_block)
: SpdyFrameWithHeaderBlockIR(stream_id, std::move(header_block)) {}
SpdyHeadersIR(const SpdyHeadersIR&) = delete;
SpdyHeadersIR& operator=(const SpdyHeadersIR&) = delete;
@@ -776,10 +775,10 @@ class QUICHE_EXPORT_PRIVATE SpdyPushPromiseIR
: public SpdyFrameWithHeaderBlockIR {
public:
SpdyPushPromiseIR(SpdyStreamId stream_id, SpdyStreamId promised_stream_id)
- : SpdyPushPromiseIR(stream_id, promised_stream_id, SpdyHeaderBlock()) {}
+ : SpdyPushPromiseIR(stream_id, promised_stream_id, Http2HeaderBlock()) {}
SpdyPushPromiseIR(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
- SpdyHeaderBlock header_block)
+ Http2HeaderBlock header_block)
: SpdyFrameWithHeaderBlockIR(stream_id, std::move(header_block)),
promised_stream_id_(promised_stream_id),
padded_(false),
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test.cc
index c952bce0677..f4cbc42cc8d 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test.cc
@@ -226,8 +226,8 @@ TEST(SpdyStreamPrecedenceTest, Equals) {
TEST(SpdyDataIRTest, Construct) {
// Confirm that it makes a string of zero length from a
- // QuicheStringPiece(nullptr).
- quiche::QuicheStringPiece s1;
+ // absl::string_view(nullptr).
+ absl::string_view s1;
SpdyDataIR d1(/* stream_id = */ 1, s1);
EXPECT_EQ(0u, d1.data_len());
EXPECT_NE(nullptr, d1.data());
@@ -235,8 +235,8 @@ TEST(SpdyDataIRTest, Construct) {
// Confirms makes a copy of char array.
const char s2[] = "something";
SpdyDataIR d2(/* stream_id = */ 2, s2);
- EXPECT_EQ(quiche::QuicheStringPiece(d2.data(), d2.data_len()), s2);
- EXPECT_NE(quiche::QuicheStringPiece(d1.data(), d1.data_len()), s2);
+ EXPECT_EQ(absl::string_view(d2.data(), d2.data_len()), s2);
+ EXPECT_NE(absl::string_view(d1.data(), d1.data_len()), s2);
EXPECT_EQ((int)d1.data_len(), d1.flow_control_window_consumed());
// Confirm copies a const string.
@@ -249,20 +249,18 @@ TEST(SpdyDataIRTest, Construct) {
std::string bar = "bar";
SpdyDataIR d4(/* stream_id = */ 4, bar);
EXPECT_EQ("bar", bar);
- EXPECT_EQ("bar", quiche::QuicheStringPiece(d4.data(), d4.data_len()));
+ EXPECT_EQ("bar", absl::string_view(d4.data(), d4.data_len()));
// Confirm moves an rvalue reference. Note that the test string "baz" is too
// short to trigger the move optimization, and instead a copy occurs.
std::string baz = "the quick brown fox";
SpdyDataIR d5(/* stream_id = */ 5, std::move(baz));
EXPECT_EQ("", baz);
- EXPECT_EQ(quiche::QuicheStringPiece(d5.data(), d5.data_len()),
- "the quick brown fox");
+ EXPECT_EQ(absl::string_view(d5.data(), d5.data_len()), "the quick brown fox");
// Confirms makes a copy of string literal.
SpdyDataIR d7(/* stream_id = */ 7, "something else");
- EXPECT_EQ(quiche::QuicheStringPiece(d7.data(), d7.data_len()),
- "something else");
+ EXPECT_EQ(absl::string_view(d7.data(), d7.data_len()), "something else");
SpdyDataIR d8(/* stream_id = */ 8, "shawarma");
d8.set_padding_len(20);
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.cc
index 7390f50bdc6..37199f646d1 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_protocol_test_utils.cc
@@ -6,7 +6,7 @@
#include <cstdint>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
namespace spdy {
namespace test {
@@ -47,8 +47,8 @@ namespace test {
if (expected.data() == nullptr) {
VERIFY_EQ(nullptr, actual.data());
} else {
- VERIFY_EQ(quiche::QuicheStringPiece(expected.data(), expected.data_len()),
- quiche::QuicheStringPiece(actual.data(), actual.data_len()));
+ VERIFY_EQ(absl::string_view(expected.data(), expected.data_len()),
+ absl::string_view(actual.data(), actual.data_len()));
}
VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual));
return ::testing::AssertionSuccess();
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_simple_arena_test.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_simple_arena_test.cc
index 7e66567b78f..b9e9f757168 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_simple_arena_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_simple_arena_test.cc
@@ -7,7 +7,7 @@
#include <string>
#include <vector>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace spdy {
@@ -27,7 +27,7 @@ TEST(SpdySimpleArenaTest, Memdup) {
char* c = arena.Memdup(kTestString, length);
EXPECT_NE(nullptr, c);
EXPECT_NE(c, kTestString);
- EXPECT_EQ(quiche::QuicheStringPiece(c, length), kTestString);
+ EXPECT_EQ(absl::string_view(c, length), kTestString);
}
TEST(SpdySimpleArenaTest, MemdupLargeString) {
@@ -36,7 +36,7 @@ TEST(SpdySimpleArenaTest, MemdupLargeString) {
char* c = arena.Memdup(kTestString, length);
EXPECT_NE(nullptr, c);
EXPECT_NE(c, kTestString);
- EXPECT_EQ(quiche::QuicheStringPiece(c, length), kTestString);
+ EXPECT_EQ(absl::string_view(c, length), kTestString);
}
TEST(SpdySimpleArenaTest, MultipleBlocks) {
@@ -44,9 +44,9 @@ TEST(SpdySimpleArenaTest, MultipleBlocks) {
std::vector<std::string> strings = {
"One decently long string.", "Another string.",
"A third string that will surely go in a different block."};
- std::vector<quiche::QuicheStringPiece> copies;
+ std::vector<absl::string_view> copies;
for (const std::string& s : strings) {
- quiche::QuicheStringPiece sp(arena.Memdup(s.data(), s.size()), s.size());
+ absl::string_view sp(arena.Memdup(s.data(), s.size()), s.size());
copies.push_back(sp);
}
EXPECT_EQ(strings.size(), copies.size());
@@ -63,7 +63,7 @@ TEST(SpdySimpleArenaTest, UseAfterReset) {
c = arena.Memdup(kTestString, length);
EXPECT_NE(nullptr, c);
EXPECT_NE(c, kTestString);
- EXPECT_EQ(quiche::QuicheStringPiece(c, length), kTestString);
+ EXPECT_EQ(absl::string_view(c, length), kTestString);
}
TEST(SpdySimpleArenaTest, Free) {
@@ -102,7 +102,7 @@ TEST(SpdySimpleArenaTest, Alloc) {
EXPECT_EQ(c1 + length, c2);
EXPECT_EQ(c2 + 2 * length, c3);
EXPECT_EQ(c3 + 3 * length, c4);
- EXPECT_EQ(quiche::QuicheStringPiece(c4, length), kTestString);
+ EXPECT_EQ(absl::string_view(c4, length), kTestString);
}
TEST(SpdySimpleArenaTest, Realloc) {
@@ -113,28 +113,28 @@ TEST(SpdySimpleArenaTest, Realloc) {
char* c2 = arena.Realloc(c1, length, 2 * length);
EXPECT_TRUE(c1);
EXPECT_EQ(c1, c2);
- EXPECT_EQ(quiche::QuicheStringPiece(c1, length), kTestString);
+ EXPECT_EQ(absl::string_view(c1, length), kTestString);
// Multiple reallocs.
char* c3 = arena.Memdup(kTestString, length);
EXPECT_EQ(c2 + 2 * length, c3);
- EXPECT_EQ(quiche::QuicheStringPiece(c3, length), kTestString);
+ EXPECT_EQ(absl::string_view(c3, length), kTestString);
char* c4 = arena.Realloc(c3, length, 2 * length);
EXPECT_EQ(c3, c4);
- EXPECT_EQ(quiche::QuicheStringPiece(c4, length), kTestString);
+ EXPECT_EQ(absl::string_view(c4, length), kTestString);
char* c5 = arena.Realloc(c4, 2 * length, 3 * length);
EXPECT_EQ(c4, c5);
- EXPECT_EQ(quiche::QuicheStringPiece(c5, length), kTestString);
+ EXPECT_EQ(absl::string_view(c5, length), kTestString);
char* c6 = arena.Memdup(kTestString, length);
EXPECT_EQ(c5 + 3 * length, c6);
- EXPECT_EQ(quiche::QuicheStringPiece(c6, length), kTestString);
+ EXPECT_EQ(absl::string_view(c6, length), kTestString);
// Realloc that does not fit in the remainder of the first block.
char* c7 = arena.Realloc(c6, length, kDefaultBlockSize);
- EXPECT_EQ(quiche::QuicheStringPiece(c7, length), kTestString);
+ EXPECT_EQ(absl::string_view(c7, length), kTestString);
arena.Free(c7, kDefaultBlockSize);
char* c8 = arena.Memdup(kTestString, length);
EXPECT_NE(c6, c7);
EXPECT_EQ(c7, c8);
- EXPECT_EQ(quiche::QuicheStringPiece(c8, length), kTestString);
+ EXPECT_EQ(absl::string_view(c8, length), kTestString);
}
} // namespace
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.cc b/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.cc
index 1d8db971f9c..5372bcdbf73 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.cc
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.cc
@@ -12,7 +12,7 @@
#include <vector>
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h"
+#include "net/third_party/quiche/src/common/quiche_endian.h"
#include "net/third_party/quiche/src/spdy/platform/api/spdy_logging.h"
namespace spdy {
@@ -95,26 +95,10 @@ void SetFrameFlags(SpdySerializedFrame* frame, uint8_t flags) {
void SetFrameLength(SpdySerializedFrame* frame, size_t length) {
CHECK_GT(1u << 14, length);
{
- int32_t wire_length = SpdyHostToNet32(length);
+ int32_t wire_length = quiche::QuicheEndian::HostToNet32(length);
memcpy(frame->data(), reinterpret_cast<char*>(&wire_length) + 1, 3);
}
}
-void TestHeadersHandler::OnHeaderBlockStart() {
- block_.clear();
-}
-
-void TestHeadersHandler::OnHeader(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) {
- block_.AppendValueOrAddHeader(name, value);
-}
-
-void TestHeadersHandler::OnHeaderBlockEnd(
- size_t header_bytes_parsed,
- size_t compressed_header_bytes_parsed) {
- header_bytes_parsed_ = header_bytes_parsed;
- compressed_header_bytes_parsed_ = compressed_header_bytes_parsed;
-}
-
} // namespace test
} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.h b/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.h
index b3c3aa5d38b..920838eb301 100644
--- a/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.h
+++ b/chromium/net/third_party/quiche/src/spdy/core/spdy_test_utils.h
@@ -9,16 +9,14 @@
#include <cstdint>
#include <string>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/spdy/core/spdy_header_block.h"
-#include "net/third_party/quiche/src/spdy/core/spdy_headers_handler_interface.h"
#include "net/third_party/quiche/src/spdy/core/spdy_protocol.h"
-#include "net/third_party/quiche/src/spdy/platform/api/spdy_bug_tracker.h"
namespace spdy {
-inline bool operator==(quiche::QuicheStringPiece x,
- const SpdyHeaderBlock::ValueProxy& y) {
+inline bool operator==(absl::string_view x,
+ const Http2HeaderBlock::ValueProxy& y) {
return y.operator==(x);
}
@@ -39,34 +37,6 @@ void SetFrameFlags(SpdySerializedFrame* frame, uint8_t flags);
void SetFrameLength(SpdySerializedFrame* frame, size_t length);
-// A test implementation of SpdyHeadersHandlerInterface that correctly
-// reconstructs multiple header values for the same name.
-class TestHeadersHandler : public SpdyHeadersHandlerInterface {
- public:
- TestHeadersHandler() {}
- TestHeadersHandler(const TestHeadersHandler&) = delete;
- TestHeadersHandler& operator=(const TestHeadersHandler&) = delete;
-
- void OnHeaderBlockStart() override;
-
- void OnHeader(quiche::QuicheStringPiece name,
- quiche::QuicheStringPiece value) override;
-
- void OnHeaderBlockEnd(size_t header_bytes_parsed,
- size_t compressed_header_bytes_parsed) override;
-
- const SpdyHeaderBlock& decoded_block() const { return block_; }
- size_t header_bytes_parsed() const { return header_bytes_parsed_; }
- size_t compressed_header_bytes_parsed() const {
- return compressed_header_bytes_parsed_;
- }
-
- private:
- SpdyHeaderBlock block_;
- size_t header_bytes_parsed_ = 0;
- size_t compressed_header_bytes_parsed_ = 0;
-};
-
} // namespace test
} // namespace spdy
diff --git a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h b/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h
deleted file mode 100644
index e4074d710ce..00000000000
--- a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_endianness_util.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef QUICHE_SPDY_PLATFORM_API_SPDY_ENDIANNESS_UTIL_H_
-#define QUICHE_SPDY_PLATFORM_API_SPDY_ENDIANNESS_UTIL_H_
-
-#include <stdint.h>
-
-#include "net/spdy/platform/impl/spdy_endianness_util_impl.h"
-
-namespace spdy {
-
-// Converts the bytes in |x| from network to host order (endianness), and
-// returns the result.
-inline uint16_t SpdyNetToHost16(uint16_t x) {
- return SpdyNetToHost16Impl(x);
-}
-
-inline uint32_t SpdyNetToHost32(uint32_t x) {
- return SpdyNetToHost32Impl(x);
-}
-
-inline uint64_t SpdyNetToHost64(uint64_t x) {
- return SpdyNetToHost64Impl(x);
-}
-
-// Converts the bytes in |x| from host to network order (endianness), and
-// returns the result.
-inline uint16_t SpdyHostToNet16(uint16_t x) {
- return SpdyHostToNet16Impl(x);
-}
-
-inline uint32_t SpdyHostToNet32(uint32_t x) {
- return SpdyHostToNet32Impl(x);
-}
-
-inline uint64_t SpdyHostToNet64(uint64_t x) {
- return SpdyHostToNet64Impl(x);
-}
-
-} // namespace spdy
-
-#endif // QUICHE_SPDY_PLATFORM_API_SPDY_ENDIANNESS_UTIL_H_
diff --git a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_mem_slice_test.cc b/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_mem_slice_test.cc
index 84313b0a7b2..fa41b5e4dd7 100644
--- a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_mem_slice_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_mem_slice_test.cc
@@ -6,17 +6,13 @@
#include <utility>
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Weverything"
-
-#include "testing/gtest/include/gtest/gtest.h"
-#pragma clang diagnostic pop
+#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace spdy {
namespace test {
namespace {
-class SpdyMemSliceTest : public ::testing::Test {
+class SpdyMemSliceTest : public QuicheTest {
public:
SpdyMemSliceTest() {
slice_ = SpdyMemSlice(1024);
diff --git a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h b/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h
index b023f733e04..e7ee6a9ca98 100644
--- a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h
+++ b/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils.h
@@ -14,7 +14,7 @@
// non-test code.
#include "net/third_party/quiche/src/spdy/platform/api/spdy_mem_slice.h"
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/spdy/platform/impl/spdy_string_utils_impl.h"
namespace spdy {
@@ -28,12 +28,11 @@ inline char SpdyHexDigitToInt(char c) {
return SpdyHexDigitToIntImpl(c);
}
-inline std::string SpdyHexDecode(quiche::QuicheStringPiece data) {
+inline std::string SpdyHexDecode(absl::string_view data) {
return SpdyHexDecodeImpl(data);
}
-inline bool SpdyHexDecodeToUInt32(quiche::QuicheStringPiece data,
- uint32_t* out) {
+inline bool SpdyHexDecodeToUInt32(absl::string_view data, uint32_t* out) {
return SpdyHexDecodeToUInt32Impl(data, out);
}
@@ -45,7 +44,7 @@ inline std::string SpdyHexEncodeUInt32AndTrim(uint32_t data) {
return SpdyHexEncodeUInt32AndTrimImpl(data);
}
-inline std::string SpdyHexDump(quiche::QuicheStringPiece data) {
+inline std::string SpdyHexDump(absl::string_view data) {
return SpdyHexDumpImpl(data);
}
diff --git a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils_test.cc b/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils_test.cc
index 4848bf0a54a..2f8c0220e84 100644
--- a/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils_test.cc
+++ b/chromium/net/third_party/quiche/src/spdy/platform/api/spdy_string_utils_test.cc
@@ -6,7 +6,7 @@
#include <cstdint>
-#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
+#include "absl/strings/string_view.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_test.h"
namespace spdy {
@@ -22,7 +22,7 @@ TEST(SpdyStringUtilsTest, SpdyStrAppend) {
// Single string-like argument.
const char kFoo[] = "foo";
const std::string string_foo(kFoo);
- const quiche::QuicheStringPiece stringpiece_foo(string_foo);
+ const absl::string_view stringpiece_foo(string_foo);
SpdyStrAppend(&output, kFoo);
EXPECT_EQ("foo", output);
SpdyStrAppend(&output, string_foo);
@@ -38,7 +38,7 @@ TEST(SpdyStringUtilsTest, SpdyStrAppend) {
// Two string-like arguments.
const char kBar[] = "bar";
- const quiche::QuicheStringPiece stringpiece_bar(kBar);
+ const absl::string_view stringpiece_bar(kBar);
const std::string string_bar(kBar);
SpdyStrAppend(&output, kFoo, kBar);
EXPECT_EQ("foobar", output);
diff --git a/chromium/net/third_party/uri_template/DIR_METADATA b/chromium/net/third_party/uri_template/DIR_METADATA
new file mode 100644
index 00000000000..23af0ebe901
--- /dev/null
+++ b/chromium/net/third_party/uri_template/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>DNS"
+} \ No newline at end of file
diff --git a/chromium/net/third_party/uri_template/OWNERS b/chromium/net/third_party/uri_template/OWNERS
index 3c466ff27a9..53e68eb7787 100644
--- a/chromium/net/third_party/uri_template/OWNERS
+++ b/chromium/net/third_party/uri_template/OWNERS
@@ -1,3 +1 @@
mmenke@chromium.org
-
-# COMPONENT: Internals>Network>DNS
diff --git a/chromium/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc b/chromium/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc
index 7abb217e250..63b42fb555c 100644
--- a/chromium/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc
+++ b/chromium/net/tools/dns_fuzz_stub/dns_fuzz_stub.cc
@@ -15,6 +15,7 @@
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
+#include "base/optional.h"
#include "base/time/time.h"
#include "base/values.h"
#include "net/base/address_list.h"
@@ -153,7 +154,7 @@ void RunTestCase(uint16_t id,
}
net::AddressList address_list;
- base::TimeDelta ttl;
+ base::Optional<base::TimeDelta> ttl;
net::DnsResponse::Result result = response.ParseToAddressList(
&address_list, &ttl);
if (result != net::DnsResponse::DNS_PARSE_OK) {
@@ -166,7 +167,8 @@ void RunTestCase(uint16_t id,
result_line << "Response: address_list={ ";
for (unsigned int i = 0; i < address_list.size(); i++)
result_line << address_list[i].ToString() << " ";
- result_line << "}, ttl=" << ttl.InSeconds() << "s";
+ result_line << "}, ttl=" << ttl.value_or(base::TimeDelta()).InSeconds()
+ << "s";
LOG(INFO) << result_line.str();
}
diff --git a/chromium/net/tools/quic/DIR_METADATA b/chromium/net/tools/quic/DIR_METADATA
new file mode 100644
index 00000000000..123352d107a
--- /dev/null
+++ b/chromium/net/tools/quic/DIR_METADATA
@@ -0,0 +1,11 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Internals>Network>QUIC"
+} \ No newline at end of file
diff --git a/chromium/net/tools/quic/OWNERS b/chromium/net/tools/quic/OWNERS
index e2c377d23b0..99494587900 100644
--- a/chromium/net/tools/quic/OWNERS
+++ b/chromium/net/tools/quic/OWNERS
@@ -1,3 +1 @@
file://net/quic/OWNERS
-
-# COMPONENT: Internals>Network>QUIC
diff --git a/chromium/net/tools/quic/crypto_message_printer_bin.cc b/chromium/net/tools/quic/crypto_message_printer_bin.cc
index 04833fd00b2..905a7e9ad02 100644
--- a/chromium/net/tools/quic/crypto_message_printer_bin.cc
+++ b/chromium/net/tools/quic/crypto_message_printer_bin.cc
@@ -50,7 +50,7 @@ int main(int argc, char* argv[]) {
quic::CryptoFramer framer;
framer.set_visitor(&printer);
framer.set_process_truncated_messages(true);
- std::string input = quiche::QuicheTextUtils::HexDecode(argv[1]);
+ std::string input = absl::HexStringToBytes(argv[1]);
if (!framer.ProcessInput(input)) {
return 1;
}
diff --git a/chromium/net/tools/quic/quic_http_proxy_backend.cc b/chromium/net/tools/quic/quic_http_proxy_backend.cc
index f2c757a9471..2ce00818846 100644
--- a/chromium/net/tools/quic/quic_http_proxy_backend.cc
+++ b/chromium/net/tools/quic/quic_http_proxy_backend.cc
@@ -82,7 +82,7 @@ bool QuicHttpProxyBackend::IsBackendInitialized() const {
}
void QuicHttpProxyBackend::FetchResponseFromBackend(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& incoming_body,
QuicSimpleServerBackend::RequestHandler* quic_server_stream) {
QuicHttpProxyBackendStream* proxy_backend_stream =
diff --git a/chromium/net/tools/quic/quic_http_proxy_backend.h b/chromium/net/tools/quic/quic_http_proxy_backend.h
index 32d9d6bb4bf..8f4d25440db 100644
--- a/chromium/net/tools/quic/quic_http_proxy_backend.h
+++ b/chromium/net/tools/quic/quic_http_proxy_backend.h
@@ -71,7 +71,7 @@ class QuicHttpProxyBackend : public quic::QuicSimpleServerBackend {
bool InitializeBackend(const std::string& backend_url) override;
bool IsBackendInitialized() const override;
void FetchResponseFromBackend(
- const spdy::SpdyHeaderBlock& request_headers,
+ const spdy::Http2HeaderBlock& request_headers,
const std::string& incoming_body,
quic::QuicSimpleServerBackend::RequestHandler* quic_stream) override;
void CloseBackendResponseStream(
diff --git a/chromium/net/tools/quic/quic_http_proxy_backend_stream.cc b/chromium/net/tools/quic/quic_http_proxy_backend_stream.cc
index 9c535f67b4b..73cfa720d73 100644
--- a/chromium/net/tools/quic/quic_http_proxy_backend_stream.cc
+++ b/chromium/net/tools/quic/quic_http_proxy_backend_stream.cc
@@ -81,13 +81,13 @@ void QuicHttpProxyBackendStream::set_delegate(
}
bool QuicHttpProxyBackendStream::SendRequestToBackend(
- const spdy::SpdyHeaderBlock* incoming_request_headers,
+ const spdy::Http2HeaderBlock* incoming_request_headers,
const std::string& incoming_body) {
DCHECK(proxy_context_->IsBackendInitialized())
<< " The quic-backend-proxy-context should be initialized";
// Get Path From the Incoming Header Block
- spdy::SpdyHeaderBlock::const_iterator it =
+ spdy::Http2HeaderBlock::const_iterator it =
incoming_request_headers->find(":path");
GURL url = proxy_context_->backend_url();
@@ -136,10 +136,10 @@ bool QuicHttpProxyBackendStream::SendRequestToBackend(
}
void QuicHttpProxyBackendStream::CopyHeaders(
- const spdy::SpdyHeaderBlock* incoming_request_headers) {
+ const spdy::Http2HeaderBlock* incoming_request_headers) {
// Set all the request headers
// Add or append the X-Forwarded-For Header and X-Real-IP
- for (spdy::SpdyHeaderBlock::const_iterator it =
+ for (spdy::Http2HeaderBlock::const_iterator it =
incoming_request_headers->begin();
it != incoming_request_headers->end(); ++it) {
auto key = std::string(it->first);
@@ -290,7 +290,7 @@ void QuicHttpProxyBackendStream::OnResponseCompleted() {
<< " url: " << url_;
// ToDo Stream the response
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
if (quic_response_->response_type() !=
quic::QuicBackendResponse::BACKEND_ERR_RESPONSE) {
response_headers = getAsQuicHeaders(url_request_->response_headers(),
@@ -346,13 +346,13 @@ quic::QuicBackendResponse* QuicHttpProxyBackendStream::GetBackendResponse()
}
// Copy Backend Response headers to Quic response headers
-spdy::SpdyHeaderBlock QuicHttpProxyBackendStream::getAsQuicHeaders(
+spdy::Http2HeaderBlock QuicHttpProxyBackendStream::getAsQuicHeaders(
net::HttpResponseHeaders* resp_headers,
int response_code,
uint64_t response_decoded_body_size) {
DCHECK(!headers_set_);
bool response_body_encoded = false;
- spdy::SpdyHeaderBlock quic_response_headers;
+ spdy::Http2HeaderBlock quic_response_headers;
// Add spdy headers: Status, version need : before the header
quic_response_headers[":status"] = base::NumberToString(response_code);
headers_set_ = true;
diff --git a/chromium/net/tools/quic/quic_http_proxy_backend_stream.h b/chromium/net/tools/quic/quic_http_proxy_backend_stream.h
index 80f8e2bc9a5..67c7aafb10a 100644
--- a/chromium/net/tools/quic/quic_http_proxy_backend_stream.h
+++ b/chromium/net/tools/quic/quic_http_proxy_backend_stream.h
@@ -79,7 +79,7 @@ class QuicHttpProxyBackendStream : public net::URLRequest::Delegate {
std::string quic_peer_ip);
virtual bool SendRequestToBackend(
- const spdy::SpdyHeaderBlock* incoming_request_headers,
+ const spdy::Http2HeaderBlock* incoming_request_headers,
const std::string& incoming_body);
quic::QuicConnectionId quic_connection_id() const {
@@ -115,16 +115,17 @@ class QuicHttpProxyBackendStream : public net::URLRequest::Delegate {
void SendRequestOnBackendThread();
void ReadOnceTask();
void OnResponseCompleted();
- void CopyHeaders(const spdy::SpdyHeaderBlock* incoming_request_headers);
+ void CopyHeaders(const spdy::Http2HeaderBlock* incoming_request_headers);
bool ValidateHttpMethod(std::string method);
bool AddRequestHeader(std::string name, std::string value);
// Adds a request body to the request before it starts.
void SetUpload(std::unique_ptr<net::UploadDataStream> upload);
void SendResponseOnDelegateThread();
void ReleaseRequest();
- spdy::SpdyHeaderBlock getAsQuicHeaders(net::HttpResponseHeaders* resp_headers,
- int response_code,
- uint64_t response_decoded_body_size);
+ spdy::Http2HeaderBlock getAsQuicHeaders(
+ net::HttpResponseHeaders* resp_headers,
+ int response_code,
+ uint64_t response_decoded_body_size);
// The quic proxy backend context
QuicHttpProxyBackend* proxy_context_;
diff --git a/chromium/net/tools/quic/quic_http_proxy_backend_stream_test.cc b/chromium/net/tools/quic/quic_http_proxy_backend_stream_test.cc
index 019def29aa4..ce7b83f2403 100644
--- a/chromium/net/tools/quic/quic_http_proxy_backend_stream_test.cc
+++ b/chromium/net/tools/quic/quic_http_proxy_backend_stream_test.cc
@@ -56,9 +56,9 @@ std::unique_ptr<test_server::HttpResponse> HandleDefaultResponseLarge(
return std::move(http_response);
}
-int ParseHeaderStatusCode(const spdy::SpdyHeaderBlock& header) {
+int ParseHeaderStatusCode(const spdy::Http2HeaderBlock& header) {
int status_code;
- spdy::SpdyHeaderBlock::const_iterator it = header.find(kHttp2StatusHeader);
+ spdy::Http2HeaderBlock::const_iterator it = header.find(kHttp2StatusHeader);
if (it == header.end()) {
return -1;
}
@@ -108,7 +108,7 @@ class TestQuicServerStreamDelegate
}
void StartHttpRequestToBackendAndWait(
- spdy::SpdyHeaderBlock* incoming_request_headers,
+ spdy::Http2HeaderBlock* incoming_request_headers,
const std::string& incoming_body) {
send_success_ = quic_backend_stream_->SendRequestToBackend(
incoming_request_headers, incoming_body);
@@ -198,7 +198,7 @@ class QuicHttpProxyBackendStreamTest : public QuicTest {
TEST_F(QuicHttpProxyBackendStreamTest,
DISABLED_SendRequestToBackendGetDefault) {
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = kDefaultResponsePath;
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/1.1";
@@ -217,7 +217,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
}
TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendGetLarge) {
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = "/defaultresponselarge";
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/1.1";
@@ -239,7 +239,7 @@ TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendGetLarge) {
TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendPostBody) {
const char kUploadData[] = "bobsyeruncle";
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = "/echo";
request_headers[":version"] = "HTTP/2.0";
request_headers[":version"] = "HTTP/1.1";
@@ -263,7 +263,7 @@ TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendPostBody) {
TEST_F(QuicHttpProxyBackendStreamTest,
DISABLED_SendRequestToBackendPostEmptyString) {
const char kUploadData[] = "";
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = "/echo";
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/2.0";
@@ -289,7 +289,7 @@ TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendPostFile) {
base::FilePath upload_path = GetUploadFileTestPath();
ASSERT_TRUE(base::ReadFileToString(upload_path, &kUploadData));
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = "/echo";
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/2.0";
@@ -312,7 +312,7 @@ TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendPostFile) {
TEST_F(QuicHttpProxyBackendStreamTest,
DISABLED_SendRequestToBackendResponse500) {
const char kUploadData[] = "bobsyeruncle";
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = "/echo?status=500";
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/2.0";
@@ -332,7 +332,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendFail) {
const char kUploadData[] = "bobsyeruncle";
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = "/echo";
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/2.0";
@@ -352,7 +352,7 @@ TEST_F(QuicHttpProxyBackendStreamTest, DISABLED_SendRequestToBackendFail) {
TEST_F(QuicHttpProxyBackendStreamTest,
DISABLED_SendRequestToBackendOnRedirect) {
const std::string kRedirectTarget = backend_url_.append("/echo");
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = std::string("/server-redirect?") + kRedirectTarget;
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/2.0";
@@ -377,7 +377,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
const char kGzipData[] =
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!";
uint64_t rawBodyLength = strlen(kGzipData);
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = std::string("/gzip-body?") + kGzipData;
request_headers[":authority"] = "www.example.org";
request_headers[":version"] = "HTTP/2.0";
@@ -394,7 +394,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
quic_response->response_type());
EXPECT_EQ(200, ParseHeaderStatusCode(quic_response->headers()));
EXPECT_EQ(kGzipData, quic_response->body());
- spdy::SpdyHeaderBlock quic_response_headers =
+ spdy::Http2HeaderBlock quic_response_headers =
quic_response->headers().Clone();
// Ensure that the content length is set to the raw body size (unencoded)
@@ -414,7 +414,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
// Ensure cookies are not saved/updated at the proxy
TEST_F(QuicHttpProxyBackendStreamTest,
DISABLED_SendRequestToBackendCookiesNotSaved) {
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":authority"] = "www.example.org";
request_headers[":method"] = "GET";
@@ -429,7 +429,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
delegate.get_proxy_backend_stream()->GetBackendResponse();
EXPECT_EQ(200, ParseHeaderStatusCode(quic_response->headers()));
- spdy::SpdyHeaderBlock quic_response_headers =
+ spdy::Http2HeaderBlock quic_response_headers =
quic_response->headers().Clone();
EXPECT_TRUE(quic_response_headers.end() !=
quic_response_headers.find("set-cookie"));
@@ -459,7 +459,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
// backend
TEST_F(QuicHttpProxyBackendStreamTest,
DISABLED_SendRequestToBackendHopHeaders) {
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":path"] = "/echoall";
request_headers[":authority"] = "www.example.org";
request_headers[":method"] = "GET";
@@ -482,7 +482,7 @@ TEST_F(QuicHttpProxyBackendStreamTest,
quic::QuicBackendResponse* quic_response =
delegate.get_proxy_backend_stream()->GetBackendResponse();
EXPECT_EQ(200, ParseHeaderStatusCode(quic_response->headers()));
- spdy::SpdyHeaderBlock quic_response_headers =
+ spdy::Http2HeaderBlock quic_response_headers =
quic_response->headers().Clone();
for (it = QuicHttpProxyBackendStream::kHopHeaders.begin();
it != QuicHttpProxyBackendStream::kHopHeaders.end(); ++it) {
diff --git a/chromium/net/tools/quic/quic_http_proxy_backend_test.cc b/chromium/net/tools/quic/quic_http_proxy_backend_test.cc
index 038c3483d99..76c9925c0ed 100644
--- a/chromium/net/tools/quic/quic_http_proxy_backend_test.cc
+++ b/chromium/net/tools/quic/quic_http_proxy_backend_test.cc
@@ -62,7 +62,7 @@ class QuicHttpProxyBackendTest : public QuicTest {
quic_proxy_backend_url_ = "http://www.google.com:80";
http_proxy_.InitializeBackend(quic_proxy_backend_url_);
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[":authority"] = "www.example.org";
request_headers[":method"] = "GET";
std::string body = "Test Body";
diff --git a/chromium/net/tools/stress_cache/stress_cache.cc b/chromium/net/tools/stress_cache/stress_cache.cc
index c48f359ad53..710ea36d07c 100644
--- a/chromium/net/tools/stress_cache/stress_cache.cc
+++ b/chromium/net/tools/stress_cache/stress_cache.cc
@@ -19,7 +19,7 @@
#include "base/at_exit.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/files/file_path.h"
diff --git a/chromium/net/tools/testserver/echo_message.py b/chromium/net/tools/testserver/echo_message.py
deleted file mode 100644
index b2f7b04e8a1..00000000000
--- a/chromium/net/tools/testserver/echo_message.py
+++ /dev/null
@@ -1,385 +0,0 @@
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Provides utility functions for TCP/UDP echo servers and clients.
-
-This program has classes and functions to encode, decode, calculate checksum
-and verify the "echo request" and "echo response" messages. "echo request"
-message is an echo message sent from the client to the server. "echo response"
-message is a response from the server to the "echo request" message from the
-client.
-
-The format of "echo request" message is
-<version><checksum><payload_size><payload>. <version> is the version number
-of the "echo request" protocol. <checksum> is the checksum of the <payload>.
-<payload_size> is the size of the <payload>. <payload> is the echo message.
-
-The format of "echo response" message is
-<version><checksum><payload_size><key><encoded_payload>.<version>,
-<checksum> and <payload_size> are same as what is in the "echo request" message.
-<encoded_payload> is encoded version of the <payload>. <key> is a randomly
-generated key that is used to encode/decode the <payload>.
-"""
-
-__author__ = 'rtenneti@google.com (Raman Tenneti)'
-
-
-from itertools import cycle
-from itertools import izip
-import random
-
-
-class EchoHeader(object):
- """Class to keep header info of the EchoRequest and EchoResponse messages.
-
- This class knows how to parse the checksum, payload_size from the
- "echo request" and "echo response" messages. It holds the checksum,
- payload_size of the "echo request" and "echo response" messages.
- """
-
- # This specifies the version.
- VERSION_STRING = '01'
-
- # This specifies the starting position of the checksum and length of the
- # checksum. Maximum value for the checksum is less than (2 ** 31 - 1).
- CHECKSUM_START = 2
- CHECKSUM_LENGTH = 10
- CHECKSUM_FORMAT = '%010d'
- CHECKSUM_END = CHECKSUM_START + CHECKSUM_LENGTH
-
- # This specifies the starting position of the <payload_size> and length of the
- # <payload_size>. Maximum number of bytes that can be sent in the <payload> is
- # 9,999,999.
- PAYLOAD_SIZE_START = CHECKSUM_END
- PAYLOAD_SIZE_LENGTH = 7
- PAYLOAD_SIZE_FORMAT = '%07d'
- PAYLOAD_SIZE_END = PAYLOAD_SIZE_START + PAYLOAD_SIZE_LENGTH
-
- def __init__(self, checksum=0, payload_size=0):
- """Initializes the checksum and payload_size of self (EchoHeader).
-
- Args:
- checksum: (int)
- The checksum of the payload.
- payload_size: (int)
- The size of the payload.
- """
- self.checksum = checksum
- self.payload_size = payload_size
-
- def ParseAndInitialize(self, echo_message):
- """Parses the echo_message and initializes self with the parsed data.
-
- This method extracts checksum, and payload_size from the echo_message
- (echo_message could be either echo_request or echo_response messages) and
- initializes self (EchoHeader) with checksum and payload_size.
-
- Args:
- echo_message: (string)
- The string representation of EchoRequest or EchoResponse objects.
- Raises:
- ValueError: Invalid data
- """
- if not echo_message or len(echo_message) < EchoHeader.PAYLOAD_SIZE_END:
- raise ValueError('Invalid data:%s' % echo_message)
- self.checksum = int(echo_message[
- EchoHeader.CHECKSUM_START:EchoHeader.CHECKSUM_END])
- self.payload_size = int(echo_message[
- EchoHeader.PAYLOAD_SIZE_START:EchoHeader.PAYLOAD_SIZE_END])
-
- def InitializeFromPayload(self, payload):
- """Initializes the EchoHeader object with the payload.
-
- It calculates checksum for the payload and initializes self (EchoHeader)
- with the calculated checksum and size of the payload.
-
- This method is used by the client code during testing.
-
- Args:
- payload: (string)
- The payload is the echo string (like 'hello').
- Raises:
- ValueError: Invalid data
- """
- if not payload:
- raise ValueError('Invalid data:%s' % payload)
- self.payload_size = len(payload)
- self.checksum = Checksum(payload, self.payload_size)
-
- def __str__(self):
- """String representation of the self (EchoHeader).
-
- Returns:
- A string representation of self (EchoHeader).
- """
- checksum_string = EchoHeader.CHECKSUM_FORMAT % self.checksum
- payload_size_string = EchoHeader.PAYLOAD_SIZE_FORMAT % self.payload_size
- return EchoHeader.VERSION_STRING + checksum_string + payload_size_string
-
-
-class EchoRequest(EchoHeader):
- """Class holds data specific to the "echo request" message.
-
- This class holds the payload extracted from the "echo request" message.
- """
-
- # This specifies the starting position of the <payload>.
- PAYLOAD_START = EchoHeader.PAYLOAD_SIZE_END
-
- def __init__(self):
- """Initializes EchoRequest object."""
- EchoHeader.__init__(self)
- self.payload = ''
-
- def ParseAndInitialize(self, echo_request_data):
- """Parses and Initializes the EchoRequest object from the echo_request_data.
-
- This method extracts the header information (checksum and payload_size) and
- payload from echo_request_data.
-
- Args:
- echo_request_data: (string)
- The string representation of EchoRequest object.
- Raises:
- ValueError: Invalid data
- """
- EchoHeader.ParseAndInitialize(self, echo_request_data)
- if len(echo_request_data) <= EchoRequest.PAYLOAD_START:
- raise ValueError('Invalid data:%s' % echo_request_data)
- self.payload = echo_request_data[EchoRequest.PAYLOAD_START:]
-
- def InitializeFromPayload(self, payload):
- """Initializes the EchoRequest object with payload.
-
- It calculates checksum for the payload and initializes self (EchoRequest)
- object.
-
- Args:
- payload: (string)
- The payload string for which "echo request" needs to be constructed.
- """
- EchoHeader.InitializeFromPayload(self, payload)
- self.payload = payload
-
- def __str__(self):
- """String representation of the self (EchoRequest).
-
- Returns:
- A string representation of self (EchoRequest).
- """
- return EchoHeader.__str__(self) + self.payload
-
-
-class EchoResponse(EchoHeader):
- """Class holds data specific to the "echo response" message.
-
- This class knows how to parse the "echo response" message. This class holds
- key, encoded_payload and decoded_payload of the "echo response" message.
- """
-
- # This specifies the starting position of the |key_| and length of the |key_|.
- # Minimum and maximum values for the |key_| are 100,000 and 999,999.
- KEY_START = EchoHeader.PAYLOAD_SIZE_END
- KEY_LENGTH = 6
- KEY_FORMAT = '%06d'
- KEY_END = KEY_START + KEY_LENGTH
- KEY_MIN_VALUE = 0
- KEY_MAX_VALUE = 999999
-
- # This specifies the starting position of the <encoded_payload> and length
- # of the <encoded_payload>.
- ENCODED_PAYLOAD_START = KEY_END
-
- def __init__(self, key='', encoded_payload='', decoded_payload=''):
- """Initializes the EchoResponse object."""
- EchoHeader.__init__(self)
- self.key = key
- self.encoded_payload = encoded_payload
- self.decoded_payload = decoded_payload
-
- def ParseAndInitialize(self, echo_response_data=None):
- """Parses and Initializes the EchoResponse object from echo_response_data.
-
- This method calls EchoHeader to extract header information from the
- echo_response_data and it then extracts key and encoded_payload from the
- echo_response_data. It holds the decoded payload of the encoded_payload.
-
- Args:
- echo_response_data: (string)
- The string representation of EchoResponse object.
- Raises:
- ValueError: Invalid echo_request_data
- """
- EchoHeader.ParseAndInitialize(self, echo_response_data)
- if len(echo_response_data) <= EchoResponse.ENCODED_PAYLOAD_START:
- raise ValueError('Invalid echo_response_data:%s' % echo_response_data)
- self.key = echo_response_data[EchoResponse.KEY_START:EchoResponse.KEY_END]
- self.encoded_payload = echo_response_data[
- EchoResponse.ENCODED_PAYLOAD_START:]
- self.decoded_payload = Crypt(self.encoded_payload, self.key)
-
- def InitializeFromEchoRequest(self, echo_request):
- """Initializes EchoResponse with the data from the echo_request object.
-
- It gets the checksum, payload_size and payload from the echo_request object
- and then encodes the payload with a random key. It also saves the payload
- as decoded_payload.
-
- Args:
- echo_request: (EchoRequest)
- The EchoRequest object which has "echo request" message.
- """
- self.checksum = echo_request.checksum
- self.payload_size = echo_request.payload_size
- self.key = (EchoResponse.KEY_FORMAT %
- random.randrange(EchoResponse.KEY_MIN_VALUE,
- EchoResponse.KEY_MAX_VALUE))
- self.encoded_payload = Crypt(echo_request.payload, self.key)
- self.decoded_payload = echo_request.payload
-
- def __str__(self):
- """String representation of the self (EchoResponse).
-
- Returns:
- A string representation of self (EchoResponse).
- """
- return EchoHeader.__str__(self) + self.key + self.encoded_payload
-
-
-def Crypt(payload, key):
- """Encodes/decodes the payload with the key and returns encoded payload.
-
- This method loops through the payload and XORs each byte with the key.
-
- Args:
- payload: (string)
- The string to be encoded/decoded.
- key: (string)
- The key used to encode/decode the payload.
-
- Returns:
- An encoded/decoded string.
- """
- return ''.join(chr(ord(x) ^ ord(y)) for (x, y) in izip(payload, cycle(key)))
-
-
-def Checksum(payload, payload_size):
- """Calculates the checksum of the payload.
-
- Args:
- payload: (string)
- The payload string for which checksum needs to be calculated.
- payload_size: (int)
- The number of bytes in the payload.
-
- Returns:
- The checksum of the payload.
- """
- checksum = 0
- length = min(payload_size, len(payload))
- for i in range (0, length):
- checksum += ord(payload[i])
- return checksum
-
-
-def GetEchoRequestData(payload):
- """Constructs an "echo request" message from the payload.
-
- It builds an EchoRequest object from the payload and then returns a string
- representation of the EchoRequest object.
-
- This is used by the TCP/UDP echo clients to build the "echo request" message.
-
- Args:
- payload: (string)
- The payload string for which "echo request" needs to be constructed.
-
- Returns:
- A string representation of the EchoRequest object.
- Raises:
- ValueError: Invalid payload
- """
- try:
- echo_request = EchoRequest()
- echo_request.InitializeFromPayload(payload)
- return str(echo_request)
- except (IndexError, ValueError):
- raise ValueError('Invalid payload:%s' % payload)
-
-
-def GetEchoResponseData(echo_request_data):
- """Verifies the echo_request_data and returns "echo response" message.
-
- It builds the EchoRequest object from the echo_request_data and then verifies
- the checksum of the EchoRequest is same as the calculated checksum of the
- payload. If the checksums don't match then it returns None. It checksums
- match, it builds the echo_response object from echo_request object and returns
- string representation of the EchoResponse object.
-
- This is used by the TCP/UDP echo servers.
-
- Args:
- echo_request_data: (string)
- The string that echo servers send to the clients.
-
- Returns:
- A string representation of the EchoResponse object. It returns None if the
- echo_request_data is not valid.
- Raises:
- ValueError: Invalid echo_request_data
- """
- try:
- if not echo_request_data:
- raise ValueError('Invalid payload:%s' % echo_request_data)
-
- echo_request = EchoRequest()
- echo_request.ParseAndInitialize(echo_request_data)
-
- if Checksum(echo_request.payload,
- echo_request.payload_size) != echo_request.checksum:
- return None
-
- echo_response = EchoResponse()
- echo_response.InitializeFromEchoRequest(echo_request)
-
- return str(echo_response)
- except (IndexError, ValueError):
- raise ValueError('Invalid payload:%s' % echo_request_data)
-
-
-def DecodeAndVerify(echo_request_data, echo_response_data):
- """Decodes and verifies the echo_response_data.
-
- It builds EchoRequest and EchoResponse objects from the echo_request_data and
- echo_response_data. It returns True if the EchoResponse's payload and
- checksum match EchoRequest's.
-
- This is used by the TCP/UDP echo clients for testing purposes.
-
- Args:
- echo_request_data: (string)
- The request clients sent to echo servers.
- echo_response_data: (string)
- The response clients received from the echo servers.
-
- Returns:
- True if echo_request_data and echo_response_data match.
- Raises:
- ValueError: Invalid echo_request_data or Invalid echo_response
- """
-
- try:
- echo_request = EchoRequest()
- echo_request.ParseAndInitialize(echo_request_data)
- except (IndexError, ValueError):
- raise ValueError('Invalid echo_request:%s' % echo_request_data)
-
- try:
- echo_response = EchoResponse()
- echo_response.ParseAndInitialize(echo_response_data)
- except (IndexError, ValueError):
- raise ValueError('Invalid echo_response:%s' % echo_response_data)
-
- return (echo_request.checksum == echo_response.checksum and
- echo_request.payload == echo_response.decoded_payload)
diff --git a/chromium/net/tools/testserver/run_testserver.cc b/chromium/net/tools/testserver/run_testserver.cc
index 2ee38f1ff94..fb3471d298c 100644
--- a/chromium/net/tools/testserver/run_testserver.cc
+++ b/chromium/net/tools/testserver/run_testserver.cc
@@ -14,6 +14,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_executor.h"
#include "base/test/test_timeouts.h"
+#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
static void PrintUsage() {
@@ -47,9 +48,13 @@ int main(int argc, const char* argv[]) {
return -1;
}
+ // If populated, EmbeddedTestServer is used instead of the SpawnedTestServer.
+ base::Optional<net::test_server::EmbeddedTestServer::Type>
+ embedded_test_server_type;
+
net::SpawnedTestServer::Type server_type;
if (command_line->HasSwitch("http")) {
- server_type = net::SpawnedTestServer::TYPE_HTTP;
+ embedded_test_server_type = net::test_server::EmbeddedTestServer::TYPE_HTTP;
} else if (command_line->HasSwitch("https")) {
server_type = net::SpawnedTestServer::TYPE_HTTPS;
} else if (command_line->HasSwitch("ws")) {
@@ -61,15 +66,18 @@ int main(int argc, const char* argv[]) {
} else {
// If no scheme switch is specified, select http or https scheme.
// TODO(toyoshim): Remove this estimation.
- if (command_line->HasSwitch("ssl-cert"))
+ if (command_line->HasSwitch("ssl-cert")) {
server_type = net::SpawnedTestServer::TYPE_HTTPS;
- else
- server_type = net::SpawnedTestServer::TYPE_HTTP;
+ } else {
+ embedded_test_server_type =
+ net::test_server::EmbeddedTestServer::TYPE_HTTP;
+ }
}
net::SpawnedTestServer::SSLOptions ssl_options;
if (command_line->HasSwitch("ssl-cert")) {
- if (!net::SpawnedTestServer::UsingSSL(server_type)) {
+ if (!net::SpawnedTestServer::UsingSSL(server_type) ||
+ embedded_test_server_type.has_value()) {
printf("Error: --ssl-cert is specified on non-secure scheme\n");
PrintUsage();
return -1;
@@ -98,6 +106,33 @@ int main(int argc, const char* argv[]) {
return -1;
}
+ base::FilePath full_path =
+ net::test_server::EmbeddedTestServer::GetFullPathFromSourceDirectory(
+ doc_root);
+ if (!base::DirectoryExists(full_path)) {
+ printf("Error: invalid doc root: \"%s\" does not exist!\n",
+ base::UTF16ToUTF8(full_path.LossyDisplayName()).c_str());
+ return -1;
+ }
+
+ // Use EmbeddedTestServer, if it supports the provided configuration.
+ if (embedded_test_server_type.has_value()) {
+ net::test_server::EmbeddedTestServer embedded_test_server(
+ *embedded_test_server_type);
+ embedded_test_server.AddDefaultHandlers(doc_root);
+ if (!embedded_test_server.Start()) {
+ printf("Error: failed to start embedded test server. Exiting.\n");
+ return -1;
+ }
+
+ printf("Embedded test server running at %s (type ctrl+c to exit)\n",
+ embedded_test_server.host_port_pair().ToString().c_str());
+
+ base::RunLoop().Run();
+ return 0;
+ }
+
+ // Otherwise, use the SpawnedTestServer.
std::unique_ptr<net::SpawnedTestServer> test_server;
if (net::SpawnedTestServer::UsingSSL(server_type)) {
test_server.reset(
@@ -111,16 +146,8 @@ int main(int argc, const char* argv[]) {
return -1;
}
- if (!base::DirectoryExists(test_server->document_root())) {
- printf("Error: invalid doc root: \"%s\" does not exist!\n",
- base::UTF16ToUTF8(
- test_server->document_root().LossyDisplayName()).c_str());
- return -1;
- }
-
printf("testserver running at %s (type ctrl+c to exit)\n",
test_server->host_port_pair().ToString().c_str());
base::RunLoop().Run();
- return 0;
}
diff --git a/chromium/net/tools/testserver/testserver.py b/chromium/net/tools/testserver/testserver.py
index b21be689e4d..0d1e43a33e6 100755
--- a/chromium/net/tools/testserver/testserver.py
+++ b/chromium/net/tools/testserver/testserver.py
@@ -55,16 +55,13 @@ import pyftpdlib.ftpserver
import tlslite
import tlslite.api
-import echo_message
import testserver_base
SERVER_HTTP = 0
SERVER_FTP = 1
-SERVER_TCP_ECHO = 2
-SERVER_UDP_ECHO = 3
-SERVER_BASIC_AUTH_PROXY = 4
-SERVER_WEBSOCKET = 5
-SERVER_PROXY = 6
+SERVER_BASIC_AUTH_PROXY = 2
+SERVER_WEBSOCKET = 3
+SERVER_PROXY = 4
# Default request queue size for WebSocketServer.
_DEFAULT_REQUEST_QUEUE_SIZE = 128
@@ -260,46 +257,6 @@ class FTPServer(testserver_base.ClientRestrictingServerMixIn,
pass
-class TCPEchoServer(testserver_base.ClientRestrictingServerMixIn,
- SocketServer.TCPServer):
- """A TCP echo server that echoes back what it has received."""
-
- def server_bind(self):
- """Override server_bind to store the server name."""
-
- SocketServer.TCPServer.server_bind(self)
- host, port = self.socket.getsockname()[:2]
- self.server_name = socket.getfqdn(host)
- self.server_port = port
-
- def serve_forever(self):
- self.stop = False
- self.nonce_time = None
- while not self.stop:
- self.handle_request()
- self.socket.close()
-
-
-class UDPEchoServer(testserver_base.ClientRestrictingServerMixIn,
- SocketServer.UDPServer):
- """A UDP echo server that echoes back what it has received."""
-
- def server_bind(self):
- """Override server_bind to store the server name."""
-
- SocketServer.UDPServer.server_bind(self)
- host, port = self.socket.getsockname()[:2]
- self.server_name = socket.getfqdn(host)
- self.server_port = port
-
- def serve_forever(self):
- self.stop = False
- self.nonce_time = None
- while not self.stop:
- self.handle_request()
- self.socket.close()
-
-
class TestPageHandler(testserver_base.BasePageHandler):
# Class variables to allow for persistence state between page handler
# invocations
@@ -338,7 +295,6 @@ class TestPageHandler(testserver_base.BasePageHandler):
self.AuthBasicHandler,
self.AuthDigestHandler,
self.SlowServerHandler,
- self.ChunkedServerHandler,
self.NoContentHandler,
self.ServerRedirectHandler,
self.CrossSiteRedirectHandler,
@@ -1323,48 +1279,6 @@ class TestPageHandler(testserver_base.BasePageHandler):
self.wfile.write("waited %.1f seconds" % wait_sec)
return True
- def ChunkedServerHandler(self):
- """Send chunked response. Allows to specify chunks parameters:
- - waitBeforeHeaders - ms to wait before sending headers
- - waitBetweenChunks - ms to wait between chunks
- - chunkSize - size of each chunk in bytes
- - chunksNumber - number of chunks
- Example: /chunked?waitBeforeHeaders=1000&chunkSize=5&chunksNumber=5
- waits one second, then sends headers and five chunks five bytes each."""
-
- if not self._ShouldHandleRequest("/chunked"):
- return False
- query_char = self.path.find('?')
- chunkedSettings = {'waitBeforeHeaders' : 0,
- 'waitBetweenChunks' : 0,
- 'chunkSize' : 5,
- 'chunksNumber' : 5}
- if query_char >= 0:
- params = self.path[query_char + 1:].split('&')
- for param in params:
- keyValue = param.split('=')
- if len(keyValue) == 2:
- try:
- chunkedSettings[keyValue[0]] = int(keyValue[1])
- except ValueError:
- pass
- time.sleep(0.001 * chunkedSettings['waitBeforeHeaders'])
- self.protocol_version = 'HTTP/1.1' # Needed for chunked encoding
- self.send_response(200)
- self.send_header('Content-Type', 'text/plain')
- self.send_header('Connection', 'close')
- self.send_header('Transfer-Encoding', 'chunked')
- self.end_headers()
- # Chunked encoding: sending all chunks, then final zero-length chunk and
- # then final CRLF.
- for i in range(0, chunkedSettings['chunksNumber']):
- if i > 0:
- time.sleep(0.001 * chunkedSettings['waitBetweenChunks'])
- self.sendChunkHelp('*' * chunkedSettings['chunkSize'])
- self.wfile.flush() # Keep in mind that we start flushing only after 1kb.
- self.sendChunkHelp('')
- return True
-
def NoContentHandler(self):
"""Returns a 204 No Content response."""
@@ -1659,52 +1573,6 @@ class OCSPHandler(testserver_base.BasePageHandler):
self.wfile.write(self.ca_issuers_response)
-class TCPEchoHandler(SocketServer.BaseRequestHandler):
- """The RequestHandler class for TCP echo server.
-
- It is instantiated once per connection to the server, and overrides the
- handle() method to implement communication to the client.
- """
-
- def handle(self):
- """Handles the request from the client and constructs a response."""
-
- data = self.request.recv(65536).strip()
- # Verify the "echo request" message received from the client. Send back
- # "echo response" message if "echo request" message is valid.
- try:
- return_data = echo_message.GetEchoResponseData(data)
- if not return_data:
- return
- except ValueError:
- return
-
- self.request.send(return_data)
-
-
-class UDPEchoHandler(SocketServer.BaseRequestHandler):
- """The RequestHandler class for UDP echo server.
-
- It is instantiated once per connection to the server, and overrides the
- handle() method to implement communication to the client.
- """
-
- def handle(self):
- """Handles the request from the client and constructs a response."""
-
- data = self.request[0].strip()
- request_socket = self.request[1]
- # Verify the "echo request" message received from the client. Send back
- # "echo response" message if "echo request" message is valid.
- try:
- return_data = echo_message.GetEchoResponseData(data)
- if not return_data:
- return
- except ValueError:
- return
- request_socket.sendto(return_data, self.client_address)
-
-
class ProxyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""A request handler that behaves as a proxy server. Only CONNECT, GET and
HEAD methods are supported.
@@ -2108,20 +1976,6 @@ class ServerRunner(testserver_base.TestServerRunner):
(scheme, host, server.server_port)
server_data['port'] = server.server_port
websocket_options.use_basic_auth = self.options.ws_basic_auth
- elif self.options.server_type == SERVER_TCP_ECHO:
- # Used for generating the key (randomly) that encodes the "echo request"
- # message.
- random.seed()
- server = TCPEchoServer((host, port), TCPEchoHandler)
- print 'Echo TCP server started on port %d...' % server.server_port
- server_data['port'] = server.server_port
- elif self.options.server_type == SERVER_UDP_ECHO:
- # Used for generating the key (randomly) that encodes the "echo request"
- # message.
- random.seed()
- server = UDPEchoServer((host, port), UDPEchoHandler)
- print 'Echo UDP server started on port %d...' % server.server_port
- server_data['port'] = server.server_port
elif self.options.server_type == SERVER_PROXY:
ProxyRequestHandler.redirect_connect_to_localhost = \
self.options.redirect_connect_to_localhost
@@ -2180,14 +2034,6 @@ class ServerRunner(testserver_base.TestServerRunner):
const=SERVER_FTP, default=SERVER_HTTP,
dest='server_type',
help='start up an FTP server.')
- self.option_parser.add_option('--tcp-echo', action='store_const',
- const=SERVER_TCP_ECHO, default=SERVER_HTTP,
- dest='server_type',
- help='start up a tcp echo server.')
- self.option_parser.add_option('--udp-echo', action='store_const',
- const=SERVER_UDP_ECHO, default=SERVER_HTTP,
- dest='server_type',
- help='start up a udp echo server.')
self.option_parser.add_option('--proxy', action='store_const',
const=SERVER_PROXY,
default=SERVER_HTTP, dest='server_type',
diff --git a/chromium/net/tools/testserver/testserver.pydeps b/chromium/net/tools/testserver/testserver.pydeps
index eb133f34ff5..e6b32e345f7 100644
--- a/chromium/net/tools/testserver/testserver.pydeps
+++ b/chromium/net/tools/testserver/testserver.pydeps
@@ -75,7 +75,6 @@
../../../third_party/tlslite/tlslite/x509.py
../../../third_party/tlslite/tlslite/x509certchain.py
asn1.py
-echo_message.py
minica.py
testserver.py
testserver_base.py
diff --git a/chromium/net/url_request/report_sender.cc b/chromium/net/url_request/report_sender.cc
index 1a040063acb..269658b6314 100644
--- a/chromium/net/url_request/report_sender.cc
+++ b/chromium/net/url_request/report_sender.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "net/base/elements_upload_data_stream.h"
+#include "net/base/isolation_info.h"
#include "net/base/load_flags.h"
#include "net/base/request_priority.h"
#include "net/base/upload_bytes_element_reader.h"
@@ -58,6 +59,7 @@ ReportSender::~ReportSender() = default;
void ReportSender::Send(const GURL& report_uri,
base::StringPiece content_type,
base::StringPiece report,
+ const NetworkIsolationKey& network_isolation_key,
SuccessCallback success_callback,
ErrorCallback error_callback) {
DCHECK(!content_type.empty());
@@ -66,9 +68,10 @@ void ReportSender::Send(const GURL& report_uri,
url_request->SetUserData(
&kUserDataKey, std::make_unique<CallbackInfo>(std::move(success_callback),
std::move(error_callback)));
-
url_request->SetLoadFlags(kLoadFlags);
url_request->set_allow_credentials(false);
+ url_request->set_isolation_info(IsolationInfo::CreatePartial(
+ IsolationInfo::RequestType::kOther, network_isolation_key));
HttpRequestHeaders extra_headers;
extra_headers.SetHeader(HttpRequestHeaders::kContentType, content_type);
diff --git a/chromium/net/url_request/report_sender.h b/chromium/net/url_request/report_sender.h
index 1e4023640ad..7e2f57c9b88 100644
--- a/chromium/net/url_request/report_sender.h
+++ b/chromium/net/url_request/report_sender.h
@@ -20,6 +20,7 @@ class GURL;
namespace net {
+class NetworkIsolationKey;
class URLRequestContext;
// ReportSender asynchronously sends serialized reports to a URI.
@@ -27,6 +28,9 @@ class URLRequestContext;
// the format of the report being sent (JSON, protobuf, etc.) and the particular
// data that it contains. Multiple reports can be in-flight at once. This class
// owns inflight requests and cleans them up when necessary.
+//
+// Despite this class's name, it has nothing to do with the Reporting API,
+// which is implemented in net/reporting.
class NET_EXPORT ReportSender
: public URLRequest::Delegate,
public TransportSecurityState::ReportSenderInterface {
@@ -49,6 +53,7 @@ class NET_EXPORT ReportSender
void Send(const GURL& report_uri,
base::StringPiece content_type,
base::StringPiece report,
+ const NetworkIsolationKey& network_isolation_key,
SuccessCallback success_callback,
ErrorCallback error_callback) override;
diff --git a/chromium/net/url_request/report_sender_unittest.cc b/chromium/net/url_request/report_sender_unittest.cc
index c921c6cc72d..4dee747342d 100644
--- a/chromium/net/url_request/report_sender_unittest.cc
+++ b/chromium/net/url_request/report_sender_unittest.cc
@@ -5,7 +5,7 @@
#include "net/url_request/report_sender.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -143,6 +143,11 @@ class TestReportSenderNetworkDelegate : public NetworkDelegateImpl {
expected_content_type_ = content_type;
}
+ void set_expected_network_isolation_key(
+ const NetworkIsolationKey& expected_network_isolation_key) {
+ expected_network_isolation_key_ = expected_network_isolation_key;
+ }
+
// NetworkDelegateImpl implementation.
int OnBeforeURLRequest(URLRequest* request,
CompletionOnceCallback callback,
@@ -153,6 +158,12 @@ class TestReportSenderNetworkDelegate : public NetworkDelegateImpl {
EXPECT_FALSE(request->allow_credentials());
EXPECT_TRUE(request->load_flags() & LOAD_DO_NOT_SAVE_COOKIES);
+ EXPECT_EQ(expected_network_isolation_key_,
+ request->isolation_info().network_isolation_key());
+ EXPECT_EQ(IsolationInfo::RequestType::kOther,
+ request->isolation_info().request_type());
+ EXPECT_TRUE(request->site_for_cookies().IsNull());
+
const HttpRequestHeaders& extra_headers = request->extra_request_headers();
std::string content_type;
EXPECT_TRUE(extra_headers.GetHeader(HttpRequestHeaders::kContentType,
@@ -179,6 +190,7 @@ class TestReportSenderNetworkDelegate : public NetworkDelegateImpl {
GURL expect_url_;
std::set<std::string> expect_reports_;
std::string expected_content_type_;
+ NetworkIsolationKey expected_network_isolation_key_;
DISALLOW_COPY_AND_ASSIGN(TestReportSenderNetworkDelegate);
};
@@ -211,6 +223,9 @@ class ReportSenderTest : public TestWithTaskEnvironment {
size_t request_sequence_number,
base::OnceCallback<void()> success_callback,
base::OnceCallback<void(const GURL&, int, int)> error_callback) {
+ NetworkIsolationKey network_isolation_key =
+ NetworkIsolationKey::CreateTransient();
+
base::RunLoop run_loop;
network_delegate_.set_url_request_destroyed_callback(
run_loop.QuitClosure());
@@ -218,10 +233,11 @@ class ReportSenderTest : public TestWithTaskEnvironment {
network_delegate_.set_expect_url(url);
network_delegate_.ExpectReport(report);
network_delegate_.set_expected_content_type("application/foobar");
+ network_delegate_.set_expected_network_isolation_key(network_isolation_key);
EXPECT_EQ(request_sequence_number, network_delegate_.num_requests());
- reporter->Send(url, "application/foobar", report,
+ reporter->Send(url, "application/foobar", report, network_isolation_key,
std::move(success_callback), std::move(error_callback));
// The report is sent asynchronously, so wait for the report's
@@ -277,11 +293,11 @@ TEST_F(ReportSenderTest, SendMultipleReportsSimultaneously) {
EXPECT_EQ(0u, network_delegate_.num_requests());
- reporter.Send(url, "application/foobar", kDummyReport,
+ reporter.Send(url, "application/foobar", kDummyReport, NetworkIsolationKey(),
base::OnceCallback<void()>(),
base::OnceCallback<void(const GURL&, int, int)>());
reporter.Send(url, "application/foobar", kSecondDummyReport,
- base::OnceCallback<void()>(),
+ NetworkIsolationKey(), base::OnceCallback<void()>(),
base::OnceCallback<void(const GURL&, int, int)>());
run_loop.Run();
@@ -306,7 +322,7 @@ TEST_F(ReportSenderTest, PendingRequestGetsDeleted) {
std::unique_ptr<ReportSender> reporter(
new ReportSender(context(), TRAFFIC_ANNOTATION_FOR_TESTS));
- reporter->Send(url, "application/foobar", kDummyReport,
+ reporter->Send(url, "application/foobar", kDummyReport, NetworkIsolationKey(),
base::OnceCallback<void()>(),
base::OnceCallback<void(const GURL&, int, int)>());
reporter.reset();
diff --git a/chromium/net/url_request/url_fetcher_core.cc b/chromium/net/url_request/url_fetcher_core.cc
index 4a933d1b7e1..754dd86d1d9 100644
--- a/chromium/net/url_request/url_fetcher_core.cc
+++ b/chromium/net/url_request/url_fetcher_core.cc
@@ -8,7 +8,7 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/sequenced_task_runner.h"
diff --git a/chromium/net/url_request/url_request.cc b/chromium/net/url_request/url_request.cc
index 9138aae0196..b8409e80748 100644
--- a/chromium/net/url_request/url_request.cc
+++ b/chromium/net/url_request/url_request.cc
@@ -7,8 +7,8 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/compiler_specific.h"
#include "base/metrics/histogram_macros.h"
#include "base/rand_util.h"
diff --git a/chromium/net/url_request/url_request.h b/chromium/net/url_request/url_request.h
index adeb342deba..eed0ae918a0 100644
--- a/chromium/net/url_request/url_request.h
+++ b/chromium/net/url_request/url_request.h
@@ -19,6 +19,7 @@
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "net/base/auth.h"
+#include "net/base/idempotency.h"
#include "net/base/ip_endpoint.h"
#include "net/base/isolation_info.h"
#include "net/base/load_states.h"
@@ -711,6 +712,9 @@ class NET_EXPORT URLRequest : public base::SupportsUserData {
send_client_certs_ = send_client_certs;
}
+ void SetIdempotency(Idempotency idempotency) { idempotency_ = idempotency; }
+ Idempotency GetIdempotency() const { return idempotency_; }
+
base::WeakPtr<URLRequest> GetWeakPtr();
protected:
@@ -948,6 +952,9 @@ class NET_EXPORT URLRequest : public base::SupportsUserData {
bool send_client_certs_ = true;
+ // Idempotency of the request.
+ Idempotency idempotency_ = DEFAULT_IDEMPOTENCY;
+
THREAD_CHECKER(thread_checker_);
base::WeakPtrFactory<URLRequest> weak_factory_{this};
diff --git a/chromium/net/url_request/url_request_context_builder_unittest.cc b/chromium/net/url_request/url_request_context_builder_unittest.cc
index 7266f85a38d..585f4865546 100644
--- a/chromium/net/url_request/url_request_context_builder_unittest.cc
+++ b/chromium/net/url_request/url_request_context_builder_unittest.cc
@@ -4,7 +4,7 @@
#include "net/url_request/url_request_context_builder.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/run_loop.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
diff --git a/chromium/net/url_request/url_request_http_job.cc b/chromium/net/url_request/url_request_http_job.cc
index f5e754f4ea0..dd533f15e3d 100644
--- a/chromium/net/url_request/url_request_http_job.cc
+++ b/chromium/net/url_request/url_request_http_job.cc
@@ -10,12 +10,13 @@
#include "base/base_switches.h"
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/file_version_info.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
@@ -149,15 +150,6 @@ void RecordCTHistograms(const net::SSLInfo& ssl_info) {
"Net.CertificateTransparency.RequestComplianceStatus",
ssl_info.ct_policy_compliance,
net::ct::CTPolicyCompliance::CT_POLICY_COUNT);
- // Record the CT compliance of each request which was required to be CT
- // compliant. This gives a picture of the sites that are supposed to be
- // compliant and how well they do at actually being compliant.
- if (ssl_info.ct_policy_compliance_required) {
- UMA_HISTOGRAM_ENUMERATION(
- "Net.CertificateTransparency.CTRequiredRequestComplianceStatus",
- ssl_info.ct_policy_compliance,
- net::ct::CTPolicyCompliance::CT_POLICY_COUNT);
- }
}
template <typename CookieWithMetadata>
@@ -212,6 +204,15 @@ void MarkSameSiteCompatPairs(
}
}
+net::CookieOptions CreateCookieOptions(
+ net::CookieOptions::SameSiteCookieContext cookie_context) {
+ net::CookieOptions options;
+ options.set_return_excluded_cookies();
+ options.set_include_httponly();
+ options.set_same_site_cookie_context(cookie_context);
+ return options;
+}
+
} // namespace
namespace net {
@@ -301,11 +302,17 @@ void URLRequestHttpJob::Start() {
request_info_.network_isolation_key =
request_->isolation_info().network_isolation_key();
+ request_info_.possibly_top_frame_origin =
+ request_->isolation_info().top_frame_origin();
+ request_info_.is_subframe_document_resource =
+ request_->isolation_info().request_type() ==
+ net::IsolationInfo::RequestType::kSubFrame;
request_info_.load_flags = request_->load_flags();
request_info_.disable_secure_dns = request_->disable_secure_dns();
request_info_.traffic_annotation =
net::MutableNetworkTrafficAnnotationTag(request_->traffic_annotation());
request_info_.socket_tag = request_->socket_tag();
+ request_info_.idempotency = request_->GetIdempotency();
#if BUILDFLAG(ENABLE_REPORTING)
request_info_.reporting_upload_depth = request_->reporting_upload_depth();
#endif
@@ -568,9 +575,6 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() {
// is being overridden by NetworkDelegate and will eventually block them, as
// blocked cookies still need to be logged in that case.
if (cookie_store && request_->allow_credentials()) {
- CookieOptions options;
- options.set_return_excluded_cookies();
- options.set_include_httponly();
bool force_ignore_site_for_cookies =
request_->force_ignore_site_for_cookies();
if (cookie_store->cookie_access_delegate() &&
@@ -579,10 +583,13 @@ void URLRequestHttpJob::AddCookieHeaderAndStart() {
request_->site_for_cookies())) {
force_ignore_site_for_cookies = true;
}
- options.set_same_site_cookie_context(
+ CookieOptions::SameSiteCookieContext same_site_context =
net::cookie_util::ComputeSameSiteContextForRequest(
request_->method(), request_->url(), request_->site_for_cookies(),
- request_->initiator(), force_ignore_site_for_cookies));
+ request_->initiator(), force_ignore_site_for_cookies);
+
+ CookieOptions options = CreateCookieOptions(same_site_context);
+
cookie_store->GetCookieListWithOptionsAsync(
request_->url(), options,
base::BindOnce(&URLRequestHttpJob::SetCookieHeaderAndStart,
@@ -713,8 +720,6 @@ void URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete(int result) {
if (GetResponseHeaders()->GetDateValue(&response_date))
server_time = base::make_optional(response_date);
- CookieOptions options;
- options.set_include_httponly();
bool force_ignore_site_for_cookies =
request_->force_ignore_site_for_cookies();
if (cookie_store->cookie_access_delegate() &&
@@ -722,12 +727,12 @@ void URLRequestHttpJob::SaveCookiesAndNotifyHeadersComplete(int result) {
request_->url(), request_->site_for_cookies())) {
force_ignore_site_for_cookies = true;
}
- options.set_same_site_cookie_context(
+ CookieOptions::SameSiteCookieContext same_site_context =
net::cookie_util::ComputeSameSiteContextForResponse(
request_->url(), request_->site_for_cookies(), request_->initiator(),
- force_ignore_site_for_cookies));
+ force_ignore_site_for_cookies);
- options.set_return_excluded_cookies();
+ CookieOptions options = CreateCookieOptions(same_site_context);
// Set all cookies, without waiting for them to be set. Any subsequent read
// will see the combined result of all cookie operation.
diff --git a/chromium/net/url_request/url_request_http_job_unittest.cc b/chromium/net/url_request/url_request_http_job_unittest.cc
index 723a911eba1..5de6c860a6b 100644
--- a/chromium/net/url_request/url_request_http_job_unittest.cc
+++ b/chromium/net/url_request/url_request_http_job_unittest.cc
@@ -18,7 +18,7 @@
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "net/base/auth.h"
@@ -88,8 +88,6 @@ const char kTrustAnchorRequestHistogram[] =
const char kCTComplianceHistogramName[] =
"Net.CertificateTransparency.RequestComplianceStatus";
-const char kCTRequiredHistogramName[] =
- "Net.CertificateTransparency.CTRequiredRequestComplianceStatus";
// Inherit from URLRequestHttpJob to expose the priority and some
// other hidden functions.
@@ -1040,7 +1038,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
ssl_socket_data.ssl_info.cert =
ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem");
ssl_socket_data.ssl_info.is_issued_by_known_root = true;
- ssl_socket_data.ssl_info.ct_policy_compliance_required = false;
ssl_socket_data.ssl_info.ct_policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS;
@@ -1086,7 +1083,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
ssl_socket_data.ssl_info.cert =
ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem");
ssl_socket_data.ssl_info.is_issued_by_known_root = true;
- ssl_socket_data.ssl_info.ct_policy_compliance_required = false;
ssl_socket_data.ssl_info.ct_policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS;
@@ -1113,9 +1109,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
kCTComplianceHistogramName,
static_cast<int32_t>(ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS),
1);
- // CTRequiredRequestComplianceStatus should *not* have been recorded because
- // it is only recorded for requests which are required to be compliant.
- histograms.ExpectTotalCount(kCTRequiredHistogramName, 0);
}
// Tests that the CT compliance histograms are not recorded for
@@ -1126,7 +1119,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
ssl_socket_data.ssl_info.cert =
ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem");
ssl_socket_data.ssl_info.is_issued_by_known_root = false;
- ssl_socket_data.ssl_info.ct_policy_compliance_required = false;
ssl_socket_data.ssl_info.ct_policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS;
@@ -1150,7 +1142,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
EXPECT_THAT(delegate.request_status(), IsOk());
histograms.ExpectTotalCount(kCTComplianceHistogramName, 0);
- histograms.ExpectTotalCount(kCTRequiredHistogramName, 0);
}
// Tests that the CT compliance histogram is recorded when CT is required but
@@ -1161,7 +1152,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
ssl_socket_data.ssl_info.cert =
ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem");
ssl_socket_data.ssl_info.is_issued_by_known_root = true;
- ssl_socket_data.ssl_info.ct_policy_compliance_required = true;
ssl_socket_data.ssl_info.ct_policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS;
@@ -1188,10 +1178,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
kCTComplianceHistogramName,
static_cast<int32_t>(ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS),
1);
- histograms.ExpectUniqueSample(
- kCTRequiredHistogramName,
- static_cast<int32_t>(ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS),
- 1);
}
// Tests that the CT compliance histograms are not recorded when there is an
@@ -1202,7 +1188,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
ssl_socket_data.ssl_info.cert =
ImportCertFromFile(GetTestCertsDirectory(), "ok_cert.pem");
ssl_socket_data.ssl_info.is_issued_by_known_root = true;
- ssl_socket_data.ssl_info.ct_policy_compliance_required = true;
ssl_socket_data.ssl_info.ct_policy_compliance =
ct::CTPolicyCompliance::CT_POLICY_NOT_DIVERSE_SCTS;
ssl_socket_data.ssl_info.cert_status = net::CERT_STATUS_DATE_INVALID;
@@ -1227,7 +1212,6 @@ TEST_F(URLRequestHttpJobWithMockSocketsTest,
EXPECT_THAT(delegate.request_status(), IsOk());
histograms.ExpectTotalCount(kCTComplianceHistogramName, 0);
- histograms.ExpectTotalCount(kCTRequiredHistogramName, 0);
}
TEST_F(URLRequestHttpJobWithMockSocketsTest, EncodingAdvertisementOnRange) {
diff --git a/chromium/net/url_request/url_request_quic_unittest.cc b/chromium/net/url_request/url_request_quic_unittest.cc
index daa4dd25d93..27fca18dc55 100644
--- a/chromium/net/url_request/url_request_quic_unittest.cc
+++ b/chromium/net/url_request/url_request_quic_unittest.cc
@@ -3,14 +3,14 @@
// found in the LICENSE file.
#include "base/bind.h"
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "build/build_config.h"
#include "net/base/features.h"
@@ -236,10 +236,10 @@ class URLRequestQuicTest
// Now set up index so that it pushes kitten and favicon.
quic::QuicBackendResponse::ServerPushInfo push_info1(
- quic::QuicUrl(UrlFromPath(kKittenPath)), spdy::SpdyHeaderBlock(),
+ quic::QuicUrl(UrlFromPath(kKittenPath)), spdy::Http2HeaderBlock(),
spdy::kV3LowestPriority, kKittenBodyValue);
quic::QuicBackendResponse::ServerPushInfo push_info2(
- quic::QuicUrl(UrlFromPath(kFaviconPath)), spdy::SpdyHeaderBlock(),
+ quic::QuicUrl(UrlFromPath(kFaviconPath)), spdy::Http2HeaderBlock(),
spdy::kV3LowestPriority, kFaviconBodyValue);
memory_cache_backend_.AddSimpleResponseWithServerPushResources(
kTestServerHost, kIndexPath, kIndexStatus, kIndexBodyValue,
diff --git a/chromium/net/url_request/url_request_unittest.cc b/chromium/net/url_request/url_request_unittest.cc
index a0c62ccd48b..e06b380e25c 100644
--- a/chromium/net/url_request/url_request_unittest.cc
+++ b/chromium/net/url_request/url_request_unittest.cc
@@ -6,7 +6,7 @@
#include <utility>
// This must be before Windows headers
-#include "base/bind_helpers.h"
+#include "base/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "build/build_config.h"
@@ -44,7 +44,7 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/test/bind_test_util.h"
+#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
@@ -640,20 +640,26 @@ class MockCertificateReportSender
const GURL& report_uri,
base::StringPiece content_type,
base::StringPiece report,
+ const NetworkIsolationKey& network_isolation_key,
base::OnceCallback<void()> success_callback,
base::OnceCallback<void(const GURL&, int, int)> error_callback) override {
latest_report_uri_ = report_uri;
latest_report_.assign(report.data(), report.size());
latest_content_type_.assign(content_type.data(), content_type.size());
+ latest_network_isolation_key_ = network_isolation_key;
}
const GURL& latest_report_uri() { return latest_report_uri_; }
const std::string& latest_report() { return latest_report_; }
const std::string& latest_content_type() { return latest_content_type_; }
+ const NetworkIsolationKey& latest_network_isolation_key() {
+ return latest_network_isolation_key_;
+ }
private:
GURL latest_report_uri_;
std::string latest_report_;
std::string latest_content_type_;
+ NetworkIsolationKey latest_network_isolation_key_;
};
// OCSPErrorTestDelegate caches the SSLInfo passed to OnSSLCertificateError.
@@ -2474,8 +2480,8 @@ TEST_F(URLRequestTest, SameSiteCookiesSpecialScheme) {
ASSERT_TRUE(https_test_server.Start());
EmbeddedTestServer http_test_server(EmbeddedTestServer::TYPE_HTTP);
RegisterDefaultHandlers(&http_test_server);
- // Ensure they are on different ports.
- ASSERT_TRUE(http_test_server.Start(https_test_server.port() + 1));
+ ASSERT_TRUE(http_test_server.Start());
+ ASSERT_NE(https_test_server.port(), http_test_server.port());
// Both hostnames should be 127.0.0.1 (so that we can use the same set of
// cookies on both, for convenience).
ASSERT_EQ(https_test_server.host_port_pair().host(),
@@ -2873,7 +2879,12 @@ class URLRequestTestHTTP : public URLRequestTest {
origin2_(url::Origin::Create(GURL("https://bar.test/"))),
isolation_info1_(IsolationInfo::CreateForInternalRequest(origin1_)),
isolation_info2_(IsolationInfo::CreateForInternalRequest(origin2_)),
- test_server_(base::FilePath(kTestFilePath)) {}
+ test_server_(base::FilePath(kTestFilePath)) {
+ // Needed for NetworkIsolationKey to make it down to the socket layer, for
+ // the PKP violation report test.
+ feature_list_.InitAndEnableFeature(
+ net::features::kPartitionConnectionsByNetworkIsolationKey);
+ }
protected:
// ProtocolHandler for the scheme that's unsafe to redirect to.
@@ -3036,6 +3047,8 @@ class URLRequestTestHTTP : public URLRequestTest {
HttpTestServer* http_test_server() { return &test_server_; }
private:
+ base::test::ScopedFeatureList feature_list_;
+
HttpTestServer test_server_;
};
@@ -4442,14 +4455,9 @@ TEST_F(URLRequestTestHTTP, NetworkDelegateInfoRedirect) {
NetLogEventType::DELEGATE_INFO));
}
-// TODO(svaldez): Update tests to use EmbeddedTestServer.
-#if !defined(OS_IOS)
// Tests handling of delegate info from a URLRequest::Delegate.
TEST_F(URLRequestTestHTTP, URLRequestDelegateInfo) {
- SpawnedTestServer test_server(SpawnedTestServer::TYPE_HTTP,
- base::FilePath(kTestFilePath));
-
- ASSERT_TRUE(test_server.Start());
+ ASSERT_TRUE(http_test_server()->Start());
AsyncLoggingUrlRequestDelegate request_delegate(
AsyncLoggingUrlRequestDelegate::NO_CANCEL);
@@ -4465,8 +4473,8 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfo) {
// the possibility of multiple reads being combined in the unlikely event
// that it occurs.
std::unique_ptr<URLRequest> r(context.CreateRequest(
- test_server.GetURL("/chunked?waitBetweenChunks=20"), DEFAULT_PRIORITY,
- &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
+ http_test_server()->GetURL("/chunked?waitBetweenChunks=20"),
+ DEFAULT_PRIORITY, &request_delegate, TRAFFIC_ANNOTATION_FOR_TESTS));
LoadStateWithParam load_state = r->GetLoadState();
r->Start();
request_delegate.RunUntilComplete();
@@ -4502,7 +4510,6 @@ TEST_F(URLRequestTestHTTP, URLRequestDelegateInfo) {
entries, log_position + 1,
NetLogEventType::URL_REQUEST_DELEGATE_RESPONSE_STARTED));
}
-#endif // !defined(OS_IOS)
// Tests handling of delegate info from a URLRequest::Delegate in the case of
// an HTTP redirect.
@@ -5202,11 +5209,14 @@ TEST_F(URLRequestTestHTTP, ProcessPKPAndSendReport) {
context.set_cert_verifier(&cert_verifier);
context.Init();
+ IsolationInfo isolation_info = IsolationInfo::CreateTransient();
+
// Now send a request to trigger the violation.
TestDelegate d;
std::unique_ptr<URLRequest> violating_request(context.CreateRequest(
https_test_server.GetURL(test_server_hostname, "/simple.html"),
DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
+ violating_request->set_isolation_info(isolation_info);
violating_request->Start();
d.RunUntilComplete();
@@ -5224,6 +5234,8 @@ TEST_F(URLRequestTestHTTP, ProcessPKPAndSendReport) {
std::string report_hostname;
EXPECT_TRUE(report_dict->GetString("hostname", &report_hostname));
EXPECT_EQ(test_server_hostname, report_hostname);
+ EXPECT_EQ(isolation_info.network_isolation_key(),
+ mock_report_sender.latest_network_isolation_key());
}
// Tests that reports do not get sent on requests to static pkp hosts that
@@ -5269,6 +5281,7 @@ TEST_F(URLRequestTestHTTP, ProcessPKPWithNoViolation) {
std::unique_ptr<URLRequest> request(context.CreateRequest(
https_test_server.GetURL(test_server_hostname, "/simple.html"),
DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
+ request->set_isolation_info(IsolationInfo::CreateTransient());
request->Start();
d.RunUntilComplete();
@@ -5277,6 +5290,8 @@ TEST_F(URLRequestTestHTTP, ProcessPKPWithNoViolation) {
EXPECT_EQ(OK, d.request_status());
EXPECT_EQ(GURL(), mock_report_sender.latest_report_uri());
EXPECT_EQ(std::string(), mock_report_sender.latest_report());
+ EXPECT_EQ(NetworkIsolationKey(),
+ mock_report_sender.latest_network_isolation_key());
TransportSecurityState::STSState sts_state;
TransportSecurityState::PKPState pkp_state;
EXPECT_TRUE(security_state.GetStaticDomainState(test_server_hostname,
@@ -5327,6 +5342,7 @@ TEST_F(URLRequestTestHTTP, PKPBypassRecorded) {
std::unique_ptr<URLRequest> request(context.CreateRequest(
https_test_server.GetURL(test_server_hostname, "/simple.html"),
DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
+ request->set_isolation_info(IsolationInfo::CreateTransient());
request->Start();
d.RunUntilComplete();
@@ -5335,6 +5351,8 @@ TEST_F(URLRequestTestHTTP, PKPBypassRecorded) {
EXPECT_EQ(OK, d.request_status());
EXPECT_EQ(GURL(), mock_report_sender.latest_report_uri());
EXPECT_EQ(std::string(), mock_report_sender.latest_report());
+ EXPECT_EQ(NetworkIsolationKey(),
+ mock_report_sender.latest_network_isolation_key());
TransportSecurityState::STSState sts_state;
TransportSecurityState::PKPState pkp_state;
EXPECT_TRUE(security_state.GetStaticDomainState(test_server_hostname,
@@ -6695,22 +6713,22 @@ TEST_F(URLRequestTestHTTP, IsolationInfoUpdatedOnRedirect) {
IsolationInfo expected_info_after_redirect;
} kTestCases[] = {
{IsolationInfo(), IsolationInfo()},
- {IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateTopFrame,
+ {IsolationInfo::Create(IsolationInfo::RequestType::kMainFrame,
original_origin, original_origin,
SiteForCookies()),
- IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateTopFrame,
+ IsolationInfo::Create(IsolationInfo::RequestType::kMainFrame,
redirect_origin, redirect_origin,
SiteForCookies::FromOrigin(redirect_origin))},
- {IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateFrameOnly,
+ {IsolationInfo::Create(IsolationInfo::RequestType::kSubFrame,
original_origin, original_origin,
SiteForCookies::FromOrigin(original_origin)),
- IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateFrameOnly,
+ IsolationInfo::Create(IsolationInfo::RequestType::kSubFrame,
original_origin, redirect_origin,
SiteForCookies::FromOrigin(original_origin))},
- {IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing,
+ {IsolationInfo::Create(IsolationInfo::RequestType::kOther,
original_origin, original_origin,
SiteForCookies()),
- IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing,
+ IsolationInfo::Create(IsolationInfo::RequestType::kOther,
original_origin, original_origin,
SiteForCookies())},
{transient_isolation_info, transient_isolation_info},
@@ -6746,8 +6764,8 @@ TEST_F(URLRequestTestHTTP, IsolationInfoUpdatedOnRedirect) {
EXPECT_EQ(!test_case.expected_info_after_redirect.network_isolation_key()
.IsTransient(),
r->was_cached());
- EXPECT_EQ(test_case.expected_info_after_redirect.redirect_mode(),
- r->isolation_info().redirect_mode());
+ EXPECT_EQ(test_case.expected_info_after_redirect.request_type(),
+ r->isolation_info().request_type());
EXPECT_EQ(test_case.expected_info_after_redirect.top_frame_origin(),
r->isolation_info().top_frame_origin());
EXPECT_EQ(test_case.expected_info_after_redirect.frame_origin(),
@@ -12213,6 +12231,122 @@ TEST_F(HTTPSEarlyDataTest, TLSEarlyDataPOSTTest) {
}
}
+// TLSEarlyDataTest tests that the 0-RTT is enabled for idempotent POST request.
+TEST_F(HTTPSEarlyDataTest, TLSEarlyDataIdempotentPOSTTest) {
+ ASSERT_TRUE(test_server_.Start());
+ context_.http_transaction_factory()->GetSession()->ClearSSLSessionCache();
+ const int kParamSize = 4 * 1024;
+ const GURL kUrl =
+ test_server_.GetURL("/zerortt?" + std::string(kParamSize, 'a'));
+
+ {
+ TestDelegate d;
+ std::unique_ptr<URLRequest> r(context_.CreateRequest(
+ kUrl, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
+ r->Start();
+ EXPECT_TRUE(r->is_pending());
+
+ base::RunLoop().Run();
+
+ EXPECT_EQ(1, d.response_started_count());
+
+ EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1_3,
+ SSLConnectionStatusToVersion(r->ssl_info().connection_status));
+ EXPECT_TRUE(r->ssl_info().unverified_cert.get());
+ EXPECT_TRUE(test_server_.GetCertificate()->EqualsIncludingChain(
+ r->ssl_info().cert.get()));
+
+ // The Early-Data header should be omitted in the initial request, and the
+ // handler should return "0".
+ EXPECT_EQ("0", d.data_received());
+ }
+
+ context_.http_transaction_factory()->GetSession()->CloseAllConnections(
+ ERR_FAILED, "Very good reason");
+ listener_.BufferNextConnection(kParamSize);
+
+ {
+ TestDelegate d;
+ std::unique_ptr<URLRequest> r(context_.CreateRequest(
+ kUrl, DEFAULT_PRIORITY, &d, TRAFFIC_ANNOTATION_FOR_TESTS));
+ r->set_method("POST");
+ r->SetIdempotency(net::IDEMPOTENT);
+ r->Start();
+ EXPECT_TRUE(r->is_pending());
+
+ base::RunLoop().Run();
+
+ EXPECT_EQ(1, d.response_started_count());
+
+ EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1_3,
+ SSLConnectionStatusToVersion(r->ssl_info().connection_status));
+ EXPECT_TRUE(r->ssl_info().unverified_cert.get());
+ EXPECT_TRUE(test_server_.GetCertificate()->EqualsIncludingChain(
+ r->ssl_info().cert.get()));
+
+ // The Early-Data header should be set since the request is set as an
+ // idempotent POST request.
+ EXPECT_EQ("1", d.data_received());
+ }
+}
+
+// TLSEarlyDataTest tests that the 0-RTT is disabled for non-idempotent request.
+TEST_F(HTTPSEarlyDataTest, TLSEarlyDataNonIdempotentRequestTest) {
+ ASSERT_TRUE(test_server_.Start());
+ context_.http_transaction_factory()->GetSession()->ClearSSLSessionCache();
+
+ {
+ TestDelegate d;
+ std::unique_ptr<URLRequest> r(context_.CreateRequest(
+ test_server_.GetURL("/zerortt"), DEFAULT_PRIORITY, &d,
+ TRAFFIC_ANNOTATION_FOR_TESTS));
+ r->Start();
+ EXPECT_TRUE(r->is_pending());
+
+ base::RunLoop().Run();
+
+ EXPECT_EQ(1, d.response_started_count());
+
+ EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1_3,
+ SSLConnectionStatusToVersion(r->ssl_info().connection_status));
+ EXPECT_TRUE(r->ssl_info().unverified_cert.get());
+ EXPECT_TRUE(test_server_.GetCertificate()->EqualsIncludingChain(
+ r->ssl_info().cert.get()));
+
+ // The Early-Data header should be omitted in the initial request, and the
+ // handler should return "0".
+ EXPECT_EQ("0", d.data_received());
+ }
+
+ context_.http_transaction_factory()->GetSession()->CloseAllConnections(
+ ERR_FAILED, "Very good reason");
+
+ {
+ TestDelegate d;
+ std::unique_ptr<URLRequest> r(context_.CreateRequest(
+ test_server_.GetURL("/zerortt"), DEFAULT_PRIORITY, &d,
+ TRAFFIC_ANNOTATION_FOR_TESTS));
+ // Sets the GET request as not idempotent.
+ r->SetIdempotency(net::NOT_IDEMPOTENT);
+ r->Start();
+ EXPECT_TRUE(r->is_pending());
+
+ base::RunLoop().Run();
+
+ EXPECT_EQ(1, d.response_started_count());
+
+ EXPECT_EQ(SSL_CONNECTION_VERSION_TLS1_3,
+ SSLConnectionStatusToVersion(r->ssl_info().connection_status));
+ EXPECT_TRUE(r->ssl_info().unverified_cert.get());
+ EXPECT_TRUE(test_server_.GetCertificate()->EqualsIncludingChain(
+ r->ssl_info().cert.get()));
+
+ // The Early-Data header should be omitted in the initial request even
+ // though it is a GET request, since the request is set as not idempotent.
+ EXPECT_EQ("0", d.data_received());
+ }
+}
+
std::unique_ptr<test_server::HttpResponse> HandleTooEarly(
bool* sent_425,
const test_server::HttpRequest& request) {
diff --git a/chromium/net/websockets/DIR_METADATA b/chromium/net/websockets/DIR_METADATA
new file mode 100644
index 00000000000..ba4c96c87f9
--- /dev/null
+++ b/chromium/net/websockets/DIR_METADATA
@@ -0,0 +1,12 @@
+# Metadata information for this directory.
+#
+# For more information on DIR_METADATA files, see:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/README.md
+#
+# For the schema of this file, see Metadata message:
+# https://source.chromium.org/chromium/infra/infra/+/master:go/src/infra/tools/dirmd/proto/dir_metadata.proto
+
+monorail {
+ component: "Blink>Network>WebSockets"
+}
+team_email: "blink-network-dev@chromium.org" \ No newline at end of file
diff --git a/chromium/net/websockets/OWNERS b/chromium/net/websockets/OWNERS
index e765c190805..3dc0bbfbdc1 100644
--- a/chromium/net/websockets/OWNERS
+++ b/chromium/net/websockets/OWNERS
@@ -1,6 +1,3 @@
ricea@chromium.org
yhirano@chromium.org
yoichio@chromium.org
-
-# TEAM: blink-network-dev@chromium.org
-# COMPONENT: Blink>Network>WebSockets
diff --git a/chromium/net/websockets/websocket_basic_handshake_stream.cc b/chromium/net/websockets/websocket_basic_handshake_stream.cc
index 692b61a50f5..8fd1f570a9b 100644
--- a/chromium/net/websockets/websocket_basic_handshake_stream.cc
+++ b/chromium/net/websockets/websocket_basic_handshake_stream.cc
@@ -453,23 +453,27 @@ int WebSocketBasicHandshakeStream::ValidateResponse(int rv) {
// Reporting "Unexpected response code: 200" in this case is not
// helpful, so use a different error message.
if (headers->GetHttpVersion() == HttpVersion(0, 9)) {
- OnFailure("Error during WebSocket handshake: Invalid status line");
+ OnFailure("Error during WebSocket handshake: Invalid status line",
+ ERR_FAILED, base::nullopt);
} else {
- OnFailure(base::StringPrintf(
- "Error during WebSocket handshake: Unexpected response code: %d",
- headers->response_code()));
+ OnFailure(base::StringPrintf("Error during WebSocket handshake: "
+ "Unexpected response code: %d",
+ headers->response_code()),
+ ERR_FAILED, headers->response_code());
}
result_ = HandshakeResult::INVALID_STATUS;
return ERR_INVALID_RESPONSE;
}
} else {
if (rv == ERR_EMPTY_RESPONSE) {
- OnFailure("Connection closed before receiving a handshake response");
+ OnFailure("Connection closed before receiving a handshake response", rv,
+ base::nullopt);
result_ = HandshakeResult::EMPTY_RESPONSE;
return rv;
}
- OnFailure(std::string("Error during WebSocket handshake: ") +
- ErrorToString(rv));
+ OnFailure(
+ std::string("Error during WebSocket handshake: ") + ErrorToString(rv),
+ rv, base::nullopt);
// Some error codes (for example ERR_CONNECTION_CLOSED) get changed to OK at
// higher levels. To prevent an unvalidated connection getting erroneously
// upgraded, don't pass through the status code unchanged if it is
@@ -508,14 +512,18 @@ int WebSocketBasicHandshakeStream::ValidateUpgradeResponse(
result_ = HandshakeResult::CONNECTED;
return OK;
}
- OnFailure("Error during WebSocket handshake: " + failure_message);
+ OnFailure("Error during WebSocket handshake: " + failure_message, ERR_FAILED,
+ base::nullopt);
return ERR_INVALID_RESPONSE;
}
-void WebSocketBasicHandshakeStream::OnFailure(const std::string& message) {
+void WebSocketBasicHandshakeStream::OnFailure(
+ const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) {
// Avoid connection reuse if auth did not happen.
state_.connection()->socket()->Disconnect();
- stream_request_->OnFailure(message);
+ stream_request_->OnFailure(message, net_error, response_code);
}
} // namespace net
diff --git a/chromium/net/websockets/websocket_basic_handshake_stream.h b/chromium/net/websockets/websocket_basic_handshake_stream.h
index 3e2fd62d196..a3576c22347 100644
--- a/chromium/net/websockets/websocket_basic_handshake_stream.h
+++ b/chromium/net/websockets/websocket_basic_handshake_stream.h
@@ -101,7 +101,9 @@ class NET_EXPORT_PRIVATE WebSocketBasicHandshakeStream final
// OK if they are, otherwise returns ERR_INVALID_RESPONSE.
int ValidateUpgradeResponse(const HttpResponseHeaders* headers);
- void OnFailure(const std::string& message);
+ void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code);
HttpStreamParser* parser() const { return state_.parser(); }
diff --git a/chromium/net/websockets/websocket_basic_stream_adapters.cc b/chromium/net/websockets/websocket_basic_stream_adapters.cc
index 5513a5d75a0..db3bd486095 100644
--- a/chromium/net/websockets/websocket_basic_stream_adapters.cc
+++ b/chromium/net/websockets/websocket_basic_stream_adapters.cc
@@ -131,8 +131,8 @@ void WebSocketSpdyStreamAdapter::OnHeadersSent() {
}
void WebSocketSpdyStreamAdapter::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) {
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) {
if (delegate_)
delegate_->OnHeadersReceived(response_headers);
}
@@ -151,10 +151,15 @@ void WebSocketSpdyStreamAdapter::OnDataSent() {
}
void WebSocketSpdyStreamAdapter::OnTrailers(
- const spdy::SpdyHeaderBlock& trailers) {}
+ const spdy::Http2HeaderBlock& trailers) {}
void WebSocketSpdyStreamAdapter::OnClose(int status) {
- DCHECK_GT(ERR_IO_PENDING, status);
+ DCHECK_NE(ERR_IO_PENDING, status);
+ DCHECK_LE(status, 0);
+
+ if (status == OK) {
+ status = ERR_CONNECTION_CLOSED;
+ }
stream_error_ = status;
stream_ = nullptr;
diff --git a/chromium/net/websockets/websocket_basic_stream_adapters.h b/chromium/net/websockets/websocket_basic_stream_adapters.h
index 0e4fed1d67c..23b6a90e9b7 100644
--- a/chromium/net/websockets/websocket_basic_stream_adapters.h
+++ b/chromium/net/websockets/websocket_basic_stream_adapters.h
@@ -61,7 +61,7 @@ class NET_EXPORT_PRIVATE WebSocketSpdyStreamAdapter
virtual ~Delegate() = default;
virtual void OnHeadersSent() = 0;
virtual void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) = 0;
+ const spdy::Http2HeaderBlock& response_headers) = 0;
// Might destroy |this|.
virtual void OnClose(int status) = 0;
};
@@ -95,11 +95,11 @@ class NET_EXPORT_PRIVATE WebSocketSpdyStreamAdapter
void OnHeadersSent() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers,
- const spdy::SpdyHeaderBlock* pushed_request_headers) override;
+ const spdy::Http2HeaderBlock& response_headers,
+ const spdy::Http2HeaderBlock* pushed_request_headers) override;
void OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) override;
void OnDataSent() override;
- void OnTrailers(const spdy::SpdyHeaderBlock& trailers) override;
+ void OnTrailers(const spdy::Http2HeaderBlock& trailers) override;
void OnClose(int status) override;
bool CanGreaseFrameType() const override;
NetLogSource source_dependency() const override;
diff --git a/chromium/net/websockets/websocket_basic_stream_adapters_test.cc b/chromium/net/websockets/websocket_basic_stream_adapters_test.cc
index a7be45400a7..7cbf3551671 100644
--- a/chromium/net/websockets/websocket_basic_stream_adapters_test.cc
+++ b/chromium/net/websockets/websocket_basic_stream_adapters_test.cc
@@ -274,7 +274,7 @@ class MockDelegate : public WebSocketSpdyStreamAdapter::Delegate {
public:
~MockDelegate() override = default;
MOCK_METHOD0(OnHeadersSent, void());
- MOCK_METHOD1(OnHeadersReceived, void(const spdy::SpdyHeaderBlock&));
+ MOCK_METHOD1(OnHeadersReceived, void(const spdy::Http2HeaderBlock&));
MOCK_METHOD1(OnClose, void(int));
};
@@ -294,12 +294,12 @@ class WebSocketSpdyStreamAdapterTest : public TestWithTaskEnvironment {
~WebSocketSpdyStreamAdapterTest() override = default;
- static spdy::SpdyHeaderBlock RequestHeaders() {
+ static spdy::Http2HeaderBlock RequestHeaders() {
return WebSocketHttp2Request("/", "www.example.org:443",
"http://www.example.org", {});
}
- static spdy::SpdyHeaderBlock ResponseHeaders() {
+ static spdy::Http2HeaderBlock ResponseHeaders() {
return WebSocketHttp2Response({});
}
@@ -963,6 +963,44 @@ TEST_F(WebSocketSpdyStreamAdapterTest, WriteCallbackDestroysAdapter) {
EXPECT_TRUE(data.AllWriteDataConsumed());
}
+TEST_F(WebSocketSpdyStreamAdapterTest,
+ OnCloseOkShouldBeTranslatedToConnectionClose) {
+ spdy::SpdySerializedFrame response_headers(
+ spdy_util_.ConstructSpdyResponseHeaders(1, ResponseHeaders(), false));
+ spdy::SpdySerializedFrame close(
+ spdy_util_.ConstructSpdyRstStream(1, spdy::ERROR_CODE_NO_ERROR));
+ MockRead reads[] = {CreateMockRead(response_headers, 1),
+ CreateMockRead(close, 2), MockRead(ASYNC, 0, 3)};
+ spdy::SpdySerializedFrame request_headers(spdy_util_.ConstructSpdyHeaders(
+ 1, RequestHeaders(), DEFAULT_PRIORITY, false));
+ MockWrite writes[] = {CreateMockWrite(request_headers, 0)};
+ SequencedSocketData data(reads, writes);
+ AddSocketData(&data);
+ AddSSLSocketData();
+
+ EXPECT_CALL(mock_delegate_, OnHeadersSent());
+ EXPECT_CALL(mock_delegate_, OnHeadersReceived(_));
+
+ base::WeakPtr<SpdySession> session = CreateSpdySession();
+ base::WeakPtr<SpdyStream> stream = CreateSpdyStream(session);
+ WebSocketSpdyStreamAdapter adapter(stream, &mock_delegate_,
+ NetLogWithSource());
+ EXPECT_TRUE(adapter.is_initialized());
+
+ EXPECT_CALL(mock_delegate_, OnClose(ERR_CONNECTION_CLOSED));
+
+ int rv = stream->SendRequestHeaders(RequestHeaders(), MORE_DATA_TO_SEND);
+ EXPECT_THAT(rv, IsError(ERR_IO_PENDING));
+
+ const int kReadBufSize = 1024;
+ auto read_buf = base::MakeRefCounted<IOBuffer>(kReadBufSize);
+ TestCompletionCallback callback;
+ rv = adapter.Read(read_buf.get(), kReadBufSize, callback.callback());
+ EXPECT_THAT(rv, IsError(ERR_IO_PENDING));
+ rv = callback.WaitForResult();
+ ASSERT_EQ(ERR_CONNECTION_CLOSED, rv);
+}
+
} // namespace test
} // namespace net
diff --git a/chromium/net/websockets/websocket_channel.cc b/chromium/net/websockets/websocket_channel.cc
index ab1cf1abafc..ab44881b4a9 100644
--- a/chromium/net/websockets/websocket_channel.cc
+++ b/chromium/net/websockets/websocket_channel.cc
@@ -240,8 +240,10 @@ class WebSocketChannel::ConnectDelegate
// |this| may have been deleted.
}
- void OnFailure(const std::string& message) override {
- creator_->OnConnectFailure(message);
+ void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) override {
+ creator_->OnConnectFailure(message, net_error, response_code);
// |this| has been deleted.
}
@@ -473,7 +475,8 @@ void WebSocketChannel::SendAddChannelRequestWithSuppliedCallback(
if (!socket_url.SchemeIsWSOrWSS()) {
// TODO(ricea): Kill the renderer (this error should have been caught by
// Javascript).
- event_interface_->OnFailChannel("Invalid scheme");
+ event_interface_->OnFailChannel("Invalid scheme", ERR_FAILED,
+ base::nullopt);
// |this| is deleted here.
return;
}
@@ -508,7 +511,9 @@ void WebSocketChannel::OnConnectSuccess(
// |this| may have been deleted after OnAddChannelResponse.
}
-void WebSocketChannel::OnConnectFailure(const std::string& message) {
+void WebSocketChannel::OnConnectFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) {
DCHECK_EQ(CONNECTING, state_);
// Copy the message before we delete its owner.
@@ -517,7 +522,7 @@ void WebSocketChannel::OnConnectFailure(const std::string& message) {
SetState(CLOSED);
stream_request_.reset();
- event_interface_->OnFailChannel(message_copy);
+ event_interface_->OnFailChannel(message_copy, net_error, response_code);
// |this| has been deleted.
}
@@ -956,7 +961,7 @@ void WebSocketChannel::FailChannel(const std::string& message,
// handshake.
stream_->Close();
SetState(CLOSED);
- event_interface_->OnFailChannel(message);
+ event_interface_->OnFailChannel(message, ERR_FAILED, base::nullopt);
}
ChannelState WebSocketChannel::SendClose(uint16_t code,
diff --git a/chromium/net/websockets/websocket_channel.h b/chromium/net/websockets/websocket_channel.h
index 60d57fb0547..404498276f7 100644
--- a/chromium/net/websockets/websocket_channel.h
+++ b/chromium/net/websockets/websocket_channel.h
@@ -17,6 +17,7 @@
#include "base/i18n/streaming_utf8_validator.h"
#include "base/macros.h"
#include "base/memory/scoped_refptr.h"
+#include "base/optional.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "net/base/net_export.h"
@@ -196,7 +197,9 @@ class NET_EXPORT WebSocketChannel {
// Failure callback from WebSocketStream::CreateAndConnectStream(). Reports
// failure to the event interface. May delete |this|.
- void OnConnectFailure(const std::string& message);
+ void OnConnectFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code);
// SSL certificate error callback from
// WebSocketStream::CreateAndConnectStream(). Forwards the request to the
diff --git a/chromium/net/websockets/websocket_channel_test.cc b/chromium/net/websockets/websocket_channel_test.cc
index cde91ac43e6..90df01a8e53 100644
--- a/chromium/net/websockets/websocket_channel_test.cc
+++ b/chromium/net/websockets/websocket_channel_test.cc
@@ -16,7 +16,6 @@
#include <vector>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
#include "base/callback_helpers.h"
#include "base/location.h"
@@ -170,7 +169,8 @@ class MockWebSocketEventInterface : public WebSocketEventInterface {
MOCK_METHOD0(HasPendingDataFrames, bool(void)); // NOLINT
MOCK_METHOD0(OnSendDataFrameDone, void(void)); // NOLINT
MOCK_METHOD0(OnClosingHandshake, void(void)); // NOLINT
- MOCK_METHOD1(OnFailChannel, void(const std::string&)); // NOLINT
+ MOCK_METHOD3(OnFailChannel,
+ void(const std::string&, int, base::Optional<int>)); // NOLINT
MOCK_METHOD3(OnDropChannel,
void(bool, uint16_t, const std::string&)); // NOLINT
@@ -223,7 +223,9 @@ class FakeWebSocketEventInterface : public WebSocketEventInterface {
void OnSendDataFrameDone() override {}
bool HasPendingDataFrames() override { return false; }
void OnClosingHandshake() override {}
- void OnFailChannel(const std::string& message) override {}
+ void OnFailChannel(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) override {}
void OnDropChannel(bool was_clean,
uint16_t code,
const std::string& reason) override {}
@@ -840,9 +842,9 @@ class WebSocketChannelTest : public TestWithTaskEnvironment {
: socket_url("ws://ws/"),
origin(url::Origin::Create(GURL("http://ws"))),
site_for_cookies(SiteForCookies::FromUrl(GURL("http://ws/"))) {
- this->isolation_info = IsolationInfo::Create(
- IsolationInfo::RedirectMode::kUpdateNothing, origin, origin,
- SiteForCookies::FromOrigin(origin));
+ this->isolation_info =
+ IsolationInfo::Create(IsolationInfo::RequestType::kOther, origin,
+ origin, SiteForCookies::FromOrigin(origin));
}
// URLRequestContext object.
@@ -930,7 +932,7 @@ class WebSocketChannelStreamTest : public WebSocketChannelEventInterfaceTest {
.Times(AnyNumber());
EXPECT_CALL(*event_interface_, OnClosingHandshake()).Times(AnyNumber());
EXPECT_CALL(*event_interface_, OnSendDataFrameDone()).Times(AnyNumber());
- EXPECT_CALL(*event_interface_, OnFailChannel(_)).Times(AnyNumber());
+ EXPECT_CALL(*event_interface_, OnFailChannel(_, _, _)).Times(AnyNumber());
EXPECT_CALL(*event_interface_, OnDropChannel(_, _, _)).Times(AnyNumber());
}
@@ -981,7 +983,7 @@ TEST_F(WebSocketChannelTest, EverythingIsPassedToTheCreatorFunction) {
connect_data_.site_for_cookies =
SiteForCookies::FromUrl(GURL("http://example.com/"));
connect_data_.isolation_info = net::IsolationInfo::Create(
- IsolationInfo::RedirectMode::kUpdateNothing, connect_data_.origin,
+ IsolationInfo::RequestType::kOther, connect_data_.origin,
connect_data_.origin, SiteForCookies::FromOrigin(connect_data_.origin));
connect_data_.requested_subprotocols.push_back("Sinbad");
@@ -1013,15 +1015,16 @@ TEST_F(WebSocketChannelEventInterfaceTest, ConnectSuccessReported) {
}
TEST_F(WebSocketChannelEventInterfaceTest, ConnectFailureReported) {
- EXPECT_CALL(*event_interface_, OnFailChannel("hello"));
+ EXPECT_CALL(*event_interface_, OnFailChannel("hello", ERR_FAILED, _));
CreateChannelAndConnect();
- connect_data_.argument_saver.connect_delegate->OnFailure("hello");
+ connect_data_.argument_saver.connect_delegate->OnFailure("hello", ERR_FAILED,
+ base::nullopt);
}
TEST_F(WebSocketChannelEventInterfaceTest, NonWebSocketSchemeRejected) {
- EXPECT_CALL(*event_interface_, OnFailChannel("Invalid scheme"));
+ EXPECT_CALL(*event_interface_, OnFailChannel("Invalid scheme", _, _));
connect_data_.socket_url = GURL("http://www.google.com/");
CreateChannelAndConnect();
}
@@ -1310,7 +1313,8 @@ TEST_F(WebSocketChannelEventInterfaceTest, MaskedFramesAreRejected) {
EXPECT_CALL(
*event_interface_,
OnFailChannel(
- "A server must not mask any frames that it sends to the client."));
+ "A server must not mask any frames that it sends to the client.", _,
+ _));
}
CreateChannelAndConnectSuccessfully();
@@ -1329,7 +1333,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, UnknownOpCodeIsRejected) {
InSequence s;
EXPECT_CALL(*event_interface_, OnAddChannelResponse(_, _, _));
EXPECT_CALL(*event_interface_,
- OnFailChannel("Unrecognized frame opcode: 4"));
+ OnFailChannel("Unrecognized frame opcode: 4", _, _));
}
CreateChannelAndConnectSuccessfully();
@@ -1400,7 +1404,8 @@ TEST_F(WebSocketChannelEventInterfaceTest, FrameAfterInvalidFrame) {
EXPECT_CALL(
*event_interface_,
OnFailChannel(
- "A server must not mask any frames that it sends to the client."));
+ "A server must not mask any frames that it sends to the client.", _,
+ _));
}
CreateChannelAndConnectSuccessfully();
@@ -1521,7 +1526,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, SyncProtocolErrorGivesStatus1002) {
set_stream(std::move(stream));
EXPECT_CALL(*event_interface_, OnAddChannelResponse(_, _, _));
- EXPECT_CALL(*event_interface_, OnFailChannel("Invalid frame header"));
+ EXPECT_CALL(*event_interface_, OnFailChannel("Invalid frame header", _, _));
CreateChannelAndConnectSuccessfully();
}
@@ -1533,7 +1538,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, AsyncProtocolErrorGivesStatus1002) {
ERR_WS_PROTOCOL_ERROR);
set_stream(std::move(stream));
EXPECT_CALL(*event_interface_, OnAddChannelResponse(_, _, _));
- EXPECT_CALL(*event_interface_, OnFailChannel("Invalid frame header"));
+ EXPECT_CALL(*event_interface_, OnFailChannel("Invalid frame header", _, _));
CreateChannelAndConnectSuccessfully();
base::RunLoop().RunUntilIdle();
@@ -1560,7 +1565,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, FailJustAfterHandshake) {
{
InSequence s;
EXPECT_CALL(*event_interface_, OnStartOpeningHandshakeCalled());
- EXPECT_CALL(*event_interface_, OnFailChannel("bye"));
+ EXPECT_CALL(*event_interface_, OnFailChannel("bye", _, _));
}
CreateChannelAndConnect();
@@ -1576,7 +1581,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, FailJustAfterHandshake) {
url, response_headers, IPEndPoint(), base::Time());
connect_delegate->OnStartOpeningHandshake(std::move(request_info));
- connect_delegate->OnFailure("bye");
+ connect_delegate->OnFailure("bye", ERR_FAILED, base::nullopt);
base::RunLoop().RunUntilIdle();
}
@@ -1596,7 +1601,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, DataAfterCloseIsRejected) {
InSequence s;
EXPECT_CALL(*event_interface_, OnClosingHandshake());
EXPECT_CALL(*event_interface_,
- OnFailChannel("Data frame received after close"));
+ OnFailChannel("Data frame received after close", _, _));
}
CreateChannelAndConnectSuccessfully();
@@ -1614,7 +1619,8 @@ TEST_F(WebSocketChannelEventInterfaceTest, OneByteClosePayloadMessage) {
EXPECT_CALL(
*event_interface_,
OnFailChannel(
- "Received a broken close frame containing an invalid size body."));
+ "Received a broken close frame containing an invalid size body.", _,
+ _));
CreateChannelAndConnectSuccessfully();
}
@@ -1632,7 +1638,8 @@ TEST_F(WebSocketChannelEventInterfaceTest, ClosePayloadReservedStatusMessage) {
EXPECT_CALL(
*event_interface_,
OnFailChannel(
- "Received a broken close frame containing a reserved status code."));
+ "Received a broken close frame containing a reserved status code.", _,
+ _));
CreateChannelAndConnectSuccessfully();
}
@@ -1649,8 +1656,8 @@ TEST_F(WebSocketChannelEventInterfaceTest, ClosePayloadInvalidReason) {
EXPECT_CALL(*event_interface_, OnAddChannelResponse(_, _, _));
EXPECT_CALL(
*event_interface_,
- OnFailChannel(
- "Received a broken close frame containing invalid UTF-8."));
+ OnFailChannel("Received a broken close frame containing invalid UTF-8.",
+ _, _));
CreateChannelAndConnectSuccessfully();
}
@@ -1672,9 +1679,9 @@ TEST_F(WebSocketChannelEventInterfaceTest, ReservedBitsMustNotBeSet) {
set_stream(std::move(stream));
EXPECT_CALL(*event_interface_, OnAddChannelResponse(_, _, _));
EXPECT_CALL(*event_interface_,
- OnFailChannel(
- "One or more reserved bits are on: reserved1 = 1, "
- "reserved2 = 0, reserved3 = 0"));
+ OnFailChannel("One or more reserved bits are on: reserved1 = 1, "
+ "reserved2 = 0, reserved3 = 0",
+ _, _));
CreateChannelAndConnectSuccessfully();
}
@@ -2242,9 +2249,9 @@ TEST_F(WebSocketChannelEventInterfaceTest, ReadBinaryFramesAre8BitClean) {
// Invalid UTF-8 is not permitted in Text frames.
TEST_F(WebSocketChannelSendUtf8Test, InvalidUtf8Rejected) {
- EXPECT_CALL(
- *event_interface_,
- OnFailChannel("Browser sent a text frame containing invalid UTF-8"));
+ EXPECT_CALL(*event_interface_,
+ OnFailChannel(
+ "Browser sent a text frame containing invalid UTF-8", _, _));
CreateChannelAndConnectSuccessfully();
@@ -2255,9 +2262,9 @@ TEST_F(WebSocketChannelSendUtf8Test, InvalidUtf8Rejected) {
// A Text message cannot end with a partial UTF-8 character.
TEST_F(WebSocketChannelSendUtf8Test, IncompleteCharacterInFinalFrame) {
- EXPECT_CALL(
- *event_interface_,
- OnFailChannel("Browser sent a text frame containing invalid UTF-8"));
+ EXPECT_CALL(*event_interface_,
+ OnFailChannel(
+ "Browser sent a text frame containing invalid UTF-8", _, _));
CreateChannelAndConnectSuccessfully();
@@ -2290,9 +2297,9 @@ TEST_F(WebSocketChannelSendUtf8Test, ValidCharacterSplitBetweenFrames) {
// Similarly, an invalid character should be detected even if split.
TEST_F(WebSocketChannelSendUtf8Test, InvalidCharacterSplit) {
- EXPECT_CALL(
- *event_interface_,
- OnFailChannel("Browser sent a text frame containing invalid UTF-8"));
+ EXPECT_CALL(*event_interface_,
+ OnFailChannel(
+ "Browser sent a text frame containing invalid UTF-8", _, _));
CreateChannelAndConnectSuccessfully();
@@ -2306,9 +2313,9 @@ TEST_F(WebSocketChannelSendUtf8Test, InvalidCharacterSplit) {
// An invalid character must be detected in continuation frames.
TEST_F(WebSocketChannelSendUtf8Test, InvalidByteInContinuation) {
- EXPECT_CALL(
- *event_interface_,
- OnFailChannel("Browser sent a text frame containing invalid UTF-8"));
+ EXPECT_CALL(*event_interface_,
+ OnFailChannel(
+ "Browser sent a text frame containing invalid UTF-8", _, _));
CreateChannelAndConnectSuccessfully();
@@ -2364,7 +2371,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, ReceivedInvalidUtf8) {
EXPECT_CALL(*event_interface_, OnAddChannelResponse(_, _, _));
EXPECT_CALL(*event_interface_,
- OnFailChannel("Could not decode a text frame as UTF-8."));
+ OnFailChannel("Could not decode a text frame as UTF-8.", _, _));
CreateChannelAndConnectSuccessfully();
base::RunLoop().RunUntilIdle();
@@ -2558,7 +2565,8 @@ TEST_F(WebSocketChannelEventInterfaceTest, BogusContinuation) {
EXPECT_CALL(
*event_interface_,
OnFailChannel(
- "Received start of new message but previous message is unfinished."));
+ "Received start of new message but previous message is unfinished.",
+ _, _));
CreateChannelAndConnectSuccessfully();
}
@@ -2574,7 +2582,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, MessageStartingWithContinuation) {
EXPECT_CALL(*event_interface_, OnAddChannelResponse(_, _, _));
EXPECT_CALL(*event_interface_,
- OnFailChannel("Received unexpected continuation frame."));
+ OnFailChannel("Received unexpected continuation frame.", _, _));
CreateChannelAndConnectSuccessfully();
}
diff --git a/chromium/net/websockets/websocket_end_to_end_test.cc b/chromium/net/websockets/websocket_end_to_end_test.cc
index 687cb4322a4..d12fedd1115 100644
--- a/chromium/net/websockets/websocket_end_to_end_test.cc
+++ b/chromium/net/websockets/websocket_end_to_end_test.cc
@@ -15,8 +15,8 @@
#include <utility>
#include "base/bind.h"
-#include "base/bind_helpers.h"
#include "base/callback.h"
+#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
@@ -116,7 +116,9 @@ class ConnectTestingEventInterface : public WebSocketEventInterface {
uint16_t code,
const std::string& reason) override;
- void OnFailChannel(const std::string& message) override;
+ void OnFailChannel(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) override;
void OnStartOpeningHandshake(
std::unique_ptr<WebSocketHandshakeRequestInfo> request) override;
@@ -188,7 +190,10 @@ void ConnectTestingEventInterface::OnDropChannel(bool was_clean,
uint16_t code,
const std::string& reason) {}
-void ConnectTestingEventInterface::OnFailChannel(const std::string& message) {
+void ConnectTestingEventInterface::OnFailChannel(
+ const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) {
failed_ = true;
failure_message_ = message;
QuitNestedEventLoop();
@@ -292,9 +297,9 @@ class WebSocketEndToEndTest : public TestWithTaskEnvironment {
url::Origin origin = url::Origin::Create(GURL("http://localhost"));
net::SiteForCookies site_for_cookies =
net::SiteForCookies::FromOrigin(origin);
- IsolationInfo isolation_info = IsolationInfo::Create(
- IsolationInfo::RedirectMode::kUpdateNothing, origin, origin,
- SiteForCookies::FromOrigin(origin));
+ IsolationInfo isolation_info =
+ IsolationInfo::Create(IsolationInfo::RequestType::kOther, origin,
+ origin, SiteForCookies::FromOrigin(origin));
event_interface_ = new ConnectTestingEventInterface();
channel_ = std::make_unique<WebSocketChannel>(
base::WrapUnique(event_interface_), &context_);
diff --git a/chromium/net/websockets/websocket_event_interface.h b/chromium/net/websockets/websocket_event_interface.h
index df55472067e..204ccf66eed 100644
--- a/chromium/net/websockets/websocket_event_interface.h
+++ b/chromium/net/websockets/websocket_event_interface.h
@@ -96,8 +96,16 @@ class NET_EXPORT WebSocketEventInterface {
// The channel should not be used again after OnFailChannel() has been
// called.
//
+ // |message| is a human readable string describing the failure. (It may be
+ // empty.) |net_error| contains the network error code for the failure, which
+ // may be |OK| if the failure was at a higher level. |response_code| contains
+ // the HTTP status code that caused the failure, or |base::nullopt| if the
+ // attempt didn't get that far.
+ //
// This function deletes the Channel.
- virtual void OnFailChannel(const std::string& message) = 0;
+ virtual void OnFailChannel(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) = 0;
// Called when the browser starts the WebSocket Opening Handshake.
virtual void OnStartOpeningHandshake(
diff --git a/chromium/net/websockets/websocket_handshake_stream_create_helper_test.cc b/chromium/net/websockets/websocket_handshake_stream_create_helper_test.cc
index ef4f7a59d24..7ede1a444d2 100644
--- a/chromium/net/websockets/websocket_handshake_stream_create_helper_test.cc
+++ b/chromium/net/websockets/websocket_handshake_stream_create_helper_test.cc
@@ -117,7 +117,9 @@ class TestConnectDelegate : public WebSocketStream::ConnectDelegate {
void OnSuccess(
std::unique_ptr<WebSocketStream> stream,
std::unique_ptr<WebSocketHandshakeResponseInfo> response) override {}
- void OnFailure(const std::string& failure_message) override {}
+ void OnFailure(const std::string& failure_message,
+ int net_error,
+ base::Optional<int> response_code) override {}
void OnStartOpeningHandshake(
std::unique_ptr<WebSocketHandshakeRequestInfo> request) override {}
void OnSSLCertificateError(
@@ -144,7 +146,10 @@ class MockWebSocketStreamRequestAPI : public WebSocketStreamRequestAPI {
void(WebSocketBasicHandshakeStream* handshake_stream));
MOCK_METHOD1(OnHttp2HandshakeStreamCreated,
void(WebSocketHttp2HandshakeStream* handshake_stream));
- MOCK_METHOD1(OnFailure, void(const std::string& message));
+ MOCK_METHOD3(OnFailure,
+ void(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code));
};
class WebSocketHandshakeStreamCreateHelperTest
@@ -176,7 +181,7 @@ class WebSocketHandshakeStreamCreateHelperTest
NOTREACHED();
}
- EXPECT_CALL(stream_request_, OnFailure(_)).Times(0);
+ EXPECT_CALL(stream_request_, OnFailure(_, _, _)).Times(0);
HttpRequestInfo request_info;
request_info.url = url;
@@ -229,14 +234,14 @@ class WebSocketHandshakeStreamCreateHelperTest
}
case HTTP2_HANDSHAKE_STREAM: {
SpdyTestUtil spdy_util;
- spdy::SpdyHeaderBlock request_header_block = WebSocketHttp2Request(
+ spdy::Http2HeaderBlock request_header_block = WebSocketHttp2Request(
kPath, "www.example.org", kOrigin, extra_request_headers);
spdy::SpdySerializedFrame request_headers(
spdy_util.ConstructSpdyHeaders(1, std::move(request_header_block),
DEFAULT_PRIORITY, false));
MockWrite writes[] = {CreateMockWrite(request_headers, 0)};
- spdy::SpdyHeaderBlock response_header_block =
+ spdy::Http2HeaderBlock response_header_block =
WebSocketHttp2Response(extra_response_headers);
spdy::SpdySerializedFrame response_headers(
spdy_util.ConstructSpdyResponseHeaders(
diff --git a/chromium/net/websockets/websocket_http2_handshake_stream.cc b/chromium/net/websockets/websocket_http2_handshake_stream.cc
index 2a81c69a4b4..ce60d0c7d6a 100644
--- a/chromium/net/websockets/websocket_http2_handshake_stream.cc
+++ b/chromium/net/websockets/websocket_http2_handshake_stream.cc
@@ -90,8 +90,9 @@ int WebSocketHttp2HandshakeStream::SendRequest(
DCHECK(headers.HasHeader(websockets::kSecWebSocketVersion));
if (!session_) {
- OnFailure("Connection closed before sending request.");
- return ERR_CONNECTION_CLOSED;
+ const int rv = ERR_CONNECTION_CLOSED;
+ OnFailure("Connection closed before sending request.", rv, base::nullopt);
+ return rv;
}
http_response_info_ = response;
@@ -99,7 +100,7 @@ int WebSocketHttp2HandshakeStream::SendRequest(
IPEndPoint address;
int result = session_->GetPeerAddress(&address);
if (result != OK) {
- OnFailure("Error getting IP address.");
+ OnFailure("Error getting IP address.", result, base::nullopt);
return result;
}
http_response_info_->remote_endpoint = address;
@@ -261,7 +262,7 @@ void WebSocketHttp2HandshakeStream::OnHeadersSent() {
}
void WebSocketHttp2HandshakeStream::OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) {
+ const spdy::Http2HeaderBlock& response_headers) {
DCHECK(!response_headers_complete_);
DCHECK(http_response_info_);
@@ -303,7 +304,8 @@ void WebSocketHttp2HandshakeStream::OnClose(int status) {
if (!response_headers_complete_)
result_ = HandshakeResult::HTTP2_FAILED;
- OnFailure(std::string("Stream closed with error: ") + ErrorToString(status));
+ OnFailure(std::string("Stream closed with error: ") + ErrorToString(status),
+ status, base::nullopt);
if (callback_)
std::move(callback_).Run(status);
@@ -343,9 +345,11 @@ int WebSocketHttp2HandshakeStream::ValidateResponse() {
// Other status codes are potentially risky (see the warnings in the
// WHATWG WebSocket API spec) and so are dropped by default.
default:
- OnFailure(base::StringPrintf(
- "Error during WebSocket handshake: Unexpected response code: %d",
- headers->response_code()));
+ OnFailure(
+ base::StringPrintf(
+ "Error during WebSocket handshake: Unexpected response code: %d",
+ headers->response_code()),
+ ERR_FAILED, headers->response_code());
result_ = HandshakeResult::HTTP2_INVALID_STATUS;
return ERR_INVALID_RESPONSE;
}
@@ -367,12 +371,18 @@ int WebSocketHttp2HandshakeStream::ValidateUpgradeResponse(
result_ = HandshakeResult::HTTP2_CONNECTED;
return OK;
}
- OnFailure("Error during WebSocket handshake: " + failure_message);
- return ERR_INVALID_RESPONSE;
+
+ const int rv = ERR_INVALID_RESPONSE;
+ OnFailure("Error during WebSocket handshake: " + failure_message, rv,
+ base::nullopt);
+ return rv;
}
-void WebSocketHttp2HandshakeStream::OnFailure(const std::string& message) {
- stream_request_->OnFailure(message);
+void WebSocketHttp2HandshakeStream::OnFailure(
+ const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) {
+ stream_request_->OnFailure(message, net_error, response_code);
}
} // namespace net
diff --git a/chromium/net/websockets/websocket_http2_handshake_stream.h b/chromium/net/websockets/websocket_http2_handshake_stream.h
index 2e40191d902..634806f732a 100644
--- a/chromium/net/websockets/websocket_http2_handshake_stream.h
+++ b/chromium/net/websockets/websocket_http2_handshake_stream.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/optional.h"
#include "net/base/completion_once_callback.h"
#include "net/base/io_buffer.h"
#include "net/base/net_export.h"
@@ -99,7 +100,7 @@ class NET_EXPORT_PRIVATE WebSocketHttp2HandshakeStream
// WebSocketSpdyStreamAdapter::Delegate methods.
void OnHeadersSent() override;
void OnHeadersReceived(
- const spdy::SpdyHeaderBlock& response_headers) override;
+ const spdy::Http2HeaderBlock& response_headers) override;
void OnClose(int status) override;
// Called by |spdy_stream_request_| when requested stream is ready.
@@ -113,7 +114,9 @@ class NET_EXPORT_PRIVATE WebSocketHttp2HandshakeStream
// in which case returns OK, otherwise returns ERR_INVALID_RESPONSE.
int ValidateUpgradeResponse(const HttpResponseHeaders* headers);
- void OnFailure(const std::string& message);
+ void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code);
HandshakeResult result_;
@@ -126,7 +129,7 @@ class NET_EXPORT_PRIVATE WebSocketHttp2HandshakeStream
HttpResponseInfo* http_response_info_;
- spdy::SpdyHeaderBlock http2_request_headers_;
+ spdy::Http2HeaderBlock http2_request_headers_;
// The sub-protocols we requested.
std::vector<std::string> requested_sub_protocols_;
diff --git a/chromium/net/websockets/websocket_stream.cc b/chromium/net/websockets/websocket_stream.cc
index 71f5eac2c09..02754d44264 100644
--- a/chromium/net/websockets/websocket_stream.cc
+++ b/chromium/net/websockets/websocket_stream.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/histogram_functions.h"
+#include "base/optional.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "net/base/ip_endpoint.h"
@@ -98,8 +99,8 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequestAPI {
traffic_annotation)),
connect_delegate_(std::move(connect_delegate)),
api_delegate_(std::move(api_delegate)) {
- DCHECK_EQ(IsolationInfo::RedirectMode::kUpdateNothing,
- isolation_info.redirect_mode());
+ DCHECK_EQ(IsolationInfo::RequestType::kOther,
+ isolation_info.request_type());
HttpRequestHeaders headers = additional_headers;
headers.SetHeader(websockets::kUpgrade, websockets::kWebSocketLowercase);
@@ -147,10 +148,14 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequestAPI {
OnHandshakeStreamCreated(handshake_stream);
}
- void OnFailure(const std::string& message) override {
+ void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) override {
if (api_delegate_)
- api_delegate_->OnFailure(message);
+ api_delegate_->OnFailure(message, net_error, response_code);
failure_message_ = message;
+ failure_net_error_ = net_error;
+ failure_response_code_ = response_code;
}
void Start(std::unique_ptr<base::OneShotTimer> timer) {
@@ -172,8 +177,9 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequestAPI {
if (!handshake_stream_) {
ReportFailureWithMessage(
- "No handshake stream has been created "
- "or handshake stream is already destroyed.");
+ "No handshake stream has been created or handshake stream is already "
+ "destroyed.",
+ ERR_FAILED, base::nullopt);
return;
}
@@ -205,7 +211,7 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequestAPI {
}
}
- void ReportFailure(int net_error) {
+ void ReportFailure(int net_error, base::Optional<int> response_code) {
DCHECK(timer_);
timer_->Stop();
if (failure_message_.empty()) {
@@ -224,11 +230,16 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequestAPI {
break;
}
}
- ReportFailureWithMessage(failure_message_);
+
+ ReportFailureWithMessage(
+ failure_message_, failure_net_error_.value_or(net_error),
+ failure_response_code_ ? failure_response_code_ : response_code);
}
- void ReportFailureWithMessage(const std::string& failure_message) {
- connect_delegate_->OnFailure(failure_message);
+ void ReportFailureWithMessage(const std::string& failure_message,
+ int net_error,
+ base::Optional<int> response_code) {
+ connect_delegate_->OnFailure(failure_message, net_error, response_code);
}
WebSocketStream::ConnectDelegate* connect_delegate() const {
@@ -265,8 +276,10 @@ class WebSocketStreamRequestImpl : public WebSocketStreamRequestAPI {
// succeeded.
base::WeakPtr<WebSocketHandshakeStreamBase> handshake_stream_;
- // The failure message supplied by WebSocketBasicHandshakeStream, if any.
+ // The failure information supplied by WebSocketBasicHandshakeStream, if any.
std::string failure_message_;
+ base::Optional<int> failure_net_error_;
+ base::Optional<int> failure_response_code_;
// A timer for handshake timeout.
std::unique_ptr<base::OneShotTimer> timer_;
@@ -339,7 +352,7 @@ void Delegate::OnResponseStarted(URLRequest* request, int net_error) {
if (net_error != OK) {
DVLOG(3) << "OnResponseStarted (request failed)";
- owner_->ReportFailure(net_error);
+ owner_->ReportFailure(net_error, base::nullopt);
return;
}
const int response_code = request->GetResponseCode();
@@ -352,7 +365,7 @@ void Delegate::OnResponseStarted(URLRequest* request, int net_error) {
return;
}
- owner_->ReportFailure(net_error);
+ owner_->ReportFailure(net_error, base::nullopt);
return;
}
@@ -363,15 +376,17 @@ void Delegate::OnResponseStarted(URLRequest* request, int net_error) {
case HTTP_UNAUTHORIZED:
owner_->ReportFailureWithMessage(
- "HTTP Authentication failed; no valid credentials available");
+ "HTTP Authentication failed; no valid credentials available",
+ net_error, response_code);
return;
case HTTP_PROXY_AUTHENTICATION_REQUIRED:
- owner_->ReportFailureWithMessage("Proxy authentication failed");
+ owner_->ReportFailureWithMessage("Proxy authentication failed", net_error,
+ response_code);
return;
default:
- owner_->ReportFailure(net_error);
+ owner_->ReportFailure(net_error, response_code);
}
}
@@ -391,7 +406,7 @@ void Delegate::OnAuthRequired(URLRequest* request,
return;
if (rv != OK) {
request->LogUnblocked();
- owner_->ReportFailure(rv);
+ owner_->ReportFailure(rv, base::nullopt);
return;
}
OnAuthRequiredComplete(request, nullptr);
diff --git a/chromium/net/websockets/websocket_stream.h b/chromium/net/websockets/websocket_stream.h
index b9b6a56804e..ce7f5f625a1 100644
--- a/chromium/net/websockets/websocket_stream.h
+++ b/chromium/net/websockets/websocket_stream.h
@@ -66,7 +66,9 @@ class NET_EXPORT_PRIVATE WebSocketStreamRequestAPI
WebSocketBasicHandshakeStream* handshake_stream) = 0;
virtual void OnHttp2HandshakeStreamCreated(
WebSocketHttp2HandshakeStream* handshake_stream) = 0;
- virtual void OnFailure(const std::string& message) = 0;
+ virtual void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) = 0;
};
// WebSocketStream is a transport-agnostic interface for reading and writing
@@ -100,7 +102,9 @@ class NET_EXPORT_PRIVATE WebSocketStream {
// Called on failure to connect.
// |message| contains defails of the failure.
- virtual void OnFailure(const std::string& message) = 0;
+ virtual void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) = 0;
// Called when the WebSocket Opening Handshake starts.
virtual void OnStartOpeningHandshake(
diff --git a/chromium/net/websockets/websocket_stream_cookie_test.cc b/chromium/net/websockets/websocket_stream_cookie_test.cc
index b8f98d661e1..e8a218ec36d 100644
--- a/chromium/net/websockets/websocket_stream_cookie_test.cc
+++ b/chromium/net/websockets/websocket_stream_cookie_test.cc
@@ -144,8 +144,8 @@ TEST_P(WebSocketStreamClientUseCookieTest, ClientUseCookie) {
url::Origin::Create(GURL("http://www.example.com"));
const SiteForCookies site_for_cookies = SiteForCookies::FromOrigin(origin);
const IsolationInfo isolation_info =
- IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing, origin,
- origin, SiteForCookies::FromOrigin(origin));
+ IsolationInfo::Create(IsolationInfo::RequestType::kOther, origin, origin,
+ SiteForCookies::FromOrigin(origin));
const std::string cookie_line(GetParam().cookie_line);
const std::string cookie_header(AddCRLFIfNotEmpty(GetParam().cookie_header));
@@ -184,8 +184,8 @@ TEST_P(WebSocketStreamServerSetCookieTest, ServerSetCookie) {
url::Origin::Create(GURL("http://www.example.com"));
const SiteForCookies site_for_cookies = SiteForCookies::FromOrigin(origin);
const IsolationInfo isolation_info =
- IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing, origin,
- origin, SiteForCookies::FromOrigin(origin));
+ IsolationInfo::Create(IsolationInfo::RequestType::kOther, origin, origin,
+ SiteForCookies::FromOrigin(origin));
const std::string cookie_line(GetParam().cookie_line);
const std::string cookie_header(AddCRLFIfNotEmpty(GetParam().cookie_header));
diff --git a/chromium/net/websockets/websocket_stream_create_test_base.cc b/chromium/net/websockets/websocket_stream_create_test_base.cc
index 7b397e6ae75..9f141d53f37 100644
--- a/chromium/net/websockets/websocket_stream_create_test_base.cc
+++ b/chromium/net/websockets/websocket_stream_create_test_base.cc
@@ -45,9 +45,12 @@ class WebSocketStreamCreateTestBase::TestConnectDelegate
std::move(done_callback_).Run();
}
- void OnFailure(const std::string& message) override {
+ void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) override {
owner_->has_failed_ = true;
owner_->failure_message_ = message;
+ owner_->failure_response_code_ = response_code.value_or(-1);
std::move(done_callback_).Run();
}
diff --git a/chromium/net/websockets/websocket_stream_create_test_base.h b/chromium/net/websockets/websocket_stream_create_test_base.h
index bdcc3d7fecc..e80360cf5c2 100644
--- a/chromium/net/websockets/websocket_stream_create_test_base.h
+++ b/chromium/net/websockets/websocket_stream_create_test_base.h
@@ -55,6 +55,7 @@ class WebSocketStreamCreateTestBase : public WithTaskEnvironment {
const HttpResponseHeaders& headers);
const std::string& failure_message() const { return failure_message_; }
+ int failure_response_code() const { return failure_response_code_; }
bool has_failed() const { return has_failed_; }
// Runs |connect_run_loop_|. It will stop when the connection establishes or
@@ -75,6 +76,7 @@ class WebSocketStreamCreateTestBase : public WithTaskEnvironment {
std::unique_ptr<WebSocketStream> stream_;
// Only set if the connection failed.
std::string failure_message_;
+ int failure_response_code_ = -1;
bool has_failed_;
std::unique_ptr<WebSocketHandshakeRequestInfo> request_info_;
std::unique_ptr<WebSocketHandshakeResponseInfo> response_info_;
diff --git a/chromium/net/websockets/websocket_stream_test.cc b/chromium/net/websockets/websocket_stream_test.cc
index 7784392afa2..e9554557849 100644
--- a/chromium/net/websockets/websocket_stream_test.cc
+++ b/chromium/net/websockets/websocket_stream_test.cc
@@ -19,7 +19,6 @@
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
-#include "base/test/scoped_feature_list.h"
#include "base/timer/mock_timer.h"
#include "base/timer/timer.h"
#include "net/base/isolation_info.h"
@@ -93,9 +92,8 @@ static net::SiteForCookies SiteForCookies() {
static IsolationInfo CreateIsolationInfo() {
url::Origin origin = Origin();
- return IsolationInfo::Create(IsolationInfo::RedirectMode::kUpdateNothing,
- origin, origin,
- SiteForCookies::FromOrigin(origin));
+ return IsolationInfo::Create(IsolationInfo::RequestType::kOther, origin,
+ origin, SiteForCookies::FromOrigin(origin));
}
class WebSocketStreamCreateTest : public TestWithParam<HandshakeStreamType>,
@@ -239,7 +237,7 @@ class WebSocketStreamCreateTest : public TestWithParam<HandshakeStreamType>,
spdy_util_.UpdateWithStreamDestruction(1);
// WebSocket request.
- spdy::SpdyHeaderBlock request_headers = WebSocketHttp2Request(
+ spdy::Http2HeaderBlock request_headers = WebSocketHttp2Request(
socket_path, socket_host, kOrigin, extra_request_headers);
frames_.push_back(spdy_util_.ConstructSpdyHeaders(
3, std::move(request_headers), DEFAULT_PRIORITY, false));
@@ -974,6 +972,7 @@ TEST_P(WebSocketMultiProtocolStreamCreateTest, InvalidStatusCode) {
if (stream_type_ == BASIC_HANDSHAKE_STREAM) {
EXPECT_EQ("Error during WebSocket handshake: Unexpected response code: 200",
failure_message());
+ EXPECT_EQ(failure_response_code(), 200);
EXPECT_EQ(
1, samples->GetCount(static_cast<int>(
WebSocketHandshakeStreamBase::HandshakeResult::INVALID_STATUS)));
@@ -981,6 +980,7 @@ TEST_P(WebSocketMultiProtocolStreamCreateTest, InvalidStatusCode) {
DCHECK_EQ(stream_type_, HTTP2_HANDSHAKE_STREAM);
EXPECT_EQ("Error during WebSocket handshake: Unexpected response code: 101",
failure_message());
+ EXPECT_EQ(failure_response_code(), 101);
EXPECT_EQ(1, samples->GetCount(static_cast<int>(
WebSocketHandshakeStreamBase::HandshakeResult::
HTTP2_INVALID_STATUS)));
diff --git a/chromium/net/websockets/websocket_test_util.cc b/chromium/net/websockets/websocket_test_util.cc
index 623f07180c3..33526167621 100644
--- a/chromium/net/websockets/websocket_test_util.cc
+++ b/chromium/net/websockets/websocket_test_util.cc
@@ -129,12 +129,12 @@ HttpRequestHeaders WebSocketCommonTestHeaders() {
return request_headers;
}
-spdy::SpdyHeaderBlock WebSocketHttp2Request(
+spdy::Http2HeaderBlock WebSocketHttp2Request(
const std::string& path,
const std::string& authority,
const std::string& origin,
const WebSocketExtraHeaders& extra_headers) {
- spdy::SpdyHeaderBlock request_headers;
+ spdy::Http2HeaderBlock request_headers;
request_headers[spdy::kHttp2MethodHeader] = "CONNECT";
request_headers[spdy::kHttp2AuthorityHeader] = authority;
request_headers[spdy::kHttp2SchemeHeader] = "https";
@@ -155,9 +155,9 @@ spdy::SpdyHeaderBlock WebSocketHttp2Request(
return request_headers;
}
-spdy::SpdyHeaderBlock WebSocketHttp2Response(
+spdy::Http2HeaderBlock WebSocketHttp2Response(
const WebSocketExtraHeaders& extra_headers) {
- spdy::SpdyHeaderBlock response_headers;
+ spdy::Http2HeaderBlock response_headers;
response_headers[spdy::kHttp2StatusHeader] = "200";
for (const auto& header : extra_headers) {
response_headers[base::ToLowerASCII(header.first)] = header.second;
diff --git a/chromium/net/websockets/websocket_test_util.h b/chromium/net/websockets/websocket_test_util.h
index 8ccc09fc63f..69810f106eb 100644
--- a/chromium/net/websockets/websocket_test_util.h
+++ b/chromium/net/websockets/websocket_test_util.h
@@ -13,6 +13,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/optional.h"
#include "net/http/http_basic_state.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_stream_parser.h"
@@ -86,7 +87,7 @@ std::string WebSocketStandardResponse(const std::string& extra_headers);
HttpRequestHeaders WebSocketCommonTestHeaders();
// Generates a handshake request header block when using WebSockets over HTTP/2.
-spdy::SpdyHeaderBlock WebSocketHttp2Request(
+spdy::Http2HeaderBlock WebSocketHttp2Request(
const std::string& path,
const std::string& authority,
const std::string& origin,
@@ -94,7 +95,7 @@ spdy::SpdyHeaderBlock WebSocketHttp2Request(
// Generates a handshake response header block when using WebSockets over
// HTTP/2.
-spdy::SpdyHeaderBlock WebSocketHttp2Response(
+spdy::Http2HeaderBlock WebSocketHttp2Response(
const WebSocketExtraHeaders& extra_headers);
// This class provides a convenient way to construct a MockClientSocketFactory
@@ -187,7 +188,9 @@ class DummyConnectDelegate : public WebSocketStream::ConnectDelegate {
void OnSuccess(
std::unique_ptr<WebSocketStream> stream,
std::unique_ptr<WebSocketHandshakeResponseInfo> response) override {}
- void OnFailure(const std::string& message) override {}
+ void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) override {}
void OnStartOpeningHandshake(
std::unique_ptr<WebSocketHandshakeRequestInfo> request) override {}
void OnSSLCertificateError(
@@ -213,7 +216,9 @@ class TestWebSocketStreamRequestAPI : public WebSocketStreamRequestAPI {
WebSocketBasicHandshakeStream* handshake_stream) override;
void OnHttp2HandshakeStreamCreated(
WebSocketHttp2HandshakeStream* handshake_stream) override;
- void OnFailure(const std::string& message) override {}
+ void OnFailure(const std::string& message,
+ int net_error,
+ base::Optional<int> response_code) override {}
};
// A sub-class of WebSocketHandshakeStreamCreateHelper which sets a