Rename {absl => std}::optional in //components/
#cleanup Automated patch. This is a no-op. Please avoid, to assign unrelated bugs to this, as much as possible. Context: https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email 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 "^components/" \ | grep \ -e "\.h" \ -e "\.cc" \ -e "\.mm" \ | grep -v \ -e "components/cast_streaming/browser/public/receiver_config.*" \ -e "components/power_metrics/*" \ -e "components/zucchini/patch_reader.*" \ | sort \ | uniq \ | 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>" echo "Formatting:" echo "IncludeBlocks: Regroup" >> ".clang-format" echo "IncludeIsMainRegex: \"(_(android|apple|chromeos|freebsd|fuchsia|fuzzer|ios|linux|mac|nacl|openbsd|posix|stubs?|win))?(_(unit|browser|perf)?tests?)?$\"" >> ".clang-format" git cl format git restore ".clang-format" git cl format ``` Bug: chromium:1500249 Change-Id: I34b45aba082a627d94fd9d3f9f994a60c64b40b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5200092 Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Owners-Override: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/main@{#1252820}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
f903b2778c
commit
c571efbef3
components
access_code_cast
account_id
account_manager_core
account_manager_facade.haccount_manager_facade_impl.ccaccount_manager_facade_impl_unittest.ccaccount_manager_util.ccaccount_manager_util.haccount_upsertion_result.ccaccount_upsertion_result.h
chromeos
aggregation_service
allocation_recorder
crash_handler
android_autofill
browser
apdu
arc
intent_helper
attribution_reporting
aggregatable_dedup_key.ccaggregatable_dedup_key.haggregatable_dedup_key_unittest.ccaggregatable_trigger_config.ccaggregatable_trigger_config.haggregatable_trigger_config_unittest.ccaggregatable_trigger_data.ccaggregatable_trigger_data.haggregatable_values.ccaggregatable_values.haggregatable_values_unittest.ccaggregation_keys.ccaggregation_keys.haggregation_keys_unittest.ccdestination_set.ccdestination_set.hevent_level_epsilon.ccevent_report_windows.ccevent_report_windows.hevent_report_windows_unittest.ccevent_trigger_data.ccevent_trigger_data.hevent_trigger_data_unittest.ccfilters.ccfilters.hfilters_unittest.ccmax_event_level_reports.ccos_registration.ccparsing_utils.ccparsing_utils.hparsing_utils_unittest.ccregistration_mojom_traits.ccregistration_mojom_traits.hsource_registration.ccsource_registration.hsource_registration_fuzzer.ccsource_registration_unittest.ccsuitable_origin.ccsuitable_origin.hsuitable_origin_unittest.cctest_utils.cctest_utils.htrigger_config.cctrigger_config.htrigger_registration.cctrigger_registration.htrigger_registration_fuzzer.cctrigger_registration_unittest.cc
autofill
core
browser
ios
background_sync
background_task_scheduler
blocked_content
popup_blocker_tab_helper.ccpopup_navigation_delegate.hpopup_opener_tab_helper.hpopup_tracker.hsafe_browsing_triggered_popup_blocker.ccsafe_browsing_triggered_popup_blocker.h
test
blocklist
opt_out_blocklist
bookmarks
browser
bookmark_codec.ccbookmark_model.ccbookmark_model.hbookmark_model_unittest.ccbookmark_storage.ccbookmark_utils.cctitled_url_index.cctitled_url_index.h
managed
breadcrumbs
core
browser_sync
browser_ui
site_settings
android
browsing_data
content
browsing_data_model.ccbrowsing_data_model.hbrowsing_data_model_unittest.cccookie_helper_unittest.ccfile_system_helper_unittest.cclocal_storage_helper_browsertest.ccmock_cookie_helper.ccmock_cookie_helper.htest_browsing_data_model_delegate.cctest_browsing_data_model_delegate.h
core
browsing_topics
annotator.hannotator_fuzzer.ccannotator_impl.ccannotator_impl.hannotator_impl_unittest.ccannotator_noop.ccannotator_noop.hbrowsing_topics_calculator.ccbrowsing_topics_page_load_data_tracker_unittest.ccbrowsing_topics_service_impl.ccbrowsing_topics_service_impl_unittest.ccbrowsing_topics_state.ccbrowsing_topics_state.hbrowsing_topics_state_unittest.cc
common
epoch_topics.ccepoch_topics.htest_util.cctest_util.htopic_and_domains.cccast
message_port
cast_receiver
browser
cast_streaming
browser
cast_message_port_impl.cccast_message_port_impl_unittest.cccast_streaming_session.cccast_streaming_session.h
common
control
playback_command_dispatcher.ccplayback_command_dispatcher.h
remoting
renderer_control_multiplexer.ccrenderer_control_multiplexer.hframe
receiver_config.ccreceiver_session_impl.ccreceiver_session_impl.hcommon
renderer
common
control
playback_command_forwarding_renderer.ccplayback_command_forwarding_renderer.hplayback_command_forwarding_renderer_unittest.cc
frame
test
cbor
cdm
browser
common
renderer
chromeos_camera
client_hints
browser
cloud_devices
commerce
core
account_checker.ccaccount_checker_unittest.cc
android
bookmark_update_manager.ccbookmark_update_manager.hcommerce_heuristics_data.cccommerce_heuristics_data.hcommerce_types.hdiscounts_storage_unittest.ccinternals
metrics
mock_shopping_service.ccmock_shopping_service.hparcel
price_tracking_utils.ccprice_tracking_utils.hprice_tracking_utils_unittest.ccshopping_bookmark_model_observer.ccshopping_bookmark_model_observer.hshopping_power_bookmark_data_provider.ccshopping_service.ccshopping_service.hshopping_service_metrics_unittest.ccshopping_service_test_base.hshopping_service_unittest.ccsubscriptions
commerce_subscription.cccommerce_subscription.hsubscriptions_server_proxy.ccsubscriptions_server_proxy.hsubscriptions_server_proxy_unittest.ccsubscriptions_storage.cc
test_utils.cctest_utils.hwebui
component_updater
android
component_installer.cccomponent_installer.hcomponent_installer_unittest.cccomponent_updater_service.cccomponent_updater_service_internal.hcomponent_updater_utils.cccomponent_updater_utils.hconfigurator_impl.ccconfigurator_impl.hinstaller_policies
masked_domain_list_component_installer_policy.ccmasked_domain_list_component_installer_policy.hmasked_domain_list_component_installer_policy_unittest.ccoptimization_hints_component_installer_unittest.cctpcd_metadata_component_installer_policy.cctrust_token_key_commitments_component_installer_policy.cctrust_token_key_commitments_component_installer_policy.h
consent_auditor
content_capture
android
test_support
browser
content_relationship_verification
content_settings
android
browser
content_settings_manager_impl.ccpage_specific_content_settings.ccpage_specific_content_settings_unittest.cc
ui
core
browser
content_settings_policy_provider.cccontent_settings_pref.cccontent_settings_pref_provider.cccontent_settings_pref_provider.hcookie_settings_unittest.cchost_content_settings_map.cchost_content_settings_map.huser_modifiable_provider.h
common
renderer
contextual_search
core
crash
content
browser
core
cronet
android
cronet_url_request.ccnative
generated
native_metrics_util.ccnative_metrics_util.hnative_metrics_util_test.ccperftest
url_request.cctools
generators
crx_file
custom_handlers
desks_storage
core
device_reauth
device_signals
core
browser
agent_signals_collector.ccagent_signals_collector.hagent_signals_collector_unittest.cc
ash
crowdstrike_client.cccrowdstrike_client.hcrowdstrike_client_unittest.ccmetrics_utils.ccmetrics_utils.hsettings_signals_collector_unittest.ccsignals_types.huser_permission_service_impl_unittest.ccwin
common
cached_signal.hcommon_types.cccommon_types.h
mojom
system_signals_mojom_traits_common.ccsystem_signals_mojom_traits_common.hsystem_signals_mojom_traits_win.cc
platform_utils.hposix
win
system_signals
test
devtools
simple_devtools_protocol_client
discardable_memory
dom_distiller
content
browser
distillability_driver.hdistillable_page_utils.ccdistillable_page_utils.h
test
test_distillability_observer.hrenderer
core
domain_reliability
download
content
database
internal
background_service
controller_impl.cccontroller_impl.hcontroller_impl_unittest.ccdownload_driver.hdownload_store_unittest.ccdriver_entry.hfile_monitor_unittest.ccin_memory_download_driver.ccin_memory_download_driver.hin_memory_download_driver_unittest.cc
ios
log_source.hlogger_impl.ccstartup_status.htest
common
network
public
background_service
common
embedder_support
android
contextmenu
util
endpoint_fetcher
endpoint_fetcher.ccendpoint_fetcher.hendpoint_fetcher_unittest.ccmock_endpoint_fetcher.ccmock_endpoint_fetcher.h
enterprise
browser
content
clipboard_restriction_service.ccclipboard_restriction_service_unittest.cccopy_prevention_settings_policy_handler.cccopy_prevention_settings_policy_handler_unittests.cc
data_controls
idle
error_page
exo
client_controlled_shell_surface.ccclient_controlled_shell_surface.hdata_offer.ccdata_offer_unittest.ccdata_source.ccdata_source.hdata_source_delegate.hdata_source_unittest.ccdrag_drop_operation.ccdrag_drop_operation_unittest.ccextended_drag_source.ccextended_drag_source.hlayer_tree_frame_sink_holder.cclayer_tree_frame_sink_holder.hnotification.ccnotification.hnotification_surface.ccnotification_unittest.ccpointer.ccpointer.hpointer_unittest.ccseat.ccseat_unittest.ccshell_surface.ccshell_surface.hshell_surface_base.ccshell_surface_base.hshell_surface_presentation_time_recorder.ccshell_surface_presentation_time_recorder.hshell_surface_unittest.ccshell_surface_util.ccshell_surface_util.hsub_surface.ccsub_surface.hsub_surface_unittest.ccsurface.ccsurface.hsurface_tree_host.ccsurface_tree_host.hsurface_tree_host_unittest.ccsurface_unittest.ccwl_data_device_manager.cczaura_shell.cczaura_shell.hzcr_notification_shell.cczcr_touchpad_haptics.cczcr_ui_controls.cczwp_text_input_manager.cc
test
text_input.cctext_input.htext_input_unittest.cctouch.cctouch_unittest.ccui_lock_controller.ccwayland
clients
compatibility_test
template_client_event_receiver_version_tests.cc.tmplwayland_client_event_recorder.hwayland_client_registry.ccwayland_client_registry.h
serial_tracker.ccserial_tracker.hsurface_augmenter.cctest
wlcs
eye_dropper
favicon
core
feature_engagement
internal
android
availability_model.havailability_model_impl.ccavailability_model_impl.havailability_model_impl_unittest.cccondition_validator.hfeature_config_condition_validator.ccfeature_config_condition_validator.hfeature_config_condition_validator_unittest.ccinit_aware_event_model_unittest.ccnever_availability_model.ccnever_availability_model.hnever_availability_model_unittest.ccnever_condition_validator.ccnever_condition_validator.honce_condition_validator.cconce_condition_validator.honce_condition_validator_unittest.ccpersistent_availability_store_unittest.ccpersistent_event_store_unittest.cctracker_impl.cctracker_impl.htracker_impl_unittest.ccpublic
android
configuration.ccconfiguration.hfeature_configurations.ccfeature_configurations.hgroup_configurations.ccgroup_configurations.hios_promo_feature_configuration.ccios_promo_feature_configuration.hscalable_iph_feature_configurations.ccscalable_iph_feature_configurations.htracker.htest
feed
core
v2
api_test
feed_network.hfeed_network_impl.ccfeed_network_impl.hfeed_store_unittest.ccfeed_stream.ccfeed_stream.hfeedstore_util.ccfeedstore_util.hfeedstore_util_unittest.ccimage_fetcher.ccimage_fetcher.hios_shared_experiments_translator.ccios_shared_experiments_translator.hios_shared_experiments_translator_unittest.ccmetrics_reporter.ccmetrics_reporter.hprotocol_translator.ccprotocol_translator.hprotocol_translator_unittest.ccpublic
scheduling.ccstream_model_unittest.cctasks
test
types.cctypes_unittest.ccweb_feed_subscription_coordinator.ccweb_feed_subscription_coordinator.hweb_feed_subscriptions
feedback
fuchsia_component_support
fuchsia_legacymetrics
gcm_driver
global_media_controls
public
guest_view
gwp_asan
client
common
crash_handler
headless
heap_profiling
history
core
browser
expire_history_backend.ccexpire_history_backend.hexpire_history_backend_unittest.cchistory_backend.cchistory_backend.hhistory_backend_notifier.hhistory_backend_unittest.cchistory_service.cchistory_service.hhistory_service_observer.hhistory_service_unittest.cchistory_types.cchistory_types.hkeyword_search_term.h
sync
delete_directive_handler.ccdelete_directive_handler.hdelete_directive_handler_unittest.cchistory_backend_for_sync.hhistory_sync_bridge.cchistory_sync_bridge.hhistory_sync_bridge_unittest.cctest_history_backend_for_sync.cctest_history_backend_for_sync.h
top_sites_impl.ccurl_row.ccurl_row.hvisit_annotations_database.ccvisit_annotations_database_unittest.ccvisit_tracker.hweb_history_service.ccweb_history_service.hweb_history_service_unittest.cctest
history_clusters
core
cluster_interaction_state_processor_unittest.ccclusterer.ccclustering_test_utils.ccclustering_test_utils.hcontext_clusterer_history_service_observer.ccfile_clustering_backend.cchistory_cluster_type_utils.cchistory_clusters_service.cchistory_clusters_service.hhistory_clusters_service_task_update_cluster_triggerability.hhistory_clusters_types.hhistory_clusters_util_unittest.cclabel_cluster_finalizer.cclabel_cluster_finalizer_unittest.ccon_device_clustering_backend.ccon_device_clustering_backend.hon_device_clustering_backend_unittest.ccon_device_clustering_util_unittest.ccranking_cluster_finalizer.h
ui
image_fetcher
core
invalidation
impl
js_injection
language
content
browser
ulp_language_code_locator
ios
lens
leveldb_proto
link_header_util
live_caption
caption_bubble_context.hcaption_bubble_context_remote.cccaption_bubble_context_remote_unittest.cccaption_bubble_controller.hcaption_util.cccaption_util.hlive_caption_controller.h
views
local_state
lookalikes
manta
media_device_salt
media_device_salt_database.ccmedia_device_salt_database.hmedia_device_salt_database_unittest.ccmedia_device_salt_service.ccmedia_device_salt_service.h
media_message_center
media_controls_progress_view.ccmedia_notification_background_impl.ccmedia_notification_background_impl.hmedia_notification_background_impl_unittest.ccmedia_notification_item.hmedia_notification_view_impl.ccmedia_notification_view_impl.hmock_media_notification_item.h
media_router
browser
android
media_router_android.ccmedia_router_android.hmedia_router_android_bridge.ccmedia_router_android_unittest.cc
media_router_metrics.ccmedia_router_metrics.hmedia_router_metrics_unittest.ccmedia_sinks_observer.hmirroring_to_flinging_switcher_unittest.ccpresentation
common
memory_pressure
memory_pressure_voter.ccmemory_pressure_voter.hmemory_pressure_voter_unittest.ccmulti_source_memory_pressure_monitor_unittest.cc
memory_system
metal_util
metrics
call_stacks
call_stack_profile_builder_unittest.cccall_stack_profile_metadata.cccall_stack_profile_metadata.hcall_stack_profile_metadata_unittest.cccall_stack_profile_metrics_provider.cc
clean_exit_beacon.ccclean_exit_beacon.hclean_exit_beacon_unittest.ccdaily_event_unittest.ccdemographics
log_store.hmetrics_log.ccmetrics_log.hmetrics_log_store.ccmetrics_log_store.hmetrics_log_unittest.ccmetrics_logs_event_manager.ccmetrics_logs_event_manager.hmetrics_service.ccmetrics_service.hmetrics_service_client.ccmetrics_service_client.hmetrics_service_observer.ccmetrics_service_observer.hmetrics_service_unittest.ccmotherboard.ccmotherboard.hreporting_service_unittest.ccstructured
external_metrics_unittest.cckey_data_prefs_delegate.cckey_data_provider.hkey_util.cc
mojom
persistent_proto.cctest
ui
screen_info_metrics_provider.ccscreen_info_metrics_provider.hscreen_info_metrics_provider_unittest.cc
unsent_log_store.ccunsent_log_store.hunsent_log_store_unittest.ccmirroring
service
ml
nacl
renderer
named_mojo_ipc_server
navigation_interception
net_log
network_hints
network_session_configurator
network_time
no_state_prefetch
browser
no_state_prefetch_contents.ccno_state_prefetch_contents.hno_state_prefetch_link_manager.ccno_state_prefetch_link_manager.hno_state_prefetch_manager.ccno_state_prefetch_manager.hno_state_prefetch_processor_impl.hno_state_prefetch_processor_impl_unittest.cc
common
ntp_tiles
custom_links_manager_impl.cccustom_links_manager_impl.hcustom_links_manager_impl_unittest.cccustom_links_store.ccmost_visited_sites.ccmost_visited_sites.hmost_visited_sites_unittest.ccpopular_sites_impl.ccpopular_sites_impl_unittest.cc
offline_items_collection
core
android
offline_content_aggregator_bridge.ccoffline_content_aggregator_bridge.hoffline_item_bridge.ccoffline_item_bridge.h
filtered_offline_item_observer.ccfiltered_offline_item_observer.hfiltered_offline_item_observer_unittest.ccoffline_content_aggregator.ccoffline_content_aggregator.hoffline_content_aggregator_unittest.ccoffline_content_provider.ccoffline_content_provider.hoffline_item.htest_support
mock_filtered_offline_item_observer.hmock_offline_content_provider.ccmock_offline_content_provider.h
throttled_offline_content_provider.ccthrottled_offline_content_provider.hthrottled_offline_content_provider_unittest.ccupdate_delta.ccupdate_delta.hoffline_pages
core
omnibox
browser
actions
history_clusters_action.ccomnibox_action_in_suggest.ccomnibox_action_in_suggest.homnibox_action_in_suggest_unittest.cc
autocomplete_controller.ccautocomplete_controller.hautocomplete_controller_metrics_unittest.ccautocomplete_controller_unittest.ccautocomplete_grouper_sections.ccautocomplete_input.hautocomplete_match.ccautocomplete_match.hautocomplete_match_type_unittest.ccautocomplete_match_unittest.ccautocomplete_provider_unittest.ccautocomplete_result.ccautocomplete_result.hautocomplete_result_unittest.ccautocomplete_scoring_model_executor.ccautocomplete_scoring_model_executor.hautocomplete_scoring_model_executor_unittest.ccautocomplete_scoring_model_handler.ccautocomplete_scoring_model_handler.hautocomplete_scoring_model_handler_unittest.ccautocomplete_scoring_model_service.ccautocomplete_scoring_model_service.hbase_search_provider.ccbookmark_scoring_signals_annotator.ccclipboard_provider.ccclipboard_provider.hclipboard_provider_unittest.ccdocument_provider.ccdocument_provider_unittest.ccdocument_suggestions_service_unittest.cchistory_cluster_provider_unittest.cchistory_quick_provider.cchistory_quick_provider.hhistory_scoring_signals_annotator.cchistory_url_provider.ccomnibox_prefs.ccomnibox_triggered_feature_service_unittest.ccon_device_tail_model_service.ccon_device_tail_model_service_unittest.ccquery_tile_provider_unittest.ccscored_history_match.ccscored_history_match.hsearch_provider.ccsearch_suggestion_parser.ccsearch_suggestion_parser.hsearch_suggestion_parser_fuzzer.ccsearch_suggestion_parser_unittest.ccshortcuts_provider.ccshortcuts_provider_unittest.ccsuggestion_answer.ccsuggestion_answer.hsuggestion_answer_unittest.ccsuggestion_group_util.cctitled_url_match_utils.ccurl_scoring_signals_annotator.ccurl_scoring_signals_annotator_unittest.cczero_suggest_provider.ccopen_from_clipboard
clipboard_recent_content.hclipboard_recent_content_generic.ccclipboard_recent_content_generic.hclipboard_recent_content_generic_unittest.ccclipboard_recent_content_ios.hclipboard_recent_content_ios.mmclipboard_recent_content_ios_unittest.mmfake_clipboard_recent_content.ccfake_clipboard_recent_content.h
openscreen_platform
tls_connection_factory.cctls_connection_factory.htls_connection_factory_unittest.ccudp_socket.ccudp_socket.h
optimization_guide
content
browser
in_memory_text_embedding_manager.ccin_memory_text_embedding_manager.hin_memory_text_embedding_manager_unittest.ccpage_content_annotations_model_manager.ccpage_content_annotations_model_manager.hpage_content_annotations_model_manager_unittest.ccpage_content_annotations_service.ccpage_content_annotations_service.hpage_content_annotations_service_unittest.ccpage_content_annotations_validator.ccpage_content_annotations_web_contents_observer_unittest.ccpage_content_annotator.hpage_text_dump_result.ccpage_text_dump_result.hpage_text_dump_result_unittest.ccpage_text_observer.ccpage_text_observer.hpage_text_observer_unittest.cctest_page_content_annotator.cctest_page_content_annotator.h
renderer
core
base_model_executor.hbase_model_executor_helpers.hbatch_entity_metadata_task.ccbatch_entity_metadata_task.hbatch_entity_metadata_task_unittest.ccbert_model_executor.ccbert_model_executor.hbert_model_executor_unittest.ccbert_model_handler.ccbert_model_handler.hcommand_line_top_host_provider.ccentity_annotator_native_library.ccentity_metadata_provider.hhint_cache_unittest.cchints_fetcher.cchints_fetcher.hhints_fetcher_unittest.cchints_manager.cchints_manager.hhints_manager_unittest.ccmediapipe_text_model_executor.ccmediapipe_text_model_executor.hmediapipe_text_model_executor_unittest.ccmemory_hint.ccmemory_hint.h
model_execution
model_execution_fetcher_unittest.ccmodel_execution_manager.ccmodel_execution_manager_unittest.ccon_device_model_service_controller.h
model_executor.hmodel_handler.hmodel_handler_unittest.ccmodel_quality
model_store_metadata_entry.ccmodel_store_metadata_entry.hmodel_util.ccmodel_util.hmodel_util_unittest.ccmodel_validator.ccmodel_validator.hmodel_validator_unittest.ccoptimization_guide_features.ccoptimization_guide_features.hoptimization_guide_features_unittest.ccoptimization_guide_model_provider.hoptimization_guide_navigation_data.ccoptimization_guide_navigation_data.hoptimization_guide_store.ccoptimization_guide_store.hoptimization_guide_store_unittest.ccoptimization_guide_switches.ccoptimization_guide_switches.hoptimization_guide_switches_unittest.ccoptimization_guide_util.hoptimization_guide_util_unittest.ccoptimization_hints_component_update_listener.ccoptimization_hints_component_update_listener.hoptimization_metadata.hoptimization_metadata_unittest.ccpage_content_annotation_job.ccpage_content_annotation_job.hpage_content_annotation_job_executor.hpage_content_annotation_job_executor_unittest.ccpage_content_annotation_job_unittest.ccpage_content_annotations_common.ccpage_content_annotations_common.hpage_entities_model_handler.ccpage_entities_model_handler.hpage_entities_model_handler_impl.ccpage_entities_model_handler_impl.hpage_entities_model_handler_impl_unittest.ccpage_visibility_model_executor.ccpage_visibility_model_executor.hpage_visibility_model_fuzzer.ccpage_visibility_model_handler.ccpage_visibility_model_handler.hpage_visibility_model_handler_unittest.ccprediction_manager.ccprediction_manager.hprediction_manager_unittest.ccprediction_model_download_manager.ccprediction_model_download_manager.hprediction_model_download_manager_unittest.ccprediction_model_fetch_timer_unittest.ccprediction_model_fetcher.hprediction_model_fetcher_impl.ccprediction_model_fetcher_impl.hprediction_model_fetcher_unittest.ccprediction_model_override.ccprediction_model_store.ccstore_update_data.ccstore_update_data.htest_model_executor.cctest_model_executor.htest_model_handler.htest_optimization_guide_model_provider.cctest_optimization_guide_model_provider.htest_tflite_model_executor.cctest_tflite_model_executor.htest_tflite_model_handler.htext_embedding_model_executor.cctext_embedding_model_executor.htext_embedding_model_executor_unittest.cctext_embedding_model_handler.cctext_embedding_model_handler.htext_embedding_model_handler_unittest.cctflite_model_executor.htflite_model_executor_unittest.ccorigin_trials
os_crypt
async
browser
common
sync
key_storage_kwallet.cckey_storage_kwallet.hkey_storage_kwallet_unittest.cckey_storage_libsecret.cckey_storage_libsecret.hkey_storage_libsecret_unittest.cckey_storage_linux.cckey_storage_linux.hkey_storage_linux_unittest.cckwallet_dbus.cckwallet_dbus.hkwallet_dbus_unittest.ccos_crypt_linux.ccos_crypt_mocker_linux.ccos_crypt_mocker_linux.h
ownership
page_image_annotation
content
renderer
page_image_service
page_info
android
core
about_this_site_service.ccabout_this_site_service.habout_this_site_service_unittest.ccabout_this_site_validation.ccabout_this_site_validation.h
page_info.ccpage_info.hpage_info_delegate.hpage_info_ui.ccpage_info_ui.hpage_info_ui_delegate.hpage_load_metrics
browser
fake_page_load_metrics_observer_delegate.ccfake_page_load_metrics_observer_delegate.hmetrics_web_contents_observer.ccmetrics_web_contents_observer.hmetrics_web_contents_observer_unittest.ccpage_load_metrics_observer_delegate.hpage_load_metrics_test_waiter.hpage_load_metrics_update_dispatcher.ccpage_load_metrics_update_dispatcher.hpage_load_metrics_util.ccpage_load_metrics_util.hpage_load_metrics_util_unittest.ccpage_load_tracker.ccpage_load_tracker.hresponsiveness_metrics_normalization.ccresponsiveness_metrics_normalization.htest_metrics_web_contents_observer_embedder.cctest_metrics_web_contents_observer_embedder.h
observers
ad_metrics
ads_page_load_metrics_observer.ccads_page_load_metrics_observer.hads_page_load_metrics_observer_unittest.ccframe_tree_data.ccframe_tree_data.hpage_ad_density_tracker.ccpage_ad_density_tracker.h
back_forward_cache_page_load_metrics_observer.ccback_forward_cache_page_load_metrics_observer.hback_forward_cache_page_load_metrics_observer_unittest.cccore
largest_contentful_paint_handler.cclargest_contentful_paint_handler.huma_page_load_metrics_observer.cc
fenced_frames_page_load_metrics_observer.hpage_load_metrics_observer_tester.ccpage_load_metrics_observer_tester.hprerender_page_load_metrics_observer.hprivacy_sandbox_ads_page_load_metrics_observer.cccommon
page_load_metrics_mojom_traits.hpage_load_metrics_util.ccpage_load_metrics_util.hpage_load_timing.cc
renderer
paint_preview
browser
file_manager.ccfile_manager.hpaint_preview_base_service_unittest.ccpaint_preview_client_unittest.ccpaint_preview_compositor_client_impl.ccpaint_preview_compositor_client_impl.hpaint_preview_file_mixin.ccpaint_preview_file_mixin.htest_paint_preview_policy.cc
common
paint_preview_tracker.ccpaint_preview_tracker.hrecording_map.ccserialized_recording.ccserialized_recording.hserialized_recording_unittest.cc
player
android
bitmap_request.ccbitmap_request.hplayer_compositor_delegate.ccplayer_compositor_delegate.hplayer_compositor_delegate_unittest.ccpublic
renderer
password_manager
core
payments
content
android
android_app_communication.handroid_app_communication_ash.ccandroid_app_communication_helpers.ccandroid_app_communication_helpers.handroid_app_communication_lacros.ccandroid_app_communication_stub.ccandroid_app_communication_unittest.ccandroid_payment_app.ccandroid_payment_app.handroid_payment_app_factory.ccandroid_payment_app_factory_unittest.ccandroid_payment_app_unittest.cccontent_payment_request_delegate.hmock_android_app_communication.hmock_payment_app_factory_delegate.hpayment_app_factory.hpayment_credential.hpayment_request_state.ccpayment_request_state.hsecure_payment_confirmation_app_factory.ccsecure_payment_confirmation_controller.ccsecure_payment_confirmation_model.hservice_worker_payment_app_unittest.cctest_content_payment_request_delegate.cctest_content_payment_request_delegate.hutility
core
pdf
browser
fake_pdf_stream_delegate.ccfake_pdf_stream_delegate.hmock_url_loader_client.hpdf_navigation_throttle.ccpdf_stream_delegate.ccpdf_stream_delegate.hpdf_url_loader_request_interceptor.ccplugin_response_writer.ccplugin_response_writer_unittest.cc
renderer
performance_manager
decorators
execution_context_priority
boosting_vote_aggregator.hmax_vote_aggregator.ccoverride_vote_aggregator.ccoverride_vote_aggregator.h
freezing
graph
frame_node_impl.ccframe_node_impl.hframe_node_impl_describer.ccnode_data_describer_util_unittest.ccpage_node_impl.ccpage_node_impl.hpage_node_impl_describer.ccpage_node_impl_unittest.ccprocess_node_impl.ccprocess_node_impl.hprocess_node_impl_unittest.cc
performance_manager_lifetime.ccpersistence
site_data
leveldb_site_data_store.ccleveldb_site_data_store_unittest.ccnon_recording_site_data_cache.ccsite_data_cache_factory.ccsite_data_cache_factory.hsite_data_cache_factory_unittest.ccsite_data_cache_inspector.hsite_data_impl.ccsite_data_impl.hsite_data_impl_unittest.ccsite_data_reader_unittest.ccsite_data_store.h
power
battery_level_provider_chromeos.ccbattery_level_provider_chromeos.hbattery_level_provider_chromeos_unittest.cc
public
graph
resource_attribution
user_tuning
v8_memory
resource_attribution
frame_context.ccframe_context_unittest.ccpage_context.ccpage_context_unittest.ccprocess_context.ccprocess_context_unittest.ccqueries_unittest.ccresource_contexts_unittest.cctype_helpers_unittest.ccworker_context.ccworker_context_unittest.cc
test_support
persistence
resource_attribution
user_tuning
v8_memory
v8_context_tracker.ccv8_context_tracker_helpers.ccv8_context_tracker_helpers.hv8_context_tracker_helpers_unittest.ccv8_context_tracker_unittest.ccv8_detailed_memory.ccv8_detailed_memory_any_seq.ccv8_memory_test_helpers.ccv8_memory_test_helpers.hweb_memory_aggregator.ccweb_memory_aggregator.hweb_memory_aggregator_unittest.ccweb_memory_impl_unittest.cc
permissions
android
permission_prompt
contexts
notifications_engagement_service.ccnotifications_engagement_service.hobject_permission_context_base.ccobject_permission_context_base.horigin_keyed_permission_action_service.ccorigin_keyed_permission_action_service.hpepc_initiated_permission_request_unittest.ccpermission_actions_history.ccpermission_actions_history_unittest.ccpermission_auditing_database.ccpermission_auditing_database.hpermission_auditing_database_unittest.ccpermission_auditing_service.hpermission_auditing_service_unittest.ccpermission_context_base.ccpermission_context_base.hpermission_context_base_unittest.ccpermission_decision_auto_blocker.ccpermission_decision_auto_blocker.hpermission_decision_auto_blocker_unittest.ccpermission_manager.ccpermission_manager.hpermission_manager_unittest.ccpermission_prompt.hpermission_recovery_success_rate_tracker.hpermission_request.ccpermission_request.hpermission_request_data.hpermission_request_manager.ccpermission_request_manager.hpermission_request_manager_unittest.ccpermission_ui_selector.ccpermission_ui_selector.hpermission_uma_util.ccpermission_uma_util.hpermission_uma_util_unittest.ccpermission_util.ccpermission_util.hpermissions_client.ccpermissions_client.hprediction_service
prediction_model_executor.ccprediction_model_executor.hprediction_model_handler.ccprediction_model_handler.hprediction_service.ccprediction_service_base.hprediction_service_unittest.cc
request_type.ccrequest_type.htest
plugins
renderer
plus_addresses
plus_address_client.ccplus_address_client.hplus_address_client_unittest.ccplus_address_parser.ccplus_address_parser.hplus_address_parser_unittest.ccplus_address_service.ccplus_address_service.hplus_address_service_unittest.ccplus_address_test_utils.cc
policy
content
core
browser
configuration_policy_handler.ccconfiguration_policy_handler.hconfiguration_policy_handler_unittest.ccpolicy_conversions_client.ccpolicy_conversions_client.hpolicy_conversions_client_unittest.ccpolicy_pref_mapping_test.cc
signin
profile_separation_policies.ccprofile_separation_policies.huser_cloud_signin_restriction_policy_fetcher.cc
url_blocklist_manager.ccurl_blocklist_manager.hurl_blocklist_policy_handler.ccurl_scheme_list_policy_handler_unittest.ccwebui
common
android
async_policy_loader.hcloud
cloud_external_data_store_unittest.cccloud_policy_client.cccloud_policy_client.hcloud_policy_client_unittest.cccloud_policy_manager.cccloud_policy_service.hcloud_policy_util.cccloud_policy_validator.cccloud_policy_validator.hcomponent_cloud_policy_service_unittest.cccomponent_cloud_policy_store_unittest.cccomponent_cloud_policy_updater_unittest.ccdevice_management_service.ccdevice_management_service.hdevice_management_service_unittest.ccdmserver_job_configurations.ccdmserver_job_configurations.hencrypted_reporting_job_configuration.ccencrypted_reporting_job_configuration_unittest.ccrealtime_reporting_job_configuration.ccrealtime_reporting_job_configuration_unittest.ccreporting_job_configuration_base.ccreporting_job_configuration_base.hresource_cache.ccresource_cache.hresource_cache_unittest.ccuser_info_fetcher.cc
config_dir_policy_loader.ccmanagement
policy_loader_ios.mmpolicy_loader_lacros.hpolicy_loader_win.ccpolicy_map.ccpolicy_map.hpolicy_map_unittest.ccpolicy_proto_decoders.ccregistry_dict.ccregistry_dict.hregistry_dict_unittest.ccremote_commands
schema.ccschema.hschema_fuzzer.ccschema_map_unittest.cctest_support
power_bookmarks
core
storage
prefs
json_pref_store.ccjson_pref_store.hoverlay_user_pref_store.ccpref_member.ccpref_service.cctesting_pref_store.cc
printing
browser
print_to_pdf
common
renderer
test
privacy_sandbox
canonical_topic.cccanonical_topic.h
privacy_sandbox_attestations
privacy_sandbox_attestations.ccprivacy_sandbox_attestations.hprivacy_sandbox_attestations_parser.ccprivacy_sandbox_attestations_parser.hprivacy_sandbox_attestations_parser_unittest.cc
privacy_sandbox_settings_impl.ccprivacy_sandbox_settings_impl.hprivacy_sandbox_settings_impl_unittest.ccprivacy_sandbox_test_util.ccprivacy_sandbox_test_util.hproxy_config
qr_code_generator
query_tiles
android
internal
init_aware_tile_service.ccinit_aware_tile_service.hinit_aware_tile_service_unittest.cctile_manager.cctile_manager.htile_manager_unittest.cctile_service_impl.cctile_service_impl.htile_service_impl_unittest.cc
test
tile_service.hquirks
reading_list
core
reduce_accept_language
browser
remote_cocoa
app_shim
renderer_context_menu
reporting
client
report_queue_configuration.ccreport_queue_configuration.hreport_queue_impl.ccreport_queue_impl.hreport_queue_impl_unittest.cc
compression
compression_module.cccompression_module.hcompression_module_unittest.cctest_compression_module.cctest_compression_module.h
encryption
metrics
collector_base.hdelayed_sampler_unittest.cc
fakes
manual_collector.ccmanual_collector.hmanual_collector_unittest.ccmetric_event_observer_manager_unittest.ccone_shot_collector.ccone_shot_collector.hone_shot_collector_unittest.ccperiodic_collector.ccperiodic_collector.hperiodic_collector_unittest.ccperiodic_event_collector.ccperiodic_event_collector.hperiodic_event_collector_unittest.ccsampler.hresources
storage
storage.ccstorage.hstorage_queue.ccstorage_queue.hstorage_queue_stress_test.ccstorage_queue_unittest.ccstorage_unittest.cctest_storage_module.h
util
safe_browsing
android
content
browser
async_check_tracker.ccasync_check_tracker.hbase_blocking_page.ccbase_blocking_page.hbase_ui_manager.ccbase_ui_manager.hbrowser_url_loader_throttle.ccbrowser_url_loader_throttle.hbrowser_url_loader_throttle_unittest.ccclient_side_phishing_model.ccclient_side_phishing_model.hclient_side_phishing_model_unittest.cc
download
mojo_safe_browsing_impl.ccsafe_browsing_blocking_page_factory.hsafe_browsing_navigation_observer_manager.ccsafe_browsing_navigation_observer_manager.hsafe_browsing_navigation_throttle.ccthreat_details.ccthreat_details.htriggers
ad_sampler_trigger.ccmock_trigger_manager.htrigger_manager.cctrigger_manager.htrigger_manager_unittest.cc
ui_manager.ccui_manager.hui_manager_unittest.ccurl_checker_on_sb.ccurl_checker_on_sb.hweb_api_handshake_checker.ccweb_ui
common
renderer
core
browser
db
hash_realtime_mechanism.cchash_realtime_mechanism.hhashprefix_realtime
hash_realtime_cache_unittest.cchash_realtime_service.cchash_realtime_service.hhash_realtime_service_unittest.cchash_realtime_utils.cchash_realtime_utils_unittest.ccohttp_key_service.ccohttp_key_service.hohttp_key_service_unittest.cc
ping_manager_unittest.ccrealtime
safe_browsing_lookup_mechanism.ccsafe_browsing_lookup_mechanism.hsafe_browsing_lookup_mechanism_runner.ccsafe_browsing_lookup_mechanism_runner.hsafe_browsing_metrics_collector.ccsafe_browsing_metrics_collector.hsafe_browsing_metrics_collector_unittest.ccsafe_browsing_url_checker_impl.ccsafe_browsing_url_checker_impl.hsafe_browsing_url_checker_impl_unittest.cctailored_security_service
url_realtime_mechanism.ccurl_realtime_mechanism.huser_population.ccuser_population.huser_population_unittest.ccverdict_cache_manager.ccverdict_cache_manager.hcommon
safe_search_api
safe_search
saved_tab_groups
saved_tab_group.ccsaved_tab_group.hsaved_tab_group_model.ccsaved_tab_group_model.hsaved_tab_group_model_observer.hsaved_tab_group_model_unittest.ccsaved_tab_group_proto_conversion_unittest.ccsaved_tab_group_sync_bridge.ccsaved_tab_group_sync_bridge.hsaved_tab_group_sync_bridge_unittest.ccsaved_tab_group_tab.ccsaved_tab_group_tab.hsaved_tab_group_unittest.cc
schema_org
search
search_engines
default_search_policy_handler_unittest.cckeyword_table.cc
search_engine_choice
site_search_policy_handler_unittest.cctemplate_url.cctemplate_url_data_util.cctemplate_url_service.cctemplate_url_service.hsearch_provider_logos
security_interstitials
content
ssl_error_assistant.ccssl_error_assistant.hssl_error_assistant_unittest.ccssl_error_handler.ccstateful_ssl_host_state_delegate.cc
core
segmentation_platform
embedder
default_model
android_home_module_ranker.cccontextual_page_actions_model.cccross_device_user_segment.ccdefault_model_test_base.ccdefault_model_test_base.hdevice_switcher_model.ccdevice_switcher_result_dispatcher.ccdevice_switcher_result_dispatcher.hdevice_switcher_result_dispatcher_unittest.ccdevice_tier_segment.ccdevice_tier_segment.hfeed_user_segment.ccfrequent_feature_user_model.ccintentional_user_model.ccios_module_ranker.cclow_user_engagement_model.ccmost_visited_tiles_user.ccoptimization_target_segmentation_dummy.ccpassword_manager_user_segment.ccpower_user_segment.ccresume_heavy_user_model.ccsearch_user_model.ccsearch_user_model.hshopping_user_model.cctab_resumption_ranker.cctablet_productivity_user_model.cctablet_productivity_user_model.h
input_delegate
model_provider_factory_impl.ccmodel_provider_factory_impl_unittest.cctab_fetcher.cctab_fetcher.hinternal
config_parser.cc
data_collection
training_data_cache.cctraining_data_cache.htraining_data_cache_unittest.cctraining_data_collector.htraining_data_collector_impl.cctraining_data_collector_impl.htraining_data_collector_impl_unittest.cc
database
cached_result_provider.cccached_result_provider.hcached_result_provider_unittest.ccclient_result_prefs.ccclient_result_prefs.hclient_result_prefs_unittest.ccconfig_holder.ccconfig_holder.hmock_signal_database.hsegment_info_cache.ccsegment_info_cache.hsegment_info_cache_unittest.ccsegment_info_database.ccsegment_info_database.hsegment_info_database_unittest.ccsignal_database.hsignal_database_impl.ccsignal_database_impl.hsignal_database_impl_unittest.ccsignal_sample_view.ccsignal_sample_view.hsignal_sample_view_unittest.ccstorage_service.htest_segment_info_database.cctest_segment_info_database.hukm_metrics_table_unittest.cc
execution
mock_model_provider.hmodel_executor_impl.ccmodel_executor_impl.hmodel_executor_impl_unittest.ccmodel_manager.hmodel_manager_impl.ccmodel_manager_impl.hmodel_manager_impl_unittest.cc
optimization_guide
optimization_guide_segmentation_model_handler.ccoptimization_guide_segmentation_model_handler.hoptimization_guide_segmentation_model_provider.ccoptimization_guide_segmentation_model_provider_unittest.ccsegmentation_model_executor.ccsegmentation_model_executor.hsegmentation_model_executor_unittest.cc
processing
custom_input_processor.ccfeature_aggregator.hfeature_aggregator_impl.ccfeature_aggregator_impl.hfeature_aggregator_impl_unittest.ccfeature_list_query_processor.ccfeature_list_query_processor.hfeature_list_query_processor_unittest.ccfeature_processor_state.ccfeature_processor_state.hmock_feature_aggregator.hsync_device_info_observer.ccsync_device_info_observer_unittest.ccuma_feature_processor.ccuma_feature_processor_unittest.cc
metadata
metrics
migration
post_processor
scheduler
segment_id_convertor.ccsegment_id_convertor.hsegmentation_platform_service_impl.ccsegmentation_platform_service_impl.hsegmentation_ukm_helper.ccsegmentation_ukm_helper.hsegmentation_ukm_helper_unittest.ccselection
experimental_group_recorder.hrequest_dispatcher.hrequest_handler_unittest.ccresult_refresh_manager.ccresult_refresh_manager_unittest.ccsegment_result_provider.ccsegment_result_provider.hsegment_result_provider_unittest.ccsegment_score_provider.hsegment_selector.hsegment_selector_impl.ccsegment_selector_unittest.ccsegmentation_result_prefs.ccsegmentation_result_prefs.hsegmentation_result_prefs_unittest.cc
service_proxy_impl.ccservice_proxy_impl.hsignals
history_delegate_impl.hhistory_service_observer.cchistory_service_observer.huser_action_signal_handler.ccuser_action_signal_handler_unittest.cc
stats.ccstats.hstats_unittest.ccukm_data_manager_impl.hukm_data_manager_impl_unittest.ccpublic
send_tab_to_self
entry_point_display_reason.ccentry_point_display_reason.hsend_tab_to_self_bridge.ccsend_tab_to_self_bridge.hsend_tab_to_self_bridge_unittest.ccsend_tab_to_self_sync_service.ccsend_tab_to_self_sync_service.htarget_device_info_unittest.cc
services
app_service
public
cpp
app_capability_access_cache_unittest.ccapp_capability_access_cache_wrapper_unittest.ccapp_launch_util.h
app_storage
app_types.happ_types_unittest.ccapp_update.ccapp_update.happ_update_unittest.cccapability_access.hcapability_access_update.cccapability_access_update.hcapability_access_update_unittest.ccicon_cache.ccicon_cache.hicon_coalescer.ccicon_coalescer.hicon_info.hicon_loader.ccicon_loader.hicon_types.ccicon_types.hinstance_registry.hintent.ccintent.hintent_filter.hintent_filter_util.ccintent_util.ccintent_util.hintent_util_unittest.ccpackage_id.ccpackage_id.hpackage_id_unittest.ccpermission.ccpermission.hpreferred_apps_converter.ccpreferred_apps_converter_unittest.ccpreferred_apps_list.ccpreferred_apps_list.hpreferred_apps_list_handle.hpreferred_apps_list_unittest.ccrun_on_os_login_types.ccrun_on_os_login_types.hshortcut
stub_icon_loader.ccstub_icon_loader.hfilesystem
font
heap_profiling
paint_preview_compositor
screen_ai
proto
screen_ai_library_wrapper.ccscreen_ai_library_wrapper.hscreen_ai_service_impl.ccscreen_ai_service_impl.hstorage
dom_storage
async_dom_storage_database.ccasync_dom_storage_database.hdom_storage_database.ccdom_storage_database.hdom_storage_database_unittest.cclocal_storage_impl.cclocal_storage_impl_unittest.ccsession_storage_area_impl.ccsession_storage_area_impl.hsession_storage_area_impl_unittest.ccsession_storage_data_map_unittest.ccsession_storage_impl.ccsession_storage_impl_unittest.ccsession_storage_metadata.ccsession_storage_metadata.hsession_storage_metadata_unittest.ccsession_storage_namespace_impl_unittest.ccstorage_area_impl.ccstorage_area_impl.hstorage_area_impl_unittest.ccstorage_area_test_util.ccstorage_area_test_util.htesting_legacy_session_storage_database.cctesting_legacy_session_storage_database.h
indexed_db
partition_impl.ccpartition_impl.hpartition_impl_unittest.ccpublic
cpp
service_worker
service_worker_database.ccservice_worker_database_unittest.ccservice_worker_resource_ops.ccservice_worker_storage.ccservice_worker_storage.hservice_worker_storage_control_impl.ccservice_worker_storage_control_impl.hservice_worker_storage_control_impl_unittest.ccservice_worker_storage_test_utils.hservice_worker_storage_unittest.cc
shared_storage
async_shared_storage_database.hshared_storage_database.ccshared_storage_database.hshared_storage_manager.h
storage_service_impl.ccstorage_service_impl.hstorage_service_impl_unittest.ccsession_proto_db
sessions
content
core
base_session_service_commands.ccbase_session_service_commands.hcommand_storage_backend.cccommand_storage_backend.hcommand_storage_backend_unittest.cclive_tab_context.hserialized_navigation_entry.hserialized_user_agent_override.hsession_service_commands.ccsession_service_commands.hsession_types.htab_restore_service.htab_restore_service_helper.cctab_restore_service_helper.htab_restore_service_impl.cctab_restore_service_impl.h
shared_highlighting
core
common
ios
signin
core
browser
internal
identity_manager
account_capabilities_fetcher.ccaccount_capabilities_fetcher.haccount_capabilities_fetcher_android.ccaccount_capabilities_fetcher_gaia.ccaccount_capabilities_fetcher_unittest.ccaccount_fetcher_service.ccaccount_fetcher_service.haccount_info_util.ccaccount_info_util.haccount_info_util_unittest.ccaccount_tracker_service.ccaccount_tracker_service.haccount_tracker_service_unittest.ccaccounts_mutator_impl.ccdevice_accounts_synchronizer_impl.ccdevice_accounts_synchronizer_impl.hfake_account_capabilities_fetcher.ccfake_account_capabilities_fetcher.hfake_account_capabilities_fetcher_factory.ccfake_account_capabilities_fetcher_factory.hgaia_cookie_manager_service.ccgaia_cookie_manager_service_unittest.ccmutable_profile_oauth2_token_service_delegate.ccmutable_profile_oauth2_token_service_delegate_unittest.ccprimary_account_manager.hprimary_account_manager_unittest.ccprofile_oauth2_token_service_delegate.ccprofile_oauth2_token_service_delegate.hprofile_oauth2_token_service_delegate_android.ccprofile_oauth2_token_service_delegate_android.hprofile_oauth2_token_service_delegate_android_unittest.ccprofile_oauth2_token_service_delegate_ios.ccprofile_oauth2_token_service_delegate_ios.htest_profile_oauth2_token_service_delegate_chromeos.cctest_profile_oauth2_token_service_delegate_chromeos.htoken_binding_helper.cc
ios
public
site_engagement
site_isolation
soda
spellcheck
browser
sqlite_proto
startup_metric_utils
subresource_filter
content
browser
activation_state_computing_navigation_throttle.ccactivation_state_computing_navigation_throttle.hactivation_state_computing_navigation_throttle_unittest.ccad_tagging_browser_test_utils.ccads_intervention_manager.ccads_intervention_manager.hads_intervention_manager_unittest.ccasync_document_subresource_filter.hcontent_subresource_filter_throttle_manager.cccontent_subresource_filter_throttle_manager.hcontent_subresource_filter_throttle_manager_unittest.ccprofile_interaction_manager.ccsubresource_filter_content_settings_manager.ccsubresource_filter_content_settings_manager.hsubresource_filter_content_settings_manager_unittest.ccsubresource_filter_observer_test_utils.ccsubresource_filter_observer_test_utils.hsubresource_filter_safe_browsing_activation_throttle.ccsubresource_filter_safe_browsing_activation_throttle_unittest.cc
common
renderer
tools
supervised_user
core
browser
fetcher_config.hproto_fetcher.ccproto_fetcher.hproto_fetcher_unittest.ccsupervised_user_preferences.ccsupervised_user_settings_service.ccsupervised_user_settings_service.hsupervised_user_settings_service_unittest.cc
common
test_support
sync
base
passphrase_enums.ccpassphrase_enums.hsync_invalidation_adapter.ccsync_invalidation_adapter.huser_selectable_type.ccuser_selectable_type.h
engine
cycle
forwarding_model_type_processor.ccforwarding_model_type_processor.hloopback_server
model_type_processor.hmodel_type_processor_proxy.ccmodel_type_processor_proxy.hmodel_type_worker.ccmodel_type_worker.hmodel_type_worker_unittest.ccnigori
cross_user_sharing_public_key.cccross_user_sharing_public_key.hcross_user_sharing_public_key_unittest.cccross_user_sharing_public_private_key_pair.cccross_user_sharing_public_private_key_pair.hcross_user_sharing_public_private_key_pair_unittest.cccryptographer.h
sync_scheduler_impl.ccsync_scheduler_impl.hsyncer_proto_util.ccsyncer_unittest.ccinvalidations
fcm_handler.ccfcm_handler_unittest.ccsync_invalidations_service.hsync_invalidations_service_impl.ccsync_invalidations_service_impl.h
model
blocking_model_type_store.hblocking_model_type_store_impl.ccblocking_model_type_store_impl.hclient_tag_based_model_type_processor.ccclient_tag_based_model_type_processor.hclient_tag_based_model_type_processor_unittest.ccclient_tag_based_remote_update_handler.ccclient_tag_based_remote_update_handler.hmodel_type_change_processor.hmodel_type_store.hmodel_type_store_backend.ccmodel_type_store_backend.hmodel_type_store_backend_unittest.ccmodel_type_store_impl.ccmodel_type_store_impl.hmodel_type_store_impl_unittest.ccmodel_type_store_service_impl_unittest.ccmodel_type_sync_bridge.hsync_change_processor.hsync_metadata_store_change_list.ccsync_metadata_store_change_list.hsyncable_service.hsyncable_service_based_bridge.ccsyncable_service_based_bridge.hsyncable_service_based_bridge_unittest.cc
nigori
cross_user_sharing_keys.cccryptographer_impl.cccryptographer_impl.hcryptographer_impl_unittest.ccnigori_local_change_processor.hnigori_model_type_processor.ccnigori_model_type_processor.hnigori_model_type_processor_unittest.ccnigori_state.ccnigori_state.hnigori_state_unittest.ccnigori_storage.hnigori_storage_impl.ccnigori_storage_impl.hnigori_storage_impl_unittest.ccnigori_sync_bridge.hnigori_sync_bridge_impl.ccnigori_sync_bridge_impl.hnigori_sync_bridge_impl_unittest.ccpending_local_nigori_commit.cc
service
glue
model_load_manager.hnon_ui_syncable_service_based_model_type_controller.ccpassphrase_type_metrics_provider.ccpassphrase_type_metrics_provider_unittest.ccsync_policy_handler.ccsync_prefs.ccsync_prefs.hsync_service_crypto.ccsync_service_crypto.hsync_service_crypto_unittest.ccsync_service_impl.ccsync_service_impl.hsync_user_settings.hsync_user_settings_impl.ccsync_user_settings_impl.hsync_user_settings_impl_unittest.cctest
entity_builder_factory.ccentity_builder_factory.hfake_cryptographer.ccfake_cryptographer.hfake_model_type_controller_delegate.hfake_model_type_processor.ccfake_model_type_processor.hfake_model_type_sync_bridge.ccfake_model_type_sync_bridge.hfake_server.ccfake_server.hfake_sync_change_processor.ccfake_sync_change_processor.hfake_sync_scheduler.ccfake_sync_scheduler.hforwarding_model_type_change_processor.ccforwarding_model_type_change_processor.hmock_model_type_change_processor.hmock_model_type_processor.ccmock_model_type_processor.hmock_model_type_worker.ccmock_sync_invalidations_service.hmodel_type_store_test_util.ccnigori_test_utils.ccnigori_test_utils.hstub_model_type_sync_bridge.ccstub_model_type_sync_bridge.hsync_change_processor_wrapper_for_test.ccsync_change_processor_wrapper_for_test.hsync_user_settings_mock.htest_matchers.htest_sync_user_settings.cctest_sync_user_settings.h
sync_bookmarks
bookmark_model_type_processor.ccbookmark_model_type_processor.hbookmark_model_type_processor_unittest.ccbookmark_model_view.ccbookmark_model_view.hbookmark_remote_updates_handler_unittest.cclocal_bookmark_model_merger.cclocal_bookmark_model_merger_unittest.ccsynced_bookmark_tracker.ccsynced_bookmark_tracker.hsynced_bookmark_tracker_unittest.cctest_bookmark_model_view.h
sync_device_info
device_info.ccdevice_info.hdevice_info_prefs.ccdevice_info_sync_bridge.ccdevice_info_sync_bridge.hdevice_info_sync_bridge_unittest.ccdevice_info_sync_client.hfake_device_info_tracker.hfake_local_device_info_provider.cclocal_device_info_provider_impl.cclocal_device_info_provider_impl_unittest.cclocal_device_info_util.cclocal_device_info_util_mac.mm
sync_preferences
common_syncable_prefs_database.cccommon_syncable_prefs_database.hdual_layer_user_pref_store.ccpref_model_associator.ccpref_model_associator.hpref_service_syncable_unittest.ccpreferences_merge_helper.ccpreferences_merge_helper_unittest.ccsyncable_prefs_database.ccsyncable_prefs_database.htest_syncable_prefs_database.cctest_syncable_prefs_database.h
sync_sessions
session_store.ccsession_store.hsession_store_unittest.ccsession_sync_bridge.ccsession_sync_bridge.hsession_sync_bridge_unittest.ccsynced_session.ccsynced_session.hsynced_session_tracker.ccsynced_session_tracker.hsynced_session_unittest.cc
sync_user_events
system_cpu
cpu_probe.cccpu_probe.hcpu_probe_linux.cccpu_probe_linux_unittest.cccpu_probe_mac.cccpu_probe_mac_unittest.cccpu_probe_unittest.cccpu_probe_win.cccpu_probe_win_unittest.ccpressure_test_support.ccpressure_test_support.h
system_media_controls
linux
mac
thin_webview
internal
tpcd
metadata
tracing
common
translate
content
browser
renderer
core
browser
ios
trusted_vault
download_keys_response_handler.ccdownload_keys_response_handler.hsecurebox.ccsecurebox.hsecurebox_unittest.ccstandalone_trusted_vault_backend.ccstandalone_trusted_vault_backend.hstandalone_trusted_vault_backend_unittest.ccstandalone_trusted_vault_client.ccstandalone_trusted_vault_client.h
test
trusted_vault_access_token_fetcher_frontend.htrusted_vault_connection.htrusted_vault_connection_impl.cctrusted_vault_connection_impl.htrusted_vault_connection_impl_unittest.cctrusted_vault_crypto.cctrusted_vault_crypto.htrusted_vault_crypto_unittest.cctrusted_vault_degraded_recoverability_handler_unittest.cctrusted_vault_histograms.cctrusted_vault_histograms.htrusted_vault_request.cctrusted_vault_request.htrusted_vault_request_unittest.cctrusted_vault_server_constants.cctrusted_vault_server_constants.htrusted_vault_server_constants_unittest.ccui_devtools
ukm
unexportable_keys
background_long_task_scheduler.ccbackground_task.hbackground_task_impl.hunexportable_key_service_impl.ccunexportable_key_task_manager.ccunexportable_key_tasks.ccunexportable_key_tasks.h
unified_consent
update_client
background_downloader_mac.mmcomponent.cccomponent.hconfigurator.hcrx_cache.cccrx_cache.hcrx_cache_unittest.cccrx_downloader_factory.cccrx_downloader_factory.hcrx_update_item.hping_manager.ccping_manager_unittest.ccprotocol_definition.hprotocol_parser_json.ccprotocol_serializer.ccprotocol_serializer.hprotocol_serializer_fuzzer.ccprotocol_serializer_json_unittest.cctest_configurator.cctest_configurator.htest_installer.ccupdate_checker.ccupdate_checker.hupdate_checker_unittest.ccupdate_client.hupdate_client_unittest.ccupdate_engine.ccupdate_engine.hutils.ccutils.h
upload_list
url_pattern_index
url_rewrite
browser
common
user_education
common
feature_promo_controller.ccfeature_promo_result.hfeature_promo_session_policy.ccfeature_promo_session_policy.hfeature_promo_specification.ccfeature_promo_specification.hfeature_promo_storage_service.ccfeature_promo_storage_service.hhelp_bubble_factory_registry.hhelp_bubble_params.htutorial.cctutorial.htutorial_description.htutorial_service.cctutorial_service.htutorial_unittest.cc
test
views
help_bubble_factory_views.cchelp_bubble_factory_views.hhelp_bubble_view.cchelp_bubble_view.hhelp_bubble_view_unittest.cc
webui
user_manager
fake_user_manager.ccfake_user_manager.hknown_user.ccknown_user.hknown_user_unittest.cc
multi_user
user.huser_directory_integrity_manager.ccuser_directory_integrity_manager.huser_manager.huser_manager_base.ccuser_manager_base.huser_notes
storage
value_store
lazy_leveldb.cclazy_leveldb.hleveldb_value_store.cctesting_value_store.ccvalue_store_change.ccvalue_store_change.hvalue_store_change_unittest.ccvalue_store_frontend.ccvalue_store_frontend.hvalue_store_frontend_unittest.ccvalue_store_test_suite.cc
visitedlink
viz
client
common
features.ccfeatures.h
frame_sinks
gpu
quads
aggregated_render_pass.ccaggregated_render_pass.hcompositor_frame_metadata.hcompositor_frame_metadata_unittest.cccompositor_render_pass.cccompositor_render_pass.hcompositor_render_pass_unittest.ccdraw_quad_perftest.ccdraw_quad_unittest.ccframe_deadline.ccframe_deadline.hrender_pass_internal.hrender_pass_io.ccrender_pass_io_unittest.ccshared_quad_state.ccshared_quad_state.hsurface_draw_quad.cctexture_draw_quad.hyuv_video_draw_quad.ccyuv_video_draw_quad.h
resources
surfaces
switches.ccswitches.hdemo
client
host
client_frame_sink_video_capturer.ccclient_frame_sink_video_capturer.hgpu_host_impl.ccgpu_host_impl.hhost_frame_sink_manager.cchost_frame_sink_manager.hhost_frame_sink_manager_unittest.cc
service
compositor_frame_fuzzer
compositor_frame_fuzzer.cccompositor_frame_fuzzer_util.ccfuzzer_browser_process.ccfuzzer_browser_process.hfuzzer_software_output_surface_provider.ccfuzzer_software_output_surface_provider.h
debugger
display
aggregated_frame.hca_layer_overlay.hcopy_output_scaling_pixeltest.ccdc_layer_overlay.ccdelegated_ink_point_renderer_base.ccdelegated_ink_point_renderer_base.hdelegated_ink_trail_data.ccdelegated_ink_trail_data.hdirect_renderer.ccdirect_renderer.hdisplay.ccdisplay_damage_tracker.hdisplay_perftest.ccdisplay_resource_provider_skia_unittest.ccdisplay_scheduler.hdisplay_scheduler_base.hdisplay_unittest.ccexternal_use_client.ccexternal_use_client.hframe_rate_decider.ccframe_rate_decider_unittest.ccoutput_surface.houtput_surface_frame.hoverlay_ca_unittest.ccoverlay_candidate.hoverlay_candidate_factory.ccoverlay_candidate_factory.hoverlay_candidate_factory_unittest.ccoverlay_dc_unittest.ccoverlay_processor_delegated.ccoverlay_processor_delegated.hoverlay_processor_interface.hoverlay_processor_mac.ccoverlay_processor_mac.hoverlay_processor_stub.hoverlay_processor_surface_control.ccoverlay_processor_surface_control.hoverlay_processor_surface_control_unittest.ccoverlay_processor_using_strategy.ccoverlay_processor_using_strategy.hoverlay_processor_win.hoverlay_proposed_candidate_unittest.ccoverlay_unittest.ccpending_swap_params.hrenderer_perftest.ccrenderer_pixeltest.ccresolved_frame_data.ccresolved_frame_data.hresolved_frame_data_unittest.ccskia_readback_pixeltest.ccskia_renderer.ccskia_renderer.hsoftware_renderer.ccsoftware_renderer.hsoftware_renderer_unittest.ccsurface_aggregator.ccsurface_aggregator.hsurface_aggregator_perftest.ccsurface_aggregator_pixeltest.ccsurface_aggregator_unittest.ccviz_perftest.ccviz_perftest.h
display_embedder
buffer_queue.himage_context_impl.ccimage_context_impl.houtput_presenter_fuchsia.houtput_presenter_gl.ccskia_output_device.ccskia_output_device.hskia_output_device_buffer_queue.ccskia_output_device_buffer_queue.hskia_output_device_buffer_queue_unittest.ccskia_output_device_dawn.ccskia_output_device_dawn.hskia_output_device_dcomp.ccskia_output_device_dcomp.hskia_output_device_gl.ccskia_output_device_gl.hskia_output_device_offscreen.ccskia_output_device_offscreen.hskia_output_device_vulkan.ccskia_output_device_vulkan.hskia_output_device_vulkan_secondary_cb.ccskia_output_device_vulkan_secondary_cb.hskia_output_device_webview.ccskia_output_device_webview.hskia_output_device_x11.ccskia_output_device_x11.hskia_output_surface_impl.ccskia_output_surface_impl.hskia_output_surface_impl_on_gpu.ccskia_output_surface_impl_on_gpu.hskia_output_surface_impl_on_gpu_debug_capture.cc
frame_sinks
compositor_frame_sink_impl.cccompositor_frame_sink_impl.hcompositor_frame_sink_support.cccompositor_frame_sink_support.hcompositor_frame_sink_support_unittest.ccexternal_begin_frame_source_android.ccexternal_begin_frame_source_android.hexternal_begin_frame_source_mojo.hframe_sink_bundle_impl.hframe_sink_bundle_impl_unittest.ccframe_sink_manager_impl.ccframe_sink_manager_impl.hframe_sink_manager_unittest.ccroot_compositor_frame_sink_impl.ccroot_compositor_frame_sink_impl.hsurface_synchronization_unittest.cc
video_capture
capturable_frame_sink.hframe_sink_video_capturer_impl.ccframe_sink_video_capturer_impl.hframe_sink_video_capturer_impl_unittest.ccvideo_capture_overlay.ccvideo_capture_overlay.hvideo_capture_overlay_unittest.cc
video_detector_unittest.ccgl
hit_test
hit_test_aggregator.cchit_test_aggregator.hhit_test_aggregator_unittest.cchit_test_manager.cchit_test_manager.hhit_test_manager_fuzzer.cc
main
surfaces
surface.ccsurface.hsurface_dependency_deadline.ccsurface_dependency_deadline.hsurface_manager.ccsurface_manager.hsurface_saved_frame.ccsurface_saved_frame.h
transitions
test
web_cache
renderer
web_modal
web_package
input_reader.ccinput_reader.h
signed_web_bundles
ed25519_public_key.hed25519_signature.hintegrity_block_parser.ccintegrity_block_parser.hsigned_web_bundle_id_unittest.ccsigned_web_bundle_signature_verifier.ccsigned_web_bundle_signature_verifier.hsigned_web_bundle_signature_verifier_unittest.cc
test_support
mock_web_bundle_parser.ccmock_web_bundle_parser.hmock_web_bundle_parser_factory.ccmock_web_bundle_parser_factory.h
web_bundle_parser.ccweb_bundle_parser.hweb_bundle_parser_factory.ccweb_bundle_parser_factory.hweb_bundle_parser_factory_unittest.ccweb_bundle_parser_fuzzer.ccweb_bundle_parser_unittest.ccsigned_web_bundles
webapps
browser
android
add_to_homescreen_data_fetcher_unittest.ccambient_badge_manager.ccapp_banner_manager_android.ccshortcut_info.ccshortcut_info.hshortcut_info_unittest.cc
webapk
banners
app_banner_manager.ccapp_banner_settings_helper.ccapp_banner_settings_helper.happ_banner_settings_helper_unittest.cc
installable
services
web_app_origin_association
webauthn
android
core
browser
json
webcrypto
algorithm_dispatch.ccalgorithm_implementation.ccalgorithm_implementation.h
algorithms
aes.ccaes.hecdh.ccecdh_unittest.cchkdf.cchmac.ccpbkdf2.cctest_helpers.cctest_helpers.hx25519.ccx25519.h
jwk.ccwebrtc
webrtc_logging
browser
wifi
winhttp
zoom
zucchini
abs32_utils.ccabs32_utils.habs32_utils_unittest.ccdisassembler.ccdisassembler.hdisassembler_dex.ccdisassembler_ztf.ccdisassembler_ztf.helement_detection.ccelement_detection.helement_detection_unittest.cc
fuzzers
heuristic_ensemble_matcher.ccimage_utils.himposed_ensemble_matcher.ccimposed_ensemble_matcher_unittest.ccintegration_test.ccpatch_writer.hrel32_utils.ccrel32_utils.hrel32_utils_unittest.ccreloc_elf.ccreloc_elf.hreloc_elf_unittest.ccreloc_win32.ccreloc_win32.hreloc_win32_unittest.cctest_reference_reader.cctest_reference_reader.hzucchini_apply.cc@ -308,7 +308,7 @@ TEST(AccessCodeCastMetricsTest, CheckMetricsEnums) {
|
||||
base::HistogramTester histogram_tester;
|
||||
|
||||
// AddSinkResult
|
||||
absl::optional<base::HistogramEnumEntryMap> add_sink_results =
|
||||
std::optional<base::HistogramEnumEntryMap> add_sink_results =
|
||||
base::ReadEnumFromEnumsXml("AccessCodeCastAddSinkResult");
|
||||
EXPECT_TRUE(add_sink_results->size() ==
|
||||
static_cast<int>(AccessCodeCastAddSinkResult::kMaxValue) + 1)
|
||||
@ -317,7 +317,7 @@ TEST(AccessCodeCastMetricsTest, CheckMetricsEnums) {
|
||||
"enums.xml to match.";
|
||||
|
||||
// CastMode
|
||||
absl::optional<base::HistogramEnumEntryMap> cast_modes =
|
||||
std::optional<base::HistogramEnumEntryMap> cast_modes =
|
||||
base::ReadEnumFromEnumsXml("AccessCodeCastCastMode");
|
||||
EXPECT_TRUE(cast_modes->size() ==
|
||||
static_cast<int>(AccessCodeCastCastMode::kMaxValue) + 1)
|
||||
@ -326,7 +326,7 @@ TEST(AccessCodeCastMetricsTest, CheckMetricsEnums) {
|
||||
"enums.xml to match.";
|
||||
|
||||
// DialogCloseReason
|
||||
absl::optional<base::HistogramEnumEntryMap> dialog_close_reasons =
|
||||
std::optional<base::HistogramEnumEntryMap> dialog_close_reasons =
|
||||
base::ReadEnumFromEnumsXml("AccessCodeCastDialogCloseReason");
|
||||
EXPECT_TRUE(dialog_close_reasons->size() ==
|
||||
static_cast<int>(AccessCodeCastDialogCloseReason::kMaxValue) + 1)
|
||||
@ -335,7 +335,7 @@ TEST(AccessCodeCastMetricsTest, CheckMetricsEnums) {
|
||||
"enums.xml to match.";
|
||||
|
||||
// DialogOpenLocation
|
||||
absl::optional<base::HistogramEnumEntryMap> dialog_open_locations =
|
||||
std::optional<base::HistogramEnumEntryMap> dialog_open_locations =
|
||||
base::ReadEnumFromEnumsXml("AccessCodeCastDialogOpenLocation");
|
||||
EXPECT_TRUE(dialog_open_locations->size() ==
|
||||
static_cast<int>(AccessCodeCastDialogOpenLocation::kMaxValue) + 1)
|
||||
@ -344,7 +344,7 @@ TEST(AccessCodeCastMetricsTest, CheckMetricsEnums) {
|
||||
"enums.xml to match.";
|
||||
|
||||
// DiscoveryTypeAndSource
|
||||
absl::optional<base::HistogramEnumEntryMap> discovery_types_and_sources =
|
||||
std::optional<base::HistogramEnumEntryMap> discovery_types_and_sources =
|
||||
base::ReadEnumFromEnumsXml("AccessCodeCastDiscoveryTypeAndSource");
|
||||
EXPECT_TRUE(
|
||||
discovery_types_and_sources->size() ==
|
||||
|
@ -241,7 +241,7 @@ std::string AccountId::Serialize() const {
|
||||
// static
|
||||
bool AccountId::Deserialize(const std::string& serialized,
|
||||
AccountId* account_id) {
|
||||
absl::optional<base::Value> value(base::JSONReader::Read(serialized));
|
||||
std::optional<base::Value> value(base::JSONReader::Read(serialized));
|
||||
if (!value || !value->is_dict())
|
||||
return false;
|
||||
|
||||
|
@ -133,7 +133,7 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) AccountManagerFacade {
|
||||
|
||||
// Launches account addition dialog and calls the `callback` with the result.
|
||||
// If `result` is `kSuccess`, the added account will be passed to the
|
||||
// callback. Otherwise `account` will be set to `absl::nullopt`.
|
||||
// callback. Otherwise `account` will be set to `std::nullopt`.
|
||||
virtual void ShowAddAccountDialog(
|
||||
AccountAdditionSource source,
|
||||
base::OnceCallback<void(const AccountUpsertionResult& result)>
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "components/account_manager_core/account_manager_facade_impl.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -27,7 +28,6 @@
|
||||
#include "google_apis/gaia/oauth2_access_token_consumer.h"
|
||||
#include "google_apis/gaia/oauth2_access_token_fetcher.h"
|
||||
#include "google_apis/gaia/oauth2_access_token_fetcher_immediate_error.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace account_manager {
|
||||
|
||||
@ -52,7 +52,7 @@ void UnmarshalAccounts(
|
||||
std::vector<crosapi::mojom::AccountPtr> mojo_accounts) {
|
||||
std::vector<Account> accounts;
|
||||
for (const auto& mojo_account : mojo_accounts) {
|
||||
absl::optional<Account> maybe_account = FromMojoAccount(mojo_account);
|
||||
std::optional<Account> maybe_account = FromMojoAccount(mojo_account);
|
||||
if (!maybe_account) {
|
||||
// Skip accounts we couldn't unmarshal. No logging, as it would produce
|
||||
// a lot of noise.
|
||||
@ -66,7 +66,7 @@ void UnmarshalAccounts(
|
||||
void UnmarshalPersistentError(
|
||||
base::OnceCallback<void(const GoogleServiceAuthError&)> callback,
|
||||
crosapi::mojom::GoogleServiceAuthErrorPtr mojo_error) {
|
||||
absl::optional<GoogleServiceAuthError> maybe_error =
|
||||
std::optional<GoogleServiceAuthError> maybe_error =
|
||||
FromMojoGoogleServiceAuthError(mojo_error);
|
||||
if (!maybe_error) {
|
||||
// Couldn't unmarshal GoogleServiceAuthError, report the account as not
|
||||
@ -237,7 +237,7 @@ class AccountManagerFacadeImpl::AccessTokenFetcher
|
||||
is_request_pending_ = false;
|
||||
|
||||
if (result->is_error()) {
|
||||
absl::optional<GoogleServiceAuthError> maybe_error =
|
||||
std::optional<GoogleServiceAuthError> maybe_error =
|
||||
account_manager::FromMojoGoogleServiceAuthError(result->get_error());
|
||||
|
||||
if (!maybe_error.has_value()) {
|
||||
@ -546,7 +546,7 @@ void AccountManagerFacadeImpl::OnSigninDialogActionFinished(
|
||||
base::OnceCallback<
|
||||
void(const account_manager::AccountUpsertionResult& result)> callback,
|
||||
crosapi::mojom::AccountUpsertionResultPtr mojo_result) {
|
||||
absl::optional<account_manager::AccountUpsertionResult> result =
|
||||
std::optional<account_manager::AccountUpsertionResult> result =
|
||||
account_manager::FromMojoAccountUpsertionResult(mojo_result);
|
||||
if (!result.has_value()) {
|
||||
FinishUpsertAccount(
|
||||
@ -568,7 +568,7 @@ void AccountManagerFacadeImpl::FinishUpsertAccount(
|
||||
|
||||
void AccountManagerFacadeImpl::OnTokenUpserted(
|
||||
crosapi::mojom::AccountPtr account) {
|
||||
absl::optional<Account> maybe_account = FromMojoAccount(account);
|
||||
std::optional<Account> maybe_account = FromMojoAccount(account);
|
||||
if (!maybe_account) {
|
||||
LOG(WARNING) << "Can't unmarshal account of type: "
|
||||
<< account->key->account_type;
|
||||
@ -581,7 +581,7 @@ void AccountManagerFacadeImpl::OnTokenUpserted(
|
||||
|
||||
void AccountManagerFacadeImpl::OnAccountRemoved(
|
||||
crosapi::mojom::AccountPtr account) {
|
||||
absl::optional<Account> maybe_account = FromMojoAccount(account);
|
||||
std::optional<Account> maybe_account = FromMojoAccount(account);
|
||||
if (!maybe_account) {
|
||||
LOG(WARNING) << "Can't unmarshal account of type: "
|
||||
<< account->key->account_type;
|
||||
@ -595,14 +595,14 @@ void AccountManagerFacadeImpl::OnAccountRemoved(
|
||||
void AccountManagerFacadeImpl::OnAuthErrorChanged(
|
||||
crosapi::mojom::AccountKeyPtr account,
|
||||
crosapi::mojom::GoogleServiceAuthErrorPtr error) {
|
||||
absl::optional<AccountKey> maybe_account_key = FromMojoAccountKey(account);
|
||||
std::optional<AccountKey> maybe_account_key = FromMojoAccountKey(account);
|
||||
if (!maybe_account_key) {
|
||||
LOG(WARNING) << "Can't unmarshal account key of type: "
|
||||
<< account->account_type;
|
||||
return;
|
||||
}
|
||||
|
||||
absl::optional<GoogleServiceAuthError> maybe_error =
|
||||
std::optional<GoogleServiceAuthError> maybe_error =
|
||||
FromMojoGoogleServiceAuthError(error);
|
||||
if (!maybe_error) {
|
||||
LOG(WARNING) << "Can't unmarshal error with state: " << error->state;
|
||||
|
@ -159,7 +159,7 @@ class FakeAccountManager : public crosapi::mojom::AccountManager {
|
||||
void GetPersistentErrorForAccount(
|
||||
crosapi::mojom::AccountKeyPtr mojo_account_key,
|
||||
GetPersistentErrorForAccountCallback callback) override {
|
||||
absl::optional<AccountKey> account_key =
|
||||
std::optional<AccountKey> account_key =
|
||||
FromMojoAccountKey(mojo_account_key);
|
||||
DCHECK(account_key.has_value());
|
||||
auto it = persistent_errors_.find(account_key.value());
|
||||
@ -256,7 +256,7 @@ class FakeAccountManager : public crosapi::mojom::AccountManager {
|
||||
return show_add_account_dialog_calls_;
|
||||
}
|
||||
|
||||
absl::optional<account_manager::AccountAdditionOptions>
|
||||
std::optional<account_manager::AccountAdditionOptions>
|
||||
show_add_account_dialog_options() const {
|
||||
return show_add_account_dialog_options_;
|
||||
}
|
||||
@ -271,7 +271,7 @@ class FakeAccountManager : public crosapi::mojom::AccountManager {
|
||||
|
||||
private:
|
||||
int show_add_account_dialog_calls_ = 0;
|
||||
absl::optional<account_manager::AccountAdditionOptions>
|
||||
std::optional<account_manager::AccountAdditionOptions>
|
||||
show_add_account_dialog_options_;
|
||||
int show_reauth_account_dialog_calls_ = 0;
|
||||
int show_manage_accounts_settings_calls_ = 0;
|
||||
|
@ -4,12 +4,13 @@
|
||||
|
||||
#include "components/account_manager_core/account_manager_util.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/notreached.h"
|
||||
#include "components/account_manager_core/account.h"
|
||||
#include "components/account_manager_core/account_addition_options.h"
|
||||
#include "components/account_manager_core/account_upsertion_result.h"
|
||||
#include "google_apis/gaia/google_service_auth_error.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace account_manager {
|
||||
|
||||
@ -98,7 +99,7 @@ crosapi::mojom::GoogleServiceAuthError::State ToMojoGoogleServiceAuthErrorState(
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<account_manager::AccountUpsertionResult::Status>
|
||||
std::optional<account_manager::AccountUpsertionResult::Status>
|
||||
FromMojoAccountAdditionStatus(
|
||||
crosapi::mojom::AccountUpsertionResult::Status mojo_status) {
|
||||
switch (mojo_status) {
|
||||
@ -119,7 +120,7 @@ FromMojoAccountAdditionStatus(
|
||||
default:
|
||||
LOG(WARNING) << "Unknown crosapi::mojom::AccountUpsertionResult::Status: "
|
||||
<< mojo_status;
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,16 +156,16 @@ crosapi::mojom::AccountUpsertionResult::Status ToMojoAccountAdditionStatus(
|
||||
|
||||
} // namespace
|
||||
|
||||
absl::optional<account_manager::Account> FromMojoAccount(
|
||||
std::optional<account_manager::Account> FromMojoAccount(
|
||||
const crosapi::mojom::AccountPtr& mojom_account) {
|
||||
if (mojom_account.is_null()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const absl::optional<account_manager::AccountKey> account_key =
|
||||
const std::optional<account_manager::AccountKey> account_key =
|
||||
FromMojoAccountKey(mojom_account->key);
|
||||
if (!account_key.has_value())
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
account_manager::Account account{account_key.value(),
|
||||
mojom_account->raw_email};
|
||||
@ -179,18 +180,18 @@ crosapi::mojom::AccountPtr ToMojoAccount(
|
||||
return mojom_account;
|
||||
}
|
||||
|
||||
absl::optional<account_manager::AccountKey> FromMojoAccountKey(
|
||||
std::optional<account_manager::AccountKey> FromMojoAccountKey(
|
||||
const crosapi::mojom::AccountKeyPtr& mojom_account_key) {
|
||||
if (mojom_account_key.is_null()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const absl::optional<account_manager::AccountType> account_type =
|
||||
const std::optional<account_manager::AccountType> account_type =
|
||||
FromMojoAccountType(mojom_account_key->account_type);
|
||||
if (!account_type.has_value())
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
if (mojom_account_key->id.empty())
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
return account_manager::AccountKey(mojom_account_key->id,
|
||||
account_type.value());
|
||||
@ -206,7 +207,7 @@ crosapi::mojom::AccountKeyPtr ToMojoAccountKey(
|
||||
return mojom_account_key;
|
||||
}
|
||||
|
||||
absl::optional<account_manager::AccountType> FromMojoAccountType(
|
||||
std::optional<account_manager::AccountType> FromMojoAccountType(
|
||||
const crosapi::mojom::AccountType& account_type) {
|
||||
switch (account_type) {
|
||||
case crosapi::mojom::AccountType::kGaia:
|
||||
@ -224,7 +225,7 @@ absl::optional<account_manager::AccountType> FromMojoAccountType(
|
||||
// Don't consider this as as error to preserve forwards compatibility with
|
||||
// lacros.
|
||||
LOG(WARNING) << "Unknown account type: " << account_type;
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -238,10 +239,10 @@ crosapi::mojom::AccountType ToMojoAccountType(
|
||||
}
|
||||
}
|
||||
|
||||
absl::optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
std::optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
const crosapi::mojom::GoogleServiceAuthErrorPtr& mojo_error) {
|
||||
if (mojo_error.is_null()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
switch (mojo_error->state) {
|
||||
@ -279,7 +280,7 @@ absl::optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
default:
|
||||
LOG(WARNING) << "Unknown crosapi::mojom::GoogleServiceAuthError::State: "
|
||||
<< mojo_error->state;
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,32 +306,32 @@ crosapi::mojom::GoogleServiceAuthErrorPtr ToMojoGoogleServiceAuthError(
|
||||
return mojo_result;
|
||||
}
|
||||
|
||||
absl::optional<account_manager::AccountUpsertionResult>
|
||||
std::optional<account_manager::AccountUpsertionResult>
|
||||
FromMojoAccountUpsertionResult(
|
||||
const crosapi::mojom::AccountUpsertionResultPtr& mojo_result) {
|
||||
if (mojo_result.is_null()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
absl::optional<account_manager::AccountUpsertionResult::Status> status =
|
||||
std::optional<account_manager::AccountUpsertionResult::Status> status =
|
||||
FromMojoAccountAdditionStatus(mojo_result->status);
|
||||
if (!status.has_value())
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
switch (status.value()) {
|
||||
case account_manager::AccountUpsertionResult::Status::kSuccess: {
|
||||
absl::optional<account_manager::Account> account =
|
||||
std::optional<account_manager::Account> account =
|
||||
FromMojoAccount(mojo_result->account);
|
||||
if (!account.has_value())
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
return account_manager::AccountUpsertionResult::FromAccount(
|
||||
account.value());
|
||||
}
|
||||
case account_manager::AccountUpsertionResult::Status::kNetworkError: {
|
||||
absl::optional<GoogleServiceAuthError> net_error =
|
||||
std::optional<GoogleServiceAuthError> net_error =
|
||||
FromMojoGoogleServiceAuthError(mojo_result->error);
|
||||
if (!net_error.has_value())
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
return account_manager::AccountUpsertionResult::FromError(
|
||||
net_error.value());
|
||||
}
|
||||
@ -364,11 +365,11 @@ crosapi::mojom::AccountUpsertionResultPtr ToMojoAccountUpsertionResult(
|
||||
return mojo_result;
|
||||
}
|
||||
|
||||
absl::optional<account_manager::AccountAdditionOptions>
|
||||
std::optional<account_manager::AccountAdditionOptions>
|
||||
FromMojoAccountAdditionOptions(
|
||||
const crosapi::mojom::AccountAdditionOptionsPtr& mojo_options) {
|
||||
if (mojo_options.is_null()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
account_manager::AccountAdditionOptions result;
|
||||
|
@ -5,48 +5,49 @@
|
||||
#ifndef COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_MANAGER_UTIL_H_
|
||||
#define COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_MANAGER_UTIL_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "chromeos/crosapi/mojom/account_manager.mojom.h"
|
||||
#include "components/account_manager_core/account.h"
|
||||
#include "components/account_manager_core/account_addition_options.h"
|
||||
#include "components/account_manager_core/account_upsertion_result.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class GoogleServiceAuthError;
|
||||
|
||||
namespace account_manager {
|
||||
|
||||
// Returns `absl::nullopt` if `mojom_account` cannot be parsed.
|
||||
// Returns `std::nullopt` if `mojom_account` cannot be parsed.
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
absl::optional<account_manager::Account> FromMojoAccount(
|
||||
std::optional<account_manager::Account> FromMojoAccount(
|
||||
const crosapi::mojom::AccountPtr& mojom_account);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
crosapi::mojom::AccountPtr ToMojoAccount(
|
||||
const account_manager::Account& account);
|
||||
|
||||
// Returns `absl::nullopt` if `mojom_account_key` cannot be parsed.
|
||||
// Returns `std::nullopt` if `mojom_account_key` cannot be parsed.
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
absl::optional<account_manager::AccountKey> FromMojoAccountKey(
|
||||
std::optional<account_manager::AccountKey> FromMojoAccountKey(
|
||||
const crosapi::mojom::AccountKeyPtr& mojom_account_key);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
crosapi::mojom::AccountKeyPtr ToMojoAccountKey(
|
||||
const account_manager::AccountKey& account_key);
|
||||
|
||||
// Returns `absl::nullopt` if `account_type` cannot be parsed.
|
||||
// Returns `std::nullopt` if `account_type` cannot be parsed.
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
absl::optional<account_manager::AccountType> FromMojoAccountType(
|
||||
std::optional<account_manager::AccountType> FromMojoAccountType(
|
||||
const crosapi::mojom::AccountType& account_type);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
crosapi::mojom::AccountType ToMojoAccountType(
|
||||
const account_manager::AccountType& account_type);
|
||||
|
||||
// Returns `absl::nullopt` if `mojo_error` cannot be parsed. This probably means
|
||||
// Returns `std::nullopt` if `mojo_error` cannot be parsed. This probably means
|
||||
// that a new error type was added, so it should be considered a persistent
|
||||
// error.
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
absl::optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
std::optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
const crosapi::mojom::GoogleServiceAuthErrorPtr& mojo_error);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
@ -54,7 +55,7 @@ crosapi::mojom::GoogleServiceAuthErrorPtr ToMojoGoogleServiceAuthError(
|
||||
GoogleServiceAuthError error);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
absl::optional<account_manager::AccountUpsertionResult>
|
||||
std::optional<account_manager::AccountUpsertionResult>
|
||||
FromMojoAccountUpsertionResult(
|
||||
const crosapi::mojom::AccountUpsertionResultPtr& mojo_result);
|
||||
|
||||
@ -63,7 +64,7 @@ crosapi::mojom::AccountUpsertionResultPtr ToMojoAccountUpsertionResult(
|
||||
account_manager::AccountUpsertionResult result);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
absl::optional<account_manager::AccountAdditionOptions>
|
||||
std::optional<account_manager::AccountAdditionOptions>
|
||||
FromMojoAccountAdditionOptions(
|
||||
const crosapi::mojom::AccountAdditionOptionsPtr& mojo_options);
|
||||
} // namespace account_manager
|
||||
|
@ -13,7 +13,7 @@ namespace account_manager {
|
||||
AccountUpsertionResult AccountUpsertionResult::FromStatus(Status status) {
|
||||
DCHECK_NE(status, Status::kSuccess);
|
||||
DCHECK_NE(status, Status::kNetworkError);
|
||||
return AccountUpsertionResult(status, /*account=*/absl::nullopt,
|
||||
return AccountUpsertionResult(status, /*account=*/std::nullopt,
|
||||
GoogleServiceAuthError::AuthErrorNone());
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ AccountUpsertionResult AccountUpsertionResult::FromError(
|
||||
const GoogleServiceAuthError& error) {
|
||||
DCHECK_NE(error.state(), GoogleServiceAuthError::NONE);
|
||||
return AccountUpsertionResult(Status::kNetworkError,
|
||||
/*account=*/absl::nullopt, error);
|
||||
/*account=*/std::nullopt, error);
|
||||
}
|
||||
|
||||
AccountUpsertionResult::AccountUpsertionResult(const AccountUpsertionResult&) =
|
||||
@ -42,7 +42,7 @@ AccountUpsertionResult::~AccountUpsertionResult() = default;
|
||||
|
||||
AccountUpsertionResult::AccountUpsertionResult(
|
||||
Status status,
|
||||
const absl::optional<Account>& account,
|
||||
const std::optional<Account>& account,
|
||||
const GoogleServiceAuthError& error)
|
||||
: status_(status), account_(account), error_(error) {
|
||||
DCHECK_EQ(account.has_value(), status == Status::kSuccess);
|
||||
|
@ -5,9 +5,10 @@
|
||||
#ifndef COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_UPSERTION_RESULT_H_
|
||||
#define COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_UPSERTION_RESULT_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "components/account_manager_core/account.h"
|
||||
#include "google_apis/gaia/google_service_auth_error.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace account_manager {
|
||||
|
||||
@ -50,11 +51,11 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) AccountUpsertionResult {
|
||||
static AccountUpsertionResult FromError(const GoogleServiceAuthError& error);
|
||||
|
||||
// If `status` is `kSuccess`, the reauthenticated/added account will be
|
||||
// returned from `account`. Otherwise `account` will be `absl::nullopt`.
|
||||
// returned from `account`. Otherwise `account` will be `std::nullopt`.
|
||||
Status status() const { return status_; }
|
||||
|
||||
// The account that was added. Set iff `status` is set to `kSuccess`.
|
||||
const absl::optional<Account>& account() const { return account_; }
|
||||
const std::optional<Account>& account() const { return account_; }
|
||||
|
||||
// The error state is NONE unless `status` is set to `kNetworkError`.
|
||||
const GoogleServiceAuthError& error() const { return error_; }
|
||||
@ -65,11 +66,11 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) AccountUpsertionResult {
|
||||
|
||||
private:
|
||||
AccountUpsertionResult(Status status,
|
||||
const absl::optional<Account>& account,
|
||||
const std::optional<Account>& account,
|
||||
const GoogleServiceAuthError& error);
|
||||
|
||||
Status status_;
|
||||
absl::optional<Account> account_;
|
||||
std::optional<Account> account_;
|
||||
GoogleServiceAuthError error_;
|
||||
};
|
||||
|
||||
|
@ -30,7 +30,7 @@ AccessTokenFetcher::AccessTokenFetcher(
|
||||
receiver_.set_disconnect_handler(base::BindOnce(
|
||||
&AccessTokenFetcher::OnMojoPipeError, base::Unretained(this)));
|
||||
|
||||
absl::optional<account_manager::AccountKey> maybe_account_key =
|
||||
std::optional<account_manager::AccountKey> maybe_account_key =
|
||||
account_manager::FromMojoAccountKey(mojo_account_key);
|
||||
if (maybe_account_key.has_value()) {
|
||||
access_token_fetcher_ = account_manager->CreateAccessTokenFetcher(
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "components/account_manager_core/chromeos/account_manager.h"
|
||||
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -38,7 +39,6 @@
|
||||
#include "google_apis/gaia/google_service_auth_error.h"
|
||||
#include "google_apis/gaia/oauth2_access_token_consumer.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/protobuf/src/google/protobuf/message_lite.h"
|
||||
|
||||
namespace account_manager {
|
||||
@ -81,11 +81,11 @@ void RecordInitializationTime(
|
||||
}
|
||||
|
||||
// Returns `nullopt` if `account_type` is `ACCOUNT_TYPE_UNSPECIFIED`.
|
||||
absl::optional<::account_manager::AccountType> FromProtoAccountType(
|
||||
std::optional<::account_manager::AccountType> FromProtoAccountType(
|
||||
const internal::AccountType& account_type) {
|
||||
switch (account_type) {
|
||||
case internal::AccountType::ACCOUNT_TYPE_UNSPECIFIED:
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
case internal::AccountType::ACCOUNT_TYPE_GAIA:
|
||||
static_assert(
|
||||
static_cast<int>(internal::AccountType::ACCOUNT_TYPE_GAIA) ==
|
||||
@ -243,7 +243,7 @@ class AccountManager::AccessTokenFetcher : public OAuth2AccessTokenFetcher {
|
||||
return;
|
||||
}
|
||||
|
||||
absl::optional<std::string> maybe_token =
|
||||
std::optional<std::string> maybe_token =
|
||||
account_manager_->GetRefreshToken(account_key_);
|
||||
if (!maybe_token.has_value()) {
|
||||
FireOnGetTokenFailure(GoogleServiceAuthError(
|
||||
@ -413,7 +413,7 @@ AccountManager::AccountMap AccountManager::LoadAccountsFromDisk(
|
||||
|
||||
bool is_any_account_corrupt = false;
|
||||
for (const auto& account : accounts_proto.accounts()) {
|
||||
const absl::optional<::account_manager::AccountType> account_type =
|
||||
const std::optional<::account_manager::AccountType> account_type =
|
||||
FromProtoAccountType(account.account_type());
|
||||
if (!account_type.has_value()) {
|
||||
LOG(WARNING) << "Ignoring invalid account_type load from disk";
|
||||
@ -836,7 +836,7 @@ bool AccountManager::IsEphemeralMode() const {
|
||||
return home_dir_.empty();
|
||||
}
|
||||
|
||||
absl::optional<std::string> AccountManager::GetRefreshToken(
|
||||
std::optional<std::string> AccountManager::GetRefreshToken(
|
||||
const ::account_manager::AccountKey& account_key) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
DCHECK_EQ(init_state_, InitializationState::kInitialized);
|
||||
@ -844,10 +844,10 @@ absl::optional<std::string> AccountManager::GetRefreshToken(
|
||||
|
||||
auto it = accounts_.find(account_key);
|
||||
if (it == accounts_.end() || it->second.token.empty()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return absl::make_optional<std::string>(it->second.token);
|
||||
return std::make_optional<std::string>(it->second.token);
|
||||
}
|
||||
|
||||
scoped_refptr<network::SharedURLLoaderFactory>
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -21,7 +22,6 @@
|
||||
#include "base/observer_list.h"
|
||||
#include "base/sequence_checker.h"
|
||||
#include "components/account_manager_core/account.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class OAuth2AccessTokenFetcher;
|
||||
class OAuth2AccessTokenConsumer;
|
||||
@ -340,7 +340,7 @@ class COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) AccountManager {
|
||||
// Returns the refresh token for `account_key`, if present. `account_key` must
|
||||
// be a Gaia account. Assumes that `AccountManager` initialization
|
||||
// (`init_state_`) is complete.
|
||||
absl::optional<std::string> GetRefreshToken(
|
||||
std::optional<std::string> GetRefreshToken(
|
||||
const ::account_manager::AccountKey& account_key);
|
||||
|
||||
// Returns `url_loader_factory_`. Assumes that `AccountManager` initialization
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/containers/contains.h"
|
||||
@ -25,7 +26,6 @@
|
||||
#include "google_apis/gaia/google_service_auth_error.h"
|
||||
#include "mojo/public/cpp/bindings/pending_remote.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace crosapi {
|
||||
|
||||
@ -101,7 +101,7 @@ void AccountManagerMojoService::GetAccounts(
|
||||
void AccountManagerMojoService::GetPersistentErrorForAccount(
|
||||
mojom::AccountKeyPtr mojo_account_key,
|
||||
mojom::AccountManager::GetPersistentErrorForAccountCallback callback) {
|
||||
absl::optional<account_manager::AccountKey> maybe_account_key =
|
||||
std::optional<account_manager::AccountKey> maybe_account_key =
|
||||
account_manager::FromMojoAccountKey(mojo_account_key);
|
||||
DCHECK(maybe_account_key)
|
||||
<< "Can't unmarshal account of type: " << mojo_account_key->account_type;
|
||||
@ -182,7 +182,7 @@ void AccountManagerMojoService::CreateAccessTokenFetcher(
|
||||
void AccountManagerMojoService::ReportAuthError(
|
||||
mojom::AccountKeyPtr mojo_account_key,
|
||||
mojom::GoogleServiceAuthErrorPtr mojo_error) {
|
||||
absl::optional<account_manager::AccountKey> maybe_account_key =
|
||||
std::optional<account_manager::AccountKey> maybe_account_key =
|
||||
account_manager::FromMojoAccountKey(mojo_account_key);
|
||||
base::UmaHistogramBoolean("AccountManager.ReportAuthError.IsAccountKeyEmpty",
|
||||
!maybe_account_key.has_value());
|
||||
@ -192,7 +192,7 @@ void AccountManagerMojoService::ReportAuthError(
|
||||
return;
|
||||
}
|
||||
|
||||
absl::optional<GoogleServiceAuthError> maybe_error =
|
||||
std::optional<GoogleServiceAuthError> maybe_error =
|
||||
account_manager::FromMojoGoogleServiceAuthError(mojo_error);
|
||||
if (!maybe_error) {
|
||||
// Newer version of Lacros may have reported an error that older version of
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -31,7 +32,6 @@
|
||||
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
|
||||
#include "services/network/test/test_url_loader_factory.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace crosapi {
|
||||
|
||||
@ -130,10 +130,10 @@ class TestAccountManagerObserver
|
||||
int num_account_removed_calls_ = 0;
|
||||
int num_auth_errors_ = 0;
|
||||
int num_signin_dialog_closed_notifications_ = 0;
|
||||
absl::optional<account_manager::Account> last_upserted_account_;
|
||||
absl::optional<account_manager::Account> last_removed_account_;
|
||||
absl::optional<account_manager::AccountKey> last_err_account_;
|
||||
absl::optional<GoogleServiceAuthError> last_error_;
|
||||
std::optional<account_manager::Account> last_upserted_account_;
|
||||
std::optional<account_manager::Account> last_removed_account_;
|
||||
std::optional<account_manager::AccountKey> last_err_account_;
|
||||
std::optional<GoogleServiceAuthError> last_error_;
|
||||
mojo::Receiver<mojom::AccountManagerObserver> receiver_;
|
||||
};
|
||||
|
||||
@ -165,7 +165,7 @@ class AccountManagerSpy : public account_manager::AccountManager {
|
||||
private:
|
||||
// Mutated by const CreateAccessTokenFetcher.
|
||||
mutable int num_access_token_fetches_ = 0;
|
||||
mutable absl::optional<account_manager::AccountKey>
|
||||
mutable std::optional<account_manager::AccountKey>
|
||||
last_access_token_account_key_;
|
||||
};
|
||||
|
||||
@ -462,7 +462,7 @@ TEST_F(AccountManagerMojoServiceTest,
|
||||
// Check status.
|
||||
EXPECT_EQ(mojom::AccountUpsertionResult::Status::kSuccess, result->status);
|
||||
// Check account.
|
||||
absl::optional<account_manager::Account> account =
|
||||
std::optional<account_manager::Account> account =
|
||||
account_manager::FromMojoAccount(result->account);
|
||||
EXPECT_TRUE(account.has_value());
|
||||
EXPECT_EQ(kFakeAccount.key, account.value().key);
|
||||
@ -490,7 +490,7 @@ TEST_F(AccountManagerMojoServiceTest,
|
||||
// Check status.
|
||||
EXPECT_EQ(mojom::AccountUpsertionResult::Status::kSuccess, result->status);
|
||||
// Check account.
|
||||
absl::optional<account_manager::Account> account =
|
||||
std::optional<account_manager::Account> account =
|
||||
account_manager::FromMojoAccount(result->account);
|
||||
EXPECT_TRUE(account.has_value());
|
||||
EXPECT_EQ(kFakeAccount.key, account.value().key);
|
||||
@ -527,7 +527,7 @@ TEST_F(AccountManagerMojoServiceTest,
|
||||
|
||||
EXPECT_EQ(mojom::AccountUpsertionResult::Status::kSuccess, result->status);
|
||||
// Check account.
|
||||
absl::optional<account_manager::Account> account =
|
||||
std::optional<account_manager::Account> account =
|
||||
account_manager::FromMojoAccount(result->account);
|
||||
EXPECT_TRUE(account.has_value());
|
||||
EXPECT_EQ(kFakeAccount.key, account.value().key);
|
||||
@ -552,7 +552,7 @@ TEST_F(AccountManagerMojoServiceTest,
|
||||
auto result = future.Take();
|
||||
EXPECT_EQ(mojom::AccountUpsertionResult::Status::kSuccess, result->status);
|
||||
// Check account.
|
||||
absl::optional<account_manager::Account> account =
|
||||
std::optional<account_manager::Account> account =
|
||||
account_manager::FromMojoAccount(result->account);
|
||||
EXPECT_TRUE(account.has_value());
|
||||
EXPECT_EQ(kFakeAccount.key, account.value().key);
|
||||
@ -569,7 +569,7 @@ TEST_F(AccountManagerMojoServiceTest,
|
||||
auto result_2 = future_2.Take();
|
||||
EXPECT_EQ(mojom::AccountUpsertionResult::Status::kSuccess, result_2->status);
|
||||
// Check account.
|
||||
absl::optional<account_manager::Account> account_2 =
|
||||
std::optional<account_manager::Account> account_2 =
|
||||
account_manager::FromMojoAccount(result_2->account);
|
||||
EXPECT_TRUE(account_2.has_value());
|
||||
EXPECT_EQ(kFakeAccount.key, account_2.value().key);
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/account_manager_core/chromeos/account_manager.h"
|
||||
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
@ -29,7 +30,6 @@
|
||||
#include "services/network/test/test_url_loader_factory.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 account_manager {
|
||||
|
||||
@ -240,9 +240,9 @@ class AccountManagerObserver : public AccountManager::Observer {
|
||||
void Reset() {
|
||||
is_token_upserted_callback_called_ = false;
|
||||
is_account_removed_callback_called_ = false;
|
||||
last_upserted_account_key_ = absl::nullopt;
|
||||
last_upserted_account_key_ = std::nullopt;
|
||||
last_upserted_account_email_.clear();
|
||||
last_removed_account_key_ = absl::nullopt;
|
||||
last_removed_account_key_ = std::nullopt;
|
||||
last_removed_account_email_.clear();
|
||||
accounts_.clear();
|
||||
}
|
||||
@ -278,9 +278,9 @@ class AccountManagerObserver : public AccountManager::Observer {
|
||||
private:
|
||||
bool is_token_upserted_callback_called_ = false;
|
||||
bool is_account_removed_callback_called_ = false;
|
||||
absl::optional<::account_manager::AccountKey> last_upserted_account_key_;
|
||||
std::optional<::account_manager::AccountKey> last_upserted_account_key_;
|
||||
std::string last_upserted_account_email_;
|
||||
absl::optional<::account_manager::AccountKey> last_removed_account_key_;
|
||||
std::optional<::account_manager::AccountKey> last_removed_account_key_;
|
||||
std::string last_removed_account_email_;
|
||||
std::set<::account_manager::AccountKey> accounts_;
|
||||
};
|
||||
|
@ -4,22 +4,21 @@
|
||||
|
||||
#include "components/aggregation_service/parsing_utils.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "components/aggregation_service/aggregation_coordinator_utils.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
namespace aggregation_service {
|
||||
|
||||
absl::optional<url::Origin> ParseAggregationCoordinator(
|
||||
const std::string& str) {
|
||||
std::optional<url::Origin> ParseAggregationCoordinator(const std::string& str) {
|
||||
auto origin = url::Origin::Create(GURL(str));
|
||||
if (IsAggregationCoordinatorOriginAllowed(origin)) {
|
||||
return origin;
|
||||
}
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
} // namespace aggregation_service
|
||||
|
@ -5,10 +5,10 @@
|
||||
#ifndef COMPONENTS_AGGREGATION_SERVICE_PARSING_UTILS_H_
|
||||
#define COMPONENTS_AGGREGATION_SERVICE_PARSING_UTILS_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/component_export.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace url {
|
||||
class Origin;
|
||||
@ -19,7 +19,7 @@ namespace aggregation_service {
|
||||
// Parses aggregation coordinator identifier. Returns `kDefault` if `str` is
|
||||
// nullptr or is not a pre-defined value.
|
||||
COMPONENT_EXPORT(AGGREGATION_SERVICE)
|
||||
absl::optional<url::Origin> ParseAggregationCoordinator(const std::string& str);
|
||||
std::optional<url::Origin> ParseAggregationCoordinator(const std::string& str);
|
||||
|
||||
} // namespace aggregation_service
|
||||
|
||||
|
@ -4,11 +4,11 @@
|
||||
|
||||
#include "components/aggregation_service/parsing_utils.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "components/aggregation_service/features.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"
|
||||
|
||||
@ -18,11 +18,11 @@ namespace {
|
||||
TEST(AggregationServiceParsingUtilsTest, ParseAggregationCoordinator) {
|
||||
const struct {
|
||||
std::string str;
|
||||
absl::optional<url::Origin> expected;
|
||||
std::optional<url::Origin> expected;
|
||||
} kTestCases[] = {
|
||||
{kAggregationServiceCoordinatorAwsCloud.Get(),
|
||||
url::Origin::Create(GURL(kAggregationServiceCoordinatorAwsCloud.Get()))},
|
||||
{"https://a.test", absl::nullopt},
|
||||
{"https://a.test", std::nullopt},
|
||||
};
|
||||
|
||||
for (const auto& test_case : kTestCases) {
|
||||
|
@ -4,13 +4,13 @@
|
||||
|
||||
#include "components/allocation_recorder/crash_handler/allocation_recorder_holder.h"
|
||||
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "base/check.h"
|
||||
#include "build/build_config.h"
|
||||
#include "components/allocation_recorder/internal/internal.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/crashpad/crashpad/client/annotation.h"
|
||||
#include "third_party/crashpad/crashpad/snapshot/cpu_context.h"
|
||||
#include "third_party/crashpad/crashpad/snapshot/exception_snapshot.h"
|
||||
@ -67,7 +67,7 @@ constexpr const char* GetBitnessDescriptor(BitnessType bitness) {
|
||||
// in the process_snapshot. Returns an optional containing the exact address.
|
||||
// In case of an error, an empty optional is returned and details on the error
|
||||
// will be written to the error_stream.
|
||||
absl::optional<crashpad::VMAddress> GetRecorderVMAddress(
|
||||
std::optional<crashpad::VMAddress> GetRecorderVMAddress(
|
||||
const crashpad::ProcessSnapshot& process_snapshot,
|
||||
std::ostream& error_stream) {
|
||||
for (const auto* module : process_snapshot.Modules()) {
|
||||
|
@ -464,7 +464,7 @@ void AutofillProviderAndroid::OnFocusNoLongerOnForm(
|
||||
return;
|
||||
}
|
||||
|
||||
bridge_->OnFocusChanged(absl::nullopt);
|
||||
bridge_->OnFocusChanged(std::nullopt);
|
||||
}
|
||||
|
||||
void AutofillProviderAndroid::OnFocusOnFormField(
|
||||
|
@ -7,12 +7,12 @@
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/containers/span.h"
|
||||
#include "components/autofill/core/common/form_field_data.h"
|
||||
#include "components/autofill/core/common/mojom/autofill_types.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/jni_zero/scoped_java_ref.h"
|
||||
|
||||
namespace gfx {
|
||||
@ -76,7 +76,7 @@ class AutofillProviderAndroidBridge {
|
||||
virtual void HideDatalistPopup() = 0;
|
||||
|
||||
// Informs the Java side that a focus change has happened to `field`.
|
||||
virtual void OnFocusChanged(const absl::optional<FieldInfo>& field) = 0;
|
||||
virtual void OnFocusChanged(const std::optional<FieldInfo>& field) = 0;
|
||||
|
||||
// Informs the Java side that the `field` has changed.
|
||||
virtual void OnFormFieldDidChange(const FieldInfo& field) = 0;
|
||||
|
@ -98,7 +98,7 @@ void AutofillProviderAndroidBridgeImpl::OnServerPredictionsAvailable() {
|
||||
}
|
||||
|
||||
void AutofillProviderAndroidBridgeImpl::OnFocusChanged(
|
||||
const absl::optional<FieldInfo>& field) {
|
||||
const std::optional<FieldInfo>& field) {
|
||||
JNIEnv* env = AttachCurrentThread();
|
||||
ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
|
||||
if (obj.is_null()) {
|
||||
|
@ -5,15 +5,15 @@
|
||||
#ifndef COMPONENTS_ANDROID_AUTOFILL_BROWSER_AUTOFILL_PROVIDER_ANDROID_BRIDGE_IMPL_H_
|
||||
#define COMPONENTS_ANDROID_AUTOFILL_BROWSER_AUTOFILL_PROVIDER_ANDROID_BRIDGE_IMPL_H_
|
||||
|
||||
#include "components/android_autofill/browser/autofill_provider_android_bridge.h"
|
||||
|
||||
#include <jni.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/android/jni_weak_ref.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/memory/raw_ref.h"
|
||||
#include "components/android_autofill/browser/autofill_provider_android_bridge.h"
|
||||
#include "components/autofill/core/common/mojom/autofill_types.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace autofill {
|
||||
|
||||
@ -34,7 +34,7 @@ class AutofillProviderAndroidBridgeImpl : public AutofillProviderAndroidBridge {
|
||||
void ShowDatalistPopup(base::span<const SelectOption> options,
|
||||
bool is_rtl) override;
|
||||
void HideDatalistPopup() override;
|
||||
void OnFocusChanged(const absl::optional<FieldInfo>& field) override;
|
||||
void OnFocusChanged(const std::optional<FieldInfo>& field) override;
|
||||
void OnFormFieldDidChange(const FieldInfo& field) override;
|
||||
void OnFormFieldVisibilitiesDidChange(base::span<const int> indices) override;
|
||||
void OnTextFieldDidScroll(const FieldInfo& field) override;
|
||||
|
@ -191,7 +191,7 @@ class MockAutofillProviderAndroidBridge : public AutofillProviderAndroidBridge {
|
||||
MOCK_METHOD(void, HideDatalistPopup, (), (override));
|
||||
MOCK_METHOD(void,
|
||||
OnFocusChanged,
|
||||
(const absl::optional<FieldInfo>&),
|
||||
(const std::optional<FieldInfo>&),
|
||||
(override));
|
||||
MOCK_METHOD(void, OnFormFieldDidChange, (const FieldInfo&), (override));
|
||||
MOCK_METHOD(void,
|
||||
@ -344,7 +344,7 @@ TEST_F(AutofillProviderAndroidTest, OnFocusChangeInsideCurrentAutofillForm) {
|
||||
EXPECT_CALL(provider_bridge(),
|
||||
OnFocusChanged(Optional(EqualsFieldInfo(/*index=*/1))));
|
||||
EXPECT_CALL(check, Call(1));
|
||||
EXPECT_CALL(provider_bridge(), OnFocusChanged(Eq(absl::nullopt)));
|
||||
EXPECT_CALL(provider_bridge(), OnFocusChanged(Eq(std::nullopt)));
|
||||
EXPECT_CALL(check, Call(2));
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/android_autofill/browser/form_field_data_android_bridge_impl.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@ -16,7 +17,6 @@
|
||||
#include "components/autofill/core/browser/autofill_type.h"
|
||||
#include "components/autofill/core/common/autofill_util.h"
|
||||
#include "components/autofill/core/common/form_field_data.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace autofill {
|
||||
|
||||
|
@ -18,10 +18,10 @@ uint16_t ParseMessageLength(base::span<const uint8_t> message, size_t offset) {
|
||||
|
||||
} // namespace
|
||||
|
||||
absl::optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
std::optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
base::span<const uint8_t> message) {
|
||||
if (message.size() < kApduMinHeader || message.size() > kApduMaxLength)
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
uint8_t cla = message[0];
|
||||
uint8_t ins = message[1];
|
||||
@ -38,12 +38,12 @@ absl::optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
// Invalid encoding sizes.
|
||||
case kApduMinHeader + 1:
|
||||
case kApduMinHeader + 2:
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
// No data present; response expected.
|
||||
case kApduMinHeader + 3:
|
||||
// Fifth byte must be 0.
|
||||
if (message[4] != 0)
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
response_length = ParseMessageLength(message, kApduCommandLengthOffset);
|
||||
// Special case where response length of 0x0000 corresponds to 65536
|
||||
// as defined in ISO7816-4.
|
||||
@ -53,7 +53,7 @@ absl::optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
default:
|
||||
// Fifth byte must be 0.
|
||||
if (message[4] != 0)
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
auto data_length = ParseMessageLength(message, kApduCommandLengthOffset);
|
||||
|
||||
if (message.size() == data_length + kApduCommandDataOffset) {
|
||||
@ -71,7 +71,7 @@ absl::optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
if (response_length == 0)
|
||||
response_length = kApduMaxResponseLength;
|
||||
} else {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -6,13 +6,13 @@
|
||||
#define COMPONENTS_APDU_APDU_COMMAND_H_
|
||||
|
||||
#include <cinttypes>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/component_export.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace apdu {
|
||||
|
||||
@ -27,7 +27,7 @@ namespace apdu {
|
||||
class COMPONENT_EXPORT(APDU) ApduCommand {
|
||||
public:
|
||||
// Constructs an APDU command from the serialized message data.
|
||||
static absl::optional<ApduCommand> CreateFromMessage(
|
||||
static std::optional<ApduCommand> CreateFromMessage(
|
||||
base::span<const uint8_t> message);
|
||||
|
||||
ApduCommand();
|
||||
|
@ -11,11 +11,11 @@
|
||||
namespace apdu {
|
||||
|
||||
// static
|
||||
absl::optional<ApduResponse> ApduResponse::CreateFromMessage(
|
||||
std::optional<ApduResponse> ApduResponse::CreateFromMessage(
|
||||
base::span<const uint8_t> data) {
|
||||
// Invalid message size, data is appended by status byte.
|
||||
if (data.size() < 2)
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
uint16_t status_bytes = data[data.size() - 2] << 8;
|
||||
status_bytes |= data[data.size() - 1];
|
||||
|
@ -7,12 +7,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "base/component_export.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace apdu {
|
||||
|
||||
@ -32,7 +32,7 @@ class COMPONENT_EXPORT(APDU) ApduResponse {
|
||||
};
|
||||
|
||||
// Create a APDU response from the serialized message.
|
||||
static absl::optional<ApduResponse> CreateFromMessage(
|
||||
static std::optional<ApduResponse> CreateFromMessage(
|
||||
base::span<const uint8_t> data);
|
||||
|
||||
ApduResponse(std::vector<uint8_t> data, Status response_status);
|
||||
|
@ -169,7 +169,7 @@ void ArcIntentHelperBridge::OnIntentFiltersUpdated(
|
||||
intent_filters_[filter.package_name()].push_back(std::move(filter));
|
||||
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnIntentFiltersUpdated(absl::nullopt);
|
||||
observer.OnIntentFiltersUpdated(std::nullopt);
|
||||
}
|
||||
|
||||
void ArcIntentHelperBridge::OnOpenDownloads() {
|
||||
|
@ -190,7 +190,7 @@ TEST_F(ArcIntentHelperTest, TestObserver) {
|
||||
|
||||
{
|
||||
// Observer should be called when an intent filter is updated.
|
||||
EXPECT_CALL(observer, OnIntentFiltersUpdated(testing::Eq(absl::nullopt)));
|
||||
EXPECT_CALL(observer, OnIntentFiltersUpdated(testing::Eq(std::nullopt)));
|
||||
instance_->OnIntentFiltersUpdated(/*filters=*/std::vector<IntentFilter>());
|
||||
testing::Mock::VerifyAndClearExpectations(&observer);
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class ArcIntentHelperObserver {
|
||||
virtual ~ArcIntentHelperObserver() = default;
|
||||
|
||||
// Called when intent filters are added, removed or updated.
|
||||
// A absl::nullopt |package_name| indicates that intent filters were updated
|
||||
// A std::nullopt |package_name| indicates that intent filters were updated
|
||||
// for all packages. Otherwise, |package_name| contains the name of the
|
||||
// package whose filters were changed.
|
||||
virtual void OnIntentFiltersUpdated(
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/types/expected.h"
|
||||
@ -14,7 +15,6 @@
|
||||
#include "components/attribution_reporting/filters.h"
|
||||
#include "components/attribution_reporting/parsing_utils.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
@ -48,7 +48,7 @@ AggregatableDedupKey::FromJSON(base::Value& value) {
|
||||
|
||||
AggregatableDedupKey::AggregatableDedupKey() = default;
|
||||
|
||||
AggregatableDedupKey::AggregatableDedupKey(absl::optional<uint64_t> dedup_key,
|
||||
AggregatableDedupKey::AggregatableDedupKey(std::optional<uint64_t> dedup_key,
|
||||
FilterPair filters)
|
||||
: dedup_key(dedup_key), filters(std::move(filters)) {}
|
||||
|
||||
|
@ -7,12 +7,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/component_export.h"
|
||||
#include "base/types/expected.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/filters.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -22,7 +23,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregatableDedupKey {
|
||||
|
||||
// Key specified for deduplication against existing trigger with the same
|
||||
// source. If absent, no deduplication is performed.
|
||||
absl::optional<uint64_t> dedup_key;
|
||||
std::optional<uint64_t> dedup_key;
|
||||
|
||||
// The filters used to determine whether this `AggregatableDedupKey`'s dedup
|
||||
// key is used.
|
||||
@ -30,7 +31,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregatableDedupKey {
|
||||
|
||||
AggregatableDedupKey();
|
||||
|
||||
AggregatableDedupKey(absl::optional<uint64_t> dedup_key, FilterPair);
|
||||
AggregatableDedupKey(std::optional<uint64_t> dedup_key, FilterPair);
|
||||
|
||||
base::Value::Dict ToJson() const;
|
||||
|
||||
|
@ -35,7 +35,7 @@ TEST(AggregatableDedupKeyTest, FromJSON) {
|
||||
{
|
||||
"empty",
|
||||
R"json({})json",
|
||||
ValueIs(AllOf(Field(&AggregatableDedupKey::dedup_key, absl::nullopt),
|
||||
ValueIs(AllOf(Field(&AggregatableDedupKey::dedup_key, std::nullopt),
|
||||
Field(&AggregatableDedupKey::filters, FilterPair()))),
|
||||
},
|
||||
{
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -17,7 +18,6 @@
|
||||
#include "components/attribution_reporting/features.h"
|
||||
#include "components/attribution_reporting/source_registration_time_config.mojom.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -84,7 +84,7 @@ bool IsTriggerContextIdAllowed(
|
||||
}
|
||||
|
||||
bool IsValid(SourceRegistrationTimeConfig source_registration_time_config,
|
||||
const absl::optional<std::string>& trigger_context_id) {
|
||||
const std::optional<std::string>& trigger_context_id) {
|
||||
if (!trigger_context_id.has_value()) {
|
||||
return true;
|
||||
}
|
||||
@ -93,12 +93,12 @@ bool IsValid(SourceRegistrationTimeConfig source_registration_time_config,
|
||||
IsTriggerContextIdAllowed(source_registration_time_config);
|
||||
}
|
||||
|
||||
base::expected<absl::optional<std::string>, TriggerRegistrationError>
|
||||
base::expected<std::optional<std::string>, TriggerRegistrationError>
|
||||
ParseTriggerContextId(base::Value* value) {
|
||||
if (!base::FeatureList::IsEnabled(
|
||||
features::kAttributionReportingTriggerContextId) ||
|
||||
!value) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::string* s = value->GetIfString();
|
||||
@ -118,7 +118,7 @@ AggregatableTriggerConfig::Parse(base::Value::Dict& dict) {
|
||||
ParseAggregatableSourceRegistrationTime(
|
||||
dict.Find(kAggregatableSourceRegistrationTime)));
|
||||
|
||||
ASSIGN_OR_RETURN(absl::optional<std::string> trigger_context_id,
|
||||
ASSIGN_OR_RETURN(std::optional<std::string> trigger_context_id,
|
||||
ParseTriggerContextId(dict.Find(kTriggerContextId)));
|
||||
|
||||
if (trigger_context_id.has_value() &&
|
||||
@ -133,11 +133,11 @@ AggregatableTriggerConfig::Parse(base::Value::Dict& dict) {
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<AggregatableTriggerConfig> AggregatableTriggerConfig::Create(
|
||||
std::optional<AggregatableTriggerConfig> AggregatableTriggerConfig::Create(
|
||||
SourceRegistrationTimeConfig source_registration_time_config,
|
||||
absl::optional<std::string> trigger_context_id) {
|
||||
std::optional<std::string> trigger_context_id) {
|
||||
if (!IsValid(source_registration_time_config, trigger_context_id)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return AggregatableTriggerConfig(source_registration_time_config,
|
||||
std::move(trigger_context_id));
|
||||
@ -147,7 +147,7 @@ AggregatableTriggerConfig::AggregatableTriggerConfig() = default;
|
||||
|
||||
AggregatableTriggerConfig::AggregatableTriggerConfig(
|
||||
SourceRegistrationTimeConfig source_registration_time_config,
|
||||
absl::optional<std::string> trigger_context_id)
|
||||
std::optional<std::string> trigger_context_id)
|
||||
: source_registration_time_config_(source_registration_time_config),
|
||||
trigger_context_id_(std::move(trigger_context_id)) {
|
||||
CHECK(IsValid(source_registration_time_config_, trigger_context_id_));
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATABLE_TRIGGER_CONFIG_H_
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATABLE_TRIGGER_CONFIG_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/component_export.h"
|
||||
@ -12,7 +13,6 @@
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/source_registration_time_config.mojom.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -22,9 +22,9 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregatableTriggerConfig {
|
||||
mojom::TriggerRegistrationError>
|
||||
Parse(base::Value::Dict&);
|
||||
|
||||
static absl::optional<AggregatableTriggerConfig> Create(
|
||||
static std::optional<AggregatableTriggerConfig> Create(
|
||||
mojom::SourceRegistrationTimeConfig,
|
||||
absl::optional<std::string> trigger_context_id);
|
||||
std::optional<std::string> trigger_context_id);
|
||||
|
||||
AggregatableTriggerConfig();
|
||||
|
||||
@ -45,18 +45,18 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregatableTriggerConfig {
|
||||
return source_registration_time_config_;
|
||||
}
|
||||
|
||||
const absl::optional<std::string>& trigger_context_id() const {
|
||||
const std::optional<std::string>& trigger_context_id() const {
|
||||
return trigger_context_id_;
|
||||
}
|
||||
|
||||
private:
|
||||
AggregatableTriggerConfig(mojom::SourceRegistrationTimeConfig,
|
||||
absl::optional<std::string> trigger_context_id);
|
||||
std::optional<std::string> trigger_context_id);
|
||||
|
||||
mojom::SourceRegistrationTimeConfig source_registration_time_config_ =
|
||||
mojom::SourceRegistrationTimeConfig::kExclude;
|
||||
|
||||
absl::optional<std::string> trigger_context_id_;
|
||||
std::optional<std::string> trigger_context_id_;
|
||||
};
|
||||
|
||||
} // namespace attribution_reporting
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/aggregatable_trigger_config.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/test/gmock_expected_support.h"
|
||||
@ -16,7 +17,6 @@
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.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 attribution_reporting {
|
||||
namespace {
|
||||
@ -124,7 +124,7 @@ TEST(AggregatableTriggerConfigTest, ParseTriggerContextId) {
|
||||
kTriggerContextIdInvalidSourceRegistrationTimeConfig),
|
||||
ValueIs(*AggregatableTriggerConfig::Create(
|
||||
SourceRegistrationTimeConfig::kInclude,
|
||||
/*trigger_context_id=*/absl::nullopt)),
|
||||
/*trigger_context_id=*/std::nullopt)),
|
||||
},
|
||||
};
|
||||
|
||||
@ -160,8 +160,8 @@ TEST(AggregatableTriggerConfigTest, Create) {
|
||||
const struct {
|
||||
const char* desc;
|
||||
SourceRegistrationTimeConfig source_registration_time_config;
|
||||
absl::optional<std::string> trigger_context_id;
|
||||
absl::optional<AggregatableTriggerConfig> expected;
|
||||
std::optional<std::string> trigger_context_id;
|
||||
std::optional<AggregatableTriggerConfig> expected;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
"valid_exclude_source_registration_time_with_trigger_context_id",
|
||||
@ -173,33 +173,33 @@ TEST(AggregatableTriggerConfigTest, Create) {
|
||||
{
|
||||
"valid_exclude_source_registration_time_without_trigger_context_id",
|
||||
SourceRegistrationTimeConfig::kExclude,
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
AggregatableTriggerConfig(),
|
||||
},
|
||||
{
|
||||
"valid_include_source_registration_time_without_trigger_context_id",
|
||||
SourceRegistrationTimeConfig::kInclude,
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
*AggregatableTriggerConfig::Create(
|
||||
SourceRegistrationTimeConfig::kInclude, absl::nullopt),
|
||||
SourceRegistrationTimeConfig::kInclude, std::nullopt),
|
||||
},
|
||||
{
|
||||
"trigger_context_id_empty",
|
||||
SourceRegistrationTimeConfig::kExclude,
|
||||
"",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
},
|
||||
{
|
||||
"trigger_context_id_too_long",
|
||||
SourceRegistrationTimeConfig::kExclude,
|
||||
std::string(65, 'a'),
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
},
|
||||
{
|
||||
"trigger_context_id_disallowed",
|
||||
SourceRegistrationTimeConfig::kInclude,
|
||||
"123",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
},
|
||||
};
|
||||
|
||||
@ -244,7 +244,7 @@ TEST(AggregatableTriggerConfigTest, Serialize) {
|
||||
{
|
||||
*AggregatableTriggerConfig::Create(
|
||||
SourceRegistrationTimeConfig::kInclude,
|
||||
/*trigger_context_id=*/absl::nullopt),
|
||||
/*trigger_context_id=*/std::nullopt),
|
||||
R"json({
|
||||
"aggregatable_source_registration_time":"include"
|
||||
})json",
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/aggregatable_trigger_data.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -16,7 +17,6 @@
|
||||
#include "components/attribution_reporting/parsing_utils.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -102,12 +102,12 @@ void SerializeSourceKeysIfNotEmpty(base::Value::Dict& dict,
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
absl::optional<AggregatableTriggerData> AggregatableTriggerData::Create(
|
||||
std::optional<AggregatableTriggerData> AggregatableTriggerData::Create(
|
||||
absl::uint128 key_piece,
|
||||
Keys source_keys,
|
||||
FilterPair filters) {
|
||||
if (!AreSourceKeysValid(source_keys))
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
return AggregatableTriggerData(key_piece, std::move(source_keys),
|
||||
std::move(filters));
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATABLE_TRIGGER_DATA_H_
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATABLE_TRIGGER_DATA_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -14,7 +15,6 @@
|
||||
#include "components/attribution_reporting/filters.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -22,9 +22,9 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregatableTriggerData {
|
||||
public:
|
||||
using Keys = std::vector<std::string>;
|
||||
|
||||
static absl::optional<AggregatableTriggerData> Create(absl::uint128 key_piece,
|
||||
Keys source_keys,
|
||||
FilterPair);
|
||||
static std::optional<AggregatableTriggerData> Create(absl::uint128 key_piece,
|
||||
Keys source_keys,
|
||||
FilterPair);
|
||||
|
||||
static base::expected<AggregatableTriggerData,
|
||||
mojom::TriggerRegistrationError>
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/aggregatable_values.h"
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/check.h"
|
||||
@ -15,7 +16,6 @@
|
||||
#include "components/attribution_reporting/constants.h"
|
||||
#include "components/attribution_reporting/parsing_utils.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -37,9 +37,9 @@ bool IsValid(const AggregatableValues::Values& values) {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
absl::optional<AggregatableValues> AggregatableValues::Create(Values values) {
|
||||
std::optional<AggregatableValues> AggregatableValues::Create(Values values) {
|
||||
if (!IsValid(values))
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
return AggregatableValues(std::move(values));
|
||||
}
|
||||
@ -64,7 +64,7 @@ AggregatableValues::FromJSON(const base::Value* input_value) {
|
||||
TriggerRegistrationError::kAggregatableValuesKeyTooLong);
|
||||
}
|
||||
|
||||
absl::optional<int> int_value = key_value.GetIfInt();
|
||||
std::optional<int> int_value = key_value.GetIfInt();
|
||||
if (!int_value.has_value()) {
|
||||
return base::unexpected(
|
||||
TriggerRegistrationError::kAggregatableValuesValueWrongType);
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/component_export.h"
|
||||
@ -14,7 +15,6 @@
|
||||
#include "base/types/expected.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -22,7 +22,7 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregatableValues {
|
||||
public:
|
||||
using Values = base::flat_map<std::string, uint32_t>;
|
||||
|
||||
static absl::optional<AggregatableValues> Create(Values);
|
||||
static std::optional<AggregatableValues> Create(Values);
|
||||
|
||||
static base::expected<AggregatableValues, mojom::TriggerRegistrationError>
|
||||
FromJSON(const base::Value*);
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -17,7 +18,6 @@
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.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 attribution_reporting {
|
||||
namespace {
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/aggregation_keys.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -18,7 +19,6 @@
|
||||
#include "components/attribution_reporting/parsing_utils.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -46,9 +46,9 @@ void RecordAggregatableKeysPerSource(base::HistogramBase::Sample count) {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
absl::optional<AggregationKeys> AggregationKeys::FromKeys(Keys keys) {
|
||||
std::optional<AggregationKeys> AggregationKeys::FromKeys(Keys keys) {
|
||||
if (!IsValid(keys))
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
return AggregationKeys(std::move(keys));
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATION_KEYS_H_
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_AGGREGATION_KEYS_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/component_export.h"
|
||||
@ -13,7 +14,6 @@
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -21,8 +21,8 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) AggregationKeys {
|
||||
public:
|
||||
using Keys = base::flat_map<std::string, absl::uint128>;
|
||||
|
||||
// Returns `absl::nullopt` if `keys` is invalid.
|
||||
static absl::optional<AggregationKeys> FromKeys(Keys keys);
|
||||
// Returns `std::nullopt` if `keys` is invalid.
|
||||
static std::optional<AggregationKeys> FromKeys(Keys keys);
|
||||
|
||||
static base::expected<AggregationKeys, mojom::SourceRegistrationError>
|
||||
FromJSON(const base::Value*);
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -20,7 +21,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"
|
||||
|
||||
namespace attribution_reporting {
|
||||
namespace {
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/destination_set.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -19,7 +20,6 @@
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
#include "mojo/public/cpp/bindings/default_construct_tag.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -35,10 +35,10 @@ bool DestinationsValid(const DestinationSet::Destinations& destinations) {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
absl::optional<DestinationSet> DestinationSet::Create(
|
||||
std::optional<DestinationSet> DestinationSet::Create(
|
||||
Destinations destinations) {
|
||||
if (!DestinationsValid(destinations)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return DestinationSet(std::move(destinations));
|
||||
}
|
||||
|
@ -5,13 +5,14 @@
|
||||
#ifndef COMPONENTS_ATTRIBUTION_REPORTING_DESTINATION_SET_H_
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_DESTINATION_SET_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/check.h"
|
||||
#include "base/component_export.h"
|
||||
#include "base/containers/flat_set.h"
|
||||
#include "base/types/expected.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom-forward.h"
|
||||
#include "mojo/public/cpp/bindings/default_construct_tag.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
class Value;
|
||||
@ -27,7 +28,7 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) DestinationSet {
|
||||
public:
|
||||
using Destinations = base::flat_set<net::SchemefulSite>;
|
||||
|
||||
static absl::optional<DestinationSet> Create(Destinations);
|
||||
static std::optional<DestinationSet> Create(Destinations);
|
||||
|
||||
static base::expected<DestinationSet, mojom::SourceRegistrationError>
|
||||
FromJSON(const base::Value*);
|
||||
|
@ -4,12 +4,13 @@
|
||||
|
||||
#include "components/attribution_reporting/event_level_epsilon.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/check.h"
|
||||
#include "base/check_op.h"
|
||||
#include "base/types/expected.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -35,7 +36,7 @@ EventLevelEpsilon::Parse(const base::Value::Dict& dict) {
|
||||
return EventLevelEpsilon();
|
||||
}
|
||||
|
||||
absl::optional<double> d = value->GetIfDouble();
|
||||
std::optional<double> d = value->GetIfDouble();
|
||||
if (!d.has_value()) {
|
||||
return base::unexpected(
|
||||
SourceRegistrationError::kEventLevelEpsilonWrongType);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@ -24,7 +25,6 @@
|
||||
#include "components/attribution_reporting/parsing_utils.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom-shared.h"
|
||||
#include "components/attribution_reporting/source_type.mojom-shared.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -65,26 +65,26 @@ base::Time ReportTimeFromDeadline(base::Time source_time,
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
absl::optional<EventReportWindows> EventReportWindows::FromDefaults(
|
||||
std::optional<EventReportWindows> EventReportWindows::FromDefaults(
|
||||
base::TimeDelta report_window,
|
||||
SourceType source_type) {
|
||||
if (!IsReportWindowValid(report_window)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return EventReportWindows(report_window, source_type);
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<EventReportWindows> EventReportWindows::Create(
|
||||
std::optional<EventReportWindows> EventReportWindows::Create(
|
||||
base::TimeDelta start_time,
|
||||
std::vector<base::TimeDelta> end_times) {
|
||||
if (!IsStrictlyIncreasing(end_times)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
base::flat_set<base::TimeDelta> end_times_set(base::sorted_unique,
|
||||
std::move(end_times));
|
||||
if (!IsValid(start_time, end_times_set)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return EventReportWindows(start_time, std::move(end_times_set));
|
||||
}
|
||||
@ -232,7 +232,7 @@ EventReportWindows::ParseWindowsJSON(const base::Value& v,
|
||||
|
||||
base::TimeDelta start_time = base::Seconds(0);
|
||||
if (const base::Value* start_time_value = dict->Find(kStartTime)) {
|
||||
absl::optional<int> int_value = start_time_value->GetIfInt();
|
||||
std::optional<int> int_value = start_time_value->GetIfInt();
|
||||
if (!int_value.has_value()) {
|
||||
return base::unexpected(
|
||||
SourceRegistrationError::kEventReportWindowsStartTimeWrongType);
|
||||
@ -270,7 +270,7 @@ EventReportWindows::ParseWindowsJSON(const base::Value& v,
|
||||
|
||||
base::TimeDelta start_duration = start_time;
|
||||
for (const auto& item : *end_times_list) {
|
||||
const absl::optional<int> item_int = item.GetIfInt();
|
||||
const std::optional<int> item_int = item.GetIfInt();
|
||||
if (!item_int.has_value()) {
|
||||
return base::unexpected(
|
||||
SourceRegistrationError::kEventReportWindowsEndTimeValueWrongType);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_ATTRIBUTION_REPORTING_EVENT_REPORT_WINDOWS_H_
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_EVENT_REPORT_WINDOWS_H_
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "base/component_export.h"
|
||||
@ -14,7 +15,6 @@
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom-forward.h"
|
||||
#include "components/attribution_reporting/source_type.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -33,13 +33,13 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) EventReportWindows {
|
||||
kMaxValue = kNotStarted,
|
||||
};
|
||||
|
||||
static absl::optional<EventReportWindows> Create(
|
||||
static std::optional<EventReportWindows> Create(
|
||||
base::TimeDelta start_time,
|
||||
std::vector<base::TimeDelta> end_times);
|
||||
|
||||
// Uses default windows based on the source type, but truncated at
|
||||
// `report_window`.
|
||||
static absl::optional<EventReportWindows> FromDefaults(
|
||||
static std::optional<EventReportWindows> FromDefaults(
|
||||
base::TimeDelta report_window,
|
||||
mojom::SourceType);
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/event_report_windows.h"
|
||||
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
#include "base/test/gmock_expected_support.h"
|
||||
@ -15,7 +16,6 @@
|
||||
#include "components/attribution_reporting/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"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -38,19 +38,19 @@ TEST(EventReportWindowsTest, FromDefaults) {
|
||||
const char* desc;
|
||||
base::TimeDelta report_window;
|
||||
SourceType source_type;
|
||||
::testing::Matcher<absl::optional<EventReportWindows>> matches;
|
||||
::testing::Matcher<std::optional<EventReportWindows>> matches;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
"negative-navigation",
|
||||
base::Seconds(-1),
|
||||
SourceType::kNavigation,
|
||||
Eq(absl::nullopt),
|
||||
Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
"negative-event",
|
||||
base::Seconds(-1),
|
||||
SourceType::kEvent,
|
||||
Eq(absl::nullopt),
|
||||
Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
"=-last-navigation",
|
||||
@ -114,56 +114,56 @@ TEST(EventReportWindowsTest, CreateWindows) {
|
||||
const char* name;
|
||||
base::TimeDelta start_time;
|
||||
std::vector<base::TimeDelta> end_times;
|
||||
::testing::Matcher<absl::optional<EventReportWindows>> matches;
|
||||
::testing::Matcher<std::optional<EventReportWindows>> matches;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
.name = "end_time-eq-start_time",
|
||||
.start_time = base::Hours(1),
|
||||
.end_times = {base::Hours(1)},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "end_time-lt-start_time",
|
||||
.start_time = base::Hours(2),
|
||||
.end_times = {base::Hours(2) - base::Microseconds(1)},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "end_time-eq-prev-end_time",
|
||||
.start_time = base::Seconds(0),
|
||||
.end_times = {base::Hours(1), base::Hours(1)},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "end_time-lt-prev-end_time",
|
||||
.start_time = base::Seconds(0),
|
||||
.end_times = {base::Hours(2), base::Hours(2) - base::Microseconds(1)},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "negative-start_time",
|
||||
.start_time = base::Seconds(-1),
|
||||
.end_times = {base::Hours(1)},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "empty-end_times",
|
||||
.start_time = base::Seconds(0),
|
||||
.end_times = {},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "too-many-end_times",
|
||||
.start_time = base::Seconds(0),
|
||||
.end_times = {base::Hours(1), base::Hours(2), base::Hours(3),
|
||||
base::Hours(4), base::Hours(5), base::Hours(6)},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "end-time-less-than-min-report-window",
|
||||
.start_time = base::Seconds(0),
|
||||
.end_times = {base::Hours(1) - base::Microseconds(1)},
|
||||
.matches = Eq(absl::nullopt),
|
||||
.matches = Eq(std::nullopt),
|
||||
},
|
||||
{
|
||||
.name = "valid",
|
||||
|
@ -62,7 +62,7 @@ EventTriggerData::EventTriggerData() = default;
|
||||
|
||||
EventTriggerData::EventTriggerData(uint64_t data,
|
||||
int64_t priority,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
std::optional<uint64_t> dedup_key,
|
||||
FilterPair filters)
|
||||
: data(data),
|
||||
priority(priority),
|
||||
|
@ -7,12 +7,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/component_export.h"
|
||||
#include "base/types/expected.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/filters.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -33,7 +34,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) EventTriggerData {
|
||||
// Key specified in conversion redirect for deduplication against existing
|
||||
// conversions with the same source. If absent, no deduplication is
|
||||
// performed.
|
||||
absl::optional<uint64_t> dedup_key;
|
||||
std::optional<uint64_t> dedup_key;
|
||||
|
||||
// The filters used to determine whether this `EventTriggerData'`s fields
|
||||
// are used.
|
||||
@ -43,7 +44,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) EventTriggerData {
|
||||
|
||||
EventTriggerData(uint64_t data,
|
||||
int64_t priority,
|
||||
absl::optional<uint64_t> dedup_key,
|
||||
std::optional<uint64_t> dedup_key,
|
||||
FilterPair);
|
||||
|
||||
base::Value::Dict ToJson() const;
|
||||
|
@ -37,7 +37,7 @@ TEST(EventTriggerDataTest, FromJSON) {
|
||||
R"json({})json",
|
||||
ValueIs(AllOf(Field(&EventTriggerData::data, 0),
|
||||
Field(&EventTriggerData::priority, 0),
|
||||
Field(&EventTriggerData::dedup_key, absl::nullopt),
|
||||
Field(&EventTriggerData::dedup_key, std::nullopt),
|
||||
Field(&EventTriggerData::filters, FilterPair()))),
|
||||
},
|
||||
{
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/filters.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -24,7 +25,6 @@
|
||||
#include "components/attribution_reporting/source_type.h"
|
||||
#include "components/attribution_reporting/source_type.mojom-forward.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -169,9 +169,9 @@ base::Value::Dict FilterValuesToJson(const FilterValues& filter_values) {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
absl::optional<FilterData> FilterData::Create(FilterValues filter_values) {
|
||||
std::optional<FilterData> FilterData::Create(FilterValues filter_values) {
|
||||
if (!IsValidForSource(filter_values)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
return FilterData(std::move(filter_values));
|
||||
@ -338,17 +338,17 @@ bool FilterData::Matches(mojom::SourceType source_type,
|
||||
|
||||
FilterConfig::FilterConfig() = default;
|
||||
|
||||
absl::optional<FilterConfig> FilterConfig::Create(
|
||||
std::optional<FilterConfig> FilterConfig::Create(
|
||||
FilterValues filter_values,
|
||||
absl::optional<base::TimeDelta> lookback_window) {
|
||||
std::optional<base::TimeDelta> lookback_window) {
|
||||
if (lookback_window && !lookback_window->is_positive()) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return FilterConfig(std::move(filter_values), lookback_window);
|
||||
}
|
||||
|
||||
FilterConfig::FilterConfig(FilterValues filter_values,
|
||||
absl::optional<base::TimeDelta> lookback_window)
|
||||
std::optional<base::TimeDelta> lookback_window)
|
||||
: lookback_window_(lookback_window),
|
||||
filter_values_(std::move(filter_values)) {
|
||||
DCHECK(!lookback_window_.has_value() || lookback_window_->is_positive());
|
||||
@ -398,10 +398,10 @@ base::expected<FiltersDisjunction, TriggerRegistrationError> FiltersFromJSON(
|
||||
return base::unexpected(TriggerRegistrationError::kFiltersWrongType);
|
||||
}
|
||||
|
||||
absl::optional<base::TimeDelta> lookback_window;
|
||||
if (absl::optional<base::Value> lookback_window_value =
|
||||
std::optional<base::TimeDelta> lookback_window;
|
||||
if (std::optional<base::Value> lookback_window_value =
|
||||
dict->Extract(FilterConfig::kLookbackWindowKey)) {
|
||||
if (absl::optional<int> int_val = lookback_window_value->GetIfInt()) {
|
||||
if (std::optional<int> int_val = lookback_window_value->GetIfInt()) {
|
||||
lookback_window = base::Seconds(*int_val);
|
||||
} else {
|
||||
return base::unexpected(
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_ATTRIBUTION_REPORTING_FILTERS_H_
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_FILTERS_H_
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -16,7 +17,6 @@
|
||||
#include "components/attribution_reporting/source_registration_error.mojom-forward.h"
|
||||
#include "components/attribution_reporting/source_type.mojom-forward.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -34,7 +34,7 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) FilterData {
|
||||
static constexpr char kSourceTypeFilterKey[] = "source_type";
|
||||
|
||||
// Filter data is not allowed to contain a `source_type` filter.
|
||||
static absl::optional<FilterData> Create(FilterValues);
|
||||
static std::optional<FilterData> Create(FilterValues);
|
||||
|
||||
static base::expected<FilterData, mojom::SourceRegistrationError> FromJSON(
|
||||
base::Value*);
|
||||
@ -108,9 +108,9 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) FilterConfig {
|
||||
static constexpr char kReservedKeyPrefix[] = "_";
|
||||
|
||||
// If set, FilterConfig's `lookback_window` must be positive.
|
||||
static absl::optional<FilterConfig> Create(
|
||||
static std::optional<FilterConfig> Create(
|
||||
FilterValues,
|
||||
absl::optional<base::TimeDelta> lookback_window = absl::nullopt);
|
||||
std::optional<base::TimeDelta> lookback_window = std::nullopt);
|
||||
|
||||
FilterConfig();
|
||||
~FilterConfig();
|
||||
@ -121,7 +121,7 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) FilterConfig {
|
||||
FilterConfig& operator=(const FilterConfig&);
|
||||
FilterConfig& operator=(FilterConfig&&);
|
||||
|
||||
const absl::optional<base::TimeDelta>& lookback_window() const {
|
||||
const std::optional<base::TimeDelta>& lookback_window() const {
|
||||
return lookback_window_;
|
||||
}
|
||||
|
||||
@ -131,8 +131,8 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) FilterConfig {
|
||||
|
||||
private:
|
||||
explicit FilterConfig(FilterValues,
|
||||
absl::optional<base::TimeDelta> lookback_window);
|
||||
absl::optional<base::TimeDelta> lookback_window_;
|
||||
std::optional<base::TimeDelta> lookback_window);
|
||||
std::optional<base::TimeDelta> lookback_window_;
|
||||
FilterValues filter_values_;
|
||||
};
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -25,7 +26,6 @@
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.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 attribution_reporting {
|
||||
namespace {
|
||||
@ -82,13 +82,13 @@ const base::Time kTriggerTime = kSourceTime + base::Seconds(5);
|
||||
|
||||
const struct {
|
||||
const char* description;
|
||||
absl::optional<base::Value> json;
|
||||
std::optional<base::Value> json;
|
||||
base::expected<FilterData, SourceRegistrationError> expected_filter_data;
|
||||
base::expected<FiltersDisjunction, TriggerRegistrationError> expected_filters;
|
||||
} kParseTestCases[] = {
|
||||
{
|
||||
"Null",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
FilterData(),
|
||||
FiltersDisjunction(),
|
||||
},
|
||||
@ -178,7 +178,7 @@ const struct {
|
||||
|
||||
const struct {
|
||||
const char* description;
|
||||
absl::optional<base::Value> json;
|
||||
std::optional<base::Value> json;
|
||||
SourceRegistrationError expected_filter_data_error;
|
||||
} kSizeTestCases[] = {
|
||||
{
|
||||
@ -222,18 +222,18 @@ TEST(FilterDataTest, Create_LimitsFilterCount) {
|
||||
|
||||
TEST(FilterDataTest, FromJSON) {
|
||||
for (auto& test_case : kParseTestCases) {
|
||||
absl::optional<base::Value> json_copy =
|
||||
test_case.json ? absl::make_optional(test_case.json->Clone())
|
||||
: absl::nullopt;
|
||||
std::optional<base::Value> json_copy =
|
||||
test_case.json ? std::make_optional(test_case.json->Clone())
|
||||
: std::nullopt;
|
||||
EXPECT_EQ(FilterData::FromJSON(base::OptionalToPtr(json_copy)),
|
||||
test_case.expected_filter_data)
|
||||
<< test_case.description;
|
||||
}
|
||||
|
||||
for (auto& test_case : kSizeTestCases) {
|
||||
absl::optional<base::Value> json_copy =
|
||||
test_case.json ? absl::make_optional(test_case.json->Clone())
|
||||
: absl::nullopt;
|
||||
std::optional<base::Value> json_copy =
|
||||
test_case.json ? std::make_optional(test_case.json->Clone())
|
||||
: std::nullopt;
|
||||
EXPECT_THAT(FilterData::FromJSON(base::OptionalToPtr(json_copy)),
|
||||
base::test::ErrorIs(test_case.expected_filter_data_error))
|
||||
<< test_case.description;
|
||||
@ -264,7 +264,7 @@ TEST(FilterDataTest, FromJSON_RecordsMetrics) {
|
||||
using ::base::Bucket;
|
||||
using ::testing::ElementsAre;
|
||||
|
||||
absl::optional<base::Value> json = base::test::ParseJson(R"json({
|
||||
std::optional<base::Value> json = base::test::ParseJson(R"json({
|
||||
"a": ["1", "2", "3"],
|
||||
"b": [],
|
||||
"c": ["4"],
|
||||
@ -286,9 +286,9 @@ TEST(FiltersTest, FromJSON) {
|
||||
for (auto& test_case : kParseTestCases) {
|
||||
SCOPED_TRACE(test_case.description);
|
||||
|
||||
absl::optional<base::Value> json_copy =
|
||||
test_case.json ? absl::make_optional(test_case.json->Clone())
|
||||
: absl::nullopt;
|
||||
std::optional<base::Value> json_copy =
|
||||
test_case.json ? std::make_optional(test_case.json->Clone())
|
||||
: std::nullopt;
|
||||
EXPECT_EQ(FiltersFromJSONForTesting(base::OptionalToPtr(json_copy)),
|
||||
test_case.expected_filters);
|
||||
}
|
||||
@ -296,9 +296,9 @@ TEST(FiltersTest, FromJSON) {
|
||||
for (auto& test_case : kSizeTestCases) {
|
||||
SCOPED_TRACE(test_case.description);
|
||||
|
||||
absl::optional<base::Value> json_copy =
|
||||
test_case.json ? absl::make_optional(test_case.json->Clone())
|
||||
: absl::nullopt;
|
||||
std::optional<base::Value> json_copy =
|
||||
test_case.json ? std::make_optional(test_case.json->Clone())
|
||||
: std::nullopt;
|
||||
|
||||
auto result = FiltersFromJSONForTesting(base::OptionalToPtr(json_copy));
|
||||
EXPECT_TRUE(result.has_value()) << result.error();
|
||||
@ -438,7 +438,7 @@ TEST(FilterDataTest, EmptyOrMissingAttributionFilters) {
|
||||
// Behavior should match for negated and non-negated filters as it
|
||||
// requires a value on each side.
|
||||
for (const auto& test_case : kTestCases) {
|
||||
absl::optional<FilterData> filter_data =
|
||||
std::optional<FilterData> filter_data =
|
||||
FilterData::Create(test_case.filter_data);
|
||||
ASSERT_TRUE(filter_data) << test_case.description;
|
||||
|
||||
@ -501,7 +501,7 @@ TEST(FilterDataTest, AttributionFilterDataMatch) {
|
||||
false},
|
||||
};
|
||||
for (const auto& test_case : kTestCases) {
|
||||
absl::optional<FilterData> filter_data =
|
||||
std::optional<FilterData> filter_data =
|
||||
FilterData::Create(test_case.filter_data);
|
||||
ASSERT_TRUE(filter_data) << test_case.description;
|
||||
|
||||
@ -645,7 +645,7 @@ TEST(FilterDataTest, NegatedAttributionFilterDataMatch) {
|
||||
};
|
||||
|
||||
for (const auto& test_case : kTestCases) {
|
||||
absl::optional<FilterData> filter_data =
|
||||
std::optional<FilterData> filter_data =
|
||||
FilterData::Create(test_case.filter_data);
|
||||
ASSERT_TRUE(filter_data) << test_case.description;
|
||||
|
||||
|
@ -4,12 +4,13 @@
|
||||
|
||||
#include "components/attribution_reporting/max_event_level_reports.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/check.h"
|
||||
#include "base/types/expected.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom.h"
|
||||
#include "components/attribution_reporting/source_type.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -46,7 +47,7 @@ MaxEventLevelReports::Parse(const base::Value::Dict& dict,
|
||||
return MaxEventLevelReports(source_type);
|
||||
}
|
||||
|
||||
absl::optional<int> i = value->GetIfInt();
|
||||
std::optional<int> i = value->GetIfInt();
|
||||
if (!i.has_value() || !IsMaxEventLevelReportsValid(*i)) {
|
||||
return base::unexpected(
|
||||
SourceRegistrationError::kMaxEventLevelReportsValueInvalid);
|
||||
|
@ -4,12 +4,12 @@
|
||||
|
||||
#include "components/attribution_reporting/os_registration.h"
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/check_op.h"
|
||||
#include "net/http/structured_headers.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <optional>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
@ -21,7 +22,6 @@
|
||||
#include "components/attribution_reporting/constants.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom-forward.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"
|
||||
|
||||
namespace attribution_reporting {
|
||||
@ -34,13 +34,13 @@ constexpr char kDeduplicationKey[] = "deduplication_key";
|
||||
constexpr char kPriority[] = "priority";
|
||||
|
||||
template <typename T>
|
||||
base::expected<absl::optional<T>, absl::monostate> ParseIntegerFromString(
|
||||
base::expected<std::optional<T>, absl::monostate> ParseIntegerFromString(
|
||||
const base::Value::Dict& dict,
|
||||
std::string_view key,
|
||||
bool (*parse)(std::string_view, T*)) {
|
||||
const base::Value* value = dict.Find(key);
|
||||
if (!value) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
T parsed_val;
|
||||
@ -82,13 +82,13 @@ std::string HexEncodeAggregationKey(absl::uint128 value) {
|
||||
return out.str();
|
||||
}
|
||||
|
||||
base::expected<absl::optional<uint64_t>, absl::monostate> ParseUint64(
|
||||
base::expected<std::optional<uint64_t>, absl::monostate> ParseUint64(
|
||||
const base::Value::Dict& dict,
|
||||
std::string_view key) {
|
||||
return ParseIntegerFromString<uint64_t>(dict, key, &base::StringToUint64);
|
||||
}
|
||||
|
||||
base::expected<absl::optional<int64_t>, absl::monostate> ParseInt64(
|
||||
base::expected<std::optional<int64_t>, absl::monostate> ParseInt64(
|
||||
const base::Value::Dict& dict,
|
||||
std::string_view key) {
|
||||
return ParseIntegerFromString<int64_t>(dict, key, &base::StringToInt64);
|
||||
@ -99,11 +99,11 @@ base::expected<int64_t, absl::monostate> ParsePriority(
|
||||
return ParseInt64(dict, kPriority).transform(&ValueOrZero<int64_t>);
|
||||
}
|
||||
|
||||
absl::optional<uint64_t> ParseDebugKey(const base::Value::Dict& dict) {
|
||||
return ParseUint64(dict, kDebugKey).value_or(absl::nullopt);
|
||||
std::optional<uint64_t> ParseDebugKey(const base::Value::Dict& dict) {
|
||||
return ParseUint64(dict, kDebugKey).value_or(std::nullopt);
|
||||
}
|
||||
|
||||
base::expected<absl::optional<uint64_t>, absl::monostate> ParseDeduplicationKey(
|
||||
base::expected<std::optional<uint64_t>, absl::monostate> ParseDeduplicationKey(
|
||||
const base::Value::Dict& dict) {
|
||||
return ParseUint64(dict, kDeduplicationKey);
|
||||
}
|
||||
@ -121,7 +121,7 @@ ParseLegacyDuration(const base::Value& value,
|
||||
// Reporting API itself clamps values to 30 days:
|
||||
// https://wicg.github.io/attribution-reporting-api/#valid-source-expiry-range
|
||||
|
||||
if (absl::optional<int> int_value = value.GetIfInt()) {
|
||||
if (std::optional<int> int_value = value.GetIfInt()) {
|
||||
if (*int_value < 0) {
|
||||
return base::unexpected(error);
|
||||
}
|
||||
@ -156,7 +156,7 @@ void SerializePriority(base::Value::Dict& dict, int64_t priority) {
|
||||
}
|
||||
|
||||
void SerializeDebugKey(base::Value::Dict& dict,
|
||||
absl::optional<uint64_t> debug_key) {
|
||||
std::optional<uint64_t> debug_key) {
|
||||
if (debug_key) {
|
||||
SerializeUint64(dict, kDebugKey, *debug_key);
|
||||
}
|
||||
@ -167,7 +167,7 @@ void SerializeDebugReporting(base::Value::Dict& dict, bool debug_reporting) {
|
||||
}
|
||||
|
||||
void SerializeDeduplicationKey(base::Value::Dict& dict,
|
||||
absl::optional<uint64_t> dedup_key) {
|
||||
std::optional<uint64_t> dedup_key) {
|
||||
if (dedup_key) {
|
||||
SerializeUint64(dict, kDeduplicationKey, *dedup_key);
|
||||
}
|
||||
@ -198,7 +198,7 @@ base::expected<uint32_t, mojom::SourceRegistrationError> ParseUint32(
|
||||
//
|
||||
// TODO(apaseltiner): Consider test coverage for all `uint32_t` values, or
|
||||
// some kind of fuzzer.
|
||||
absl::optional<double> double_value = value.GetIfDouble();
|
||||
std::optional<double> double_value = value.GetIfDouble();
|
||||
if (double int_part;
|
||||
!double_value.has_value() || std::modf(*double_value, &int_part) != 0) {
|
||||
return base::unexpected(wrong_type_error);
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <concepts>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
@ -16,7 +17,6 @@
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/source_registration_error.mojom-forward.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"
|
||||
|
||||
namespace base {
|
||||
@ -42,17 +42,17 @@ bool AggregationKeyIdHasValidLength(const std::string& key);
|
||||
|
||||
template <typename T>
|
||||
requires(std::integral<T>)
|
||||
constexpr T ValueOrZero(absl::optional<T> value) {
|
||||
constexpr T ValueOrZero(std::optional<T> value) {
|
||||
return value.value_or(0);
|
||||
}
|
||||
|
||||
COMPONENT_EXPORT(ATTRIBUTION_REPORTING)
|
||||
base::expected<absl::optional<uint64_t>, absl::monostate> ParseUint64(
|
||||
base::expected<std::optional<uint64_t>, absl::monostate> ParseUint64(
|
||||
const base::Value::Dict&,
|
||||
std::string_view key);
|
||||
|
||||
COMPONENT_EXPORT(ATTRIBUTION_REPORTING)
|
||||
base::expected<absl::optional<int64_t>, absl::monostate> ParseInt64(
|
||||
base::expected<std::optional<int64_t>, absl::monostate> ParseInt64(
|
||||
const base::Value::Dict&,
|
||||
std::string_view key);
|
||||
|
||||
@ -62,13 +62,13 @@ base::expected<int64_t, absl::monostate> ParsePriority(
|
||||
// Returns `debug_key` value as we do not need to fail the source registration
|
||||
// if the value is invalid, see
|
||||
// https://github.com/WICG/attribution-reporting-api/issues/793 for context.
|
||||
absl::optional<uint64_t> ParseDebugKey(const base::Value::Dict& dict);
|
||||
std::optional<uint64_t> ParseDebugKey(const base::Value::Dict& dict);
|
||||
|
||||
// Returns false if `dict` contains `debug_reporting` key but the value is
|
||||
// invalid, returns true otherwise.
|
||||
[[nodiscard]] bool ParseDebugReporting(const base::Value::Dict& dict);
|
||||
|
||||
base::expected<absl::optional<uint64_t>, absl::monostate> ParseDeduplicationKey(
|
||||
base::expected<std::optional<uint64_t>, absl::monostate> ParseDeduplicationKey(
|
||||
const base::Value::Dict&);
|
||||
|
||||
base::expected<base::TimeDelta, mojom::SourceRegistrationError>
|
||||
@ -81,12 +81,12 @@ void SerializeInt64(base::Value::Dict&, std::string_view key, int64_t value);
|
||||
|
||||
void SerializePriority(base::Value::Dict&, int64_t priority);
|
||||
|
||||
void SerializeDebugKey(base::Value::Dict&, absl::optional<uint64_t> debug_key);
|
||||
void SerializeDebugKey(base::Value::Dict&, std::optional<uint64_t> debug_key);
|
||||
|
||||
void SerializeDebugReporting(base::Value::Dict&, bool debug_reporting);
|
||||
|
||||
void SerializeDeduplicationKey(base::Value::Dict&,
|
||||
absl::optional<uint64_t> dedup_key);
|
||||
std::optional<uint64_t> dedup_key);
|
||||
|
||||
void SerializeTimeDeltaInSeconds(base::Value::Dict& dict,
|
||||
std::string_view key,
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <limits>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "base/test/gmock_expected_support.h"
|
||||
@ -16,7 +17,6 @@
|
||||
#include "components/attribution_reporting/constants.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"
|
||||
|
||||
namespace attribution_reporting {
|
||||
@ -52,12 +52,12 @@ TEST(AttributionReportingParsingUtilsTest, ParseUint64) {
|
||||
const struct {
|
||||
const char* description;
|
||||
const char* json;
|
||||
base::expected<absl::optional<uint64_t>, absl::monostate> expected;
|
||||
base::expected<std::optional<uint64_t>, absl::monostate> expected;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
"missing_key",
|
||||
R"json({})json",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
},
|
||||
{
|
||||
"not_string",
|
||||
@ -102,12 +102,12 @@ TEST(AttributionReportingParsingUtilsTest, ParseInt64) {
|
||||
const struct {
|
||||
const char* description;
|
||||
const char* json;
|
||||
base::expected<absl::optional<int64_t>, absl::monostate> expected;
|
||||
base::expected<std::optional<int64_t>, absl::monostate> expected;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
"missing_key",
|
||||
R"json({})json",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
},
|
||||
{
|
||||
"not_string",
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -34,7 +35,6 @@
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "services/network/public/cpp/schemeful_site_mojom_traits.h"
|
||||
#include "third_party/abseil-cpp/absl/numeric/int128.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/mojom/origin_mojom_traits.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -70,7 +70,7 @@ bool StructTraits<attribution_reporting::mojom::FilterDataDataView,
|
||||
return false;
|
||||
}
|
||||
|
||||
absl::optional<attribution_reporting::FilterData> filter_data =
|
||||
std::optional<attribution_reporting::FilterData> filter_data =
|
||||
attribution_reporting::FilterData::Create(std::move(filter_values));
|
||||
if (!filter_data.has_value()) {
|
||||
return false;
|
||||
@ -90,7 +90,7 @@ bool StructTraits<attribution_reporting::mojom::FilterConfigDataView,
|
||||
return false;
|
||||
}
|
||||
|
||||
absl::optional<base::TimeDelta> lookback_window;
|
||||
std::optional<base::TimeDelta> lookback_window;
|
||||
if (!data.ReadLookbackWindow(&lookback_window)) {
|
||||
return false;
|
||||
}
|
||||
@ -115,7 +115,7 @@ bool StructTraits<attribution_reporting::mojom::AggregationKeysDataView,
|
||||
return false;
|
||||
}
|
||||
|
||||
absl::optional<attribution_reporting::AggregationKeys> aggregation_keys =
|
||||
std::optional<attribution_reporting::AggregationKeys> aggregation_keys =
|
||||
attribution_reporting::AggregationKeys::FromKeys(std::move(keys));
|
||||
if (!aggregation_keys.has_value()) {
|
||||
return false;
|
||||
@ -361,12 +361,12 @@ bool StructTraits<attribution_reporting::mojom::TriggerRegistrationDataView,
|
||||
return false;
|
||||
}
|
||||
|
||||
absl::optional<std::string> trigger_context_id;
|
||||
std::optional<std::string> trigger_context_id;
|
||||
if (!data.ReadTriggerContextId(&trigger_context_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
absl::optional<attribution_reporting::AggregatableTriggerConfig>
|
||||
std::optional<attribution_reporting::AggregatableTriggerConfig>
|
||||
aggregatable_trigger_config =
|
||||
attribution_reporting::AggregatableTriggerConfig::Create(
|
||||
data.source_registration_time_config(),
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@ -34,7 +35,6 @@
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "services/network/public/cpp/schemeful_site_mojom_traits.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/mojom/origin_mojom_traits.h"
|
||||
#include "url/mojom/url_gurl_mojom_traits.h"
|
||||
@ -72,7 +72,7 @@ template <>
|
||||
struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS)
|
||||
StructTraits<attribution_reporting::mojom::FilterConfigDataView,
|
||||
attribution_reporting::FilterConfig> {
|
||||
static const absl::optional<base::TimeDelta>& lookback_window(
|
||||
static const std::optional<base::TimeDelta>& lookback_window(
|
||||
const attribution_reporting::FilterConfig& filter_config) {
|
||||
return filter_config.lookback_window();
|
||||
}
|
||||
@ -201,7 +201,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS)
|
||||
return source.priority;
|
||||
}
|
||||
|
||||
static absl::optional<uint64_t> debug_key(
|
||||
static std::optional<uint64_t> debug_key(
|
||||
const attribution_reporting::SourceRegistration& source) {
|
||||
return source.debug_key;
|
||||
}
|
||||
@ -267,7 +267,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS)
|
||||
return data.priority;
|
||||
}
|
||||
|
||||
static absl::optional<uint64_t> dedup_key(
|
||||
static std::optional<uint64_t> dedup_key(
|
||||
const attribution_reporting::EventTriggerData& data) {
|
||||
return data.dedup_key;
|
||||
}
|
||||
@ -331,7 +331,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS)
|
||||
return trigger.aggregatable_values.values();
|
||||
}
|
||||
|
||||
static absl::optional<uint64_t> debug_key(
|
||||
static std::optional<uint64_t> debug_key(
|
||||
const attribution_reporting::TriggerRegistration& trigger) {
|
||||
return trigger.debug_key;
|
||||
}
|
||||
@ -347,7 +347,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS)
|
||||
return trigger.debug_reporting;
|
||||
}
|
||||
|
||||
static const absl::optional<attribution_reporting::SuitableOrigin>&
|
||||
static const std::optional<attribution_reporting::SuitableOrigin>&
|
||||
aggregation_coordinator_origin(
|
||||
const attribution_reporting::TriggerRegistration& trigger) {
|
||||
return trigger.aggregation_coordinator_origin;
|
||||
@ -360,7 +360,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS)
|
||||
.source_registration_time_config();
|
||||
}
|
||||
|
||||
static const absl::optional<std::string>& trigger_context_id(
|
||||
static const std::optional<std::string>& trigger_context_id(
|
||||
const attribution_reporting::TriggerRegistration& trigger) {
|
||||
return trigger.aggregatable_trigger_config.trigger_context_id();
|
||||
}
|
||||
@ -374,7 +374,7 @@ template <>
|
||||
struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING_REGISTRATION_MOJOM_TRAITS)
|
||||
StructTraits<attribution_reporting::mojom::AggregatableDedupKeyDataView,
|
||||
attribution_reporting::AggregatableDedupKey> {
|
||||
static absl::optional<uint64_t> dedup_key(
|
||||
static std::optional<uint64_t> dedup_key(
|
||||
const attribution_reporting::AggregatableDedupKey& data) {
|
||||
return data.dedup_key;
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -30,7 +31,6 @@
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
#include "components/attribution_reporting/trigger_config.h"
|
||||
#include "mojo/public/cpp/bindings/default_construct_tag.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/variant.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
@ -163,7 +163,7 @@ SourceRegistration::Parse(std::string_view json, SourceType source_type) {
|
||||
base::expected<SourceRegistration, SourceRegistrationError> source =
|
||||
base::unexpected(SourceRegistrationError::kInvalidJson);
|
||||
|
||||
absl::optional<base::Value> value =
|
||||
std::optional<base::Value> value =
|
||||
base::JSONReader::Read(json, base::JSON_PARSE_RFC);
|
||||
|
||||
if (value) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
|
||||
#include "base/component_export.h"
|
||||
@ -24,7 +25,6 @@
|
||||
#include "components/attribution_reporting/source_type.mojom-forward.h"
|
||||
#include "components/attribution_reporting/trigger_data_matching.mojom.h"
|
||||
#include "mojo/public/cpp/bindings/default_construct_tag.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -72,7 +72,7 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) SourceRegistration {
|
||||
MaxEventLevelReports max_event_level_reports;
|
||||
int64_t priority = 0;
|
||||
FilterData filter_data;
|
||||
absl::optional<uint64_t> debug_key;
|
||||
std::optional<uint64_t> debug_key;
|
||||
AggregationKeys aggregation_keys;
|
||||
bool debug_reporting = false;
|
||||
mojom::TriggerDataMatching trigger_data_matching =
|
||||
|
@ -2,9 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "components/attribution_reporting/source_registration.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
@ -14,12 +17,10 @@
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/source_registration.h"
|
||||
#include "components/attribution_reporting/source_type.mojom.h"
|
||||
#include "testing/libfuzzer/proto/json.pb.h"
|
||||
#include "testing/libfuzzer/proto/json_proto_converter.h"
|
||||
#include "testing/libfuzzer/proto/lpm_interface.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -44,7 +45,7 @@ DEFINE_PROTO_FUZZER(const json_proto::JsonValue& json_value) {
|
||||
if (getenv("LPM_DUMP_NATIVE_INPUT"))
|
||||
std::cout << native_input << std::endl;
|
||||
|
||||
absl::optional<base::Value> input = base::JSONReader::Read(
|
||||
std::optional<base::Value> input = base::JSONReader::Read(
|
||||
native_input, base::JSONParserOptions::JSON_PARSE_RFC);
|
||||
if (!input || !input->is_dict())
|
||||
return;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/source_registration.h"
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/functional/function_ref.h"
|
||||
@ -27,7 +28,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"
|
||||
|
||||
namespace attribution_reporting {
|
||||
namespace {
|
||||
@ -85,7 +85,7 @@ TEST(SourceRegistrationTest, Parse) {
|
||||
MaxEventLevelReports(SourceType::kNavigation)),
|
||||
Field(&SourceRegistration::priority, 0),
|
||||
Field(&SourceRegistration::filter_data, FilterData()),
|
||||
Field(&SourceRegistration::debug_key, absl::nullopt),
|
||||
Field(&SourceRegistration::debug_key, std::nullopt),
|
||||
Field(&SourceRegistration::aggregation_keys, AggregationKeys()),
|
||||
Field(&SourceRegistration::debug_reporting, false),
|
||||
Field(&SourceRegistration::trigger_data_matching,
|
||||
@ -281,12 +281,12 @@ TEST(SourceRegistrationTest, Parse) {
|
||||
{
|
||||
"debug_key_invalid",
|
||||
R"json({"debug_key":"-5","destination":"https://d.example"})json",
|
||||
ValueIs(Field(&SourceRegistration::debug_key, absl::nullopt)),
|
||||
ValueIs(Field(&SourceRegistration::debug_key, std::nullopt)),
|
||||
},
|
||||
{
|
||||
"debug_key_wrong_type",
|
||||
R"json({"debug_key":5,"destination":"https://d.example"})json",
|
||||
ValueIs(Field(&SourceRegistration::debug_key, absl::nullopt)),
|
||||
ValueIs(Field(&SourceRegistration::debug_key, std::nullopt)),
|
||||
},
|
||||
{
|
||||
"filter_data_valid",
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -11,7 +12,6 @@
|
||||
#include "components/attribution_reporting/is_origin_suitable.h"
|
||||
#include "mojo/public/cpp/bindings/default_construct_tag.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -28,20 +28,20 @@ bool SuitableOrigin::IsSuitable(const url::Origin& origin) {
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<SuitableOrigin> SuitableOrigin::Create(url::Origin origin) {
|
||||
std::optional<SuitableOrigin> SuitableOrigin::Create(url::Origin origin) {
|
||||
if (!IsSuitable(origin))
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
|
||||
return SuitableOrigin(std::move(origin));
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<SuitableOrigin> SuitableOrigin::Create(const GURL& url) {
|
||||
std::optional<SuitableOrigin> SuitableOrigin::Create(const GURL& url) {
|
||||
return Create(url::Origin::Create(url));
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<SuitableOrigin> SuitableOrigin::Deserialize(
|
||||
std::optional<SuitableOrigin> SuitableOrigin::Deserialize(
|
||||
std::string_view str) {
|
||||
return Create(GURL(str));
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_SUITABLE_ORIGIN_H_
|
||||
|
||||
#include <compare>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
@ -13,7 +14,6 @@
|
||||
#include "base/check.h"
|
||||
#include "base/component_export.h"
|
||||
#include "mojo/public/cpp/bindings/default_construct_tag.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
class GURL;
|
||||
@ -45,16 +45,16 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) SuitableOrigin {
|
||||
public:
|
||||
static bool IsSuitable(const url::Origin&);
|
||||
|
||||
static absl::optional<SuitableOrigin> Create(url::Origin);
|
||||
static std::optional<SuitableOrigin> Create(url::Origin);
|
||||
|
||||
static absl::optional<SuitableOrigin> Create(const GURL&);
|
||||
static std::optional<SuitableOrigin> Create(const GURL&);
|
||||
|
||||
// Creates a `SuitableOrigin` from the given string, which is first converted
|
||||
// to a `GURL`, then to a `url::Origin`, and then subject to this class's
|
||||
// invariants.
|
||||
//
|
||||
// All parts of the URL other than the origin are ignored.
|
||||
static absl::optional<SuitableOrigin> Deserialize(std::string_view);
|
||||
static std::optional<SuitableOrigin> Deserialize(std::string_view);
|
||||
|
||||
// Creates an invalid instance for use with Mojo deserialization, which
|
||||
// requires types to be default-constructible.
|
||||
|
@ -4,9 +4,10 @@
|
||||
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
#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"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -49,7 +50,7 @@ TEST(SuitableOriginTest, Create) {
|
||||
SuitableOrigin::IsSuitable(test_case.origin))
|
||||
<< test_case.origin;
|
||||
|
||||
absl::optional<SuitableOrigin> actual =
|
||||
std::optional<SuitableOrigin> actual =
|
||||
SuitableOrigin::Create(test_case.origin);
|
||||
|
||||
EXPECT_EQ(test_case.expected_suitable, actual.has_value())
|
||||
@ -65,17 +66,17 @@ TEST(SuitableOriginTest, Create) {
|
||||
TEST(SuitableOriginTest, Deserialize_Serialize) {
|
||||
const struct {
|
||||
std::string_view str;
|
||||
absl::optional<url::Origin> expected;
|
||||
std::optional<url::Origin> expected;
|
||||
const char* expected_serialization;
|
||||
} kTestCases[] = {
|
||||
{
|
||||
"",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
nullptr,
|
||||
},
|
||||
{
|
||||
"http://a.test",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
nullptr,
|
||||
},
|
||||
{
|
||||
@ -95,18 +96,18 @@ TEST(SuitableOriginTest, Deserialize_Serialize) {
|
||||
},
|
||||
{
|
||||
"ws://a.test",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
nullptr,
|
||||
},
|
||||
{
|
||||
"wss://a.test",
|
||||
absl::nullopt,
|
||||
std::nullopt,
|
||||
nullptr,
|
||||
},
|
||||
};
|
||||
|
||||
for (const auto& test_case : kTestCases) {
|
||||
absl::optional<SuitableOrigin> actual =
|
||||
std::optional<SuitableOrigin> actual =
|
||||
SuitableOrigin::Deserialize(test_case.str);
|
||||
|
||||
EXPECT_EQ(test_case.expected.has_value(), actual.has_value())
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/test_utils.h"
|
||||
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
||||
@ -27,14 +28,13 @@
|
||||
#include "components/attribution_reporting/trigger_config.h"
|
||||
#include "components/attribution_reporting/trigger_registration.h"
|
||||
#include "net/base/schemeful_site.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
FiltersDisjunction FiltersForSourceType(
|
||||
mojom::SourceType source_type,
|
||||
absl::optional<base::TimeDelta> lookback_window) {
|
||||
std::optional<base::TimeDelta> lookback_window) {
|
||||
return {*FilterConfig::Create(
|
||||
{
|
||||
{
|
||||
|
@ -6,11 +6,11 @@
|
||||
#define COMPONENTS_ATTRIBUTION_REPORTING_TEST_UTILS_H_
|
||||
|
||||
#include <iosfwd>
|
||||
#include <optional>
|
||||
|
||||
#include "components/attribution_reporting/filters.h"
|
||||
#include "components/attribution_reporting/source_type.mojom-forward.h"
|
||||
#include "components/attribution_reporting/trigger_config.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
class TimeDelta;
|
||||
@ -35,7 +35,7 @@ struct TriggerRegistration;
|
||||
|
||||
FiltersDisjunction FiltersForSourceType(
|
||||
mojom::SourceType,
|
||||
absl::optional<base::TimeDelta> lookback_window = absl::nullopt);
|
||||
std::optional<base::TimeDelta> lookback_window = std::nullopt);
|
||||
|
||||
std::ostream& operator<<(std::ostream&, const AggregationKeys&);
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -24,7 +25,6 @@
|
||||
#include "components/attribution_reporting/source_registration_error.mojom.h"
|
||||
#include "components/attribution_reporting/source_type.mojom.h"
|
||||
#include "components/attribution_reporting/trigger_data_matching.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -282,11 +282,11 @@ TriggerSpecs TriggerSpecs::Default(SourceType source_type,
|
||||
}
|
||||
|
||||
// static
|
||||
absl::optional<TriggerSpecs> TriggerSpecs::Create(
|
||||
std::optional<TriggerSpecs> TriggerSpecs::Create(
|
||||
TriggerDataIndices trigger_data_indices,
|
||||
std::vector<TriggerSpec> specs) {
|
||||
if (!AreSpecsValid(trigger_data_indices, specs)) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
return TriggerSpecs(std::move(trigger_data_indices), std::move(specs));
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ class COMPONENT_EXPORT(ATTRIBUTION_REPORTING) TriggerSpecs {
|
||||
// source type.
|
||||
static TriggerSpecs Default(mojom::SourceType, EventReportWindows);
|
||||
|
||||
static absl::optional<TriggerSpecs> Create(TriggerDataIndices,
|
||||
std::vector<TriggerSpec>);
|
||||
static std::optional<TriggerSpecs> Create(TriggerDataIndices,
|
||||
std::vector<TriggerSpec>);
|
||||
|
||||
static TriggerSpecs CreateForTesting(TriggerDataIndices,
|
||||
std::vector<TriggerSpec>);
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/trigger_registration.h"
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
@ -26,7 +27,6 @@
|
||||
#include "components/attribution_reporting/parsing_utils.h"
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -42,13 +42,13 @@ constexpr char kAggregatableTriggerData[] = "aggregatable_trigger_data";
|
||||
constexpr char kAggregatableValues[] = "aggregatable_values";
|
||||
constexpr char kEventTriggerData[] = "event_trigger_data";
|
||||
|
||||
base::expected<absl::optional<SuitableOrigin>, TriggerRegistrationError>
|
||||
base::expected<std::optional<SuitableOrigin>, TriggerRegistrationError>
|
||||
ParseAggregationCoordinator(const base::Value* value) {
|
||||
// The default value is used for backward compatibility prior to this
|
||||
// attribute being added, but ideally this would invalidate the registration
|
||||
// if other aggregatable fields were present.
|
||||
if (!value) {
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const std::string* str = value->GetIfString();
|
||||
@ -57,7 +57,7 @@ ParseAggregationCoordinator(const base::Value* value) {
|
||||
TriggerRegistrationError::kAggregationCoordinatorWrongType);
|
||||
}
|
||||
|
||||
absl::optional<url::Origin> aggregation_coordinator =
|
||||
std::optional<url::Origin> aggregation_coordinator =
|
||||
aggregation_service::ParseAggregationCoordinator(*str);
|
||||
if (!aggregation_coordinator.has_value()) {
|
||||
return base::unexpected(
|
||||
@ -165,7 +165,7 @@ TriggerRegistration::Parse(std::string_view json) {
|
||||
base::expected<TriggerRegistration, TriggerRegistrationError> trigger =
|
||||
base::unexpected(TriggerRegistrationError::kInvalidJson);
|
||||
|
||||
absl::optional<base::Value> value =
|
||||
std::optional<base::Value> value =
|
||||
base::JSONReader::Read(json, base::JSON_PARSE_RFC);
|
||||
|
||||
if (value) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
@ -18,7 +19,6 @@
|
||||
#include "components/attribution_reporting/filters.h"
|
||||
#include "components/attribution_reporting/suitable_origin.h"
|
||||
#include "components/attribution_reporting/trigger_registration_error.mojom-forward.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -52,13 +52,13 @@ struct COMPONENT_EXPORT(ATTRIBUTION_REPORTING) TriggerRegistration {
|
||||
const TriggerRegistration&) = default;
|
||||
|
||||
FilterPair filters;
|
||||
absl::optional<uint64_t> debug_key;
|
||||
std::optional<uint64_t> debug_key;
|
||||
std::vector<AggregatableDedupKey> aggregatable_dedup_keys;
|
||||
std::vector<EventTriggerData> event_triggers;
|
||||
std::vector<AggregatableTriggerData> aggregatable_trigger_data;
|
||||
AggregatableValues aggregatable_values;
|
||||
bool debug_reporting = false;
|
||||
absl::optional<SuitableOrigin> aggregation_coordinator_origin;
|
||||
std::optional<SuitableOrigin> aggregation_coordinator_origin;
|
||||
AggregatableTriggerConfig aggregatable_trigger_config;
|
||||
};
|
||||
|
||||
|
@ -2,9 +2,12 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "components/attribution_reporting/trigger_registration.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
@ -14,11 +17,9 @@
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/values.h"
|
||||
#include "components/attribution_reporting/trigger_registration.h"
|
||||
#include "testing/libfuzzer/proto/json.pb.h"
|
||||
#include "testing/libfuzzer/proto/json_proto_converter.h"
|
||||
#include "testing/libfuzzer/proto/lpm_interface.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace attribution_reporting {
|
||||
|
||||
@ -43,7 +44,7 @@ DEFINE_PROTO_FUZZER(const json_proto::JsonValue& json_value) {
|
||||
if (getenv("LPM_DUMP_NATIVE_INPUT"))
|
||||
std::cout << native_input << std::endl;
|
||||
|
||||
absl::optional<base::Value> input = base::JSONReader::Read(
|
||||
std::optional<base::Value> input = base::JSONReader::Read(
|
||||
native_input, base::JSONParserOptions::JSON_PARSE_RFC);
|
||||
if (!input || !input->is_dict())
|
||||
return;
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "components/attribution_reporting/trigger_registration.h"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -30,7 +31,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 "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -77,7 +77,7 @@ TEST(TriggerRegistrationTest, Parse) {
|
||||
R"json({})json",
|
||||
ValueIs(AllOf(
|
||||
Field(&TriggerRegistration::filters, FilterPair()),
|
||||
Field(&TriggerRegistration::debug_key, absl::nullopt),
|
||||
Field(&TriggerRegistration::debug_key, std::nullopt),
|
||||
Field(&TriggerRegistration::aggregatable_dedup_keys, IsEmpty()),
|
||||
Field(&TriggerRegistration::event_triggers, IsEmpty()),
|
||||
Field(&TriggerRegistration::aggregatable_trigger_data, IsEmpty()),
|
||||
@ -85,7 +85,7 @@ TEST(TriggerRegistrationTest, Parse) {
|
||||
AggregatableValues()),
|
||||
Field(&TriggerRegistration::debug_reporting, false),
|
||||
Field(&TriggerRegistration::aggregation_coordinator_origin,
|
||||
absl::nullopt),
|
||||
std::nullopt),
|
||||
Field(&TriggerRegistration::aggregatable_trigger_config,
|
||||
AggregatableTriggerConfig()))),
|
||||
},
|
||||
@ -126,22 +126,21 @@ TEST(TriggerRegistrationTest, Parse) {
|
||||
{
|
||||
"debug_key_invalid",
|
||||
R"json({"debug_key":"-5"})json",
|
||||
ValueIs(Field(&TriggerRegistration::debug_key, absl::nullopt)),
|
||||
ValueIs(Field(&TriggerRegistration::debug_key, std::nullopt)),
|
||||
},
|
||||
{
|
||||
"debug_key_wrong_type",
|
||||
R"json({"debug_key":5})json",
|
||||
ValueIs(Field(&TriggerRegistration::debug_key, absl::nullopt)),
|
||||
ValueIs(Field(&TriggerRegistration::debug_key, std::nullopt)),
|
||||
},
|
||||
{
|
||||
"event_triggers_valid",
|
||||
R"json({"event_trigger_data":[{}, {"trigger_data":"5"}]})json",
|
||||
ValueIs(
|
||||
Field(&TriggerRegistration::event_triggers,
|
||||
ElementsAre(EventTriggerData(),
|
||||
EventTriggerData(/*data=*/5, /*priority=*/0,
|
||||
/*dedup_key=*/absl::nullopt,
|
||||
FilterPair())))),
|
||||
ValueIs(Field(&TriggerRegistration::event_triggers,
|
||||
ElementsAre(EventTriggerData(),
|
||||
EventTriggerData(/*data=*/5, /*priority=*/0,
|
||||
/*dedup_key=*/std::nullopt,
|
||||
FilterPair())))),
|
||||
},
|
||||
{
|
||||
"event_triggers_wrong_type",
|
||||
|
@ -388,7 +388,7 @@ void ProfileImportProcess::AcceptWithoutEdits() {
|
||||
|
||||
void ProfileImportProcess::AcceptWithEdits(AutofillProfile edited_profile) {
|
||||
SetUserDecision(UserDecision::kEditAccepted,
|
||||
absl::make_optional(edited_profile));
|
||||
std::make_optional(edited_profile));
|
||||
}
|
||||
|
||||
void ProfileImportProcess::Declined() {
|
||||
|
@ -846,7 +846,7 @@ TEST_F(AutofillSuggestionGeneratorTest,
|
||||
EXPECT_THAT(
|
||||
suggestion_generator()->CreateSuggestionsFromProfiles(
|
||||
{&profile}, {NAME_FIRST, NAME_LAST},
|
||||
/*last_targeted_fields=*/absl::nullopt, NAME_FIRST,
|
||||
/*last_targeted_fields=*/std::nullopt, NAME_FIRST,
|
||||
/*trigger_field_max_length=*/0),
|
||||
SuggestionVectorMainTextsAre(Suggestion::Text(
|
||||
profile.GetRawInfo(NAME_FULL), Suggestion::Text::IsPrimary(true))));
|
||||
@ -900,7 +900,7 @@ TEST_P(
|
||||
EXPECT_THAT(suggestion_generator()->CreateSuggestionsFromProfiles(
|
||||
{&profile},
|
||||
{NAME_FULL, ADDRESS_HOME_STREET_ADDRESS, ADDRESS_HOME_ZIP},
|
||||
/*last_targeted_fields=*/absl::nullopt, trigerring_field_type,
|
||||
/*last_targeted_fields=*/std::nullopt, trigerring_field_type,
|
||||
/*trigger_field_max_length=*/0),
|
||||
ElementsAre(AllOf(testing::Field(
|
||||
&Suggestion::labels,
|
||||
@ -926,7 +926,7 @@ TEST_P(
|
||||
EXPECT_THAT(
|
||||
suggestion_generator()->CreateSuggestionsFromProfiles(
|
||||
{&profile1, &profile2}, {NAME_FULL, ADDRESS_HOME_STREET_ADDRESS},
|
||||
/*last_targeted_fields=*/absl::nullopt, trigerring_field_type,
|
||||
/*last_targeted_fields=*/std::nullopt, trigerring_field_type,
|
||||
/*trigger_field_max_length=*/0),
|
||||
ElementsAre(
|
||||
AllOf(testing::Field(
|
||||
@ -959,7 +959,7 @@ TEST_P(
|
||||
EXPECT_THAT(
|
||||
suggestion_generator()->CreateSuggestionsFromProfiles(
|
||||
{&profile1, &profile2}, {NAME_FULL, ADDRESS_HOME_STREET_ADDRESS},
|
||||
/*last_targeted_fields=*/absl::nullopt, trigerring_field_type,
|
||||
/*last_targeted_fields=*/std::nullopt, trigerring_field_type,
|
||||
/*trigger_field_max_length=*/0),
|
||||
ElementsAre(
|
||||
AllOf(testing::Field(
|
||||
|
@ -2918,7 +2918,7 @@ std::vector<Suggestion> BrowserAutofillManager::GetProfileSuggestions(
|
||||
// not used and only holds semantic value.
|
||||
return suggestion_generator_->GetSuggestionsForProfiles(
|
||||
/*field_types=*/{UNKNOWN_TYPE}, trigger_field, UNKNOWN_TYPE,
|
||||
/*last_targeted_fields=*/absl::nullopt, trigger_source);
|
||||
/*last_targeted_fields=*/std::nullopt, trigger_source);
|
||||
}
|
||||
// If not manual fallback, `form_structure` and `autofill_field` should exist.
|
||||
CHECK(form_structure && trigger_autofill_field);
|
||||
|
@ -416,7 +416,7 @@ struct FillUtilExpirationDateTestCase {
|
||||
bool expected_response;
|
||||
const char* opt_label = nullptr;
|
||||
FieldType server_override = UNKNOWN_TYPE;
|
||||
// If this is absl::nullopt, a test is valid regardless whether the
|
||||
// If this is std::nullopt, a test is valid regardless whether the
|
||||
// features::kAutofillEnableExpirationDateImprovements is enabled or not.
|
||||
// If it is true, it should only execute if
|
||||
// features::kAutofillEnableExpirationDateImprovements is enabled. The inverse
|
||||
|
@ -74,11 +74,11 @@ RegexMatchesCache::Key RegexMatchesCache::BuildKey(
|
||||
std::hash<std::u16string_view>{}(pattern));
|
||||
}
|
||||
|
||||
absl::optional<bool> RegexMatchesCache::Get(RegexMatchesCache::Key key) {
|
||||
std::optional<bool> RegexMatchesCache::Get(RegexMatchesCache::Key key) {
|
||||
if (auto it = cache_.Get(key); it != cache_.end()) {
|
||||
return it->second;
|
||||
}
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void RegexMatchesCache::Put(RegexMatchesCache::Key key, bool value) {
|
||||
@ -112,7 +112,7 @@ bool FormFieldParser::MatchesRegexWithCache(
|
||||
RegexMatchesCache::Key key;
|
||||
if (!groups && context.matches_cache) {
|
||||
key = RegexMatchesCache::BuildKey(input, pattern);
|
||||
absl::optional<bool> cache_entry = context.matches_cache->Get(key);
|
||||
std::optional<bool> cache_entry = context.matches_cache->Get(key);
|
||||
if (cache_entry.has_value()) {
|
||||
return cache_entry.value();
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ class RegexMatchesCache {
|
||||
static Key BuildKey(base::StringPiece16 input, base::StringPiece16 pattern);
|
||||
|
||||
// Returns whether `pattern` in the key matched `input` if this information is
|
||||
// cached. absl::nullopt if the information is not cached.
|
||||
absl::optional<bool> Get(Key key);
|
||||
// cached. std::nullopt if the information is not cached.
|
||||
std::optional<bool> Get(Key key);
|
||||
|
||||
// Stores whether `pattern` in the key matched `input`.
|
||||
void Put(Key key, bool value);
|
||||
|
@ -15,7 +15,7 @@ namespace autofill {
|
||||
TEST(LabelProcessingUtil, GetParseableNameStringPieces) {
|
||||
std::vector<base::StringPiece16> labels{u"City", u"Street & House Number",
|
||||
u"", u"Zip"};
|
||||
auto expectation = absl::make_optional(
|
||||
auto expectation = std::make_optional(
|
||||
std::vector<std::u16string>{u"City", u"Street", u"House Number", u"Zip"});
|
||||
EXPECT_EQ(GetParseableLabels(labels), expectation);
|
||||
|
||||
@ -27,7 +27,7 @@ TEST(LabelProcessingUtil, GetParseableNameStringPieces) {
|
||||
TEST(LabelProcessingUtil, GetParseableNameStringPieces_ThreeComponents) {
|
||||
EXPECT_EQ(GetParseableLabels(
|
||||
{u"City", u"Street & House Number & Floor", u"", u"", u"Zip"}),
|
||||
absl::make_optional(std::vector<std::u16string>{
|
||||
std::make_optional(std::vector<std::u16string>{
|
||||
u"City", u"Street", u"House Number", u"Floor", u"Zip"}));
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ class FormStructure {
|
||||
if (randomized_encoder_) {
|
||||
return randomized_encoder_.get();
|
||||
}
|
||||
return absl::nullopt;
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
const LanguageCode& current_page_language() const {
|
||||
|
@ -3718,7 +3718,7 @@ TEST_F(PersonalDataManagerTest, ClearUrlsFromBrowsingHistoryInTimeRange) {
|
||||
history::DeletionInfo deletion_info(
|
||||
history::DeletionTimeRange(base::Time::Min(), end_of_deletion), false,
|
||||
deleted_urls, {},
|
||||
absl::make_optional<std::set<GURL>>({first_url, second_url}));
|
||||
std::make_optional<std::set<GURL>>({first_url, second_url}));
|
||||
|
||||
personal_data_->OnURLsDeleted(/*history_service=*/nullptr, deletion_info);
|
||||
|
||||
|
@ -226,7 +226,7 @@ TEST_F(AutofillAcrossIframesTest, WithChildFrames) {
|
||||
|
||||
// Get the frame tokens from the registrar. Wrap this in a block because the
|
||||
// registrar receives these from each frame in a separate JS message.
|
||||
__block absl::optional<LocalFrameToken> local_token1, local_token2;
|
||||
__block std::optional<LocalFrameToken> local_token1, local_token2;
|
||||
ASSERT_TRUE(base::test::ios::WaitUntilConditionOrTimeout(
|
||||
base::test::ios::kWaitForJSCompletionTimeout, ^bool {
|
||||
local_token1 = registrar->LookupChildFrame(
|
||||
|
@ -167,7 +167,7 @@ constexpr base::TimeDelta kA11yAnnouncementQueueDelay = base::Seconds(1);
|
||||
// The autofill data that needs to be send when the |webState_| is shown.
|
||||
// The pair contains the frame ID and the base::Value::Dict to send.
|
||||
// If the value is nullopt, no data needs to be sent.
|
||||
absl::optional<std::pair<std::string, base::Value::Dict>> _pendingFormData;
|
||||
std::optional<std::pair<std::string, base::Value::Dict>> _pendingFormData;
|
||||
|
||||
// Bridge to listen to pref changes.
|
||||
std::unique_ptr<PrefObserverBridge> _prefObserverBridge;
|
||||
@ -796,7 +796,7 @@ constexpr base::TimeDelta kA11yAnnouncementQueueDelay = base::Seconds(1);
|
||||
|
||||
std::pair<std::string, base::Value::Dict> pendingFormData =
|
||||
std::move(_pendingFormData).value();
|
||||
_pendingFormData = absl::nullopt;
|
||||
_pendingFormData = std::nullopt;
|
||||
|
||||
// The frameID cannot be empty.
|
||||
DCHECK(!pendingFormData.first.empty());
|
||||
|
@ -85,7 +85,7 @@ bool IsContextSecureForWebState(web::WebState* web_state) {
|
||||
}
|
||||
|
||||
std::unique_ptr<base::Value> ParseJson(NSString* json_string) {
|
||||
absl::optional<base::Value> json_value =
|
||||
std::optional<base::Value> json_value =
|
||||
base::JSONReader::Read(base::SysNSStringToUTF8(json_string));
|
||||
if (!json_value) {
|
||||
return nullptr;
|
||||
@ -316,7 +316,7 @@ bool ExtractFormFieldData(const base::Value::Dict& field,
|
||||
field.FindString("autocomplete_attribute")) {
|
||||
field_data->autocomplete_attribute = *autocomplete_attribute;
|
||||
}
|
||||
if (absl::optional<int> max_length = field.FindInt("max_length")) {
|
||||
if (std::optional<int> max_length = field.FindInt("max_length")) {
|
||||
field_data->max_length = *max_length;
|
||||
}
|
||||
field_data->parsed_autocomplete =
|
||||
@ -347,7 +347,7 @@ bool ExtractFormFieldData(const base::Value::Dict& field,
|
||||
|
||||
// RoleAttribute::kOther is the default value. The only other value as of this
|
||||
// writing is RoleAttribute::kPresentation.
|
||||
absl::optional<int> role = field.FindInt("role");
|
||||
std::optional<int> role = field.FindInt("role");
|
||||
if (role &&
|
||||
*role == static_cast<int>(FormFieldData::RoleAttribute::kPresentation)) {
|
||||
field_data->role = FormFieldData::RoleAttribute::kPresentation;
|
||||
|
@ -78,7 +78,7 @@ bool FormActivityParams::FromMessage(const web::ScriptMessage& message,
|
||||
const std::string* field_type = message_body->FindString("fieldType");
|
||||
const std::string* type = message_body->FindString("type");
|
||||
const std::string* value = message_body->FindString("value");
|
||||
absl::optional<bool> has_user_gesture =
|
||||
std::optional<bool> has_user_gesture =
|
||||
message_body->FindBool("hasUserGesture");
|
||||
if (!field_identifier || !unique_field_id || !field_type || !type || !value ||
|
||||
!has_user_gesture) {
|
||||
|
@ -59,7 +59,7 @@ void FormHandlersJavaScriptFeature::ToggleTrackingUserEditedFields(
|
||||
base::Value::List().Append(track_user_edited_fields));
|
||||
}
|
||||
|
||||
absl::optional<std::string>
|
||||
std::optional<std::string>
|
||||
FormHandlersJavaScriptFeature::GetScriptMessageHandlerName() const {
|
||||
return kScriptMessageName;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#ifndef COMPONENTS_BACKGROUND_SYNC_BACKGROUND_SYNC_DELEGATE_H_
|
||||
#define COMPONENTS_BACKGROUND_SYNC_BACKGROUND_SYNC_DELEGATE_H_
|
||||
|
||||
#include <optional>
|
||||
#include <set>
|
||||
|
||||
#include "base/functional/callback.h"
|
||||
@ -12,7 +13,6 @@
|
||||
#include "build/build_config.h"
|
||||
#include "content/public/browser/background_sync_controller.h"
|
||||
#include "services/metrics/public/cpp/ukm_source_id.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/background_sync/background_sync.mojom-forward.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -37,10 +37,10 @@ class BackgroundSyncDelegate {
|
||||
#endif
|
||||
|
||||
// Gets the source_ID to log the UKM event for, and calls |callback| with that
|
||||
// source_id, or with absl::nullopt if UKM recording is not allowed.
|
||||
// source_id, or with std::nullopt if UKM recording is not allowed.
|
||||
virtual void GetUkmSourceId(
|
||||
const url::Origin& origin,
|
||||
base::OnceCallback<void(absl::optional<ukm::SourceId>)> callback) = 0;
|
||||
base::OnceCallback<void(std::optional<ukm::SourceId>)> callback) = 0;
|
||||
|
||||
// Handles browser shutdown.
|
||||
virtual void Shutdown() = 0;
|
||||
|
@ -83,7 +83,7 @@ void BackgroundSyncMetrics::MaybeRecordPeriodicSyncEventCompletion(
|
||||
|
||||
void BackgroundSyncMetrics::DidGetBackgroundSourceId(
|
||||
RecordCallback record_callback,
|
||||
absl::optional<ukm::SourceId> source_id) {
|
||||
std::optional<ukm::SourceId> source_id) {
|
||||
// This background event did not meet the requirements for the UKM service.
|
||||
if (!source_id)
|
||||
return;
|
||||
|
@ -5,11 +5,12 @@
|
||||
#ifndef COMPONENTS_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_
|
||||
#define COMPONENTS_BACKGROUND_SYNC_BACKGROUND_SYNC_METRICS_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/functional/callback.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "services/metrics/public/cpp/ukm_source_id.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
|
||||
|
||||
namespace {
|
||||
@ -62,7 +63,7 @@ class BackgroundSyncMetrics {
|
||||
friend class BackgroundSyncMetricsBrowserTest;
|
||||
|
||||
void DidGetBackgroundSourceId(RecordCallback record_callback,
|
||||
absl::optional<ukm::SourceId> source_id);
|
||||
std::optional<ukm::SourceId> source_id);
|
||||
|
||||
void RecordOneShotSyncRegistrationEvent(bool can_fire,
|
||||
bool is_reregistered,
|
||||
|
@ -6,10 +6,11 @@
|
||||
#define COMPONENTS_BACKGROUND_TASK_SCHEDULER_TASK_INFO_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
#include "components/background_task_scheduler/task_ids.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace background_task {
|
||||
|
||||
@ -64,8 +65,8 @@ struct TaskInfo {
|
||||
bool update_current = false;
|
||||
std::string extras;
|
||||
|
||||
absl::optional<PeriodicInfo> periodic_info;
|
||||
absl::optional<OneOffInfo> one_off_info;
|
||||
std::optional<PeriodicInfo> periodic_info;
|
||||
std::optional<OneOffInfo> one_off_info;
|
||||
};
|
||||
|
||||
} // namespace background_task
|
||||
|
@ -116,7 +116,7 @@ void PopupBlockerTabHelper::ShowBlockedPopup(
|
||||
|
||||
BlockedRequest* popup = it->second.get();
|
||||
|
||||
absl::optional<WindowOpenDisposition> updated_disposition;
|
||||
std::optional<WindowOpenDisposition> updated_disposition;
|
||||
if (disposition != WindowOpenDisposition::CURRENT_TAB)
|
||||
updated_disposition = disposition;
|
||||
|
||||
|
@ -5,8 +5,9 @@
|
||||
#ifndef COMPONENTS_BLOCKED_CONTENT_POPUP_NAVIGATION_DELEGATE_H_
|
||||
#define COMPONENTS_BLOCKED_CONTENT_POPUP_NAVIGATION_DELEGATE_H_
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/mojom/window_features/window_features.mojom-forward.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
|
||||
@ -42,7 +43,7 @@ class PopupNavigationDelegate {
|
||||
};
|
||||
virtual NavigateResult NavigateWithGesture(
|
||||
const blink::mojom::WindowFeatures& window_features,
|
||||
absl::optional<WindowOpenDisposition> updated_disposition) = 0;
|
||||
std::optional<WindowOpenDisposition> updated_disposition) = 0;
|
||||
|
||||
// Called when the navigation represented by this class was blocked.
|
||||
virtual void OnPopupBlocked(content::WebContents* web_contents,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user