Rename {absl => std}::optional in //content/
Automated patch, intended to be effectively a no-op. Context: https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email&utm_source=footer As of https://crrev.com/1204351, absl::optional is now a type alias for std::optional. We should migrate toward it. Script: ``` function replace { echo "Replacing $1 by $2" git grep -l "$1" \ | cut -f1 -d: \ | grep \ -e "^content" \ | sort \ | uniq \ | grep \ -e "\.h" \ -e "\.cc" \ -e "\.mm" \ -e "\.py" \ | xargs sed -i "s/$1/$2/g" } replace "absl::make_optional" "std::make_optional" replace "absl::optional" "std::optional" replace "absl::nullopt" "std::nullopt" replace "absl::in_place" "std::in_place" replace "absl::in_place_t" "std::in_place_t" replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>" git cl format ``` # Skipping unrelated "check_network_annotation" errors. NOTRY=True Bug: chromium:1500249 Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537 Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Owners-Override: Avi Drissman <avi@chromium.org> Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/main@{#1245739}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
46aa2c12c9
commit
c686e8f4fd
chrome/browser/first_party_sets
content
app
android
content_main.cccontent_main_runner_impl.cccontent_main_runner_impl.hcontent_main_runner_impl_browsertest.ccapp_shim_remote_cocoa
render_widget_host_ns_view_bridge.hrender_widget_host_ns_view_bridge.mmrender_widget_host_view_cocoa.hrender_widget_host_view_cocoa.mmweb_drag_source_mac.mm
browser
about_url_loader_factory.cc
accessibility
accessibility_tree_formatter_android.ccaccessibility_tree_formatter_blink.ccbrowser_accessibility.ccbrowser_accessibility.hbrowser_accessibility_android.ccbrowser_accessibility_android.hbrowser_accessibility_android_unittest.ccbrowser_accessibility_auralinux_unittest.ccbrowser_accessibility_cocoa.mmbrowser_accessibility_com_win.ccbrowser_accessibility_fuchsia.ccbrowser_accessibility_manager_fuchsia.ccbrowser_accessibility_manager_fuchsia_unittest.ccdump_accessibility_browsertest_base.cc
android
additional_navigation_params_utils.ccadditional_navigation_params_utils.happ_web_message_port.ccbattery_metrics.cccontent_url_loader_factory.ccdialog_overlay_impl.ccdrop_data_android.ccgesture_listener_manager.hgpu_process_callback.ccime_adapter_android.ccime_adapter_android.h
java
message_payload.ccselection
synchronous_compositor_host.ccsynchronous_compositor_host.hsynchronous_compositor_sync_call_bridge.ccsynchronous_compositor_sync_call_bridge.hweb_contents_observer_proxy.ccattribution_reporting
aggregatable_attribution_utils.ccaggregatable_attribution_utils.haggregatable_attribution_utils_unittest.ccattribution_aggregatable_report_golden_unittest.ccattribution_cookie_checker_impl_unittest.ccattribution_data_host_manager.hattribution_data_host_manager_impl.ccattribution_data_host_manager_impl.hattribution_data_host_manager_impl_unittest.ccattribution_debug_report.ccattribution_debug_report.hattribution_debug_report_unittest.ccattribution_host.ccattribution_host.hattribution_host_unittest.ccattribution_info.ccattribution_info.hattribution_internals_browsertest.ccattribution_internals_handler_impl.ccattribution_internals_handler_impl.hattribution_interop_parser.ccattribution_interop_parser.hattribution_interop_parser_unittest.ccattribution_interop_runner.ccattribution_interop_unittest.ccattribution_manager.hattribution_manager_impl.ccattribution_manager_impl.hattribution_manager_impl_unittest.ccattribution_observer.hattribution_os_level_manager.ccattribution_os_level_manager.hattribution_os_level_manager_android.ccattribution_os_level_manager_android_unittest.ccattribution_report.ccattribution_report.hattribution_report_network_sender_unittest.ccattribution_report_unittest.ccattribution_storage.hattribution_storage_delegate.hattribution_storage_delegate_impl.ccattribution_storage_delegate_impl.hattribution_storage_delegate_impl_unittest.ccattribution_storage_sql.ccattribution_storage_sql.hattribution_storage_sql_query_plans_unittest.ccattribution_storage_sql_unittest.ccattribution_storage_unittest.ccattribution_test_utils.ccattribution_test_utils.hattributions_browsertest.cccreate_report_result.cccreate_report_result.hos_registration.ccos_registration.hprivacy_math.ccprivacy_math.hprivacy_sandbox_ads_apis_browsertest.ccrate_limit_table.ccrate_limit_table.hrate_limit_table_unittest.ccsql_query_plan_test_util.ccsql_query_plan_test_util.hsql_utils.ccsql_utils.hstorable_source.ccstore_source_result.hstored_source.ccstored_source.h
test
audio
back_forward_cache_browsertest.ccback_forward_cache_browsertest.hback_forward_cache_features_browsertest.ccback_forward_cache_no_store_browsertest.ccback_forward_cache_not_restored_reasons_browsertest.ccbackground_fetch
background_fetch_context.ccbackground_fetch_context.hbackground_fetch_data_manager_observer.hbackground_fetch_data_manager_unittest.ccbackground_fetch_delegate_proxy.ccbackground_fetch_delegate_proxy.hbackground_fetch_delegate_proxy_unittest.ccbackground_fetch_job_controller.ccbackground_fetch_job_controller.hbackground_fetch_job_controller_unittest.ccbackground_fetch_registration_service_impl.ccbackground_fetch_registration_service_impl.hbackground_fetch_scheduler.ccbackground_fetch_scheduler.hbackground_fetch_scheduler_unittest.ccbackground_fetch_service_impl.ccbackground_fetch_service_unittest.ccmock_background_fetch_delegate.ccmock_background_fetch_delegate.h
storage
blob_storage
blob_internals_url_loader.ccblob_url_unittest.ccfile_backed_blob_factory_frame_impl_unittest.ccfile_backed_blob_factory_worker_impl_unittest.cc
bluetooth
advertisement_client.hbluetooth_allowed_devices.ccbluetooth_blocklist.ccbluetooth_device_chooser_controller.ccbluetooth_device_chooser_controller.hbluetooth_metrics.ccbluetooth_metrics.hbluetooth_util_unittest.ccframe_connected_bluetooth_devices.ccframe_connected_bluetooth_devices.hweb_bluetooth_pairing_manager_delegate.hweb_bluetooth_pairing_manager_impl.ccweb_bluetooth_pairing_manager_impl.hweb_bluetooth_pairing_manager_impl_unittest.ccweb_bluetooth_service_impl.ccweb_bluetooth_service_impl.hweb_bluetooth_service_impl_browsertest.ccweb_bluetooth_service_impl_unittest.cc
browser_child_process_host_impl.ccbrowser_context.ccbrowser_main_loop.ccbrowser_main_loop.hbrowser_thread_impl.hbrowsing_data
browsing_data_filter_builder_impl.ccbrowsing_data_filter_builder_impl.hbrowsing_data_filter_builder_impl_unittest.ccbrowsing_data_remover_impl.ccbrowsing_data_remover_impl.hbrowsing_data_remover_impl_browsertest.ccbrowsing_data_remover_impl_unittest.ccclear_site_data_handler.ccclear_site_data_handler.hclear_site_data_handler_browsertest.ccclear_site_data_handler_unittest.ccclear_site_data_utils.cc
browsing_instance.ccbrowsing_instance.hbrowsing_topics
browsing_topics_browsertest.ccbrowsing_topics_site_data_storage.hbrowsing_topics_url_loader_interceptor.ccbrowsing_topics_url_loader_interceptor.hbrowsing_topics_url_loader_unittest.ccheader_util.cc
buckets
cache_storage
cache_storage_cache.cccache_storage_cache.hcache_storage_cache_entry_handler.cccache_storage_cache_entry_handler.hcache_storage_cache_unittest.cccache_storage_context_impl.cccache_storage_control_wrapper.hcache_storage_dispatcher_host.cccache_storage_dispatcher_host.hcache_storage_manager.cccache_storage_manager_unittest.cc
child_process_host_impl.ccchild_process_host_impl.hchild_process_launcher_helper.ccchild_process_launcher_helper.hchild_process_launcher_helper_android.ccchild_process_launcher_helper_ios.ccchild_process_launcher_helper_linux.ccchild_process_launcher_helper_mac.ccchild_process_launcher_helper_win.ccchild_process_security_policy_impl.ccchild_process_security_policy_impl.hclient_hints
code_cache
contacts
content_index
cookie_deprecation_label
cookie_store
coop_related_group.cccoop_related_group.hcross_origin_opener_policy_browsertest.ccdata_decoder_browsertest.ccdata_url_loader_factory.ccdevtools
devtools_agent_host_impl.ccdevtools_agent_host_impl.hdevtools_frontend_host_impl.ccdevtools_frontend_host_impl.hdevtools_frontend_host_impl_unittest.ccdevtools_http_handler.ccdevtools_http_handler.hdevtools_http_handler_unittest.ccdevtools_instrumentation.ccdevtools_instrumentation.hdevtools_trust_token_browsertest.ccdevtools_url_loader_interceptor.ccdevtools_url_loader_interceptor.hdevtools_video_consumer.ccdevtools_video_consumer_unittest.ccnetwork_service_devtools_observer.ccnetwork_service_devtools_observer.h
protocol
browser_handler.ccdevice_access_handler.hdevtools_network_resource_loader_browsertest.ccdevtools_protocol_browsertest.ccemulation_handler.ccemulation_handler.hfedcm_handler.ccinput_handler.ccinput_handler.hnetwork_handler.ccnetwork_handler.hpage_handler.ccpage_handler.hpreload_handler.ccpreload_handler.hservice_worker_handler.ccstorage_handler.ccstorage_handler.htarget_handler.cctarget_handler.htethering_handler.cctracing_handler.ccwebauthn_handler.cc
render_frame_devtools_agent_host.ccrender_frame_devtools_agent_host.hservice_worker_devtools_agent_host.ccservice_worker_devtools_agent_host.hservice_worker_devtools_manager.ccservice_worker_devtools_manager.hweb_contents_devtools_agent_host.ccweb_contents_devtools_agent_host.hworker_devtools_agent_host.ccworker_devtools_agent_host.hdirect_sockets
direct_sockets_open_browsertest.ccdirect_sockets_service_impl.ccdirect_sockets_service_impl.hdirect_sockets_tcp_browsertest.ccdirect_sockets_test_utils.ccdirect_sockets_test_utils.h
display_cutout
dom_storage
download
download_browsertest.ccdownload_manager_impl.ccdownload_manager_impl.hdownload_manager_impl_unittest.ccmhtml_generation_browsertest.ccmhtml_generation_manager.ccsave_file.ccsave_package.cc
fenced_frame
fenced_document_data.ccfenced_document_data.hfenced_frame.ccfenced_frame.hfenced_frame_browsertest.ccfenced_frame_config.ccfenced_frame_config.hfenced_frame_reporter.ccfenced_frame_reporter.hfenced_frame_reporter_unittest.ccfenced_frame_url_mapping.ccfenced_frame_url_mapping.hfenced_frame_url_mapping_unittest.ccredacted_fenced_frame_config_mojom_traits_unittest.cc
file_system
file_system_manager_impl.ccfile_system_manager_impl.hfile_system_operation_runner_unittest.ccfile_system_url_loader_factory.ccfile_system_url_loader_factory_browsertest.cc
file_system_access
file_system_access_change_source.hfile_system_access_directory_handle_impl.ccfile_system_access_directory_handle_impl_unittest.ccfile_system_access_file_delegate_host_impl.ccfile_system_access_file_handle_impl.ccfile_system_access_file_handle_impl.hfile_system_access_lock_manager.ccfile_system_access_lock_manager.hfile_system_access_manager_impl.ccfile_system_access_manager_impl.hfile_system_access_watch_scope_unittest.ccfile_system_access_watcher_manager_unittest.cc
first_party_sets
database
first_party_set_parser.ccfirst_party_set_parser.hfirst_party_set_parser_unittest.ccfirst_party_sets_handler_database_helper.ccfirst_party_sets_handler_database_helper_unittest.ccfirst_party_sets_handler_impl.hfirst_party_sets_handler_impl_browsertest.ccfirst_party_sets_handler_impl_instance.ccfirst_party_sets_handler_impl_instance.hfirst_party_sets_handler_impl_instance_unittest.ccfirst_party_sets_loader.ccfirst_party_sets_loader.hfirst_party_sets_loader_unittest.cctest
font_access
font_access_manager_unittest.ccfont_enumeration_cache.ccfont_enumeration_cache.hfont_enumeration_data_source_mac.mmfont_enumeration_data_source_win.cc
font_preferences_browsertest.ccgeolocation
gpu
browser_child_process_backgrounded_bridge.hgpu_data_manager_impl.ccgpu_data_manager_impl.hgpu_data_manager_impl_private.ccgpu_data_manager_impl_private.hgpu_data_manager_impl_private_unittest.ccgpu_internals_ui.ccgpu_process_host.ccgpu_process_host.h
handwriting
handwriting_recognition_service_impl_cros_unittest.cchandwriting_recognizer_impl.cchandwriting_recognizer_impl_cros.cc
hid
indexed_db
file_stream_reader_to_data_pipe.hindexed_db_backing_store.ccindexed_db_backing_store.hindexed_db_backing_store_unittest.ccindexed_db_context_impl.ccindexed_db_context_impl.hindexed_db_control_wrapper.hindexed_db_factory.ccindexed_db_factory.hindexed_db_factory_client.hindexed_db_internals_ui.ccindexed_db_leveldb_operations.ccindexed_db_tombstone_sweeper.ccindexed_db_tombstone_sweeper.h
interest_group
ad_auction_headers_util_unittest.ccad_auction_service_impl.ccad_auction_service_impl.had_auction_service_impl_unittest.ccad_auction_url_loader_interceptor.ccad_auction_url_loader_interceptor.had_auction_url_loader_interceptor_unittest.ccadditional_bids_util.ccadditional_bids_util.hadditional_bids_util_unittest.ccauction_metrics_recorder.ccauction_metrics_recorder.hauction_metrics_recorder_unittest.ccauction_process_manager.ccauction_process_manager.hauction_process_manager_unittest.ccauction_runner.ccauction_runner.hauction_runner_unittest.ccauction_url_loader_factory_proxy.ccauction_url_loader_factory_proxy.hauction_url_loader_factory_proxy_unittest.ccauction_worklet_manager.ccauction_worklet_manager.hauction_worklet_manager_unittest.ccbidding_and_auction_response.ccbidding_and_auction_response.hbidding_and_auction_response_unittest.ccbidding_and_auction_serializer.ccbidding_and_auction_server_key_fetcher.ccbidding_and_auction_server_key_fetcher.hdebuggable_auction_worklet.ccdebuggable_auction_worklet.hheader_direct_from_seller_signals.ccheader_direct_from_seller_signals.hheader_direct_from_seller_signals_unittest.ccinterest_group_auction.ccinterest_group_auction.hinterest_group_auction_reporter.ccinterest_group_auction_reporter.hinterest_group_auction_reporter_unittest.ccinterest_group_browsertest.ccinterest_group_caching_storage.ccinterest_group_caching_storage.hinterest_group_caching_storage_unittest.ccinterest_group_k_anonymity_manager.ccinterest_group_k_anonymity_manager.hinterest_group_k_anonymity_manager_unittest.ccinterest_group_manager_impl.ccinterest_group_manager_impl.hinterest_group_pa_report_util.ccinterest_group_pa_report_util.hinterest_group_pa_report_util_unittest.ccinterest_group_permissions_checker.ccinterest_group_permissions_checker_unittest.ccinterest_group_priority_util.ccinterest_group_priority_util.hinterest_group_priority_util_unittest.ccinterest_group_storage.ccinterest_group_storage.hinterest_group_storage_unittest.ccinterest_group_update.hinterest_group_update_manager.ccmock_auction_process_manager.ccmock_auction_process_manager.hstorage_interest_group.ccstorage_interest_group.hsubresource_url_authorizations.hsubresource_url_builder.ccsubresource_url_builder.hsubresource_url_builder_unittest.cctest_interest_group_manager_impl.cctest_interest_group_manager_impl.htest_interest_group_private_aggregation_manager.cctest_interest_group_private_aggregation_manager.h
isolated_origin_browsertest.cckeyboard_lock
launch_as_mojo_client_browsertest.ccloader
cached_navigation_url_loader.cccross_site_document_blocking_browsertest.ccderived_origin_in_fetch_browsertest.ccfile_url_loader_factory.cckeep_alive_url_browsertest.cckeep_alive_url_loader.cckeep_alive_url_loader.hkeep_alive_url_loader_service_unittest.ccloader_browsertest.ccnavigation_early_hints_browsertest.ccnavigation_early_hints_manager.ccnavigation_early_hints_manager.hnavigation_early_hints_manager_unittest.ccnavigation_loader_interceptor.ccnavigation_loader_interceptor.hnavigation_url_loader_delegate.hnavigation_url_loader_impl.ccnavigation_url_loader_impl.hnavigation_url_loader_impl_unittest.ccnavigation_url_loader_unittest.ccobject_navigation_fallback_body_loader.ccobject_navigation_fallback_body_loader.hprefetch_browsertest.ccprefetch_url_loader.ccprefetch_url_loader.hsubresource_proxying_url_loader.ccsubresource_proxying_url_loader.hurl_loader_throttles.cc
locks
media
active_media_session_controller.ccactive_media_session_controller.h
android
browser_gpu_video_accelerator_factories.ccbrowser_gpu_video_accelerator_factories.hmedia_player_renderer.ccmedia_player_renderer.hmedia_resource_getter_impl.ccmedia_resource_getter_impl.h
audio_input_stream_broker.ccaudio_input_stream_broker.haudio_input_stream_broker_unittest.ccaudio_loopback_stream_broker.ccaudio_loopback_stream_broker.haudio_loopback_stream_broker_unittest.ccaudio_output_stream_broker_unittest.cccapture
aura_window_video_capture_device.cccontent_capture_device_browsertest_base.hdesktop_capturer_ash.hdesktop_streams_registry_impl.ccdesktop_streams_registry_impl.hframe_sink_video_capture_device.ccframe_sink_video_capture_device.hframe_sink_video_capture_device_unittest.ccmouse_cursor_overlay_controller.hmouse_cursor_overlay_controller_aura.ccscreen_capture_kit_device_mac.mmvideo_capture_device_proxy_lacros.hweb_contents_frame_tracker.ccweb_contents_frame_tracker.hweb_contents_frame_tracker_unittest.ccweb_contents_video_capture_device_browsertest.cc
cdm_file_impl.cccdm_file_impl.hcdm_registry_impl.cccdm_registry_impl.hcdm_registry_impl_unittest.cccdm_storage_common.hcdm_storage_database.cccdm_storage_database.hcdm_storage_manager.cccdm_storage_manager.hdcomp_surface_registry_broker.ccflinging_renderer.ccflinging_renderer.hforwarding_audio_stream_factory.hkey_system_support_android.cckey_system_support_android.hkey_system_support_impl.hkey_system_support_impl_unittest.cckey_system_support_win.cckey_system_support_win.hmedia_devices_permission_checker_unittest.ccmedia_devices_util.ccmedia_devices_util.hmedia_devices_util_browsertest.ccmedia_internals.ccmedia_internals_unittest.ccmedia_license_database.ccmedia_license_database.hmedia_license_manager.ccmedia_license_storage_host.ccmedia_license_storage_host.hmedia_license_storage_host_unittest.ccmedia_power_experiment_manager.ccmedia_power_experiment_manager.hmedia_web_contents_observer.ccmedia_web_contents_observer.hsession
audio_focus_delegate.haudio_focus_delegate_android.ccaudio_focus_delegate_android.haudio_focus_delegate_default.ccmedia_session_android.ccmedia_session_android.hmedia_session_browsertest.ccmedia_session_controller.ccmedia_session_controller.hmedia_session_controller_unittest.ccmedia_session_impl.ccmedia_session_impl.hmedia_session_impl_browsertest.ccmedia_session_impl_service_routing_unittest.ccmedia_session_impl_unittest.ccmedia_session_player_observer.hmedia_session_service_impl.ccmedia_session_service_impl.hmedia_session_service_impl_browsertest.ccmock_media_session_player_observer.ccmock_media_session_player_observer.hpepper_player_delegate.ccpepper_player_delegate.h
stable_video_decoder_factory.ccsystem_media_controls_notifier.ccsystem_media_controls_notifier.hsystem_media_controls_notifier_unittest.ccweb_app_system_media_controls_manager.ccmemory_pressure
message_port_provider.ccmetrics
histogram_shared_memory_config.cchistogram_shared_memory_config.hhistogram_shared_memory_config_unittest.cc
ml
mojo_sandbox_browsertest.ccnavigation_browsertest.ccnavigation_or_document_handle.ccnavigation_or_document_handle.hnetwork
address_map_linux_browsertest.cccross_origin_embedder_policy_reporter.cccross_origin_embedder_policy_reporter.hcross_origin_embedder_policy_reporter_unittest.cccross_origin_opener_policy_reporter.cccross_origin_opener_policy_reporter_unittest.ccdns_https_protocol_upgrade_browsertest.cchttp_cache_backend_file_operations_factory.ccnetwork_service_util_internal.ccnetwork_service_util_internal.hreporting_service_proxy.ccsandboxed_http_cache_browsertest.ccsandboxed_network_list_browsertest.ccsandboxed_socket_broker_browsertest.ccshared_dictionary_browsertest.cctrust_token_origin_trial_browsertest.cctrust_token_parameters_browsertest.cc
network_sandbox.ccnetwork_service_browsertest.ccnetwork_service_client.ccnetwork_service_client.hnetwork_service_instance_impl.ccnotifications
blink_notification_service_impl_unittest.ccdevtools_event_logging.ccdevtools_event_logging.hnotification_database.ccnotification_database.hnotification_database_conversions.ccnotification_database_conversions_unittest.ccnotification_database_unittest.ccnotification_event_dispatcher_impl.ccnotification_event_dispatcher_impl.hplatform_notification_context_impl.ccplatform_notification_context_impl.hplatform_notification_context_trigger_unittest.cc
origin_trials
payments
permissions
embedded_permission_control_checker.ccembedded_permission_control_checker_unittest.ccpermission_controller_impl.ccpermission_controller_impl.hpermission_controller_impl_unittest.ccpermission_service_context.ccpermission_service_impl.cc
picture_in_picture
document_picture_in_picture_window_controller_impl.ccdocument_picture_in_picture_window_controller_impl.hpicture_in_picture_session.hvideo_picture_in_picture_content_browsertest.ccvideo_picture_in_picture_window_controller_impl.ccvideo_picture_in_picture_window_controller_impl.h
plugin_service_impl.ccplugin_service_impl.hplugin_service_impl_browsertest.ccppapi_plugin_process_host.ccppapi_plugin_process_host.hpreloading
anchor_element_interaction_host_impl_unittest.ccpreconnector_unittest.cc
prefetch
no_vary_search_helper.ccno_vary_search_helper.hno_vary_search_helper_unittest.ccprefetch_canary_checker.ccprefetch_canary_checker.hprefetch_canary_checker_unittest.ccprefetch_container.ccprefetch_container.hprefetch_container_unittest.ccprefetch_cookie_listener.ccprefetch_cookie_listener_unittest.ccprefetch_dns_prober.ccprefetch_dns_prober.hprefetch_document_manager.ccprefetch_metrics.ccprefetch_network_context.ccprefetch_network_context.hprefetch_network_context_unittest.ccprefetch_origin_prober.ccprefetch_origin_prober.hprefetch_params.ccprefetch_params.hprefetch_proxy_configurator.ccprefetch_proxy_configurator.hprefetch_response_reader.ccprefetch_response_reader.hprefetch_service.ccprefetch_service.hprefetch_service_unittest.ccprefetch_serving_page_metrics_container.ccprefetch_serving_page_metrics_container.hprefetch_streaming_url_loader.ccprefetch_streaming_url_loader.hprefetch_streaming_url_loader_unittest.ccprefetch_test_utils.ccprefetch_test_utils.hprefetch_url_loader_interceptor_unittest.ccproxy_lookup_client_impl.ccproxy_lookup_client_impl.hproxy_lookup_client_impl_unittest.cc
prefetcher.ccprefetcher.hprefetcher_unittest.ccpreloading_attempt_impl.hpreloading_config.ccpreloading_decider_unittest.ccpreloading_prediction.hprerender
devtools_prerender_attempt.ccprerender_attributes.ccprerender_attributes.hprerender_browsertest.ccprerender_commit_deferring_condition.ccprerender_commit_deferring_condition.hprerender_host.ccprerender_host.hprerender_host_registry.ccprerender_host_registry.hprerender_host_registry_unittest.ccprerender_host_unittest.ccprerender_metrics.ccprerender_metrics.hprerender_navigation_throttle.ccprerender_new_tab_handle.hprerender_subframe_navigation_throttle.cc
prerenderer_impl.ccspeculation_host_devtools_observer.hpresentation
process_internals
process_lock.hpush_messaging
reduce_accept_language
reduce_accept_language_utils.ccreduce_accept_language_utils.hreduce_accept_language_utils_unittest.cc
renderer_host
back_forward_cache_can_store_document_result.ccback_forward_cache_can_store_document_result.hback_forward_cache_impl.ccback_forward_cache_impl.hback_forward_cache_metrics.ccback_forward_cache_metrics.hbatched_proxy_ipc_sender.ccbatched_proxy_ipc_sender.hblocked_scheme_navigation_browsertest.ccbrowser_compositor_ios.mmbrowser_compositor_view_mac.mmbrowsing_context_group_swap.ccbrowsing_context_group_swap.hbrowsing_context_group_swap_browsertest.ccbrowsing_context_state.ccbrowsing_context_state.hclipboard_host_impl.ccclipboard_host_impl.hclipboard_host_impl_unittest.cccode_cache_host_impl.cccommit_deferring_condition_runner.cccommit_deferring_condition_runner.hcommit_deferring_condition_runner_unittest.cccookie_browsertest.cccross_origin_opener_policy_access_report_manager.cccross_origin_opener_policy_status.cccross_origin_opener_policy_status.hcross_process_frame_connector.cccross_process_frame_connector.hdata_transfer_util.ccdisplay_feature.ccdisplay_feature.hdocument_associated_data.hdocument_token_browsertest.ccdwrite_font_proxy_impl_win.ccembedded_frame_sink_impl.ccembedded_frame_sink_impl.hembedded_frame_sink_provider_impl_unittest.ccfile_utilities_host_impl.ccframe_navigation_entry.ccframe_navigation_entry.hframe_tree.ccframe_tree.hframe_tree_browsertest.ccframe_tree_node.ccframe_tree_node.h
sandbox_parameters_mac.mminput
input_router_impl_unittest.ccmock_input_router.ccmock_input_router.hscroll_behavior_browsertest.cctouch_selection_controller_client_aura_browsertest.cc
ipc_utils.ccipc_utils.hisolated_web_app_throttle.ccisolated_web_app_throttle.hisolated_web_app_throttle_unittest.ccmedia
audio_input_device_manager.ccaudio_input_device_manager.haudio_input_stream_handle_unittest.ccaudio_output_authorization_handler.ccaudio_output_authorization_handler.haudio_service_listener_unittest.cccaptured_surface_controller.cccaptured_surface_controller.hcaptured_surface_controller_permission_manager_unittest.cccaptured_surface_controller_unittest.ccfuchsia_media_codec_provider_impl.ccfuchsia_media_codec_provider_impl.hfuchsia_media_codec_provider_impl_unittest.ccmedia_devices_dispatcher_host.ccmedia_devices_dispatcher_host.hmedia_devices_dispatcher_host_unittest.ccmedia_devices_manager.ccmedia_devices_manager.hmedia_stream_dispatcher_host.ccmedia_stream_dispatcher_host.hmedia_stream_dispatcher_host_unittest.ccmedia_stream_manager.ccmedia_stream_manager.hmedia_stream_manager_unittest.ccmedia_stream_ui_proxy.ccmedia_stream_ui_proxy.hmedia_stream_ui_proxy_unittest.ccmock_captured_surface_controller.ccmock_captured_surface_controller.hpeer_connection_tracker_host.ccrender_frame_audio_input_stream_factory_unittest.ccrender_frame_audio_output_stream_factory.ccrender_frame_audio_output_stream_factory_unittest.ccservice_video_capture_provider.hvideo_capture_controller.ccvideo_capture_controller.hvideo_capture_host.ccvideo_capture_host.hvideo_capture_manager.ccvideo_capture_manager.hvideo_capture_manager_unittest.cc
mixed_content_checker.hmixed_content_checker_unittest.ccnavigation_controller_impl.ccnavigation_controller_impl.hnavigation_controller_impl_browsertest.ccnavigation_controller_impl_unittest.ccnavigation_entry_impl.ccnavigation_entry_impl.hnavigation_entry_impl_unittest.ccnavigation_request.ccnavigation_request.hnavigation_request_browsertest.ccnavigation_request_info.ccnavigation_request_info.hnavigation_request_unittest.ccnavigation_throttle_runner_unittest.ccnavigation_transitions
navigator.ccnavigator.hnavigator_unittest.ccoverscroll_controller.ccoverscroll_controller.hoverscroll_controller_delegate.hpage_impl.ccpage_impl.hpending_beacon_host.hpending_beacon_host_unittest.ccpending_beacon_service.ccpepper
pepper_file_system_browser_host.ccpepper_host_resolver_message_filter.ccpepper_host_resolver_message_filter.hpepper_network_monitor_host.ccpepper_network_proxy_host.ccpepper_network_proxy_host.hpepper_proxy_lookup_helper.ccpepper_proxy_lookup_helper.hpepper_proxy_lookup_helper_unittest.ccpepper_renderer_connection.ccpepper_renderer_connection.hpepper_tcp_server_socket_message_filter.ccpepper_tcp_server_socket_message_filter.hpepper_tcp_socket_message_filter.ccpepper_tcp_socket_message_filter.hpepper_udp_socket_message_filter.ccpepper_udp_socket_message_filter.h
policy_container_host.hprivate_network_access_browsertest.ccprivate_network_access_util.ccrender_frame_host_android.ccrender_frame_host_delegate.ccrender_frame_host_delegate.hrender_frame_host_impl.ccrender_frame_host_impl.hrender_frame_host_impl_browsertest.ccrender_frame_host_impl_ppapi_support.ccrender_frame_host_impl_ppapi_support.hrender_frame_host_impl_unittest.ccrender_frame_host_manager.ccrender_frame_host_manager.hrender_frame_host_manager_browsertest.ccrender_frame_host_manager_unittest.ccrender_frame_host_owner.hrender_frame_metadata_provider_impl.hrender_frame_proxy_host.ccrender_frame_proxy_host.hrender_process_host_browsertest.ccrender_process_host_impl.ccrender_process_host_impl.hrender_process_host_sandbox_policy_win_browsertest.ccrender_view_host_delegate.ccrender_view_host_delegate.hrender_view_host_factory.ccrender_view_host_factory.hrender_view_host_impl.ccrender_view_host_impl.hrender_widget_host_delegate.hrender_widget_host_impl.ccrender_widget_host_impl.hrender_widget_host_input_event_router.ccrender_widget_host_input_event_router.hrender_widget_host_input_event_router_unittest.ccrender_widget_host_unittest.ccrender_widget_host_view_android.ccrender_widget_host_view_android.hrender_widget_host_view_android_unittest.ccrender_widget_host_view_aura.ccrender_widget_host_view_aura.hrender_widget_host_view_aura_browsertest.ccrender_widget_host_view_aura_unittest.ccrender_widget_host_view_base.ccrender_widget_host_view_base.hrender_widget_host_view_browsertest.ccrender_widget_host_view_child_frame.ccrender_widget_host_view_child_frame.hrender_widget_host_view_child_frame_browsertest.ccrender_widget_host_view_event_handler.ccrender_widget_host_view_event_handler.hrender_widget_host_view_ios.hrender_widget_host_view_ios.mmrender_widget_host_view_mac.hrender_widget_host_view_mac.mmrender_widget_host_view_mac_editcommand_helper_unittest.mmrender_widget_host_view_mac_unittest.mmrender_widget_targeter.ccrender_widget_targeter.hscroll_into_view_browsertest.ccstored_page.ccstored_page.htext_input_client_mac_unittest.mmtext_input_manager.cctext_input_manager.hscheduler
screen_orientation
screenlock_monitor
security_exploit_browsertest.ccservice_process_host_browsertest.ccservice_process_host_impl.ccservice_worker
embedded_worker_instance.ccembedded_worker_instance.hembedded_worker_instance_unittest.ccfake_embedded_worker_instance_client.ccfake_service_worker.ccfake_service_worker.hservice_worker_browsertest.ccservice_worker_cache_storage_matcher.ccservice_worker_cache_storage_matcher.hservice_worker_cache_writer.ccservice_worker_client_utils.ccservice_worker_clients_api_browsertest.ccservice_worker_container_host.ccservice_worker_container_host.hservice_worker_container_host_unittest.ccservice_worker_context_core.ccservice_worker_context_core.hservice_worker_context_unittest.ccservice_worker_context_wrapper.ccservice_worker_context_wrapper.hservice_worker_controllee_request_handler.ccservice_worker_controllee_request_handler_unittest.ccservice_worker_fetch_dispatcher.ccservice_worker_file_upload_browsertest.ccservice_worker_info.ccservice_worker_info.hservice_worker_installed_script_loader.ccservice_worker_installed_script_loader.hservice_worker_installed_script_reader.ccservice_worker_installed_script_reader.hservice_worker_installed_scripts_sender.ccservice_worker_installed_scripts_sender.hservice_worker_installed_scripts_sender_unittest.ccservice_worker_internals_ui.ccservice_worker_job_unittest.ccservice_worker_main_resource_loader.ccservice_worker_main_resource_loader.hservice_worker_main_resource_loader_interceptor.ccservice_worker_main_resource_loader_interceptor.hservice_worker_main_resource_loader_unittest.ccservice_worker_new_script_fetcher.ccservice_worker_new_script_fetcher.hservice_worker_new_script_loader.ccservice_worker_new_script_loader.hservice_worker_new_script_loader_unittest.ccservice_worker_object_host.ccservice_worker_object_host_unittest.ccservice_worker_offline_capability_check_browsertest.ccservice_worker_process_manager.hservice_worker_register_job.ccservice_worker_registration_object_host.ccservice_worker_registration_unittest.ccservice_worker_registry.ccservice_worker_registry.hservice_worker_registry_unittest.ccservice_worker_script_cache_map.ccservice_worker_script_cache_map.hservice_worker_single_script_update_checker.ccservice_worker_single_script_update_checker.hservice_worker_single_script_update_checker_unittest.ccservice_worker_test_utils.ccservice_worker_test_utils.hservice_worker_update_checker.ccservice_worker_update_checker.hservice_worker_updated_script_loader.ccservice_worker_updated_script_loader.hservice_worker_version.ccservice_worker_version.hservice_worker_version_browsertest.ccservice_worker_version_unittest.ccurl_loader_client_checker.h
shared_storage
shared_storage_browsertest.ccshared_storage_document_service_impl.ccshared_storage_document_service_impl.hshared_storage_event_params.ccshared_storage_event_params.hshared_storage_header_observer.ccshared_storage_header_observer_unittest.ccshared_storage_worklet_host.ccshared_storage_worklet_host.hshared_storage_worklet_host_manager.ccshared_storage_worklet_host_manager.h
site_info.ccsite_info.hsite_instance_group.ccsite_instance_group_unittest.ccsite_instance_impl.ccsite_instance_impl.hsite_instance_impl_unittest.ccsite_per_process_browsertest.ccsite_per_process_hit_test_browsertest.ccsite_per_process_layout_browsertest.ccsite_per_process_oopsif_browsertest.ccsmart_card
sms
sms_browsertest.ccsms_fetcher_impl.ccsms_fetcher_impl.hsms_fetcher_impl_unittest.ccsms_parser.ccsms_parser_unittest.ccsms_queue.ccwebotp_service.ccwebotp_service.hwebotp_service_unittest.cc
speech
speech_recognition_engine_unittest.ccspeech_recognizer_impl.ccspeech_recognizer_impl.htts_controller_impl.cc
ssl
storage_access
storage_partition_impl.ccstorage_partition_impl.hstorage_partition_impl_map.ccstorage_partition_impl_unittest.ccsystem_dns_resolution
tracing
background_tracing_config_impl.ccbackground_tracing_config_impl.hbackground_tracing_config_unittest.ccbackground_tracing_manager_browsertest.ccbackground_tracing_manager_impl.ccbackground_tracing_manager_impl.hbackground_tracing_manager_unittest.ccbackground_tracing_rule.ccbackground_tracing_rule.hmemory_instrumentation_util.ccstartup_tracing_controller.cc
url_info.ccurl_info.hurl_loader_factory_params_helper.cctrace_report
trace_report_database.cctrace_report_database.htrace_report_database_unittest.cctrace_report_handler.cctrace_report_handler.htrace_report_handler_unittest.cctrace_upload_list.h
tracing_controller_browsertest.cctracing_controller_impl.cctracing_controller_impl.htracing_ui.ccusb
utility_process_host.ccutility_process_host.hweb_contents
aura
web_contents_android.ccweb_contents_impl.ccweb_contents_impl.hweb_contents_impl_browsertest.ccweb_contents_impl_unittest.ccweb_contents_observer_browsertest.ccweb_contents_view_android.ccweb_contents_view_android.hweb_contents_view_aura.ccweb_contents_view_aura.hweb_contents_view_aura_browsertest.ccweb_contents_view_aura_unittest.ccweb_drag_dest_mac.hweb_drag_dest_mac.mmweb_database
web_exposed_isolation_info.ccweb_exposed_isolation_info.hweb_exposed_isolation_info_unittest.ccweb_package
prefetched_signed_exchange_cache.ccsigned_exchange_cert_fetcher.ccsigned_exchange_cert_fetcher.hsigned_exchange_cert_fetcher_factory.ccsigned_exchange_cert_fetcher_factory.hsigned_exchange_cert_fetcher_unittest.ccsigned_exchange_certificate_chain.ccsigned_exchange_certificate_chain_unittest.ccsigned_exchange_devtools_proxy.ccsigned_exchange_devtools_proxy.hsigned_exchange_envelope.ccsigned_exchange_envelope.hsigned_exchange_envelope_unittest.ccsigned_exchange_error.ccsigned_exchange_error.hsigned_exchange_handler.ccsigned_exchange_handler.hsigned_exchange_handler_unittest.ccsigned_exchange_loader.ccsigned_exchange_loader.hsigned_exchange_loader_unittest.ccsigned_exchange_prefetch_handler.ccsigned_exchange_prefetch_handler.hsigned_exchange_request_handler_browsertest.ccsigned_exchange_signature_header_field.ccsigned_exchange_signature_header_field.hsigned_exchange_signature_verifier.ccsigned_exchange_subresource_prefetch_browsertest.ccsigned_exchange_utils.ccsigned_exchange_utils.hsigned_exchange_utils_unittest.cc
webauth
authenticator_common_impl.ccauthenticator_common_impl.hauthenticator_impl_unittest.ccauthenticator_mojom_traits_unittest.ccis_uvpaa.ccvirtual_authenticator.ccwebauth_request_security_checker.ccwebauth_request_security_checker_unittest.cc
webid
fake_identity_request_dialog_controller.ccfake_identity_request_dialog_controller.hfedcm_metrics.ccfedcm_metrics.hfederated_auth_disconnect_request.ccfederated_auth_disconnect_request.hfederated_auth_disconnect_request_unittest.ccfederated_auth_request_impl.ccfederated_auth_request_impl.hfederated_auth_request_impl_multiple_frames_unittest.ccfederated_auth_request_impl_registry_unittest.ccfederated_auth_request_impl_unittest.ccfederated_auth_user_info_request.ccfederated_auth_user_info_request.hfederated_auth_user_info_request_unittest.ccfederated_provider_fetcher.ccfederated_provider_fetcher.hfederated_provider_fetcher_unittest.ccidp_network_request_manager.ccidp_network_request_manager.hidp_network_request_manager_unittest.cc
webkit_browsertest.cctest
federated_auth_request_request_token_callback_helper.ccfederated_auth_request_request_token_callback_helper.hmock_identity_request_dialog_controller.hmock_idp_network_request_manager.hmock_permission_delegate.h
webid_browsertest.ccwebid_utils.ccwebid_utils.hwebrtc
websockets
webtransport
webui
web_ui_browsertest.ccweb_ui_data_source_impl.hweb_ui_main_frame_observer.ccweb_ui_main_frame_observer.hweb_ui_main_frame_observer_unittest.ccweb_ui_managed_interface.hweb_ui_message_handler.ccweb_ui_mojo_browsertest.ccweb_ui_navigation_browsertest.ccweb_ui_url_loader_factory.ccweb_ui_url_loader_factory_unittest.cc
worker_host
dedicated_worker_host.ccdedicated_worker_host.hdedicated_worker_host_factory_impl.hdedicated_worker_service_impl_unittest.ccshared_worker_host.ccshared_worker_host_unittest.ccworker_browsertest.ccworker_script_fetcher.ccworker_script_fetcher.hworker_script_loader.ccworker_script_loader.h
xr
child
common
android
background_fetch
cursors
drop_data_unittest.ccfetch
font_list_win.ccinput
actions_parser.ccactions_parser_fuzzer.ccactions_parser_test_driver_unittest.ccactions_parser_unittest.ccinput_router.hinput_router_impl.ccinput_router_impl.htouch_action_filter.htouch_action_filter_unittest.cctouchpad_pinch_event_queue.hweb_input_event_builders_ios.hweb_input_event_builders_ios.mm
media
mojo_core_library_support.ccmojo_core_library_support.hprocess_visibility_tracker.ccprocess_visibility_tracker.hservice_worker
race_network_request_url_loader_client.ccrace_network_request_url_loader_client.hrace_network_request_url_loader_client_unittest.ccservice_worker_resource_loader.hservice_worker_router_evaluator.ccservice_worker_router_evaluator.hservice_worker_router_evaluator_unittest.cc
shared_file_util.ccshared_file_util.hpublic
app
browser
android
authenticator_request_client_delegate.ccauthenticator_request_client_delegate.hback_forward_cache.hbackground_fetch_delegate.hbackground_fetch_description.ccbackground_fetch_description.hbackground_fetch_response.ccbackground_fetch_response.hbackground_tracing_manager.hbluetooth_delegate.hbrowser_child_process_host_delegate.ccbrowser_child_process_host_delegate.hbrowser_context.hbrowsing_data_filter_builder.hbrowsing_data_remover.hchild_process_host.hchild_process_security_policy.hclear_site_data_utils.hclipboard_types.hcontent_browser_client.cccontent_browser_client.hcontent_index_context.hcookie_deprecation_label_manager.hdesktop_streams_registry.hdevtools_agent_host_client.ccdevtools_agent_host_client.hdownload_manager.hdownload_manager_delegate.ccdownload_manager_delegate.hfederated_identity_permission_context_delegate.hfile_system_access_entry_factory.hfirst_party_sets_handler.hidentity_request_account.ccidentity_request_account.hidentity_request_dialog_controller.ccidentity_request_dialog_controller.hlogin_delegate.hmedia_device_id.ccmedia_device_id.hmedia_stream_request.hmessage_port_provider.hmhtml_generation_result.ccmhtml_generation_result.hnavigation_controller.hnavigation_entry.hnavigation_handle.hnavigation_throttle.ccnavigation_throttle.hnotification_database_data.hnotification_event_dispatcher.hpage.hpage_navigator.hpermission_controller_delegate.ccpermission_controller_delegate.hpermission_overrides.ccpermission_overrides.hpermission_request_description.ccpermission_request_description.hpicture_in_picture_window_controller.hplatform_notification_context.hprefetch_metrics.hpush_messaging_service.hreduce_accept_language_controller_delegate.hrender_frame_host.hrender_widget_host.hrender_widget_host_view.hservice_process_host.hservice_process_info.ccservice_process_info.hservice_worker_context.hstorage_partition_config.ccstorage_partition_config.htracing_delegate.cctracing_delegate.htrust_token_access_details.cctrust_token_access_details.htts_controller_delegate.hweb_contents.hweb_contents_observer.hweb_contents_view_delegate.hcommon
renderer
test
accessibility_notification_waiter.ccaccessibility_notification_waiter.hblink_test_environment.hbrowser_task_environment.hbrowser_test_base.ccbrowser_test_base.hbrowser_test_utils.ccbrowser_test_utils.hcontent_browser_test.hcontent_browser_test_shell_main_delegate.cccontent_browser_test_shell_main_delegate.hfake_download_item.ccfake_download_item.hfake_frame_widget.ccfake_frame_widget.hfake_local_frame.ccfake_local_frame.hfake_remote_frame.ccfake_remote_frame.hfake_render_widget_host.ccfake_render_widget_host.hfenced_frame_reporter_observer.ccfenced_frame_test_util.ccfenced_frame_test_util.hfile_system_chooser_test_helpers.ccfile_system_chooser_test_helpers.hfocus_changed_observer.hmock_download_manager.ccmock_download_manager.hmock_media_session.hmock_navigation_handle.hmock_web_contents_observer.hnavigation_handle_observer.hnetwork_service_test_helper.ccpermissions_test_utils.ccpreloading_test_util.ccpreloading_test_util.hprerender_test_util.ccprerender_test_util.hrender_view_test.ccrender_view_test.hscoped_page_focus_override.ccservice_worker_test_helpers.ccshared_storage_test_utils.ccshared_storage_test_utils.hsigned_exchange_browser_test_helper.cctest_devtools_protocol_client.cctest_devtools_protocol_client.htest_download_http_response.htest_frame_navigation_observer.htest_navigation_observer.cctest_navigation_observer.htest_navigation_throttle.cctest_select_url_fenced_frame_config_observer.htest_utils.htest_web_ui_listener_observer.htext_input_test_utils.ccunittest_test_suite.ccunittest_test_suite.hurl_loader_interceptor.ccurl_loader_interceptor.hurl_loader_monitor.ccurl_loader_monitor.hweb_contents_tester.hweb_ui_browsertest_util.ccweb_ui_browsertest_util.h
renderer
accessibility
agent_scheduling_group.cccontent_security_policy_util.ccgpu_benchmarking_extension.ccmedia
android
stream_texture_factory.ccstream_texture_factory.hstream_texture_wrapper_impl.ccstream_texture_wrapper_impl.h
batching_media_log.hcodec_factory.cccodec_factory.hgpu
inspector_media_event_handler.ccrender_media_client.ccrender_media_client.hrenderer_web_media_player_delegate.hwin
pepper
pepper_file_system_host.ccpepper_media_stream_video_track_host.ccpepper_plugin_instance_impl.hpepper_plugin_registry.ccpepper_plugin_registry.hpepper_video_encoder_host.ccplugin_module.ccplugin_module.hurl_request_info_util.ccvideo_decoder_shim.ccvideo_decoder_shim.hvideo_encoder_shim.ccvideo_encoder_shim.h
render_frame_impl.ccrender_frame_impl.hrender_frame_impl_browsertest.ccrender_thread_impl.ccrender_thread_impl.hrender_view_browsertest.ccrenderer_blink_platform_impl.ccrenderer_blink_platform_impl.hrenderer_main.ccservice_worker
controller_service_worker_connector.cccontroller_service_worker_connector.hservice_worker_provider_context.ccservice_worker_provider_context.hservice_worker_subresource_loader.ccservice_worker_subresource_loader.hservice_worker_subresource_loader_unittest.ccweb_service_worker_provider_impl.ccweb_service_worker_provider_impl.h
skia_benchmarking_extension.ccstream_texture_host_android.ccstream_texture_host_android.hservices
auction_worklet
auction_v8_helper.ccauction_v8_helper.hauction_v8_helper_unittest.ccauction_worklet_service_impl.ccauction_worklet_service_impl.hbidder_worklet.ccbidder_worklet.hbidder_worklet_unittest.cccontext_recycler_unittest.ccdirect_from_seller_signals_requester.ccdirect_from_seller_signals_requester.hfor_debugging_only_bindings.ccfor_debugging_only_bindings.hprivate_aggregation_bindings.ccregister_ad_beacon_bindings.hreport_bindings.ccreport_bindings.hseller_worklet.ccseller_worklet.hseller_worklet_unittest.ccset_bid_bindings.ccset_bid_bindings.hset_priority_bindings.ccset_priority_bindings.hset_priority_signals_override_bindings.hshared_storage_bindings.cctrusted_signals.cctrusted_signals.htrusted_signals_request_manager.cctrusted_signals_request_manager.htrusted_signals_request_manager_unittest.cctrusted_signals_unittest.ccwebidl_compat.hwebidl_compat_unittest.ccworklet_devtools_debug_test_util.ccworklet_loader.ccworklet_loader.hworklet_loader_unittest.ccworklet_test_util.ccworklet_test_util.hworklet_v8_debug_test_util.cc
public
cpp
shell
app
browser
test
content_browser_test_test.cccontent_browser_test_utils_internal.cccontent_browser_test_utils_internal.hdwrite_font_fake_sender_win.ccfake_network.ccfenced_frame_test_utils.ccfenced_frame_test_utils.h
fuzzer
audio_context_manager_mojolpm_fuzzer.ccimage_capture_mojolpm_fuzzer.ccmedia_stream_dispatcher_host_mojolpm_fuzzer.ccpresentation_service_mojolpm_fuzzer.ccrenderer_tree_fuzzer.cc
mock_overscroll_controller_delegate_aura.ccmock_overscroll_controller_delegate_aura.hmock_platform_notification_service.ccmock_platform_notification_service.hmock_reduce_accept_language_controller_delegate.ccmock_reduce_accept_language_controller_delegate.hmock_render_widget_host_delegate.ccmock_render_widget_host_delegate.hmock_widget.hnavigation_simulator_impl.ccnavigation_simulator_impl.hnavigation_simulator_unittest.ccrun_all_unittests.cctest_aggregation_service_impl.cctest_navigation_url_loader.cctest_navigation_url_loader.htest_navigation_url_loader_delegate.cctest_navigation_url_loader_delegate.htest_overscroll_delegate.cctest_overscroll_delegate.htest_page.cctest_page.htest_page_broadcast.cctest_page_broadcast.htest_render_frame.cctest_render_frame.htest_render_frame_host.cctest_render_frame_host.htest_render_view_host.cctest_render_view_host.htest_render_view_host_factory.cctest_render_view_host_factory.htest_select_url_fenced_frame_config_observer_impl.cctest_select_url_fenced_frame_config_observer_impl.htest_web_contents.cctest_web_contents.hurl_loader_interceptor_browsertest.ccweb_contents_observer_consistency_checker.ccweb_contents_observer_consistency_checker.hutility
web_test
browser
fake_bluetooth_chooser.ccfake_bluetooth_delegate.ccfake_bluetooth_delegate.hmojo_optional_numerics_unittest.ccmojo_optional_numerics_unittest.hweb_test_background_fetch_delegate.ccweb_test_background_fetch_delegate.hweb_test_bluetooth_adapter_provider.ccweb_test_control_host.ccweb_test_control_host.hweb_test_cookie_manager.ccweb_test_download_manager_delegate.ccweb_test_download_manager_delegate.hweb_test_fedcm_manager.ccweb_test_permission_manager.ccweb_test_push_messaging_service.ccweb_test_tracing_controller.h
common
renderer
ui/webui/examples/app
@ -6,6 +6,7 @@
|
||||
#define CHROME_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_NAVIGATION_THROTTLE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include "base/memory/raw_ref.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
@ -63,7 +64,7 @@ class FirstPartySetsNavigationThrottle : public content::NavigationThrottle {
|
||||
GUARDED_BY_CONTEXT(sequence_checker_);
|
||||
|
||||
// Timer starting when a navigation gets deferred.
|
||||
absl::optional<base::ElapsedTimer> throttle_navigation_timer_
|
||||
std::optional<base::ElapsedTimer> throttle_navigation_timer_
|
||||
GUARDED_BY_CONTEXT(sequence_checker_);
|
||||
|
||||
// Stores the state of whether the navigation has been resumed, to make sure
|
||||
|
@ -147,7 +147,7 @@ void JNI_ContentChildProcessServiceDelegate_RetrieveFileDescriptorsIdsToKeys(
|
||||
std::vector<int> ids;
|
||||
std::vector<std::string> keys;
|
||||
if (!file_switch_value.empty()) {
|
||||
absl::optional<std::map<int, std::string>> ids_to_keys_from_command_line =
|
||||
std::optional<std::map<int, std::string>> ids_to_keys_from_command_line =
|
||||
ParseSharedFileSwitchValue(file_switch_value);
|
||||
if (ids_to_keys_from_command_line) {
|
||||
for (auto iter : *ids_to_keys_from_command_line) {
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "content/public/app/content_main.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/allocator/partition_alloc_support.h"
|
||||
#include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc_buildflags.h"
|
||||
#include "base/at_exit.h"
|
||||
@ -42,7 +44,6 @@
|
||||
#include "mojo/public/cpp/platform/platform_channel.h"
|
||||
#include "mojo/public/cpp/system/dynamic_library_support.h"
|
||||
#include "sandbox/policy/sandbox_type.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/base/ui_base_paths.h"
|
||||
#include "ui/base/ui_base_switches.h"
|
||||
|
||||
|
@ -870,7 +870,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
|
||||
|
||||
if (!GetContentClient())
|
||||
ContentClientCreator::Create(delegate_);
|
||||
absl::optional<int> basic_startup_exit_code =
|
||||
std::optional<int> basic_startup_exit_code =
|
||||
delegate_->BasicStartupComplete();
|
||||
if (basic_startup_exit_code.has_value())
|
||||
return basic_startup_exit_code.value();
|
||||
@ -1176,8 +1176,7 @@ int ContentMainRunnerImpl::RunBrowser(MainFunctionParams main_params,
|
||||
const bool has_thread_pool =
|
||||
GetContentClient()->browser()->CreateThreadPool("Browser");
|
||||
|
||||
absl::optional<int> pre_browser_main_exit_code =
|
||||
delegate_->PreBrowserMain();
|
||||
std::optional<int> pre_browser_main_exit_code = delegate_->PreBrowserMain();
|
||||
if (pre_browser_main_exit_code.has_value())
|
||||
return pre_browser_main_exit_code.value();
|
||||
|
||||
@ -1202,7 +1201,7 @@ int ContentMainRunnerImpl::RunBrowser(MainFunctionParams main_params,
|
||||
variations::VariationsIdsProvider::Mode::kUseSignedInState);
|
||||
}
|
||||
|
||||
absl::optional<int> post_early_initialization_exit_code =
|
||||
std::optional<int> post_early_initialization_exit_code =
|
||||
delegate_->PostEarlyInitialization(invoked_in_browser);
|
||||
if (post_early_initialization_exit_code.has_value())
|
||||
return post_early_initialization_exit_code.value();
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define CONTENT_APP_CONTENT_MAIN_RUNNER_IMPL_H_
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
@ -14,7 +15,6 @@
|
||||
#include "content/public/app/content_main_runner.h"
|
||||
#include "content/public/common/main_function_params.h"
|
||||
#include "mojo/core/embedder/scoped_ipc_support.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
class AtExitManager;
|
||||
@ -72,7 +72,7 @@ class ContentMainRunnerImpl : public ContentMainRunner {
|
||||
std::unique_ptr<base::AtExitManager> exit_manager_;
|
||||
|
||||
// Received in Initialize(), handed-off in Run().
|
||||
absl::optional<ContentMainParams> content_main_params_;
|
||||
std::optional<ContentMainParams> content_main_params_;
|
||||
};
|
||||
|
||||
} // namespace content
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -23,7 +24,6 @@
|
||||
#include "content/public/utility/content_utility_client.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
namespace variations {
|
||||
@ -48,9 +48,9 @@ class MockContentMainDelegate : public ContentBrowserTestShellMainDelegate {
|
||||
public:
|
||||
using Super = ContentBrowserTestShellMainDelegate;
|
||||
|
||||
MOCK_METHOD(absl::optional<int>, MockBasicStartupComplete, ());
|
||||
absl::optional<int> BasicStartupComplete() override {
|
||||
absl::optional<int> result = MockBasicStartupComplete();
|
||||
MOCK_METHOD(std::optional<int>, MockBasicStartupComplete, ());
|
||||
std::optional<int> BasicStartupComplete() override {
|
||||
std::optional<int> result = MockBasicStartupComplete();
|
||||
// Check for early exit code.
|
||||
if (result.has_value())
|
||||
return result;
|
||||
@ -96,9 +96,9 @@ class MockContentMainDelegate : public ContentBrowserTestShellMainDelegate {
|
||||
return Super::ShouldLockSchemeRegistry();
|
||||
}
|
||||
|
||||
MOCK_METHOD(absl::optional<int>, MockPreBrowserMain, ());
|
||||
absl::optional<int> PreBrowserMain() override {
|
||||
absl::optional<int> result = MockPreBrowserMain();
|
||||
MOCK_METHOD(std::optional<int>, MockPreBrowserMain, ());
|
||||
std::optional<int> PreBrowserMain() override {
|
||||
std::optional<int> result = MockPreBrowserMain();
|
||||
// Check for early exit code.
|
||||
if (result.has_value())
|
||||
return result;
|
||||
@ -118,9 +118,9 @@ class MockContentMainDelegate : public ContentBrowserTestShellMainDelegate {
|
||||
return Super::CreateVariationsIdsProvider();
|
||||
}
|
||||
|
||||
MOCK_METHOD(absl::optional<int>, MockPostEarlyInitialization, (InvokedIn));
|
||||
absl::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override {
|
||||
absl::optional<int> result = MockPostEarlyInitialization(invoked_in);
|
||||
MOCK_METHOD(std::optional<int>, MockPostEarlyInitialization, (InvokedIn));
|
||||
std::optional<int> PostEarlyInitialization(InvokedIn invoked_in) override {
|
||||
std::optional<int> result = MockPostEarlyInitialization(invoked_in);
|
||||
// Check for early exit code.
|
||||
if (result.has_value())
|
||||
return result;
|
||||
@ -218,7 +218,7 @@ class ContentMainRunnerImplBrowserTest : public ContentBrowserTest {
|
||||
.WillOnce(DoAll(
|
||||
// Test the starting state of ContentMainRunnerImpl.
|
||||
Invoke(this, &Self::TestBasicStartupComplete),
|
||||
Return(absl::nullopt)));
|
||||
Return(std::nullopt)));
|
||||
EXPECT_CALL(mock_delegate_, MockCreateContentBrowserClient());
|
||||
EXPECT_CALL(mock_delegate_, MockPreSandboxStartup());
|
||||
EXPECT_CALL(mock_delegate_, MockSandboxInitialized(kBrowserProcessType));
|
||||
@ -229,11 +229,11 @@ class ContentMainRunnerImplBrowserTest : public ContentBrowserTest {
|
||||
ShouldInitializeMojo(InvokedInMatcher(kBrowserProcessType)))
|
||||
.WillOnce(Return(true));
|
||||
EXPECT_CALL(mock_delegate_, MockPreBrowserMain())
|
||||
.WillOnce(Return(absl::nullopt));
|
||||
.WillOnce(Return(std::nullopt));
|
||||
EXPECT_CALL(mock_delegate_, MockPostEarlyInitialization(
|
||||
InvokedInMatcher(kBrowserProcessType)))
|
||||
.WillOnce(DoAll(Invoke(this, &Self::TestPostEarlyInitialization),
|
||||
Return(absl::nullopt)));
|
||||
Return(std::nullopt)));
|
||||
EXPECT_CALL(mock_delegate_, MockRunProcess(kBrowserProcessType, _));
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// Android never calls ProcessExiting, since it leaks its ContentMainRunner
|
||||
|
@ -75,7 +75,7 @@ class RenderWidgetHostNSViewBridge : public mojom::RenderWidgetHostNSView,
|
||||
void ShowDictionaryOverlay(ui::mojom::AttributedStringPtr attributed_string,
|
||||
const gfx::Point& baseline_point) override;
|
||||
void LockKeyboard(
|
||||
const absl::optional<std::vector<uint32_t>>& uint_dom_codes) override;
|
||||
const std::optional<std::vector<uint32_t>>& uint_dom_codes) override;
|
||||
void UnlockKeyboard() override;
|
||||
void ShowSharingServicePicker(
|
||||
const std::string& title,
|
||||
|
@ -279,8 +279,8 @@ void RenderWidgetHostNSViewBridge::ShowDictionaryOverlay(
|
||||
}
|
||||
|
||||
void RenderWidgetHostNSViewBridge::LockKeyboard(
|
||||
const absl::optional<std::vector<uint32_t>>& uint_dom_codes) {
|
||||
absl::optional<base::flat_set<ui::DomCode>> dom_codes;
|
||||
const std::optional<std::vector<uint32_t>>& uint_dom_codes) {
|
||||
std::optional<base::flat_set<ui::DomCode>> dom_codes;
|
||||
if (uint_dom_codes) {
|
||||
dom_codes.emplace();
|
||||
for (const auto& uint_dom_code : *uint_dom_codes)
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
@ -14,7 +15,6 @@
|
||||
#include "content/browser/renderer_host/input/mouse_wheel_rails_filter_mac.h"
|
||||
#include "content/common/render_widget_host_ns_view.mojom.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/input/input_handler.mojom-shared.h"
|
||||
#import "ui/base/cocoa/command_dispatcher.h"
|
||||
#import "ui/base/cocoa/tool_tip_base_view.h"
|
||||
@ -108,7 +108,7 @@ struct DidOverscrollParams;
|
||||
- (void)setCompositionRange:(gfx::Range)range;
|
||||
|
||||
// KeyboardLock methods.
|
||||
- (void)lockKeyboard:(absl::optional<base::flat_set<ui::DomCode>>)keysToLock;
|
||||
- (void)lockKeyboard:(std::optional<base::flat_set<ui::DomCode>>)keysToLock;
|
||||
- (void)unlockKeyboard;
|
||||
|
||||
// Cursorlock methods.
|
||||
|
@ -252,7 +252,7 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
|
||||
// keyCode value of an NSEvent. This field has a value while we're handling
|
||||
// a key down event.
|
||||
absl::optional<unsigned short> _currentKeyDownCode;
|
||||
std::optional<unsigned short> _currentKeyDownCode;
|
||||
|
||||
// Indicates if a reconversion (which means a piece of committed text becomes
|
||||
// part of the composition again) is triggered in Japanese IME when Live
|
||||
@ -343,7 +343,7 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
uint64_t popup_parent_ns_view_id_;
|
||||
|
||||
bool _keyboardLockActive;
|
||||
absl::optional<base::flat_set<ui::DomCode>> _lockedKeys;
|
||||
std::optional<base::flat_set<ui::DomCode>> _lockedKeys;
|
||||
|
||||
NSCandidateListTouchBarItem* __strong _candidateListTouchBarItem;
|
||||
NSInteger _textSuggestionsSequenceNumber;
|
||||
@ -1000,7 +1000,7 @@ void ExtractUnderlines(NSAttributedString* string,
|
||||
}
|
||||
}
|
||||
|
||||
- (void)lockKeyboard:(absl::optional<base::flat_set<ui::DomCode>>)keysToLock {
|
||||
- (void)lockKeyboard:(std::optional<base::flat_set<ui::DomCode>>)keysToLock {
|
||||
// TODO(joedow): Integrate System-level keyboard hook into this method.
|
||||
_lockedKeys = std::move(keysToLock);
|
||||
_keyboardLockActive = true;
|
||||
|
@ -111,7 +111,7 @@
|
||||
// TODO(https://crbug.com/898608): The |downloadFileName_| and
|
||||
// |downloadURL_| values should be computed by the caller.
|
||||
if (_dropData.download_metadata.empty()) {
|
||||
absl::optional<base::FilePath> suggestedFilename =
|
||||
std::optional<base::FilePath> suggestedFilename =
|
||||
_dropData.GetSafeFilenameForImageFileContents();
|
||||
if (suggestedFilename) {
|
||||
_downloadFileName = std::move(*suggestedFilename);
|
||||
|
@ -39,7 +39,7 @@ void AboutURLLoaderFactory::CreateLoaderAndStart(
|
||||
}
|
||||
|
||||
client_remote->OnReceiveResponse(std::move(response_head),
|
||||
std::move(consumer), absl::nullopt);
|
||||
std::move(consumer), std::nullopt);
|
||||
client_remote->OnComplete(network::URLLoaderCompletionStatus(net::OK));
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ std::string AccessibilityTreeFormatterAndroid::ProcessTreeForOutput(
|
||||
}
|
||||
|
||||
for (const char* attribute_name : BOOL_ATTRIBUTES) {
|
||||
absl::optional<bool> value = dict.FindBool(attribute_name);
|
||||
std::optional<bool> value = dict.FindBool(attribute_name);
|
||||
if (value && *value)
|
||||
WriteAttribute(true, attribute_name, &line);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <cstddef>
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
@ -16,7 +16,6 @@
|
||||
#include "base/values.h"
|
||||
#include "content/browser/accessibility/browser_accessibility.h"
|
||||
#include "content/browser/accessibility/browser_accessibility_manager.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/accessibility/ax_enums.mojom.h"
|
||||
#include "ui/accessibility/ax_node_data.h"
|
||||
#include "ui/accessibility/ax_selection.h"
|
||||
@ -28,15 +27,14 @@
|
||||
namespace content {
|
||||
namespace {
|
||||
|
||||
absl::optional<std::string> GetStringAttribute(
|
||||
const ui::AXNode& node,
|
||||
ax::mojom::StringAttribute attr) {
|
||||
std::optional<std::string> GetStringAttribute(const ui::AXNode& node,
|
||||
ax::mojom::StringAttribute attr) {
|
||||
// Language is different from other string attributes as it inherits and has
|
||||
// a method to compute it.
|
||||
if (attr == ax::mojom::StringAttribute::kLanguage) {
|
||||
std::string value = node.GetLanguage();
|
||||
if (value.empty()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@ -45,7 +43,7 @@ absl::optional<std::string> GetStringAttribute(
|
||||
if (attr == ax::mojom::StringAttribute::kFontFamily) {
|
||||
std::string value = node.GetInheritedStringAttribute(attr);
|
||||
if (value.empty()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
@ -56,7 +54,7 @@ absl::optional<std::string> GetStringAttribute(
|
||||
if (node.GetStringAttribute(attr, &value)) {
|
||||
return value;
|
||||
}
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::string FormatColor(int argb) {
|
||||
@ -714,7 +712,7 @@ std::string AccessibilityTreeFormatterBlink::ProcessTreeForOutput(
|
||||
attr_index <= static_cast<int32_t>(ax::mojom::BoolAttribute::kMaxValue);
|
||||
++attr_index) {
|
||||
auto attr = static_cast<ax::mojom::BoolAttribute>(attr_index);
|
||||
absl::optional<bool> bool_value = dict.FindBool(ui::ToString(attr));
|
||||
std::optional<bool> bool_value = dict.FindBool(ui::ToString(attr));
|
||||
if (!bool_value.has_value())
|
||||
continue;
|
||||
WriteAttribute(false,
|
||||
@ -727,7 +725,7 @@ std::string AccessibilityTreeFormatterBlink::ProcessTreeForOutput(
|
||||
attr_index <= static_cast<int32_t>(ax::mojom::FloatAttribute::kMaxValue);
|
||||
++attr_index) {
|
||||
auto attr = static_cast<ax::mojom::FloatAttribute>(attr_index);
|
||||
absl::optional<double> float_value = dict.FindDouble(ui::ToString(attr));
|
||||
std::optional<double> float_value = dict.FindDouble(ui::ToString(attr));
|
||||
if (!float_value)
|
||||
continue;
|
||||
WriteAttribute(
|
||||
|
@ -1059,7 +1059,7 @@ BrowserAccessibility::PlatformChildIterator::GetNativeViewAccessible() const {
|
||||
return platform_iterator->GetNativeViewAccessible();
|
||||
}
|
||||
|
||||
absl::optional<size_t>
|
||||
std::optional<size_t>
|
||||
BrowserAccessibility::PlatformChildIterator::GetIndexInParent() const {
|
||||
if (platform_iterator == parent_->PlatformChildrenEnd().platform_iterator)
|
||||
return parent_->PlatformChildCount();
|
||||
@ -1127,13 +1127,13 @@ ui::AXPlatformNode* BrowserAccessibility::GetFromTreeIDAndNodeID(
|
||||
return node->GetAXPlatformNode();
|
||||
}
|
||||
|
||||
absl::optional<size_t> BrowserAccessibility::GetIndexInParent() const {
|
||||
std::optional<size_t> BrowserAccessibility::GetIndexInParent() const {
|
||||
if (manager()->GetBrowserAccessibilityRoot() == this &&
|
||||
PlatformGetParent() == nullptr) {
|
||||
// If it is a root node of WebContent, it doesn't have a parent and a
|
||||
// valid index in parent. So it returns -1 in order to compute its
|
||||
// index at AXPlatformNodeBase.
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return node()->GetUnignoredIndexInParent();
|
||||
}
|
||||
@ -1803,11 +1803,11 @@ bool BrowserAccessibility::ShouldIgnoreHoveredStateForTesting() {
|
||||
return accessibility_state->disable_hot_tracking_for_testing();
|
||||
}
|
||||
|
||||
absl::optional<int> BrowserAccessibility::GetPosInSet() const {
|
||||
std::optional<int> BrowserAccessibility::GetPosInSet() const {
|
||||
return node()->GetPosInSet();
|
||||
}
|
||||
|
||||
absl::optional<int> BrowserAccessibility::GetSetSize() const {
|
||||
std::optional<int> BrowserAccessibility::GetSetSize() const {
|
||||
return node()->GetSetSize();
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
@ -20,7 +21,6 @@
|
||||
#include "base/strings/string_split.h"
|
||||
#include "build/build_config.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/web/web_ax_enums.h"
|
||||
#include "ui/accessibility/ax_enums.mojom-forward.h"
|
||||
#include "ui/accessibility/ax_node.h"
|
||||
@ -131,7 +131,7 @@ class CONTENT_EXPORT BrowserAccessibility : public ui::AXPlatformNodeDelegate {
|
||||
PlatformChildIterator operator--(int);
|
||||
gfx::NativeViewAccessible GetNativeViewAccessible() const override;
|
||||
BrowserAccessibility* get() const override;
|
||||
absl::optional<size_t> GetIndexInParent() const override;
|
||||
std::optional<size_t> GetIndexInParent() const override;
|
||||
BrowserAccessibility& operator*() const override;
|
||||
BrowserAccessibility* operator->() const override;
|
||||
|
||||
@ -407,7 +407,7 @@ class CONTENT_EXPORT BrowserAccessibility : public ui::AXPlatformNodeDelegate {
|
||||
ui::AXPlatformNode* GetFromNodeID(int32_t id) override;
|
||||
ui::AXPlatformNode* GetFromTreeIDAndNodeID(const ui::AXTreeID& ax_tree_id,
|
||||
int32_t id) override;
|
||||
absl::optional<size_t> GetIndexInParent() const override;
|
||||
std::optional<size_t> GetIndexInParent() const override;
|
||||
gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override;
|
||||
|
||||
const std::vector<gfx::NativeViewAccessible> GetUIADirectChildrenInRange(
|
||||
@ -433,8 +433,8 @@ class CONTENT_EXPORT BrowserAccessibility : public ui::AXPlatformNodeDelegate {
|
||||
ax::mojom::IntAttribute attr) override;
|
||||
std::vector<ui::AXPlatformNode*> GetSourceNodesForReverseRelations(
|
||||
ax::mojom::IntListAttribute attr) override;
|
||||
absl::optional<int> GetPosInSet() const override;
|
||||
absl::optional<int> GetSetSize() const override;
|
||||
std::optional<int> GetPosInSet() const override;
|
||||
std::optional<int> GetSetSize() const override;
|
||||
|
||||
// Returns true if this node is a list marker or if it's a descendant
|
||||
// of a list marker node. Returns false otherwise.
|
||||
|
@ -652,11 +652,11 @@ std::u16string BrowserAccessibilityAndroid::GetBrailleRoleDescription() const {
|
||||
}
|
||||
|
||||
std::u16string BrowserAccessibilityAndroid::GetTextContentUTF16() const {
|
||||
return GetSubstringTextContentUTF16(absl::nullopt);
|
||||
return GetSubstringTextContentUTF16(std::nullopt);
|
||||
}
|
||||
|
||||
std::u16string BrowserAccessibilityAndroid::GetSubstringTextContentUTF16(
|
||||
absl::optional<EarlyExitPredicate> predicate) const {
|
||||
std::optional<EarlyExitPredicate> predicate) const {
|
||||
if (ui::IsIframe(GetRole()))
|
||||
return std::u16string();
|
||||
|
||||
@ -1238,7 +1238,7 @@ int BrowserAccessibilityAndroid::GetItemIndex() const {
|
||||
if (max > min && value >= min && value <= max)
|
||||
index = static_cast<int>(((value - min)) * 100 / (max - min));
|
||||
} else {
|
||||
absl::optional<int> pos_in_set = GetPosInSet();
|
||||
std::optional<int> pos_in_set = GetPosInSet();
|
||||
if (pos_in_set && *pos_in_set > 0)
|
||||
index = *pos_in_set - 1;
|
||||
}
|
||||
@ -1628,7 +1628,7 @@ int BrowserAccessibilityAndroid::ColumnCount() const {
|
||||
}
|
||||
|
||||
int BrowserAccessibilityAndroid::RowIndex() const {
|
||||
absl::optional<int> pos_in_set = GetPosInSet();
|
||||
std::optional<int> pos_in_set = GetPosInSet();
|
||||
if (pos_in_set && pos_in_set > 0)
|
||||
return *pos_in_set - 1;
|
||||
return node()->GetTableCellRowIndex().value_or(0);
|
||||
|
@ -121,7 +121,7 @@ class CONTENT_EXPORT BrowserAccessibilityAndroid : public BrowserAccessibility {
|
||||
typedef base::RepeatingCallback<bool(const std::u16string& partial)>
|
||||
EarlyExitPredicate;
|
||||
std::u16string GetSubstringTextContentUTF16(
|
||||
absl::optional<EarlyExitPredicate>) const;
|
||||
std::optional<EarlyExitPredicate>) const;
|
||||
static EarlyExitPredicate NonEmptyPredicate();
|
||||
static EarlyExitPredicate LengthAtLeast(size_t length);
|
||||
|
||||
|
@ -357,7 +357,7 @@ TEST_F(BrowserAccessibilityAndroidTest, TestGetTextContent) {
|
||||
BrowserAccessibilityAndroid* node =
|
||||
static_cast<BrowserAccessibilityAndroid*>(container_obj);
|
||||
// No predicate returns all text.
|
||||
EXPECT_EQ(u"1Foo2Bar3Baz", node->GetSubstringTextContentUTF16(absl::nullopt));
|
||||
EXPECT_EQ(u"1Foo2Bar3Baz", node->GetSubstringTextContentUTF16(std::nullopt));
|
||||
// Non-empty predicate terminates after one text node.
|
||||
EXPECT_EQ(u"1Foo", node->GetSubstringTextContentUTF16(
|
||||
BrowserAccessibilityAndroid::NonEmptyPredicate()));
|
||||
|
@ -378,7 +378,7 @@ TEST_F(BrowserAccessibilityAuraLinuxTest,
|
||||
TestTextAttributesInContentEditables) {
|
||||
auto has_attribute = [](AtkAttributeSet* attributes,
|
||||
AtkTextAttribute text_attribute,
|
||||
absl::optional<const char*> expected_value) {
|
||||
std::optional<const char*> expected_value) {
|
||||
const char* name = atk_text_attribute_get_name(text_attribute);
|
||||
while (attributes) {
|
||||
const AtkAttribute* attribute =
|
||||
@ -539,9 +539,8 @@ TEST_F(BrowserAccessibilityAuraLinuxTest,
|
||||
|
||||
ASSERT_TRUE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_FAMILY_NAME, "Helvetica"));
|
||||
ASSERT_FALSE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_WEIGHT, absl::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_STYLE, absl::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_WEIGHT, std::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_STYLE, std::nullopt));
|
||||
ASSERT_TRUE(has_attribute(attributes, ATK_TEXT_ATTR_UNDERLINE, "single"));
|
||||
ASSERT_TRUE(has_attribute(attributes, ATK_TEXT_ATTR_LANGUAGE, "fr"));
|
||||
|
||||
@ -563,13 +562,12 @@ TEST_F(BrowserAccessibilityAuraLinuxTest,
|
||||
|
||||
ASSERT_TRUE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_FAMILY_NAME, "Helvetica"));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_WEIGHT, std::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_STYLE, std::nullopt));
|
||||
ASSERT_FALSE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_WEIGHT, absl::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_STYLE, absl::nullopt));
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_UNDERLINE, std::nullopt));
|
||||
ASSERT_FALSE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_UNDERLINE, absl::nullopt));
|
||||
ASSERT_FALSE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_INVALID, absl::nullopt));
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_INVALID, std::nullopt));
|
||||
|
||||
atk_attribute_set_free(attributes);
|
||||
}
|
||||
@ -587,8 +585,8 @@ TEST_F(BrowserAccessibilityAuraLinuxTest,
|
||||
ASSERT_TRUE(has_attribute(attributes, ATK_TEXT_ATTR_WEIGHT, "700"));
|
||||
ASSERT_TRUE(has_attribute(attributes, ATK_TEXT_ATTR_STYLE, "italic"));
|
||||
ASSERT_FALSE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_UNDERLINE, absl::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_INVALID, absl::nullopt));
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_UNDERLINE, std::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_INVALID, std::nullopt));
|
||||
atk_attribute_set_free(attributes);
|
||||
|
||||
AtkObject* ax_after_atk_object =
|
||||
@ -599,10 +597,10 @@ TEST_F(BrowserAccessibilityAuraLinuxTest,
|
||||
EXPECT_EQ(7, end_offset);
|
||||
ASSERT_TRUE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_FAMILY_NAME, "Helvetica"));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_WEIGHT, absl::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_WEIGHT, std::nullopt));
|
||||
ASSERT_FALSE(has_attribute(attributes, ATK_TEXT_ATTR_STYLE, "italic"));
|
||||
ASSERT_FALSE(
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_UNDERLINE, absl::nullopt));
|
||||
has_attribute(attributes, ATK_TEXT_ATTR_UNDERLINE, std::nullopt));
|
||||
atk_attribute_set_free(attributes);
|
||||
|
||||
manager.reset();
|
||||
|
@ -8,10 +8,12 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/apple/foundation_util.h"
|
||||
@ -29,7 +31,6 @@
|
||||
#include "content/browser/accessibility/one_shot_accessibility_tree_search.h"
|
||||
#include "content/browser/accessibility/web_ax_platform_tree_manager_delegate.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/strings/grit/blink_strings.h"
|
||||
#include "third_party/skia/include/core/SkColor.h"
|
||||
#include "ui/accessibility/ax_common.h"
|
||||
@ -660,8 +661,8 @@ bool content::IsNSRange(id value) {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
|
||||
absl::optional<int> column = _owner->node()->GetTableCellColIndex();
|
||||
absl::optional<int> colspan = _owner->node()->GetTableCellColSpan();
|
||||
std::optional<int> column = _owner->node()->GetTableCellColIndex();
|
||||
std::optional<int> colspan = _owner->node()->GetTableCellColSpan();
|
||||
if (column && colspan)
|
||||
return [NSValue valueWithRange:NSMakeRange(*column, *colspan)];
|
||||
return nil;
|
||||
@ -801,12 +802,12 @@ bool content::IsNSRange(id value) {
|
||||
return [self treeItemRowIndex];
|
||||
} else if ([self internalRole] == ax::mojom::Role::kColumn) {
|
||||
DCHECK(_owner->node());
|
||||
absl::optional<int> col_index = *_owner->node()->GetTableColColIndex();
|
||||
std::optional<int> col_index = *_owner->node()->GetTableColColIndex();
|
||||
if (col_index)
|
||||
return @(*col_index);
|
||||
} else if ([self internalRole] == ax::mojom::Role::kRow) {
|
||||
DCHECK(_owner->node());
|
||||
absl::optional<int> row_index = _owner->node()->GetTableRowRowIndex();
|
||||
std::optional<int> row_index = _owner->node()->GetTableRowRowIndex();
|
||||
if (row_index)
|
||||
return @(*row_index);
|
||||
}
|
||||
@ -1194,8 +1195,8 @@ bool content::IsNSRange(id value) {
|
||||
if (![self instanceActive])
|
||||
return nil;
|
||||
|
||||
absl::optional<int> row = _owner->node()->GetTableCellRowIndex();
|
||||
absl::optional<int> rowspan = _owner->node()->GetTableCellRowSpan();
|
||||
std::optional<int> row = _owner->node()->GetTableCellRowIndex();
|
||||
std::optional<int> rowspan = _owner->node()->GetTableCellRowSpan();
|
||||
if (row && rowspan)
|
||||
return [NSValue valueWithRange:NSMakeRange(*row, *rowspan)];
|
||||
return nil;
|
||||
|
@ -1280,7 +1280,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_previousSibling(
|
||||
if (!node)
|
||||
return E_INVALIDARG;
|
||||
|
||||
absl::optional<size_t> index_in_parent = absl::nullopt;
|
||||
std::optional<size_t> index_in_parent = std::nullopt;
|
||||
if (GetOwner()->PlatformGetParent()) {
|
||||
index_in_parent = GetIndexInParent();
|
||||
}
|
||||
@ -1305,7 +1305,7 @@ IFACEMETHODIMP BrowserAccessibilityComWin::get_nextSibling(
|
||||
if (!node)
|
||||
return E_INVALIDARG;
|
||||
|
||||
absl::optional<size_t> index_in_parent = absl::nullopt;
|
||||
std::optional<size_t> index_in_parent = std::nullopt;
|
||||
if (GetOwner()->PlatformGetParent()) {
|
||||
index_in_parent = GetIndexInParent();
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ BrowserAccessibilityFuchsia::GetFuchsiaAttributes() const {
|
||||
}
|
||||
|
||||
if (IsList()) {
|
||||
absl::optional<int> size = GetSetSize();
|
||||
std::optional<int> size = GetSetSize();
|
||||
if (size) {
|
||||
fuchsia_accessibility_semantics::SetAttributes list_attributes;
|
||||
list_attributes.size(*size);
|
||||
@ -334,7 +334,7 @@ BrowserAccessibilityFuchsia::GetFuchsiaAttributes() const {
|
||||
}
|
||||
|
||||
if (IsListElement()) {
|
||||
absl::optional<int> index = GetPosInSet();
|
||||
std::optional<int> index = GetPosInSet();
|
||||
if (index) {
|
||||
fuchsia_accessibility_semantics::SetAttributes list_element_attributes;
|
||||
list_element_attributes.index(*index);
|
||||
|
@ -135,7 +135,7 @@ void BrowserAccessibilityManagerFuchsia::OnHitTestResult(
|
||||
if (!GetAccessibilityBridge())
|
||||
return;
|
||||
|
||||
absl::optional<uint32_t> hit_result_id;
|
||||
std::optional<uint32_t> hit_result_id;
|
||||
|
||||
if (node) {
|
||||
BrowserAccessibilityFuchsia* hit_result =
|
||||
|
@ -42,20 +42,20 @@ class MockBrowserAccessibilityDelegate
|
||||
last_request_id_ = opt_request_id;
|
||||
}
|
||||
|
||||
const absl::optional<ui::AXActionData>& last_action_data() {
|
||||
const std::optional<ui::AXActionData>& last_action_data() {
|
||||
return last_action_data_;
|
||||
}
|
||||
|
||||
const absl::optional<int>& last_request_id() { return last_request_id_; }
|
||||
const std::optional<int>& last_request_id() { return last_request_id_; }
|
||||
|
||||
const absl::optional<gfx::Point>& last_hit_test_point() {
|
||||
const std::optional<gfx::Point>& last_hit_test_point() {
|
||||
return last_hit_test_point_;
|
||||
}
|
||||
|
||||
private:
|
||||
absl::optional<ui::AXActionData> last_action_data_;
|
||||
absl::optional<int> last_request_id_;
|
||||
absl::optional<gfx::Point> last_hit_test_point_;
|
||||
std::optional<ui::AXActionData> last_action_data_;
|
||||
std::optional<int> last_request_id_;
|
||||
std::optional<gfx::Point> last_hit_test_point_;
|
||||
};
|
||||
|
||||
class MockAccessibilityBridge : public ui::AccessibilityBridgeFuchsia {
|
||||
@ -73,7 +73,7 @@ class MockAccessibilityBridge : public ui::AccessibilityBridgeFuchsia {
|
||||
}
|
||||
|
||||
void OnAccessibilityHitTestResult(int hit_test_request_id,
|
||||
absl::optional<uint32_t> result) override {
|
||||
std::optional<uint32_t> result) override {
|
||||
hit_test_results_[hit_test_request_id] = result;
|
||||
}
|
||||
|
||||
@ -93,15 +93,15 @@ class MockAccessibilityBridge : public ui::AccessibilityBridgeFuchsia {
|
||||
return node_updates_;
|
||||
}
|
||||
const std::vector<uint32_t>& node_deletions() { return node_deletions_; }
|
||||
const std::map<int, absl::optional<uint32_t>>& hit_test_results() {
|
||||
const std::map<int, std::optional<uint32_t>>& hit_test_results() {
|
||||
return hit_test_results_;
|
||||
}
|
||||
|
||||
const absl::optional<uint32_t>& old_focus() { return old_focus_; }
|
||||
const std::optional<uint32_t>& old_focus() { return old_focus_; }
|
||||
|
||||
const absl::optional<uint32_t>& new_focus() { return new_focus_; }
|
||||
const std::optional<uint32_t>& new_focus() { return new_focus_; }
|
||||
|
||||
const absl::optional<uint32_t>& root_node_id() { return root_node_id_; }
|
||||
const std::optional<uint32_t>& root_node_id() { return root_node_id_; }
|
||||
|
||||
void reset() {
|
||||
node_updates_.clear();
|
||||
@ -114,11 +114,11 @@ class MockAccessibilityBridge : public ui::AccessibilityBridgeFuchsia {
|
||||
std::vector<fuchsia_accessibility_semantics::Node> node_updates_;
|
||||
std::vector<uint32_t> node_deletions_;
|
||||
std::map<int /* hit test request id */,
|
||||
absl::optional<uint32_t> /* hit test result */>
|
||||
std::optional<uint32_t> /* hit test result */>
|
||||
hit_test_results_;
|
||||
absl::optional<uint32_t> old_focus_;
|
||||
absl::optional<uint32_t> new_focus_;
|
||||
absl::optional<uint32_t> root_node_id_;
|
||||
std::optional<uint32_t> old_focus_;
|
||||
std::optional<uint32_t> new_focus_;
|
||||
std::optional<uint32_t> root_node_id_;
|
||||
};
|
||||
|
||||
class BrowserAccessibilityManagerFuchsiaTest : public testing::Test {
|
||||
@ -443,13 +443,13 @@ TEST_F(BrowserAccessibilityManagerFuchsiaTest, HitTest) {
|
||||
platform_node->PerformAction(action_data);
|
||||
|
||||
{
|
||||
absl::optional<gfx::Point> last_target =
|
||||
std::optional<gfx::Point> last_target =
|
||||
mock_browser_accessibility_delegate_->last_hit_test_point();
|
||||
ASSERT_TRUE(last_target.has_value());
|
||||
EXPECT_EQ(last_target->x(), 1);
|
||||
EXPECT_EQ(last_target->y(), 2);
|
||||
|
||||
absl::optional<int> last_request_id =
|
||||
std::optional<int> last_request_id =
|
||||
mock_browser_accessibility_delegate_->last_request_id();
|
||||
ASSERT_TRUE(last_request_id.has_value());
|
||||
EXPECT_EQ(*last_request_id, action_data.request_id);
|
||||
@ -460,7 +460,7 @@ TEST_F(BrowserAccessibilityManagerFuchsiaTest, HitTest) {
|
||||
action_data.request_id);
|
||||
|
||||
{
|
||||
const std::map<int, absl::optional<uint32_t>>& hit_test_results =
|
||||
const std::map<int, std::optional<uint32_t>>& hit_test_results =
|
||||
mock_accessibility_bridge_->hit_test_results();
|
||||
// We should have a hit test result for request id = 3, and the result
|
||||
// should be the fuchsia ID of node 2, which is our hit result specified
|
||||
@ -505,7 +505,7 @@ TEST_F(BrowserAccessibilityManagerFuchsiaTest, HitTestFails) {
|
||||
platform_node->PerformAction(action_data);
|
||||
|
||||
{
|
||||
absl::optional<gfx::Point> last_target =
|
||||
std::optional<gfx::Point> last_target =
|
||||
mock_browser_accessibility_delegate_->last_hit_test_point();
|
||||
EXPECT_EQ(last_target->x(), 1);
|
||||
EXPECT_EQ(last_target->y(), 2);
|
||||
@ -515,7 +515,7 @@ TEST_F(BrowserAccessibilityManagerFuchsiaTest, HitTestFails) {
|
||||
manager_->FireBlinkEvent(ax::mojom::Event::kHover, nullptr, 4);
|
||||
|
||||
{
|
||||
const std::map<int, absl::optional<uint32_t>>& hit_test_results =
|
||||
const std::map<int, std::optional<uint32_t>>& hit_test_results =
|
||||
mock_accessibility_bridge_->hit_test_results();
|
||||
|
||||
ASSERT_FALSE(hit_test_results.empty());
|
||||
@ -556,7 +556,7 @@ TEST_F(BrowserAccessibilityManagerFuchsiaTest, PerformAction) {
|
||||
platform_node->PerformAction(action_data);
|
||||
|
||||
{
|
||||
const absl::optional<ui::AXActionData> last_action_data =
|
||||
const std::optional<ui::AXActionData> last_action_data =
|
||||
mock_browser_accessibility_delegate_->last_action_data();
|
||||
ASSERT_TRUE(last_action_data);
|
||||
EXPECT_EQ(last_action_data->action,
|
||||
|
@ -397,7 +397,7 @@ void DumpAccessibilityTestBase::RunTestForPlatform(
|
||||
|
||||
EXPECT_TRUE(NavigateToURL(shell(), GURL(url::kAboutBlankURL)));
|
||||
|
||||
absl::optional<ui::AXInspectScenario> scenario =
|
||||
std::optional<ui::AXInspectScenario> scenario =
|
||||
test_helper_.ParseScenario(file_path, DefaultFilters());
|
||||
if (!scenario) {
|
||||
ADD_FAILURE()
|
||||
@ -407,7 +407,7 @@ void DumpAccessibilityTestBase::RunTestForPlatform(
|
||||
}
|
||||
scenario_ = std::move(*scenario);
|
||||
|
||||
absl::optional<std::vector<std::string>> expected_lines;
|
||||
std::optional<std::vector<std::string>> expected_lines;
|
||||
|
||||
// Get expectation lines from expectation file if any.
|
||||
base::FilePath expected_file =
|
||||
|
@ -14,8 +14,8 @@ base::android::ScopedJavaLocalRef<jobject> CreateJavaAdditionalNavigationParams(
|
||||
JNIEnv* env,
|
||||
base::UnguessableToken initiator_frame_token,
|
||||
int initiator_process_id,
|
||||
absl::optional<base::UnguessableToken> attribution_src_token,
|
||||
absl::optional<network::AttributionReportingRuntimeFeatures>
|
||||
std::optional<base::UnguessableToken> attribution_src_token,
|
||||
std::optional<network::AttributionReportingRuntimeFeatures>
|
||||
runtime_features) {
|
||||
return Java_AdditionalNavigationParamsUtils_create(
|
||||
env,
|
||||
@ -28,12 +28,12 @@ base::android::ScopedJavaLocalRef<jobject> CreateJavaAdditionalNavigationParams(
|
||||
runtime_features ? runtime_features->ToEnumBitmask() : 0);
|
||||
}
|
||||
|
||||
absl::optional<blink::LocalFrameToken>
|
||||
std::optional<blink::LocalFrameToken>
|
||||
GetInitiatorFrameTokenFromJavaAdditionalNavigationParams(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& j_object) {
|
||||
if (!j_object) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
auto optional_token =
|
||||
base::android::UnguessableTokenAndroid::FromJavaUnguessableToken(
|
||||
@ -42,7 +42,7 @@ GetInitiatorFrameTokenFromJavaAdditionalNavigationParams(
|
||||
if (optional_token) {
|
||||
return blink::LocalFrameToken(optional_token.value());
|
||||
}
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
int GetInitiatorProcessIdFromJavaAdditionalNavigationParams(
|
||||
@ -55,17 +55,17 @@ int GetInitiatorProcessIdFromJavaAdditionalNavigationParams(
|
||||
j_object);
|
||||
}
|
||||
|
||||
absl::optional<blink::AttributionSrcToken>
|
||||
std::optional<blink::AttributionSrcToken>
|
||||
GetAttributionSrcTokenFromJavaAdditionalNavigationParams(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& j_object) {
|
||||
if (!j_object) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
auto java_token = Java_AdditionalNavigationParamsUtils_getAttributionSrcToken(
|
||||
env, j_object);
|
||||
if (!java_token) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
auto optional_token =
|
||||
base::android::UnguessableTokenAndroid::FromJavaUnguessableToken(
|
||||
@ -73,7 +73,7 @@ GetAttributionSrcTokenFromJavaAdditionalNavigationParams(
|
||||
if (optional_token) {
|
||||
return blink::AttributionSrcToken(optional_token.value());
|
||||
}
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
network::AttributionReportingRuntimeFeatures
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
namespace content {
|
||||
|
||||
absl::optional<blink::LocalFrameToken>
|
||||
std::optional<blink::LocalFrameToken>
|
||||
GetInitiatorFrameTokenFromJavaAdditionalNavigationParams(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& j_object);
|
||||
@ -24,7 +24,7 @@ int GetInitiatorProcessIdFromJavaAdditionalNavigationParams(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& j_object);
|
||||
|
||||
absl::optional<blink::AttributionSrcToken>
|
||||
std::optional<blink::AttributionSrcToken>
|
||||
GetAttributionSrcTokenFromJavaAdditionalNavigationParams(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& j_object);
|
||||
|
@ -116,7 +116,7 @@ void AppWebMessagePort::PostMessage(
|
||||
// set the agent cluster ID to the embedder's, and nullify its parent task ID.
|
||||
transferable_message.sender_agent_cluster_id =
|
||||
blink::WebMessagePort::GetEmbedderAgentClusterID();
|
||||
transferable_message.parent_task_id = absl::nullopt;
|
||||
transferable_message.parent_task_id = std::nullopt;
|
||||
|
||||
mojo::Message mojo_message =
|
||||
blink::mojom::TransferableMessage::SerializeAsMessage(
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
#include "content/browser/android/battery_metrics.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/android/application_status_listener.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/functional/bind.h"
|
||||
@ -23,7 +25,6 @@
|
||||
#include "base/tracing/protos/chrome_track_event.pbzero.h"
|
||||
#include "content/browser/web_contents/web_contents_impl.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/webpreferences/web_preferences.mojom.h"
|
||||
|
||||
namespace content {
|
||||
|
@ -118,7 +118,7 @@ class ContentURLLoader : public network::mojom::URLLoader {
|
||||
const std::vector<std::string>& removed_headers,
|
||||
const net::HttpRequestHeaders& modified_headers,
|
||||
const net::HttpRequestHeaders& modified_cors_exempt_headers,
|
||||
const absl::optional<GURL>& new_url) override {}
|
||||
const std::optional<GURL>& new_url) override {}
|
||||
void SetPriority(net::RequestPriority priority,
|
||||
int32_t intra_priority_value) override {}
|
||||
void PauseReadingBodyFromNet() override {}
|
||||
@ -205,7 +205,7 @@ class ContentURLLoader : public network::mojom::URLLoader {
|
||||
}
|
||||
|
||||
client->OnReceiveResponse(std::move(head), std::move(consumer_handle),
|
||||
absl::nullopt);
|
||||
std::nullopt);
|
||||
client_ = std::move(client);
|
||||
|
||||
if (total_bytes_to_send == 0) {
|
||||
|
@ -33,7 +33,7 @@ static jlong JNI_DialogOverlayImpl_Init(JNIEnv* env,
|
||||
jboolean power_efficient) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
||||
|
||||
absl::optional<base::UnguessableToken> token =
|
||||
std::optional<base::UnguessableToken> token =
|
||||
base::UnguessableToken::Deserialize(high, low);
|
||||
if (!token.has_value()) {
|
||||
return 0;
|
||||
|
@ -54,7 +54,7 @@ ScopedJavaLocalRef<jobject> ToJavaDropData(const DropData& drop_data) {
|
||||
jimage_bytes = ToJavaByteArray(env, drop_data.file_contents);
|
||||
jimage_extension = ConvertUTF8ToJavaString(
|
||||
env, drop_data.file_contents_filename_extension);
|
||||
absl::optional<base::FilePath> filename =
|
||||
std::optional<base::FilePath> filename =
|
||||
drop_data.GetSafeFilenameForImageFileContents();
|
||||
if (filename) {
|
||||
jimage_filename =
|
||||
|
@ -101,7 +101,7 @@ class CONTENT_EXPORT GestureListenerManager : public RenderWidgetHostConnector {
|
||||
JavaObjectWeakGlobalRef java_ref_;
|
||||
|
||||
// Highest update frequency requested by any of the listeners.
|
||||
absl::optional<cc::mojom::RootScrollOffsetUpdateFrequency>
|
||||
std::optional<cc::mojom::RootScrollOffsetUpdateFrequency>
|
||||
root_scroll_offset_update_frequency_;
|
||||
};
|
||||
|
||||
|
@ -21,7 +21,7 @@ void JNI_GpuProcessCallback_CompleteScopedSurfaceRequest(
|
||||
JNIEnv* env,
|
||||
const base::android::JavaParamRef<jobject>& token,
|
||||
const base::android::JavaParamRef<jobject>& surface) {
|
||||
absl::optional<base::UnguessableToken> requestToken =
|
||||
std::optional<base::UnguessableToken> requestToken =
|
||||
base::android::UnguessableTokenAndroid::FromJavaUnguessableToken(env,
|
||||
token);
|
||||
if (!requestToken) {
|
||||
|
@ -479,7 +479,7 @@ void ImeAdapterAndroid::SetEditableSelectionOffsets(
|
||||
void ImeAdapterAndroid::SetBounds(
|
||||
const std::vector<gfx::Rect>& character_bounds,
|
||||
const bool character_bounds_changed,
|
||||
const absl::optional<std::vector<gfx::Rect>>& line_bounds) {
|
||||
const std::optional<std::vector<gfx::Rect>>& line_bounds) {
|
||||
if (!character_bounds_changed && !line_bounds.has_value()) {
|
||||
return;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ class CONTENT_EXPORT ImeAdapterAndroid : public RenderWidgetHostConnector {
|
||||
// Update the composition character bounds, the visible line bounds or both.
|
||||
void SetBounds(const std::vector<gfx::Rect>& character_bounds,
|
||||
const bool character_bounds_changed,
|
||||
const absl::optional<std::vector<gfx::Rect>>& line_bounds);
|
||||
const std::optional<std::vector<gfx::Rect>>& line_bounds);
|
||||
// Requests to start stylus writing and returns true if successful.
|
||||
bool RequestStartStylusWriting();
|
||||
|
||||
|
@ -219,7 +219,7 @@ void GinJavaBridgeDispatcherHost::PrimaryPageChanged(Page& page) {
|
||||
GinJavaBoundObject::ObjectID GinJavaBridgeDispatcherHost::AddObject(
|
||||
const base::android::JavaRef<jobject>& object,
|
||||
const base::android::JavaRef<jclass>& safe_annotation_clazz,
|
||||
absl::optional<GlobalRenderFrameHostId> holder) {
|
||||
std::optional<GlobalRenderFrameHostId> holder) {
|
||||
// Can be called on any thread. Calls come from the UI thread via
|
||||
// AddNamedObject, and from the background thread, when injected Java
|
||||
// object's method returns a Java object.
|
||||
@ -324,7 +324,7 @@ void GinJavaBridgeDispatcherHost::AddNamedObject(
|
||||
base::AutoLock locker(objects_lock_);
|
||||
objects_[object_id]->AddName();
|
||||
} else {
|
||||
object_id = AddObject(object, safe_annotation_clazz, absl::nullopt);
|
||||
object_id = AddObject(object, safe_annotation_clazz, std::nullopt);
|
||||
}
|
||||
named_objects_[name] = object_id;
|
||||
|
||||
|
@ -127,7 +127,7 @@ class GinJavaBridgeDispatcherHost
|
||||
GinJavaBoundObject::ObjectID AddObject(
|
||||
const base::android::JavaRef<jobject>& object,
|
||||
const base::android::JavaRef<jclass>& safe_annotation_clazz,
|
||||
absl::optional<GlobalRenderFrameHostId> holder);
|
||||
std::optional<GlobalRenderFrameHostId> holder);
|
||||
scoped_refptr<GinJavaBoundObject> FindObject(
|
||||
GinJavaBoundObject::ObjectID object_id);
|
||||
bool FindObjectId(const base::android::JavaRef<jobject>& object,
|
||||
|
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
#include "content/public/browser/android/message_payload.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -14,7 +15,6 @@
|
||||
#include "base/functional/overloaded.h"
|
||||
#include "base/notreached.h"
|
||||
#include "content/public/android/content_jni_headers/MessagePayloadJni_jni.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/common/messaging/string_message_codec.h"
|
||||
#include "third_party/blink/public/common/messaging/transferable_message.h"
|
||||
@ -40,9 +40,9 @@ class JavaArrayBuffer : public blink::WebMessageArrayBufferPayload {
|
||||
|
||||
// Due to JNI limitation, Java ByteArray cannot be converted into base::span
|
||||
// trivially.
|
||||
absl::optional<base::span<const uint8_t>> GetAsSpanIfPossible()
|
||||
std::optional<base::span<const uint8_t>> GetAsSpanIfPossible()
|
||||
const override {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void CopyInto(base::span<uint8_t> dest) const override {
|
||||
|
@ -222,7 +222,7 @@ void MagnifierSurfaceControl::UpdateLayers() {
|
||||
return;
|
||||
}
|
||||
|
||||
absl::optional<SkColor> background_color = rwhva->GetBackgroundColor();
|
||||
std::optional<SkColor> background_color = rwhva->GetBackgroundColor();
|
||||
rounded_corner_layer_->SetBackgroundColor(
|
||||
background_color ? SkColor4f::FromColor(background_color.value())
|
||||
: SkColors::kWhite);
|
||||
|
@ -5,9 +5,8 @@
|
||||
#ifndef CONTENT_BROWSER_ANDROID_SELECTION_MAGNIFIER_SURFACE_CONTROL_H_
|
||||
#define CONTENT_BROWSER_ANDROID_SELECTION_MAGNIFIER_SURFACE_CONTROL_H_
|
||||
|
||||
#include "ui/gl/android/scoped_java_surface_control.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
@ -24,7 +23,7 @@
|
||||
#include "gpu/ipc/common/surface_handle.h"
|
||||
#include "mojo/public/cpp/bindings/associated_remote.h"
|
||||
#include "services/viz/privileged/mojom/compositing/display_private.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/gl/android/scoped_java_surface_control.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
|
@ -109,9 +109,9 @@ class SynchronousCompositorControlHost
|
||||
void ReturnFrame(
|
||||
uint32_t layer_tree_frame_sink_id,
|
||||
uint32_t metadata_version,
|
||||
const absl::optional<viz::LocalSurfaceId>& local_surface_id,
|
||||
absl::optional<viz::CompositorFrame> frame,
|
||||
absl::optional<viz::HitTestRegionList> hit_test_region_list) override {
|
||||
const std::optional<viz::LocalSurfaceId>& local_surface_id,
|
||||
std::optional<viz::CompositorFrame> frame,
|
||||
std::optional<viz::HitTestRegionList> hit_test_region_list) override {
|
||||
if (frame && (!local_surface_id || !local_surface_id->is_valid())) {
|
||||
bad_message::ReceivedBadMessage(
|
||||
process_id_, bad_message::SYNC_COMPOSITOR_NO_LOCAL_SURFACE_ID);
|
||||
@ -267,9 +267,9 @@ SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw(
|
||||
|
||||
uint32_t layer_tree_frame_sink_id;
|
||||
uint32_t metadata_version = 0u;
|
||||
absl::optional<viz::LocalSurfaceId> local_surface_id;
|
||||
absl::optional<viz::CompositorFrame> compositor_frame;
|
||||
absl::optional<viz::HitTestRegionList> hit_test_region_list;
|
||||
std::optional<viz::LocalSurfaceId> local_surface_id;
|
||||
std::optional<viz::CompositorFrame> compositor_frame;
|
||||
std::optional<viz::HitTestRegionList> hit_test_region_list;
|
||||
blink::mojom::SyncCompositorCommonRendererParamsPtr common_renderer_params;
|
||||
|
||||
{
|
||||
@ -313,7 +313,7 @@ SynchronousCompositor::Frame SynchronousCompositorHost::DemandDrawHw(
|
||||
void SynchronousCompositorHost::UpdateFrameMetaData(
|
||||
uint32_t version,
|
||||
viz::CompositorFrameMetadata frame_metadata,
|
||||
absl::optional<viz::LocalSurfaceId> new_local_surface_id) {
|
||||
std::optional<viz::LocalSurfaceId> new_local_surface_id) {
|
||||
// Ignore if |frame_metadata_version_| is newer than |version|. This
|
||||
// comparison takes into account when the unsigned int wraps.
|
||||
if ((frame_metadata_version_ - version) < 0x80000000) {
|
||||
@ -347,7 +347,7 @@ bool SynchronousCompositorHost::DemandDrawSwInProc(SkCanvas* canvas) {
|
||||
base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope
|
||||
allow_base_sync_primitives;
|
||||
blink::mojom::SyncCompositorCommonRendererParamsPtr common_renderer_params;
|
||||
absl::optional<viz::CompositorFrameMetadata> metadata;
|
||||
std::optional<viz::CompositorFrameMetadata> metadata;
|
||||
ScopedSetSkCanvas set_sk_canvas(canvas);
|
||||
blink::mojom::SyncCompositorDemandDrawSwParamsPtr params =
|
||||
blink::mojom::SyncCompositorDemandDrawSwParams::New(); // Unused.
|
||||
@ -361,7 +361,7 @@ bool SynchronousCompositorHost::DemandDrawSwInProc(SkCanvas* canvas) {
|
||||
if (!metadata)
|
||||
return false;
|
||||
UpdateState(std::move(common_renderer_params));
|
||||
UpdateFrameMetaData(metadata_version, std::move(*metadata), absl::nullopt);
|
||||
UpdateFrameMetaData(metadata_version, std::move(*metadata), std::nullopt);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ bool SynchronousCompositorHost::DemandDrawSw(SkCanvas* canvas,
|
||||
if (!software_draw_shm_)
|
||||
return false;
|
||||
|
||||
absl::optional<viz::CompositorFrameMetadata> metadata;
|
||||
std::optional<viz::CompositorFrameMetadata> metadata;
|
||||
uint32_t metadata_version = 0u;
|
||||
blink::mojom::SyncCompositorCommonRendererParamsPtr common_renderer_params;
|
||||
{
|
||||
@ -437,7 +437,7 @@ bool SynchronousCompositorHost::DemandDrawSw(SkCanvas* canvas,
|
||||
return false;
|
||||
|
||||
UpdateState(std::move(common_renderer_params));
|
||||
UpdateFrameMetaData(metadata_version, std::move(*metadata), absl::nullopt);
|
||||
UpdateFrameMetaData(metadata_version, std::move(*metadata), std::nullopt);
|
||||
|
||||
SkBitmap bitmap;
|
||||
SkPixmap pixmap(info, software_draw_shm_->shared_memory.memory(), stride);
|
||||
|
@ -89,7 +89,7 @@ class CONTENT_EXPORT SynchronousCompositorHost
|
||||
void UpdateFrameMetaData(
|
||||
uint32_t version,
|
||||
viz::CompositorFrameMetadata frame_metadata,
|
||||
absl::optional<viz::LocalSurfaceId> new_local_surface_id);
|
||||
std::optional<viz::LocalSurfaceId> new_local_surface_id);
|
||||
|
||||
// Called when the mojo channel should be created.
|
||||
void InitMojo();
|
||||
|
@ -42,9 +42,9 @@ void SynchronousCompositorSyncCallBridge::RemoteClosedOnIOThread() {
|
||||
bool SynchronousCompositorSyncCallBridge::ReceiveFrameOnIOThread(
|
||||
int layer_tree_frame_sink_id,
|
||||
uint32_t metadata_version,
|
||||
absl::optional<viz::LocalSurfaceId> local_surface_id,
|
||||
absl::optional<viz::CompositorFrame> compositor_frame,
|
||||
absl::optional<viz::HitTestRegionList> hit_test_region_list) {
|
||||
std::optional<viz::LocalSurfaceId> local_surface_id,
|
||||
std::optional<viz::CompositorFrame> compositor_frame,
|
||||
std::optional<viz::HitTestRegionList> hit_test_region_list) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
base::AutoLock lock(lock_);
|
||||
if (remote_state_ != RemoteState::READY || frame_futures_.empty())
|
||||
|
@ -5,6 +5,8 @@
|
||||
#ifndef CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_SYNC_CALL_BRIDGE_H_
|
||||
#define CONTENT_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_SYNC_CALL_BRIDGE_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/containers/circular_deque.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
@ -13,7 +15,6 @@
|
||||
#include "components/viz/common/quads/compositor_frame.h"
|
||||
#include "content/public/browser/android/synchronous_compositor.h"
|
||||
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/input/synchronous_compositor.mojom.h"
|
||||
|
||||
namespace content {
|
||||
@ -90,9 +91,9 @@ class SynchronousCompositorSyncCallBridge
|
||||
bool ReceiveFrameOnIOThread(
|
||||
int frame_sink_id,
|
||||
uint32_t metadata_version,
|
||||
absl::optional<viz::LocalSurfaceId> local_surface_id,
|
||||
absl::optional<viz::CompositorFrame>,
|
||||
absl::optional<viz::HitTestRegionList> hit_test_region_list);
|
||||
std::optional<viz::LocalSurfaceId> local_surface_id,
|
||||
std::optional<viz::CompositorFrame>,
|
||||
std::optional<viz::HitTestRegionList> hit_test_region_list);
|
||||
|
||||
// Receive a BeginFrameResponse. Returns true if handling the response was
|
||||
// successful or not.
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "content/browser/android/web_contents_observer_proxy.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/android/jni_android.h"
|
||||
@ -21,7 +22,6 @@
|
||||
#include "content/public/browser/navigation_details.h"
|
||||
#include "content/public/browser/navigation_entry.h"
|
||||
#include "content/public/browser/navigation_handle.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/android/gurl_android.h"
|
||||
|
||||
using base::android::AttachCurrentThread;
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "content/browser/attribution_reporting/aggregatable_attribution_utils.h"
|
||||
|
||||
#include <iterator>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@ -31,7 +32,6 @@
|
||||
#include "content/browser/attribution_reporting/attribution_info.h"
|
||||
#include "content/browser/attribution_reporting/attribution_report.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/mojom/private_aggregation/aggregatable_report.mojom.h"
|
||||
|
||||
@ -121,10 +121,10 @@ std::vector<AggregatableHistogramContribution> CreateAggregatableHistogram(
|
||||
return contributions;
|
||||
}
|
||||
|
||||
absl::optional<AggregatableReportRequest> CreateAggregatableReportRequest(
|
||||
std::optional<AggregatableReportRequest> CreateAggregatableReportRequest(
|
||||
const AttributionReport& report) {
|
||||
base::Time source_time;
|
||||
absl::optional<uint64_t> source_debug_key;
|
||||
std::optional<uint64_t> source_debug_key;
|
||||
std::vector<blink::mojom::AggregatableReportHistogramContribution>
|
||||
contributions;
|
||||
const AttributionReport::CommonAggregatableData* common_aggregatable_data =
|
||||
@ -186,9 +186,9 @@ absl::optional<AggregatableReportRequest> CreateAggregatableReportRequest(
|
||||
std::move(contributions),
|
||||
blink::mojom::AggregationServiceMode::kDefault,
|
||||
common_aggregatable_data->aggregation_coordinator_origin
|
||||
? absl::make_optional(
|
||||
? std::make_optional(
|
||||
**common_aggregatable_data->aggregation_coordinator_origin)
|
||||
: absl::nullopt,
|
||||
: std::nullopt,
|
||||
/*max_contributions_allowed=*/
|
||||
attribution_reporting::kMaxAggregationKeysPerSource),
|
||||
AggregatableReportSharedInfo(
|
||||
|
@ -5,11 +5,11 @@
|
||||
#ifndef CONTENT_BROWSER_ATTRIBUTION_REPORTING_AGGREGATABLE_ATTRIBUTION_UTILS_H_
|
||||
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_AGGREGATABLE_ATTRIBUTION_UTILS_H_
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "components/attribution_reporting/source_type.mojom-forward.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
class AggregatableTriggerData;
|
||||
@ -49,7 +49,7 @@ enum class AssembleAggregatableReportStatus {
|
||||
kMaxValue = kAssembleReportFailed,
|
||||
};
|
||||
|
||||
CONTENT_EXPORT absl::optional<AggregatableReportRequest>
|
||||
CONTENT_EXPORT std::optional<AggregatableReportRequest>
|
||||
CreateAggregatableReportRequest(const AttributionReport& report);
|
||||
|
||||
CONTENT_EXPORT base::Time RoundDownToWholeDaySinceUnixEpoch(base::Time);
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -27,7 +28,6 @@
|
||||
#include "content/browser/attribution_reporting/attribution_test_utils.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/private_aggregation/aggregatable_report.mojom.h"
|
||||
|
||||
namespace content {
|
||||
@ -98,7 +98,7 @@ TEST(AggregatableAttributionUtilsTest, CreateAggregatableHistogram) {
|
||||
/*negative=*/{})),
|
||||
};
|
||||
|
||||
absl::optional<attribution_reporting::FilterData> source_filter_data =
|
||||
std::optional<attribution_reporting::FilterData> source_filter_data =
|
||||
attribution_reporting::FilterData::Create({{"filter", {"value"}}});
|
||||
ASSERT_TRUE(source_filter_data.has_value());
|
||||
|
||||
@ -176,7 +176,7 @@ TEST(AggregatableAttributionUtilsTest, RoundsSourceRegistrationTime) {
|
||||
{AggregatableHistogramContribution(/*key=*/1, /*value=*/2)})
|
||||
.BuildAggregatableAttribution();
|
||||
|
||||
absl::optional<AggregatableReportRequest> request =
|
||||
std::optional<AggregatableReportRequest> request =
|
||||
CreateAggregatableReportRequest(report);
|
||||
ASSERT_TRUE(request.has_value());
|
||||
const base::Value::Dict& additional_fields =
|
||||
@ -200,7 +200,7 @@ TEST(AggregatableAttributionUtilsTest, AggregationCoordinatorSet) {
|
||||
.SetAggregationCoordinatorOrigin(*coordinator_origin)
|
||||
.BuildAggregatableAttribution();
|
||||
|
||||
absl::optional<AggregatableReportRequest> request =
|
||||
std::optional<AggregatableReportRequest> request =
|
||||
CreateAggregatableReportRequest(report);
|
||||
ASSERT_TRUE(request.has_value());
|
||||
EXPECT_EQ(request->payload_contents().aggregation_coordinator_origin,
|
||||
@ -208,7 +208,7 @@ TEST(AggregatableAttributionUtilsTest, AggregationCoordinatorSet) {
|
||||
}
|
||||
|
||||
TEST(AggregatableAttributionUtilsTest, AggregatableReportRequestForNullReport) {
|
||||
absl::optional<AggregatableReportRequest> request =
|
||||
std::optional<AggregatableReportRequest> request =
|
||||
CreateAggregatableReportRequest(
|
||||
ReportBuilder(
|
||||
AttributionInfoBuilder().Build(),
|
||||
@ -229,7 +229,7 @@ TEST(AggregatableAttributionUtilsTest, AggregatableReportRequestForNullReport) {
|
||||
|
||||
TEST(AggregatableAttributionUtilsTest,
|
||||
AggregatableReportRequestExcludingSourceRegistrationTime) {
|
||||
absl::optional<AggregatableReportRequest> request =
|
||||
std::optional<AggregatableReportRequest> request =
|
||||
CreateAggregatableReportRequest(
|
||||
ReportBuilder(
|
||||
AttributionInfoBuilder().Build(),
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -38,7 +39,6 @@
|
||||
#include "content/public/test/test_browser_context.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/boringssl/src/include/openssl/hpke.h"
|
||||
#include "url/gurl.h"
|
||||
@ -91,7 +91,7 @@ class AttributionAggregatableReportGoldenLatestVersionTest
|
||||
.Get()))),
|
||||
keyset);
|
||||
|
||||
absl::optional<std::vector<uint8_t>> private_key =
|
||||
std::optional<std::vector<uint8_t>> private_key =
|
||||
base::Base64Decode(ReadStringFromFile(
|
||||
input_dir_.AppendASCII("private_key.txt"), /*trim=*/true));
|
||||
ASSERT_TRUE(private_key);
|
||||
@ -119,7 +119,7 @@ class AttributionAggregatableReportGoldenLatestVersionTest
|
||||
expected_cleartext_payloads.GetList().front().GetIfString();
|
||||
ASSERT_TRUE(base64_encoded_expected_cleartext_payload);
|
||||
|
||||
absl::optional<AggregatableReportRequest> request =
|
||||
std::optional<AggregatableReportRequest> request =
|
||||
CreateAggregatableReportRequest(report);
|
||||
ASSERT_TRUE(request);
|
||||
|
||||
@ -129,7 +129,7 @@ class AttributionAggregatableReportGoldenLatestVersionTest
|
||||
std::move(*request),
|
||||
base::BindLambdaForTesting(
|
||||
[&](AggregatableReportRequest,
|
||||
absl::optional<AggregatableReport> assembled_report,
|
||||
std::optional<AggregatableReport> assembled_report,
|
||||
AggregationService::AssemblyStatus status) {
|
||||
EXPECT_EQ(status, AggregationService::AssemblyStatus::kOk);
|
||||
ASSERT_TRUE(assembled_report);
|
||||
@ -173,14 +173,14 @@ class AttributionAggregatableReportGoldenLatestVersionTest
|
||||
base::Value::Dict actual_report,
|
||||
base::Value::Dict expected_report,
|
||||
const std::string& base64_encoded_expected_cleartext_payload) {
|
||||
absl::optional<base::Value> actual_payloads =
|
||||
std::optional<base::Value> actual_payloads =
|
||||
actual_report.Extract(kKeyAggregationServicePayloads);
|
||||
if (!actual_payloads) {
|
||||
return testing::AssertionFailure() << kKeyAggregationServicePayloads
|
||||
<< " not present in the actual report";
|
||||
}
|
||||
|
||||
absl::optional<base::Value> expected_payloads =
|
||||
std::optional<base::Value> expected_payloads =
|
||||
expected_report.Extract(kKeyAggregationServicePayloads);
|
||||
if (!expected_payloads) {
|
||||
return testing::AssertionFailure()
|
||||
@ -252,14 +252,14 @@ class AttributionAggregatableReportGoldenLatestVersionTest
|
||||
|
||||
static constexpr char kKeyPayload[] = "payload";
|
||||
|
||||
absl::optional<base::Value> actual_encrypted_payload =
|
||||
std::optional<base::Value> actual_encrypted_payload =
|
||||
actual_payload->Extract(kKeyPayload);
|
||||
if (!actual_encrypted_payload) {
|
||||
return testing::AssertionFailure()
|
||||
<< kKeyPayload << " not present in the actual report";
|
||||
}
|
||||
|
||||
absl::optional<base::Value> expected_encrypted_payload =
|
||||
std::optional<base::Value> expected_encrypted_payload =
|
||||
expected_payload->Extract(kKeyPayload);
|
||||
if (!expected_encrypted_payload) {
|
||||
return testing::AssertionFailure()
|
||||
@ -309,7 +309,7 @@ class AttributionAggregatableReportGoldenLatestVersionTest
|
||||
std::vector<uint8_t> DecryptPayload(
|
||||
const std::string& base64_encoded_encrypted_payload,
|
||||
const std::string& shared_info) {
|
||||
absl::optional<std::vector<uint8_t>> encrypted_payload =
|
||||
std::optional<std::vector<uint8_t>> encrypted_payload =
|
||||
base::Base64Decode(base64_encoded_encrypted_payload);
|
||||
if (!encrypted_payload) {
|
||||
return {};
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "content/browser/attribution_reporting/attribution_cookie_checker_impl.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/run_loop.h"
|
||||
@ -21,7 +22,6 @@
|
||||
#include "net/cookies/cookie_util.h"
|
||||
#include "services/network/public/mojom/cookie_manager.mojom.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -37,7 +37,7 @@ struct AttributionCookieParams {
|
||||
const char* domain;
|
||||
bool httponly;
|
||||
net::CookieSameSite same_site;
|
||||
absl::optional<net::CookiePartitionKey> partition_key;
|
||||
std::optional<net::CookiePartitionKey> partition_key;
|
||||
};
|
||||
|
||||
class AttributionCookieCheckerImplTest : public testing::Test {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -17,7 +18,6 @@
|
||||
#include "content/browser/attribution_reporting/attribution_beacon_id.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
#include "services/network/public/cpp/attribution_reporting_runtime_features.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom-forward.h"
|
||||
|
||||
@ -132,8 +132,8 @@ class AttributionDataHostManager
|
||||
attribution_reporting::mojom::RegistrationEligibility,
|
||||
GlobalRenderFrameHostId render_frame_id,
|
||||
int64_t last_navigation_id,
|
||||
absl::optional<blink::AttributionSrcToken> attribution_src_token,
|
||||
absl::optional<std::string> devtools_request_id) = 0;
|
||||
std::optional<blink::AttributionSrcToken> attribution_src_token,
|
||||
std::optional<std::string> devtools_request_id) = 0;
|
||||
|
||||
// Notifies the manager that a background attribution request has sent a
|
||||
// response. May be called multiple times for the same request; for redirects
|
||||
@ -159,10 +159,10 @@ class AttributionDataHostManager
|
||||
// use. Passes the topmost ancestor of the initiator render frame for
|
||||
// obtaining the page access report.
|
||||
// `navigation_id` is the id of the navigation for automatic beacons and
|
||||
// `absl::nullopt` for event beacons.
|
||||
// `std::nullopt` for event beacons.
|
||||
virtual void NotifyFencedFrameReportingBeaconStarted(
|
||||
BeaconId beacon_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
attribution_reporting::SuitableOrigin source_origin,
|
||||
bool is_within_fenced_frame,
|
||||
AttributionInputEvent input_event,
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -63,7 +64,6 @@
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/trigger_verification.h"
|
||||
#include "services/network/public/mojom/attribution.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
@ -189,8 +189,8 @@ class RegistrationNavigationContext {
|
||||
|
||||
void MaybeLogAuditIssue(GlobalRenderFrameHostId render_frame_id,
|
||||
const GURL& request_url,
|
||||
const absl::optional<std::string>& request_devtools_id,
|
||||
absl::optional<std::string> invalid_parameter,
|
||||
const std::optional<std::string>& request_devtools_id,
|
||||
std::optional<std::string> invalid_parameter,
|
||||
AttributionReportingIssueType violation_type) {
|
||||
if (!request_devtools_id.has_value()) {
|
||||
return;
|
||||
@ -333,9 +333,9 @@ class AttributionDataHostManagerImpl::NavigationContextForPendingRegistration {
|
||||
return pending_registrations_count_ > 0;
|
||||
}
|
||||
|
||||
absl::optional<int64_t> navigation_id() const {
|
||||
std::optional<int64_t> navigation_id() const {
|
||||
if (!context_.has_value()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
};
|
||||
|
||||
return context_->navigation_id();
|
||||
@ -343,8 +343,8 @@ class AttributionDataHostManagerImpl::NavigationContextForPendingRegistration {
|
||||
|
||||
private:
|
||||
size_t pending_registrations_count_;
|
||||
absl::optional<bool> eligible_;
|
||||
absl::optional<RegistrationNavigationContext> context_;
|
||||
std::optional<bool> eligible_;
|
||||
std::optional<RegistrationNavigationContext> context_;
|
||||
};
|
||||
|
||||
class AttributionDataHostManagerImpl::RegistrationContext {
|
||||
@ -353,8 +353,8 @@ class AttributionDataHostManagerImpl::RegistrationContext {
|
||||
RegistrationEligibility registration_eligibility,
|
||||
bool is_within_fenced_frame,
|
||||
GlobalRenderFrameHostId render_frame_id,
|
||||
absl::optional<std::string> devtools_request_id,
|
||||
absl::optional<RegistrationNavigationContext> navigation)
|
||||
std::optional<std::string> devtools_request_id,
|
||||
std::optional<RegistrationNavigationContext> navigation)
|
||||
: context_origin_(std::move(context_origin)),
|
||||
registration_eligibility_(registration_eligibility),
|
||||
is_within_fenced_frame_(is_within_fenced_frame),
|
||||
@ -381,13 +381,13 @@ class AttributionDataHostManagerImpl::RegistrationContext {
|
||||
|
||||
bool is_within_fenced_frame() const { return is_within_fenced_frame_; }
|
||||
|
||||
const absl::optional<std::string>& devtools_request_id() const {
|
||||
const std::optional<std::string>& devtools_request_id() const {
|
||||
return devtools_request_id_;
|
||||
}
|
||||
|
||||
GlobalRenderFrameHostId render_frame_id() const { return render_frame_id_; }
|
||||
|
||||
const absl::optional<RegistrationNavigationContext>& navigation() const {
|
||||
const std::optional<RegistrationNavigationContext>& navigation() const {
|
||||
return navigation_;
|
||||
}
|
||||
|
||||
@ -416,11 +416,11 @@ class AttributionDataHostManagerImpl::RegistrationContext {
|
||||
// identified and reported in blink. As such, we don't need to plumb the
|
||||
// devtools request ID. A request might also not have a defined ID when there
|
||||
// are no devtools agents registered.
|
||||
absl::optional<std::string> devtools_request_id_;
|
||||
std::optional<std::string> devtools_request_id_;
|
||||
|
||||
// When the registration is tied to a navigation, we store additional context
|
||||
// on the navigation.
|
||||
absl::optional<RegistrationNavigationContext> navigation_;
|
||||
std::optional<RegistrationNavigationContext> navigation_;
|
||||
};
|
||||
|
||||
struct AttributionDataHostManagerImpl::DeferredReceiver {
|
||||
@ -433,13 +433,13 @@ struct AttributionDataHostManagerImpl::HeaderPendingDecode {
|
||||
std::string header;
|
||||
SuitableOrigin reporting_origin;
|
||||
GURL reporting_url;
|
||||
absl::optional<std::vector<network::TriggerVerification>> verifications;
|
||||
std::optional<std::vector<network::TriggerVerification>> verifications;
|
||||
|
||||
HeaderPendingDecode(
|
||||
std::string header,
|
||||
SuitableOrigin reporting_origin,
|
||||
GURL reporting_url,
|
||||
absl::optional<std::vector<network::TriggerVerification>> verifications)
|
||||
std::optional<std::vector<network::TriggerVerification>> verifications)
|
||||
: header(std::move(header)),
|
||||
reporting_origin(std::move(reporting_origin)),
|
||||
reporting_url(std::move(reporting_url)),
|
||||
@ -459,7 +459,7 @@ class AttributionDataHostManagerImpl::Registrations {
|
||||
Registrations(RegistrationsId id,
|
||||
RegistrationContext context,
|
||||
bool waiting_on_navigation,
|
||||
absl::optional<int64_t> defer_until_navigation)
|
||||
std::optional<int64_t> defer_until_navigation)
|
||||
: waiting_on_navigation_(waiting_on_navigation),
|
||||
defer_until_navigation_(defer_until_navigation),
|
||||
id_(id),
|
||||
@ -499,12 +499,12 @@ class AttributionDataHostManagerImpl::Registrations {
|
||||
return true;
|
||||
}
|
||||
|
||||
absl::optional<int64_t> navigation_id() const {
|
||||
std::optional<int64_t> navigation_id() const {
|
||||
if (context_.navigation().has_value()) {
|
||||
return context_.navigation()->navigation_id();
|
||||
}
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const AttributionInputEvent* input_event() const {
|
||||
@ -519,7 +519,7 @@ class AttributionDataHostManagerImpl::Registrations {
|
||||
return context_.render_frame_id();
|
||||
}
|
||||
|
||||
const absl::optional<std::string>& devtools_request_id() const {
|
||||
const std::optional<std::string>& devtools_request_id() const {
|
||||
return context_.devtools_request_id();
|
||||
}
|
||||
|
||||
@ -539,7 +539,7 @@ class AttributionDataHostManagerImpl::Registrations {
|
||||
return pending_os_decodes_;
|
||||
}
|
||||
|
||||
absl::optional<int64_t> defer_until_navigation() const {
|
||||
std::optional<int64_t> defer_until_navigation() const {
|
||||
return defer_until_navigation_;
|
||||
}
|
||||
|
||||
@ -584,7 +584,7 @@ class AttributionDataHostManagerImpl::Registrations {
|
||||
// Indicates that the registration should not be processed until all source
|
||||
// registrations linked to the navigation complete. When they complete,
|
||||
// `ClearDeferUntilNavigation` should be called.
|
||||
absl::optional<int64_t> defer_until_navigation_;
|
||||
std::optional<int64_t> defer_until_navigation_;
|
||||
|
||||
RegistrationsId id_;
|
||||
|
||||
@ -605,14 +605,14 @@ struct AttributionDataHostManagerImpl::RegistrarAndHeader {
|
||||
RegistrationType type;
|
||||
std::string header;
|
||||
|
||||
[[nodiscard]] static absl::optional<RegistrarAndHeader> Get(
|
||||
[[nodiscard]] static std::optional<RegistrarAndHeader> Get(
|
||||
const net::HttpResponseHeaders* headers,
|
||||
bool cross_app_web_runtime_enabled,
|
||||
RegistrationEligibility eligibility,
|
||||
base::RepeatingCallback<void(AttributionReportingIssueType)>
|
||||
log_audit_issue) {
|
||||
if (!headers) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::string web_source;
|
||||
@ -647,13 +647,13 @@ struct AttributionDataHostManagerImpl::RegistrarAndHeader {
|
||||
const bool has_source = has_web_source || has_os_source;
|
||||
const bool has_trigger = has_web_trigger || has_os_trigger;
|
||||
|
||||
absl::optional<RegistrationType> registration_type;
|
||||
std::optional<RegistrationType> registration_type;
|
||||
switch (eligibility) {
|
||||
case RegistrationEligibility::kSourceOrTrigger:
|
||||
if (has_source && has_trigger) {
|
||||
log_audit_issue.Run(
|
||||
AttributionReportingIssueType::kSourceAndTriggerHeaders);
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (has_source) {
|
||||
@ -687,14 +687,14 @@ struct AttributionDataHostManagerImpl::RegistrarAndHeader {
|
||||
}
|
||||
// No eligibile header available.
|
||||
if (!registration_type.has_value()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
switch (registration_type.value()) {
|
||||
case RegistrationType::kSource:
|
||||
if (has_os_source && has_web_source) {
|
||||
log_audit_issue.Run(AttributionReportingIssueType::kWebAndOsHeaders);
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
if (has_os_source) {
|
||||
// Max header size is 256 KB, use 1M count to encapsulate.
|
||||
@ -716,7 +716,7 @@ struct AttributionDataHostManagerImpl::RegistrarAndHeader {
|
||||
case RegistrationType::kTrigger:
|
||||
if (has_os_trigger && has_web_trigger) {
|
||||
log_audit_issue.Run(AttributionReportingIssueType::kWebAndOsHeaders);
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
if (has_os_trigger) {
|
||||
// Max header size is 256 KB, use 1M count to encapsulate.
|
||||
@ -771,7 +771,7 @@ void AttributionDataHostManagerImpl::RegisterDataHost(
|
||||
RegistrationContext receiver_context(
|
||||
std::move(context_origin), registration_eligibility,
|
||||
is_within_fenced_frame, render_frame_id,
|
||||
/*devtools_request_id=*/absl::nullopt, /*navigation=*/absl::nullopt);
|
||||
/*devtools_request_id=*/std::nullopt, /*navigation=*/std::nullopt);
|
||||
|
||||
switch (registration_eligibility) {
|
||||
case RegistrationEligibility::kTrigger:
|
||||
@ -850,7 +850,7 @@ void AttributionDataHostManagerImpl::ParseHeader(
|
||||
it->render_frame_id(),
|
||||
/*request_url=*/pending_decode.reporting_url,
|
||||
it->devtools_request_id(),
|
||||
/*invalid_parameter=*/absl::nullopt,
|
||||
/*invalid_parameter=*/std::nullopt,
|
||||
/*violation_type=*/
|
||||
blink::mojom::AttributionReportingIssueType::kNoWebOrOsSupport);
|
||||
MaybeOnRegistrationsFinished(it);
|
||||
@ -869,7 +869,7 @@ void AttributionDataHostManagerImpl::ParseHeader(
|
||||
it->render_frame_id(),
|
||||
/*request_url=*/pending_decode.reporting_url,
|
||||
it->devtools_request_id(),
|
||||
/*invalid_parameter=*/absl::nullopt,
|
||||
/*invalid_parameter=*/std::nullopt,
|
||||
/*violation_type=*/
|
||||
blink::mojom::AttributionReportingIssueType::kNoWebOrOsSupport);
|
||||
MaybeOnRegistrationsFinished(it);
|
||||
@ -964,7 +964,7 @@ void AttributionDataHostManagerImpl::NotifyNavigationRegistrationStarted(
|
||||
std::move(devtools_request_id),
|
||||
RegistrationNavigationContext(navigation_id, input_event)),
|
||||
/*waiting_on_navigation=*/false,
|
||||
/*defer_until_navigation=*/absl::nullopt);
|
||||
/*defer_until_navigation=*/std::nullopt);
|
||||
if (!registration_inserted) {
|
||||
RecordNavigationUnexpectedRegistration(
|
||||
NavigationUnexpectedRegistration::kRegistrationAlreadyExists);
|
||||
@ -995,7 +995,7 @@ void AttributionDataHostManagerImpl::NotifyNavigationRegistrationStarted(
|
||||
/*context_origin=*/source_origin,
|
||||
RegistrationEligibility::kSource, is_within_fenced_frame,
|
||||
render_frame_id,
|
||||
/*devtools_request_id=*/absl::nullopt,
|
||||
/*devtools_request_id=*/std::nullopt,
|
||||
RegistrationNavigationContext(navigation_id, input_event)));
|
||||
|
||||
navigation_data_host_map_.erase(it);
|
||||
@ -1066,7 +1066,7 @@ bool AttributionDataHostManagerImpl::NotifyNavigationRegistrationData(
|
||||
base::BindRepeating(&MaybeLogAuditIssue, it->render_frame_id(),
|
||||
/*request_url=*/reporting_url,
|
||||
it->devtools_request_id(),
|
||||
/*invalid_parameter=*/absl::nullopt));
|
||||
/*invalid_parameter=*/std::nullopt));
|
||||
if (!header.has_value()) {
|
||||
return false;
|
||||
}
|
||||
@ -1075,7 +1075,7 @@ bool AttributionDataHostManagerImpl::NotifyNavigationRegistrationData(
|
||||
HeaderPendingDecode(std::move(header->header),
|
||||
std::move(reporting_origin.value()),
|
||||
std::move(reporting_url),
|
||||
/*verifications=*/absl::nullopt),
|
||||
/*verifications=*/std::nullopt),
|
||||
header->registrar);
|
||||
return true;
|
||||
}
|
||||
@ -1171,11 +1171,11 @@ void AttributionDataHostManagerImpl::NotifyBackgroundRegistrationStarted(
|
||||
registration_eligibility,
|
||||
GlobalRenderFrameHostId render_frame_id,
|
||||
int64_t last_navigation_id,
|
||||
absl::optional<blink::AttributionSrcToken> attribution_src_token,
|
||||
absl::optional<std::string> devtools_request_id) {
|
||||
std::optional<blink::AttributionSrcToken> attribution_src_token,
|
||||
std::optional<std::string> devtools_request_id) {
|
||||
CHECK(BackgroundRegistrationsEnabled());
|
||||
|
||||
absl::optional<RegistrationNavigationContext> navigation_context;
|
||||
std::optional<RegistrationNavigationContext> navigation_context;
|
||||
|
||||
if (attribution_src_token.has_value()) {
|
||||
const blink::AttributionSrcToken& token = attribution_src_token.value();
|
||||
@ -1228,7 +1228,7 @@ void AttributionDataHostManagerImpl::NotifyBackgroundRegistrationStarted(
|
||||
|
||||
bool waiting_on_navigation =
|
||||
attribution_src_token.has_value() && !navigation_context.has_value();
|
||||
absl::optional<int64_t> deferred_until;
|
||||
std::optional<int64_t> deferred_until;
|
||||
if (deferred_receivers_.contains(last_navigation_id) &&
|
||||
registration_eligibility != RegistrationEligibility::kSource) {
|
||||
deferred_until = last_navigation_id;
|
||||
@ -1268,7 +1268,7 @@ bool AttributionDataHostManagerImpl::NotifyBackgroundRegistrationData(
|
||||
base::BindRepeating(&MaybeLogAuditIssue, it->render_frame_id(),
|
||||
/*request_url=*/reporting_url,
|
||||
it->devtools_request_id(),
|
||||
/*invalid_parameter=*/absl::nullopt));
|
||||
/*invalid_parameter=*/std::nullopt));
|
||||
if (!header.has_value()) {
|
||||
return false;
|
||||
}
|
||||
@ -1277,7 +1277,7 @@ bool AttributionDataHostManagerImpl::NotifyBackgroundRegistrationData(
|
||||
SuitableOrigin::Create(url::Origin::Create(reporting_url));
|
||||
CHECK(reporting_origin);
|
||||
|
||||
absl::optional<std::vector<network::TriggerVerification>> verifications;
|
||||
std::optional<std::vector<network::TriggerVerification>> verifications;
|
||||
if (header->type == RegistrationType::kTrigger) {
|
||||
verifications = std::move(trigger_verifications);
|
||||
}
|
||||
@ -1411,7 +1411,7 @@ void AttributionDataHostManagerImpl::OsTriggerDataAvailable(
|
||||
for (auto& item : registration_items) {
|
||||
attribution_manager_->HandleOsRegistration(OsRegistration(
|
||||
std::move(item.url), item.debug_reporting, context->context_origin(),
|
||||
/*input_event=*/absl::nullopt, context->is_within_fenced_frame(),
|
||||
/*input_event=*/std::nullopt, context->is_within_fenced_frame(),
|
||||
context->render_frame_id()));
|
||||
}
|
||||
}
|
||||
@ -1432,13 +1432,13 @@ void AttributionDataHostManagerImpl::OnReceiverDisconnected() {
|
||||
|
||||
void AttributionDataHostManagerImpl::NotifyFencedFrameReportingBeaconStarted(
|
||||
BeaconId beacon_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
SuitableOrigin source_origin,
|
||||
bool is_within_fenced_frame,
|
||||
AttributionInputEvent input_event,
|
||||
GlobalRenderFrameHostId render_frame_id,
|
||||
std::string devtools_request_id) {
|
||||
absl::optional<RegistrationNavigationContext> navigation;
|
||||
std::optional<RegistrationNavigationContext> navigation;
|
||||
if (navigation_id.has_value()) {
|
||||
MaybeSetupDeferredReceivers(navigation_id.value());
|
||||
navigation = RegistrationNavigationContext(navigation_id.value(),
|
||||
@ -1453,7 +1453,7 @@ void AttributionDataHostManagerImpl::NotifyFencedFrameReportingBeaconStarted(
|
||||
std::move(devtools_request_id),
|
||||
std::move(navigation)),
|
||||
/*waiting_on_navigation=*/false,
|
||||
/*defer_until_navigation=*/absl::nullopt);
|
||||
/*defer_until_navigation=*/std::nullopt);
|
||||
CHECK(inserted);
|
||||
}
|
||||
|
||||
@ -1476,7 +1476,7 @@ void AttributionDataHostManagerImpl::NotifyFencedFrameReportingBeaconData(
|
||||
it->CompleteRegistrations();
|
||||
}
|
||||
|
||||
absl::optional<SuitableOrigin> suitable_reporting_origin =
|
||||
std::optional<SuitableOrigin> suitable_reporting_origin =
|
||||
SuitableOrigin::Create(reporting_url);
|
||||
if (!suitable_reporting_origin) {
|
||||
MaybeOnRegistrationsFinished(it);
|
||||
@ -1491,7 +1491,7 @@ void AttributionDataHostManagerImpl::NotifyFencedFrameReportingBeaconData(
|
||||
base::BindRepeating(&MaybeLogAuditIssue, it->render_frame_id(),
|
||||
/*request_url=*/reporting_url,
|
||||
it->devtools_request_id(),
|
||||
/*invalid_parameter=*/absl::nullopt));
|
||||
/*invalid_parameter=*/std::nullopt));
|
||||
if (!header.has_value()) {
|
||||
MaybeOnRegistrationsFinished(it);
|
||||
return;
|
||||
@ -1506,7 +1506,7 @@ void AttributionDataHostManagerImpl::NotifyFencedFrameReportingBeaconData(
|
||||
HeaderPendingDecode(std::move(header->header),
|
||||
std::move(suitable_reporting_origin.value()),
|
||||
std::move(reporting_url),
|
||||
/*verifications=*/absl::nullopt),
|
||||
/*verifications=*/std::nullopt),
|
||||
header->registrar);
|
||||
}
|
||||
|
||||
@ -1610,7 +1610,7 @@ void AttributionDataHostManagerImpl::HandleParsedWebTrigger(
|
||||
void AttributionDataHostManagerImpl::OnWebHeaderParsed(
|
||||
RegistrationsId id,
|
||||
RegistrationType type,
|
||||
absl::optional<std::vector<network::TriggerVerification>>
|
||||
std::optional<std::vector<network::TriggerVerification>>
|
||||
trigger_verifications,
|
||||
data_decoder::DataDecoder::ValueOrError result) {
|
||||
auto registrations = registrations_.find(id);
|
||||
@ -1659,7 +1659,7 @@ void AttributionDataHostManagerImpl::OnOsHeaderParsed(
|
||||
registration_items =
|
||||
attribution_reporting::ParseOsSourceOrTriggerHeader(*result);
|
||||
|
||||
absl::optional<AttributionInputEvent> input_event;
|
||||
std::optional<AttributionInputEvent> input_event;
|
||||
if (registration_type == RegistrationType::kSource) {
|
||||
input_event = registrations->input_event()
|
||||
? *registrations->input_event()
|
||||
@ -1700,7 +1700,7 @@ void AttributionDataHostManagerImpl::MaybeOnRegistrationsFinished(
|
||||
return;
|
||||
}
|
||||
|
||||
absl::optional<int64_t> navigation_id = it->navigation_id();
|
||||
std::optional<int64_t> navigation_id = it->navigation_id();
|
||||
registrations_.erase(it);
|
||||
if (navigation_id.has_value()) {
|
||||
MaybeBindDeferredReceivers(navigation_id.value(), /*due_to_timeout=*/false);
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -31,7 +32,6 @@
|
||||
#include "mojo/public/cpp/bindings/receiver_set.h"
|
||||
#include "net/http/structured_headers.h"
|
||||
#include "services/data_decoder/public/cpp/data_decoder.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom.h"
|
||||
@ -112,8 +112,8 @@ class CONTENT_EXPORT AttributionDataHostManagerImpl
|
||||
attribution_reporting::mojom::RegistrationEligibility,
|
||||
GlobalRenderFrameHostId render_frame_id,
|
||||
int64_t last_navigation_id,
|
||||
absl::optional<blink::AttributionSrcToken> attribution_src_token,
|
||||
absl::optional<std::string> devtools_request_id) override;
|
||||
std::optional<blink::AttributionSrcToken> attribution_src_token,
|
||||
std::optional<std::string> devtools_request_id) override;
|
||||
bool NotifyBackgroundRegistrationData(
|
||||
BackgroundRegistrationsId id,
|
||||
const net::HttpResponseHeaders* headers,
|
||||
@ -125,7 +125,7 @@ class CONTENT_EXPORT AttributionDataHostManagerImpl
|
||||
|
||||
void NotifyFencedFrameReportingBeaconStarted(
|
||||
BeaconId beacon_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
attribution_reporting::SuitableOrigin source_origin,
|
||||
bool is_within_fenced_frame,
|
||||
AttributionInputEvent input_event,
|
||||
@ -212,7 +212,7 @@ class CONTENT_EXPORT AttributionDataHostManagerImpl
|
||||
void OnWebHeaderParsed(
|
||||
RegistrationsId,
|
||||
attribution_reporting::mojom::RegistrationType,
|
||||
absl::optional<std::vector<network::TriggerVerification>>,
|
||||
std::optional<std::vector<network::TriggerVerification>>,
|
||||
data_decoder::DataDecoder::ValueOrError result);
|
||||
void HandleParsedWebSource(const Registrations&,
|
||||
const HeaderPendingDecode&,
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -65,7 +66,6 @@
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/tokens/tokens.h"
|
||||
#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom.h"
|
||||
@ -260,7 +260,7 @@ TEST_F(AttributionDataHostManagerImplTest, TriggerDataHost_TriggerRegistered) {
|
||||
/*dedup_key=*/3, event_trigger_data_filters),
|
||||
attribution_reporting::EventTriggerData(
|
||||
/*data=*/4, /*priority=*/5,
|
||||
/*dedup_key=*/absl::nullopt, FilterPair())};
|
||||
/*dedup_key=*/std::nullopt, FilterPair())};
|
||||
|
||||
trigger_data.aggregatable_dedup_keys = aggregatable_dedup_keys;
|
||||
trigger_data.debug_reporting = true;
|
||||
@ -2005,7 +2005,7 @@ TEST_F(AttributionDataHostManagerImplTest,
|
||||
R"("https://r.test/x")");
|
||||
|
||||
data_host_manager_.NotifyFencedFrameReportingBeaconStarted(
|
||||
kBeaconId, /*navigation_id=*/absl::nullopt, source_origin,
|
||||
kBeaconId, /*navigation_id=*/std::nullopt, source_origin,
|
||||
/*is_within_fenced_frame=*/false, AttributionInputEvent(), kFrameId,
|
||||
kDevtoolsRequestId);
|
||||
|
||||
@ -2445,7 +2445,7 @@ TEST_F(AttributionDataHostManagerImplTest, EventBeaconSource_DataReceived) {
|
||||
kFrameId));
|
||||
|
||||
data_host_manager_.NotifyFencedFrameReportingBeaconStarted(
|
||||
kBeaconId, /*navigation_id=*/absl::nullopt,
|
||||
kBeaconId, /*navigation_id=*/std::nullopt,
|
||||
/*source_origin=*/*SuitableOrigin::Deserialize("https://source.test"),
|
||||
/*is_within_fenced_frame=*/true,
|
||||
/*input_event=*/AttributionInputEvent(), kFrameId, kDevtoolsRequestId);
|
||||
@ -2492,7 +2492,7 @@ TEST_F(AttributionDataHostManagerImplTest, OsTriggerAvailable) {
|
||||
EXPECT_CALL(mock_manager_,
|
||||
HandleOsRegistration(OsRegistration(
|
||||
kRegistrationUrl, /*debug_reporting=*/true, *kTopLevelOrigin,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/true, kFrameId)));
|
||||
|
||||
mojo::Remote<blink::mojom::AttributionDataHost> data_host_remote;
|
||||
@ -2592,7 +2592,7 @@ TEST_F(AttributionDataHostManagerImplTest, HeadersSize_SourceMetricsRecorded) {
|
||||
os_registration);
|
||||
|
||||
data_host_manager_.NotifyFencedFrameReportingBeaconStarted(
|
||||
kBeaconId, /*navigation_id=*/absl::nullopt, source_origin,
|
||||
kBeaconId, /*navigation_id=*/std::nullopt, source_origin,
|
||||
/*is_within_fenced_frame=*/false, AttributionInputEvent(), kFrameId,
|
||||
kDevtoolsRequestId);
|
||||
|
||||
@ -2628,7 +2628,7 @@ TEST_F(AttributionDataHostManagerImplTest, HeadersSize_TriggerMetricsRecorded) {
|
||||
data_host_manager_.NotifyBackgroundRegistrationStarted(
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false, RegistrationEligibility::kTrigger,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/absl::nullopt,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/std::nullopt,
|
||||
kDevtoolsRequestId);
|
||||
|
||||
auto headers = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
@ -2652,7 +2652,7 @@ TEST_F(AttributionDataHostManagerImplTest, HeadersSize_TriggerMetricsRecorded) {
|
||||
data_host_manager_.NotifyBackgroundRegistrationStarted(
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false, RegistrationEligibility::kTrigger,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/absl::nullopt,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/std::nullopt,
|
||||
kDevtoolsRequestId);
|
||||
|
||||
auto headers = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
@ -2736,7 +2736,7 @@ TEST_F(
|
||||
/*is_within_fenced_frame=*/false,
|
||||
RegistrationEligibility::kSourceOrTrigger, kFrameId,
|
||||
/*last_navigation_id=*/kNavigationId,
|
||||
/*attribution_src_token=*/absl::nullopt, kDevtoolsRequestId);
|
||||
/*attribution_src_token=*/std::nullopt, kDevtoolsRequestId);
|
||||
auto triggerHeaders = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
triggerHeaders->SetHeader(kAttributionReportingRegisterTriggerHeader,
|
||||
kRegisterTriggerJson);
|
||||
@ -3281,7 +3281,7 @@ TEST_F(AttributionDataHostManagerImplTest, BackgroundOsSource) {
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false,
|
||||
RegistrationEligibility::kSourceOrTrigger, kFrameId, kLastNavigationId,
|
||||
/*attribution_src_token=*/absl::nullopt, kDevtoolsRequestId);
|
||||
/*attribution_src_token=*/std::nullopt, kDevtoolsRequestId);
|
||||
|
||||
auto headers = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
headers->SetHeader(kAttributionReportingRegisterOsSourceHeader,
|
||||
@ -3328,7 +3328,7 @@ TEST_F(AttributionDataHostManagerImplTest, Background_NonNavigationTied) {
|
||||
data_host_manager_.NotifyBackgroundRegistrationStarted(
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false, RegistrationEligibility::kSource,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/absl::nullopt,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/std::nullopt,
|
||||
kDevtoolsRequestId);
|
||||
|
||||
// Trigger registration that should not be delayed.
|
||||
@ -3381,7 +3381,7 @@ TEST_F(AttributionDataHostManagerImplTest, BackgroundTrigger) {
|
||||
data_host_manager_.NotifyBackgroundRegistrationStarted(
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false, RegistrationEligibility::kTrigger,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/absl::nullopt,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/std::nullopt,
|
||||
kDevtoolsRequestId);
|
||||
|
||||
auto headers = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
@ -3414,13 +3414,13 @@ TEST_F(AttributionDataHostManagerImplTest, BackgroundOsTrigger) {
|
||||
EXPECT_CALL(mock_manager_,
|
||||
HandleOsRegistration(OsRegistration(
|
||||
GURL("https://r.test/x"), /*debug_reporting=*/false,
|
||||
context_origin, /*input_event=*/absl::nullopt,
|
||||
context_origin, /*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId)));
|
||||
|
||||
data_host_manager_.NotifyBackgroundRegistrationStarted(
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false, RegistrationEligibility::kTrigger,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/absl::nullopt,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/std::nullopt,
|
||||
kDevtoolsRequestId);
|
||||
|
||||
auto headers = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
@ -3450,8 +3450,8 @@ TEST_F(AttributionDataHostManagerImplTest, BackgroundTrigger_ParsingFails) {
|
||||
*SuitableOrigin::Deserialize("https://destination.test");
|
||||
|
||||
for (const auto& devtools_request_id :
|
||||
std::vector<absl::optional<std::string>>{absl::nullopt,
|
||||
kDevtoolsRequestId}) {
|
||||
std::vector<std::optional<std::string>>{std::nullopt,
|
||||
kDevtoolsRequestId}) {
|
||||
EXPECT_CALL(mock_manager_, HandleTrigger).Times(0);
|
||||
|
||||
// TODO(https://crbug.com/1457238): Add expectation that
|
||||
@ -3460,7 +3460,7 @@ TEST_F(AttributionDataHostManagerImplTest, BackgroundTrigger_ParsingFails) {
|
||||
data_host_manager_.NotifyBackgroundRegistrationStarted(
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false, RegistrationEligibility::kTrigger,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/absl::nullopt,
|
||||
kFrameId, kLastNavigationId, /*attribution_src_token=*/std::nullopt,
|
||||
devtools_request_id);
|
||||
|
||||
auto headers = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
@ -3570,13 +3570,13 @@ TEST_F(AttributionDataHostManagerImplTest, Background_InvalidHeaders) {
|
||||
};
|
||||
|
||||
for (const auto& devtools_request_id :
|
||||
std::vector<absl::optional<std::string>>{absl::nullopt,
|
||||
kDevtoolsRequestId}) {
|
||||
std::vector<std::optional<std::string>>{std::nullopt,
|
||||
kDevtoolsRequestId}) {
|
||||
for (const auto& test_case : kTestCases) {
|
||||
data_host_manager_.NotifyBackgroundRegistrationStarted(
|
||||
kBackgroundId, context_origin,
|
||||
/*is_within_fenced_frame=*/false, test_case.eligibility, kFrameId,
|
||||
kLastNavigationId, /*attribution_src_token=*/absl::nullopt,
|
||||
kLastNavigationId, /*attribution_src_token=*/std::nullopt,
|
||||
devtools_request_id);
|
||||
|
||||
auto headers = base::MakeRefCounted<net::HttpResponseHeaders>("");
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/check.h"
|
||||
@ -28,7 +29,6 @@
|
||||
#include "content/browser/attribution_reporting/storable_source.h"
|
||||
#include "content/browser/attribution_reporting/store_source_result.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
@ -75,9 +75,9 @@ enum class DebugDataType {
|
||||
kMaxValue = kTriggerEventNoMatchingTriggerData,
|
||||
};
|
||||
|
||||
absl::optional<DebugDataType> DataTypeIfCookieSet(DebugDataType data_type,
|
||||
bool is_debug_cookie_set) {
|
||||
return is_debug_cookie_set ? absl::make_optional(data_type) : absl::nullopt;
|
||||
std::optional<DebugDataType> DataTypeIfCookieSet(DebugDataType data_type,
|
||||
bool is_debug_cookie_set) {
|
||||
return is_debug_cookie_set ? std::make_optional(data_type) : std::nullopt;
|
||||
}
|
||||
|
||||
struct DebugDataTypeAndBody {
|
||||
@ -88,14 +88,14 @@ struct DebugDataTypeAndBody {
|
||||
: debug_data_type(debug_data_type), limit(limit) {}
|
||||
};
|
||||
|
||||
absl::optional<DebugDataTypeAndBody> GetReportDataBody(
|
||||
std::optional<DebugDataTypeAndBody> GetReportDataBody(
|
||||
bool is_debug_cookie_set,
|
||||
const StoreSourceResult& result) {
|
||||
return absl::visit(
|
||||
base::Overloaded{
|
||||
[](absl::variant<StoreSourceResult::ProhibitedByBrowserPolicy,
|
||||
StoreSourceResult::ExceedsMaxChannelCapacity>) {
|
||||
return absl::optional<DebugDataTypeAndBody>();
|
||||
return std::optional<DebugDataTypeAndBody>();
|
||||
},
|
||||
[&](absl::variant<
|
||||
StoreSourceResult::Success,
|
||||
@ -108,50 +108,50 @@ absl::optional<DebugDataTypeAndBody> GetReportDataBody(
|
||||
StoreSourceResult::DestinationGlobalLimitReached,
|
||||
StoreSourceResult::ReportingOriginsPerSiteLimitReached>) {
|
||||
return is_debug_cookie_set
|
||||
? absl::make_optional<DebugDataTypeAndBody>(
|
||||
? std::make_optional<DebugDataTypeAndBody>(
|
||||
DebugDataType::kSourceSuccess)
|
||||
: absl::nullopt;
|
||||
: std::nullopt;
|
||||
},
|
||||
[](StoreSourceResult::InsufficientUniqueDestinationCapacity v) {
|
||||
return absl::make_optional<DebugDataTypeAndBody>(
|
||||
return std::make_optional<DebugDataTypeAndBody>(
|
||||
DebugDataType::kSourceDestinationLimit, v.limit);
|
||||
},
|
||||
[](absl::variant<StoreSourceResult::DestinationReportingLimitReached,
|
||||
StoreSourceResult::DestinationBothLimitsReached> v) {
|
||||
return absl::make_optional<DebugDataTypeAndBody>(
|
||||
return std::make_optional<DebugDataTypeAndBody>(
|
||||
DebugDataType::kSourceDestinationRateLimit,
|
||||
absl::visit([](auto v) { return v.limit; }, v));
|
||||
},
|
||||
[&](StoreSourceResult::SuccessNoised) {
|
||||
return is_debug_cookie_set
|
||||
? absl::make_optional<DebugDataTypeAndBody>(
|
||||
? std::make_optional<DebugDataTypeAndBody>(
|
||||
DebugDataType::kSourceNoised)
|
||||
: absl::nullopt;
|
||||
: std::nullopt;
|
||||
},
|
||||
[&](StoreSourceResult::InsufficientSourceCapacity v) {
|
||||
return is_debug_cookie_set
|
||||
? absl::make_optional<DebugDataTypeAndBody>(
|
||||
? std::make_optional<DebugDataTypeAndBody>(
|
||||
DebugDataType::kSourceStorageLimit, v.limit)
|
||||
: absl::nullopt;
|
||||
: std::nullopt;
|
||||
},
|
||||
[&](StoreSourceResult::InternalError) {
|
||||
return is_debug_cookie_set
|
||||
? absl::make_optional<DebugDataTypeAndBody>(
|
||||
? std::make_optional<DebugDataTypeAndBody>(
|
||||
DebugDataType::kSourceUnknownError)
|
||||
: absl::nullopt;
|
||||
: std::nullopt;
|
||||
},
|
||||
},
|
||||
result.result());
|
||||
}
|
||||
|
||||
absl::optional<DebugDataType> GetReportDataType(EventLevelResult result,
|
||||
bool is_debug_cookie_set) {
|
||||
std::optional<DebugDataType> GetReportDataType(EventLevelResult result,
|
||||
bool is_debug_cookie_set) {
|
||||
switch (result) {
|
||||
case EventLevelResult::kSuccess:
|
||||
case EventLevelResult::kProhibitedByBrowserPolicy:
|
||||
case EventLevelResult::kSuccessDroppedLowerPriority:
|
||||
case EventLevelResult::kNotRegistered:
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
case EventLevelResult::kInternalError:
|
||||
return DataTypeIfCookieSet(DebugDataType::kTriggerUnknownError,
|
||||
is_debug_cookie_set);
|
||||
@ -202,13 +202,13 @@ absl::optional<DebugDataType> GetReportDataType(EventLevelResult result,
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<DebugDataType> GetReportDataType(AggregatableResult result,
|
||||
bool is_debug_cookie_set) {
|
||||
std::optional<DebugDataType> GetReportDataType(AggregatableResult result,
|
||||
bool is_debug_cookie_set) {
|
||||
switch (result) {
|
||||
case AggregatableResult::kSuccess:
|
||||
case AggregatableResult::kNotRegistered:
|
||||
case AggregatableResult::kProhibitedByBrowserPolicy:
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
case AggregatableResult::kInternalError:
|
||||
return DataTypeIfCookieSet(DebugDataType::kTriggerUnknownError,
|
||||
is_debug_cookie_set);
|
||||
@ -313,7 +313,7 @@ std::string SerializeReportDataType(DebugDataType data_type) {
|
||||
void SetSourceData(base::Value::Dict& data_body,
|
||||
uint64_t source_event_id,
|
||||
const net::SchemefulSite& source_site,
|
||||
absl::optional<uint64_t> source_debug_key) {
|
||||
std::optional<uint64_t> source_debug_key) {
|
||||
data_body.Set("source_event_id", base::NumberToString(source_event_id));
|
||||
data_body.Set("source_site", source_site.Serialize());
|
||||
if (source_debug_key) {
|
||||
@ -327,7 +327,7 @@ void SetLimit(base::Value::Dict& data_body, T limit) {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void SetLimit(base::Value::Dict& data_body, absl::optional<T> limit) {
|
||||
void SetLimit(base::Value::Dict& data_body, std::optional<T> limit) {
|
||||
DCHECK(limit.has_value());
|
||||
SetLimit(data_body, *limit);
|
||||
}
|
||||
@ -343,11 +343,11 @@ base::Value::Dict GetReportDataBody(DebugDataType data_type,
|
||||
base::Value::Dict data_body;
|
||||
data_body.Set(kAttributionDestination,
|
||||
net::SchemefulSite(trigger.destination_origin()).Serialize());
|
||||
if (absl::optional<uint64_t> debug_key = trigger.registration().debug_key) {
|
||||
if (std::optional<uint64_t> debug_key = trigger.registration().debug_key) {
|
||||
data_body.Set("trigger_debug_key", base::NumberToString(*debug_key));
|
||||
}
|
||||
|
||||
if (const absl::optional<StoredSource>& source = result.source()) {
|
||||
if (const std::optional<StoredSource>& source = result.source()) {
|
||||
SetSourceData(data_body, source->source_event_id(),
|
||||
source->common_info().source_site(), source->debug_key());
|
||||
}
|
||||
@ -436,19 +436,19 @@ GURL AttributionDebugReport::ReportUrl() const {
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
std::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
const StorableSource& source,
|
||||
bool is_debug_cookie_set,
|
||||
const StoreSourceResult& result) {
|
||||
if (!source.registration().debug_reporting ||
|
||||
source.is_within_fenced_frame()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
absl::optional<DebugDataTypeAndBody> data =
|
||||
std::optional<DebugDataTypeAndBody> data =
|
||||
GetReportDataBody(is_debug_cookie_set, result);
|
||||
if (!data) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
RecordVerboseDebugReportType(data->debug_data_type);
|
||||
@ -473,13 +473,13 @@ absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
std::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
const AttributionTrigger& trigger,
|
||||
bool is_debug_cookie_set,
|
||||
const CreateReportResult& result) {
|
||||
if (!trigger.registration().debug_reporting ||
|
||||
trigger.is_within_fenced_frame()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (is_debug_cookie_set && result.source()) {
|
||||
@ -489,7 +489,7 @@ absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
base::Value::List report_body;
|
||||
base::Time original_report_time;
|
||||
|
||||
absl::optional<DebugDataType> event_level_data_type =
|
||||
std::optional<DebugDataType> event_level_data_type =
|
||||
GetReportDataType(result.event_level_status(), is_debug_cookie_set);
|
||||
if (event_level_data_type) {
|
||||
report_body.Append(
|
||||
@ -499,7 +499,7 @@ absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
RecordVerboseDebugReportType(*event_level_data_type);
|
||||
}
|
||||
|
||||
if (absl::optional<DebugDataType> aggregatable_data_type =
|
||||
if (std::optional<DebugDataType> aggregatable_data_type =
|
||||
GetReportDataType(result.aggregatable_status(), is_debug_cookie_set);
|
||||
aggregatable_data_type &&
|
||||
aggregatable_data_type != event_level_data_type) {
|
||||
@ -511,7 +511,7 @@ absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
}
|
||||
|
||||
if (report_body.empty()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return AttributionDebugReport(
|
||||
@ -519,16 +519,16 @@ absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
std::optional<AttributionDebugReport> AttributionDebugReport::Create(
|
||||
const OsRegistration& registration) {
|
||||
if (!registration.debug_reporting || registration.is_within_fenced_frame) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
auto registration_origin = attribution_reporting::SuitableOrigin::Create(
|
||||
registration.registration_url);
|
||||
if (!registration_origin.has_value()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
DebugDataType data_type;
|
||||
|
@ -5,11 +5,12 @@
|
||||
#ifndef CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_DEBUG_REPORT_H_
|
||||
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_DEBUG_REPORT_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/time/time.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class GURL;
|
||||
|
||||
@ -26,17 +27,17 @@ struct OsRegistration;
|
||||
// debug report.
|
||||
class CONTENT_EXPORT AttributionDebugReport {
|
||||
public:
|
||||
static absl::optional<AttributionDebugReport> Create(
|
||||
static std::optional<AttributionDebugReport> Create(
|
||||
const StorableSource& source,
|
||||
bool is_debug_cookie_set,
|
||||
const StoreSourceResult& result);
|
||||
|
||||
static absl::optional<AttributionDebugReport> Create(
|
||||
static std::optional<AttributionDebugReport> Create(
|
||||
const AttributionTrigger& trigger,
|
||||
bool is_debug_cookie_set,
|
||||
const CreateReportResult& result);
|
||||
|
||||
static absl::optional<AttributionDebugReport> Create(const OsRegistration&);
|
||||
static std::optional<AttributionDebugReport> Create(const OsRegistration&);
|
||||
|
||||
~AttributionDebugReport();
|
||||
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/test/values_test_util.h"
|
||||
#include "base/time/time.h"
|
||||
#include "content/browser/attribution_reporting/attribution_config.h"
|
||||
@ -19,7 +21,6 @@
|
||||
#include "content/public/browser/global_routing_id.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace content {
|
||||
@ -62,11 +63,10 @@ TEST(AttributionDebugReportTest, NoDebugReporting_NoReportReturned) {
|
||||
|
||||
TEST(AttributionDebugReportTest,
|
||||
SourceDestinationLimitError_ValidReportReturned) {
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/false,
|
||||
StoreSourceResult::InsufficientUniqueDestinationCapacity(3));
|
||||
std::optional<AttributionDebugReport> report = AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/false,
|
||||
StoreSourceResult::InsufficientUniqueDestinationCapacity(3));
|
||||
ASSERT_TRUE(report);
|
||||
|
||||
static constexpr char kExpectedJsonString[] = R"([{
|
||||
@ -110,12 +110,12 @@ TEST(AttributionDebugReportTest, WithinFencedFrame_NoDebugReport) {
|
||||
TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
const struct {
|
||||
StoreSourceResult result;
|
||||
absl::optional<uint64_t> debug_key;
|
||||
std::optional<uint64_t> debug_key;
|
||||
const char* expected_report_body_without_cookie;
|
||||
const char* expected_report_body_with_cookie;
|
||||
} kTestCases[] = {
|
||||
{StoreSourceResult::Success(),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*expected_report_body_without_cookie=*/nullptr,
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -139,7 +139,7 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
"type": "source-unknown-error"
|
||||
}])json"},
|
||||
{StoreSourceResult::InsufficientSourceCapacity(10),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*expected_report_body_without_cookie=*/nullptr,
|
||||
/*expected_report_body_with_cookie=*/
|
||||
R"json([{
|
||||
@ -152,11 +152,11 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
"type": "source-storage-limit"
|
||||
}])json"},
|
||||
{StoreSourceResult::ProhibitedByBrowserPolicy(),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*expected_report_body_without_cookie=*/nullptr,
|
||||
/*expected_report_body_with_cookie=*/nullptr},
|
||||
{StoreSourceResult::InsufficientUniqueDestinationCapacity(3),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*expected_report_body_without_cookie=*/
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -177,8 +177,8 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
},
|
||||
"type": "source-destination-limit"
|
||||
}])json"},
|
||||
{StoreSourceResult::SuccessNoised(/*min_fake_report_time=*/absl::nullopt),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
{StoreSourceResult::SuccessNoised(/*min_fake_report_time=*/std::nullopt),
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*expected_report_body_without_cookie=*/nullptr,
|
||||
/*expected_report_body_with_cookie=*/
|
||||
R"json([{
|
||||
@ -216,7 +216,7 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
"type": "source-success"
|
||||
}])json"},
|
||||
{StoreSourceResult::DestinationReportingLimitReached(50),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*expected_report_body_without_cookie=*/
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -238,7 +238,7 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
"type": "source-destination-rate-limit"
|
||||
}])json"},
|
||||
{StoreSourceResult::DestinationBothLimitsReached(50),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*expected_report_body_without_cookie=*/
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -266,7 +266,7 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
SCOPED_TRACE(Message() << "is_debug_cookie_set: " << is_debug_cookie_set
|
||||
<< ", result: " << test_case.result.status());
|
||||
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
std::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(SourceBuilder()
|
||||
.SetDebugReporting(true)
|
||||
.SetDebugKey(test_case.debug_key)
|
||||
@ -286,7 +286,7 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
|
||||
// Multiple destinations
|
||||
{
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
std::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
SourceBuilder()
|
||||
.SetDebugReporting(true)
|
||||
@ -297,7 +297,7 @@ TEST(AttributionDebugReportTest, SourceDebugging) {
|
||||
.Build(),
|
||||
/*is_debug_cookie_set=*/true,
|
||||
StoreSourceResult::SuccessNoised(
|
||||
/*min_fake_report_time=*/absl::nullopt));
|
||||
/*min_fake_report_time=*/std::nullopt));
|
||||
|
||||
EXPECT_EQ(report->ReportBody(), base::test::ParseJson(R"json([{
|
||||
"body": {
|
||||
@ -391,22 +391,22 @@ TEST(AttributionDebugReportTest, TriggerDebugging) {
|
||||
<< ", event_level_result: " << test_case.event_level_result
|
||||
<< ", aggregatable_result: " << test_case.aggregatable_result);
|
||||
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
std::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
TriggerBuilder().SetDebugReporting(true).Build(),
|
||||
is_trigger_debug_cookie_set,
|
||||
CreateReportResult(
|
||||
/*trigger_time=*/base::Time::Now(),
|
||||
test_case.event_level_result, test_case.aggregatable_result,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt,
|
||||
test_case.has_matching_source
|
||||
? absl::make_optional(
|
||||
? std::make_optional(
|
||||
SourceBuilder()
|
||||
.SetDebugCookieSet(is_source_debug_cookie_set)
|
||||
.BuildStored())
|
||||
: absl::nullopt,
|
||||
: std::nullopt,
|
||||
test_case.limits));
|
||||
if (is_trigger_debug_cookie_set &&
|
||||
(!test_case.has_matching_source || is_source_debug_cookie_set)) {
|
||||
@ -427,34 +427,34 @@ TEST(AttributionDebugReportTest, TriggerDebugging) {
|
||||
TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
const struct {
|
||||
EventLevelResult result;
|
||||
absl::optional<AttributionReport> replaced_event_level_report;
|
||||
absl::optional<AttributionReport> new_event_level_report;
|
||||
std::optional<AttributionReport> replaced_event_level_report;
|
||||
std::optional<AttributionReport> new_event_level_report;
|
||||
bool has_matching_source = false;
|
||||
CreateReportResult::Limits limits;
|
||||
absl::optional<AttributionReport> dropped_event_level_report;
|
||||
absl::optional<uint64_t> trigger_debug_key;
|
||||
std::optional<AttributionReport> dropped_event_level_report;
|
||||
std::optional<uint64_t> trigger_debug_key;
|
||||
const char* expected_report_body;
|
||||
absl::optional<uint64_t> source_debug_key;
|
||||
std::optional<uint64_t> source_debug_key;
|
||||
} kTestCases[] = {
|
||||
{EventLevelResult::kSuccess,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/DefaultEventLevelReport(),
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
/*expected_report_body=*/nullptr},
|
||||
{EventLevelResult::kSuccessDroppedLowerPriority,
|
||||
/*replaced_event_level_report=*/DefaultEventLevelReport(),
|
||||
/*new_event_level_report=*/DefaultEventLevelReport(),
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
/*expected_report_body=*/nullptr},
|
||||
{EventLevelResult::kInternalError,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/false, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/123,
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -464,13 +464,13 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-unknown-error"
|
||||
}])json"},
|
||||
{EventLevelResult::kNoCapacityForConversionDestination,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true,
|
||||
CreateReportResult::Limits{.max_event_level_reports_per_destination =
|
||||
10},
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -483,11 +483,11 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
}])json",
|
||||
/*source_debug_key=*/456},
|
||||
{EventLevelResult::kNoMatchingImpressions,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/false, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test"
|
||||
@ -495,10 +495,10 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-no-matching-source"
|
||||
}])json"},
|
||||
{EventLevelResult::kDeduplicated,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/456,
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -512,12 +512,12 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
}])json",
|
||||
/*source_debug_key=*/789},
|
||||
{EventLevelResult::kExcessiveAttributions,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true,
|
||||
CreateReportResult::Limits{.rate_limits_max_attributions = 10},
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -528,12 +528,12 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-attributions-per-source-destination-limit"
|
||||
}])json"},
|
||||
{EventLevelResult::kPriorityTooLow,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/
|
||||
DefaultEventLevelReport(base::Time::UnixEpoch()),
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -547,11 +547,11 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-event-low-priority"
|
||||
}])json"},
|
||||
{EventLevelResult::kNeverAttributedSource,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -561,13 +561,13 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-event-noise"
|
||||
}])json"},
|
||||
{EventLevelResult::kExcessiveReportingOrigins,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true,
|
||||
CreateReportResult::Limits{
|
||||
.rate_limits_max_attribution_reporting_origins = 10},
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -578,11 +578,11 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-reporting-origin-limit"
|
||||
}])json"},
|
||||
{EventLevelResult::kNoMatchingSourceFilterData,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -592,18 +592,18 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-no-matching-filter-data"
|
||||
}])json"},
|
||||
{EventLevelResult::kProhibitedByBrowserPolicy,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/false, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
/*expected_report_body=*/nullptr},
|
||||
{EventLevelResult::kNoMatchingConfigurations,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -613,12 +613,12 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-event-no-matching-configurations"
|
||||
}])json"},
|
||||
{EventLevelResult::kExcessiveReports,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/
|
||||
DefaultEventLevelReport(base::Time::UnixEpoch()),
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -632,11 +632,11 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-event-excessive-reports"
|
||||
}])json"},
|
||||
{EventLevelResult::kFalselyAttributedSource,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -646,11 +646,11 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-event-noise"
|
||||
}])json"},
|
||||
{EventLevelResult::kReportWindowNotStarted,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -660,11 +660,11 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-event-report-window-not-started"
|
||||
}])json"},
|
||||
{EventLevelResult::kReportWindowPassed,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/true, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -674,11 +674,11 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
"type": "trigger-event-report-window-passed"
|
||||
}])json"},
|
||||
{EventLevelResult::kNotRegistered,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*new_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/std::nullopt,
|
||||
/*has_matching_source=*/false, CreateReportResult::Limits(),
|
||||
/*dropped_event_level_report=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*dropped_event_level_report=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
/*expected_report_body=*/nullptr},
|
||||
};
|
||||
|
||||
@ -695,7 +695,7 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
<< is_trigger_debug_cookie_set
|
||||
<< ", result: " << test_case.result);
|
||||
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
std::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
TriggerBuilder()
|
||||
.SetDebugReporting(true)
|
||||
@ -707,14 +707,14 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
AggregatableResult::kNotRegistered,
|
||||
test_case.replaced_event_level_report,
|
||||
test_case.new_event_level_report,
|
||||
/*new_aggregatable_report=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt,
|
||||
test_case.has_matching_source
|
||||
? absl::make_optional(
|
||||
? std::make_optional(
|
||||
SourceBuilder(base::Time::UnixEpoch())
|
||||
.SetDebugCookieSet(is_source_debug_cookie_set)
|
||||
.SetDebugKey(test_case.source_debug_key)
|
||||
.BuildStored())
|
||||
: absl::nullopt,
|
||||
: std::nullopt,
|
||||
test_case.limits, test_case.dropped_event_level_report));
|
||||
if (is_trigger_debug_cookie_set &&
|
||||
(!test_case.has_matching_source || is_source_debug_cookie_set)) {
|
||||
@ -735,21 +735,21 @@ TEST(AttributionDebugReportTest, EventLevelAttributionDebugging) {
|
||||
TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
const struct {
|
||||
AggregatableResult result;
|
||||
absl::optional<AttributionReport> new_aggregatable_report;
|
||||
std::optional<AttributionReport> new_aggregatable_report;
|
||||
CreateReportResult::Limits limits;
|
||||
absl::optional<uint64_t> source_debug_key;
|
||||
absl::optional<uint64_t> trigger_debug_key;
|
||||
std::optional<uint64_t> source_debug_key;
|
||||
std::optional<uint64_t> trigger_debug_key;
|
||||
const char* expected_report_body;
|
||||
} kTestCases[] = {
|
||||
{AggregatableResult::kSuccess, DefaultAggregatableReport(),
|
||||
CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
/*expected_report_body=*/nullptr},
|
||||
{AggregatableResult::kInternalError,
|
||||
/*new_aggregatable_report=*/absl::nullopt, CreateReportResult::Limits(),
|
||||
/*new_aggregatable_report=*/std::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/456,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -760,10 +760,10 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-unknown-error"
|
||||
}])json"},
|
||||
{AggregatableResult::kNoCapacityForConversionDestination,
|
||||
/*new_aggregatable_report=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt,
|
||||
CreateReportResult::Limits{.max_aggregatable_reports_per_destination =
|
||||
20},
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/789,
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -776,7 +776,7 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-aggregate-storage-limit"
|
||||
}])json"},
|
||||
{AggregatableResult::kExcessiveAttributions,
|
||||
/*new_aggregatable_report=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt,
|
||||
CreateReportResult::Limits{.rate_limits_max_attributions = 10},
|
||||
/*source_debug_key=*/789,
|
||||
/*trigger_debug_key=*/456,
|
||||
@ -792,11 +792,11 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-attributions-per-source-destination-limit"
|
||||
}])json"},
|
||||
{AggregatableResult::kExcessiveReportingOrigins,
|
||||
/*new_aggregatable_report=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt,
|
||||
CreateReportResult::Limits{
|
||||
.rate_limits_max_attribution_reporting_origins = 5},
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -807,9 +807,9 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-reporting-origin-limit"
|
||||
}])json"},
|
||||
{AggregatableResult::kNoHistograms,
|
||||
/*new_aggregatable_report=*/absl::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -819,9 +819,9 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-aggregate-no-contributions"
|
||||
}])json"},
|
||||
{AggregatableResult::kInsufficientBudget,
|
||||
/*new_aggregatable_report=*/absl::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -832,10 +832,10 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-aggregate-insufficient-budget"
|
||||
}])json"},
|
||||
{AggregatableResult::kExcessiveReports,
|
||||
/*new_aggregatable_report=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt,
|
||||
CreateReportResult::Limits{.max_aggregatable_reports_per_source = 10},
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -846,9 +846,9 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-aggregate-excessive-reports"
|
||||
}])json"},
|
||||
{AggregatableResult::kNoMatchingSourceFilterData,
|
||||
/*new_aggregatable_report=*/absl::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -858,14 +858,14 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-no-matching-filter-data"
|
||||
}])json"},
|
||||
{AggregatableResult::kNotRegistered,
|
||||
/*new_aggregatable_report=*/absl::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
/*expected_report_body=*/nullptr},
|
||||
{AggregatableResult::kDeduplicated,
|
||||
/*new_aggregatable_report=*/absl::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -875,9 +875,9 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
"type": "trigger-aggregate-deduplicated"
|
||||
}])json"},
|
||||
{AggregatableResult::kReportWindowPassed,
|
||||
/*new_aggregatable_report=*/absl::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/absl::nullopt,
|
||||
/*trigger_debug_key=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt, CreateReportResult::Limits(),
|
||||
/*source_debug_key=*/std::nullopt,
|
||||
/*trigger_debug_key=*/std::nullopt,
|
||||
R"json([{
|
||||
"body": {
|
||||
"attribution_destination": "https://conversion.test",
|
||||
@ -901,7 +901,7 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
<< is_trigger_debug_cookie_set
|
||||
<< ", result: " << test_case.result);
|
||||
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
std::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
TriggerBuilder()
|
||||
.SetDebugReporting(true)
|
||||
@ -911,7 +911,7 @@ TEST(AttributionDebugReportTest, AggregatableAttributionDebugging) {
|
||||
CreateReportResult(
|
||||
/*trigger_time=*/base::Time::Now(),
|
||||
EventLevelResult::kSuccess, test_case.result,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/DefaultEventLevelReport(),
|
||||
test_case.new_aggregatable_report,
|
||||
SourceBuilder()
|
||||
@ -963,7 +963,7 @@ TEST(AttributionDebugReportTest, OsRegistrationDebugging) {
|
||||
/*registration_url=*/GURL("https://a.test/x"),
|
||||
/*debug_reporting=*/true,
|
||||
/*top_level_origin=*/url::Origin::Create(GURL("https://b.test")),
|
||||
/*input_event=*/absl::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*input_event=*/std::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*render_frame_id=*/GlobalRenderFrameHostId()),
|
||||
R"json([{
|
||||
"body": {
|
||||
@ -979,7 +979,7 @@ TEST(AttributionDebugReportTest, OsRegistrationDebugging) {
|
||||
/*registration_url=*/GURL("https://a.test/x"),
|
||||
/*debug_reporting=*/false,
|
||||
/*top_level_origin=*/url::Origin::Create(GURL("https://b.test")),
|
||||
/*input_event=*/absl::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*input_event=*/std::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*render_frame_id=*/GlobalRenderFrameHostId()),
|
||||
nullptr,
|
||||
},
|
||||
@ -989,7 +989,7 @@ TEST(AttributionDebugReportTest, OsRegistrationDebugging) {
|
||||
/*registration_url=*/GURL("https://a.test/x"),
|
||||
/*debug_reporting=*/true,
|
||||
/*top_level_origin=*/url::Origin::Create(GURL("https://b.test")),
|
||||
/*input_event=*/absl::nullopt, /*is_within_fenced_frame=*/true,
|
||||
/*input_event=*/std::nullopt, /*is_within_fenced_frame=*/true,
|
||||
/*render_frame_id=*/GlobalRenderFrameHostId()),
|
||||
nullptr,
|
||||
},
|
||||
@ -999,14 +999,14 @@ TEST(AttributionDebugReportTest, OsRegistrationDebugging) {
|
||||
/*registration_url=*/GURL("http://a.test/x"),
|
||||
/*debug_reporting=*/true,
|
||||
/*top_level_origin=*/url::Origin::Create(GURL("https://b.test")),
|
||||
/*input_event=*/absl::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*input_event=*/std::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*render_frame_id=*/GlobalRenderFrameHostId()),
|
||||
nullptr,
|
||||
},
|
||||
};
|
||||
|
||||
for (const auto& test_case : kTestCases) {
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
std::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(test_case.registration);
|
||||
EXPECT_EQ(report.has_value(), test_case.expected_body != nullptr)
|
||||
<< test_case.description;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -42,7 +43,6 @@
|
||||
#include "net/url_request/url_request.h"
|
||||
#include "services/network/public/cpp/attribution_reporting_runtime_features.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/common/navigation/impression.h"
|
||||
#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom.h"
|
||||
@ -178,7 +178,7 @@ void AttributionHost::DidStartNavigation(NavigationHandle* navigation_handle) {
|
||||
// implicit ordering: a navigation with an impression attached won't be
|
||||
// processed after a navigation commit in the initiator RFH, so reading the
|
||||
// origin off is safe at the start of the navigation.
|
||||
absl::optional<SuitableOrigin> initiator_root_frame_origin =
|
||||
std::optional<SuitableOrigin> initiator_root_frame_origin =
|
||||
SuitableOrigin::Create(initiator_root_frame->GetLastCommittedOrigin());
|
||||
|
||||
if (!initiator_root_frame_origin) {
|
||||
@ -242,7 +242,7 @@ void AttributionHost::NotifyNavigationRegistrationData(
|
||||
return;
|
||||
}
|
||||
|
||||
const absl::optional<blink::Impression>& impression =
|
||||
const std::optional<blink::Impression>& impression =
|
||||
navigation_handle->GetImpression();
|
||||
// If there is an ongoing_registration_eligible_navigation, the navigation
|
||||
// must have an associated impression, be in the primary main frame and not in
|
||||
@ -291,7 +291,7 @@ void AttributionHost::NotifyNavigationRegistrationData(
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<SuitableOrigin>
|
||||
std::optional<SuitableOrigin>
|
||||
AttributionHost::TopFrameOriginForSecureContext() {
|
||||
RenderFrameHostImpl* render_frame_host =
|
||||
static_cast<RenderFrameHostImpl*>(receivers_.GetCurrentTargetFrame());
|
||||
@ -304,13 +304,13 @@ AttributionHost::TopFrameOriginForSecureContext() {
|
||||
// `is_web_secure_context` would allow opaque origins to pass through, but
|
||||
// they cannot be handled by the storage layer.
|
||||
|
||||
absl::optional<SuitableOrigin> suitable_top_frame_origin =
|
||||
std::optional<SuitableOrigin> suitable_top_frame_origin =
|
||||
SuitableOrigin::Create(top_frame_origin);
|
||||
|
||||
// TODO(crbug.com/1378749): Invoke mojo::ReportBadMessage here when we can be
|
||||
// sure honest renderers won't hit this path.
|
||||
if (!suitable_top_frame_origin) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// TODO(crbug.com/1378492): Invoke mojo::ReportBadMessage here when we can be
|
||||
@ -319,12 +319,12 @@ AttributionHost::TopFrameOriginForSecureContext() {
|
||||
!render_frame_host->policy_container_host()
|
||||
->policies()
|
||||
.is_web_secure_context) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (!render_frame_host->IsFeatureEnabled(
|
||||
blink::mojom::PermissionsPolicyFeature::kAttributionReporting)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return suitable_top_frame_origin;
|
||||
@ -334,7 +334,7 @@ void AttributionHost::RegisterDataHost(
|
||||
mojo::PendingReceiver<blink::mojom::AttributionDataHost> data_host,
|
||||
attribution_reporting::mojom::RegistrationEligibility
|
||||
registration_eligibility) {
|
||||
absl::optional<SuitableOrigin> top_frame_origin =
|
||||
std::optional<SuitableOrigin> top_frame_origin =
|
||||
TopFrameOriginForSecureContext();
|
||||
if (!top_frame_origin) {
|
||||
return;
|
||||
@ -417,7 +417,7 @@ void AttributionHost::BindReceiver(
|
||||
|
||||
bool AttributionHost::NotifyFencedFrameReportingBeaconStarted(
|
||||
BeaconId beacon_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
RenderFrameHostImpl* initiator_frame_host,
|
||||
std::string devtools_request_id) {
|
||||
if (!base::FeatureList::IsEnabled(
|
||||
@ -438,7 +438,7 @@ bool AttributionHost::NotifyFencedFrameReportingBeaconStarted(
|
||||
initiator_frame_host->GetOutermostMainFrame();
|
||||
DCHECK(initiator_root_frame);
|
||||
|
||||
absl::optional<SuitableOrigin> initiator_root_frame_origin =
|
||||
std::optional<SuitableOrigin> initiator_root_frame_origin =
|
||||
SuitableOrigin::Create(initiator_root_frame->GetLastCommittedOrigin());
|
||||
|
||||
if (!initiator_root_frame_origin) {
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/containers/flat_set.h"
|
||||
@ -19,7 +20,6 @@
|
||||
#include "content/public/browser/web_contents_observer.h"
|
||||
#include "content/public/browser/web_contents_user_data.h"
|
||||
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom-forward.h"
|
||||
#include "third_party/blink/public/mojom/conversions/conversions.mojom.h"
|
||||
|
||||
@ -72,12 +72,12 @@ class CONTENT_EXPORT AttributionHost
|
||||
// `navigation_id` will be set if this beacon is being sent as the result of a
|
||||
// top navigation initiated by a fenced frame. This is used to track
|
||||
// attributions that occur on a navigated page after the current page has been
|
||||
// unloaded. Otherwise `absl::nullopt`.
|
||||
// unloaded. Otherwise `std::nullopt`.
|
||||
// Returns whether fenced frame reporting beacons can support Attribution
|
||||
// Reporting API.
|
||||
bool NotifyFencedFrameReportingBeaconStarted(
|
||||
BeaconId beacon_id,
|
||||
absl::optional<int64_t> navigation_id,
|
||||
std::optional<int64_t> navigation_id,
|
||||
RenderFrameHostImpl* initiator_frame_host,
|
||||
std::string devtools_request_id);
|
||||
|
||||
@ -105,10 +105,10 @@ class CONTENT_EXPORT AttributionHost
|
||||
bool is_final_response);
|
||||
|
||||
// Returns the top frame origin corresponding to the current target frame.
|
||||
// Returns `absl::nullopt` and reports a bad message if the top frame origin
|
||||
// Returns `std::nullopt` and reports a bad message if the top frame origin
|
||||
// is not potentially trustworthy or the current target frame is not a secure
|
||||
// context.
|
||||
absl::optional<attribution_reporting::SuitableOrigin>
|
||||
std::optional<attribution_reporting::SuitableOrigin>
|
||||
TopFrameOriginForSecureContext();
|
||||
|
||||
AttributionInputEvent GetMostRecentNavigationInputEvent() const;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
@ -36,7 +37,6 @@
|
||||
#include "mojo/public/cpp/test_support/test_utils.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/permissions_policy/origin_with_possible_wildcards.h"
|
||||
#include "third_party/blink/public/common/permissions_policy/permissions_policy_declaration.h"
|
||||
@ -135,7 +135,7 @@ class AttributionHostTest : public RenderViewHostTestHarness {
|
||||
blink::mojom::PermissionsPolicyFeature::kAttributionReporting,
|
||||
/*allowed_origins=*/
|
||||
{*blink::OriginWithPossibleWildcards::FromOrigin(allowed_origin)},
|
||||
/*self_if_matches=*/absl::nullopt,
|
||||
/*self_if_matches=*/std::nullopt,
|
||||
/*matches_all_origins=*/false, /*matches_opaque_src=*/false)};
|
||||
}
|
||||
|
||||
@ -785,7 +785,7 @@ TEST_F(AttributionHostTest, FencedFrameReportingBeacon_FeaturePolicyChecked) {
|
||||
fenced_frame = simulator->GetFinalRenderFrameHost();
|
||||
|
||||
EXPECT_EQ(attribution_host()->NotifyFencedFrameReportingBeaconStarted(
|
||||
kBeaconId, /*navigation_id=*/absl::nullopt,
|
||||
kBeaconId, /*navigation_id=*/std::nullopt,
|
||||
static_cast<RenderFrameHostImpl*>(fenced_frame),
|
||||
"devtools-request-id"),
|
||||
test_case.expected);
|
||||
|
@ -12,7 +12,7 @@ namespace content {
|
||||
|
||||
AttributionInfo::AttributionInfo(
|
||||
base::Time time,
|
||||
absl::optional<uint64_t> debug_key,
|
||||
std::optional<uint64_t> debug_key,
|
||||
attribution_reporting::SuitableOrigin context_origin)
|
||||
: time(time),
|
||||
debug_key(debug_key),
|
||||
|
@ -7,17 +7,18 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/time/time.h"
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
// Contains information associated with a trigger.
|
||||
struct CONTENT_EXPORT AttributionInfo {
|
||||
AttributionInfo(base::Time time,
|
||||
absl::optional<uint64_t> debug_key,
|
||||
std::optional<uint64_t> debug_key,
|
||||
attribution_reporting::SuitableOrigin context_origin);
|
||||
~AttributionInfo();
|
||||
|
||||
@ -30,7 +31,7 @@ struct CONTENT_EXPORT AttributionInfo {
|
||||
// The time the trigger occurred.
|
||||
base::Time time;
|
||||
|
||||
absl::optional<uint64_t> debug_key;
|
||||
std::optional<uint64_t> debug_key;
|
||||
|
||||
// The secondary owner of the reports generated by the trigger. For real
|
||||
// reports, this is the destination origin. For fake reports, it is the source
|
||||
|
@ -2,11 +2,10 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "content/browser/attribution_reporting/attribution_internals_ui.h"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@ -23,6 +22,7 @@
|
||||
#include "components/attribution_reporting/trigger_registration.h"
|
||||
#include "content/browser/attribution_reporting/attribution_debug_report.h"
|
||||
#include "content/browser/attribution_reporting/attribution_input_event.h"
|
||||
#include "content/browser/attribution_reporting/attribution_internals_ui.h"
|
||||
#include "content/browser/attribution_reporting/attribution_manager.h"
|
||||
#include "content/browser/attribution_reporting/attribution_os_level_manager.h"
|
||||
#include "content/browser/attribution_reporting/attribution_report.h"
|
||||
@ -54,7 +54,6 @@
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "services/network/public/cpp/trigger_verification.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
namespace content {
|
||||
@ -673,7 +672,7 @@ IN_PROC_BROWSER_TEST_F(AttributionInternalsWebUiBrowserTest,
|
||||
.SetPriority(11)
|
||||
.Build(),
|
||||
/*new_event_level_report=*/IrreleventEventLevelReport(),
|
||||
/*new_aggregatable_report=*/absl::nullopt,
|
||||
/*new_aggregatable_report=*/std::nullopt,
|
||||
/*source=*/SourceBuilder().BuildStored()));
|
||||
|
||||
{
|
||||
@ -1203,14 +1202,14 @@ IN_PROC_BROWSER_TEST_F(AttributionInternalsWebUiBrowserTest,
|
||||
[&](const AttributionTrigger& trigger,
|
||||
AttributionTrigger::EventLevelResult event_status,
|
||||
AttributionTrigger::AggregatableResult aggregatable_status,
|
||||
absl::optional<uint64_t> cleared_debug_key = absl::nullopt) {
|
||||
std::optional<uint64_t> cleared_debug_key = std::nullopt) {
|
||||
static int offset_hours = 0;
|
||||
manager()->NotifyTriggerHandled(
|
||||
trigger,
|
||||
CreateReportResult(
|
||||
/*trigger_time=*/now + base::Hours(++offset_hours),
|
||||
event_status, aggregatable_status,
|
||||
/*replaced_event_level_report=*/absl::nullopt,
|
||||
/*replaced_event_level_report=*/std::nullopt,
|
||||
/*new_event_level_report=*/IrreleventEventLevelReport(),
|
||||
/*new_aggregatable_report=*/IrreleventAggregatableReport(),
|
||||
/*source=*/SourceBuilder().BuildStored()),
|
||||
@ -1468,11 +1467,10 @@ IN_PROC_BROWSER_TEST_F(AttributionInternalsWebUiBrowserTest,
|
||||
VerboseDebugReport) {
|
||||
ASSERT_TRUE(NavigateToURL(shell(), GURL(kAttributionInternalsUrl)));
|
||||
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/true,
|
||||
StoreSourceResult(StoreSourceResult::InternalError()));
|
||||
std::optional<AttributionDebugReport> report = AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/true,
|
||||
StoreSourceResult(StoreSourceResult::InternalError()));
|
||||
ASSERT_TRUE(report);
|
||||
|
||||
static constexpr char kScript[] = R"(
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <iterator>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -51,7 +52,6 @@
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/base/net_errors.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
@ -331,7 +331,7 @@ attribution_internals::mojom::WebUIRegistrationPtr GetRegistration(
|
||||
const attribution_reporting::SuitableOrigin& context_origin,
|
||||
const attribution_reporting::SuitableOrigin& reporting_origin,
|
||||
std::string registration_json,
|
||||
absl::optional<uint64_t> cleared_debug_key) {
|
||||
std::optional<uint64_t> cleared_debug_key) {
|
||||
auto reg = attribution_internals::mojom::WebUIRegistration::New();
|
||||
reg->time = time.InMillisecondsFSinceUnixEpoch();
|
||||
reg->context_origin = context_origin;
|
||||
@ -346,7 +346,7 @@ attribution_internals::mojom::WebUIRegistrationPtr GetRegistration(
|
||||
void AttributionInternalsHandlerImpl::OnSourceHandled(
|
||||
const StorableSource& source,
|
||||
base::Time source_time,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
attribution_reporting::mojom::StoreSourceResult result) {
|
||||
auto web_ui_source = WebUISourceRegistration::New();
|
||||
web_ui_source->registration =
|
||||
@ -429,7 +429,7 @@ void AttributionInternalsHandlerImpl::OnOsRegistration(
|
||||
|
||||
void AttributionInternalsHandlerImpl::OnTriggerHandled(
|
||||
const AttributionTrigger& trigger,
|
||||
const absl::optional<uint64_t> cleared_debug_key,
|
||||
const std::optional<uint64_t> cleared_debug_key,
|
||||
const CreateReportResult& result) {
|
||||
const attribution_reporting::TriggerRegistration& registration =
|
||||
trigger.registration();
|
||||
@ -447,7 +447,7 @@ void AttributionInternalsHandlerImpl::OnTriggerHandled(
|
||||
|
||||
observer_->OnTriggerHandled(std::move(web_ui_trigger));
|
||||
|
||||
if (const absl::optional<AttributionReport>& report =
|
||||
if (const std::optional<AttributionReport>& report =
|
||||
result.replaced_event_level_report()) {
|
||||
DCHECK_EQ(
|
||||
result.event_level_status(),
|
||||
|
@ -63,7 +63,7 @@ class AttributionInternalsHandlerImpl
|
||||
void OnSourceHandled(
|
||||
const StorableSource& source,
|
||||
base::Time source_time,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
attribution_reporting::mojom::StoreSourceResult) override;
|
||||
void OnReportSent(const AttributionReport& report,
|
||||
bool is_debug_report,
|
||||
@ -72,7 +72,7 @@ class AttributionInternalsHandlerImpl
|
||||
int status,
|
||||
base::Time) override;
|
||||
void OnTriggerHandled(const AttributionTrigger& trigger,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
const CreateReportResult& result) override;
|
||||
void OnOsRegistration(
|
||||
base::Time time,
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@ -28,7 +29,6 @@
|
||||
#include "components/attribution_reporting/test_utils.h"
|
||||
#include "content/browser/attribution_reporting/attribution_config.h"
|
||||
#include "content/browser/attribution_reporting/attribution_reporting.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
namespace content {
|
||||
@ -154,7 +154,7 @@ class AttributionInteropParser {
|
||||
AttributionInteropOutput output;
|
||||
|
||||
{
|
||||
absl::optional<base::Value> reports = dict.Extract(kReportsKey);
|
||||
std::optional<base::Value> reports = dict.Extract(kReportsKey);
|
||||
auto context = PushContext(kReportsKey);
|
||||
ParseListOfDicts(base::OptionalToPtr(reports),
|
||||
[&](base::Value::Dict report) {
|
||||
@ -163,7 +163,7 @@ class AttributionInteropParser {
|
||||
}
|
||||
|
||||
{
|
||||
absl::optional<base::Value> regs =
|
||||
std::optional<base::Value> regs =
|
||||
dict.Extract(kUnparsableRegistrationsKey);
|
||||
auto context = PushContext(kUnparsableRegistrationsKey);
|
||||
ParseListOfDicts(base::OptionalToPtr(regs), [&](base::Value::Dict reg) {
|
||||
@ -315,7 +315,7 @@ class AttributionInteropParser {
|
||||
void VerifyReportingOrigin(const base::Value::Dict& dict,
|
||||
const SuitableOrigin& reporting_origin) {
|
||||
static constexpr char kUrlKey[] = "url";
|
||||
absl::optional<SuitableOrigin> origin = ParseOrigin(dict, kUrlKey);
|
||||
std::optional<SuitableOrigin> origin = ParseOrigin(dict, kUrlKey);
|
||||
if (has_error_) {
|
||||
return;
|
||||
}
|
||||
@ -333,9 +333,9 @@ class AttributionInteropParser {
|
||||
: events.back().time,
|
||||
/*strictly_greater=*/true);
|
||||
|
||||
absl::optional<SuitableOrigin> context_origin;
|
||||
absl::optional<SuitableOrigin> reporting_origin;
|
||||
absl::optional<SourceType> source_type;
|
||||
std::optional<SuitableOrigin> context_origin;
|
||||
std::optional<SuitableOrigin> reporting_origin;
|
||||
std::optional<SourceType> source_type;
|
||||
|
||||
ParseDict(dict, kRegistrationRequestKey, [&](base::Value::Dict reg_req) {
|
||||
context_origin = ParseOrigin(reg_req, "context_origin");
|
||||
@ -364,10 +364,10 @@ class AttributionInteropParser {
|
||||
|
||||
ParseDict(
|
||||
response, kResponseKey, [&](base::Value::Dict response_dict) {
|
||||
absl::optional<base::Value> source = response_dict.Extract(
|
||||
std::optional<base::Value> source = response_dict.Extract(
|
||||
"Attribution-Reporting-Register-Source");
|
||||
|
||||
absl::optional<base::Value> trigger = response_dict.Extract(
|
||||
std::optional<base::Value> trigger = response_dict.Extract(
|
||||
"Attribution-Reporting-Register-Trigger");
|
||||
|
||||
if (source.has_value() == trigger.has_value()) {
|
||||
@ -419,7 +419,7 @@ class AttributionInteropParser {
|
||||
/*strictly_greater=*/false);
|
||||
dict.Remove(kReportTimeKey);
|
||||
|
||||
if (absl::optional<base::Value> url = dict.Extract(kReportUrlKey);
|
||||
if (std::optional<base::Value> url = dict.Extract(kReportUrlKey);
|
||||
const std::string* str = url ? url->GetIfString() : nullptr) {
|
||||
report.url = GURL(*str);
|
||||
}
|
||||
@ -428,7 +428,7 @@ class AttributionInteropParser {
|
||||
*Error() << "must be a valid URL";
|
||||
}
|
||||
|
||||
if (absl::optional<base::Value> payload = dict.Extract(kPayloadKey)) {
|
||||
if (std::optional<base::Value> payload = dict.Extract(kPayloadKey)) {
|
||||
report.payload = std::move(*payload);
|
||||
} else {
|
||||
auto context = PushContext(kPayloadKey);
|
||||
@ -456,7 +456,7 @@ class AttributionInteropParser {
|
||||
dict.Remove(kTimeKey);
|
||||
|
||||
{
|
||||
absl::optional<base::Value> type = dict.Extract(kTypeKey);
|
||||
std::optional<base::Value> type = dict.Extract(kTypeKey);
|
||||
bool ok = false;
|
||||
|
||||
if (const std::string* str = type ? type->GetIfString() : nullptr) {
|
||||
@ -490,11 +490,11 @@ class AttributionInteropParser {
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<SuitableOrigin> ParseOrigin(const base::Value::Dict& dict,
|
||||
base::StringPiece key) {
|
||||
std::optional<SuitableOrigin> ParseOrigin(const base::Value::Dict& dict,
|
||||
base::StringPiece key) {
|
||||
auto context = PushContext(key);
|
||||
|
||||
absl::optional<SuitableOrigin> origin;
|
||||
std::optional<SuitableOrigin> origin;
|
||||
if (const std::string* s = dict.FindString(key)) {
|
||||
origin = SuitableOrigin::Deserialize(*s);
|
||||
}
|
||||
@ -532,18 +532,18 @@ class AttributionInteropParser {
|
||||
return base::Time();
|
||||
}
|
||||
|
||||
absl::optional<bool> ParseBool(const base::Value::Dict& dict,
|
||||
base::StringPiece key) {
|
||||
std::optional<bool> ParseBool(const base::Value::Dict& dict,
|
||||
base::StringPiece key) {
|
||||
auto context = PushContext(key);
|
||||
|
||||
const base::Value* v = dict.Find(key);
|
||||
if (!v) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (!v->is_bool()) {
|
||||
*Error() << "must be a bool";
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return v->GetBool();
|
||||
@ -553,13 +553,13 @@ class AttributionInteropParser {
|
||||
return ParseBool(dict, "debug_permission").value_or(false);
|
||||
}
|
||||
|
||||
absl::optional<SourceType> ParseSourceType(const base::Value::Dict& dict) {
|
||||
std::optional<SourceType> ParseSourceType(const base::Value::Dict& dict) {
|
||||
static constexpr char kNavigation[] = "navigation";
|
||||
static constexpr char kEvent[] = "event";
|
||||
|
||||
const std::string* v = dict.FindString(kSourceTypeKey);
|
||||
if (!v) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (*v == kNavigation) {
|
||||
@ -570,7 +570,7 @@ class AttributionInteropParser {
|
||||
auto context = PushContext(kSourceTypeKey);
|
||||
*Error() << "must be either \"" << kNavigation << "\" or \"" << kEvent
|
||||
<< "\"";
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_INTEROP_PARSER_H_
|
||||
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -16,7 +17,6 @@
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
#include "content/browser/attribution_reporting/attribution_config.h"
|
||||
#include "content/browser/attribution_reporting/attribution_reporting.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace content {
|
||||
@ -25,7 +25,7 @@ struct AttributionSimulationEvent {
|
||||
attribution_reporting::SuitableOrigin reporting_origin;
|
||||
attribution_reporting::SuitableOrigin context_origin;
|
||||
// If null, the event represents a trigger. Otherwise, represents a source.
|
||||
absl::optional<attribution_reporting::mojom::SourceType> source_type;
|
||||
std::optional<attribution_reporting::mojom::SourceType> source_type;
|
||||
base::Value registration;
|
||||
base::Time time;
|
||||
bool debug_permission = false;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -24,7 +25,6 @@
|
||||
#include "content/browser/attribution_reporting/attribution_test_utils.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
namespace content {
|
||||
@ -151,7 +151,7 @@ TEST(AttributionInteropParserTest, ValidTriggerParses) {
|
||||
*SuitableOrigin::Deserialize("https://a.r.test"));
|
||||
EXPECT_EQ(result.front().context_origin,
|
||||
*SuitableOrigin::Deserialize("https://b.d.test"));
|
||||
EXPECT_EQ(result.front().source_type, absl::nullopt);
|
||||
EXPECT_EQ(result.front().source_type, std::nullopt);
|
||||
EXPECT_EQ(result.front().registration, base::Value(789));
|
||||
EXPECT_TRUE(result.front().debug_permission);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -62,7 +63,6 @@
|
||||
#include "content/public/test/browser_task_environment.h"
|
||||
#include "content/public/test/test_browser_context.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/mojom/conversions/attribution_data_host.mojom.h"
|
||||
#include "url/gurl.h"
|
||||
@ -97,15 +97,15 @@ class AttributionReportConverter {
|
||||
// and therefore are sources of nondeterminism in the output.
|
||||
|
||||
// Output attribution_destination from the shared_info field.
|
||||
if (absl::optional<base::Value> shared_info =
|
||||
if (std::optional<base::Value> shared_info =
|
||||
report_body.Extract("shared_info");
|
||||
shared_info.has_value() && shared_info->is_string()) {
|
||||
if (absl::optional<base::Value> shared_info_value =
|
||||
if (std::optional<base::Value> shared_info_value =
|
||||
base::JSONReader::Read(shared_info->GetString(),
|
||||
base::JSON_PARSE_RFC)) {
|
||||
static constexpr char kKeyAttributionDestination[] =
|
||||
"attribution_destination";
|
||||
if (absl::optional<base::Value> attribution_destination =
|
||||
if (std::optional<base::Value> attribution_destination =
|
||||
shared_info_value->GetDict().Extract(
|
||||
kKeyAttributionDestination)) {
|
||||
report_body.Set(kKeyAttributionDestination,
|
||||
|
@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -24,7 +25,6 @@
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
@ -139,10 +139,10 @@ TEST_P(AttributionInteropTest, HasExpectedOutput) {
|
||||
attribution_reporting::ScopedMaxEventLevelEpsilonForTesting
|
||||
scoped_max_event_level_epsilon(config.max_event_level_epsilon);
|
||||
|
||||
absl::optional<base::Value> input = dict.Extract("input");
|
||||
std::optional<base::Value> input = dict.Extract("input");
|
||||
ASSERT_TRUE(input && input->is_dict());
|
||||
|
||||
absl::optional<base::Value> output = dict.Extract("output");
|
||||
std::optional<base::Value> output = dict.Extract("output");
|
||||
ASSERT_TRUE(output && output->is_dict());
|
||||
|
||||
ASSERT_OK_AND_ASSIGN(
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_MANAGER_H_
|
||||
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_MANAGER_H_
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "base/functional/callback_forward.h"
|
||||
@ -13,7 +14,6 @@
|
||||
#include "content/public/browser/attribution_data_model.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "services/network/public/mojom/attribution.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
class Time;
|
||||
@ -102,9 +102,9 @@ class CONTENT_EXPORT AttributionManager : public AttributionDataModel {
|
||||
base::OnceClosure done) = 0;
|
||||
|
||||
// If debug mode is enabled, noise and delays are disabled to facilitate
|
||||
// testing, whether automated or manual. If `enabled` is `absl::nullopt`,
|
||||
// testing, whether automated or manual. If `enabled` is `std::nullopt`,
|
||||
// falls back to `switches::kAttributionReportingDebugMode`.
|
||||
virtual void SetDebugMode(absl::optional<bool> enabled,
|
||||
virtual void SetDebugMode(std::optional<bool> enabled,
|
||||
base::OnceClosure done) = 0;
|
||||
};
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "content/browser/attribution_reporting/attribution_manager_impl.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -82,7 +83,6 @@
|
||||
#include "services/network/public/mojom/attribution.mojom.h"
|
||||
#include "services/network/public/mojom/network_change_manager.mojom-forward.h"
|
||||
#include "storage/browser/quota/special_storage_policy.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/storage_key/storage_key.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
@ -150,7 +150,7 @@ class AttributionReportScheduler : public ReportSchedulerTimer::Delegate {
|
||||
private:
|
||||
// ReportSchedulerTimer::Delegate:
|
||||
void GetNextReportTime(
|
||||
base::OnceCallback<void(absl::optional<base::Time>)> callback,
|
||||
base::OnceCallback<void(std::optional<base::Time>)> callback,
|
||||
base::Time now) override {
|
||||
attribution_storage_->AsyncCall(&AttributionStorage::GetNextReportTime)
|
||||
.WithArgs(now)
|
||||
@ -161,7 +161,7 @@ class AttributionReportScheduler : public ReportSchedulerTimer::Delegate {
|
||||
send_reports_.Run();
|
||||
}
|
||||
void AdjustOfflineReportTimes(
|
||||
base::OnceCallback<void(absl::optional<base::Time>)> maybe_set_timer_cb)
|
||||
base::OnceCallback<void(std::optional<base::Time>)> maybe_set_timer_cb)
|
||||
override {
|
||||
// Add delay to all reports that should have been sent while the browser was
|
||||
// offline so they are not temporally joinable. We do this in storage to
|
||||
@ -432,7 +432,7 @@ struct AttributionManagerImpl::SourceOrTriggerRFH {
|
||||
GlobalRenderFrameHostId rfh_id;
|
||||
};
|
||||
|
||||
absl::optional<base::TimeDelta> GetFailedReportDelay(int failed_send_attempts) {
|
||||
std::optional<base::TimeDelta> GetFailedReportDelay(int failed_send_attempts) {
|
||||
DCHECK_GT(failed_send_attempts, 0);
|
||||
|
||||
const int kMaxFailedSendAttempts = 2;
|
||||
@ -440,7 +440,7 @@ absl::optional<base::TimeDelta> GetFailedReportDelay(int failed_send_attempts) {
|
||||
const int kDelayFactor = 3;
|
||||
|
||||
if (failed_send_attempts > kMaxFailedSendAttempts) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return kInitialReportDelay * std::pow(kDelayFactor, failed_send_attempts - 1);
|
||||
@ -625,7 +625,7 @@ void AttributionManagerImpl::RecordPendingAggregatableReportsTimings() {
|
||||
|
||||
void AttributionManagerImpl::OnSourceStored(
|
||||
const StorableSource& source,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
bool is_debug_cookie_set,
|
||||
StoreSourceResult result) {
|
||||
CHECK(IsReady());
|
||||
@ -657,10 +657,10 @@ void AttributionManagerImpl::HandleTrigger(
|
||||
|
||||
void AttributionManagerImpl::StoreTrigger(AttributionTrigger trigger,
|
||||
bool is_debug_cookie_set) {
|
||||
absl::optional<uint64_t> cleared_debug_key;
|
||||
std::optional<uint64_t> cleared_debug_key;
|
||||
if (!is_debug_cookie_set) {
|
||||
cleared_debug_key =
|
||||
std::exchange(trigger.registration().debug_key, absl::nullopt);
|
||||
std::exchange(trigger.registration().debug_key, std::nullopt);
|
||||
}
|
||||
|
||||
attribution_storage_.AsyncCall(&AttributionStorage::MaybeCreateAndStoreReport)
|
||||
@ -776,7 +776,7 @@ void AttributionManagerImpl::ProcessNextEvent(bool registration_allowed,
|
||||
StoreSource(std::move(source), is_debug_cookie_set);
|
||||
} else {
|
||||
OnSourceStored(source,
|
||||
/*cleared_debug_key=*/absl::nullopt,
|
||||
/*cleared_debug_key=*/std::nullopt,
|
||||
/*is_debug_cookie_set=*/false,
|
||||
StoreSourceResult::ProhibitedByBrowserPolicy());
|
||||
}
|
||||
@ -786,7 +786,7 @@ void AttributionManagerImpl::ProcessNextEvent(bool registration_allowed,
|
||||
StoreTrigger(std::move(trigger), is_debug_cookie_set);
|
||||
} else {
|
||||
OnReportStored(trigger,
|
||||
/*cleared_debug_key=*/absl::nullopt,
|
||||
/*cleared_debug_key=*/std::nullopt,
|
||||
/*is_debug_cookie_set=*/false,
|
||||
CreateReportResult(
|
||||
/*trigger_time=*/base::Time::Now(),
|
||||
@ -804,10 +804,10 @@ void AttributionManagerImpl::ProcessNextEvent(bool registration_allowed,
|
||||
|
||||
void AttributionManagerImpl::StoreSource(StorableSource source,
|
||||
bool is_debug_cookie_set) {
|
||||
absl::optional<uint64_t> cleared_debug_key;
|
||||
std::optional<uint64_t> cleared_debug_key;
|
||||
if (!is_debug_cookie_set) {
|
||||
cleared_debug_key =
|
||||
std::exchange(source.registration().debug_key, absl::nullopt);
|
||||
std::exchange(source.registration().debug_key, std::nullopt);
|
||||
}
|
||||
|
||||
attribution_storage_.AsyncCall(&AttributionStorage::StoreSource)
|
||||
@ -839,14 +839,14 @@ void AttributionManagerImpl::AddPendingAggregatableReportTiming(
|
||||
|
||||
void AttributionManagerImpl::OnReportStored(
|
||||
const AttributionTrigger& trigger,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
bool is_debug_cookie_set,
|
||||
CreateReportResult result) {
|
||||
CHECK(IsReady());
|
||||
|
||||
RecordCreateReportStatus(result);
|
||||
|
||||
absl::optional<base::Time> min_new_report_time;
|
||||
std::optional<base::Time> min_new_report_time;
|
||||
|
||||
if (auto& report = result.new_event_level_report()) {
|
||||
min_new_report_time = report->report_time();
|
||||
@ -1152,13 +1152,13 @@ void AttributionManagerImpl::OnReportSent(base::OnceClosure done,
|
||||
// update the report's DB state to reflect that. Otherwise, delete the report
|
||||
// from storage.
|
||||
|
||||
absl::optional<base::Time> new_report_time;
|
||||
std::optional<base::Time> new_report_time;
|
||||
// TODO(linnan): Retry on transient assembly failure isn't privacy sensitive,
|
||||
// therefore we could consider subjecting these failures to a different limit.
|
||||
if (info.status == SendResult::Status::kTransientFailure ||
|
||||
info.status == SendResult::Status::kTransientAssemblyFailure) {
|
||||
int retry_attempts = report.failed_send_attempts() + 1;
|
||||
if (absl::optional<base::TimeDelta> delay =
|
||||
if (std::optional<base::TimeDelta> delay =
|
||||
GetFailedReportDelay(retry_attempts)) {
|
||||
new_report_time = base::Time::Now() + *delay;
|
||||
} else {
|
||||
@ -1184,7 +1184,7 @@ void AttributionManagerImpl::OnReportSent(base::OnceClosure done,
|
||||
base::OnceCallback then = base::BindOnce(
|
||||
[](base::OnceClosure done, base::WeakPtr<AttributionManagerImpl> manager,
|
||||
AttributionReport::Id report_id,
|
||||
absl::optional<base::Time> new_report_time, bool success) {
|
||||
std::optional<base::Time> new_report_time, bool success) {
|
||||
if (done) {
|
||||
std::move(done).Run();
|
||||
}
|
||||
@ -1254,7 +1254,7 @@ void AttributionManagerImpl::AssembleAggregatableReport(
|
||||
return;
|
||||
}
|
||||
|
||||
absl::optional<AggregatableReportRequest> request =
|
||||
std::optional<AggregatableReportRequest> request =
|
||||
CreateAggregatableReportRequest(report);
|
||||
if (!request.has_value()) {
|
||||
RecordAssembleAggregatableReportStatus(
|
||||
@ -1276,7 +1276,7 @@ void AttributionManagerImpl::OnAggregatableReportAssembled(
|
||||
bool is_debug_report,
|
||||
ReportSentCallback callback,
|
||||
AggregatableReportRequest,
|
||||
absl::optional<AggregatableReport> assembled_report,
|
||||
std::optional<AggregatableReport> assembled_report,
|
||||
AggregationService::AssemblyStatus) {
|
||||
if (!assembled_report.has_value()) {
|
||||
RecordAssembleAggregatableReportStatus(
|
||||
@ -1338,7 +1338,7 @@ void AttributionManagerImpl::MaybeSendVerboseDebugReport(
|
||||
return;
|
||||
}
|
||||
|
||||
if (absl::optional<AttributionDebugReport> debug_report =
|
||||
if (std::optional<AttributionDebugReport> debug_report =
|
||||
AttributionDebugReport::Create(source, is_debug_cookie_set, result)) {
|
||||
report_sender_->SendReport(
|
||||
std::move(*debug_report),
|
||||
@ -1365,7 +1365,7 @@ void AttributionManagerImpl::MaybeSendVerboseDebugReport(
|
||||
return;
|
||||
}
|
||||
|
||||
if (absl::optional<AttributionDebugReport> debug_report =
|
||||
if (std::optional<AttributionDebugReport> debug_report =
|
||||
AttributionDebugReport::Create(trigger, is_debug_cookie_set,
|
||||
result)) {
|
||||
report_sender_->SendReport(
|
||||
@ -1531,7 +1531,7 @@ void AttributionManagerImpl::OnOsRegistration(
|
||||
: OsRegistrationResult::kRejectedByOs);
|
||||
}
|
||||
|
||||
void AttributionManagerImpl::SetDebugMode(absl::optional<bool> enabled,
|
||||
void AttributionManagerImpl::SetDebugMode(std::optional<bool> enabled,
|
||||
base::OnceClosure done) {
|
||||
bool debug_mode =
|
||||
enabled.value_or(base::CommandLine::ForCurrentProcess()->HasSwitch(
|
||||
@ -1577,7 +1577,7 @@ void AttributionManagerImpl::MaybeSendVerboseDebugReport(
|
||||
return;
|
||||
}
|
||||
|
||||
if (absl::optional<AttributionDebugReport> debug_report =
|
||||
if (std::optional<AttributionDebugReport> debug_report =
|
||||
AttributionDebugReport::Create(registration)) {
|
||||
report_sender_->SendReport(
|
||||
std::move(*debug_report),
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/circular_deque.h"
|
||||
@ -31,7 +32,6 @@
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/public/browser/privacy_sandbox_attestations_observer.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
namespace base {
|
||||
@ -134,7 +134,7 @@ class CONTENT_EXPORT AttributionManagerImpl
|
||||
BrowsingDataFilterBuilder* filter_builder,
|
||||
bool delete_rate_limit_data,
|
||||
base::OnceClosure done) override;
|
||||
void SetDebugMode(absl::optional<bool> enabled,
|
||||
void SetDebugMode(std::optional<bool> enabled,
|
||||
base::OnceClosure done) override;
|
||||
|
||||
void GetAllDataKeys(
|
||||
@ -197,16 +197,16 @@ class CONTENT_EXPORT AttributionManagerImpl
|
||||
bool is_debug_report,
|
||||
ReportSentCallback callback,
|
||||
AggregatableReportRequest,
|
||||
absl::optional<AggregatableReport> assembled_report,
|
||||
std::optional<AggregatableReport> assembled_report,
|
||||
AggregationService::AssemblyStatus);
|
||||
void MarkReportCompleted(AttributionReport::Id report_id);
|
||||
|
||||
void OnSourceStored(const StorableSource& source,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
bool is_debug_cookie_set,
|
||||
StoreSourceResult result);
|
||||
void OnReportStored(const AttributionTrigger& trigger,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
bool is_debug_cookie_set,
|
||||
CreateReportResult result);
|
||||
|
||||
@ -319,13 +319,13 @@ class CONTENT_EXPORT AttributionManagerImpl
|
||||
|
||||
// Gets the delay for a report that has failed to be sent
|
||||
// `failed_send_attempts` times.
|
||||
// Returns `absl::nullopt` to indicate that no more attempts should be made.
|
||||
// Returns `std::nullopt` to indicate that no more attempts should be made.
|
||||
// Otherwise, the return value must be positive. `failed_send_attempts` is
|
||||
// guaranteed to be positive.
|
||||
//
|
||||
// Exposed here for testing.
|
||||
CONTENT_EXPORT
|
||||
absl::optional<base::TimeDelta> GetFailedReportDelay(int failed_send_attempts);
|
||||
std::optional<base::TimeDelta> GetFailedReportDelay(int failed_send_attempts);
|
||||
|
||||
} // namespace content
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -80,7 +81,6 @@
|
||||
#include "storage/browser/test/mock_special_storage_policy.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -153,10 +153,10 @@ AggregatableReport CreateExampleAggregatableReport() {
|
||||
std::vector<AggregatableReport::AggregationServicePayload> payloads;
|
||||
payloads.emplace_back(/*payload=*/kABCD1234AsBytes,
|
||||
/*key_id=*/"key_1",
|
||||
/*debug_cleartext_payload=*/absl::nullopt);
|
||||
/*debug_cleartext_payload=*/std::nullopt);
|
||||
payloads.emplace_back(/*payload=*/kEFGH5678AsBytes,
|
||||
/*key_id=*/"key_2",
|
||||
/*debug_cleartext_payload=*/absl::nullopt);
|
||||
/*debug_cleartext_payload=*/std::nullopt);
|
||||
|
||||
base::Value::Dict additional_fields;
|
||||
additional_fields.Set("source_registration_time", "1234569600");
|
||||
@ -174,9 +174,9 @@ AggregatableReport CreateExampleAggregatableReport() {
|
||||
/*api_identifier=*/"attribution-reporting");
|
||||
|
||||
return AggregatableReport(std::move(payloads), shared_info.SerializeAsJson(),
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*additional_fields=*/{},
|
||||
/*aggregation_coordinator_origin=*/absl::nullopt);
|
||||
/*aggregation_coordinator_origin=*/std::nullopt);
|
||||
}
|
||||
|
||||
// Time after impression that a conversion can first be sent. See
|
||||
@ -929,7 +929,7 @@ TEST_F(AttributionManagerImplTest, TriggerHandled_ObserversNotified) {
|
||||
observer,
|
||||
OnTriggerHandled(
|
||||
_, _,
|
||||
AllOf(ReplacedEventLevelReportIs(absl::nullopt),
|
||||
AllOf(ReplacedEventLevelReportIs(std::nullopt),
|
||||
CreateReportEventLevelStatusIs(
|
||||
AttributionTrigger::EventLevelResult::kPriorityTooLow))));
|
||||
|
||||
@ -1297,7 +1297,7 @@ TEST_F(AttributionManagerImplTest, HandleOsTrigger) {
|
||||
|
||||
const OsRegistration registration1(
|
||||
kRegistrationUrl1, /*debug_reporting=*/false, kTopLevelOrigin1,
|
||||
/*input_event=*/absl::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*input_event=*/std::nullopt, /*is_within_fenced_frame=*/false,
|
||||
kFrameId);
|
||||
EXPECT_CALL(*os_level_manager_, Register(registration1,
|
||||
/*is_debug_key_allowed=*/true, _))
|
||||
@ -1305,7 +1305,7 @@ TEST_F(AttributionManagerImplTest, HandleOsTrigger) {
|
||||
|
||||
const OsRegistration registration2(
|
||||
kRegistrationUrl2, /*debug_reporting=*/false, kTopLevelOrigin2,
|
||||
/*input_event=*/absl::nullopt, /*is_within_fenced_frame=*/false,
|
||||
/*input_event=*/std::nullopt, /*is_within_fenced_frame=*/false,
|
||||
kFrameId);
|
||||
EXPECT_CALL(*os_level_manager_, Register(registration2,
|
||||
/*is_debug_key_allowed=*/false, _))
|
||||
@ -1327,7 +1327,7 @@ TEST_F(AttributionManagerImplTest, HandleOsTrigger) {
|
||||
*os_level_manager_,
|
||||
Register(OsRegistration(kRegistrationUrl3, /*debug_reporting=*/false,
|
||||
kTopLevelOrigin3,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId),
|
||||
_, _))
|
||||
.Times(0);
|
||||
@ -1337,22 +1337,22 @@ TEST_F(AttributionManagerImplTest, HandleOsTrigger) {
|
||||
*os_level_manager_,
|
||||
Register(OsRegistration(kRegistrationUrl4, /*debug_reporting=*/false,
|
||||
kTopLevelOrigin4,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId),
|
||||
_, _))
|
||||
.Times(0);
|
||||
|
||||
attribution_manager_->HandleOsRegistration(OsRegistration(
|
||||
kRegistrationUrl1, /*debug_reporting=*/false, kTopLevelOrigin1,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId));
|
||||
attribution_manager_->HandleOsRegistration(OsRegistration(
|
||||
kRegistrationUrl2, /*debug_reporting=*/false, kTopLevelOrigin2,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId));
|
||||
attribution_manager_->HandleOsRegistration(OsRegistration(
|
||||
kRegistrationUrl3, /*debug_reporting=*/false, kTopLevelOrigin3,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId));
|
||||
|
||||
ExpectOperationAllowed(
|
||||
@ -1405,15 +1405,15 @@ TEST_F(AttributionManagerImplTest, HandleOsTrigger) {
|
||||
|
||||
attribution_manager_->HandleOsRegistration(OsRegistration(
|
||||
kRegistrationUrl4, /*debug_reporting=*/false, kTopLevelOrigin4,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId));
|
||||
attribution_manager_->HandleOsRegistration(OsRegistration(
|
||||
kRegistrationUrl1, /*debug_reporting=*/false, kTopLevelOrigin1,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId));
|
||||
attribution_manager_->HandleOsRegistration(OsRegistration(
|
||||
kRegistrationUrl2, /*debug_reporting=*/false, kTopLevelOrigin2,
|
||||
/*input_event=*/absl::nullopt,
|
||||
/*input_event=*/std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId));
|
||||
|
||||
EXPECT_THAT(
|
||||
@ -1762,7 +1762,7 @@ TEST_F(AttributionManagerImplTest,
|
||||
|
||||
EXPECT_CALL(
|
||||
observer,
|
||||
OnSourceHandled(source, base::Time::Now(), testing::Eq(absl::nullopt),
|
||||
OnSourceHandled(source, base::Time::Now(), testing::Eq(std::nullopt),
|
||||
StorableSource::Result::kProhibitedByBrowserPolicy));
|
||||
|
||||
const auto source_origin =
|
||||
@ -2025,7 +2025,7 @@ TEST_F(AttributionManagerImplTest, TimeFromConversionToReportSendHistogram) {
|
||||
attribution_manager_->HandleTrigger(DefaultTrigger(), kFrameId);
|
||||
|
||||
ReportSentCallback report_sent_callback;
|
||||
absl::optional<AttributionReport> sent_report;
|
||||
std::optional<AttributionReport> sent_report;
|
||||
|
||||
EXPECT_CALL(*report_sender_, SendReport(_, /*is_debug_report=*/false, _))
|
||||
.WillOnce([&](AttributionReport report, bool is_debug_report,
|
||||
@ -2057,7 +2057,7 @@ TEST_F(AttributionManagerImplTest, ReportRetriesTillSuccessHistogram) {
|
||||
base::HistogramTester histograms;
|
||||
|
||||
ReportSentCallback report_sent_callback;
|
||||
absl::optional<AttributionReport> sent_report;
|
||||
std::optional<AttributionReport> sent_report;
|
||||
|
||||
Checkpoint checkpoint;
|
||||
{
|
||||
@ -2299,20 +2299,20 @@ namespace {
|
||||
|
||||
const struct {
|
||||
const char* name;
|
||||
absl::optional<uint64_t> input_debug_key;
|
||||
std::optional<uint64_t> input_debug_key;
|
||||
const char* reporting_origin;
|
||||
absl::optional<uint64_t> expected_debug_key;
|
||||
absl::optional<uint64_t> expected_cleared_key;
|
||||
std::optional<uint64_t> expected_debug_key;
|
||||
std::optional<uint64_t> expected_cleared_key;
|
||||
bool cookie_access_allowed;
|
||||
bool expected_debug_cookie_set;
|
||||
bool can_bypass = false;
|
||||
} kDebugKeyTestCases[] = {
|
||||
{
|
||||
"no debug key, no cookie",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
"https://r2.test",
|
||||
absl::nullopt,
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
std::nullopt,
|
||||
true,
|
||||
false,
|
||||
},
|
||||
@ -2320,17 +2320,17 @@ const struct {
|
||||
"has debug key, no cookie",
|
||||
123,
|
||||
"https://r2.test",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
123,
|
||||
true,
|
||||
false,
|
||||
},
|
||||
{
|
||||
"no debug key, has cookie",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
"https://r1.test",
|
||||
absl::nullopt,
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
std::nullopt,
|
||||
true,
|
||||
true,
|
||||
},
|
||||
@ -2339,7 +2339,7 @@ const struct {
|
||||
123,
|
||||
"https://r1.test",
|
||||
123,
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
true,
|
||||
true,
|
||||
},
|
||||
@ -2347,7 +2347,7 @@ const struct {
|
||||
"has debug key, no cookie access",
|
||||
123,
|
||||
"https://r1.test",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
123,
|
||||
false,
|
||||
false,
|
||||
@ -2357,7 +2357,7 @@ const struct {
|
||||
123,
|
||||
"https://r1.test",
|
||||
123,
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
false,
|
||||
true,
|
||||
true,
|
||||
@ -2494,7 +2494,7 @@ TEST_F(AttributionManagerImplTest, HandleTrigger_DebugKey) {
|
||||
kFrameId);
|
||||
EXPECT_THAT(
|
||||
StoredReports(),
|
||||
ElementsAre(AllOf(ReportSourceIs(SourceDebugKeyIs(absl::nullopt)),
|
||||
ElementsAre(AllOf(ReportSourceIs(SourceDebugKeyIs(std::nullopt)),
|
||||
TriggerDebugKeyIs(test_case.expected_debug_key))))
|
||||
<< test_case.name;
|
||||
|
||||
@ -2513,13 +2513,13 @@ TEST_F(AttributionManagerImplTest, DebugReport_SentImmediately) {
|
||||
|
||||
const struct {
|
||||
const char* name;
|
||||
absl::optional<uint64_t> source_debug_key;
|
||||
absl::optional<uint64_t> trigger_debug_key;
|
||||
std::optional<uint64_t> source_debug_key;
|
||||
std::optional<uint64_t> trigger_debug_key;
|
||||
bool send_expected;
|
||||
} kTestCases[] = {
|
||||
{"neither", absl::nullopt, absl::nullopt, false},
|
||||
{"source", 1, absl::nullopt, false},
|
||||
{"trigger", absl::nullopt, 1, false},
|
||||
{"neither", std::nullopt, std::nullopt, false},
|
||||
{"source", 1, std::nullopt, false},
|
||||
{"trigger", std::nullopt, 1, false},
|
||||
{"both", 1, 2, true},
|
||||
};
|
||||
|
||||
@ -2601,7 +2601,7 @@ TEST_F(AttributionManagerImplTest,
|
||||
const StorableSource source = SourceBuilder().Build();
|
||||
|
||||
EXPECT_CALL(observer, OnSourceHandled(source, base::Time::Now(),
|
||||
testing::Eq(absl::nullopt),
|
||||
testing::Eq(std::nullopt),
|
||||
StorableSource::Result::kSuccess));
|
||||
|
||||
attribution_manager_->HandleSource(source, kFrameId);
|
||||
@ -2789,7 +2789,7 @@ TEST_F(AttributionManagerImplTest,
|
||||
.WillOnce([](AggregatableReportRequest request,
|
||||
AggregationService::AssemblyCallback callback) {
|
||||
std::move(callback).Run(
|
||||
std::move(request), absl::nullopt,
|
||||
std::move(request), std::nullopt,
|
||||
AggregationService::AssemblyStatus::kAssemblyFailed);
|
||||
});
|
||||
EXPECT_CALL(checkpoint, Call(2));
|
||||
@ -2797,7 +2797,7 @@ TEST_F(AttributionManagerImplTest,
|
||||
.WillOnce([](AggregatableReportRequest request,
|
||||
AggregationService::AssemblyCallback callback) {
|
||||
std::move(callback).Run(
|
||||
std::move(request), absl::nullopt,
|
||||
std::move(request), std::nullopt,
|
||||
AggregationService::AssemblyStatus::kAssemblyFailed);
|
||||
});
|
||||
EXPECT_CALL(checkpoint, Call(3));
|
||||
@ -2805,7 +2805,7 @@ TEST_F(AttributionManagerImplTest,
|
||||
.WillOnce([](AggregatableReportRequest request,
|
||||
AggregationService::AssemblyCallback callback) {
|
||||
std::move(callback).Run(
|
||||
std::move(request), absl::nullopt,
|
||||
std::move(request), std::nullopt,
|
||||
AggregationService::AssemblyStatus::kAssemblyFailed);
|
||||
});
|
||||
}
|
||||
@ -2876,11 +2876,11 @@ TEST_F(AttributionManagerImplTest, AggregationServiceDisabled_ReportNotSent) {
|
||||
TEST_F(AttributionManagerImplTest, GetFailedReportDelay) {
|
||||
const struct {
|
||||
int failed_send_attempts;
|
||||
absl::optional<base::TimeDelta> expected;
|
||||
std::optional<base::TimeDelta> expected;
|
||||
} kTestCases[] = {
|
||||
{1, base::Minutes(5)},
|
||||
{2, base::Minutes(15)},
|
||||
{3, absl::nullopt},
|
||||
{3, std::nullopt},
|
||||
};
|
||||
|
||||
for (const auto& test_case : kTestCases) {
|
||||
@ -3160,7 +3160,7 @@ class AttributionManagerImplDebugReportTest
|
||||
TEST_F(AttributionManagerImplDebugReportTest, VerboseDebugReport_ReportSent) {
|
||||
base::HistogramTester histograms;
|
||||
|
||||
absl::optional<AttributionDebugReport> sent_report;
|
||||
std::optional<AttributionDebugReport> sent_report;
|
||||
|
||||
Checkpoint checkpoint;
|
||||
{
|
||||
@ -3473,9 +3473,9 @@ TEST_F(AttributionManagerImplTest,
|
||||
/*registration_url=*/GURL("https://a.test/x"),
|
||||
/*debug_reporting=*/true,
|
||||
/*top_level_origin=*/url::Origin::Create(GURL("https://b.test")),
|
||||
is_os_source ? absl::make_optional<AttributionInputEvent>(
|
||||
AttributionInputEvent())
|
||||
: absl::nullopt,
|
||||
is_os_source
|
||||
? std::make_optional<AttributionInputEvent>(AttributionInputEvent())
|
||||
: std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId);
|
||||
|
||||
EXPECT_CALL(*os_level_manager_, Register)
|
||||
@ -3508,9 +3508,9 @@ TEST_F(AttributionManagerImplTest,
|
||||
kRegistrationUrl, /*debug_reporting=*/true,
|
||||
/*top_level_origin=*/url::Origin::Create(GURL("https://b.test")),
|
||||
/*input_event=*/
|
||||
is_os_source ? absl::make_optional<AttributionInputEvent>(
|
||||
AttributionInputEvent())
|
||||
: absl::nullopt,
|
||||
is_os_source
|
||||
? std::make_optional<AttributionInputEvent>(AttributionInputEvent())
|
||||
: std::nullopt,
|
||||
/*is_within_fenced_frame=*/false, kFrameId);
|
||||
|
||||
EXPECT_CALL(*report_sender_, SendReport(_, _)).Times(0);
|
||||
|
@ -7,11 +7,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/observer_list_types.h"
|
||||
#include "base/time/time.h"
|
||||
#include "content/browser/attribution_reporting/attribution_reporting.mojom-forward.h"
|
||||
#include "content/browser/attribution_reporting/store_source_result.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
@ -40,7 +41,7 @@ class AttributionObserver : public base::CheckedObserver {
|
||||
virtual void OnSourceHandled(
|
||||
const StorableSource& source,
|
||||
base::Time source_time,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
attribution_reporting::mojom::StoreSourceResult) {}
|
||||
|
||||
// Called when a report is sent, regardless of success, but not for attempts
|
||||
@ -58,7 +59,7 @@ class AttributionObserver : public base::CheckedObserver {
|
||||
|
||||
// Called when a trigger is registered, regardless of success.
|
||||
virtual void OnTriggerHandled(const AttributionTrigger& trigger,
|
||||
absl::optional<uint64_t> cleared_debug_key,
|
||||
std::optional<uint64_t> cleared_debug_key,
|
||||
const CreateReportResult& result) {}
|
||||
|
||||
// Called when an OS source or trigger registration is handled, regardless of
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "content/browser/attribution_reporting/attribution_os_level_manager.h"
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/dcheck_is_on.h"
|
||||
@ -18,7 +19,6 @@
|
||||
#include "content/public/browser/global_routing_id.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
@ -39,7 +39,7 @@ const base::SequenceChecker& GetSequenceChecker() {
|
||||
// This flag is per device and can only be changed by the OS. Currently we don't
|
||||
// observe setting changes on the device and the flag is only initialized once
|
||||
// on startup. The value may vary in tests.
|
||||
absl::optional<ApiState> g_state GUARDED_BY_CONTEXT(GetSequenceChecker());
|
||||
std::optional<ApiState> g_state GUARDED_BY_CONTEXT(GetSequenceChecker());
|
||||
|
||||
} // namespace
|
||||
|
||||
@ -78,7 +78,7 @@ ApiState AttributionOsLevelManager::GetApiState() {
|
||||
}
|
||||
|
||||
// static
|
||||
void AttributionOsLevelManager::SetApiState(absl::optional<ApiState> state) {
|
||||
void AttributionOsLevelManager::SetApiState(std::optional<ApiState> state) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(GetSequenceChecker());
|
||||
|
||||
ApiState old_state = GetApiState();
|
||||
@ -96,7 +96,7 @@ void AttributionOsLevelManager::SetApiState(absl::optional<ApiState> state) {
|
||||
}
|
||||
|
||||
ScopedApiStateForTesting::ScopedApiStateForTesting(
|
||||
absl::optional<ApiState> state)
|
||||
std::optional<ApiState> state)
|
||||
: previous_(g_state) {
|
||||
SetApiState(state);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_OS_LEVEL_MANAGER_H_
|
||||
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_OS_LEVEL_MANAGER_H_
|
||||
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
@ -12,7 +13,6 @@
|
||||
#include "content/common/content_export.h"
|
||||
#include "content/public/browser/browsing_data_filter_builder.h"
|
||||
#include "content/public/browser/content_browser_client.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
class Time;
|
||||
@ -35,7 +35,7 @@ class CONTENT_EXPORT AttributionOsLevelManager {
|
||||
|
||||
class CONTENT_EXPORT ScopedApiStateForTesting {
|
||||
public:
|
||||
explicit ScopedApiStateForTesting(absl::optional<ApiState>);
|
||||
explicit ScopedApiStateForTesting(std::optional<ApiState>);
|
||||
~ScopedApiStateForTesting();
|
||||
|
||||
ScopedApiStateForTesting(const ScopedApiStateForTesting&) = delete;
|
||||
@ -46,11 +46,11 @@ class CONTENT_EXPORT AttributionOsLevelManager {
|
||||
ScopedApiStateForTesting& operator=(ScopedApiStateForTesting&&) = delete;
|
||||
|
||||
private:
|
||||
const absl::optional<ApiState> previous_;
|
||||
const std::optional<ApiState> previous_;
|
||||
};
|
||||
|
||||
static ApiState GetApiState();
|
||||
static void SetApiState(absl::optional<ApiState>);
|
||||
static void SetApiState(std::optional<ApiState>);
|
||||
|
||||
virtual ~AttributionOsLevelManager() = default;
|
||||
|
||||
|
@ -145,7 +145,7 @@ void AttributionOsLevelManagerAndroid::Register(OsRegistration registration,
|
||||
url::GURLAndroid::FromNativeGURL(env, registration.registration_url);
|
||||
auto top_level_origin = url::GURLAndroid::FromNativeGURL(
|
||||
env, registration.top_level_origin.GetURL());
|
||||
absl::optional<AttributionInputEvent> input_event = registration.input_event;
|
||||
std::optional<AttributionInputEvent> input_event = registration.input_event;
|
||||
|
||||
int request_id = next_callback_id_++;
|
||||
pending_registration_callbacks_.emplace(
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "content/browser/attribution_reporting/attribution_os_level_manager_android.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
@ -23,7 +24,6 @@
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -51,10 +51,10 @@ TEST_F(AttributionOsLevelManagerAndroidTest, GetMeasurementStatusTimeMetric) {
|
||||
TEST_F(AttributionOsLevelManagerAndroidTest, Register) {
|
||||
const struct {
|
||||
const char* desc;
|
||||
absl::optional<AttributionInputEvent> input_event;
|
||||
std::optional<AttributionInputEvent> input_event;
|
||||
bool should_use_os_web_source;
|
||||
} kTestCases[] = {
|
||||
{"trigger", absl::nullopt, false},
|
||||
{"trigger", std::nullopt, false},
|
||||
{"os-source", AttributionInputEvent(), false},
|
||||
{"web-source", AttributionInputEvent(), true},
|
||||
};
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -21,7 +22,6 @@
|
||||
#include "content/browser/attribution_reporting/common_source_info.h"
|
||||
#include "content/browser/attribution_reporting/stored_source.h"
|
||||
#include "net/http/http_request_headers.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
@ -33,7 +33,7 @@ namespace {
|
||||
|
||||
base::Value::Dict GetReportBody(
|
||||
const AttributionReport::CommonAggregatableData& data,
|
||||
absl::optional<uint64_t> trigger_debug_key) {
|
||||
std::optional<uint64_t> trigger_debug_key) {
|
||||
base::Value::Dict dict;
|
||||
|
||||
if (const auto& assembled_report = data.assembled_report;
|
||||
@ -82,9 +82,9 @@ AttributionReport::EventLevelData& AttributionReport::EventLevelData::operator=(
|
||||
AttributionReport::EventLevelData::~EventLevelData() = default;
|
||||
|
||||
AttributionReport::CommonAggregatableData::CommonAggregatableData(
|
||||
absl::optional<attribution_reporting::SuitableOrigin>
|
||||
std::optional<attribution_reporting::SuitableOrigin>
|
||||
aggregation_coordinator_origin,
|
||||
absl::optional<std::string> verification_token,
|
||||
std::optional<std::string> verification_token,
|
||||
attribution_reporting::AggregatableTriggerConfig
|
||||
aggregatable_trigger_config)
|
||||
: aggregation_coordinator_origin(std::move(aggregation_coordinator_origin)),
|
||||
@ -252,11 +252,11 @@ base::Value::Dict AttributionReport::ReportBody() const {
|
||||
10000000.0;
|
||||
dict.Set("randomized_trigger_rate", rounded_rate);
|
||||
|
||||
if (absl::optional<uint64_t> debug_key = source.debug_key()) {
|
||||
if (std::optional<uint64_t> debug_key = source.debug_key()) {
|
||||
dict.Set("source_debug_key", base::NumberToString(*debug_key));
|
||||
}
|
||||
|
||||
if (absl::optional<uint64_t> debug_key =
|
||||
if (std::optional<uint64_t> debug_key =
|
||||
this->attribution_info().debug_key) {
|
||||
dict.Set("trigger_debug_key", base::NumberToString(*debug_key));
|
||||
}
|
||||
@ -273,7 +273,7 @@ base::Value::Dict AttributionReport::ReportBody() const {
|
||||
base::Value::Dict dict = GetReportBody(
|
||||
data.common_data, this->attribution_info().debug_key);
|
||||
|
||||
if (absl::optional<uint64_t> debug_key = data.source.debug_key()) {
|
||||
if (std::optional<uint64_t> debug_key = data.source.debug_key()) {
|
||||
dict.Set("source_debug_key", base::NumberToString(*debug_key));
|
||||
}
|
||||
|
||||
@ -297,9 +297,9 @@ void AttributionReport::set_external_report_id(base::Uuid external_report_id) {
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<base::Time> AttributionReport::MinReportTime(
|
||||
absl::optional<base::Time> a,
|
||||
absl::optional<base::Time> b) {
|
||||
std::optional<base::Time> AttributionReport::MinReportTime(
|
||||
std::optional<base::Time> a,
|
||||
std::optional<base::Time> b) {
|
||||
if (!a.has_value()) {
|
||||
return b;
|
||||
}
|
||||
@ -313,9 +313,9 @@ absl::optional<base::Time> AttributionReport::MinReportTime(
|
||||
|
||||
void AttributionReport::PopulateAdditionalHeaders(
|
||||
net::HttpRequestHeaders& headers) const {
|
||||
const absl::optional<std::string>* verification_token = absl::visit(
|
||||
const std::optional<std::string>* verification_token = absl::visit(
|
||||
base::Overloaded{
|
||||
[](const EventLevelData&) -> const absl::optional<std::string>* {
|
||||
[](const EventLevelData&) -> const std::optional<std::string>* {
|
||||
return nullptr;
|
||||
},
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -23,7 +24,6 @@
|
||||
#include "content/browser/attribution_reporting/attribution_reporting.mojom.h"
|
||||
#include "content/browser/attribution_reporting/stored_source.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
class GURL;
|
||||
@ -66,9 +66,9 @@ class CONTENT_EXPORT AttributionReport {
|
||||
};
|
||||
|
||||
struct CONTENT_EXPORT CommonAggregatableData {
|
||||
CommonAggregatableData(absl::optional<attribution_reporting::SuitableOrigin>
|
||||
CommonAggregatableData(std::optional<attribution_reporting::SuitableOrigin>
|
||||
aggregation_coordinator_origin,
|
||||
absl::optional<std::string> verification_token,
|
||||
std::optional<std::string> verification_token,
|
||||
attribution_reporting::AggregatableTriggerConfig);
|
||||
CommonAggregatableData();
|
||||
CommonAggregatableData(const CommonAggregatableData&);
|
||||
@ -86,14 +86,14 @@ class CONTENT_EXPORT AttributionReport {
|
||||
|
||||
// The report assembled by the aggregation service. If null, the report has
|
||||
// not been assembled yet.
|
||||
absl::optional<AggregatableReport> assembled_report;
|
||||
std::optional<AggregatableReport> assembled_report;
|
||||
|
||||
absl::optional<attribution_reporting::SuitableOrigin>
|
||||
std::optional<attribution_reporting::SuitableOrigin>
|
||||
aggregation_coordinator_origin;
|
||||
|
||||
// A token that can be sent alongside the report to complete its
|
||||
// verification.
|
||||
absl::optional<std::string> verification_token;
|
||||
std::optional<std::string> verification_token;
|
||||
|
||||
attribution_reporting::AggregatableTriggerConfig
|
||||
aggregatable_trigger_config;
|
||||
@ -150,10 +150,10 @@ class CONTENT_EXPORT AttributionReport {
|
||||
AggregatableAttributionData,
|
||||
NullAggregatableData>;
|
||||
|
||||
// Returns the minimum non-null time of `a` and `b`, or `absl::nullopt` if
|
||||
// Returns the minimum non-null time of `a` and `b`, or `std::nullopt` if
|
||||
// both are null.
|
||||
static absl::optional<base::Time> MinReportTime(absl::optional<base::Time> a,
|
||||
absl::optional<base::Time> b);
|
||||
static std::optional<base::Time> MinReportTime(std::optional<base::Time> a,
|
||||
std::optional<base::Time> b);
|
||||
|
||||
AttributionReport(AttributionInfo attribution_info,
|
||||
Id id,
|
||||
|
@ -798,11 +798,10 @@ TEST_F(AttributionReportNetworkSenderTest,
|
||||
static constexpr char kErrorReportUrl[] =
|
||||
"https://report.test/.well-known/attribution-reporting/debug/verbose";
|
||||
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/false,
|
||||
StoreSourceResult::InsufficientUniqueDestinationCapacity(3));
|
||||
std::optional<AttributionDebugReport> report = AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/false,
|
||||
StoreSourceResult::InsufficientUniqueDestinationCapacity(3));
|
||||
ASSERT_TRUE(report);
|
||||
|
||||
base::MockCallback<AttributionReportSender::DebugReportSentCallback> callback;
|
||||
@ -828,11 +827,10 @@ TEST_F(AttributionReportNetworkSenderTest,
|
||||
static constexpr char kErrorReportUrl[] =
|
||||
"https://report.test/.well-known/attribution-reporting/debug/verbose";
|
||||
|
||||
absl::optional<AttributionDebugReport> report =
|
||||
AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/false,
|
||||
StoreSourceResult::InsufficientUniqueDestinationCapacity(3));
|
||||
std::optional<AttributionDebugReport> report = AttributionDebugReport::Create(
|
||||
SourceBuilder().SetDebugReporting(true).Build(),
|
||||
/*is_debug_cookie_set=*/false,
|
||||
StoreSourceResult::InsufficientUniqueDestinationCapacity(3));
|
||||
ASSERT_TRUE(report);
|
||||
|
||||
base::MockCallback<AttributionReportSender::DebugReportSentCallback> callback;
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/containers/flat_set.h"
|
||||
@ -25,7 +26,6 @@
|
||||
#include "net/http/http_request_headers.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -156,11 +156,11 @@ TEST(AttributionReportTest, ReportBody_MultiDestination) {
|
||||
|
||||
TEST(AttributionReportTest, ReportBody_DebugKeys) {
|
||||
const struct {
|
||||
absl::optional<uint64_t> source_debug_key;
|
||||
absl::optional<uint64_t> trigger_debug_key;
|
||||
std::optional<uint64_t> source_debug_key;
|
||||
std::optional<uint64_t> trigger_debug_key;
|
||||
base::Value::Dict expected;
|
||||
} kTestCases[] = {
|
||||
{absl::nullopt, absl::nullopt, base::test::ParseJsonDict(R"json({
|
||||
{std::nullopt, std::nullopt, base::test::ParseJsonDict(R"json({
|
||||
"attribution_destination":"https://conversion.test",
|
||||
"randomized_trigger_rate":0.2,
|
||||
"report_id":"21abd97f-73e8-4b88-9389-a9fee6abda5e",
|
||||
@ -169,7 +169,7 @@ TEST(AttributionReportTest, ReportBody_DebugKeys) {
|
||||
"source_type":"navigation",
|
||||
"trigger_data":"5"
|
||||
})json")},
|
||||
{7, absl::nullopt, base::test::ParseJsonDict(R"json({
|
||||
{7, std::nullopt, base::test::ParseJsonDict(R"json({
|
||||
"attribution_destination":"https://conversion.test",
|
||||
"randomized_trigger_rate":0.2,
|
||||
"report_id":"21abd97f-73e8-4b88-9389-a9fee6abda5e",
|
||||
@ -179,7 +179,7 @@ TEST(AttributionReportTest, ReportBody_DebugKeys) {
|
||||
"source_type":"navigation",
|
||||
"trigger_data":"5"
|
||||
})json")},
|
||||
{absl::nullopt, 7, base::test::ParseJsonDict(R"json({
|
||||
{std::nullopt, 7, base::test::ParseJsonDict(R"json({
|
||||
"attribution_destination":"https://conversion.test",
|
||||
"randomized_trigger_rate":0.2,
|
||||
"report_id":"21abd97f-73e8-4b88-9389-a9fee6abda5e",
|
||||
@ -239,8 +239,8 @@ TEST(AttributionReportTest, ReportBody_Aggregatable) {
|
||||
}
|
||||
|
||||
TEST(AttributionReportTest, PopulateAdditionalHeaders) {
|
||||
const absl::optional<std::string> kTestCases[] = {
|
||||
absl::nullopt,
|
||||
const std::optional<std::string> kTestCases[] = {
|
||||
std::nullopt,
|
||||
"foo",
|
||||
};
|
||||
|
||||
@ -265,8 +265,8 @@ TEST(AttributionReportTest, PopulateAdditionalHeaders) {
|
||||
}
|
||||
|
||||
TEST(AttributionReportTest, PopulateAdditionalHeadersNullAggregatableReport) {
|
||||
const absl::optional<std::string> kTestCases[] = {
|
||||
absl::nullopt,
|
||||
const std::optional<std::string> kTestCases[] = {
|
||||
std::nullopt,
|
||||
"foo",
|
||||
};
|
||||
|
||||
@ -323,11 +323,11 @@ TEST(AttributionReportTest, NullAggregatableReport) {
|
||||
AggregatableReport({AggregatableReport::AggregationServicePayload(
|
||||
/*payload=*/kABCD1234AsBytes,
|
||||
/*key_id=*/"key",
|
||||
/*debug_cleartext_payload=*/absl::nullopt)},
|
||||
/*debug_cleartext_payload=*/std::nullopt)},
|
||||
"example_shared_info",
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*additional_fields=*/{},
|
||||
/*aggregation_coordinator_origin=*/absl::nullopt);
|
||||
/*aggregation_coordinator_origin=*/std::nullopt);
|
||||
|
||||
EXPECT_THAT(report.ReportBody(), IsJson(expected));
|
||||
}
|
||||
@ -365,11 +365,11 @@ TEST(AttributionReportTest, ReportBody_AggregatableAttributionReport) {
|
||||
AggregatableReport({AggregatableReport::AggregationServicePayload(
|
||||
/*payload=*/kABCD1234AsBytes,
|
||||
/*key_id=*/"key",
|
||||
/*debug_cleartext_payload=*/absl::nullopt)},
|
||||
/*debug_cleartext_payload=*/std::nullopt)},
|
||||
"example_shared_info",
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*additional_fields=*/{},
|
||||
/*aggregation_coordinator_origin=*/absl::nullopt);
|
||||
/*aggregation_coordinator_origin=*/std::nullopt);
|
||||
|
||||
EXPECT_THAT(report.ReportBody(), IsJson(expected));
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define CONTENT_BROWSER_ATTRIBUTION_REPORTING_ATTRIBUTION_STORAGE_H_
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
@ -13,7 +14,6 @@
|
||||
#include "content/browser/attribution_reporting/attribution_report.h"
|
||||
#include "content/public/browser/attribution_data_model.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
class Time;
|
||||
@ -65,7 +65,7 @@ class AttributionStorage {
|
||||
int limit = -1) = 0;
|
||||
|
||||
// Returns the first report time strictly after `time`.
|
||||
virtual absl::optional<base::Time> GetNextReportTime(base::Time time) = 0;
|
||||
virtual std::optional<base::Time> GetNextReportTime(base::Time time) = 0;
|
||||
|
||||
// Returns the reports with the given IDs. This call is logically const, and
|
||||
// does not modify the underlying storage.
|
||||
@ -106,7 +106,7 @@ class AttributionStorage {
|
||||
// method returns null, no delay is applied. Otherwise, applies a random value
|
||||
// between `min_delay` and `max_delay`, both inclusive. Returns the new first
|
||||
// report time in storage, if any.
|
||||
virtual absl::optional<base::Time> AdjustOfflineReportTimes() = 0;
|
||||
virtual std::optional<base::Time> AdjustOfflineReportTimes() = 0;
|
||||
|
||||
// Deletes all data in storage for reporting origins matching `filter`,
|
||||
// between `delete_begin` and `delete_end` time. More specifically, this:
|
||||
|
@ -122,7 +122,7 @@ class CONTENT_EXPORT AttributionStorageDelegate {
|
||||
// being open, or internet being disconnected. This gives them a noisy
|
||||
// report time to help disassociate them from other reports. Returns null if
|
||||
// no delay should be applied, e.g. due to debug mode.
|
||||
virtual absl::optional<OfflineReportDelayConfig> GetOfflineReportDelayConfig()
|
||||
virtual std::optional<OfflineReportDelayConfig> GetOfflineReportDelayConfig()
|
||||
const = 0;
|
||||
|
||||
// Shuffles reports to provide plausible deniability on the ordering of
|
||||
@ -167,7 +167,7 @@ class CONTENT_EXPORT AttributionStorageDelegate {
|
||||
virtual std::vector<NullAggregatableReport> GetNullAggregatableReports(
|
||||
const AttributionTrigger&,
|
||||
base::Time trigger_time,
|
||||
absl::optional<base::Time> attributed_source_time) const = 0;
|
||||
std::optional<base::Time> attributed_source_time) const = 0;
|
||||
|
||||
protected:
|
||||
AttributionConfig config_ GUARDED_BY_CONTEXT(sequence_checker_);
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iterator>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@ -35,7 +36,6 @@
|
||||
#include "content/browser/attribution_reporting/privacy_math.h"
|
||||
#include "content/browser/attribution_reporting/stored_source.h"
|
||||
#include "services/network/public/cpp/trigger_verification.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
@ -47,7 +47,7 @@ std::vector<AttributionStorageDelegate::NullAggregatableReport>
|
||||
GetNullAggregatableReportsForLookback(
|
||||
const AttributionTrigger& trigger,
|
||||
base::Time trigger_time,
|
||||
absl::optional<base::Time> attributed_source_time,
|
||||
std::optional<base::Time> attributed_source_time,
|
||||
int days_lookback,
|
||||
double rate) {
|
||||
std::vector<AttributionStorageDelegate::NullAggregatableReport> reports;
|
||||
@ -150,7 +150,7 @@ base::Uuid AttributionStorageDelegateImpl::NewReportID() const {
|
||||
return base::Uuid::GenerateRandomV4();
|
||||
}
|
||||
|
||||
absl::optional<AttributionStorageDelegate::OfflineReportDelayConfig>
|
||||
std::optional<AttributionStorageDelegate::OfflineReportDelayConfig>
|
||||
AttributionStorageDelegateImpl::GetOfflineReportDelayConfig() const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
@ -168,7 +168,7 @@ AttributionStorageDelegateImpl::GetOfflineReportDelayConfig() const {
|
||||
};
|
||||
}
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void AttributionStorageDelegateImpl::ShuffleReports(
|
||||
@ -226,7 +226,7 @@ AttributionStorageDelegateImpl::GetRandomizedResponse(
|
||||
return response;
|
||||
case AttributionNoiseMode::kNone:
|
||||
return RandomizedResponseData(response.rate(),
|
||||
response.channel_capacity(), absl::nullopt);
|
||||
response.channel_capacity(), std::nullopt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ std::vector<AttributionStorageDelegate::NullAggregatableReport>
|
||||
AttributionStorageDelegateImpl::GetNullAggregatableReports(
|
||||
const AttributionTrigger& trigger,
|
||||
base::Time trigger_time,
|
||||
absl::optional<base::Time> attributed_source_time) const {
|
||||
std::optional<base::Time> attributed_source_time) const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
switch (noise_mode_) {
|
||||
@ -250,7 +250,7 @@ std::vector<AttributionStorageDelegate::NullAggregatableReport>
|
||||
AttributionStorageDelegateImpl::GetNullAggregatableReportsImpl(
|
||||
const AttributionTrigger& trigger,
|
||||
base::Time trigger_time,
|
||||
absl::optional<base::Time> attributed_source_time) const {
|
||||
std::optional<base::Time> attributed_source_time) const {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
// See spec
|
||||
@ -264,7 +264,7 @@ AttributionStorageDelegateImpl::GetNullAggregatableReportsImpl(
|
||||
switch (trigger.registration()
|
||||
.aggregatable_trigger_config.source_registration_time_config()) {
|
||||
case attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude: {
|
||||
absl::optional<base::Time> rounded_attributed_source_time;
|
||||
std::optional<base::Time> rounded_attributed_source_time;
|
||||
if (attributed_source_time) {
|
||||
rounded_attributed_source_time =
|
||||
RoundDownToWholeDaySinceUnixEpoch(*attributed_source_time);
|
||||
|
@ -80,7 +80,7 @@ class CONTENT_EXPORT AttributionStorageDelegateImpl
|
||||
base::TimeDelta GetDeleteExpiredSourcesFrequency() const override;
|
||||
base::TimeDelta GetDeleteExpiredRateLimitsFrequency() const override;
|
||||
base::Uuid NewReportID() const override;
|
||||
absl::optional<OfflineReportDelayConfig> GetOfflineReportDelayConfig()
|
||||
std::optional<OfflineReportDelayConfig> GetOfflineReportDelayConfig()
|
||||
const override;
|
||||
void ShuffleReports(std::vector<AttributionReport>& reports) override;
|
||||
void ShuffleTriggerVerifications(
|
||||
@ -98,8 +98,7 @@ class CONTENT_EXPORT AttributionStorageDelegateImpl
|
||||
std::vector<NullAggregatableReport> GetNullAggregatableReports(
|
||||
const AttributionTrigger&,
|
||||
base::Time trigger_time,
|
||||
absl::optional<base::Time> attributed_source_time) const override;
|
||||
|
||||
std::optional<base::Time> attributed_source_time) const override;
|
||||
|
||||
private:
|
||||
AttributionStorageDelegateImpl(AttributionNoiseMode noise_mode,
|
||||
@ -112,7 +111,7 @@ class CONTENT_EXPORT AttributionStorageDelegateImpl
|
||||
std::vector<NullAggregatableReport> GetNullAggregatableReportsImpl(
|
||||
const AttributionTrigger&,
|
||||
base::Time trigger_time,
|
||||
absl::optional<base::Time> attributed_source_time) const;
|
||||
std::optional<base::Time> attributed_source_time) const;
|
||||
};
|
||||
|
||||
} // namespace content
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "base/containers/flat_map.h"
|
||||
@ -24,7 +25,6 @@
|
||||
#include "content/browser/attribution_reporting/privacy_math.h"
|
||||
#include "content/browser/attribution_reporting/stored_source.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
namespace {
|
||||
@ -84,7 +84,7 @@ TEST(AttributionStorageDelegateImplTest,
|
||||
source.source_time());
|
||||
ASSERT_TRUE(result.has_value());
|
||||
ASSERT_GT(result->rate(), 0);
|
||||
ASSERT_EQ(result->response(), absl::nullopt);
|
||||
ASSERT_EQ(result->response(), std::nullopt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ TEST(AttributionStorageDelegateImplTest,
|
||||
EXPECT_THAT(AttributionStorageDelegateImpl()
|
||||
.GetNullAggregatableReports(
|
||||
trigger, /*trigger_time=*/base::Time::Now(),
|
||||
/*attributed_source_time=*/absl::nullopt)
|
||||
/*attributed_source_time=*/std::nullopt)
|
||||
.size(),
|
||||
Le(31u));
|
||||
|
||||
@ -225,7 +225,7 @@ TEST(AttributionStorageDelegateImplTest,
|
||||
EXPECT_THAT(AttributionStorageDelegateImpl()
|
||||
.GetNullAggregatableReports(
|
||||
trigger, /*trigger_time=*/base::Time::Now(),
|
||||
/*attributed_source_time=*/absl::nullopt)
|
||||
/*attributed_source_time=*/std::nullopt)
|
||||
.size(),
|
||||
Le(1u));
|
||||
|
||||
@ -246,7 +246,7 @@ TEST(AttributionStorageDelegateImplTest,
|
||||
|
||||
EXPECT_THAT(AttributionStorageDelegateImpl().GetNullAggregatableReports(
|
||||
trigger, /*trigger_time=*/base::Time::Now(),
|
||||
/*attributed_source_time=*/absl::nullopt),
|
||||
/*attributed_source_time=*/std::nullopt),
|
||||
SizeIs(1u));
|
||||
|
||||
EXPECT_THAT(AttributionStorageDelegateImpl().GetNullAggregatableReports(
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <iterator>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
@ -80,7 +81,6 @@
|
||||
#include "sql/statement_id.h"
|
||||
#include "sql/transaction.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/common/storage_key/storage_key.h"
|
||||
#include "url/origin.h"
|
||||
@ -144,7 +144,7 @@ int SerializeAttributionLogic(StoredSource::AttributionLogic val) {
|
||||
return static_cast<int>(val);
|
||||
}
|
||||
|
||||
absl::optional<StoredSource::AttributionLogic> DeserializeAttributionLogic(
|
||||
std::optional<StoredSource::AttributionLogic> DeserializeAttributionLogic(
|
||||
int val) {
|
||||
switch (val) {
|
||||
case static_cast<int>(StoredSource::AttributionLogic::kNever):
|
||||
@ -154,7 +154,7 @@ absl::optional<StoredSource::AttributionLogic> DeserializeAttributionLogic(
|
||||
case static_cast<int>(StoredSource::AttributionLogic::kFalsely):
|
||||
return StoredSource::AttributionLogic::kFalsely;
|
||||
default:
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ int SerializeReportType(AttributionReport::Type val) {
|
||||
return static_cast<int>(val);
|
||||
}
|
||||
|
||||
absl::optional<AttributionReport::Type> DeserializeReportType(int val) {
|
||||
std::optional<AttributionReport::Type> DeserializeReportType(int val) {
|
||||
switch (val) {
|
||||
case static_cast<int>(AttributionReport::Type::kEventLevel):
|
||||
return AttributionReport::Type::kEventLevel;
|
||||
@ -175,11 +175,11 @@ absl::optional<AttributionReport::Type> DeserializeReportType(int val) {
|
||||
case static_cast<int>(AttributionReport::Type::kNullAggregatable):
|
||||
return AttributionReport::Type::kNullAggregatable;
|
||||
default:
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<StoredSource::ActiveState> GetSourceActiveState(
|
||||
std::optional<StoredSource::ActiveState> GetSourceActiveState(
|
||||
bool event_level_active,
|
||||
bool aggregatable_active) {
|
||||
if (event_level_active && aggregatable_active) {
|
||||
@ -195,12 +195,12 @@ absl::optional<StoredSource::ActiveState> GetSourceActiveState(
|
||||
}
|
||||
|
||||
// We haven't enforced aggregatable attribution limit yet.
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void BindUint64OrNull(sql::Statement& statement,
|
||||
int col,
|
||||
absl::optional<uint64_t> value) {
|
||||
std::optional<uint64_t> value) {
|
||||
if (value.has_value()) {
|
||||
statement.BindInt64(col, SerializeUint64(*value));
|
||||
} else {
|
||||
@ -208,11 +208,10 @@ void BindUint64OrNull(sql::Statement& statement,
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<uint64_t> ColumnUint64OrNull(sql::Statement& statement,
|
||||
int col) {
|
||||
std::optional<uint64_t> ColumnUint64OrNull(sql::Statement& statement, int col) {
|
||||
return statement.GetColumnType(col) == sql::ColumnType::kNull
|
||||
? absl::nullopt
|
||||
: absl::make_optional(
|
||||
? std::nullopt
|
||||
: std::make_optional(
|
||||
DeserializeUint64(statement.ColumnInt64(col)));
|
||||
}
|
||||
|
||||
@ -264,23 +263,23 @@ AttributionStorageSql::ReadSourceFromStatement(sql::Statement& statement) {
|
||||
|
||||
StoredSource::Id source_id(statement.ColumnInt64(col++));
|
||||
uint64_t source_event_id = DeserializeUint64(statement.ColumnInt64(col++));
|
||||
absl::optional<SuitableOrigin> source_origin =
|
||||
std::optional<SuitableOrigin> source_origin =
|
||||
SuitableOrigin::Deserialize(statement.ColumnString(col++));
|
||||
absl::optional<SuitableOrigin> reporting_origin =
|
||||
std::optional<SuitableOrigin> reporting_origin =
|
||||
SuitableOrigin::Deserialize(statement.ColumnString(col++));
|
||||
base::Time source_time = statement.ColumnTime(col++);
|
||||
base::Time expiry_time = statement.ColumnTime(col++);
|
||||
base::Time aggregatable_report_window_time = statement.ColumnTime(col++);
|
||||
absl::optional<SourceType> source_type =
|
||||
std::optional<SourceType> source_type =
|
||||
DeserializeSourceType(statement.ColumnInt(col++));
|
||||
absl::optional<StoredSource::AttributionLogic> attribution_logic =
|
||||
std::optional<StoredSource::AttributionLogic> attribution_logic =
|
||||
DeserializeAttributionLogic(statement.ColumnInt(col++));
|
||||
int64_t priority = statement.ColumnInt64(col++);
|
||||
absl::optional<uint64_t> debug_key = ColumnUint64OrNull(statement, col++);
|
||||
std::optional<uint64_t> debug_key = ColumnUint64OrNull(statement, col++);
|
||||
int num_conversions = statement.ColumnInt(col++);
|
||||
int64_t aggregatable_budget_consumed = statement.ColumnInt64(col++);
|
||||
int num_aggregatable_reports = statement.ColumnInt(col++);
|
||||
absl::optional<attribution_reporting::AggregationKeys> aggregation_keys =
|
||||
std::optional<attribution_reporting::AggregationKeys> aggregation_keys =
|
||||
DeserializeAggregationKeys(statement, col++);
|
||||
|
||||
ReportCorruptionStatusSet corruption_causes;
|
||||
@ -317,7 +316,7 @@ AttributionStorageSql::ReadSourceFromStatement(sql::Statement& statement) {
|
||||
ReportCorruptionStatus::kSourceInvalidAggregationKeys);
|
||||
}
|
||||
|
||||
absl::optional<attribution_reporting::FilterData> filter_data =
|
||||
std::optional<attribution_reporting::FilterData> filter_data =
|
||||
DeserializeFilterData(statement, col++);
|
||||
if (!filter_data) {
|
||||
corruption_causes.Put(ReportCorruptionStatus::kSourceInvalidFilterData);
|
||||
@ -325,17 +324,17 @@ AttributionStorageSql::ReadSourceFromStatement(sql::Statement& statement) {
|
||||
|
||||
bool event_level_active = statement.ColumnBool(col++);
|
||||
bool aggregatable_active = statement.ColumnBool(col++);
|
||||
absl::optional<StoredSource::ActiveState> active_state =
|
||||
std::optional<StoredSource::ActiveState> active_state =
|
||||
GetSourceActiveState(event_level_active, aggregatable_active);
|
||||
if (!active_state.has_value()) {
|
||||
corruption_causes.Put(ReportCorruptionStatus::kSourceInvalidActiveState);
|
||||
}
|
||||
|
||||
attribution_reporting::MaxEventLevelReports max_event_level_reports;
|
||||
absl::optional<EventReportWindows> event_report_windows;
|
||||
std::optional<EventReportWindows> event_report_windows;
|
||||
attribution_reporting::EventLevelEpsilon event_level_epsilon;
|
||||
|
||||
absl::optional<proto::AttributionReadOnlySourceData>
|
||||
std::optional<proto::AttributionReadOnlySourceData>
|
||||
read_only_source_data_msg =
|
||||
DeserializeReadOnlySourceDataAsProto(statement, col++);
|
||||
if (!read_only_source_data_msg.has_value()) {
|
||||
@ -418,7 +417,7 @@ AttributionStorageSql::ReadSourceFromStatement(sql::Statement& statement) {
|
||||
: delegate_->GetRandomizedResponseRate(
|
||||
trigger_specs, max_event_level_reports, event_level_epsilon);
|
||||
|
||||
absl::optional<StoredSource> stored_source = StoredSource::Create(
|
||||
std::optional<StoredSource> stored_source = StoredSource::Create(
|
||||
CommonSourceInfo(std::move(*source_origin), std::move(*reporting_origin),
|
||||
*source_type),
|
||||
source_event_id, std::move(*destination_set), source_time, expiry_time,
|
||||
@ -440,18 +439,18 @@ AttributionStorageSql::ReadSourceFromStatement(sql::Statement& statement) {
|
||||
.num_aggregatable_reports = num_aggregatable_reports};
|
||||
}
|
||||
|
||||
absl::optional<AttributionStorageSql::StoredSourceData>
|
||||
std::optional<AttributionStorageSql::StoredSourceData>
|
||||
AttributionStorageSql::ReadSourceToAttribute(StoredSource::Id source_id) {
|
||||
sql::Statement statement(db_.GetCachedStatement(
|
||||
SQL_FROM_HERE, attribution_queries::kReadSourceToAttributeSql));
|
||||
statement.BindInt64(0, *source_id);
|
||||
if (!statement.Step()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
auto source = ReadSourceFromStatement(statement);
|
||||
return source.has_value() ? absl::make_optional(std::move(*source))
|
||||
: absl::nullopt;
|
||||
return source.has_value() ? std::make_optional(std::move(*source))
|
||||
: std::nullopt;
|
||||
}
|
||||
|
||||
namespace {
|
||||
@ -549,7 +548,7 @@ StoreSourceResult AttributionStorageSql::StoreSource(
|
||||
base::UmaHistogramCounts10M(
|
||||
"Conversions.Storage.Sql.FileSizeSourcesPerOriginLimitReached2",
|
||||
file_size);
|
||||
absl::optional<int64_t> number_of_sources = NumberOfSources();
|
||||
std::optional<int64_t> number_of_sources = NumberOfSources();
|
||||
if (number_of_sources.has_value()) {
|
||||
CHECK_GT(*number_of_sources, 0);
|
||||
base::UmaHistogramCounts1M(
|
||||
@ -658,7 +657,7 @@ StoreSourceResult AttributionStorageSql::StoreSource(
|
||||
|
||||
BindUint64OrNull(statement, 13, reg.debug_key);
|
||||
|
||||
absl::optional<StoredSource::ActiveState> active_state =
|
||||
std::optional<StoredSource::ActiveState> active_state =
|
||||
GetSourceActiveState(event_level_active, aggregatable_active);
|
||||
DCHECK(active_state.has_value());
|
||||
|
||||
@ -690,7 +689,7 @@ StoreSourceResult AttributionStorageSql::StoreSource(
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<StoredSource> stored_source = StoredSource::Create(
|
||||
std::optional<StoredSource> stored_source = StoredSource::Create(
|
||||
source.common_info(), reg.source_event_id, reg.destination_set,
|
||||
source_time, expiry_time, std::move(trigger_specs),
|
||||
aggregatable_report_window_time, reg.max_event_level_reports,
|
||||
@ -704,7 +703,7 @@ StoreSourceResult AttributionStorageSql::StoreSource(
|
||||
return StoreSourceResult::InternalError();
|
||||
}
|
||||
|
||||
absl::optional<base::Time> min_fake_report_time;
|
||||
std::optional<base::Time> min_fake_report_time;
|
||||
|
||||
if (attribution_logic == StoredSource::AttributionLogic::kFalsely) {
|
||||
for (const auto& fake_report : *randomized_response_data.response()) {
|
||||
@ -732,7 +731,7 @@ StoreSourceResult AttributionStorageSql::StoreSource(
|
||||
// actually created the report.
|
||||
AttributionReport fake_attribution_report(
|
||||
AttributionInfo(trigger_time,
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*context_origin=*/common_info.source_origin()),
|
||||
AttributionReport::Id(kUnsetRecordId), report_time,
|
||||
/*initial_report_time=*/report_time, delegate_->NewReportID(),
|
||||
@ -754,7 +753,7 @@ StoreSourceResult AttributionStorageSql::StoreSource(
|
||||
if (!rate_limit_table_.AddRateLimitForAttribution(
|
||||
&db_,
|
||||
AttributionInfo(/*time=*/source_time,
|
||||
/*debug_key=*/absl::nullopt,
|
||||
/*debug_key=*/std::nullopt,
|
||||
/*context_origin=*/common_info.source_origin()),
|
||||
*stored_source)) {
|
||||
return StoreSourceResult::InternalError();
|
||||
@ -816,7 +815,7 @@ AttributionStorageSql::MaybeReplaceLowerPriorityEventLevelReport(
|
||||
const AttributionReport& report,
|
||||
int num_conversions,
|
||||
int64_t conversion_priority,
|
||||
absl::optional<AttributionReport>& replaced_report) {
|
||||
std::optional<AttributionReport>& replaced_report) {
|
||||
DCHECK_GE(num_conversions, 0);
|
||||
|
||||
const auto* data =
|
||||
@ -849,7 +848,7 @@ AttributionStorageSql::MaybeReplaceLowerPriorityEventLevelReport(
|
||||
min_priority_statement.BindInt64(0, *source.source_id());
|
||||
min_priority_statement.BindTime(1, report.initial_report_time());
|
||||
|
||||
absl::optional<AttributionReport::Id> conversion_id_with_min_priority;
|
||||
std::optional<AttributionReport::Id> conversion_id_with_min_priority;
|
||||
int64_t min_priority;
|
||||
|
||||
while (min_priority_statement.Step()) {
|
||||
@ -898,7 +897,7 @@ AttributionStorageSql::MaybeReplaceLowerPriorityEventLevelReport(
|
||||
return MaybeReplaceLowerPriorityEventLevelReportResult::kDropNewReport;
|
||||
}
|
||||
|
||||
absl::optional<AttributionReport> replaced =
|
||||
std::optional<AttributionReport> replaced =
|
||||
GetReport(*conversion_id_with_min_priority);
|
||||
if (!replaced.has_value()) {
|
||||
return MaybeReplaceLowerPriorityEventLevelReportResult::kError;
|
||||
@ -915,12 +914,12 @@ AttributionStorageSql::MaybeReplaceLowerPriorityEventLevelReport(
|
||||
|
||||
namespace {
|
||||
|
||||
bool IsSuccessResult(absl::optional<EventLevelResult> result) {
|
||||
bool IsSuccessResult(std::optional<EventLevelResult> result) {
|
||||
return result == EventLevelResult::kSuccess ||
|
||||
result == EventLevelResult::kSuccessDroppedLowerPriority;
|
||||
}
|
||||
|
||||
bool IsSuccessResult(absl::optional<AggregatableResult> result) {
|
||||
bool IsSuccessResult(std::optional<AggregatableResult> result) {
|
||||
return result == AggregatableResult::kSuccess;
|
||||
}
|
||||
|
||||
@ -948,32 +947,32 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
// Declarations for all of the various pieces of information which may be
|
||||
// collected and/or returned as a result of computing new reports in order to
|
||||
// produce a `CreateReportResult`.
|
||||
absl::optional<EventLevelResult> event_level_status;
|
||||
absl::optional<AttributionReport> new_event_level_report;
|
||||
std::optional<EventLevelResult> event_level_status;
|
||||
std::optional<AttributionReport> new_event_level_report;
|
||||
|
||||
absl::optional<AggregatableResult> aggregatable_status;
|
||||
absl::optional<AttributionReport> new_aggregatable_report;
|
||||
std::optional<AggregatableResult> aggregatable_status;
|
||||
std::optional<AttributionReport> new_aggregatable_report;
|
||||
|
||||
absl::optional<AttributionReport> replaced_event_level_report;
|
||||
absl::optional<AttributionReport> dropped_event_level_report;
|
||||
std::optional<AttributionReport> replaced_event_level_report;
|
||||
std::optional<AttributionReport> dropped_event_level_report;
|
||||
|
||||
absl::optional<StoredSourceData> source_to_attribute;
|
||||
std::optional<StoredSourceData> source_to_attribute;
|
||||
|
||||
absl::optional<base::Time> min_null_aggregatable_report_time;
|
||||
std::optional<base::Time> min_null_aggregatable_report_time;
|
||||
|
||||
CreateReportResult::Limits limits;
|
||||
|
||||
auto assemble_report_result =
|
||||
[&](absl::optional<EventLevelResult> new_event_level_status,
|
||||
absl::optional<AggregatableResult> new_aggregatable_status) {
|
||||
[&](std::optional<EventLevelResult> new_event_level_status,
|
||||
std::optional<AggregatableResult> new_aggregatable_status) {
|
||||
event_level_status = event_level_status.has_value()
|
||||
? event_level_status
|
||||
: new_event_level_status;
|
||||
DCHECK(event_level_status.has_value());
|
||||
|
||||
if (!IsSuccessResult(*event_level_status)) {
|
||||
new_event_level_report = absl::nullopt;
|
||||
replaced_event_level_report = absl::nullopt;
|
||||
new_event_level_report = std::nullopt;
|
||||
replaced_event_level_report = std::nullopt;
|
||||
}
|
||||
|
||||
aggregatable_status = aggregatable_status.has_value()
|
||||
@ -982,7 +981,7 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
DCHECK(aggregatable_status.has_value());
|
||||
|
||||
if (!IsSuccessResult(*aggregatable_status)) {
|
||||
new_aggregatable_report = absl::nullopt;
|
||||
new_aggregatable_report = std::nullopt;
|
||||
}
|
||||
|
||||
if (event_level_status == EventLevelResult::kInternalError ||
|
||||
@ -996,15 +995,15 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
std::move(new_event_level_report),
|
||||
std::move(new_aggregatable_report),
|
||||
source_to_attribute
|
||||
? absl::make_optional(std::move(source_to_attribute->source))
|
||||
: absl::nullopt,
|
||||
? std::make_optional(std::move(source_to_attribute->source))
|
||||
: std::nullopt,
|
||||
limits, std::move(dropped_event_level_report),
|
||||
min_null_aggregatable_report_time);
|
||||
};
|
||||
|
||||
auto generate_null_reports_and_assemble_report_result =
|
||||
[&](absl::optional<EventLevelResult> new_event_level_status,
|
||||
absl::optional<AggregatableResult> new_aggregatable_status)
|
||||
[&](std::optional<EventLevelResult> new_event_level_status,
|
||||
std::optional<AggregatableResult> new_aggregatable_status)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_) {
|
||||
DCHECK(!new_aggregatable_report.has_value());
|
||||
|
||||
@ -1027,8 +1026,8 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
}
|
||||
|
||||
if (event_level_status.has_value() && aggregatable_status.has_value()) {
|
||||
return assemble_report_result(/*new_event_level_status=*/absl::nullopt,
|
||||
/*new_aggregaable_status=*/absl::nullopt);
|
||||
return assemble_report_result(/*new_event_level_status=*/std::nullopt,
|
||||
/*new_aggregaable_status=*/std::nullopt);
|
||||
}
|
||||
|
||||
if (!LazyInit(DbCreationPolicy::kCreateIfAbsent)) {
|
||||
@ -1036,7 +1035,7 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
AggregatableResult::kInternalError);
|
||||
}
|
||||
|
||||
absl::optional<StoredSource::Id> source_id_to_attribute;
|
||||
std::optional<StoredSource::Id> source_id_to_attribute;
|
||||
std::vector<StoredSource::Id> source_ids_to_delete;
|
||||
std::vector<StoredSource::Id> source_ids_to_deactivate;
|
||||
if (!FindMatchingSourceForTrigger(
|
||||
@ -1087,7 +1086,7 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<uint64_t> dedup_key;
|
||||
std::optional<uint64_t> dedup_key;
|
||||
if (!event_level_status.has_value()) {
|
||||
if (EventLevelResult create_event_level_status =
|
||||
MaybeCreateEventLevelReport(
|
||||
@ -1099,7 +1098,7 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<uint64_t> aggregatable_dedup_key;
|
||||
std::optional<uint64_t> aggregatable_dedup_key;
|
||||
if (!aggregatable_status.has_value()) {
|
||||
if (AggregatableResult create_aggregatable_status =
|
||||
MaybeCreateAggregatableAttributionReport(
|
||||
@ -1119,8 +1118,8 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
|
||||
if (event_level_status.has_value() && aggregatable_status.has_value()) {
|
||||
return generate_null_reports_and_assemble_report_result(
|
||||
/*new_event_level_status=*/absl::nullopt,
|
||||
/*new_aggregaable_status=*/absl::nullopt);
|
||||
/*new_event_level_status=*/std::nullopt,
|
||||
/*new_aggregaable_status=*/std::nullopt);
|
||||
}
|
||||
|
||||
switch (rate_limit_table_.AttributionAllowedForAttributionLimit(
|
||||
@ -1161,7 +1160,7 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
AggregatableResult::kInternalError);
|
||||
}
|
||||
|
||||
absl::optional<EventLevelResult> store_event_level_status;
|
||||
std::optional<EventLevelResult> store_event_level_status;
|
||||
if (!event_level_status.has_value()) {
|
||||
DCHECK(new_event_level_report.has_value());
|
||||
store_event_level_status = MaybeStoreEventLevelReport(
|
||||
@ -1170,7 +1169,7 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
dropped_event_level_report);
|
||||
}
|
||||
|
||||
absl::optional<AggregatableResult> store_aggregatable_status;
|
||||
std::optional<AggregatableResult> store_aggregatable_status;
|
||||
if (!aggregatable_status.has_value()) {
|
||||
DCHECK(new_aggregatable_report.has_value());
|
||||
store_aggregatable_status = MaybeStoreAggregatableAttributionReportData(
|
||||
@ -1266,7 +1265,7 @@ CreateReportResult AttributionStorageSql::MaybeCreateAndStoreReport(
|
||||
bool AttributionStorageSql::FindMatchingSourceForTrigger(
|
||||
const AttributionTrigger& trigger,
|
||||
base::Time trigger_time,
|
||||
absl::optional<StoredSource::Id>& source_id_to_attribute,
|
||||
std::optional<StoredSource::Id>& source_id_to_attribute,
|
||||
std::vector<StoredSource::Id>& source_ids_to_delete,
|
||||
std::vector<StoredSource::Id>& source_ids_to_deactivate) {
|
||||
const SuitableOrigin& destination_origin = trigger.destination_origin();
|
||||
@ -1312,9 +1311,9 @@ EventLevelResult AttributionStorageSql::MaybeCreateEventLevelReport(
|
||||
const AttributionInfo& attribution_info,
|
||||
const StoredSource& source,
|
||||
const AttributionTrigger& trigger,
|
||||
absl::optional<AttributionReport>& report,
|
||||
absl::optional<uint64_t>& dedup_key,
|
||||
absl::optional<int>& max_event_level_reports_per_destination) {
|
||||
std::optional<AttributionReport>& report,
|
||||
std::optional<uint64_t>& dedup_key,
|
||||
std::optional<int>& max_event_level_reports_per_destination) {
|
||||
if (source.attribution_logic() == StoredSource::AttributionLogic::kFalsely) {
|
||||
DCHECK_EQ(source.active_state(),
|
||||
StoredSource::ActiveState::kReachedEventLevelAttributionLimit);
|
||||
@ -1398,10 +1397,10 @@ EventLevelResult AttributionStorageSql::MaybeCreateEventLevelReport(
|
||||
|
||||
EventLevelResult AttributionStorageSql::MaybeStoreEventLevelReport(
|
||||
AttributionReport& report,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
std::optional<uint64_t> dedup_key,
|
||||
int num_conversions,
|
||||
absl::optional<AttributionReport>& replaced_report,
|
||||
absl::optional<AttributionReport>& dropped_report) {
|
||||
std::optional<AttributionReport>& replaced_report,
|
||||
std::optional<AttributionReport>& dropped_report) {
|
||||
auto* event_level_data =
|
||||
absl::get_if<AttributionReport::EventLevelData>(&report.data());
|
||||
DCHECK(event_level_data);
|
||||
@ -1512,13 +1511,13 @@ AttributionStorageSql::ReadReportFromStatement(sql::Statement& statement) {
|
||||
int failed_send_attempts = statement.ColumnInt(col++);
|
||||
base::Uuid external_report_id =
|
||||
base::Uuid::ParseLowercase(statement.ColumnString(col++));
|
||||
absl::optional<uint64_t> trigger_debug_key =
|
||||
std::optional<uint64_t> trigger_debug_key =
|
||||
ColumnUint64OrNull(statement, col++);
|
||||
auto context_origin =
|
||||
SuitableOrigin::Deserialize(statement.ColumnString(col++));
|
||||
auto reporting_origin =
|
||||
SuitableOrigin::Deserialize(statement.ColumnString(col++));
|
||||
absl::optional<AttributionReport::Type> report_type =
|
||||
std::optional<AttributionReport::Type> report_type =
|
||||
DeserializeReportType(statement.ColumnInt(col++));
|
||||
|
||||
base::expected<StoredSourceData, ReportCorruptionStatusSetAndIds>
|
||||
@ -1565,7 +1564,7 @@ AttributionStorageSql::ReadReportFromStatement(sql::Statement& statement) {
|
||||
return base::unexpected(std::move(corruptions));
|
||||
}
|
||||
|
||||
absl::optional<AttributionReport::Data> data;
|
||||
std::optional<AttributionReport::Data> data;
|
||||
|
||||
switch (base::span<const uint8_t> metadata = statement.ColumnBlob(col++);
|
||||
*report_type) {
|
||||
@ -1681,11 +1680,11 @@ std::vector<AttributionReport> AttributionStorageSql::GetReportsInternal(
|
||||
return reports;
|
||||
}
|
||||
|
||||
absl::optional<base::Time> AttributionStorageSql::GetNextReportTime(
|
||||
std::optional<base::Time> AttributionStorageSql::GetNextReportTime(
|
||||
base::Time time) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
if (!LazyInit(DbCreationPolicy::kIgnoreIfAbsent)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
sql::Statement statement(db_.GetCachedStatement(
|
||||
@ -1697,7 +1696,7 @@ absl::optional<base::Time> AttributionStorageSql::GetNextReportTime(
|
||||
return statement.ColumnTime(0);
|
||||
}
|
||||
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::vector<AttributionReport> AttributionStorageSql::GetReports(
|
||||
@ -1709,7 +1708,7 @@ std::vector<AttributionReport> AttributionStorageSql::GetReports(
|
||||
|
||||
std::vector<AttributionReport> reports;
|
||||
for (AttributionReport::Id id : ids) {
|
||||
absl::optional<AttributionReport> report = GetReport(id);
|
||||
std::optional<AttributionReport> report = GetReport(id);
|
||||
if (report.has_value()) {
|
||||
reports.push_back(std::move(*report));
|
||||
}
|
||||
@ -1717,18 +1716,18 @@ std::vector<AttributionReport> AttributionStorageSql::GetReports(
|
||||
return reports;
|
||||
}
|
||||
|
||||
absl::optional<AttributionReport> AttributionStorageSql::GetReport(
|
||||
std::optional<AttributionReport> AttributionStorageSql::GetReport(
|
||||
AttributionReport::Id id) {
|
||||
sql::Statement statement(db_.GetCachedStatement(
|
||||
SQL_FROM_HERE, attribution_queries::kGetReportSql));
|
||||
statement.BindInt64(0, *id);
|
||||
|
||||
if (!statement.Step()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
auto report = ReadReportFromStatement(statement);
|
||||
return report.has_value() ? absl::make_optional(std::move(*report))
|
||||
: absl::nullopt;
|
||||
return report.has_value() ? std::make_optional(std::move(*report))
|
||||
: std::nullopt;
|
||||
}
|
||||
|
||||
bool AttributionStorageSql::DeleteExpiredSources() {
|
||||
@ -1813,7 +1812,7 @@ bool AttributionStorageSql::UpdateReportForSendFailure(
|
||||
return statement.Run() && db_.GetLastChangeCount() == 1;
|
||||
}
|
||||
|
||||
absl::optional<base::Time> AttributionStorageSql::AdjustOfflineReportTimes() {
|
||||
std::optional<base::Time> AttributionStorageSql::AdjustOfflineReportTimes() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
auto delay = delegate_->GetOfflineReportDelayConfig();
|
||||
@ -1829,7 +1828,7 @@ absl::optional<base::Time> AttributionStorageSql::AdjustOfflineReportTimes() {
|
||||
DCHECK_LE(delay->min, delay->max);
|
||||
|
||||
if (!LazyInit(DbCreationPolicy::kIgnoreIfAbsent)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
base::Time now = base::Time::Now();
|
||||
@ -1840,7 +1839,7 @@ absl::optional<base::Time> AttributionStorageSql::AdjustOfflineReportTimes() {
|
||||
statement.BindTimeDelta(1, delay->max - delay->min + base::Microseconds(1));
|
||||
statement.BindTime(2, now);
|
||||
if (!statement.Run()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return GetNextReportTime(base::Time::Min());
|
||||
@ -1950,7 +1949,7 @@ void AttributionStorageSql::ClearAllDataAllTime(bool delete_rate_limit_data) {
|
||||
sql::Statement delete_all_reports_statement(
|
||||
db_.GetCachedStatement(SQL_FROM_HERE, kDeleteAllReportsSql));
|
||||
while (delete_all_reports_statement.Step()) {
|
||||
absl::optional<AttributionReport::Type> report_type =
|
||||
std::optional<AttributionReport::Type> report_type =
|
||||
DeserializeReportType(delete_all_reports_statement.ColumnInt(0));
|
||||
if (!report_type) {
|
||||
continue;
|
||||
@ -2025,7 +2024,7 @@ bool AttributionStorageSql::HasCapacityForStoringSource(
|
||||
AttributionStorageSql::ReportAlreadyStoredStatus
|
||||
AttributionStorageSql::ReportAlreadyStored(
|
||||
StoredSource::Id source_id,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
std::optional<uint64_t> dedup_key,
|
||||
AttributionReport::Type report_type) {
|
||||
if (!dedup_key.has_value()) {
|
||||
return ReportAlreadyStoredStatus::kNotStored;
|
||||
@ -2111,7 +2110,7 @@ bool AttributionStorageSql::ReadDedupKeys(StoredSource& source) {
|
||||
while (statement.Step()) {
|
||||
uint64_t dedup_key = DeserializeUint64(statement.ColumnInt64(0));
|
||||
|
||||
absl::optional<AttributionReport::Type> report_type =
|
||||
std::optional<AttributionReport::Type> report_type =
|
||||
DeserializeReportType(statement.ColumnInt(1));
|
||||
if (!report_type.has_value()) {
|
||||
continue;
|
||||
@ -2220,7 +2219,7 @@ bool AttributionStorageSql::LazyInit(DbCreationPolicy creation_policy) {
|
||||
if (int64_t file_size = StorageFileSizeKB(path_to_database_);
|
||||
file_size > -1) {
|
||||
base::UmaHistogramCounts10M("Conversions.Storage.Sql.FileSize2", file_size);
|
||||
absl::optional<int64_t> number_of_sources = NumberOfSources();
|
||||
std::optional<int64_t> number_of_sources = NumberOfSources();
|
||||
if (number_of_sources.has_value() && *number_of_sources > 0) {
|
||||
base::UmaHistogramCounts1M("Conversions.Storage.Sql.FileSize2.PerSource",
|
||||
file_size * 1024 / *number_of_sources);
|
||||
@ -2233,11 +2232,11 @@ bool AttributionStorageSql::LazyInit(DbCreationPolicy creation_policy) {
|
||||
return true;
|
||||
}
|
||||
|
||||
absl::optional<int64_t> AttributionStorageSql::NumberOfSources() {
|
||||
std::optional<int64_t> AttributionStorageSql::NumberOfSources() {
|
||||
sql::Statement statement(db_.GetCachedStatement(
|
||||
SQL_FROM_HERE, attribution_queries::kCountSourcesSql));
|
||||
if (!statement.Step()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return statement.ColumnInt64(0);
|
||||
}
|
||||
@ -2762,7 +2761,7 @@ bool AttributionStorageSql::ClearReportsForOriginsInRange(
|
||||
continue;
|
||||
}
|
||||
source_ids_to_delete.emplace_back(scan_reports_statement.ColumnInt64(1));
|
||||
absl::optional<AttributionReport::Type> report_type =
|
||||
std::optional<AttributionReport::Type> report_type =
|
||||
DeserializeReportType(scan_reports_statement.ColumnInt(3));
|
||||
if (report_type) {
|
||||
switch (*report_type) {
|
||||
@ -2806,7 +2805,7 @@ bool AttributionStorageSql::ClearReportsForSourceIds(
|
||||
statement.BindInt64(0, *id);
|
||||
|
||||
while (statement.Step()) {
|
||||
absl::optional<AttributionReport::Type> report_type =
|
||||
std::optional<AttributionReport::Type> report_type =
|
||||
DeserializeReportType(statement.ColumnInt(0));
|
||||
if (!report_type) {
|
||||
continue;
|
||||
@ -2877,9 +2876,9 @@ AttributionStorageSql::MaybeCreateAggregatableAttributionReport(
|
||||
const AttributionInfo& attribution_info,
|
||||
const StoredSource& source,
|
||||
const AttributionTrigger& trigger,
|
||||
absl::optional<AttributionReport>& report,
|
||||
absl::optional<uint64_t>& dedup_key,
|
||||
absl::optional<int>& max_aggregatable_reports_per_destination) {
|
||||
std::optional<AttributionReport>& report,
|
||||
std::optional<uint64_t>& dedup_key,
|
||||
std::optional<int>& max_aggregatable_reports_per_destination) {
|
||||
const attribution_reporting::TriggerRegistration& trigger_registration =
|
||||
trigger.registration();
|
||||
|
||||
@ -2950,7 +2949,7 @@ AttributionStorageSql::MaybeCreateAggregatableAttributionReport(
|
||||
AttributionReport::AggregatableAttributionData(
|
||||
AttributionReport::CommonAggregatableData(
|
||||
trigger_registration.aggregation_coordinator_origin,
|
||||
/*verification_token=*/absl::nullopt,
|
||||
/*verification_token=*/std::nullopt,
|
||||
trigger_registration.aggregatable_trigger_config),
|
||||
std::move(contributions), source));
|
||||
|
||||
@ -3007,8 +3006,8 @@ AttributionStorageSql::MaybeStoreAggregatableAttributionReportData(
|
||||
AttributionReport& report,
|
||||
int64_t aggregatable_budget_consumed,
|
||||
int num_aggregatable_reports,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
absl::optional<int>& max_aggregatable_reports_per_source) {
|
||||
std::optional<uint64_t> dedup_key,
|
||||
std::optional<int>& max_aggregatable_reports_per_source) {
|
||||
const auto* aggregatable_attribution =
|
||||
absl::get_if<AttributionReport::AggregatableAttributionData>(
|
||||
&report.data());
|
||||
@ -3063,9 +3062,9 @@ AttributionStorageSql::MaybeStoreAggregatableAttributionReportData(
|
||||
bool AttributionStorageSql::GenerateNullAggregatableReportsAndStoreReports(
|
||||
const AttributionTrigger& trigger,
|
||||
const AttributionInfo& attribution_info,
|
||||
absl::optional<AttributionReport>& new_aggregatable_report,
|
||||
absl::optional<base::Time>& min_null_aggregatable_report_time) {
|
||||
absl::optional<base::Time> attributed_source_time;
|
||||
std::optional<AttributionReport>& new_aggregatable_report,
|
||||
std::optional<base::Time>& min_null_aggregatable_report_time) {
|
||||
std::optional<base::Time> attributed_source_time;
|
||||
std::vector<AttributionReport> reports;
|
||||
|
||||
if (new_aggregatable_report) {
|
||||
@ -3095,7 +3094,7 @@ bool AttributionStorageSql::GenerateNullAggregatableReportsAndStoreReports(
|
||||
AttributionReport::NullAggregatableData(
|
||||
AttributionReport::CommonAggregatableData(
|
||||
trigger.registration().aggregation_coordinator_origin,
|
||||
/*verification_token=*/absl::nullopt,
|
||||
/*verification_token=*/std::nullopt,
|
||||
trigger.registration().aggregatable_trigger_config),
|
||||
trigger.reporting_origin(),
|
||||
null_aggregatable_report.fake_source_time));
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -26,7 +27,6 @@
|
||||
#include "content/public/browser/attribution_data_model.h"
|
||||
#include "content/public/browser/storage_partition.h"
|
||||
#include "sql/database.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace sql {
|
||||
class Statement;
|
||||
@ -162,7 +162,7 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
std::vector<AttributionReport> GetAttributionReports(
|
||||
base::Time max_report_time,
|
||||
int limit = -1) override;
|
||||
absl::optional<base::Time> GetNextReportTime(base::Time time) override;
|
||||
std::optional<base::Time> GetNextReportTime(base::Time time) override;
|
||||
std::vector<AttributionReport> GetReports(
|
||||
const std::vector<AttributionReport::Id>& ids) override;
|
||||
std::vector<StoredSource> GetActiveSources(int limit = -1) override;
|
||||
@ -171,7 +171,7 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
bool DeleteReport(AttributionReport::Id report_id) override;
|
||||
bool UpdateReportForSendFailure(AttributionReport::Id report_id,
|
||||
base::Time new_report_time) override;
|
||||
absl::optional<base::Time> AdjustOfflineReportTimes() override;
|
||||
std::optional<base::Time> AdjustOfflineReportTimes() override;
|
||||
void ClearData(base::Time delete_begin,
|
||||
base::Time delete_end,
|
||||
StoragePartition::StorageKeyMatcherFunction filter,
|
||||
@ -205,7 +205,7 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
// Returns the number of sources in storage.
|
||||
absl::optional<int64_t> NumberOfSources()
|
||||
std::optional<int64_t> NumberOfSources()
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
enum class ReportAlreadyStoredStatus {
|
||||
@ -218,7 +218,7 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
|
||||
ReportAlreadyStoredStatus ReportAlreadyStored(
|
||||
StoredSource::Id source_id,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
std::optional<uint64_t> dedup_key,
|
||||
AttributionReport::Type report_type)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
@ -244,10 +244,10 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
const AttributionReport& report,
|
||||
int num_conversions,
|
||||
int64_t conversion_priority,
|
||||
absl::optional<AttributionReport>& replaced_report)
|
||||
std::optional<AttributionReport>& replaced_report)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
absl::optional<AttributionReport> GetReport(AttributionReport::Id report_id)
|
||||
std::optional<AttributionReport> GetReport(AttributionReport::Id report_id)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
[[nodiscard]] bool ReadDedupKeys(StoredSource&)
|
||||
@ -266,7 +266,7 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
ReadSourceFromStatement(sql::Statement&)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
absl::optional<StoredSourceData> ReadSourceToAttribute(
|
||||
std::optional<StoredSourceData> ReadSourceToAttribute(
|
||||
StoredSource::Id source_id) VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
std::vector<AttributionReport> GetReportsInternal(base::Time max_report_time,
|
||||
@ -276,9 +276,9 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
[[nodiscard]] bool DeleteReportInternal(AttributionReport::Id)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
absl::optional<base::Time> GetNextReportTime(sql::StatementID id,
|
||||
const char* sql,
|
||||
base::Time time)
|
||||
std::optional<base::Time> GetNextReportTime(sql::StatementID id,
|
||||
const char* sql,
|
||||
base::Time time)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
[[nodiscard]] bool AdjustOfflineReportTimes(sql::StatementID id,
|
||||
@ -294,7 +294,7 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
bool FindMatchingSourceForTrigger(
|
||||
const AttributionTrigger& trigger,
|
||||
base::Time trigger_time,
|
||||
absl::optional<StoredSource::Id>& source_id_to_attribute,
|
||||
std::optional<StoredSource::Id>& source_id_to_attribute,
|
||||
std::vector<StoredSource::Id>& source_ids_to_delete,
|
||||
std::vector<StoredSource::Id>& source_ids_to_deactivate)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
@ -303,17 +303,17 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
const AttributionInfo& attribution_info,
|
||||
const StoredSource&,
|
||||
const AttributionTrigger& trigger,
|
||||
absl::optional<AttributionReport>& report,
|
||||
absl::optional<uint64_t>& dedup_key,
|
||||
absl::optional<int>& max_event_level_reports_per_destination)
|
||||
std::optional<AttributionReport>& report,
|
||||
std::optional<uint64_t>& dedup_key,
|
||||
std::optional<int>& max_event_level_reports_per_destination)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
AttributionTrigger::EventLevelResult MaybeStoreEventLevelReport(
|
||||
AttributionReport& report,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
std::optional<uint64_t> dedup_key,
|
||||
int num_conversions,
|
||||
absl::optional<AttributionReport>& replaced_report,
|
||||
absl::optional<AttributionReport>& dropped_report)
|
||||
std::optional<AttributionReport>& replaced_report,
|
||||
std::optional<AttributionReport>& dropped_report)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
// Initializes the database if necessary, and returns whether the database is
|
||||
@ -378,9 +378,9 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
const AttributionInfo& attribution_info,
|
||||
const StoredSource&,
|
||||
const AttributionTrigger& trigger,
|
||||
absl::optional<AttributionReport>& report,
|
||||
absl::optional<uint64_t>& dedup_key,
|
||||
absl::optional<int>& max_aggregatable_reports_per_destination)
|
||||
std::optional<AttributionReport>& report,
|
||||
std::optional<uint64_t>& dedup_key,
|
||||
std::optional<int>& max_aggregatable_reports_per_destination)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
// Stores the data associated with the aggregatable report, e.g. budget
|
||||
@ -391,8 +391,8 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
AttributionReport& report,
|
||||
int64_t aggregatable_budget_consumed,
|
||||
int num_aggregatable_reports,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
absl::optional<int>& max_aggregatable_reports_per_source)
|
||||
std::optional<uint64_t> dedup_key,
|
||||
std::optional<int>& max_aggregatable_reports_per_source)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
[[nodiscard]] bool StoreAttributionReport(AttributionReport& report)
|
||||
@ -404,8 +404,8 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
[[nodiscard]] bool GenerateNullAggregatableReportsAndStoreReports(
|
||||
const AttributionTrigger&,
|
||||
const AttributionInfo&,
|
||||
absl::optional<AttributionReport>& new_aggregatable_report,
|
||||
absl::optional<base::Time>& min_null_aggregatable_report_time)
|
||||
std::optional<AttributionReport>& new_aggregatable_report,
|
||||
std::optional<base::Time>& min_null_aggregatable_report_time)
|
||||
VALID_CONTEXT_REQUIRED(sequence_checker_);
|
||||
|
||||
// Randomly assigns trigger verification data to the given reports.
|
||||
@ -426,8 +426,7 @@ class CONTENT_EXPORT AttributionStorageSql : public AttributionStorage {
|
||||
// at for lazy initialization, and used as a signal for if the database is
|
||||
// closed. This is initialized in the first call to LazyInit() to avoid doing
|
||||
// additional work in the constructor, see https://crbug.com/1121307.
|
||||
absl::optional<DbStatus> db_init_status_
|
||||
GUARDED_BY_CONTEXT(sequence_checker_);
|
||||
std::optional<DbStatus> db_init_status_ GUARDED_BY_CONTEXT(sequence_checker_);
|
||||
|
||||
sql::Database db_ GUARDED_BY_CONTEXT(sequence_checker_);
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -18,7 +19,6 @@
|
||||
#include "content/browser/attribution_reporting/test/configurable_storage_delegate.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
namespace {
|
||||
@ -48,7 +48,7 @@ class AttributionSqlQueryPlanTest : public testing::Test {
|
||||
// Helper method to make tests as readable as possible.
|
||||
base::expected<SqlQueryPlan, SqlQueryPlanExplainer::Error> GetPlan(
|
||||
std::string query,
|
||||
absl::optional<SqlFullScanReason> reason = absl::nullopt) {
|
||||
std::optional<SqlFullScanReason> reason = std::nullopt) {
|
||||
return explainer_->GetPlan(std::move(query), reason);
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -66,7 +67,6 @@
|
||||
#include "sql/test/scoped_error_expecter.h"
|
||||
#include "sql/test/test_helpers.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
#include "third_party/blink/public/common/storage_key/storage_key.h"
|
||||
#include "url/gurl.h"
|
||||
@ -103,7 +103,7 @@ struct AttributionSourceRecord {
|
||||
int num_aggregatable_reports;
|
||||
int event_level_active;
|
||||
int aggregatable_active;
|
||||
absl::optional<uint64_t> debug_key;
|
||||
std::optional<uint64_t> debug_key;
|
||||
std::string aggregation_keys;
|
||||
std::string filter_data;
|
||||
std::string read_only_source_data;
|
||||
@ -117,7 +117,7 @@ struct AttributionReportRecord {
|
||||
base::Time initial_report_time;
|
||||
int failed_send_attempts = 0;
|
||||
std::string external_report_id;
|
||||
absl::optional<uint64_t> debug_key;
|
||||
std::optional<uint64_t> debug_key;
|
||||
std::string context_origin = "https://destination.test";
|
||||
std::string reporting_origin = kDefaultReportOrigin;
|
||||
int report_type;
|
||||
@ -125,33 +125,33 @@ struct AttributionReportRecord {
|
||||
};
|
||||
|
||||
struct AttributionEventLevelMetadataRecord {
|
||||
absl::optional<uint64_t> trigger_data;
|
||||
absl::optional<int64_t> priority;
|
||||
std::optional<uint64_t> trigger_data;
|
||||
std::optional<int64_t> priority;
|
||||
};
|
||||
|
||||
struct AttributionAggregatableMetadataRecord {
|
||||
struct Contribution {
|
||||
absl::optional<uint64_t> high_bits;
|
||||
absl::optional<uint64_t> low_bits;
|
||||
absl::optional<uint32_t> value;
|
||||
std::optional<uint64_t> high_bits;
|
||||
std::optional<uint64_t> low_bits;
|
||||
std::optional<uint32_t> value;
|
||||
};
|
||||
std::vector<Contribution> contributions;
|
||||
absl::optional<url::Origin> coordinator_origin;
|
||||
absl::optional<
|
||||
std::optional<url::Origin> coordinator_origin;
|
||||
std::optional<
|
||||
proto::AttributionCommonAggregatableMetadata_SourceRegistrationTimeConfig>
|
||||
source_registration_time_config =
|
||||
proto::AttributionCommonAggregatableMetadata::INCLUDE;
|
||||
absl::optional<std::string> trigger_context_id;
|
||||
std::optional<std::string> trigger_context_id;
|
||||
};
|
||||
|
||||
struct AttributionNullAggregatableMetadataRecord {
|
||||
absl::optional<int64_t> fake_source_time;
|
||||
absl::optional<url::Origin> coordinator_origin;
|
||||
absl::optional<
|
||||
std::optional<int64_t> fake_source_time;
|
||||
std::optional<url::Origin> coordinator_origin;
|
||||
std::optional<
|
||||
proto::AttributionCommonAggregatableMetadata_SourceRegistrationTimeConfig>
|
||||
source_registration_time_config =
|
||||
proto::AttributionCommonAggregatableMetadata::INCLUDE;
|
||||
absl::optional<std::string> trigger_context_id;
|
||||
std::optional<std::string> trigger_context_id;
|
||||
};
|
||||
|
||||
std::string CreateSerializedFilterData(
|
||||
@ -2084,7 +2084,7 @@ TEST_P(AttributionStorageSqlTest,
|
||||
.value = 3,
|
||||
},
|
||||
},
|
||||
.source_registration_time_config = absl::nullopt,
|
||||
.source_registration_time_config = std::nullopt,
|
||||
},
|
||||
.valid = false,
|
||||
},
|
||||
@ -2202,7 +2202,7 @@ TEST_P(AttributionStorageSqlTest,
|
||||
.record =
|
||||
AttributionNullAggregatableMetadataRecord{
|
||||
.fake_source_time = 12345678900,
|
||||
.source_registration_time_config = absl::nullopt,
|
||||
.source_registration_time_config = std::nullopt,
|
||||
},
|
||||
.valid = false,
|
||||
},
|
||||
@ -2659,32 +2659,32 @@ TEST_P(AttributionStorageSqlTest,
|
||||
TEST_P(AttributionStorageSqlTest, SourceDebugKeyAndDebugCookieSetCombination) {
|
||||
const struct {
|
||||
const char* desc;
|
||||
absl::optional<bool> debug_cookie_set;
|
||||
absl::optional<uint64_t> debug_key;
|
||||
absl::optional<bool> expected_debug_cookie_set;
|
||||
std::optional<bool> debug_cookie_set;
|
||||
std::optional<uint64_t> debug_key;
|
||||
std::optional<bool> expected_debug_cookie_set;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
.desc = "debug cookie missing, debug key set",
|
||||
.debug_cookie_set = absl::nullopt,
|
||||
.debug_cookie_set = std::nullopt,
|
||||
.debug_key = 123,
|
||||
.expected_debug_cookie_set = true,
|
||||
},
|
||||
{
|
||||
.desc = "debug cookie missing, debug key not set",
|
||||
.debug_cookie_set = absl::nullopt,
|
||||
.debug_key = absl::nullopt,
|
||||
.debug_cookie_set = std::nullopt,
|
||||
.debug_key = std::nullopt,
|
||||
.expected_debug_cookie_set = false,
|
||||
},
|
||||
{
|
||||
.desc = "debug cookie not set, debug key set",
|
||||
.debug_cookie_set = false,
|
||||
.debug_key = 123,
|
||||
.expected_debug_cookie_set = absl::nullopt,
|
||||
.expected_debug_cookie_set = std::nullopt,
|
||||
},
|
||||
{
|
||||
.desc = "debug cookie not set, debug key not set",
|
||||
.debug_cookie_set = false,
|
||||
.debug_key = absl::nullopt,
|
||||
.debug_key = std::nullopt,
|
||||
.expected_debug_cookie_set = false,
|
||||
},
|
||||
{
|
||||
@ -2696,7 +2696,7 @@ TEST_P(AttributionStorageSqlTest, SourceDebugKeyAndDebugCookieSetCombination) {
|
||||
{
|
||||
.desc = "debug cookie set, debug key not set",
|
||||
.debug_cookie_set = true,
|
||||
.debug_key = absl::nullopt,
|
||||
.debug_key = std::nullopt,
|
||||
.expected_debug_cookie_set = true,
|
||||
},
|
||||
};
|
||||
@ -2722,7 +2722,7 @@ TEST_P(AttributionStorageSqlTest, SourceDebugKeyAndDebugCookieSetCombination) {
|
||||
|
||||
sql::Statement read_statement(raw_db.GetUniqueStatement(kReadSql));
|
||||
ASSERT_TRUE(read_statement.Step());
|
||||
absl::optional<proto::AttributionReadOnlySourceData>
|
||||
std::optional<proto::AttributionReadOnlySourceData>
|
||||
read_only_source_data_msg =
|
||||
DeserializeReadOnlySourceDataAsProto(read_statement, 0);
|
||||
ASSERT_TRUE(read_only_source_data_msg);
|
||||
|
@ -213,7 +213,7 @@ TEST_F(AttributionStorageTest,
|
||||
EXPECT_TRUE(storage->DeleteReport(AttributionReport::Id(0)));
|
||||
EXPECT_NO_FATAL_FAILURE(storage->ClearData(
|
||||
base::Time::Min(), base::Time::Max(), base::NullCallback()));
|
||||
EXPECT_EQ(storage->AdjustOfflineReportTimes(), absl::nullopt);
|
||||
EXPECT_EQ(storage->AdjustOfflineReportTimes(), std::nullopt);
|
||||
}
|
||||
|
||||
TEST_F(AttributionStorageTest, ImpressionStoredAndRetrieved_ValuesIdentical) {
|
||||
@ -257,9 +257,9 @@ TEST_F(AttributionStorageTest,
|
||||
storage()->MaybeCreateAndStoreReport(DefaultTrigger()),
|
||||
AllOf(CreateReportEventLevelStatusIs(
|
||||
AttributionTrigger::EventLevelResult::kNoMatchingImpressions),
|
||||
NewEventLevelReportIs(absl::nullopt),
|
||||
NewAggregatableReportIs(absl::nullopt),
|
||||
CreateReportSourceIs(absl::nullopt)));
|
||||
NewEventLevelReportIs(std::nullopt),
|
||||
NewAggregatableReportIs(std::nullopt),
|
||||
CreateReportSourceIs(std::nullopt)));
|
||||
EXPECT_THAT(storage()->GetAttributionReports(base::Time::Now()), IsEmpty());
|
||||
}
|
||||
|
||||
@ -383,7 +383,7 @@ TEST_F(AttributionStorageTest,
|
||||
TriggerBuilder().SetDebugKey(20).Build()),
|
||||
AllOf(CreateReportEventLevelStatusIs(
|
||||
AttributionTrigger::EventLevelResult::kPriorityTooLow),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
DroppedEventLevelReportIs(Optional(TriggerDebugKeyIs(20u)))));
|
||||
}
|
||||
|
||||
@ -816,8 +816,8 @@ TEST_F(AttributionStorageTest, MaxEventLevelReportsPerDestination) {
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
CreateReportMaxEventLevelReportsLimitIs(absl::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxEventLevelReportsLimitIs(std::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(std::nullopt)));
|
||||
|
||||
// Verify that MaxReportsPerDestination is enforced.
|
||||
EXPECT_THAT(storage()->MaybeCreateAndStoreReport(
|
||||
@ -827,10 +827,10 @@ TEST_F(AttributionStorageTest, MaxEventLevelReportsPerDestination) {
|
||||
kNoCapacityForConversionDestination),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
DroppedEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
DroppedEventLevelReportIs(std::nullopt),
|
||||
CreateReportMaxEventLevelReportsLimitIs(1),
|
||||
CreateReportMaxAggregatableReportsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxAggregatableReportsLimitIs(std::nullopt)));
|
||||
}
|
||||
|
||||
TEST_F(AttributionStorageTest,
|
||||
@ -861,8 +861,8 @@ TEST_F(AttributionStorageTest,
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
CreateReportMaxEventLevelReportsLimitIs(absl::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxEventLevelReportsLimitIs(std::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(std::nullopt)));
|
||||
|
||||
// Verify that MaxReportsPerDestination is enforced.
|
||||
EXPECT_THAT(storage()->MaybeCreateAndStoreReport(
|
||||
@ -875,10 +875,10 @@ TEST_F(AttributionStorageTest,
|
||||
kNoCapacityForConversionDestination),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
DroppedEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
DroppedEventLevelReportIs(std::nullopt),
|
||||
CreateReportMaxEventLevelReportsLimitIs(1),
|
||||
CreateReportMaxAggregatableReportsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxAggregatableReportsLimitIs(std::nullopt)));
|
||||
}
|
||||
|
||||
TEST_F(AttributionStorageTest, MaxAggregatableReportsPerDestination) {
|
||||
@ -895,8 +895,8 @@ TEST_F(AttributionStorageTest, MaxAggregatableReportsPerDestination) {
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
CreateReportMaxEventLevelReportsLimitIs(absl::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxEventLevelReportsLimitIs(std::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(std::nullopt)));
|
||||
|
||||
// Verify that MaxReportsPerDestination is enforced.
|
||||
EXPECT_THAT(storage()->MaybeCreateAndStoreReport(
|
||||
@ -906,9 +906,9 @@ TEST_F(AttributionStorageTest, MaxAggregatableReportsPerDestination) {
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::
|
||||
kNoCapacityForConversionDestination),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
DroppedEventLevelReportIs(absl::nullopt),
|
||||
CreateReportMaxEventLevelReportsLimitIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
DroppedEventLevelReportIs(std::nullopt),
|
||||
CreateReportMaxEventLevelReportsLimitIs(std::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(1)));
|
||||
}
|
||||
|
||||
@ -940,8 +940,8 @@ TEST_F(AttributionStorageTest,
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
CreateReportMaxEventLevelReportsLimitIs(absl::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxEventLevelReportsLimitIs(std::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(std::nullopt)));
|
||||
|
||||
// Verify that MaxReportsPerDestination is enforced.
|
||||
EXPECT_THAT(storage()->MaybeCreateAndStoreReport(
|
||||
@ -954,9 +954,9 @@ TEST_F(AttributionStorageTest,
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::
|
||||
kNoCapacityForConversionDestination),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
DroppedEventLevelReportIs(absl::nullopt),
|
||||
CreateReportMaxEventLevelReportsLimitIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
DroppedEventLevelReportIs(std::nullopt),
|
||||
CreateReportMaxEventLevelReportsLimitIs(std::nullopt),
|
||||
CreateReportMaxAggregatableReportsLimitIs(1)));
|
||||
}
|
||||
|
||||
@ -1196,7 +1196,7 @@ TEST_F(AttributionStorageTest, MaxAttributionsBetweenSites) {
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kNotRegistered),
|
||||
CreateReportMaxAttributionsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxAttributionsLimitIs(std::nullopt)));
|
||||
|
||||
auto conversion2 = DefaultAggregatableTriggerBuilder(/*histogram_values=*/{5})
|
||||
.SetTriggerData(2)
|
||||
@ -1206,7 +1206,7 @@ TEST_F(AttributionStorageTest, MaxAttributionsBetweenSites) {
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
CreateReportMaxAttributionsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxAttributionsLimitIs(std::nullopt)));
|
||||
|
||||
auto conversion3 = DefaultAggregatableTriggerBuilder(/*histogram_values=*/{5})
|
||||
.SetTriggerData(3)
|
||||
@ -1218,9 +1218,9 @@ TEST_F(AttributionStorageTest, MaxAttributionsBetweenSites) {
|
||||
AttributionTrigger::EventLevelResult::kExcessiveAttributions),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kExcessiveAttributions),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
CreateReportMaxAttributionsLimitIs(2),
|
||||
DroppedEventLevelReportIs(absl::nullopt)));
|
||||
DroppedEventLevelReportIs(std::nullopt)));
|
||||
|
||||
const auto source = source_builder.SetAggregatableBudgetConsumed(5)
|
||||
.BuildStored();
|
||||
@ -1264,7 +1264,7 @@ TEST_F(AttributionStorageTest,
|
||||
StoreSourceResult result = storage()->StoreSource(
|
||||
TestAggregatableSourceProvider().GetBuilder().Build());
|
||||
EXPECT_EQ(result.status(), StorableSource::Result::kSuccessNoised);
|
||||
delegate()->set_randomized_response(absl::nullopt);
|
||||
delegate()->set_randomized_response(std::nullopt);
|
||||
|
||||
EXPECT_THAT(
|
||||
storage()->MaybeCreateAndStoreReport(
|
||||
@ -1293,7 +1293,7 @@ TEST_F(AttributionStorageTest,
|
||||
StoreSourceResult result =
|
||||
storage()->StoreSource(SourceBuilder().SetSourceEventId(5).Build());
|
||||
EXPECT_EQ(result.status(), StorableSource::Result::kSuccessNoised);
|
||||
delegate()->set_randomized_response(absl::nullopt);
|
||||
delegate()->set_randomized_response(std::nullopt);
|
||||
|
||||
EXPECT_THAT(storage()->GetActiveSources(), SizeIs(2u));
|
||||
|
||||
@ -1312,7 +1312,7 @@ TEST_F(AttributionStorageTest,
|
||||
{.trigger_data = 7, .window_index = 0}});
|
||||
StoreSourceResult result = storage()->StoreSource(SourceBuilder().Build());
|
||||
EXPECT_EQ(result.status(), StorableSource::Result::kSuccessNoised);
|
||||
delegate()->set_randomized_response(absl::nullopt);
|
||||
delegate()->set_randomized_response(std::nullopt);
|
||||
|
||||
EXPECT_THAT(storage()->GetActiveSources(), SizeIs(2u));
|
||||
|
||||
@ -1338,7 +1338,7 @@ TEST_F(AttributionStorageTest, NeverAttributeImpression_RateLimitsChanged) {
|
||||
.GetBuilder()
|
||||
.SetSourceEventId(5)
|
||||
.Build());
|
||||
delegate()->set_randomized_response(absl::nullopt);
|
||||
delegate()->set_randomized_response(std::nullopt);
|
||||
|
||||
EXPECT_THAT(
|
||||
storage()->MaybeCreateAndStoreReport(
|
||||
@ -1366,7 +1366,7 @@ TEST_F(AttributionStorageTest,
|
||||
|
||||
delegate()->set_randomized_response(std::vector<FakeEventLevelReport>{});
|
||||
storage()->StoreSource(builder.SetSourceEventId(5).Build());
|
||||
delegate()->set_randomized_response(absl::nullopt);
|
||||
delegate()->set_randomized_response(std::nullopt);
|
||||
|
||||
const auto trigger = DefaultAggregatableTriggerBuilder().Build();
|
||||
EXPECT_EQ(AttributionTrigger::AggregatableResult::kSuccess,
|
||||
@ -1399,7 +1399,7 @@ TEST_F(AttributionStorageTest,
|
||||
delegate()->set_randomized_response(std::vector<FakeEventLevelReport>{});
|
||||
|
||||
storage()->StoreSource(provider.GetBuilder().Build());
|
||||
delegate()->set_randomized_response(absl::nullopt);
|
||||
delegate()->set_randomized_response(std::nullopt);
|
||||
|
||||
const auto conversion = DefaultAggregatableTriggerBuilder().Build();
|
||||
|
||||
@ -1797,7 +1797,7 @@ TEST_F(AttributionStorageTest, FalselyAttributeImpression_ReportStored) {
|
||||
{.trigger_data = 1, .window_index = 0}});
|
||||
StoreSourceResult result = storage()->StoreSource(builder.Build());
|
||||
EXPECT_EQ(result.status(), StorableSource::Result::kSuccessNoised);
|
||||
delegate()->set_randomized_response(absl::nullopt);
|
||||
delegate()->set_randomized_response(std::nullopt);
|
||||
|
||||
AttributionReport expected_event_level_report =
|
||||
ReportBuilder(
|
||||
@ -1887,14 +1887,14 @@ TEST_F(AttributionStorageTest, StoreSource_ReturnsMinFakeReportTime) {
|
||||
::testing::Matcher<StoreSourceResult::Result> matches;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
VariantWith<StoreSourceResult::Success>(_),
|
||||
},
|
||||
{
|
||||
std::vector<FakeEventLevelReport>(),
|
||||
VariantWith<StoreSourceResult::SuccessNoised>(
|
||||
Field(&StoreSourceResult::SuccessNoised::min_fake_report_time,
|
||||
absl::nullopt)),
|
||||
std::nullopt)),
|
||||
},
|
||||
{
|
||||
std::vector<FakeEventLevelReport>{
|
||||
@ -1938,9 +1938,9 @@ TEST_F(AttributionStorageTest, TriggerPriority) {
|
||||
TriggerBuilder().SetPriority(0).SetDebugKey(20).Build()),
|
||||
AllOf(CreateReportEventLevelStatusIs(
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
CreateReportSourceIs(Optional(SourceEventIdIs(5u))),
|
||||
DroppedEventLevelReportIs(absl::nullopt)));
|
||||
DroppedEventLevelReportIs(std::nullopt)));
|
||||
|
||||
// This conversion should replace the one above because it has a higher
|
||||
// priority.
|
||||
@ -1952,7 +1952,7 @@ TEST_F(AttributionStorageTest, TriggerPriority) {
|
||||
kSuccessDroppedLowerPriority),
|
||||
ReplacedEventLevelReportIs(Optional(TriggerDebugKeyIs(20u))),
|
||||
CreateReportSourceIs(Optional(SourceEventIdIs(5u))),
|
||||
DroppedEventLevelReportIs(absl::nullopt)));
|
||||
DroppedEventLevelReportIs(std::nullopt)));
|
||||
|
||||
storage()->StoreSource(SourceBuilder()
|
||||
.SetSourceEventId(7)
|
||||
@ -1970,7 +1970,7 @@ TEST_F(AttributionStorageTest, TriggerPriority) {
|
||||
TriggerBuilder().SetPriority(0).SetDebugKey(23).Build()),
|
||||
AllOf(CreateReportEventLevelStatusIs(
|
||||
AttributionTrigger::EventLevelResult::kPriorityTooLow),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
CreateReportSourceIs(Optional(SourceEventIdIs(7u))),
|
||||
DroppedEventLevelReportIs(Optional(TriggerDebugKeyIs(23u)))));
|
||||
|
||||
@ -2188,7 +2188,7 @@ TEST_F(AttributionStorageTest, DedupKey_Dedups) {
|
||||
.Build());
|
||||
EXPECT_EQ(AttributionTrigger::EventLevelResult::kDeduplicated,
|
||||
result.event_level_status());
|
||||
EXPECT_EQ(result.replaced_event_level_report(), absl::nullopt);
|
||||
EXPECT_EQ(result.replaced_event_level_report(), std::nullopt);
|
||||
|
||||
// Shouldn't be stored because conversion destination and dedup key match.
|
||||
EXPECT_EQ(AttributionTrigger::EventLevelResult::kDeduplicated,
|
||||
@ -2584,7 +2584,7 @@ TEST_F(AttributionStorageTest, AggregatableDedupKeysFiltering) {
|
||||
{
|
||||
"null dedup key",
|
||||
attribution_reporting::AggregatableDedupKey(
|
||||
/*dedup_key=*/absl::nullopt,
|
||||
/*dedup_key=*/std::nullopt,
|
||||
FilterPair(/*positive=*/{*FilterConfig::Create({
|
||||
{"abc", {"123"}},
|
||||
})},
|
||||
@ -2726,7 +2726,7 @@ TEST_F(AttributionStorageTest,
|
||||
TriggerBuilder().SetDebugKey(20).Build()),
|
||||
AllOf(CreateReportEventLevelStatusIs(
|
||||
AttributionTrigger::EventLevelResult::kExcessiveReports),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
DroppedEventLevelReportIs(Optional(TriggerDebugKeyIs(20u)))));
|
||||
EXPECT_THAT(
|
||||
storage()->GetActiveSources(),
|
||||
@ -2746,12 +2746,12 @@ TEST_F(AttributionStorageTest, ReportID_RoundTrips) {
|
||||
}
|
||||
|
||||
TEST_F(AttributionStorageTest, AdjustOfflineReportTimes) {
|
||||
EXPECT_EQ(storage()->AdjustOfflineReportTimes(), absl::nullopt);
|
||||
EXPECT_EQ(storage()->AdjustOfflineReportTimes(), std::nullopt);
|
||||
|
||||
delegate()->set_offline_report_delay_config(
|
||||
AttributionStorageDelegate::OfflineReportDelayConfig{
|
||||
.min = base::Hours(1), .max = base::Hours(1)});
|
||||
EXPECT_EQ(storage()->AdjustOfflineReportTimes(), absl::nullopt);
|
||||
EXPECT_EQ(storage()->AdjustOfflineReportTimes(), std::nullopt);
|
||||
|
||||
storage()->StoreSource(TestAggregatableSourceProvider().GetBuilder().Build());
|
||||
EXPECT_THAT(storage()->MaybeCreateAndStoreReport(
|
||||
@ -2828,9 +2828,9 @@ TEST_F(AttributionStorageTest, AdjustOfflineReportTimes_Range) {
|
||||
|
||||
TEST_F(AttributionStorageTest,
|
||||
AdjustOfflineReportTimes_ReturnsMinReportTimeWithoutDelay) {
|
||||
delegate()->set_offline_report_delay_config(absl::nullopt);
|
||||
delegate()->set_offline_report_delay_config(std::nullopt);
|
||||
|
||||
ASSERT_EQ(storage()->AdjustOfflineReportTimes(), absl::nullopt);
|
||||
ASSERT_EQ(storage()->AdjustOfflineReportTimes(), std::nullopt);
|
||||
|
||||
storage()->StoreSource(SourceBuilder().Build());
|
||||
ASSERT_EQ(AttributionTrigger::EventLevelResult::kSuccess,
|
||||
@ -2848,7 +2848,7 @@ TEST_F(AttributionStorageTest, GetNextEventReportTime) {
|
||||
const auto origin_a = *SuitableOrigin::Deserialize("https://a.example/");
|
||||
const auto origin_b = *SuitableOrigin::Deserialize("https://b.example/");
|
||||
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), absl::nullopt);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), std::nullopt);
|
||||
|
||||
storage()->StoreSource(SourceBuilder().SetReportingOrigin(origin_a).Build());
|
||||
EXPECT_EQ(AttributionTrigger::EventLevelResult::kSuccess,
|
||||
@ -2858,7 +2858,7 @@ TEST_F(AttributionStorageTest, GetNextEventReportTime) {
|
||||
const base::Time report_time_a = base::Time::Now() + kReportDelay;
|
||||
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), report_time_a);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_a), absl::nullopt);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_a), std::nullopt);
|
||||
|
||||
task_environment_.FastForwardBy(base::Milliseconds(1));
|
||||
storage()->StoreSource(SourceBuilder().SetReportingOrigin(origin_b).Build());
|
||||
@ -2870,7 +2870,7 @@ TEST_F(AttributionStorageTest, GetNextEventReportTime) {
|
||||
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), report_time_a);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_a), report_time_b);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_b), absl::nullopt);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_b), std::nullopt);
|
||||
}
|
||||
|
||||
TEST_F(AttributionStorageTest, GetAttributionReports_Shuffles) {
|
||||
@ -3004,7 +3004,7 @@ TEST_F(AttributionStorageTest, MaybeCreateAndStoreReport_ReturnsNewReport) {
|
||||
AllOf(CreateReportEventLevelStatusIs(
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
NewEventLevelReportIs(Optional(EventLevelDataIs(_))),
|
||||
NewAggregatableReportIs(absl::nullopt)));
|
||||
NewAggregatableReportIs(std::nullopt)));
|
||||
}
|
||||
|
||||
// This is tested more thoroughly by the `RateLimitTable` unit tests. Here just
|
||||
@ -3080,7 +3080,7 @@ TEST_F(AttributionStorageTest, MaxReportingOriginsPerAttribution) {
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
CreateReportMaxAttributionReportingOriginsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxAttributionReportingOriginsLimitIs(std::nullopt)));
|
||||
|
||||
ASSERT_THAT(
|
||||
storage()->MaybeCreateAndStoreReport(
|
||||
@ -3089,7 +3089,7 @@ TEST_F(AttributionStorageTest, MaxReportingOriginsPerAttribution) {
|
||||
AttributionTrigger::EventLevelResult::kSuccess),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
CreateReportMaxAttributionReportingOriginsLimitIs(absl::nullopt)));
|
||||
CreateReportMaxAttributionReportingOriginsLimitIs(std::nullopt)));
|
||||
|
||||
ASSERT_THAT(
|
||||
storage()->MaybeCreateAndStoreReport(
|
||||
@ -3222,7 +3222,7 @@ TEST_F(AttributionStorageTest, RandomizedResponseRatePerSourceUsed) {
|
||||
// Will return minimum of next event-level report and next aggregatable report
|
||||
// time if both present.
|
||||
TEST_F(AttributionStorageTest, GetNextReportTime) {
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), absl::nullopt);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), std::nullopt);
|
||||
|
||||
storage()->StoreSource(TestAggregatableSourceProvider()
|
||||
.GetBuilder()
|
||||
@ -3235,7 +3235,7 @@ TEST_F(AttributionStorageTest, GetNextReportTime) {
|
||||
const base::Time report_time_a = base::Time::Now() + kReportDelay;
|
||||
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), report_time_a);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_a), absl::nullopt);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_a), std::nullopt);
|
||||
|
||||
task_environment_.FastForwardBy(base::Milliseconds(1));
|
||||
|
||||
@ -3247,7 +3247,7 @@ TEST_F(AttributionStorageTest, GetNextReportTime) {
|
||||
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), report_time_a);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_a), report_time_b);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_b), absl::nullopt);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_b), std::nullopt);
|
||||
|
||||
task_environment_.FastForwardBy(base::Milliseconds(1));
|
||||
|
||||
@ -3261,7 +3261,7 @@ TEST_F(AttributionStorageTest, GetNextReportTime) {
|
||||
EXPECT_EQ(storage()->GetNextReportTime(base::Time::Min()), report_time_a);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_a), report_time_b);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_b), report_time_c);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_c), absl::nullopt);
|
||||
EXPECT_EQ(storage()->GetNextReportTime(report_time_c), std::nullopt);
|
||||
}
|
||||
|
||||
TEST_F(AttributionStorageTest, TriggerDataSanitized) {
|
||||
@ -3532,8 +3532,8 @@ TEST_F(AttributionStorageTest,
|
||||
DefaultAggregatableTriggerBuilder().Build()),
|
||||
AllOf(CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kNoMatchingImpressions),
|
||||
NewEventLevelReportIs(absl::nullopt),
|
||||
NewAggregatableReportIs(absl::nullopt)));
|
||||
NewEventLevelReportIs(std::nullopt),
|
||||
NewAggregatableReportIs(std::nullopt)));
|
||||
EXPECT_THAT(storage()->GetAttributionReports(base::Time::Max()), IsEmpty());
|
||||
}
|
||||
|
||||
@ -3553,7 +3553,7 @@ TEST_F(AttributionStorageTest,
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kNoHistograms),
|
||||
NewEventLevelReportIs(Optional(EventLevelDataIs(TriggerDataIs(5)))),
|
||||
NewAggregatableReportIs(Eq(absl::nullopt))));
|
||||
NewAggregatableReportIs(Eq(std::nullopt))));
|
||||
}
|
||||
|
||||
TEST_F(AttributionStorageTest, AggregatableAttribution_ReportsScheduled) {
|
||||
@ -3629,8 +3629,8 @@ TEST_F(
|
||||
AttributionTrigger::EventLevelResult::kExcessiveReports),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kSuccess),
|
||||
ReplacedEventLevelReportIs(absl::nullopt),
|
||||
NewEventLevelReportIs(absl::nullopt),
|
||||
ReplacedEventLevelReportIs(std::nullopt),
|
||||
NewEventLevelReportIs(std::nullopt),
|
||||
NewAggregatableReportIs(Optional(AggregatableAttributionDataIs(
|
||||
AggregatableHistogramContributionsAre(
|
||||
DefaultAggregatableHistogramContributions(
|
||||
@ -3769,8 +3769,8 @@ TEST_F(AttributionStorageTest, NoEventTriggerData_NotRegisteredReturned) {
|
||||
AttributionTrigger::EventLevelResult::kNotRegistered),
|
||||
CreateReportAggregatableStatusIs(
|
||||
AttributionTrigger::AggregatableResult::kNoMatchingImpressions),
|
||||
NewEventLevelReportIs(absl::nullopt),
|
||||
NewAggregatableReportIs(absl::nullopt)));
|
||||
NewEventLevelReportIs(std::nullopt),
|
||||
NewAggregatableReportIs(std::nullopt)));
|
||||
EXPECT_THAT(storage()->GetAttributionReports(base::Time::Max()), IsEmpty());
|
||||
}
|
||||
|
||||
@ -3950,7 +3950,7 @@ TEST_F(AttributionStorageTest, TriggerDataMatching) {
|
||||
const char* desc;
|
||||
TriggerDataMatching trigger_data_matching;
|
||||
uint64_t trigger_data;
|
||||
absl::optional<uint64_t> expected_trigger_data;
|
||||
std::optional<uint64_t> expected_trigger_data;
|
||||
} kTestCases[] = {
|
||||
{"modulus-0", TriggerDataMatching::kModulus, 0, 0},
|
||||
{"modulus-7", TriggerDataMatching::kModulus, 7, 7},
|
||||
@ -3958,8 +3958,8 @@ TEST_F(AttributionStorageTest, TriggerDataMatching) {
|
||||
{"modulus-9", TriggerDataMatching::kModulus, 9, 1},
|
||||
{"exact-0", TriggerDataMatching::kExact, 0, 0},
|
||||
{"exact-7", TriggerDataMatching::kExact, 7, 7},
|
||||
{"exact-8", TriggerDataMatching::kExact, 8, absl::nullopt},
|
||||
{"exact-9", TriggerDataMatching::kExact, 9, absl::nullopt},
|
||||
{"exact-8", TriggerDataMatching::kExact, 8, std::nullopt},
|
||||
{"exact-9", TriggerDataMatching::kExact, 9, std::nullopt},
|
||||
};
|
||||
|
||||
for (const auto& test_case : kTestCases) {
|
||||
@ -3981,7 +3981,7 @@ TEST_F(AttributionStorageTest, TriggerDataMatching) {
|
||||
|
||||
auto reports = storage()->GetAttributionReports(base::Time::Max());
|
||||
|
||||
if (absl::optional<uint64_t> expected = test_case.expected_trigger_data) {
|
||||
if (std::optional<uint64_t> expected = test_case.expected_trigger_data) {
|
||||
EXPECT_THAT(reports,
|
||||
ElementsAre(EventLevelDataIs(TriggerDataIs(*expected))));
|
||||
} else {
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -43,7 +44,6 @@
|
||||
#include "services/network/public/cpp/trigger_verification_test_utils.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -137,7 +137,7 @@ SourceBuilder& SourceBuilder::SetFilterData(
|
||||
return *this;
|
||||
}
|
||||
|
||||
SourceBuilder& SourceBuilder::SetDebugKey(absl::optional<uint64_t> debug_key) {
|
||||
SourceBuilder& SourceBuilder::SetDebugKey(std::optional<uint64_t> debug_key) {
|
||||
registration_.debug_key = debug_key;
|
||||
return *this;
|
||||
}
|
||||
@ -287,14 +287,12 @@ TriggerBuilder& TriggerBuilder::SetPriority(int64_t priority) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
TriggerBuilder& TriggerBuilder::SetDedupKey(
|
||||
absl::optional<uint64_t> dedup_key) {
|
||||
TriggerBuilder& TriggerBuilder::SetDedupKey(std::optional<uint64_t> dedup_key) {
|
||||
dedup_key_ = dedup_key;
|
||||
return *this;
|
||||
}
|
||||
|
||||
TriggerBuilder& TriggerBuilder::SetDebugKey(
|
||||
absl::optional<uint64_t> debug_key) {
|
||||
TriggerBuilder& TriggerBuilder::SetDebugKey(std::optional<uint64_t> debug_key) {
|
||||
debug_key_ = debug_key;
|
||||
return *this;
|
||||
}
|
||||
@ -313,7 +311,7 @@ TriggerBuilder& TriggerBuilder::SetAggregatableValues(
|
||||
}
|
||||
|
||||
TriggerBuilder& TriggerBuilder::SetAggregatableDedupKey(
|
||||
absl::optional<uint64_t> aggregatable_dedup_key) {
|
||||
std::optional<uint64_t> aggregatable_dedup_key) {
|
||||
aggregatable_dedup_key_ = aggregatable_dedup_key;
|
||||
return *this;
|
||||
}
|
||||
@ -404,7 +402,7 @@ AttributionInfoBuilder& AttributionInfoBuilder::SetTime(base::Time time) {
|
||||
}
|
||||
|
||||
AttributionInfoBuilder& AttributionInfoBuilder::SetDebugKey(
|
||||
absl::optional<uint64_t> debug_key) {
|
||||
std::optional<uint64_t> debug_key) {
|
||||
debug_key_ = debug_key;
|
||||
return *this;
|
||||
}
|
||||
@ -461,7 +459,7 @@ ReportBuilder& ReportBuilder::SetAggregationCoordinatorOrigin(
|
||||
}
|
||||
|
||||
ReportBuilder& ReportBuilder::SetVerificationToken(
|
||||
absl::optional<std::string> verification_token) {
|
||||
std::optional<std::string> verification_token) {
|
||||
verification_token_ = std::move(verification_token);
|
||||
return *this;
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -31,7 +32,6 @@
|
||||
#include "content/browser/attribution_reporting/stored_source.h"
|
||||
#include "content/public/browser/attribution_data_model.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
class AggregationKeys;
|
||||
@ -95,7 +95,7 @@ class SourceBuilder {
|
||||
|
||||
SourceBuilder& SetActiveState(StoredSource::ActiveState active_state);
|
||||
|
||||
SourceBuilder& SetDebugKey(absl::optional<uint64_t> debug_key);
|
||||
SourceBuilder& SetDebugKey(std::optional<uint64_t> debug_key);
|
||||
|
||||
SourceBuilder& SetSourceId(StoredSource::Id source_id);
|
||||
|
||||
@ -177,9 +177,9 @@ class TriggerBuilder {
|
||||
|
||||
TriggerBuilder& SetPriority(int64_t priority);
|
||||
|
||||
TriggerBuilder& SetDedupKey(absl::optional<uint64_t> dedup_key);
|
||||
TriggerBuilder& SetDedupKey(std::optional<uint64_t> dedup_key);
|
||||
|
||||
TriggerBuilder& SetDebugKey(absl::optional<uint64_t> debug_key);
|
||||
TriggerBuilder& SetDebugKey(std::optional<uint64_t> debug_key);
|
||||
|
||||
TriggerBuilder& SetAggregatableTriggerData(
|
||||
std::vector<attribution_reporting::AggregatableTriggerData>);
|
||||
@ -188,7 +188,7 @@ class TriggerBuilder {
|
||||
attribution_reporting::AggregatableValues);
|
||||
|
||||
TriggerBuilder& SetAggregatableDedupKey(
|
||||
absl::optional<uint64_t> aggregatable_dedup_key);
|
||||
std::optional<uint64_t> aggregatable_dedup_key);
|
||||
|
||||
TriggerBuilder& SetAggregatableDedupKeyFilterPair(
|
||||
attribution_reporting::FilterPair filter_pair);
|
||||
@ -218,22 +218,22 @@ class TriggerBuilder {
|
||||
attribution_reporting::SuitableOrigin reporting_origin_;
|
||||
attribution_reporting::FilterPair filter_pair_;
|
||||
int64_t priority_ = 0;
|
||||
absl::optional<uint64_t> dedup_key_;
|
||||
absl::optional<uint64_t> debug_key_;
|
||||
std::optional<uint64_t> dedup_key_;
|
||||
std::optional<uint64_t> debug_key_;
|
||||
std::vector<attribution_reporting::AggregatableTriggerData>
|
||||
aggregatable_trigger_data_;
|
||||
attribution_reporting::AggregatableValues aggregatable_values_;
|
||||
absl::optional<uint64_t> aggregatable_dedup_key_;
|
||||
std::optional<uint64_t> aggregatable_dedup_key_;
|
||||
attribution_reporting::FilterPair aggregatable_dedup_key_filter_pair_;
|
||||
bool is_within_fenced_frame_ = false;
|
||||
bool debug_reporting_ = false;
|
||||
absl::optional<attribution_reporting::SuitableOrigin>
|
||||
std::optional<attribution_reporting::SuitableOrigin>
|
||||
aggregation_coordinator_origin_;
|
||||
std::vector<network::TriggerVerification> verifications_;
|
||||
attribution_reporting::mojom::SourceRegistrationTimeConfig
|
||||
source_registration_time_config_ =
|
||||
attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude;
|
||||
absl::optional<std::string> trigger_context_id_;
|
||||
std::optional<std::string> trigger_context_id_;
|
||||
};
|
||||
|
||||
// Helper class to construct an `AttributionInfo` for tests using default data.
|
||||
@ -248,13 +248,13 @@ class AttributionInfoBuilder {
|
||||
|
||||
AttributionInfoBuilder& SetTime(base::Time time);
|
||||
|
||||
AttributionInfoBuilder& SetDebugKey(absl::optional<uint64_t> debug_key);
|
||||
AttributionInfoBuilder& SetDebugKey(std::optional<uint64_t> debug_key);
|
||||
|
||||
AttributionInfo Build() const;
|
||||
|
||||
private:
|
||||
base::Time time_;
|
||||
absl::optional<uint64_t> debug_key_;
|
||||
std::optional<uint64_t> debug_key_;
|
||||
attribution_reporting::SuitableOrigin context_origin_;
|
||||
};
|
||||
|
||||
@ -285,7 +285,7 @@ class ReportBuilder {
|
||||
attribution_reporting::mojom::SourceRegistrationTimeConfig);
|
||||
|
||||
ReportBuilder& SetVerificationToken(
|
||||
absl::optional<std::string> verification_token);
|
||||
std::optional<std::string> verification_token);
|
||||
|
||||
ReportBuilder& SetTriggerContextId(std::string trigger_context_id);
|
||||
|
||||
@ -304,14 +304,14 @@ class ReportBuilder {
|
||||
base::Uuid external_report_id_;
|
||||
AttributionReport::Id report_id_{0};
|
||||
std::vector<AggregatableHistogramContribution> contributions_;
|
||||
absl::optional<attribution_reporting::SuitableOrigin>
|
||||
std::optional<attribution_reporting::SuitableOrigin>
|
||||
aggregation_coordinator_origin_;
|
||||
|
||||
absl::optional<std::string> verification_token_;
|
||||
std::optional<std::string> verification_token_;
|
||||
attribution_reporting::mojom::SourceRegistrationTimeConfig
|
||||
source_registration_time_config_ =
|
||||
attribution_reporting::mojom::SourceRegistrationTimeConfig::kInclude;
|
||||
absl::optional<std::string> trigger_context_id_;
|
||||
std::optional<std::string> trigger_context_id_;
|
||||
};
|
||||
|
||||
bool operator==(const StoredSource&, const StoredSource&);
|
||||
|
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -68,7 +69,6 @@
|
||||
#include "services/network/test/test_network_connection_tracker.h"
|
||||
#include "testing/gmock/include/gmock/gmock.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/features.h"
|
||||
#include "third_party/blink/public/common/fenced_frame/fenced_frame_utils.h"
|
||||
#include "third_party/blink/public/common/fenced_frame/redacted_fenced_frame_config.h"
|
||||
@ -1446,7 +1446,7 @@ class AttributionsFencedFrameBrowserTest : public AttributionsBrowserTest {
|
||||
/*main_frame_origin=*/
|
||||
web_contents()->GetPrimaryMainFrame()->GetLastCommittedOrigin(),
|
||||
/*winner_origin=*/url::Origin::Create(GURL("https://a.test")),
|
||||
/*winner_aggregation_coordinator_origin=*/absl::nullopt);
|
||||
/*winner_aggregation_coordinator_origin=*/std::nullopt);
|
||||
}
|
||||
|
||||
private:
|
||||
@ -1454,7 +1454,7 @@ class AttributionsFencedFrameBrowserTest : public AttributionsBrowserTest {
|
||||
FencedFrameURLMapping* fenced_frame_url_mapping,
|
||||
const GURL& https_url,
|
||||
scoped_refptr<FencedFrameReporter> fenced_frame_reporter) {
|
||||
absl::optional<GURL> urn_uuid =
|
||||
std::optional<GURL> urn_uuid =
|
||||
fenced_frame_url_mapping->AddFencedFrameURLForTesting(
|
||||
https_url, std::move(fenced_frame_reporter));
|
||||
EXPECT_TRUE(urn_uuid.has_value());
|
||||
|
@ -23,13 +23,13 @@ CreateReportResult::CreateReportResult(
|
||||
base::Time trigger_time,
|
||||
EventLevelResult event_level_status,
|
||||
AggregatableResult aggregatable_status,
|
||||
absl::optional<AttributionReport> replaced_event_level_report,
|
||||
absl::optional<AttributionReport> new_event_level_report,
|
||||
absl::optional<AttributionReport> new_aggregatable_report,
|
||||
absl::optional<StoredSource> source,
|
||||
std::optional<AttributionReport> replaced_event_level_report,
|
||||
std::optional<AttributionReport> new_event_level_report,
|
||||
std::optional<AttributionReport> new_aggregatable_report,
|
||||
std::optional<StoredSource> source,
|
||||
Limits limits,
|
||||
absl::optional<AttributionReport> dropped_event_level_report,
|
||||
absl::optional<base::Time> min_null_aggregatable_report_time)
|
||||
std::optional<AttributionReport> dropped_event_level_report,
|
||||
std::optional<base::Time> min_null_aggregatable_report_time)
|
||||
: trigger_time_(trigger_time),
|
||||
event_level_status_(event_level_status),
|
||||
aggregatable_status_(aggregatable_status),
|
||||
|
@ -7,53 +7,54 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/time/time.h"
|
||||
#include "content/browser/attribution_reporting/attribution_report.h"
|
||||
#include "content/browser/attribution_reporting/attribution_trigger.h"
|
||||
#include "content/browser/attribution_reporting/stored_source.h"
|
||||
#include "content/common/content_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
|
||||
class CONTENT_EXPORT CreateReportResult {
|
||||
public:
|
||||
struct Limits {
|
||||
// `absl::nullopt` unless `event_level_status_` or `aggregatable_status_` is
|
||||
// `std::nullopt` unless `event_level_status_` or `aggregatable_status_` is
|
||||
// `kExcessiveAttributions`.
|
||||
absl::optional<int64_t> rate_limits_max_attributions;
|
||||
std::optional<int64_t> rate_limits_max_attributions;
|
||||
|
||||
// `absl::nullopt` unless `event_level_status_` or `aggregatable_status_` is
|
||||
// `std::nullopt` unless `event_level_status_` or `aggregatable_status_` is
|
||||
// `kExcessiveReportingOrigins`.
|
||||
absl::optional<int64_t> rate_limits_max_attribution_reporting_origins;
|
||||
std::optional<int64_t> rate_limits_max_attribution_reporting_origins;
|
||||
|
||||
// `absl::nullopt` unless `event_level_status_` is
|
||||
// `std::nullopt` unless `event_level_status_` is
|
||||
// `kNoCapacityForConversionDestination`.
|
||||
absl::optional<int> max_event_level_reports_per_destination;
|
||||
std::optional<int> max_event_level_reports_per_destination;
|
||||
|
||||
// `absl::nullopt` unless `aggregatable_status_` is
|
||||
// `std::nullopt` unless `aggregatable_status_` is
|
||||
// `kNoCapacityForConversionDestination`.
|
||||
absl::optional<int> max_aggregatable_reports_per_destination;
|
||||
std::optional<int> max_aggregatable_reports_per_destination;
|
||||
|
||||
// `absl::nullopt` unless `aggregatable_status_` is
|
||||
// `std::nullopt` unless `aggregatable_status_` is
|
||||
// `kExcessiveReports`..
|
||||
absl::optional<int> max_aggregatable_reports_per_source;
|
||||
std::optional<int> max_aggregatable_reports_per_source;
|
||||
};
|
||||
|
||||
CreateReportResult(
|
||||
base::Time trigger_time,
|
||||
AttributionTrigger::EventLevelResult event_level_status,
|
||||
AttributionTrigger::AggregatableResult aggregatable_status,
|
||||
absl::optional<AttributionReport> replaced_event_level_report =
|
||||
absl::nullopt,
|
||||
absl::optional<AttributionReport> new_event_level_report = absl::nullopt,
|
||||
absl::optional<AttributionReport> new_aggregatable_report = absl::nullopt,
|
||||
absl::optional<StoredSource> source = absl::nullopt,
|
||||
std::optional<AttributionReport> replaced_event_level_report =
|
||||
std::nullopt,
|
||||
std::optional<AttributionReport> new_event_level_report = std::nullopt,
|
||||
std::optional<AttributionReport> new_aggregatable_report = std::nullopt,
|
||||
std::optional<StoredSource> source = std::nullopt,
|
||||
Limits limits = Limits(),
|
||||
absl::optional<AttributionReport> dropped_event_level_report =
|
||||
absl::nullopt,
|
||||
absl::optional<base::Time> min_null_aggregatble_report_time =
|
||||
absl::nullopt);
|
||||
std::optional<AttributionReport> dropped_event_level_report =
|
||||
std::nullopt,
|
||||
std::optional<base::Time> min_null_aggregatble_report_time =
|
||||
std::nullopt);
|
||||
~CreateReportResult();
|
||||
|
||||
CreateReportResult(const CreateReportResult&);
|
||||
@ -72,35 +73,35 @@ class CONTENT_EXPORT CreateReportResult {
|
||||
return aggregatable_status_;
|
||||
}
|
||||
|
||||
const absl::optional<AttributionReport>& replaced_event_level_report() const {
|
||||
const std::optional<AttributionReport>& replaced_event_level_report() const {
|
||||
return replaced_event_level_report_;
|
||||
}
|
||||
|
||||
const absl::optional<AttributionReport>& new_event_level_report() const {
|
||||
const std::optional<AttributionReport>& new_event_level_report() const {
|
||||
return new_event_level_report_;
|
||||
}
|
||||
|
||||
absl::optional<AttributionReport>& new_event_level_report() {
|
||||
std::optional<AttributionReport>& new_event_level_report() {
|
||||
return new_event_level_report_;
|
||||
}
|
||||
|
||||
const absl::optional<AttributionReport>& new_aggregatable_report() const {
|
||||
const std::optional<AttributionReport>& new_aggregatable_report() const {
|
||||
return new_aggregatable_report_;
|
||||
}
|
||||
|
||||
absl::optional<AttributionReport>& new_aggregatable_report() {
|
||||
std::optional<AttributionReport>& new_aggregatable_report() {
|
||||
return new_aggregatable_report_;
|
||||
}
|
||||
|
||||
const absl::optional<StoredSource>& source() const { return source_; }
|
||||
const std::optional<StoredSource>& source() const { return source_; }
|
||||
|
||||
const Limits& limits() const { return limits_; }
|
||||
|
||||
const absl::optional<AttributionReport>& dropped_event_level_report() const {
|
||||
const std::optional<AttributionReport>& dropped_event_level_report() const {
|
||||
return dropped_event_level_report_;
|
||||
}
|
||||
|
||||
absl::optional<base::Time> min_null_aggregatable_report_time() const {
|
||||
std::optional<base::Time> min_null_aggregatable_report_time() const {
|
||||
return min_null_aggregatable_report_time_;
|
||||
}
|
||||
|
||||
@ -111,27 +112,27 @@ class CONTENT_EXPORT CreateReportResult {
|
||||
|
||||
AttributionTrigger::AggregatableResult aggregatable_status_;
|
||||
|
||||
// `absl::nullopt` unless `event_level_status_` is
|
||||
// `std::nullopt` unless `event_level_status_` is
|
||||
// `kSuccessDroppedLowerPriority`.
|
||||
absl::optional<AttributionReport> replaced_event_level_report_;
|
||||
std::optional<AttributionReport> replaced_event_level_report_;
|
||||
|
||||
// `absl::nullopt` unless `event_level_status_` is `kSuccess` or
|
||||
// `std::nullopt` unless `event_level_status_` is `kSuccess` or
|
||||
// `kSuccessDroppedLowerPriority`.
|
||||
absl::optional<AttributionReport> new_event_level_report_;
|
||||
std::optional<AttributionReport> new_event_level_report_;
|
||||
|
||||
// `absl::nullopt` unless `aggregatable_status_` is `kSuccess`.
|
||||
absl::optional<AttributionReport> new_aggregatable_report_;
|
||||
// `std::nullopt` unless `aggregatable_status_` is `kSuccess`.
|
||||
std::optional<AttributionReport> new_aggregatable_report_;
|
||||
|
||||
// `absl::nullopt` if there's no matching source.
|
||||
absl::optional<StoredSource> source_;
|
||||
// `std::nullopt` if there's no matching source.
|
||||
std::optional<StoredSource> source_;
|
||||
|
||||
Limits limits_;
|
||||
|
||||
// `absl::nullopt` unless `event_level_status_` is `kPriorityTooLow` or
|
||||
// `std::nullopt` unless `event_level_status_` is `kPriorityTooLow` or
|
||||
// `kExcessiveReports`.
|
||||
absl::optional<AttributionReport> dropped_event_level_report_;
|
||||
std::optional<AttributionReport> dropped_event_level_report_;
|
||||
|
||||
absl::optional<base::Time> min_null_aggregatable_report_time_;
|
||||
std::optional<base::Time> min_null_aggregatable_report_time_;
|
||||
};
|
||||
|
||||
} // namespace content
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user