components: Replace base::Optional and friends with absl counterparts
This replaces: - base::Optional -> absl::optional - include "base/optional.h" -> include "third_party/abseil-cpp/absl/types/optional.h" - base::nullopt -> absl::nullopt - base::make_optional -> absl::make_optional Bug: 1202909 Change-Id: If697b7bf69b199c1796f873eedca3359cdb48c64 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897151 Commit-Queue: Anton Bikineev <bikineev@chromium.org> Owners-Override: Anton Bikineev <bikineev@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#883296}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
330c3555c6
commit
1156b5f891
components
account_id
account_manager_core
account_addition_result.haccount_manager_facade.haccount_manager_facade_impl.ccaccount_manager_facade_impl_unittest.ccaccount_manager_util.ccaccount_manager_util.h
apdu
arc
appfuse
arc_features_parser.ccarc_features_parser.harc_features_parser_unittest.ccarc_util.ccbluetooth
compat_mode
crash_collector
disk_quota
enterprise
ime
arc_ime_service.ccarc_ime_service.harc_ime_service_unittest.cckey_event_result_receiver.cckey_event_result_receiver.hkey_event_result_receiver_unittest.cc
intent_helper
arc_intent_helper_bridge.ccarc_intent_helper_bridge_unittest.ccarc_intent_helper_observer.hintent_filter_mojom_traits.cc
lock_screen
metrics
arc_metrics_service.ccarc_metrics_service.harc_metrics_service_unittest.ccstability_metrics_manager.ccstability_metrics_manager.h
mojom
video_accelerator_mojom_traits.ccvideo_accelerator_mojom_traits_unittest.ccvideo_encode_accelerator_mojom_traits.cc
net
power
property
sensor
session
arc_data_remover.ccarc_data_remover.harc_data_remover_unittest.ccarc_instance_mode.ccarc_instance_mode.harc_instance_mode_unittest.ccarc_session_impl.harc_session_impl_unittest.ccarc_session_runner.ccarc_session_runner.harc_vm_client_adapter.ccarc_vm_client_adapter.harc_vm_client_adapter_unittest.cc
test
fake_app_instance.ccfake_app_instance.hfake_cast_receiver_instance.hfake_file_system_instance.ccfake_file_system_instance.hfake_lock_screen_instance.hfake_pip_instance.h
timer
usb
video_accelerator
autofill
content
browser
renderer
core
browser
address_profile_save_manager.haddress_profile_save_manager_unittest.ccautofill_field.hautofill_form_test_utils.ccautofill_form_test_utils.hautofill_merge_unittest.ccautofill_metrics_unittest.ccautofill_profile_import_process.ccautofill_profile_import_process.hautofill_profile_save_strike_database.ccautofill_profile_save_strike_database.hautofill_profile_update_strike_database.ccautofill_profile_update_strike_database.hautofill_save_update_address_profile_delegate_ios.hbrowser_autofill_manager.ccbrowser_autofill_manager.h
data_model
address.ccaddress.hautofill_profile_comparator.ccautofill_profile_comparator.hautofill_profile_comparator_unittest.ccautofill_structured_address_component.h
field_filler.ccform_data_importer.ccform_data_importer.hform_data_importer_unittest.ccform_parsing
form_processing
label_processing_util.cclabel_processing_util.hlabel_processing_util_unittest.ccname_processing_util.ccname_processing_util.hname_processing_util_unittest.cc
form_structure.ccform_structure.hgeo
alternative_state_name_map.ccalternative_state_name_map.halternative_state_name_map_test_utils.halternative_state_name_map_unittest.ccalternative_state_name_map_updater_unittest.cc
metrics
pattern_provider
pattern_configuration_parser.ccpattern_configuration_parser.hpattern_configuration_parser_unittest.ccpattern_provider_unittest.cc
payments
autofill_save_card_infobar_mobile.hcredit_card_access_manager.cccredit_card_access_manager.hcredit_card_access_manager_unittest.cccredit_card_cvc_authenticator.hcredit_card_fido_authenticator.cccredit_card_save_manager.hcredit_card_save_strike_database.cccredit_card_save_strike_database.hfido_authentication_strike_database.ccfido_authentication_strike_database.hfull_card_request.ccfull_card_request.hlegal_message_line_unittest.cclocal_card_migration_manager.hlocal_card_migration_strike_database.cclocal_card_migration_strike_database.hpayments_client.ccpayments_client.htest_authentication_requester.h
personal_data_manager_unittest.ccstrike_database_integrator_base.ccstrike_database_integrator_base.hstrike_database_integrator_test_strike_database.ccstrike_database_integrator_test_strike_database.hstrike_database_integrator_test_strike_database_unittest.cctest_autofill_client.htest_browser_autofill_manager.cctest_browser_autofill_manager.htest_personal_data_manager.hui
webdata
autocomplete_sync_bridge.ccautocomplete_sync_bridge.hautofill_profile_sync_bridge.ccautofill_profile_sync_bridge.hautofill_profile_sync_bridge_unittest.ccautofill_profile_sync_difference_tracker.ccautofill_profile_sync_difference_tracker.hautofill_profile_sync_difference_tracker_unittest.ccautofill_wallet_metadata_sync_bridge.ccautofill_wallet_metadata_sync_bridge.hautofill_wallet_offer_sync_bridge.ccautofill_wallet_offer_sync_bridge.hautofill_wallet_sync_bridge.ccautofill_wallet_sync_bridge.h
common
ios
autofill_assistant
browser
actions
action_delegate_util_unittest.cccollect_user_data_action.cccollect_user_data_action.hcollect_user_data_action_unittest.cc
autofill_assistant_onboarding_fetcher.ccclient.hclient_context_unittest.ccclient_settings.hcontroller.cccontroller.hcontroller_unittest.ccdetails.ccdetails.hfallback_handler
generate_password_for_form_field_action.ccgenerate_password_for_form_field_action_unittest.ccget_element_status_action_unittest.ccpresave_generated_password_action.ccpresave_generated_password_action_unittest.ccsave_generated_password_action.ccset_form_field_value_action_unittest.ccshow_generic_ui_action.ccuse_address_action.ccuse_credit_card_action.ccdevtools
devtools_api
service
starter.ccstarter.hstarter_heuristic.ccstarter_heuristic.hstarter_heuristic_unittest.ccstarter_platform_delegate.hstarter_unittest.ccstartup_util.ccstartup_util.hstartup_util_unittest.cctrigger_context.htrigger_scripts
dynamic_trigger_conditions.ccdynamic_trigger_conditions.hdynamic_trigger_conditions_unittest.ccmock_dynamic_trigger_conditions.htrigger_script_coordinator.cctrigger_script_coordinator.htrigger_script_coordinator_unittest.cc
ui_delegate.huser_data.ccuser_data.huser_data_util_unittest.ccuser_model.ccuser_model.huser_model_unittest.ccvalue_util.ccvalue_util.hvalue_util_unittest.ccweb
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
managed
breadcrumbs
browser_sync
browsing_data
captive_portal
cast
cast_channel
cast_message_handler.cccast_message_handler.hcast_message_handler_unittest.cccast_message_util.cccast_message_util.hcast_message_util_fuzzer.cccast_socket.cccast_socket.hcast_test_util.henum_table.ccenum_table.henum_table_unittest.cc
cast_streaming
cbor
cdm
chromeos_camera
client_hints
browser
cloud_devices
component_updater
android
loader_policies
installer_policies
consent_auditor
content_capture
browser
content_settings
android
browser
core
browser
common
renderer
crash
content
browser
cronet
android
cronet_url_request.ccnative
stale_host_resolver.ccstale_host_resolver.hstale_host_resolver_unittest.cctools
generators
crx_file
data_reduction_proxy
core
digital_asset_links
discardable_memory
dom_distiller
content
domain_reliability
download
content
database
download_db.hdownload_db_conversions.ccdownload_db_conversions_unittest.ccdownload_db_entry.hdownload_info.h
in_progress
internal
background_service
controller_impl.cccontroller_impl.hcontroller_impl_unittest.ccdownload_blockage_status.hdownload_driver.hdownload_store_unittest.ccdriver_entry.hfile_monitor_unittest.ccin_memory_download_driver.ccin_memory_download_driver.hin_memory_download_driver_unittest.cclog_source.hlogger_impl.ccstartup_status.hstats.h
test
common
public
background_service
common
auto_resumption_handler_unittest.ccbase_file.hdownload_create_info.hdownload_item.hdownload_item_factory.hdownload_item_impl.hdownload_item_impl_delegate.hdownload_response_handler.hdownload_schedule.ccdownload_schedule.hdownload_schedule_unittest.ccdownload_ukm_helper.hdownload_url_parameters.hdownload_utils.hin_progress_download_manager.hmock_download_item.hmock_download_item_impl.ccmock_download_item_impl.h
embedder_support
android
util
enterprise
browser
controller
error_page
exo
client_controlled_shell_surface.ccclient_controlled_shell_surface.hdata_source.ccdata_source.hdata_source_delegate.hdata_source_unittest.ccdrag_drop_operation.ccdrag_drop_operation_unittest.ccextended_drag_source.ccextended_drag_source.hextended_drag_source_unittest.ccfullscreen_shell_surface.hlayer_tree_frame_sink_holder.cclayer_tree_frame_sink_holder.hnotification.ccnotification.hnotification_surface.ccnotification_unittest.ccpointer.ccpointer.hpointer_unittest.ccseat_unittest.ccshell_surface.ccshell_surface.hshell_surface_base.ccshell_surface_base.hshell_surface_util.ccshell_surface_util.hsurface.ccsurface.hsurface_tree_host.cctext_input.cctext_input.htouch_unittest.ccui_lock_controller.ccxdg_shell_surface.hxkb_tracker.h
wayland
compatibility_test
template_client_event_receiver_version_tests.cc.tmplwayland_client_event_recorder.hwayland_client_registry.ccwayland_client_registry.h
serial_tracker.ccserial_tracker.hwl_data_device_manager.cczcr_notification_shell.ccfavicon
content
core
feature_engagement
internal
availability_model.havailability_model_impl.ccavailability_model_impl.havailability_model_impl_unittest.ccfeature_config_condition_validator.ccfeature_config_condition_validator_unittest.ccinit_aware_event_model_unittest.ccnever_availability_model.ccnever_availability_model.hnever_availability_model_unittest.ccpersistent_availability_store_unittest.ccpersistent_event_store_unittest.cctracker_impl_unittest.cc
public
federated_learning
floc_id.ccfloc_id.hfloc_sorting_lsh_clusters_service.ccfloc_sorting_lsh_clusters_service.hfloc_sorting_lsh_clusters_service_unittest.cc
feed
core
v2
api_test
feed_store_unittest.ccfeed_stream.ccfeed_stream.hfeedstore_util.ccfeedstore_util.hfeedstore_util_unittest.ccimage_fetcher.ccimage_fetcher.hmetrics_reporter.ccmetrics_reporter.hpersistent_key_value_store_impl.hprotocol_translator.ccprotocol_translator.hprotocol_translator_unittest.ccpublic
scheduling.ccstream_model_unittest.cctasks
test
types.ccweb_feed_subscription_coordinator.ccweb_feed_subscription_coordinator.hfull_restore
app_launch_info.happ_restore_data.ccapp_restore_data.hrestore_data_unittest.ccwindow_info.ccwindow_info.h
gcm_driver
gwp_asan
history
core
browser
expire_history_backend.ccexpire_history_backend.hhistory_backend.cchistory_backend.hhistory_backend_unittest.cchistory_service_unittest.cchistory_types.cchistory_types.h
sync
delete_directive_handler.ccdelete_directive_handler.hdelete_directive_handler_unittest.cctyped_url_sync_bridge.cctyped_url_sync_bridge.h
web_history_service.cchistory_clusters
image_fetcher
core
invalidation
impl
fcm_invalidation_listener.ccfcm_invalidation_listener_unittest.ccinvalidator_registrar_with_memory.ccper_user_topic_subscription_manager.ccper_user_topic_subscription_manager.hper_user_topic_subscription_request.h
public
javascript_dialogs
js_injection
link_header_util
live_caption
media_message_center
media_notification_background_impl.ccmedia_notification_background_impl.hmedia_notification_background_impl_unittest.ccmedia_notification_view_impl.ccmedia_notification_view_impl.hmedia_notification_view_impl_unittest.ccmedia_notification_view_modern_impl.hmedia_notification_view_modern_impl_unittest.ccmedia_session_notification_item.ccmedia_session_notification_item.h
media_router
browser
android
media_router_android.ccmedia_router_android.hmedia_router_android_bridge.ccmedia_router_android_unittest.cc
media_sinks_observer.hpresentation
common
metrics
call_stack_profile_builder.hcall_stack_profile_builder_unittest.cccall_stack_profile_metadata.cccall_stack_profile_metadata.hcall_stack_profile_metadata_unittest.ccdaily_event_unittest.cc
demographics
metrics_log_manager.ccmetrics_log_store.ccmetrics_log_store.hmetrics_log_store_unittest.ccmetrics_service_unittest.ccstructured
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
navigation_interception
network_hints
network_session_configurator
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_snippets
content_suggestion.hcontent_suggestions_service.cccontent_suggestions_service.hcontent_suggestions_service_unittest.cc
remote
json_request.ccjson_request.hjson_request_unittest.ccjson_to_categories.ccjson_to_categories.hremote_suggestion.hremote_suggestion_builder.hremote_suggestions_fetcher.hremote_suggestions_fetcher_impl.ccremote_suggestions_fetcher_impl.hremote_suggestions_fetcher_impl_unittest.ccremote_suggestions_provider_impl.ccremote_suggestions_provider_impl.hremote_suggestions_provider_impl_unittest.ccrequest_params.h
ntp_tiles
custom_links_manager_impl.cccustom_links_manager_impl.hcustom_links_manager_impl_unittest.ccmost_visited_sites.ccmost_visited_sites.hmost_visited_sites_unittest.ccpopular_sites_impl.ccpopular_sites_impl_unittest.cc
webui
offline_items_collection
core
android
offline_content_aggregator_bridge.ccoffline_content_aggregator_bridge.hoffline_item_bridge.ccoffline_item_bridge.hoffline_item_bridge_unittest.cc
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.ccoffline_item.hoffline_item_unittest.cctest_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
autocomplete_controller.ccautocomplete_input.hautocomplete_match.hautocomplete_match_type_unittest.ccautocomplete_provider_unittest.ccautocomplete_result_unittest.ccbookmark_provider_unittest.ccclipboard_provider.ccclipboard_provider.hclipboard_provider_unittest.ccdocument_provider.ccdocument_provider_unittest.ccomnibox_field_trial.homnibox_prefs.ccquery_tile_provider.ccquery_tile_provider.hsearch_suggestion_parser.ccsearch_suggestion_parser.hsearch_suggestion_parser_unittest.ccsuggestion_answer.ccsuggestion_answer.hsuggestion_answer_unittest.cc
open_from_clipboard
clipboard_recent_content.hclipboard_recent_content_generic.ccclipboard_recent_content_generic.hclipboard_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
base_model_executor.hbase_model_executor_helpers.hbert_model_executor.ccbert_model_executor.hbert_model_executor_unittest.ccmodel_executor.hmodel_executor_unittest.ccoptimization_guide_decider.hpage_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_web_contents_helper_unittest.ccpage_text_dump_result.ccpage_text_dump_result.hpage_text_dump_result_unittest.ccpage_text_observer.ccpage_text_observer.hpage_text_observer_unittest.cctest_optimization_guide_decider.cctest_optimization_guide_decider.h
renderer
core
command_line_top_host_provider.cchint_cache.hhint_cache_unittest.cchints_fetcher.cchints_fetcher.hhints_fetcher_unittest.ccmemory_hint.ccmemory_hint.hoptimization_guide_features.ccoptimization_guide_features.hoptimization_guide_store.ccoptimization_guide_store.hoptimization_guide_store_unittest.ccoptimization_guide_switches.ccoptimization_guide_switches.hoptimization_guide_switches_unittest.ccoptimization_guide_util.ccoptimization_guide_util.hoptimization_guide_util_unittest.ccoptimization_hints_component_update_listener.ccoptimization_hints_component_update_listener.hoptimization_metadata.hoptimization_metadata_unittest.ccoptimization_target_model_observer.hprediction_model_fetcher.ccprediction_model_fetcher.hprediction_model_fetcher_unittest.ccprediction_model_file.ccprediction_model_file.hstore_update_data.ccstore_update_data.h
os_crypt
key_storage_keyring.cckey_storage_keyring.hkey_storage_keyring_unittest.cckey_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
page_image_annotation
content
renderer
page_info
page_load_metrics
browser
metrics_web_contents_observer_unittest.ccpage_load_metrics_observer.hpage_load_metrics_observer_delegate.hpage_load_metrics_update_dispatcher.ccpage_load_metrics_util.ccpage_load_metrics_util.hpage_load_metrics_util_unittest.ccpage_load_tracker.ccpage_load_tracker.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.hcore
common
renderer
paint_preview
browser
file_manager.ccfile_manager.hpaint_preview_base_service.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.hserialized_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
content
core
browser
browser_save_password_progress_logger.ccchange_password_url_service_impl.cccredential_manager_impl.cccredential_manager_impl.hcredential_manager_impl_unittest.cccredential_manager_utils.cc
form_parsing
form_saver.hhash_password_manager.cchash_password_manager.hhash_password_manager_unittest.cchttp_auth_manager_unittest.ccimport
leak_detection
authenticated_leak_check.ccauthenticated_leak_check.hauthenticated_leak_check_unittest.ccbulk_leak_check_impl.ccbulk_leak_check_impl.hbulk_leak_check_impl_unittest.ccencryption_utils.ccencryption_utils.h
password_form_manager.ccpassword_form_manager_unittest.ccpassword_form_metrics_recorder.ccpassword_form_metrics_recorder.hpassword_form_metrics_recorder_unittest.ccpassword_generation_frame_helper.ccpassword_generation_manager.hpassword_manager.hpassword_manager_features_util.ccpassword_manager_metrics_util.ccpassword_manager_metrics_util.hpassword_manager_test_utils.ccpassword_manager_test_utils.hpassword_manager_unittest.ccpassword_reuse_detection_manager.ccpassword_reuse_detection_manager.hpassword_reuse_detection_manager_unittest.ccpassword_reuse_detector.ccpassword_reuse_detector.hpassword_reuse_detector_consumer.hpassword_reuse_detector_unittest.ccpassword_save_manager_impl.ccpassword_save_manager_impl.hpassword_save_manager_impl_unittest.ccpassword_scripts_fetcher_impl.ccpassword_store.ccpassword_store.hpassword_store_unittest.ccpossible_username_data.hstub_password_manager_client.hfuzzer
cipher_encrypt_fuzzer.cccypher_decrypt_fuzzer.cccypher_encrypt_with_key_fuzzer.cccypher_reencrypt_fuzzer.cc
leak_detection_request.ccleak_detection_request_factory.hleak_detection_request_unittest.ccleak_detection_request_utils.ccsync
ui
votes_uploader.ccvotes_uploader.hvotes_uploader_unittest.ccwell_known_change_password_state.ccwell_known_change_password_state.hcommon
ios
payments
content
android_app_communication.handroid_app_communication_chrome_os.ccandroid_app_communication_stub.ccandroid_app_communication_unittest.ccandroid_payment_app.ccandroid_payment_app.handroid_payment_app_factory.ccandroid_payment_app_unittest.ccpayment_credential.hservice_worker_payment_app_unittest.cc
core
pdf
performance_manager
decorators
embedder
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.ccpage_node_impl.ccpage_node_impl.hpage_node_impl_describer.ccpage_node_impl_unittest.ccprocess_node_impl.ccprocess_node_impl.h
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.hunittest_utils.cc
public
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
contexts
notification_permission_ui_selector.ccnotification_permission_ui_selector.hobject_permission_context_base.ccobject_permission_context_base.hpermission_auditing_database.ccpermission_auditing_database.hpermission_auditing_database_unittest.ccpermission_auditing_service.hpermission_auditing_service_unittest.ccpermission_context_base_unittest.ccpermission_manager.ccpermission_manager.hpermission_request.ccpermission_request.hpermission_request_impl.ccpermission_request_impl.hpermission_request_manager.ccpermission_request_manager.hpermission_request_manager_unittest.ccpermission_uma_util.ccpermission_uma_util.hpermission_uma_util_unittest.ccpermissions_client.ccpermissions_client.hprediction_service
request_type.htest
policy
content
core
browser
common
android
cloud
cloud_policy_client.cccloud_policy_client.hcloud_policy_client_unittest.cccloud_policy_manager.cccloud_policy_service.hcomponent_cloud_policy_service_unittest.cccomponent_cloud_policy_store.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.hencrypted_reporting_job_configuration_unittest.ccmock_cloud_policy_client.hmock_device_management_service.ccmock_device_management_service.hrealtime_reporting_job_configuration.ccrealtime_reporting_job_configuration_unittest.ccreporting_job_configuration_base.ccreporting_job_configuration_base.hresource_cache.ccresource_cache.hresource_cache_unittest.cc
policy_loader_ios.mmpolicy_loader_lacros.hpolicy_map.ccpolicy_map.hpolicy_map_unittest.ccregistry_dict.ccregistry_dict.hremote_commands
schema.ccschema.hschema_map_unittest.cctest_support
power_scheduler
prefs
printing
browser
renderer
test
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.hreading_list
remote_cocoa
app_shim
reporting
encryption
storage
resources
storage.ccstorage.hstorage_queue.ccstorage_queue.hstorage_queue_stress_test.ccstorage_queue_unittest.ccstorage_unittest.cctest_storage_module.hutil
safe_browsing
content
renderer
web_ui
core
safe_search_api
safe_search
scheduling_metrics
schema_org
search
repeatable_queries
search_engines
search_provider_logos
security_interstitials
content
send_tab_to_self
send_tab_to_self_bridge.ccsend_tab_to_self_bridge.hsend_tab_to_self_bridge_unittest.cctarget_device_info_unittest.cc
services
app_service
filesystem
font
heap_profiling
paint_preview_compositor
paint_preview_compositor_impl.ccpaint_preview_compositor_impl.hpaint_preview_compositor_impl_unittest.cc
print_compositor
storage
dom_storage
async_dom_storage_database.ccasync_dom_storage_database.hdom_storage_database.ccdom_storage_database.hdom_storage_database_unittest.cclegacy_dom_storage_database.cclegacy_dom_storage_database.hlegacy_dom_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.hsession_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.cc
indexed_db
partition_impl.ccpartition_impl.hpartition_impl_unittest.ccpublic
cpp
service_worker
service_worker_database.hservice_worker_resource_ops.ccservice_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
storage_service_impl.ccstorage_service_impl.hstorage_service_impl_unittest.ccsessions
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
signin
core
browser
internal
identity_manager
account_info_util.ccaccount_info_util.haccount_info_util_unittest.ccaccount_tracker_service.ccaccounts_mutator_impl.ccaccounts_mutator_impl.hdevice_accounts_synchronizer_impl.ccdevice_accounts_synchronizer_impl.hprimary_account_manager.hprofile_oauth2_token_service_delegate.hprofile_oauth2_token_service_delegate_android.ccprofile_oauth2_token_service_delegate_android.hprofile_oauth2_token_service_delegate_ios.hprofile_oauth2_token_service_delegate_ios.mm
ios
public
base
identity_manager
soda
sqlite_proto
startup_metric_utils
browser
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_observer_test_utils.ccsubresource_filter_observer_test_utils.hsubresource_filter_safe_browsing_activation_throttle.ccsubresource_filter_safe_browsing_activation_throttle_unittest.cc
common
renderer
suggestions
sync
base
driver
data_type_manager_impl.hpassphrase_type_metrics_provider.ccpassphrase_type_metrics_provider_unittest.ccprofile_sync_service.ccprofile_sync_service.hsync_policy_handler.ccsync_service_crypto_unittest.cc
engine
loopback_server
invalidations
interested_data_types_manager.ccinterested_data_types_manager.hmock_sync_invalidations_service.hsync_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_error.ccmodel_error.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.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
nigori_local_change_processor.hnigori_model_type_processor.ccnigori_model_type_processor.hnigori_model_type_processor_unittest.ccnigori_state.hnigori_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.ccnigori_test_utils.ccnigori_test_utils.h
test
fake_server
model
fake_model_type_controller_delegate.hfake_model_type_sync_bridge.ccfake_model_type_sync_bridge.hfake_sync_change_processor.ccfake_sync_change_processor.hmock_model_type_change_processor.ccmock_model_type_change_processor.hmodel_type_store_test_util.ccstub_model_type_sync_bridge.ccstub_model_type_sync_bridge.hsync_change_processor_wrapper_for_test.ccsync_change_processor_wrapper_for_test.htest_matchers.h
trusted_vault
download_keys_response_handler.ccdownload_keys_response_handler.hdownload_keys_response_handler_unittest.ccsecurebox.ccsecurebox.hsecurebox_unittest.ccstandalone_trusted_vault_backend.ccstandalone_trusted_vault_backend.hstandalone_trusted_vault_backend_unittest.ccstandalone_trusted_vault_client.ccstandalone_trusted_vault_client.htrusted_vault_access_token_fetcher.htrusted_vault_access_token_fetcher_frontend.cctrusted_vault_access_token_fetcher_frontend.htrusted_vault_access_token_fetcher_frontend_unittest.cctrusted_vault_access_token_fetcher_impl.cctrusted_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_request.cctrusted_vault_request.htrusted_vault_request_unittest.cc
sync_bookmarks
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.cc
sync_preferences
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_media_controls
thin_webview
internal
translate
content
browser
content_translate_driver.ccper_frame_content_translate_driver.cctranslate_model_service.cctranslate_model_service.h
renderer
core
ui_devtools
ukm
update_client
component.cccomponent.hcrx_update_item.hprotocol_definition.hprotocol_serializer.ccprotocol_serializer.hprotocol_serializer_json_unittest.ccupdate_checker.ccupdate_checker.hupdate_checker_unittest.ccupdate_client.hupdate_client_unittest.ccupdate_engine.ccupdate_engine.h
upload_list
url_matcher
url_pattern_index
user_manager
variations
client_filterable_state.h
field_trial_config
service
variations_field_trial_creator.ccvariations_field_trial_creator.hvariations_field_trial_creator_unittest.cc
variations_ids_provider.ccvariations_ids_provider.hvariations_ids_provider_unittest.ccvariations_layers.ccvariations_layers.hvariations_seed_processor.ccvisitedlink
viz
client
common
features.ccfeatures.h
frame_sinks
gl_scaler.hgpu
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.ccsurface_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.h
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.hdelegated_ink_point_renderer_base.ccdelegated_ink_point_renderer_base.hdelegated_ink_trail_data.ccdirect_renderer.ccdirect_renderer.hdisplay.ccdisplay_perftest.ccdisplay_resource_provider_skia_unittest.ccdisplay_scheduler.hdisplay_unittest.ccexternal_use_client.ccexternal_use_client.hframe_rate_decider.ccframe_rate_decider_unittest.ccgl_renderer.ccgl_renderer.hgl_renderer_copier_pixeltest.ccgl_renderer_unittest.ccoutput_surface_frame.hoverlay_candidate.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_unittest.ccrenderer_perftest.ccrenderer_pixeltest.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_perf_test.cc
display_embedder
buffer_queue.himage_context_impl.ccimage_context_impl.houtput_presenter_fuchsia.hskia_output_device.ccskia_output_device.hskia_output_device_buffer_queue.ccskia_output_device_buffer_queue.hskia_output_device_buffer_queue_unittest.ccskia_output_device_vulkan.hskia_output_surface_dependency.hskia_output_surface_impl.ccskia_output_surface_impl.hskia_output_surface_impl_on_gpu.ccskia_output_surface_impl_on_gpu.h
frame_sinks
compositor_frame_sink_impl.cccompositor_frame_sink_impl.hcompositor_frame_sink_support.cccompositor_frame_sink_support.hcompositor_frame_sink_support_unittest.ccframe_sink_manager_impl.ccframe_sink_manager_impl.hroot_compositor_frame_sink_impl.ccroot_compositor_frame_sink_impl.hsurface_synchronization_unittest.cc
video_capture
frame_sink_video_capturer_impl.ccframe_sink_video_capturer_impl.hframe_sink_video_capturer_impl_unittest.ccvideo_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_observer.hsurface_saved_frame.ccsurface_saved_frame.h
transitions
test
web_cache
renderer
web_package
web_bundle_parser.ccweb_bundle_parser_factory.ccweb_bundle_parser_factory_unittest.ccweb_bundle_parser_fuzzer.ccweb_bundle_parser_unittest.cc
webapps
browser
android
add_to_homescreen_data_fetcher_unittest.ccapp_banner_manager_android.ccshortcut_info.ccshortcut_info.h
banners
app_banner_manager.ccapp_banner_manager.happ_banner_settings_helper.ccapp_banner_settings_helper.happ_banner_settings_helper_unittest.cc
installable
pwa_install_path_tracker.hservices
web_app_origin_association
webauthn
webcrypto
webrtc_logging
browser
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_reader.ccpatch_reader.hpatch_writer.hrel32_finder.ccrel32_finder.hrel32_finder_unittest.ccrel32_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.cczucchini_gen.htools/variations/unittest_data
@ -244,7 +244,7 @@ std::string AccountId::Serialize() const {
|
||||
// static
|
||||
bool AccountId::Deserialize(const std::string& serialized,
|
||||
AccountId* account_id) {
|
||||
base::Optional<base::Value> value(base::JSONReader::Read(serialized));
|
||||
absl::optional<base::Value> value(base::JSONReader::Read(serialized));
|
||||
if (!value || !value->is_dict())
|
||||
return false;
|
||||
|
||||
|
@ -5,9 +5,9 @@
|
||||
#ifndef COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_ADDITION_RESULT_H_
|
||||
#define COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_ADDITION_RESULT_H_
|
||||
|
||||
#include "base/optional.h"
|
||||
#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 {
|
||||
|
||||
@ -31,9 +31,9 @@ struct COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE) AccountAdditionResult {
|
||||
|
||||
Status status;
|
||||
// The account that was added.
|
||||
base::Optional<Account> account;
|
||||
absl::optional<Account> account;
|
||||
// The error is set only if `status` is set to `kNetworkError`.
|
||||
base::Optional<GoogleServiceAuthError> error;
|
||||
absl::optional<GoogleServiceAuthError> error;
|
||||
|
||||
explicit AccountAdditionResult(Status status);
|
||||
AccountAdditionResult(Status status, Account account);
|
||||
|
@ -98,7 +98,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 `base::nullopt`.
|
||||
// callback. Otherwise `account` will be set to `absl::nullopt`.
|
||||
virtual void ShowAddAccountDialog(
|
||||
const AccountAdditionSource& source,
|
||||
base::OnceCallback<void(const AccountAdditionResult& result)>
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/optional.h"
|
||||
#include "chromeos/crosapi/mojom/account_manager.mojom.h"
|
||||
#include "components/account_manager_core/account.h"
|
||||
#include "components/account_manager_core/account_addition_result.h"
|
||||
@ -23,6 +22,7 @@
|
||||
#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 {
|
||||
|
||||
@ -39,7 +39,7 @@ void UnmarshalAccounts(
|
||||
std::vector<crosapi::mojom::AccountPtr> mojo_accounts) {
|
||||
std::vector<Account> accounts;
|
||||
for (const auto& mojo_account : mojo_accounts) {
|
||||
base::Optional<Account> maybe_account = FromMojoAccount(mojo_account);
|
||||
absl::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.
|
||||
@ -53,7 +53,7 @@ void UnmarshalAccounts(
|
||||
void UnmarshalPersistentError(
|
||||
base::OnceCallback<void(const GoogleServiceAuthError&)> callback,
|
||||
crosapi::mojom::GoogleServiceAuthErrorPtr mojo_error) {
|
||||
base::Optional<GoogleServiceAuthError> maybe_error =
|
||||
absl::optional<GoogleServiceAuthError> maybe_error =
|
||||
FromMojoGoogleServiceAuthError(mojo_error);
|
||||
if (!maybe_error) {
|
||||
// Couldn't unmarshal GoogleServiceAuthError, report the account as not
|
||||
@ -158,7 +158,7 @@ class AccountManagerFacadeImpl::AccessTokenFetcher
|
||||
is_request_pending_ = false;
|
||||
|
||||
if (result->is_error()) {
|
||||
base::Optional<GoogleServiceAuthError> maybe_error =
|
||||
absl::optional<GoogleServiceAuthError> maybe_error =
|
||||
account_manager::FromMojoGoogleServiceAuthError(result->get_error());
|
||||
|
||||
if (!maybe_error.has_value()) {
|
||||
@ -368,7 +368,7 @@ void AccountManagerFacadeImpl::OnShowAddAccountDialogFinished(
|
||||
base::OnceCallback<
|
||||
void(const account_manager::AccountAdditionResult& result)> callback,
|
||||
crosapi::mojom::AccountAdditionResultPtr mojo_result) {
|
||||
base::Optional<account_manager::AccountAdditionResult> result =
|
||||
absl::optional<account_manager::AccountAdditionResult> result =
|
||||
account_manager::FromMojoAccountAdditionResult(mojo_result);
|
||||
if (!result.has_value()) {
|
||||
FinishAddAccount(std::move(callback),
|
||||
@ -390,7 +390,7 @@ void AccountManagerFacadeImpl::FinishAddAccount(
|
||||
|
||||
void AccountManagerFacadeImpl::OnTokenUpserted(
|
||||
crosapi::mojom::AccountPtr account) {
|
||||
base::Optional<Account> maybe_account = FromMojoAccount(account);
|
||||
absl::optional<Account> maybe_account = FromMojoAccount(account);
|
||||
if (!maybe_account) {
|
||||
LOG(WARNING) << "Can't unmarshal account of type: "
|
||||
<< account->key->account_type;
|
||||
@ -403,7 +403,7 @@ void AccountManagerFacadeImpl::OnTokenUpserted(
|
||||
|
||||
void AccountManagerFacadeImpl::OnAccountRemoved(
|
||||
crosapi::mojom::AccountPtr account) {
|
||||
base::Optional<Account> maybe_account = FromMojoAccount(account);
|
||||
absl::optional<Account> maybe_account = FromMojoAccount(account);
|
||||
if (!maybe_account) {
|
||||
LOG(WARNING) << "Can't unmarshal account of type: "
|
||||
<< account->key->account_type;
|
||||
|
@ -140,7 +140,7 @@ class FakeAccountManager : public crosapi::mojom::AccountManager {
|
||||
void GetPersistentErrorForAccount(
|
||||
crosapi::mojom::AccountKeyPtr mojo_account_key,
|
||||
GetPersistentErrorForAccountCallback callback) override {
|
||||
base::Optional<AccountKey> account_key =
|
||||
absl::optional<AccountKey> account_key =
|
||||
FromMojoAccountKey(mojo_account_key);
|
||||
DCHECK(account_key.has_value());
|
||||
auto it = persistent_errors_.find(account_key.value());
|
||||
|
@ -91,7 +91,7 @@ crosapi::mojom::GoogleServiceAuthError::State ToMojoGoogleServiceAuthErrorState(
|
||||
}
|
||||
}
|
||||
|
||||
base::Optional<account_manager::AccountAdditionResult::Status>
|
||||
absl::optional<account_manager::AccountAdditionResult::Status>
|
||||
FromMojoAccountAdditionStatus(
|
||||
crosapi::mojom::AccountAdditionResult::Status mojo_status) {
|
||||
switch (mojo_status) {
|
||||
@ -109,7 +109,7 @@ FromMojoAccountAdditionStatus(
|
||||
default:
|
||||
LOG(WARNING) << "Unknown crosapi::mojom::AccountAdditionResult::Status: "
|
||||
<< mojo_status;
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,12 +131,12 @@ crosapi::mojom::AccountAdditionResult::Status ToMojoAccountAdditionStatus(
|
||||
|
||||
} // namespace
|
||||
|
||||
base::Optional<account_manager::Account> FromMojoAccount(
|
||||
absl::optional<account_manager::Account> FromMojoAccount(
|
||||
const crosapi::mojom::AccountPtr& mojom_account) {
|
||||
const base::Optional<account_manager::AccountKey> account_key =
|
||||
const absl::optional<account_manager::AccountKey> account_key =
|
||||
FromMojoAccountKey(mojom_account->key);
|
||||
if (!account_key.has_value())
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
|
||||
account_manager::Account account;
|
||||
account.key = account_key.value();
|
||||
@ -152,12 +152,12 @@ crosapi::mojom::AccountPtr ToMojoAccount(
|
||||
return mojom_account;
|
||||
}
|
||||
|
||||
base::Optional<account_manager::AccountKey> FromMojoAccountKey(
|
||||
absl::optional<account_manager::AccountKey> FromMojoAccountKey(
|
||||
const crosapi::mojom::AccountKeyPtr& mojom_account_key) {
|
||||
const base::Optional<account_manager::AccountType> account_type =
|
||||
const absl::optional<account_manager::AccountType> account_type =
|
||||
FromMojoAccountType(mojom_account_key->account_type);
|
||||
if (!account_type.has_value())
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
|
||||
account_manager::AccountKey account_key;
|
||||
account_key.id = mojom_account_key->id;
|
||||
@ -174,7 +174,7 @@ crosapi::mojom::AccountKeyPtr ToMojoAccountKey(
|
||||
return mojom_account_key;
|
||||
}
|
||||
|
||||
base::Optional<account_manager::AccountType> FromMojoAccountType(
|
||||
absl::optional<account_manager::AccountType> FromMojoAccountType(
|
||||
const crosapi::mojom::AccountType& account_type) {
|
||||
switch (account_type) {
|
||||
case crosapi::mojom::AccountType::kGaia:
|
||||
@ -192,7 +192,7 @@ base::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 base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ crosapi::mojom::AccountType ToMojoAccountType(
|
||||
}
|
||||
}
|
||||
|
||||
base::Optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
absl::optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
const crosapi::mojom::GoogleServiceAuthErrorPtr& mojo_error) {
|
||||
switch (mojo_error->state) {
|
||||
case cm::GoogleServiceAuthError::State::kNone:
|
||||
@ -236,7 +236,7 @@ base::Optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
default:
|
||||
LOG(WARNING) << "Unknown crosapi::mojom::GoogleServiceAuthError::State: "
|
||||
<< mojo_error->state;
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
@ -258,13 +258,13 @@ crosapi::mojom::GoogleServiceAuthErrorPtr ToMojoGoogleServiceAuthError(
|
||||
return mojo_result;
|
||||
}
|
||||
|
||||
base::Optional<account_manager::AccountAdditionResult>
|
||||
absl::optional<account_manager::AccountAdditionResult>
|
||||
FromMojoAccountAdditionResult(
|
||||
const crosapi::mojom::AccountAdditionResultPtr& mojo_result) {
|
||||
base::Optional<account_manager::AccountAdditionResult::Status> status =
|
||||
absl::optional<account_manager::AccountAdditionResult::Status> status =
|
||||
FromMojoAccountAdditionStatus(mojo_result->status);
|
||||
if (!status.has_value()) {
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
account_manager::AccountAdditionResult result(status.value());
|
||||
result.status = status.value();
|
||||
|
@ -5,47 +5,47 @@
|
||||
#ifndef COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_MANAGER_UTIL_H_
|
||||
#define COMPONENTS_ACCOUNT_MANAGER_CORE_ACCOUNT_MANAGER_UTIL_H_
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "chromeos/crosapi/mojom/account_manager.mojom.h"
|
||||
#include "components/account_manager_core/account.h"
|
||||
#include "components/account_manager_core/account_addition_result.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class GoogleServiceAuthError;
|
||||
|
||||
namespace account_manager {
|
||||
|
||||
// Returns `base::nullopt` if `mojom_account` cannot be parsed.
|
||||
// Returns `absl::nullopt` if `mojom_account` cannot be parsed.
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
base::Optional<account_manager::Account> FromMojoAccount(
|
||||
absl::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 `base::nullopt` if `mojom_account_key` cannot be parsed.
|
||||
// Returns `absl::nullopt` if `mojom_account_key` cannot be parsed.
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
base::Optional<account_manager::AccountKey> FromMojoAccountKey(
|
||||
absl::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 `base::nullopt` if `account_type` cannot be parsed.
|
||||
// Returns `absl::nullopt` if `account_type` cannot be parsed.
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
base::Optional<account_manager::AccountType> FromMojoAccountType(
|
||||
absl::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 `base::nullopt` if `mojo_error` cannot be parsed. This probably means
|
||||
// Returns `absl::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)
|
||||
base::Optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
absl::optional<GoogleServiceAuthError> FromMojoGoogleServiceAuthError(
|
||||
const crosapi::mojom::GoogleServiceAuthErrorPtr& mojo_error);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
@ -53,7 +53,7 @@ crosapi::mojom::GoogleServiceAuthErrorPtr ToMojoGoogleServiceAuthError(
|
||||
GoogleServiceAuthError error);
|
||||
|
||||
COMPONENT_EXPORT(ACCOUNT_MANAGER_CORE)
|
||||
base::Optional<account_manager::AccountAdditionResult>
|
||||
absl::optional<account_manager::AccountAdditionResult>
|
||||
FromMojoAccountAdditionResult(
|
||||
const crosapi::mojom::AccountAdditionResultPtr& mojo_result);
|
||||
|
||||
|
@ -16,10 +16,10 @@ uint16_t ParseMessageLength(base::span<const uint8_t> message, size_t offset) {
|
||||
|
||||
} // namespace
|
||||
|
||||
base::Optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
absl::optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
base::span<const uint8_t> message) {
|
||||
if (message.size() < kApduMinHeader || message.size() > kApduMaxLength)
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
|
||||
uint8_t cla = message[0];
|
||||
uint8_t ins = message[1];
|
||||
@ -36,12 +36,12 @@ base::Optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
// Invalid encoding sizes.
|
||||
case kApduMinHeader + 1:
|
||||
case kApduMinHeader + 2:
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
// No data present; response expected.
|
||||
case kApduMinHeader + 3:
|
||||
// Fifth byte must be 0.
|
||||
if (message[4] != 0)
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
response_length = ParseMessageLength(message, kApduCommandLengthOffset);
|
||||
// Special case where response length of 0x0000 corresponds to 65536
|
||||
// as defined in ISO7816-4.
|
||||
@ -51,7 +51,7 @@ base::Optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
default:
|
||||
// Fifth byte must be 0.
|
||||
if (message[4] != 0)
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
auto data_length = ParseMessageLength(message, kApduCommandLengthOffset);
|
||||
|
||||
if (message.size() == data_length + kApduCommandDataOffset) {
|
||||
@ -69,7 +69,7 @@ base::Optional<ApduCommand> ApduCommand::CreateFromMessage(
|
||||
if (response_length == 0)
|
||||
response_length = kApduMaxResponseLength;
|
||||
} else {
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "base/containers/span.h"
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace apdu {
|
||||
|
||||
@ -28,7 +28,7 @@ namespace apdu {
|
||||
class COMPONENT_EXPORT(APDU) ApduCommand {
|
||||
public:
|
||||
// Constructs an APDU command from the serialized message data.
|
||||
static base::Optional<ApduCommand> CreateFromMessage(
|
||||
static absl::optional<ApduCommand> CreateFromMessage(
|
||||
base::span<const uint8_t> message);
|
||||
|
||||
ApduCommand();
|
||||
|
@ -11,11 +11,11 @@
|
||||
namespace apdu {
|
||||
|
||||
// static
|
||||
base::Optional<ApduResponse> ApduResponse::CreateFromMessage(
|
||||
absl::optional<ApduResponse> ApduResponse::CreateFromMessage(
|
||||
base::span<const uint8_t> data) {
|
||||
// Invalid message size, data is appended by status byte.
|
||||
if (data.size() < 2)
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
|
||||
uint16_t status_bytes = data[data.size() - 2] << 8;
|
||||
status_bytes |= data[data.size() - 1];
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "base/containers/span.h"
|
||||
#include "base/gtest_prod_util.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace apdu {
|
||||
|
||||
@ -33,7 +33,7 @@ class COMPONENT_EXPORT(APDU) ApduResponse {
|
||||
};
|
||||
|
||||
// Create a APDU response from the serialized message.
|
||||
static base::Optional<ApduResponse> CreateFromMessage(
|
||||
static absl::optional<ApduResponse> CreateFromMessage(
|
||||
base::span<const uint8_t> data);
|
||||
|
||||
ApduResponse(std::vector<uint8_t> data, Status response_status);
|
||||
|
@ -40,7 +40,7 @@ class ArcAppfuseBridgeFactory
|
||||
};
|
||||
|
||||
void RunWithScopedHandle(base::OnceCallback<void(mojo::ScopedHandle)> callback,
|
||||
base::Optional<base::ScopedFD> fd) {
|
||||
absl::optional<base::ScopedFD> fd) {
|
||||
if (!fd || !fd.value().is_valid()) {
|
||||
LOG(ERROR) << "Invalid FD: fd.has_value() = " << fd.has_value();
|
||||
std::move(callback).Run(mojo::ScopedHandle());
|
||||
|
@ -27,17 +27,17 @@ constexpr const base::FilePath::CharType kArcVmFeaturesJsonFile[] =
|
||||
constexpr const base::FilePath::CharType kArcFeaturesJsonFile[] =
|
||||
FILE_PATH_LITERAL("/etc/arc/features.json");
|
||||
|
||||
base::RepeatingCallback<base::Optional<ArcFeatures>()>*
|
||||
base::RepeatingCallback<absl::optional<ArcFeatures>()>*
|
||||
g_arc_features_getter_for_testing = nullptr;
|
||||
|
||||
base::Optional<ArcFeatures> ParseFeaturesJson(base::StringPiece input_json) {
|
||||
absl::optional<ArcFeatures> ParseFeaturesJson(base::StringPiece input_json) {
|
||||
ArcFeatures arc_features;
|
||||
|
||||
base::JSONReader::ValueWithError parsed_json =
|
||||
base::JSONReader::ReadAndReturnValueWithError(input_json);
|
||||
if (!parsed_json.value || !parsed_json.value->is_dict()) {
|
||||
LOG(ERROR) << "Error parsing feature JSON: " << parsed_json.error_message;
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
// Parse each item under features.
|
||||
@ -45,7 +45,7 @@ base::Optional<ArcFeatures> ParseFeaturesJson(base::StringPiece input_json) {
|
||||
parsed_json.value->FindKeyOfType("features", base::Value::Type::LIST);
|
||||
if (!feature_list) {
|
||||
LOG(ERROR) << "No feature list in JSON.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
for (auto& feature_item : feature_list->GetList()) {
|
||||
const base::Value* feature_name =
|
||||
@ -54,11 +54,11 @@ base::Optional<ArcFeatures> ParseFeaturesJson(base::StringPiece input_json) {
|
||||
feature_item.FindKeyOfType("version", base::Value::Type::INTEGER);
|
||||
if (!feature_name || feature_name->GetString().empty()) {
|
||||
LOG(ERROR) << "Missing name in the feature.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
if (!feature_version) {
|
||||
LOG(ERROR) << "Missing version in the feature.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
arc_features.feature_map.emplace(feature_name->GetString(),
|
||||
feature_version->GetInt());
|
||||
@ -70,17 +70,17 @@ base::Optional<ArcFeatures> ParseFeaturesJson(base::StringPiece input_json) {
|
||||
base::Value::Type::LIST);
|
||||
if (!unavailable_feature_list) {
|
||||
LOG(ERROR) << "No unavailable feature list in JSON.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
for (auto& feature_item : unavailable_feature_list->GetList()) {
|
||||
if (!feature_item.is_string()) {
|
||||
LOG(ERROR) << "Item in the unavailable feature list is not a string.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
if (feature_item.GetString().empty()) {
|
||||
LOG(ERROR) << "Missing name in the feature.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
arc_features.unavailable_features.emplace_back(feature_item.GetString());
|
||||
}
|
||||
@ -90,12 +90,12 @@ base::Optional<ArcFeatures> ParseFeaturesJson(base::StringPiece input_json) {
|
||||
"properties", base::Value::Type::DICTIONARY);
|
||||
if (!properties) {
|
||||
LOG(ERROR) << "No properties in JSON.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
for (const auto& item : properties->DictItems()) {
|
||||
if (!item.second.is_string()) {
|
||||
LOG(ERROR) << "Item in the properties mapping is not a string.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
arc_features.build_props.emplace(item.first, item.second.GetString());
|
||||
@ -106,14 +106,14 @@ base::Optional<ArcFeatures> ParseFeaturesJson(base::StringPiece input_json) {
|
||||
"play_store_version", base::Value::Type::STRING);
|
||||
if (!play_version) {
|
||||
LOG(ERROR) << "No Play Store version in JSON.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
arc_features.play_store_version = play_version->GetString();
|
||||
|
||||
return arc_features;
|
||||
}
|
||||
|
||||
base::Optional<ArcFeatures> ReadOnFileThread(const base::FilePath& file_path) {
|
||||
absl::optional<ArcFeatures> ReadOnFileThread(const base::FilePath& file_path) {
|
||||
DCHECK(!file_path.empty());
|
||||
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
base::BlockingType::MAY_BLOCK);
|
||||
@ -125,13 +125,13 @@ base::Optional<ArcFeatures> ReadOnFileThread(const base::FilePath& file_path) {
|
||||
if (!base::ReadFileToString(file_path, &input_json)) {
|
||||
PLOG(ERROR) << "Cannot read file " << file_path.value()
|
||||
<< " into string.";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
if (input_json.empty()) {
|
||||
LOG(ERROR) << "Input JSON is empty in file " << file_path.value();
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
return ParseFeaturesJson(input_json);
|
||||
@ -145,7 +145,7 @@ ArcFeatures::~ArcFeatures() = default;
|
||||
ArcFeatures& ArcFeatures::operator=(ArcFeatures&& other) = default;
|
||||
|
||||
void ArcFeaturesParser::GetArcFeatures(
|
||||
base::OnceCallback<void(base::Optional<ArcFeatures>)> callback) {
|
||||
base::OnceCallback<void(absl::optional<ArcFeatures>)> callback) {
|
||||
if (g_arc_features_getter_for_testing) {
|
||||
std::move(callback).Run(g_arc_features_getter_for_testing->Run());
|
||||
return;
|
||||
@ -159,13 +159,13 @@ void ArcFeaturesParser::GetArcFeatures(
|
||||
std::move(callback));
|
||||
}
|
||||
|
||||
base::Optional<ArcFeatures> ArcFeaturesParser::ParseFeaturesJsonForTesting(
|
||||
absl::optional<ArcFeatures> ArcFeaturesParser::ParseFeaturesJsonForTesting(
|
||||
base::StringPiece input_json) {
|
||||
return ParseFeaturesJson(input_json);
|
||||
}
|
||||
|
||||
void ArcFeaturesParser::SetArcFeaturesGetterForTesting(
|
||||
base::RepeatingCallback<base::Optional<ArcFeatures>()>* getter) {
|
||||
base::RepeatingCallback<absl::optional<ArcFeatures>()>* getter) {
|
||||
g_arc_features_getter_for_testing = getter;
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
#include "base/callback_forward.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -80,18 +80,18 @@ class ArcFeaturesParser {
|
||||
public:
|
||||
// Get ARC system available features.
|
||||
static void GetArcFeatures(
|
||||
base::OnceCallback<void(base::Optional<ArcFeatures>)> callback);
|
||||
base::OnceCallback<void(absl::optional<ArcFeatures>)> callback);
|
||||
|
||||
// Given an input feature JSON, return ARC features. This method is for
|
||||
// testing only.
|
||||
static base::Optional<ArcFeatures> ParseFeaturesJsonForTesting(
|
||||
static absl::optional<ArcFeatures> ParseFeaturesJsonForTesting(
|
||||
base::StringPiece input_json);
|
||||
|
||||
// Overrides the ArcFeatures returned by GetArcFeatures, for testing only.
|
||||
// Does not take ownership of |getter|, it must be alive when GetArcFeatures
|
||||
// is called.
|
||||
static void SetArcFeaturesGetterForTesting(
|
||||
base::RepeatingCallback<base::Optional<ArcFeatures>()>* getter);
|
||||
base::RepeatingCallback<absl::optional<ArcFeatures>()>* getter);
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ArcFeaturesParser);
|
||||
|
@ -81,20 +81,20 @@ constexpr const char kInvalidJsonWithMissingFields[] =
|
||||
"invalid_root_third": {}})json";
|
||||
|
||||
TEST_F(ArcFeaturesParserTest, ParseEmptyJson) {
|
||||
base::Optional<ArcFeatures> arc_features =
|
||||
absl::optional<ArcFeatures> arc_features =
|
||||
ArcFeaturesParser::ParseFeaturesJsonForTesting(base::StringPiece());
|
||||
EXPECT_EQ(arc_features, base::nullopt);
|
||||
EXPECT_EQ(arc_features, absl::nullopt);
|
||||
}
|
||||
|
||||
TEST_F(ArcFeaturesParserTest, ParseInvalidJson) {
|
||||
base::Optional<ArcFeatures> arc_features =
|
||||
absl::optional<ArcFeatures> arc_features =
|
||||
ArcFeaturesParser::ParseFeaturesJsonForTesting(
|
||||
kInvalidJsonWithMissingFields);
|
||||
EXPECT_EQ(arc_features, base::nullopt);
|
||||
EXPECT_EQ(arc_features, absl::nullopt);
|
||||
}
|
||||
|
||||
TEST_F(ArcFeaturesParserTest, ParseValidJson) {
|
||||
base::Optional<ArcFeatures> arc_features =
|
||||
absl::optional<ArcFeatures> arc_features =
|
||||
ArcFeaturesParser::ParseFeaturesJsonForTesting(kValidJson);
|
||||
auto feature_map = arc_features->feature_map;
|
||||
auto unavailable_features = arc_features->unavailable_features;
|
||||
@ -107,7 +107,7 @@ TEST_F(ArcFeaturesParserTest, ParseValidJson) {
|
||||
}
|
||||
|
||||
TEST_F(ArcFeaturesParserTest, ParseValidJsonWithUnavailableFeature) {
|
||||
base::Optional<ArcFeatures> arc_features =
|
||||
absl::optional<ArcFeatures> arc_features =
|
||||
ArcFeaturesParser::ParseFeaturesJsonForTesting(
|
||||
kValidJsonWithUnavailableFeature);
|
||||
auto feature_map = arc_features->feature_map;
|
||||
@ -121,10 +121,10 @@ TEST_F(ArcFeaturesParserTest, ParseValidJsonWithUnavailableFeature) {
|
||||
}
|
||||
|
||||
TEST_F(ArcFeaturesParserTest, ParseValidJsonWithEmptyFeatureName) {
|
||||
base::Optional<ArcFeatures> arc_features =
|
||||
absl::optional<ArcFeatures> arc_features =
|
||||
ArcFeaturesParser::ParseFeaturesJsonForTesting(
|
||||
kValidJsonFeatureEmptyName);
|
||||
EXPECT_EQ(arc_features, base::nullopt);
|
||||
EXPECT_EQ(arc_features, absl::nullopt);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -24,6 +23,7 @@
|
||||
#include "components/arc/arc_features.h"
|
||||
#include "components/exo/shell_surface_util.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/aura/client/aura_constants.h"
|
||||
#include "ui/aura/window.h"
|
||||
#include "ui/display/types/display_constants.h"
|
||||
@ -64,7 +64,7 @@ void SetArcCpuRestrictionCallback(
|
||||
}
|
||||
|
||||
void OnSetArcVmCpuRestriction(
|
||||
base::Optional<vm_tools::concierge::SetVmCpuRestrictionResponse> response) {
|
||||
absl::optional<vm_tools::concierge::SetVmCpuRestrictionResponse> response) {
|
||||
if (!response) {
|
||||
LOG(ERROR) << "Failed to call SetVmCpuRestriction";
|
||||
return;
|
||||
|
@ -230,7 +230,7 @@ TEST(BluetoothTypeConverterTest, ConvertMojoSequenceAttributeToBlueZAttribute) {
|
||||
sequence_mojo->sequence.push_back(std::move(value_channel));
|
||||
}
|
||||
sequence_mojo->type_size = sequence_mojo->sequence.size();
|
||||
sequence_mojo->value = base::nullopt;
|
||||
sequence_mojo->value = absl::nullopt;
|
||||
|
||||
auto sequence_blue_z =
|
||||
sequence_mojo.To<bluez::BluetoothServiceAttributeValueBlueZ>();
|
||||
@ -264,7 +264,7 @@ TEST(BluetoothTypeConverterTest,
|
||||
auto mojo = arc::mojom::BluetoothSdpAttribute::New();
|
||||
mojo->type = bluez::BluetoothServiceAttributeValueBlueZ::UINT;
|
||||
mojo->type_size = static_cast<uint32_t>(sizeof(uint32_t));
|
||||
mojo->value = base::nullopt;
|
||||
mojo->value = absl::nullopt;
|
||||
|
||||
auto blue_z = mojo.To<bluez::BluetoothServiceAttributeValueBlueZ>();
|
||||
|
||||
@ -280,7 +280,7 @@ TEST(BluetoothTypeConverterTest,
|
||||
auto mojo = arc::mojom::BluetoothSdpAttribute::New();
|
||||
mojo->type = bluez::BluetoothServiceAttributeValueBlueZ::SEQUENCE;
|
||||
mojo->type_size = 0;
|
||||
mojo->value = base::nullopt;
|
||||
mojo->value = absl::nullopt;
|
||||
|
||||
auto blue_z = mojo.To<bluez::BluetoothServiceAttributeValueBlueZ>();
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
#include "ash/resources/vector_icons/vector_icons.h"
|
||||
#include "base/notreached.h"
|
||||
#include "base/optional.h"
|
||||
#include "components/arc/compat_mode/resize_util.h"
|
||||
#include "components/strings/grit/components_strings.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/views/controls/menu/menu_item_view.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
@ -19,7 +19,7 @@ namespace arc {
|
||||
|
||||
namespace {
|
||||
|
||||
base::Optional<ResizeToggleMenu::CommandId> PredictCurrentMode(
|
||||
absl::optional<ResizeToggleMenu::CommandId> PredictCurrentMode(
|
||||
views::Widget* widget) {
|
||||
const int width = widget->GetWindowBoundsInScreen().width();
|
||||
const int height = widget->GetWindowBoundsInScreen().height();
|
||||
@ -32,7 +32,7 @@ base::Optional<ResizeToggleMenu::CommandId> PredictCurrentMode(
|
||||
return ResizeToggleMenu::CommandId::kResizePhone;
|
||||
else if (width > height)
|
||||
return ResizeToggleMenu::CommandId::kResizeTablet;
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -49,7 +49,7 @@ bool RunCrashReporter(const std::vector<std::string>& args, int stdin_fd) {
|
||||
void RunJavaCrashReporter(const std::string& crash_type,
|
||||
base::ScopedFD pipe,
|
||||
std::vector<std::string> args,
|
||||
base::Optional<base::TimeDelta> uptime) {
|
||||
absl::optional<base::TimeDelta> uptime) {
|
||||
args.push_back("--arc_java_crash=" + crash_type);
|
||||
if (uptime) {
|
||||
args.push_back(
|
||||
@ -138,7 +138,7 @@ ArcCrashCollectorBridge::~ArcCrashCollectorBridge() {
|
||||
void ArcCrashCollectorBridge::DumpCrash(
|
||||
const std::string& type,
|
||||
mojo::ScopedHandle pipe,
|
||||
base::Optional<base::TimeDelta> uptime) {
|
||||
absl::optional<base::TimeDelta> uptime) {
|
||||
base::ThreadPool::PostTask(
|
||||
FROM_HERE, {base::WithBaseSyncPrimitives()},
|
||||
base::BindOnce(&RunJavaCrashReporter, type,
|
||||
@ -172,7 +172,7 @@ void ArcCrashCollectorBridge::SetBuildProperties(
|
||||
const std::string& device,
|
||||
const std::string& board,
|
||||
const std::string& cpu_abi,
|
||||
const base::Optional<std::string>& fingerprint) {
|
||||
const absl::optional<std::string>& fingerprint) {
|
||||
device_ = device;
|
||||
board_ = board;
|
||||
cpu_abi_ = cpu_abi;
|
||||
|
@ -43,7 +43,7 @@ class ArcCrashCollectorBridge
|
||||
// mojom::CrashCollectorHost overrides.
|
||||
void DumpCrash(const std::string& type,
|
||||
mojo::ScopedHandle pipe,
|
||||
base::Optional<base::TimeDelta> uptime) override;
|
||||
absl::optional<base::TimeDelta> uptime) override;
|
||||
void DumpNativeCrash(const std::string& exec_name,
|
||||
int32_t pid,
|
||||
int64_t timestamp,
|
||||
@ -53,7 +53,7 @@ class ArcCrashCollectorBridge
|
||||
const std::string& device,
|
||||
const std::string& board,
|
||||
const std::string& cpu_abi,
|
||||
const base::Optional<std::string>& fingerprint) override;
|
||||
const absl::optional<std::string>& fingerprint) override;
|
||||
|
||||
private:
|
||||
std::vector<std::string> CreateCrashReporterArgs();
|
||||
@ -63,7 +63,7 @@ class ArcCrashCollectorBridge
|
||||
std::string device_;
|
||||
std::string board_;
|
||||
std::string cpu_abi_;
|
||||
base::Optional<std::string> fingerprint_;
|
||||
absl::optional<std::string> fingerprint_;
|
||||
};
|
||||
|
||||
} // namespace arc
|
||||
|
@ -41,9 +41,9 @@ TEST_F(ArcCrashCollectorBridgeTest, ConstructDestruct) {}
|
||||
TEST_F(ArcCrashCollectorBridgeTest, SetBuildProperties) {
|
||||
ASSERT_NE(nullptr, bridge());
|
||||
bridge()->SetBuildProperties("device", "board", "cpu_abi",
|
||||
base::Optional<std::string>());
|
||||
absl::optional<std::string>());
|
||||
bridge()->SetBuildProperties("device", "board", "cpu_abi",
|
||||
base::Optional<std::string>("fingerprint"));
|
||||
absl::optional<std::string>("fingerprint"));
|
||||
}
|
||||
|
||||
// Tests that DumpCrash doesn't crash.
|
||||
@ -51,8 +51,8 @@ TEST_F(ArcCrashCollectorBridgeTest, SetBuildProperties) {
|
||||
TEST_F(ArcCrashCollectorBridgeTest, DumpCrash) {
|
||||
ASSERT_NE(nullptr, bridge());
|
||||
bridge()->SetBuildProperties("device", "board", "cpu_abi",
|
||||
base::Optional<std::string>());
|
||||
bridge()->DumpCrash("type", mojo::ScopedHandle(), base::nullopt);
|
||||
absl::optional<std::string>());
|
||||
bridge()->DumpCrash("type", mojo::ScopedHandle(), absl::nullopt);
|
||||
}
|
||||
|
||||
// Tests that DumpNativeCrash doesn't crash.
|
||||
@ -60,7 +60,7 @@ TEST_F(ArcCrashCollectorBridgeTest, DumpCrash) {
|
||||
TEST_F(ArcCrashCollectorBridgeTest, DumpNativeCrash) {
|
||||
ASSERT_NE(nullptr, bridge());
|
||||
bridge()->SetBuildProperties("device", "board", "cpu_abi",
|
||||
base::Optional<std::string>());
|
||||
absl::optional<std::string>());
|
||||
bridge()->DumpNativeCrash("exec_name", getpid(), /*timestamp=*/42,
|
||||
mojo::ScopedHandle());
|
||||
}
|
||||
@ -70,7 +70,7 @@ TEST_F(ArcCrashCollectorBridgeTest, DumpNativeCrash) {
|
||||
TEST_F(ArcCrashCollectorBridgeTest, DumpKernelCrash) {
|
||||
ASSERT_NE(nullptr, bridge());
|
||||
bridge()->SetBuildProperties("device", "board", "cpu_abi",
|
||||
base::Optional<std::string>());
|
||||
absl::optional<std::string>());
|
||||
bridge()->DumpKernelCrash(mojo::ScopedHandle());
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,11 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/optional.h"
|
||||
#include "chromeos/cryptohome/cryptohome_parameters.h"
|
||||
#include "chromeos/dbus/userdataauth/arc_quota_client.h"
|
||||
#include "components/arc/arc_browser_context_keyed_service_factory_base.h"
|
||||
#include "components/arc/session/arc_bridge_service.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -111,7 +111,7 @@ void ArcDiskQuotaBridge::IsQuotaSupported(IsQuotaSupportedCallback callback) {
|
||||
user_data_auth::GetArcDiskFeaturesRequest(),
|
||||
base::BindOnce(
|
||||
[](IsQuotaSupportedCallback callback,
|
||||
base::Optional<user_data_auth::GetArcDiskFeaturesReply> reply) {
|
||||
absl::optional<user_data_auth::GetArcDiskFeaturesReply> reply) {
|
||||
LOG_IF(ERROR, !reply.has_value())
|
||||
<< "Failed to retrieve result from IsQuotaSupported call.";
|
||||
bool result = false;
|
||||
@ -132,7 +132,7 @@ void ArcDiskQuotaBridge::GetCurrentSpaceForUid(
|
||||
request,
|
||||
base::BindOnce(
|
||||
[](GetCurrentSpaceForUidCallback callback, int uid,
|
||||
base::Optional<user_data_auth::GetCurrentSpaceForArcUidReply>
|
||||
absl::optional<user_data_auth::GetCurrentSpaceForArcUidReply>
|
||||
reply) {
|
||||
LOG_IF(ERROR, !reply.has_value())
|
||||
<< "Failed to retrieve result from "
|
||||
@ -156,7 +156,7 @@ void ArcDiskQuotaBridge::GetCurrentSpaceForGid(
|
||||
request,
|
||||
base::BindOnce(
|
||||
[](GetCurrentSpaceForGidCallback callback, int gid,
|
||||
base::Optional<user_data_auth::GetCurrentSpaceForArcGidReply>
|
||||
absl::optional<user_data_auth::GetCurrentSpaceForArcGidReply>
|
||||
reply) {
|
||||
LOG_IF(ERROR, !reply.has_value())
|
||||
<< "Failed to retrieve result from "
|
||||
@ -180,7 +180,7 @@ void ArcDiskQuotaBridge::GetCurrentSpaceForProjectId(
|
||||
request,
|
||||
base::BindOnce(
|
||||
[](GetCurrentSpaceForProjectIdCallback callback, int project_id,
|
||||
base::Optional<user_data_auth::GetCurrentSpaceForArcProjectIdReply>
|
||||
absl::optional<user_data_auth::GetCurrentSpaceForArcProjectIdReply>
|
||||
reply) {
|
||||
LOG_IF(ERROR, !reply.has_value())
|
||||
<< "Failed to retrieve result from "
|
||||
@ -220,7 +220,7 @@ void ArcDiskQuotaBridge::SetProjectId(uint32_t project_id,
|
||||
[](SetProjectIdCallback callback, const int project_id,
|
||||
const user_data_auth::SetProjectIdAllowedPathType parent_path,
|
||||
const std::string& child_path,
|
||||
base::Optional<user_data_auth::SetProjectIdReply> reply) {
|
||||
absl::optional<user_data_auth::SetProjectIdReply> reply) {
|
||||
LOG_IF(ERROR, !reply.has_value())
|
||||
<< "Failed to set project ID " << project_id
|
||||
<< " to parent_path=" << parent_path
|
||||
|
@ -131,7 +131,7 @@ void SnapshotHoursPolicyService::UpdateTimer() {
|
||||
namespace wtu = ::policy::weekly_time_utils;
|
||||
const base::Time now = base::Time::Now();
|
||||
const bool in_interval = wtu::Contains(now, intervals_);
|
||||
const base::Optional<base::Time> update_time =
|
||||
const absl::optional<base::Time> update_time =
|
||||
wtu::GetNextEventTime(now, intervals_);
|
||||
|
||||
SetEndTime(in_interval ? update_time.value() : base::Time{});
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#include "base/callback_helpers.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/task_environment.h"
|
||||
#include "base/values.h"
|
||||
@ -20,6 +19,7 @@
|
||||
#include "components/user_manager/scoped_user_manager.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 arc {
|
||||
namespace data_snapshotd {
|
||||
@ -183,7 +183,7 @@ class SnapshotHoursPolicyServiceTest
|
||||
|
||||
// Enable feature and check.
|
||||
void EnableSnapshot(int enabled_calls_num = 1) {
|
||||
base::Optional<base::Value> policy = base::JSONReader::Read(kJsonPolicy);
|
||||
absl::optional<base::Value> policy = base::JSONReader::Read(kJsonPolicy);
|
||||
EXPECT_TRUE(policy.has_value());
|
||||
local_state()->Set(arc::prefs::kArcSnapshotHours, policy.value());
|
||||
EnsureSnapshotEnabled(enabled_calls_num);
|
||||
@ -236,7 +236,7 @@ TEST_F(SnapshotHoursPolicyServiceTest, DoubleDisable) {
|
||||
EnableSnapshot();
|
||||
|
||||
{
|
||||
base::Optional<base::Value> policy_value =
|
||||
absl::optional<base::Value> policy_value =
|
||||
base::JSONReader::Read(kJsonPolicyEmptyIntervals);
|
||||
EXPECT_TRUE(policy_value.has_value());
|
||||
local_state()->Set(arc::prefs::kArcSnapshotHours, policy_value.value());
|
||||
@ -246,7 +246,7 @@ TEST_F(SnapshotHoursPolicyServiceTest, DoubleDisable) {
|
||||
|
||||
{
|
||||
// User a different JSON to ensure the policy value is updated.
|
||||
base::Optional<base::Value> policy_value =
|
||||
absl::optional<base::Value> policy_value =
|
||||
base::JSONReader::Read(kJsonPolicyNoIntervals);
|
||||
EXPECT_TRUE(policy_value.has_value());
|
||||
local_state()->Set(arc::prefs::kArcSnapshotHours, policy_value.value());
|
||||
@ -285,7 +285,7 @@ TEST_F(SnapshotHoursPolicyServiceTest, InsideInterval) {
|
||||
|
||||
// Disable snapshots.
|
||||
{
|
||||
base::Optional<base::Value> policy_value =
|
||||
absl::optional<base::Value> policy_value =
|
||||
base::JSONReader::Read(kJsonPolicyNoIntervals);
|
||||
EXPECT_TRUE(policy_value.has_value());
|
||||
local_state()->Set(arc::prefs::kArcSnapshotHours, policy_value.value());
|
||||
@ -330,7 +330,7 @@ TEST_F(SnapshotHoursPolicyServiceTest, DisableByUserPolicyForMGS) {
|
||||
TEST_P(SnapshotHoursPolicyServiceTest, DisabledByPolicy) {
|
||||
EnableSnapshot();
|
||||
|
||||
base::Optional<base::Value> policy_value = base::JSONReader::Read(policy());
|
||||
absl::optional<base::Value> policy_value = base::JSONReader::Read(policy());
|
||||
EXPECT_TRUE(policy_value.has_value());
|
||||
local_state()->Set(arc::prefs::kArcSnapshotHours, policy_value.value());
|
||||
|
||||
|
@ -43,7 +43,7 @@ namespace arc {
|
||||
|
||||
namespace {
|
||||
|
||||
base::Optional<double> g_override_default_device_scale_factor;
|
||||
absl::optional<double> g_override_default_device_scale_factor;
|
||||
|
||||
// Return true when a rich text editing is available on a text field with the
|
||||
// given type.
|
||||
@ -674,11 +674,11 @@ bool ArcImeService::SetAutocorrectRange(const gfx::Range& range) {
|
||||
return false;
|
||||
}
|
||||
|
||||
base::Optional<ui::GrammarFragment> ArcImeService::GetGrammarFragment(
|
||||
absl::optional<ui::GrammarFragment> ArcImeService::GetGrammarFragment(
|
||||
const gfx::Range& range) {
|
||||
// TODO(https://crbug.com/1201454): Implement this method.
|
||||
NOTIMPLEMENTED_LOG_ONCE();
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
bool ArcImeService::ClearGrammarFragments(const gfx::Range& range) {
|
||||
@ -726,7 +726,7 @@ void ArcImeService::OnDispatchingKeyEventPostIME(ui::KeyEvent* event) {
|
||||
|
||||
// static
|
||||
void ArcImeService::SetOverrideDefaultDeviceScaleFactorForTesting(
|
||||
base::Optional<double> scale_factor) {
|
||||
absl::optional<double> scale_factor) {
|
||||
g_override_default_device_scale_factor = scale_factor;
|
||||
}
|
||||
|
||||
|
@ -9,10 +9,10 @@
|
||||
|
||||
#include "ash/public/cpp/keyboard/keyboard_controller_observer.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "components/arc/ime/arc_ime_bridge.h"
|
||||
#include "components/arc/ime/key_event_result_receiver.h"
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/aura/client/focus_change_observer.h"
|
||||
#include "ui/aura/env_observer.h"
|
||||
#include "ui/aura/window_observer.h"
|
||||
@ -155,7 +155,7 @@ class ArcImeService : public KeyedService,
|
||||
gfx::Range GetAutocorrectRange() const override;
|
||||
gfx::Rect GetAutocorrectCharacterBounds() const override;
|
||||
bool SetAutocorrectRange(const gfx::Range& range) override;
|
||||
base::Optional<ui::GrammarFragment> GetGrammarFragment(
|
||||
absl::optional<ui::GrammarFragment> GetGrammarFragment(
|
||||
const gfx::Range& range) override;
|
||||
bool ClearGrammarFragments(const gfx::Range& range) override;
|
||||
bool AddGrammarFragments(
|
||||
@ -165,7 +165,7 @@ class ArcImeService : public KeyedService,
|
||||
// Normally, the default device scale factor is used to convert from DPI to
|
||||
// physical pixels. This method provides a way to override it for testing.
|
||||
static void SetOverrideDefaultDeviceScaleFactorForTesting(
|
||||
base::Optional<double> scale_factor);
|
||||
absl::optional<double> scale_factor);
|
||||
|
||||
private:
|
||||
friend class ArcImeServiceTest;
|
||||
|
@ -240,7 +240,7 @@ class ArcImeServiceTest : public testing::Test {
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
ArcImeService::SetOverrideDefaultDeviceScaleFactorForTesting(base::nullopt);
|
||||
ArcImeService::SetOverrideDefaultDeviceScaleFactorForTesting(absl::nullopt);
|
||||
arc_win_.reset();
|
||||
fake_window_delegate_ = nullptr;
|
||||
fake_arc_ime_bridge_ = nullptr;
|
||||
@ -638,7 +638,7 @@ TEST_F(ArcImeServiceTest, SendKeyEvent) {
|
||||
ui::DomKey::FromCharacter('A'),
|
||||
ui::EventTimeForNow()};
|
||||
{
|
||||
base::Optional<bool> handled;
|
||||
absl::optional<bool> handled;
|
||||
auto copy = std::make_unique<ui::KeyEvent>(event);
|
||||
instance_->SendKeyEvent(
|
||||
std::move(copy),
|
||||
@ -658,7 +658,7 @@ TEST_F(ArcImeServiceTest, SendKeyEvent) {
|
||||
ui::ET_KEY_PRESSED, ui::VKEY_RETURN, ui::DomCode::ENTER, 0,
|
||||
ui::DomKey::UNIDENTIFIED, ui::EventTimeForNow()};
|
||||
{
|
||||
base::Optional<bool> handled;
|
||||
absl::optional<bool> handled;
|
||||
auto copy = std::make_unique<ui::KeyEvent>(non_character_event);
|
||||
instance_->SendKeyEvent(
|
||||
std::move(copy),
|
||||
@ -681,7 +681,7 @@ TEST_F(ArcImeServiceTest, SendKeyEvent) {
|
||||
ui::DomKey::FromCharacter('A'),
|
||||
ui::EventTimeForNow()};
|
||||
{
|
||||
base::Optional<bool> handled;
|
||||
absl::optional<bool> handled;
|
||||
auto copy = std::make_unique<ui::KeyEvent>(fabricated_event);
|
||||
instance_->SendKeyEvent(
|
||||
std::move(copy),
|
||||
|
@ -8,10 +8,10 @@
|
||||
#include "base/callback.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "base/time/time.h"
|
||||
#include "components/arc/ime/arc_ime_util.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/events/base_event_utils.h"
|
||||
#include "ui/events/event.h"
|
||||
#include "ui/events/event_dispatcher.h"
|
||||
@ -109,7 +109,7 @@ void KeyEventResultReceiver::RecordImeLatency() {
|
||||
kImeLatencyHistogramName,
|
||||
base::TimeTicks::Now() - callback_set_time_.value(), kKeyEventLatencyMin,
|
||||
kKeyEventLatencyMax, 50);
|
||||
callback_set_time_ = base::nullopt;
|
||||
callback_set_time_ = absl::nullopt;
|
||||
}
|
||||
|
||||
} // namespace arc
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/base/ime/input_method_delegate.h"
|
||||
|
||||
namespace arc {
|
||||
@ -36,7 +36,7 @@ class KeyEventResultReceiver {
|
||||
void RecordImeLatency();
|
||||
|
||||
KeyEventDoneCallback callback_{};
|
||||
base::Optional<base::TimeTicks> callback_set_time_{};
|
||||
absl::optional<base::TimeTicks> callback_set_time_{};
|
||||
base::WeakPtrFactory<KeyEventResultReceiver> weak_ptr_factory_{this};
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,7 @@ class KeyEventResultReceiverTest : public testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, ExpireCallback) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
@ -52,7 +52,7 @@ TEST_F(KeyEventResultReceiverTest, ExpireCallback) {
|
||||
}
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, EventStoppedPropagation) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
@ -68,7 +68,7 @@ TEST_F(KeyEventResultReceiverTest, EventStoppedPropagation) {
|
||||
}
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, EventConsumedByIME) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
@ -85,7 +85,7 @@ TEST_F(KeyEventResultReceiverTest, EventConsumedByIME) {
|
||||
}
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, EventNotCharacter) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
@ -103,7 +103,7 @@ TEST_F(KeyEventResultReceiverTest, EventNotCharacter) {
|
||||
}
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, UnmodifiedEnterAndBackspace) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
@ -135,7 +135,7 @@ TEST_F(KeyEventResultReceiverTest, UnmodifiedEnterAndBackspace) {
|
||||
}
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, ControlCharacters) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
@ -151,7 +151,7 @@ TEST_F(KeyEventResultReceiverTest, ControlCharacters) {
|
||||
}
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, EventWithSystemModifier) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
@ -167,7 +167,7 @@ TEST_F(KeyEventResultReceiverTest, EventWithSystemModifier) {
|
||||
}
|
||||
|
||||
TEST_F(KeyEventResultReceiverTest, NormalCharacters) {
|
||||
base::Optional<bool> result;
|
||||
absl::optional<bool> result;
|
||||
auto callback =
|
||||
base::BindLambdaForTesting([&result](bool res) { result = res; });
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/values.h"
|
||||
@ -25,6 +24,7 @@
|
||||
#include "components/arc/intent_helper/open_url_delegate.h"
|
||||
#include "components/arc/session/arc_bridge_service.h"
|
||||
#include "components/url_formatter/url_fixer.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/base/layout.h"
|
||||
#include "url/url_constants.h"
|
||||
|
||||
@ -149,7 +149,7 @@ void ArcIntentHelperBridge::OnIntentFiltersUpdated(
|
||||
intent_filters_[filter.package_name()].push_back(std::move(filter));
|
||||
|
||||
for (auto& observer : observer_list_)
|
||||
observer.OnIntentFiltersUpdated(base::nullopt);
|
||||
observer.OnIntentFiltersUpdated(absl::nullopt);
|
||||
}
|
||||
|
||||
void ArcIntentHelperBridge::OnOpenDownloads() {
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/optional.h"
|
||||
#include "components/arc/intent_helper/open_url_delegate.h"
|
||||
#include "components/arc/mojom/intent_helper.mojom.h"
|
||||
#include "components/arc/session/arc_bridge_service.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 arc {
|
||||
|
||||
@ -189,7 +189,7 @@ TEST_F(ArcIntentHelperTest, TestObserver) {
|
||||
(override));
|
||||
MOCK_METHOD(void,
|
||||
OnIntentFiltersUpdated,
|
||||
(const base::Optional<std::string>& package_name),
|
||||
(const absl::optional<std::string>& package_name),
|
||||
(override));
|
||||
MOCK_METHOD(void, OnPreferredAppsChanged, (), (override));
|
||||
};
|
||||
@ -220,7 +220,7 @@ TEST_F(ArcIntentHelperTest, TestObserver) {
|
||||
|
||||
{
|
||||
// Observer should be called when an intent filter is updated.
|
||||
EXPECT_CALL(observer, OnIntentFiltersUpdated(testing::Eq(base::nullopt)));
|
||||
EXPECT_CALL(observer, OnIntentFiltersUpdated(testing::Eq(absl::nullopt)));
|
||||
instance_->OnIntentFiltersUpdated(/*filters=*/std::vector<IntentFilter>());
|
||||
testing::Mock::VerifyAndClearExpectations(&observer);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace base {
|
||||
class FilePath;
|
||||
@ -27,11 +27,11 @@ class ArcIntentHelperObserver {
|
||||
virtual void OnArcDownloadAdded(const base::FilePath& relative_path,
|
||||
const std::string& owner_package_name) {}
|
||||
// Called when intent filters are added, removed or updated.
|
||||
// A base::nullopt |package_name| indicates that intent filters were updated
|
||||
// A absl::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(
|
||||
const base::Optional<std::string>& package_name) {}
|
||||
const absl::optional<std::string>& package_name) {}
|
||||
// Called when the preferred apps changed in ARC.
|
||||
virtual void OnPreferredAppsChanged() {}
|
||||
};
|
||||
|
@ -8,8 +8,8 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace mojo {
|
||||
|
||||
@ -24,7 +24,7 @@ bool StructTraits<arc::mojom::IntentFilterDataView, arc::IntentFilter>::Read(
|
||||
if (!data.ReadDataPaths(&paths))
|
||||
return false;
|
||||
|
||||
base::Optional<std::string> package_name;
|
||||
absl::optional<std::string> package_name;
|
||||
if (!data.ReadPackageName(&package_name))
|
||||
return false;
|
||||
|
||||
@ -40,11 +40,11 @@ bool StructTraits<arc::mojom::IntentFilterDataView, arc::IntentFilter>::Read(
|
||||
if (!data.ReadMimeTypes(&mime_types))
|
||||
return false;
|
||||
|
||||
base::Optional<std::string> activity_name;
|
||||
absl::optional<std::string> activity_name;
|
||||
if (!data.ReadActivityName(&activity_name))
|
||||
return false;
|
||||
|
||||
base::Optional<std::string> activity_label;
|
||||
absl::optional<std::string> activity_label;
|
||||
if (!data.ReadActivityLabel(&activity_label))
|
||||
return false;
|
||||
|
||||
|
@ -57,7 +57,7 @@ TEST_F(ArcLockScreenBridgeTest, ConstructDestruct) {
|
||||
}
|
||||
|
||||
TEST_F(ArcLockScreenBridgeTest, OnConnectionReady) {
|
||||
const base::Optional<bool>& is_locked = lock_screen_instance()->is_locked();
|
||||
const absl::optional<bool>& is_locked = lock_screen_instance()->is_locked();
|
||||
// The state should have been set already. See SetUp().
|
||||
ASSERT_TRUE(is_locked);
|
||||
// And the state should be "not locked";
|
||||
@ -65,7 +65,7 @@ TEST_F(ArcLockScreenBridgeTest, OnConnectionReady) {
|
||||
}
|
||||
|
||||
TEST_F(ArcLockScreenBridgeTest, OnSessionStateChanged) {
|
||||
const base::Optional<bool>& is_locked = lock_screen_instance()->is_locked();
|
||||
const absl::optional<bool>& is_locked = lock_screen_instance()->is_locked();
|
||||
// The state should have been set already. See SetUp().
|
||||
ASSERT_TRUE(is_locked);
|
||||
// Lock the screen and check the instance state.
|
||||
|
@ -236,7 +236,7 @@ void ArcMetricsService::ParseProcessList(
|
||||
void ArcMetricsService::OnArcStartTimeRetrieved(
|
||||
std::vector<mojom::BootProgressEventPtr> events,
|
||||
mojom::BootType boot_type,
|
||||
base::Optional<base::TimeTicks> arc_start_time) {
|
||||
absl::optional<base::TimeTicks> arc_start_time) {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
if (!arc_start_time.has_value()) {
|
||||
LOG(ERROR) << "Failed to retrieve ARC start timeticks.";
|
||||
@ -277,7 +277,7 @@ void ArcMetricsService::ReportBootProgress(
|
||||
// For VM builds, do not call into session_manager since we don't use it
|
||||
// for the builds. The upgrade time is included in the events vector so we
|
||||
// can extract it here.
|
||||
base::Optional<base::TimeTicks> arc_start_time =
|
||||
absl::optional<base::TimeTicks> arc_start_time =
|
||||
GetArcStartTimeFromEvents(events);
|
||||
OnArcStartTimeRetrieved(std::move(events), boot_type, arc_start_time);
|
||||
return;
|
||||
@ -362,7 +362,7 @@ void ArcMetricsService::ReportArcCorePriAbiMigDowngradeDelay(
|
||||
|
||||
void ArcMetricsService::OnArcStartTimeForPriAbiMigration(
|
||||
base::TimeTicks durationTicks,
|
||||
base::Optional<base::TimeTicks> arc_start_time) {
|
||||
absl::optional<base::TimeTicks> arc_start_time) {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
if (!arc_start_time.has_value()) {
|
||||
LOG(ERROR) << "Failed to retrieve ARC start timeticks.";
|
||||
@ -472,7 +472,7 @@ void ArcMetricsService::RemoveUserInteractionObserver(
|
||||
user_interaction_observers_.RemoveObserver(obs);
|
||||
}
|
||||
|
||||
base::Optional<base::TimeTicks> ArcMetricsService::GetArcStartTimeFromEvents(
|
||||
absl::optional<base::TimeTicks> ArcMetricsService::GetArcStartTimeFromEvents(
|
||||
std::vector<mojom::BootProgressEventPtr>& events) {
|
||||
mojom::BootProgressEventPtr arc_upgraded_event;
|
||||
for (auto it = events.begin(); it != events.end(); ++it) {
|
||||
@ -484,7 +484,7 @@ base::Optional<base::TimeTicks> ArcMetricsService::GetArcStartTimeFromEvents(
|
||||
base::TimeTicks();
|
||||
}
|
||||
}
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
ArcMetricsService::ProcessObserver::ProcessObserver(
|
||||
ArcMetricsService* arc_metrics_service)
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/observer_list_types.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/timer/timer.h"
|
||||
@ -26,6 +25,7 @@
|
||||
#include "components/arc/session/connection_observer.h"
|
||||
#include "components/guest_os/guest_os_engagement_metrics.h"
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/events/ozone/gamepad/gamepad_observer.h"
|
||||
#include "ui/wm/public/activation_change_observer.h"
|
||||
|
||||
@ -136,9 +136,9 @@ class ArcMetricsService : public KeyedService,
|
||||
|
||||
// Finds the boot_progress_arc_upgraded event, removes it from |events|, and
|
||||
// returns the event time. If the boot_progress_arc_upgraded event is not
|
||||
// found, base::nullopt is returned. This function is public for testing
|
||||
// found, absl::nullopt is returned. This function is public for testing
|
||||
// purposes.
|
||||
base::Optional<base::TimeTicks> GetArcStartTimeFromEvents(
|
||||
absl::optional<base::TimeTicks> GetArcStartTimeFromEvents(
|
||||
std::vector<mojom::BootProgressEventPtr>& events);
|
||||
|
||||
private:
|
||||
@ -215,10 +215,10 @@ class ArcMetricsService : public KeyedService,
|
||||
// DBus callbacks.
|
||||
void OnArcStartTimeRetrieved(std::vector<mojom::BootProgressEventPtr> events,
|
||||
mojom::BootType boot_type,
|
||||
base::Optional<base::TimeTicks> arc_start_time);
|
||||
absl::optional<base::TimeTicks> arc_start_time);
|
||||
void OnArcStartTimeForPriAbiMigration(
|
||||
base::TimeTicks durationTicks,
|
||||
base::Optional<base::TimeTicks> arc_start_time);
|
||||
absl::optional<base::TimeTicks> arc_start_time);
|
||||
|
||||
// Notify AppKillObservers.
|
||||
void NotifyLowMemoryKill();
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#include "ash/public/cpp/app_types.h"
|
||||
#include "base/metrics/histogram_samples.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/test/metrics/histogram_tester.h"
|
||||
@ -26,6 +25,7 @@
|
||||
#include "components/session_manager/core/session_manager.h"
|
||||
#include "content/public/test/browser_task_environment.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/aura/client/aura_constants.h"
|
||||
#include "ui/aura/test/test_windows.h"
|
||||
#include "ui/aura/window.h"
|
||||
@ -342,7 +342,7 @@ TEST_F(ArcMetricsServiceTest, GetArcStartTimeFromEvents) {
|
||||
events.emplace_back(
|
||||
mojom::BootProgressEvent::New(kBootProgressArcUpgraded, kArcStartTimeMs));
|
||||
|
||||
base::Optional<base::TimeTicks> arc_start_time =
|
||||
absl::optional<base::TimeTicks> arc_start_time =
|
||||
service()->GetArcStartTimeFromEvents(events);
|
||||
EXPECT_TRUE(arc_start_time.has_value());
|
||||
EXPECT_EQ(*arc_start_time,
|
||||
@ -360,7 +360,7 @@ TEST_F(ArcMetricsServiceTest, GetArcStartTimeFromEvents_NoArcUpgradedEvent) {
|
||||
std::vector<mojom::BootProgressEventPtr> events(
|
||||
GetBootProgressEvents(kArcStartTimeMs, 1 /* step_in_ms */));
|
||||
|
||||
base::Optional<base::TimeTicks> arc_start_time =
|
||||
absl::optional<base::TimeTicks> arc_start_time =
|
||||
service()->GetArcStartTimeFromEvents(events);
|
||||
EXPECT_FALSE(arc_start_time.has_value());
|
||||
}
|
||||
@ -371,7 +371,7 @@ TEST_F(ArcMetricsServiceTest, UserInteractionObserver) {
|
||||
void OnUserInteraction(UserInteractionType type) override {
|
||||
this->type = type;
|
||||
}
|
||||
base::Optional<UserInteractionType> type;
|
||||
absl::optional<UserInteractionType> type;
|
||||
} observer;
|
||||
|
||||
service()->AddUserInteractionObserver(&observer);
|
||||
|
@ -55,11 +55,11 @@ void StabilityMetricsManager::RecordMetricsToUMA() {
|
||||
return;
|
||||
}
|
||||
|
||||
const base::Optional<bool> enabled_state = GetArcEnabledState();
|
||||
const absl::optional<bool> enabled_state = GetArcEnabledState();
|
||||
if (enabled_state)
|
||||
UMA_STABILITY_HISTOGRAM_ENUMERATION("Arc.State", *enabled_state ? 1 : 0, 2);
|
||||
|
||||
const base::Optional<NativeBridgeType> native_bridge_type =
|
||||
const absl::optional<NativeBridgeType> native_bridge_type =
|
||||
GetArcNativeBridgeType();
|
||||
if (native_bridge_type) {
|
||||
UMA_STABILITY_HISTOGRAM_ENUMERATION(
|
||||
@ -74,7 +74,7 @@ void StabilityMetricsManager::ResetMetrics() {
|
||||
update->Clear();
|
||||
}
|
||||
|
||||
base::Optional<bool> StabilityMetricsManager::GetArcEnabledState() {
|
||||
absl::optional<bool> StabilityMetricsManager::GetArcEnabledState() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
const base::DictionaryValue* dict =
|
||||
local_state_->GetDictionary(prefs::kStabilityMetrics);
|
||||
@ -87,18 +87,18 @@ void StabilityMetricsManager::SetArcEnabledState(bool enabled) {
|
||||
update->SetKey(kArcEnabledStateKey, base::Value(enabled));
|
||||
}
|
||||
|
||||
base::Optional<NativeBridgeType>
|
||||
absl::optional<NativeBridgeType>
|
||||
StabilityMetricsManager::GetArcNativeBridgeType() {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
const base::DictionaryValue* dict =
|
||||
local_state_->GetDictionary(prefs::kStabilityMetrics);
|
||||
base::Optional<int> native_bridge_type =
|
||||
absl::optional<int> native_bridge_type =
|
||||
dict->FindIntKey(kArcNativeBridgeTypeKey);
|
||||
if (native_bridge_type) {
|
||||
return base::make_optional(
|
||||
return absl::make_optional(
|
||||
static_cast<NativeBridgeType>(*native_bridge_type));
|
||||
}
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
void StabilityMetricsManager::SetArcNativeBridgeType(
|
||||
|
@ -5,9 +5,9 @@
|
||||
#ifndef COMPONENTS_ARC_METRICS_STABILITY_METRICS_MANAGER_H_
|
||||
#define COMPONENTS_ARC_METRICS_STABILITY_METRICS_MANAGER_H_
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "base/sequence_checker.h"
|
||||
#include "components/arc/metrics/arc_metrics_constants.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class PrefService;
|
||||
|
||||
@ -37,13 +37,13 @@ class StabilityMetricsManager {
|
||||
void ResetMetrics();
|
||||
|
||||
// Returns current persisted value (if exists) for Arc.State UMA histogram.
|
||||
base::Optional<bool> GetArcEnabledState();
|
||||
absl::optional<bool> GetArcEnabledState();
|
||||
|
||||
// Sets value for Arc.State UMA histogram.
|
||||
void SetArcEnabledState(bool enabled);
|
||||
|
||||
// Returns current persisted value (if exists) for Arc.State UMA histogram.
|
||||
base::Optional<NativeBridgeType> GetArcNativeBridgeType();
|
||||
absl::optional<NativeBridgeType> GetArcNativeBridgeType();
|
||||
|
||||
// Sets value for Arc.NativeBridgeType UMA histogram.
|
||||
void SetArcNativeBridgeType(NativeBridgeType native_bridge_type);
|
||||
|
@ -216,7 +216,7 @@ bool StructTraits<arc::mojom::VideoFrameLayoutDataView,
|
||||
return false;
|
||||
}
|
||||
|
||||
base::Optional<media::VideoFrameLayout> layout =
|
||||
absl::optional<media::VideoFrameLayout> layout =
|
||||
media::VideoFrameLayout::CreateWithPlanes(
|
||||
format, coded_size, std::move(planes), data.buffer_addr_align(),
|
||||
data.modifier());
|
||||
|
@ -31,7 +31,7 @@ TEST(VideoAcceleratorStructTraitsTest, ConvertVideoFrameLayout) {
|
||||
constexpr size_t buffer_addr_align = 128;
|
||||
constexpr uint64_t modifier = 0x1234;
|
||||
|
||||
base::Optional<media::VideoFrameLayout> layout =
|
||||
absl::optional<media::VideoFrameLayout> layout =
|
||||
media::VideoFrameLayout::CreateWithPlanes(kFormat, kCodedSize, planes,
|
||||
buffer_addr_align, modifier);
|
||||
EXPECT_TRUE(layout);
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include "components/arc/mojom/video_encode_accelerator_mojom_traits.h"
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "components/arc/mojom/video_accelerator_mojom_traits.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace mojo {
|
||||
|
||||
@ -83,12 +83,12 @@ bool StructTraits<arc::mojom::VideoEncodeAcceleratorConfigDataView,
|
||||
if (!input.ReadOutputProfile(&output_profile))
|
||||
return false;
|
||||
|
||||
base::Optional<uint32_t> initial_framerate;
|
||||
absl::optional<uint32_t> initial_framerate;
|
||||
if (input.has_initial_framerate()) {
|
||||
initial_framerate = input.initial_framerate();
|
||||
}
|
||||
|
||||
base::Optional<uint8_t> h264_output_level;
|
||||
absl::optional<uint8_t> h264_output_level;
|
||||
if (input.has_h264_output_level()) {
|
||||
h264_output_level = input.h264_output_level();
|
||||
}
|
||||
@ -99,7 +99,7 @@ bool StructTraits<arc::mojom::VideoEncodeAcceleratorConfigDataView,
|
||||
|
||||
*output = media::VideoEncodeAccelerator::Config(
|
||||
input_format, input_visible_size, output_profile, input.initial_bitrate(),
|
||||
initial_framerate, base::nullopt, h264_output_level, false, storage_type);
|
||||
initial_framerate, absl::nullopt, h264_output_level, false, storage_type);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ const base::Value kVpnPackageValue(kVpnPackage);
|
||||
void OnGetProperties(bool* success_out,
|
||||
std::string* package_name_out,
|
||||
base::OnceClosure callback,
|
||||
base::Optional<base::Value> result) {
|
||||
absl::optional<base::Value> result) {
|
||||
*success_out = result.has_value();
|
||||
if (result) {
|
||||
const base::Value* value = result->FindKeyOfType(
|
||||
|
@ -872,7 +872,7 @@ void ArcNetHostImpl::NetworkPropertiesUpdated(
|
||||
|
||||
void ArcNetHostImpl::ReceiveShillProperties(
|
||||
const std::string& service_path,
|
||||
base::Optional<base::Value> shill_properties) {
|
||||
absl::optional<base::Value> shill_properties) {
|
||||
if (!shill_properties) {
|
||||
LOG(ERROR) << "Failed to get shill Service properties for " << service_path;
|
||||
return;
|
||||
|
@ -151,7 +151,7 @@ class ArcNetHostImpl : public KeyedService,
|
||||
|
||||
// Callback for chromeos::NetworkHandler::GetShillProperties
|
||||
void ReceiveShillProperties(const std::string& service_path,
|
||||
base::Optional<base::Value> shill_properties);
|
||||
absl::optional<base::Value> shill_properties);
|
||||
|
||||
ArcBridgeService* const arc_bridge_service_; // Owned by ArcServiceManager.
|
||||
|
||||
|
@ -211,7 +211,7 @@ void ArcPowerBridge::OnAndroidSuspendReady(base::UnguessableToken token) {
|
||||
|
||||
void ArcPowerBridge::OnConciergeSuspendVmResponse(
|
||||
base::UnguessableToken token,
|
||||
base::Optional<vm_tools::concierge::SuspendVmResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::SuspendVmResponse> reply) {
|
||||
if (!reply.has_value())
|
||||
LOG(ERROR) << "Failed to suspend arcvm, no reply received.";
|
||||
else if (!reply.value().success())
|
||||
@ -234,7 +234,7 @@ void ArcPowerBridge::SuspendDone(base::TimeDelta sleep_duration) {
|
||||
}
|
||||
|
||||
void ArcPowerBridge::OnConciergeResumeVmResponse(
|
||||
base::Optional<vm_tools::concierge::ResumeVmResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::ResumeVmResponse> reply) {
|
||||
if (!reply.has_value()) {
|
||||
LOG(ERROR) << "Failed to resume arcvm, no reply received.";
|
||||
return;
|
||||
@ -364,7 +364,7 @@ ArcPowerBridge::WakeLockRequestor* ArcPowerBridge::GetWakeLockRequestor(
|
||||
}
|
||||
|
||||
void ArcPowerBridge::OnGetScreenBrightnessPercent(
|
||||
base::Optional<double> percent) {
|
||||
absl::optional<double> percent) {
|
||||
if (!percent.has_value()) {
|
||||
LOG(ERROR)
|
||||
<< "PowerManagerClient::GetScreenBrightnessPercent reports an error";
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/timer/timer.h"
|
||||
#include "chromeos/dbus/concierge/concierge_client.h"
|
||||
#include "chromeos/dbus/power/power_manager_client.h"
|
||||
@ -21,6 +20,7 @@
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "services/device/public/mojom/wake_lock.mojom.h"
|
||||
#include "services/device/public/mojom/wake_lock_provider.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/display/manager/display_configurator.h"
|
||||
|
||||
namespace content {
|
||||
@ -99,7 +99,7 @@ class ArcPowerBridge : public KeyedService,
|
||||
WakeLockRequestor* GetWakeLockRequestor(device::mojom::WakeLockType type);
|
||||
|
||||
// Called on PowerManagerClient::GetScreenBrightnessPercent() completion.
|
||||
void OnGetScreenBrightnessPercent(base::Optional<double> percent);
|
||||
void OnGetScreenBrightnessPercent(absl::optional<double> percent);
|
||||
|
||||
// Called by Android when ready to suspend.
|
||||
void OnAndroidSuspendReady(base::UnguessableToken token);
|
||||
@ -108,12 +108,12 @@ class ArcPowerBridge : public KeyedService,
|
||||
// SuspendVm D-Bus call.
|
||||
void OnConciergeSuspendVmResponse(
|
||||
base::UnguessableToken token,
|
||||
base::Optional<vm_tools::concierge::SuspendVmResponse> reply);
|
||||
absl::optional<vm_tools::concierge::SuspendVmResponse> reply);
|
||||
|
||||
// Called by ConciergeClient when a response has been receive for the
|
||||
// ResumeVm D-Bus call.
|
||||
void OnConciergeResumeVmResponse(
|
||||
base::Optional<vm_tools::concierge::ResumeVmResponse> reply);
|
||||
absl::optional<vm_tools::concierge::ResumeVmResponse> reply);
|
||||
|
||||
// Sends a PowerInstance::UpdateScreenBrightnessSettings mojo call to Android.
|
||||
void UpdateAndroidScreenBrightness(double percent);
|
||||
|
@ -225,7 +225,7 @@ TEST_F(ArcPowerBridgeTest, ScreenBrightness) {
|
||||
}
|
||||
|
||||
TEST_F(ArcPowerBridgeTest, PowerSupplyInfoChanged) {
|
||||
base::Optional<power_manager::PowerSupplyProperties> prop =
|
||||
absl::optional<power_manager::PowerSupplyProperties> prop =
|
||||
power_manager_client()->GetLastStatus();
|
||||
ASSERT_TRUE(prop.has_value());
|
||||
prop->set_battery_state(power_manager::PowerSupplyProperties::FULL);
|
||||
|
@ -31,10 +31,10 @@ class FakePropertyInstance : public mojom::PropertyInstance {
|
||||
minimize_on_back_ = enable;
|
||||
}
|
||||
|
||||
base::Optional<bool> minimize_on_back() const { return minimize_on_back_; }
|
||||
absl::optional<bool> minimize_on_back() const { return minimize_on_back_; }
|
||||
|
||||
private:
|
||||
base::Optional<bool> minimize_on_back_;
|
||||
absl::optional<bool> minimize_on_back_;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
@ -76,7 +76,7 @@ class ArcPropertyBridgeTest : public testing::Test {
|
||||
instance_ = nullptr;
|
||||
}
|
||||
|
||||
base::Optional<bool> GetMinimizeOnBackState() const {
|
||||
absl::optional<bool> GetMinimizeOnBackState() const {
|
||||
return instance_->minimize_on_back();
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ void ArcIioSensorBridge::SetIsTabletModeOn(bool is_tablet_mode_on) {
|
||||
}
|
||||
|
||||
void ArcIioSensorBridge::OnGetSwitchStates(
|
||||
base::Optional<chromeos::PowerManagerClient::SwitchStates> states) {
|
||||
absl::optional<chromeos::PowerManagerClient::SwitchStates> states) {
|
||||
if (states.has_value()) {
|
||||
SetIsTabletModeOn(states->tablet_mode ==
|
||||
chromeos::PowerManagerClient::TabletMode::ON);
|
||||
|
@ -6,11 +6,11 @@
|
||||
#define COMPONENTS_ARC_SENSOR_ARC_IIO_SENSOR_BRIDGE_H_
|
||||
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/optional.h"
|
||||
#include "chromeos/dbus/power/power_manager_client.h"
|
||||
#include "components/arc/mojom/iio_sensor.mojom.h"
|
||||
#include "components/arc/session/connection_observer.h"
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace content {
|
||||
class BrowserContext;
|
||||
@ -58,10 +58,10 @@ class ArcIioSensorBridge : public KeyedService,
|
||||
|
||||
// Called with PowerManagerClient::GetSwitchStates() result.
|
||||
void OnGetSwitchStates(
|
||||
base::Optional<chromeos::PowerManagerClient::SwitchStates> states);
|
||||
absl::optional<chromeos::PowerManagerClient::SwitchStates> states);
|
||||
|
||||
ArcBridgeService* const arc_bridge_service_; // Owned by ArcServiceManager.
|
||||
base::Optional<bool> is_tablet_mode_on_;
|
||||
absl::optional<bool> is_tablet_mode_on_;
|
||||
|
||||
base::WeakPtrFactory<ArcIioSensorBridge> weak_ptr_factory_{this};
|
||||
};
|
||||
|
@ -41,7 +41,7 @@ void ArcDataRemover::Run(RunCallback callback) {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
if (!pref_.GetValue()) {
|
||||
VLOG(1) << "Data removal is not scheduled, skip.";
|
||||
std::move(callback).Run(base::nullopt);
|
||||
std::move(callback).Run(absl::nullopt);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ void ArcDataRemover::Run(RunCallback callback) {
|
||||
auto* upstart_client = chromeos::UpstartClient::Get();
|
||||
if (!upstart_client) {
|
||||
// May be null in tests
|
||||
std::move(callback).Run(base::nullopt);
|
||||
std::move(callback).Run(absl::nullopt);
|
||||
return;
|
||||
}
|
||||
const std::string account_id =
|
||||
|
@ -8,10 +8,10 @@
|
||||
#include "base/callback.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "chromeos/cryptohome/cryptohome_parameters.h"
|
||||
#include "components/prefs/pref_member.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class PrefService;
|
||||
|
||||
@ -34,7 +34,7 @@ class ArcDataRemover {
|
||||
// Executes the removing, if scheduled.
|
||||
// This must run while ARC instance is stopped.
|
||||
// If not scheduled, |callback| will be synchronously called with nullopt.
|
||||
using RunCallback = base::OnceCallback<void(base::Optional<bool> result)>;
|
||||
using RunCallback = base::OnceCallback<void(absl::optional<bool> result)>;
|
||||
void Run(RunCallback callback);
|
||||
|
||||
private:
|
||||
|
@ -83,8 +83,8 @@ TEST_F(ArcDataRemoverTest, NotScheduled) {
|
||||
|
||||
base::RunLoop loop;
|
||||
data_remover.Run(base::BindOnce(
|
||||
[](base::RunLoop* loop, base::Optional<bool> result) {
|
||||
EXPECT_EQ(result, base::nullopt);
|
||||
[](base::RunLoop* loop, absl::optional<bool> result) {
|
||||
EXPECT_EQ(result, absl::nullopt);
|
||||
loop->Quit();
|
||||
},
|
||||
&loop));
|
||||
@ -99,8 +99,8 @@ TEST_F(ArcDataRemoverTest, Success) {
|
||||
|
||||
base::RunLoop loop;
|
||||
data_remover.Run(base::BindOnce(
|
||||
[](base::RunLoop* loop, base::Optional<bool> result) {
|
||||
EXPECT_EQ(result, base::make_optional(true));
|
||||
[](base::RunLoop* loop, absl::optional<bool> result) {
|
||||
EXPECT_EQ(result, absl::make_optional(true));
|
||||
loop->Quit();
|
||||
},
|
||||
&loop));
|
||||
@ -113,8 +113,8 @@ TEST_F(ArcDataRemoverTest, Fail) {
|
||||
|
||||
base::RunLoop loop;
|
||||
data_remover.Run(base::BindOnce(
|
||||
[](base::RunLoop* loop, base::Optional<bool> result) {
|
||||
EXPECT_EQ(result, base::make_optional(false));
|
||||
[](base::RunLoop* loop, absl::optional<bool> result) {
|
||||
EXPECT_EQ(result, absl::make_optional(false));
|
||||
loop->Quit();
|
||||
},
|
||||
&loop));
|
||||
|
@ -35,7 +35,7 @@ std::ostream& operator<<(std::ostream& os, ArcInstanceMode mode) {
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
base::Optional<ArcInstanceMode> mode) {
|
||||
absl::optional<ArcInstanceMode> mode) {
|
||||
return os << (mode.has_value() ? ArcInstanceModeToString(mode.value())
|
||||
: "(nullopt)");
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <ostream>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -23,7 +23,7 @@ enum class ArcInstanceMode {
|
||||
// Stringified output for logging purpose.
|
||||
std::ostream& operator<<(std::ostream& os, ArcInstanceMode mode);
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
base::Optional<ArcInstanceMode> mode);
|
||||
absl::optional<ArcInstanceMode> mode);
|
||||
|
||||
} // namespace arc
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
namespace {
|
||||
@ -28,14 +28,14 @@ TEST(ArcInstanceModeTest, TestLogging) {
|
||||
EXPECT_TRUE(invalid.str().empty()) << invalid.str();
|
||||
}
|
||||
|
||||
// Test that base::Optional<ArcInstanceMode> can be logged too.
|
||||
// Test that absl::optional<ArcInstanceMode> can be logged too.
|
||||
TEST(ArcInstanceModeTest, TestLoggingWithOptional) {
|
||||
std::ostringstream nullopt;
|
||||
nullopt << base::Optional<ArcInstanceMode>();
|
||||
nullopt << absl::optional<ArcInstanceMode>();
|
||||
EXPECT_FALSE(nullopt.str().empty());
|
||||
|
||||
std::ostringstream non_nullopt;
|
||||
non_nullopt << base::Optional<ArcInstanceMode>(
|
||||
non_nullopt << absl::optional<ArcInstanceMode>(
|
||||
ArcInstanceMode::MINI_INSTANCE);
|
||||
EXPECT_FALSE(non_nullopt.str().empty());
|
||||
EXPECT_NE(nullopt.str(), non_nullopt.str());
|
||||
|
@ -14,11 +14,11 @@
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "chromeos/system/scheduler_configuration_manager_base.h"
|
||||
#include "components/arc/session/arc_client_adapter.h"
|
||||
#include "components/arc/session/arc_session.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace ash {
|
||||
class DefaultScaleFactorRetriever;
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/location.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/process/process_metrics.h"
|
||||
#include "base/run_loop.h"
|
||||
@ -31,6 +30,7 @@
|
||||
#include "components/arc/test/fake_arc_bridge_host.h"
|
||||
#include "components/version_info/channel.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace cryptohome {
|
||||
class Identification;
|
||||
@ -235,7 +235,7 @@ class TestArcSessionObserver : public ArcSession::Observer {
|
||||
|
||||
~TestArcSessionObserver() override { arc_session_->RemoveObserver(this); }
|
||||
|
||||
const base::Optional<OnSessionStoppedArgs>& on_session_stopped_args() const {
|
||||
const absl::optional<OnSessionStoppedArgs>& on_session_stopped_args() const {
|
||||
return on_session_stopped_args_;
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ class TestArcSessionObserver : public ArcSession::Observer {
|
||||
private:
|
||||
ArcSession* const arc_session_; // Not owned.
|
||||
base::RunLoop* const run_loop_ = nullptr; // Not owned.
|
||||
base::Optional<OnSessionStoppedArgs> on_session_stopped_args_;
|
||||
absl::optional<OnSessionStoppedArgs> on_session_stopped_args_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TestArcSessionObserver);
|
||||
};
|
||||
@ -279,12 +279,12 @@ class FakeSchedulerConfigurationManager
|
||||
obs.OnConfigurationSet(reply_->first, reply_->second);
|
||||
}
|
||||
|
||||
base::Optional<std::pair<bool, size_t>> GetLastReply() const override {
|
||||
absl::optional<std::pair<bool, size_t>> GetLastReply() const override {
|
||||
return reply_;
|
||||
}
|
||||
|
||||
private:
|
||||
base::Optional<std::pair<bool, size_t>> reply_;
|
||||
absl::optional<std::pair<bool, size_t>> reply_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FakeSchedulerConfigurationManager);
|
||||
};
|
||||
|
@ -9,9 +9,9 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/task_runner.h"
|
||||
#include "components/arc/arc_util.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -32,7 +32,7 @@ void RecordInstanceRestartAfterCrashUma(size_t restart_after_crash_count) {
|
||||
|
||||
// Gets an ArcContainerLifetimeEvent value to record. Returns nullopt when no
|
||||
// UMA recording is needed.
|
||||
base::Optional<ArcContainerLifetimeEvent> GetArcContainerLifetimeEvent(
|
||||
absl::optional<ArcContainerLifetimeEvent> GetArcContainerLifetimeEvent(
|
||||
size_t restart_after_crash_count,
|
||||
ArcStopReason stop_reason,
|
||||
bool was_running) {
|
||||
@ -41,13 +41,13 @@ base::Optional<ArcContainerLifetimeEvent> GetArcContainerLifetimeEvent(
|
||||
// container restart might be recorded. Each CONTAINER_STARTED event can
|
||||
// be paired up to one non-START event.
|
||||
if (restart_after_crash_count)
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
|
||||
switch (stop_reason) {
|
||||
case ArcStopReason::SHUTDOWN:
|
||||
case ArcStopReason::LOW_DISK_SPACE:
|
||||
// We don't record these events.
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
case ArcStopReason::GENERIC_BOOT_FAILURE:
|
||||
return ArcContainerLifetimeEvent::CONTAINER_FAILED_TO_START;
|
||||
case ArcStopReason::CRASH:
|
||||
@ -56,11 +56,11 @@ base::Optional<ArcContainerLifetimeEvent> GetArcContainerLifetimeEvent(
|
||||
}
|
||||
|
||||
NOTREACHED();
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
// Returns true if restart is needed for given conditions.
|
||||
bool IsRestartNeeded(base::Optional<ArcInstanceMode> target_mode,
|
||||
bool IsRestartNeeded(absl::optional<ArcInstanceMode> target_mode,
|
||||
ArcStopReason stop_reason,
|
||||
bool was_running) {
|
||||
if (!target_mode.has_value()) {
|
||||
@ -95,7 +95,7 @@ bool IsRestartNeeded(base::Optional<ArcInstanceMode> target_mode,
|
||||
|
||||
// Returns true if the request to start/upgrade ARC instance is allowed
|
||||
// operation.
|
||||
bool IsRequestAllowed(const base::Optional<ArcInstanceMode>& current_mode,
|
||||
bool IsRequestAllowed(const absl::optional<ArcInstanceMode>& current_mode,
|
||||
ArcInstanceMode request_mode) {
|
||||
if (!current_mode.has_value()) {
|
||||
// This is a request to start a new ARC instance (either mini instance
|
||||
@ -143,7 +143,7 @@ void ArcSessionRunner::ResumeRunner() {
|
||||
resumed_ = true;
|
||||
if (target_mode_) {
|
||||
ArcInstanceMode original_mode = *target_mode_;
|
||||
target_mode_ = base::nullopt;
|
||||
target_mode_ = absl::nullopt;
|
||||
RequestStart(original_mode);
|
||||
}
|
||||
}
|
||||
@ -205,7 +205,7 @@ void ArcSessionRunner::RequestStop() {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
|
||||
VLOG(1) << "Session stop requested";
|
||||
target_mode_ = base::nullopt;
|
||||
target_mode_ = absl::nullopt;
|
||||
|
||||
if (arc_session_) {
|
||||
// If |arc_session_| is running, stop it.
|
||||
@ -226,7 +226,7 @@ void ArcSessionRunner::OnShutdown() {
|
||||
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
|
||||
|
||||
VLOG(1) << "OnShutdown";
|
||||
target_mode_ = base::nullopt;
|
||||
target_mode_ = absl::nullopt;
|
||||
restart_timer_.Stop();
|
||||
if (arc_session_)
|
||||
arc_session_->OnShutdown();
|
||||
@ -318,7 +318,7 @@ void ArcSessionRunner::OnSessionStopped(ArcStopReason stop_reason,
|
||||
arc_session_->RemoveObserver(this);
|
||||
arc_session_.reset();
|
||||
|
||||
const base::Optional<ArcContainerLifetimeEvent> uma_to_record =
|
||||
const absl::optional<ArcContainerLifetimeEvent> uma_to_record =
|
||||
GetArcContainerLifetimeEvent(restart_after_crash_count_, stop_reason,
|
||||
was_running);
|
||||
if (uma_to_record.has_value())
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "base/callback.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/timer/timer.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "components/arc/session/arc_session.h"
|
||||
#include "components/arc/session/arc_stop_reason.h"
|
||||
#include "components/arc/session/arc_upgrade_params.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -146,7 +146,7 @@ class ArcSessionRunner : public ArcSession::Observer {
|
||||
|
||||
// Target ARC instance running mode. If nullopt, it means the ARC instance
|
||||
// should stop eventually.
|
||||
base::Optional<ArcInstanceMode> target_mode_;
|
||||
absl::optional<ArcInstanceMode> target_mode_;
|
||||
|
||||
// Instead of immediately trying to restart the container, give it some time
|
||||
// to finish tearing down in case it is still in the process of stopping.
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
@ -57,6 +56,7 @@
|
||||
#include "components/arc/session/arc_session.h"
|
||||
#include "components/arc/session/file_system_status.h"
|
||||
#include "components/version_info/version_info.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
namespace {
|
||||
@ -95,9 +95,9 @@ constexpr base::TimeDelta kConnectTimeoutLimit =
|
||||
constexpr base::TimeDelta kConnectSleepDurationInitial =
|
||||
base::TimeDelta::FromMilliseconds(100);
|
||||
|
||||
base::Optional<base::TimeDelta> g_connect_timeout_limit_for_testing;
|
||||
base::Optional<base::TimeDelta> g_connect_sleep_duration_initial_for_testing;
|
||||
base::Optional<int> g_boot_notification_server_fd;
|
||||
absl::optional<base::TimeDelta> g_connect_timeout_limit_for_testing;
|
||||
absl::optional<base::TimeDelta> g_connect_sleep_duration_initial_for_testing;
|
||||
absl::optional<int> g_boot_notification_server_fd;
|
||||
|
||||
chromeos::ConciergeClient* GetConciergeClient() {
|
||||
return chromeos::ConciergeClient::Get();
|
||||
@ -643,7 +643,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
}
|
||||
|
||||
void OnGetVmReply(
|
||||
base::Optional<vm_tools::concierge::GetVmInfoResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::GetVmInfoResponse> reply) {
|
||||
vm_tools::concierge::StopVmRequest request;
|
||||
request.set_name(kArcVmName);
|
||||
|
||||
@ -716,7 +716,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
|
||||
void OnExistingMiniVmStopped(
|
||||
chromeos::VoidDBusMethodCallback callback,
|
||||
base::Optional<vm_tools::concierge::StopVmResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::StopVmResponse> reply) {
|
||||
// reply->success() returns true even when there was no VM running.
|
||||
if (!reply.has_value() || !reply->success()) {
|
||||
LOG(ERROR) << "StopVm failed: "
|
||||
@ -788,7 +788,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
|
||||
void OnStartArcVmReply(
|
||||
chromeos::VoidDBusMethodCallback callback,
|
||||
base::Optional<vm_tools::concierge::StartVmResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::StartVmResponse> reply) {
|
||||
if (!reply.has_value()) {
|
||||
LOG(ERROR) << "Failed to start arcvm. Empty response.";
|
||||
std::move(callback).Run(false);
|
||||
@ -811,7 +811,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
void OnExistingFullVmStopped(
|
||||
UpgradeParams params,
|
||||
chromeos::VoidDBusMethodCallback callback,
|
||||
base::Optional<vm_tools::concierge::StopVmResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::StopVmResponse> reply) {
|
||||
// reply->success() returns true even when there was no VM running.
|
||||
if (!reply.has_value() || !reply->success()) {
|
||||
LOG(ERROR) << "StopVm failed: "
|
||||
@ -894,7 +894,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
|
||||
void OnSetVmId(UpgradeParams params,
|
||||
chromeos::VoidDBusMethodCallback callback,
|
||||
base::Optional<vm_tools::concierge::SetVmIdResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::SetVmIdResponse> reply) {
|
||||
if (!reply.has_value()) {
|
||||
LOG(ERROR) << "Failed to set VM ID. Empty response.";
|
||||
StopArcInstanceInternal();
|
||||
@ -971,7 +971,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
}
|
||||
|
||||
void OnStopVmReply(
|
||||
base::Optional<vm_tools::concierge::StopVmResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::StopVmResponse> reply) {
|
||||
// If the reply indicates the D-Bus call is successfully done, do nothing.
|
||||
// Concierge will call OnVmStopped() eventually.
|
||||
if (reply.has_value() && reply.value().success())
|
||||
@ -986,7 +986,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
|
||||
void OnTrimVmMemory(
|
||||
TrimVmMemoryCallback callback,
|
||||
base::Optional<vm_tools::concierge::ReclaimVmMemoryResponse> reply) {
|
||||
absl::optional<vm_tools::concierge::ReclaimVmMemoryResponse> reply) {
|
||||
bool success = false;
|
||||
std::string failure_reason;
|
||||
|
||||
@ -1005,7 +1005,7 @@ class ArcVmClientAdapter : public ArcClientAdapter,
|
||||
std::move(callback).Run(success, failure_reason);
|
||||
}
|
||||
|
||||
base::Optional<bool> is_dev_mode_;
|
||||
absl::optional<bool> is_dev_mode_;
|
||||
// True when the *host* is running on a VM.
|
||||
const bool is_host_on_vm_;
|
||||
// A cryptohome ID of the primary profile.
|
||||
@ -1057,7 +1057,7 @@ void SetArcVmBootNotificationServerAddressForTesting(
|
||||
g_connect_sleep_duration_initial_for_testing = connect_sleep_duration_initial;
|
||||
}
|
||||
|
||||
void SetArcVmBootNotificationServerFdForTesting(base::Optional<int> fd) {
|
||||
void SetArcVmBootNotificationServerFdForTesting(absl::optional<int> fd) {
|
||||
g_boot_notification_server_fd = fd;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ void SetArcVmBootNotificationServerAddressForTesting(
|
||||
base::TimeDelta connect_sleep_duration_initial);
|
||||
|
||||
// Sets the an FD ConnectToArcVmBootNotificationServer() returns for testing.
|
||||
void SetArcVmBootNotificationServerFdForTesting(base::Optional<int> fd);
|
||||
void SetArcVmBootNotificationServerFdForTesting(absl::optional<int> fd);
|
||||
|
||||
// Generates a list of props from |upgrade_params|, each of which takes the form
|
||||
// "prefix.prop_name=value"
|
||||
|
@ -326,7 +326,7 @@ class ArcVmClientAdapterTest : public testing::Test,
|
||||
|
||||
// Reset to the original behavior.
|
||||
RemoveUpstartStartStopJobFailures();
|
||||
SetArcVmBootNotificationServerFdForTesting(base::nullopt);
|
||||
SetArcVmBootNotificationServerFdForTesting(absl::nullopt);
|
||||
|
||||
const std::string abstract_addr(GenerateAbstractAddress());
|
||||
boot_server_ = std::make_unique<TestArcVmBootNotificationServer>();
|
||||
@ -1041,7 +1041,7 @@ TEST_F(ArcVmClientAdapterTest, UpgradeArc_SetVmIdEmptyReply) {
|
||||
StartMiniArc();
|
||||
|
||||
// Inject failure
|
||||
GetTestConciergeClient()->set_set_vm_id_response(base::nullopt);
|
||||
GetTestConciergeClient()->set_set_vm_id_response(absl::nullopt);
|
||||
|
||||
UpgradeArcWithParamsAndStopVmCount(false, {}, /*run_until_stop_vm_count=*/3);
|
||||
ExpectArcStopped(/*stale_full_vm_stopped=*/true);
|
||||
@ -1075,7 +1075,7 @@ TEST_F(ArcVmClientAdapterTest, StartMiniArc_StopExistingVmFailure) {
|
||||
|
||||
TEST_F(ArcVmClientAdapterTest, StartMiniArc_StopExistingVmFailureEmptyReply) {
|
||||
// Inject failure.
|
||||
GetTestConciergeClient()->set_stop_vm_response(base::nullopt);
|
||||
GetTestConciergeClient()->set_stop_vm_response(absl::nullopt);
|
||||
|
||||
StartMiniArcWithParams(false, {});
|
||||
|
||||
@ -1101,7 +1101,7 @@ TEST_F(ArcVmClientAdapterTest, UpgradeArc_StopExistingVmFailureEmptyReply) {
|
||||
StartMiniArc();
|
||||
|
||||
// Inject failure.
|
||||
GetTestConciergeClient()->set_stop_vm_response(base::nullopt);
|
||||
GetTestConciergeClient()->set_stop_vm_response(absl::nullopt);
|
||||
|
||||
UpgradeArcWithParamsAndStopVmCount(false, {}, /*run_until_stop_vm_count=*/3);
|
||||
ExpectArcStopped(/*stale_full_vm_stopped=*/true);
|
||||
@ -1136,7 +1136,7 @@ TEST_F(ArcVmClientAdapterTest, StartMiniArc_StartArcVmFailure) {
|
||||
TEST_F(ArcVmClientAdapterTest, StartMiniArc_StartArcVmFailureEmptyReply) {
|
||||
SetValidUserInfo();
|
||||
// Inject failure to StartArcVm(). This emulates D-Bus timeout situations.
|
||||
GetTestConciergeClient()->set_start_vm_response(base::nullopt);
|
||||
GetTestConciergeClient()->set_start_vm_response(absl::nullopt);
|
||||
|
||||
StartMiniArcWithParams(false, {});
|
||||
|
||||
|
@ -78,7 +78,7 @@ void FakeAppInstance::Init(mojo::PendingRemote<mojom::AppHost> host_remote,
|
||||
void FakeAppInstance::LaunchAppDeprecated(
|
||||
const std::string& package_name,
|
||||
const std::string& activity,
|
||||
const base::Optional<gfx::Rect>& dimension) {
|
||||
const absl::optional<gfx::Rect>& dimension) {
|
||||
LaunchApp(package_name, activity, 0);
|
||||
}
|
||||
|
||||
@ -558,7 +558,7 @@ void FakeAppInstance::IsInstallable(const std::string& package_name,
|
||||
|
||||
void FakeAppInstance::LaunchIntentDeprecated(
|
||||
const std::string& intent_uri,
|
||||
const base::Optional<gfx::Rect>& dimension_on_screen) {
|
||||
const absl::optional<gfx::Rect>& dimension_on_screen) {
|
||||
LaunchIntent(intent_uri, 0);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ class FakeAppInstance : public mojom::AppInstance {
|
||||
InitCallback callback) override;
|
||||
void LaunchAppDeprecated(const std::string& package_name,
|
||||
const std::string& activity,
|
||||
const base::Optional<gfx::Rect>& dimension) override;
|
||||
const absl::optional<gfx::Rect>& dimension) override;
|
||||
void LaunchApp(const std::string& package_name,
|
||||
const std::string& activity,
|
||||
int64_t display_id) override;
|
||||
@ -114,7 +114,7 @@ class FakeAppInstance : public mojom::AppInstance {
|
||||
GetAppIconCallback callback) override;
|
||||
void LaunchIntentDeprecated(
|
||||
const std::string& intent_uri,
|
||||
const base::Optional<gfx::Rect>& dimension_on_screen) override;
|
||||
const absl::optional<gfx::Rect>& dimension_on_screen) override;
|
||||
void LaunchIntent(const std::string& intent_uri, int64_t display_id) override;
|
||||
void LaunchIntentWithWindowInfo(
|
||||
const std::string& intent_uri,
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "components/arc/mojom/cast_receiver.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -33,12 +33,12 @@ class FakeCastReceiverInstance : public mojom::CastReceiverInstance {
|
||||
base::OnceCallback<void(mojom::CastReceiverInstance::Result)>;
|
||||
void SetName(const std::string& name, SetNameCallback callback) override;
|
||||
|
||||
const base::Optional<bool>& last_enabled() const { return last_enabled_; }
|
||||
const base::Optional<std::string>& last_name() const { return last_name_; }
|
||||
const absl::optional<bool>& last_enabled() const { return last_enabled_; }
|
||||
const absl::optional<std::string>& last_name() const { return last_name_; }
|
||||
|
||||
private:
|
||||
base::Optional<bool> last_enabled_;
|
||||
base::Optional<std::string> last_name_;
|
||||
absl::optional<bool> last_enabled_;
|
||||
absl::optional<std::string> last_name_;
|
||||
};
|
||||
|
||||
} // namespace arc
|
||||
|
@ -19,9 +19,9 @@
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "mojo/public/cpp/system/platform_handle.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -352,7 +352,7 @@ void FakeFileSystemInstance::GetMimeType(const std::string& url,
|
||||
auto iter = files_.find(url);
|
||||
if (iter == files_.end()) {
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(std::move(callback), base::nullopt));
|
||||
FROM_HERE, base::BindOnce(std::move(callback), absl::nullopt));
|
||||
return;
|
||||
}
|
||||
const File& file = iter->second;
|
||||
@ -466,7 +466,7 @@ void FakeFileSystemInstance::GetChildDocuments(
|
||||
child_documents_.find(DocumentKey(authority, parent_document_id));
|
||||
if (child_iter == child_documents_.end()) {
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(std::move(callback), base::nullopt));
|
||||
FROM_HERE, base::BindOnce(std::move(callback), absl::nullopt));
|
||||
return;
|
||||
}
|
||||
std::vector<mojom::DocumentPtr> children;
|
||||
@ -477,7 +477,7 @@ void FakeFileSystemInstance::GetChildDocuments(
|
||||
}
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(std::move(callback),
|
||||
base::make_optional(std::move(children))));
|
||||
absl::make_optional(std::move(children))));
|
||||
}
|
||||
|
||||
void FakeFileSystemInstance::GetRecentDocuments(
|
||||
@ -488,7 +488,7 @@ void FakeFileSystemInstance::GetRecentDocuments(
|
||||
auto recent_iter = recent_documents_.find(RootKey(authority, root_id));
|
||||
if (recent_iter == recent_documents_.end()) {
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(std::move(callback), base::nullopt));
|
||||
FROM_HERE, base::BindOnce(std::move(callback), absl::nullopt));
|
||||
return;
|
||||
}
|
||||
std::vector<mojom::DocumentPtr> recents;
|
||||
@ -496,7 +496,7 @@ void FakeFileSystemInstance::GetRecentDocuments(
|
||||
recents.emplace_back(MakeDocument(document));
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(std::move(callback),
|
||||
base::make_optional(std::move(recents))));
|
||||
absl::make_optional(std::move(recents))));
|
||||
}
|
||||
|
||||
void FakeFileSystemInstance::GetRoots(GetRootsCallback callback) {
|
||||
@ -506,7 +506,7 @@ void FakeFileSystemInstance::GetRoots(GetRootsCallback callback) {
|
||||
roots.emplace_back(MakeRoot(root));
|
||||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(std::move(callback),
|
||||
base::make_optional(std::move(roots))));
|
||||
absl::make_optional(std::move(roots))));
|
||||
}
|
||||
|
||||
void FakeFileSystemInstance::GetRootSize(const std::string& authority,
|
||||
|
@ -96,7 +96,7 @@ class FakeFileSystemInstance : public mojom::FileSystemInstance {
|
||||
Seekable seekable;
|
||||
|
||||
// Override of |content| length in bytes.
|
||||
base::Optional<int64_t> size_override;
|
||||
absl::optional<int64_t> size_override;
|
||||
|
||||
// The thumbnail of a file, which can be read by OpenThumbnail().
|
||||
std::string thumbnail_content;
|
||||
|
@ -5,8 +5,8 @@
|
||||
#ifndef COMPONENTS_ARC_TEST_FAKE_LOCK_SCREEN_INSTANCE_H_
|
||||
#define COMPONENTS_ARC_TEST_FAKE_LOCK_SCREEN_INSTANCE_H_
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "components/arc/mojom/lock_screen.mojom.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -20,10 +20,10 @@ class FakeLockScreenInstance : public mojom::LockScreenInstance {
|
||||
// mojom::LockScreenInstance overrides:
|
||||
void SetDeviceLocked(bool is_locked) override;
|
||||
|
||||
const base::Optional<bool>& is_locked() const { return is_locked_; }
|
||||
const absl::optional<bool>& is_locked() const { return is_locked_; }
|
||||
|
||||
private:
|
||||
base::Optional<bool> is_locked_;
|
||||
absl::optional<bool> is_locked_;
|
||||
};
|
||||
|
||||
} // namespace arc
|
||||
|
@ -18,7 +18,7 @@ class FakePipInstance : public mojom::PipInstance {
|
||||
~FakePipInstance() override;
|
||||
|
||||
int num_closed() { return num_closed_; }
|
||||
base::Optional<bool> suppressed() const { return suppressed_; }
|
||||
absl::optional<bool> suppressed() const { return suppressed_; }
|
||||
|
||||
// mojom::PipInstance overrides:
|
||||
void Init(mojo::PendingRemote<mojom::PipHost> host_remote,
|
||||
@ -29,7 +29,7 @@ class FakePipInstance : public mojom::PipInstance {
|
||||
private:
|
||||
mojo::Remote<mojom::PipHost> host_remote_;
|
||||
int num_closed_ = 0;
|
||||
base::Optional<bool> suppressed_;
|
||||
absl::optional<bool> suppressed_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FakePipInstance);
|
||||
};
|
||||
|
@ -180,7 +180,7 @@ void ArcTimerBridge::OnDeleteArcTimers(bool result) {
|
||||
void ArcTimerBridge::OnCreateArcTimers(
|
||||
std::vector<clockid_t> clock_ids,
|
||||
CreateTimersCallback callback,
|
||||
base::Optional<std::vector<TimerId>> timer_ids) {
|
||||
absl::optional<std::vector<TimerId>> timer_ids) {
|
||||
// Any old timers associated with the same tag are always cleared by the API
|
||||
// regardless of the new timers being created successfully or not. Clear the
|
||||
// cached timer ids in that case.
|
||||
@ -217,11 +217,11 @@ void ArcTimerBridge::OnCreateArcTimers(
|
||||
std::move(callback).Run(mojom::ArcTimerResult::SUCCESS);
|
||||
}
|
||||
|
||||
base::Optional<ArcTimerBridge::TimerId> ArcTimerBridge::GetTimerId(
|
||||
absl::optional<ArcTimerBridge::TimerId> ArcTimerBridge::GetTimerId(
|
||||
clockid_t clock_id) const {
|
||||
auto it = timer_ids_.find(clock_id);
|
||||
return (it == timer_ids_.end()) ? base::nullopt
|
||||
: base::make_optional<TimerId>(it->second);
|
||||
return (it == timer_ids_.end()) ? absl::nullopt
|
||||
: absl::make_optional<TimerId>(it->second);
|
||||
}
|
||||
|
||||
} // namespace arc
|
||||
|
@ -12,13 +12,13 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/time/time.h"
|
||||
#include "components/arc/mojom/timer.mojom.h"
|
||||
#include "components/arc/session/connection_observer.h"
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
#include "mojo/public/cpp/bindings/receiver.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class BrowserContextKeyedServiceFactory;
|
||||
|
||||
@ -72,11 +72,11 @@ class ArcTimerBridge : public KeyedService,
|
||||
// Callback for powerd's D-Bus API called in |CreateTimers|.
|
||||
void OnCreateArcTimers(std::vector<clockid_t> clock_ids,
|
||||
CreateTimersCallback callback,
|
||||
base::Optional<std::vector<TimerId>> timer_ids);
|
||||
absl::optional<std::vector<TimerId>> timer_ids);
|
||||
|
||||
// Retrieves the timer id corresponding to |clock_id|. If a mapping exists in
|
||||
// |timer_ids_| then returns an int32_t >= 0. Else returns base::nullopt.
|
||||
base::Optional<TimerId> GetTimerId(clockid_t clock_id) const;
|
||||
// |timer_ids_| then returns an int32_t >= 0. Else returns absl::nullopt.
|
||||
absl::optional<TimerId> GetTimerId(clockid_t clock_id) const;
|
||||
|
||||
// Owned by ArcServiceManager.
|
||||
ArcBridgeService* const arc_bridge_service_;
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "base/callback_helpers.h"
|
||||
#include "base/files/file_descriptor_watcher_posix.h"
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/posix/unix_domain_socket.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/time/time.h"
|
||||
@ -30,6 +29,7 @@
|
||||
#include "mojo/public/cpp/system/handle.h"
|
||||
#include "mojo/public/cpp/system/platform_handle.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace arc {
|
||||
|
||||
@ -67,10 +67,10 @@ class ArcTimerStore {
|
||||
|
||||
void ClearTimers() { return arc_timers_.clear(); }
|
||||
|
||||
base::Optional<int> GetTimerReadFd(clockid_t clock_id) {
|
||||
absl::optional<int> GetTimerReadFd(clockid_t clock_id) {
|
||||
if (!HasTimer(clock_id))
|
||||
return base::nullopt;
|
||||
return base::Optional<int>(arc_timers_[clock_id].get());
|
||||
return absl::nullopt;
|
||||
return absl::optional<int>(arc_timers_[clock_id].get());
|
||||
}
|
||||
|
||||
bool HasTimer(clockid_t clock_id) const {
|
||||
@ -222,7 +222,7 @@ bool ArcTimerTest::WaitForExpiration(clockid_t clock_id) {
|
||||
|
||||
// Wait for the host to indicate expiration by watching the read end of the
|
||||
// socket pair.
|
||||
base::Optional<int> timer_read_fd_opt =
|
||||
absl::optional<int> timer_read_fd_opt =
|
||||
arc_timer_store_.GetTimerReadFd(clock_id);
|
||||
// This should never happen if the timer was present in the store.
|
||||
if (!timer_read_fd_opt.has_value()) {
|
||||
|
@ -169,7 +169,7 @@ void ArcUsbHostBridge::RequestPermission(const std::string& guid,
|
||||
}
|
||||
|
||||
void ArcUsbHostBridge::OpenDevice(const std::string& guid,
|
||||
const base::Optional<std::string>& package,
|
||||
const absl::optional<std::string>& package,
|
||||
OpenDeviceCallback callback) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_);
|
||||
|
||||
@ -201,7 +201,7 @@ void ArcUsbHostBridge::OpenDevice(const std::string& guid,
|
||||
|
||||
void ArcUsbHostBridge::OpenDeviceDeprecated(
|
||||
const std::string& guid,
|
||||
const base::Optional<std::string>& package,
|
||||
const absl::optional<std::string>& package,
|
||||
OpenDeviceCallback callback) {
|
||||
LOG(ERROR) << "ArcUsbHostBridge::OpenDeviceDeprecated is deprecated";
|
||||
OpenDevice(guid, package, std::move(callback));
|
||||
|
@ -70,10 +70,10 @@ class ArcUsbHostBridge : public KeyedService,
|
||||
bool interactive,
|
||||
RequestPermissionCallback callback) override;
|
||||
void OpenDeviceDeprecated(const std::string& guid,
|
||||
const base::Optional<std::string>& package,
|
||||
const absl::optional<std::string>& package,
|
||||
OpenDeviceCallback callback) override;
|
||||
void OpenDevice(const std::string& guid,
|
||||
const base::Optional<std::string>& package,
|
||||
const absl::optional<std::string>& package,
|
||||
OpenDeviceCallback callback) override;
|
||||
void GetDeviceInfo(const std::string& guid,
|
||||
GetDeviceInfoCallback callback) override;
|
||||
|
@ -49,7 +49,7 @@ std::vector<base::ScopedFD> DuplicateFD(base::ScopedFD fd, size_t num_fds) {
|
||||
return fds;
|
||||
}
|
||||
|
||||
base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
absl::optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
media::VideoPixelFormat pixel_format,
|
||||
uint64_t modifier,
|
||||
const gfx::Size& coded_size,
|
||||
@ -65,7 +65,7 @@ base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
base::CheckMul(stride, plane_height);
|
||||
if (!current_size.IsValid()) {
|
||||
VLOGF(1) << "Invalid stride/height";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
color_planes.emplace_back(stride, offset, current_size.ValueOrDie());
|
||||
@ -75,7 +75,7 @@ base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
std::move(scoped_fds), color_planes);
|
||||
}
|
||||
|
||||
base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
absl::optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
media::VideoPixelFormat pixel_format,
|
||||
uint64_t modifier,
|
||||
const gfx::Size& coded_size,
|
||||
@ -85,12 +85,12 @@ base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
if (planes.size() != num_planes || planes.size() == 0) {
|
||||
VLOGF(1) << "Invalid number of dmabuf planes passed: " << planes.size()
|
||||
<< ", expected: " << num_planes;
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
if (scoped_fds.size() != num_planes) {
|
||||
VLOGF(1) << "Invalid number of fds passed: " << scoped_fds.size()
|
||||
<< ", expected: " << num_planes;
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
gfx::GpuMemoryBufferHandle gmb_handle;
|
||||
@ -101,11 +101,11 @@ base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
// offset in NativePixmapPlane are uint32_t and uint64_t, respectively.
|
||||
if (!base::IsValueInRangeForNumericType<uint32_t>(planes[i].stride)) {
|
||||
VLOGF(1) << "Invalid stride";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
if (!base::IsValueInRangeForNumericType<uint64_t>(planes[i].offset)) {
|
||||
VLOGF(1) << "Invalid offset";
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
uint32_t stride = base::checked_cast<uint32_t>(planes[i].stride);
|
||||
uint64_t offset = base::checked_cast<uint64_t>(planes[i].offset);
|
||||
@ -115,7 +115,7 @@ base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
}
|
||||
|
||||
if (!media::VerifyGpuMemoryBufferHandle(pixel_format, coded_size, gmb_handle))
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
|
||||
return gmb_handle;
|
||||
}
|
||||
|
@ -9,11 +9,11 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/optional.h"
|
||||
#include "components/arc/video_accelerator/video_frame_plane.h"
|
||||
#include "media/base/color_plane_layout.h"
|
||||
#include "media/base/video_types.h"
|
||||
#include "mojo/public/cpp/system/handle.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
#include "ui/gfx/gpu_memory_buffer.h"
|
||||
|
||||
@ -29,14 +29,14 @@ std::vector<base::ScopedFD> DuplicateFD(base::ScopedFD fd, size_t num_fds);
|
||||
|
||||
// Return GpuMemoryBufferHandle iff |planes| are valid for a video frame located
|
||||
// on |scoped_fds| and of |pixel_format| and |coded_size|. Otherwise
|
||||
// returns base::nullopt.
|
||||
base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
// returns absl::nullopt.
|
||||
absl::optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
media::VideoPixelFormat pixel_format,
|
||||
uint64_t modifier,
|
||||
const gfx::Size& coded_size,
|
||||
std::vector<base::ScopedFD> scoped_fds,
|
||||
const std::vector<VideoFramePlane>& planes);
|
||||
base::Optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
absl::optional<gfx::GpuMemoryBufferHandle> CreateGpuMemoryBufferHandle(
|
||||
media::VideoPixelFormat pixel_format,
|
||||
uint64_t modifier,
|
||||
const gfx::Size& coded_size,
|
||||
|
@ -356,7 +356,7 @@ void GpuArcVideoDecodeAccelerator::InitializeTask(
|
||||
client_count_++;
|
||||
VLOGF(2) << "Number of concurrent clients: " << client_count_;
|
||||
|
||||
secure_mode_ = base::nullopt;
|
||||
secure_mode_ = absl::nullopt;
|
||||
error_state_ = false;
|
||||
pending_requests_ = {};
|
||||
pending_flush_callbacks_ = {};
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
#include "base/callback_forward.h"
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/threading/thread_checker.h"
|
||||
#include "components/arc/mojom/video_decode_accelerator.mojom.h"
|
||||
#include "gpu/config/gpu_driver_bug_workarounds.h"
|
||||
@ -20,6 +19,7 @@
|
||||
#include "media/video/video_decode_accelerator.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 arc {
|
||||
|
||||
@ -177,7 +177,7 @@ class GpuArcVideoDecodeAccelerator
|
||||
|
||||
size_t protected_input_buffer_count_ = 0;
|
||||
|
||||
base::Optional<bool> secure_mode_ = base::nullopt;
|
||||
absl::optional<bool> secure_mode_ = absl::nullopt;
|
||||
size_t output_buffer_count_ = 0;
|
||||
|
||||
DecoderState decoder_state_ = DecoderState::kDecoding;
|
||||
|
@ -191,7 +191,7 @@ void GpuArcVideoEncodeAccelerator::Encode(
|
||||
return;
|
||||
}
|
||||
|
||||
base::Optional<gfx::BufferFormat> buffer_format =
|
||||
absl::optional<gfx::BufferFormat> buffer_format =
|
||||
VideoPixelFormatToGfxBufferFormat(format);
|
||||
if (!format) {
|
||||
DLOG(ERROR) << "Unexpected format: " << format;
|
||||
|
@ -288,11 +288,11 @@ net::IsolationInfo ContentAutofillDriver::IsolationInfo() {
|
||||
}
|
||||
|
||||
void ContentAutofillDriver::SetFormToBeProbablySubmitted(
|
||||
const base::Optional<FormData>& raw_form) {
|
||||
const absl::optional<FormData>& raw_form) {
|
||||
potentially_submitted_form_ =
|
||||
raw_form ? base::make_optional<FormData>(
|
||||
raw_form ? absl::make_optional<FormData>(
|
||||
GetFormWithFrameAndFormMetaData(*raw_form))
|
||||
: base::nullopt;
|
||||
: absl::nullopt;
|
||||
}
|
||||
|
||||
void ContentAutofillDriver::FormsSeen(const std::vector<FormData>& raw_forms) {
|
||||
|
@ -111,7 +111,7 @@ class ContentAutofillDriver : public AutofillDriver,
|
||||
|
||||
// mojom::AutofillDriver:
|
||||
void SetFormToBeProbablySubmitted(
|
||||
const base::Optional<FormData>& form) override;
|
||||
const absl::optional<FormData>& form) override;
|
||||
void FormsSeen(const std::vector<FormData>& forms) override;
|
||||
void FormSubmitted(const FormData& form,
|
||||
bool known_success,
|
||||
@ -217,7 +217,7 @@ class ContentAutofillDriver : public AutofillDriver,
|
||||
// The form pushed from the AutofillAgent to the AutofillDriver. When the
|
||||
// ProbablyFormSubmitted() event is fired, this form is considered the
|
||||
// submitted one.
|
||||
base::Optional<FormData> potentially_submitted_form_;
|
||||
absl::optional<FormData> potentially_submitted_form_;
|
||||
|
||||
// Keeps track of the forms for which FormSubmitted() event has been triggered
|
||||
// to avoid duplicates fired by AutofillAgent.
|
||||
|
@ -245,25 +245,25 @@ class FakeAutofillAgent : public mojom::AutofillAgent {
|
||||
|
||||
// Records data received from FillForm() call.
|
||||
int32_t fill_form_id_;
|
||||
base::Optional<FormData> fill_form_form_;
|
||||
absl::optional<FormData> fill_form_form_;
|
||||
// Records data received from PreviewForm() call.
|
||||
int32_t preview_form_id_;
|
||||
base::Optional<FormData> preview_form_form_;
|
||||
absl::optional<FormData> preview_form_form_;
|
||||
// Records data received from FieldTypePredictionsAvailable() call.
|
||||
base::Optional<std::vector<FormDataPredictions>> predictions_;
|
||||
absl::optional<std::vector<FormDataPredictions>> predictions_;
|
||||
// Records whether ClearSection() got called.
|
||||
bool called_clear_section_;
|
||||
// Records whether ClearPreviewedForm() got called.
|
||||
bool called_clear_previewed_form_;
|
||||
// Records the ID received from FillFieldWithValue(), PreviewFieldWithValue(),
|
||||
// SetSuggestionAvailability(), or AcceptDataListSuggestion().
|
||||
base::Optional<FieldRendererId> value_renderer_id_;
|
||||
absl::optional<FieldRendererId> value_renderer_id_;
|
||||
// Records string received from FillFieldWithValue() call.
|
||||
base::Optional<std::u16string> value_fill_field_;
|
||||
absl::optional<std::u16string> value_fill_field_;
|
||||
// Records string received from PreviewFieldWithValue() call.
|
||||
base::Optional<std::u16string> value_preview_field_;
|
||||
absl::optional<std::u16string> value_preview_field_;
|
||||
// Records string received from AcceptDataListSuggestion() call.
|
||||
base::Optional<std::u16string> value_accept_data_;
|
||||
absl::optional<std::u16string> value_accept_data_;
|
||||
// Records bool received from SetSuggestionAvailability() call.
|
||||
bool suggestions_available_;
|
||||
};
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "base/i18n/case_conversion.h"
|
||||
#include "base/location.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "base/strings/string_split.h"
|
||||
@ -49,6 +48,7 @@
|
||||
#include "content/public/renderer/render_view.h"
|
||||
#include "net/cert/cert_status_flags.h"
|
||||
#include "services/service_manager/public/cpp/interface_provider.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
#include "third_party/blink/public/common/input/web_keyboard_event.h"
|
||||
#include "third_party/blink/public/platform/web_url_request.h"
|
||||
@ -1038,7 +1038,7 @@ void AutofillAgent::OnProvisionallySaveForm(
|
||||
}
|
||||
formless_elements_user_edited_.insert(
|
||||
FieldRendererId(element.UniqueRendererFormControlId()));
|
||||
provisionally_saved_form_ = base::make_optional<FormData>();
|
||||
provisionally_saved_form_ = absl::make_optional<FormData>();
|
||||
if (!CollectFormlessElements(&provisionally_saved_form_.value())) {
|
||||
provisionally_saved_form_.reset();
|
||||
} else {
|
||||
@ -1064,7 +1064,7 @@ void AutofillAgent::OnProvisionallySaveForm(
|
||||
}
|
||||
|
||||
void AutofillAgent::OnProbablyFormSubmitted() {
|
||||
base::Optional<FormData> form_data = GetSubmittedForm();
|
||||
absl::optional<FormData> form_data = GetSubmittedForm();
|
||||
if (form_data.has_value()) {
|
||||
FireHostSubmitEvents(form_data.value(), /*known_success=*/false,
|
||||
SubmissionSource::PROBABLY_FORM_SUBMITTED);
|
||||
@ -1104,7 +1104,7 @@ void AutofillAgent::OnInferredFormSubmission(SubmissionSource source) {
|
||||
FireHostSubmitEvents(provisionally_saved_form_.value(),
|
||||
/*known_success=*/true, source);
|
||||
} else {
|
||||
base::Optional<FormData> form_data = GetSubmittedForm();
|
||||
absl::optional<FormData> form_data = GetSubmittedForm();
|
||||
if (form_data.has_value())
|
||||
FireHostSubmitEvents(form_data.value(), /*known_success=*/true, source);
|
||||
}
|
||||
@ -1126,14 +1126,14 @@ void AutofillAgent::TrackAutofilledElement(
|
||||
form_tracker_.TrackAutofilledElement(element);
|
||||
}
|
||||
|
||||
base::Optional<FormData> AutofillAgent::GetSubmittedForm() const {
|
||||
absl::optional<FormData> AutofillAgent::GetSubmittedForm() const {
|
||||
if (!last_interacted_form_.IsNull()) {
|
||||
FormData form;
|
||||
if (form_util::ExtractFormData(last_interacted_form_,
|
||||
*field_data_manager_.get(), &form)) {
|
||||
return base::make_optional(form);
|
||||
return absl::make_optional(form);
|
||||
} else if (provisionally_saved_form_.has_value()) {
|
||||
return base::make_optional(provisionally_saved_form_.value());
|
||||
return absl::make_optional(provisionally_saved_form_.value());
|
||||
}
|
||||
} else if (formless_elements_user_edited_.size() != 0 &&
|
||||
!form_util::IsSomeControlElementVisible(
|
||||
@ -1145,12 +1145,12 @@ base::Optional<FormData> AutofillAgent::GetSubmittedForm() const {
|
||||
// construct form.
|
||||
FormData form;
|
||||
if (CollectFormlessElements(&form)) {
|
||||
return base::make_optional(form);
|
||||
return absl::make_optional(form);
|
||||
} else if (provisionally_saved_form_.has_value()) {
|
||||
return base::make_optional(provisionally_saved_form_.value());
|
||||
return absl::make_optional(provisionally_saved_form_.value());
|
||||
}
|
||||
}
|
||||
return base::nullopt;
|
||||
return absl::nullopt;
|
||||
}
|
||||
|
||||
void AutofillAgent::SendPotentiallySubmittedFormToBrowser() {
|
||||
@ -1166,7 +1166,7 @@ void AutofillAgent::ResetLastInteractedElements() {
|
||||
|
||||
void AutofillAgent::UpdateLastInteractedForm(blink::WebFormElement form) {
|
||||
last_interacted_form_ = form;
|
||||
provisionally_saved_form_ = base::make_optional<FormData>();
|
||||
provisionally_saved_form_ = absl::make_optional<FormData>();
|
||||
if (!form_util::ExtractFormData(last_interacted_form_,
|
||||
*field_data_manager_.get(),
|
||||
&provisionally_saved_form_.value())) {
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/timer/timer.h"
|
||||
#include "components/autofill/content/common/mojom/autofill_agent.mojom.h"
|
||||
#include "components/autofill/content/common/mojom/autofill_driver.mojom.h"
|
||||
@ -22,6 +21,7 @@
|
||||
#include "mojo/public/cpp/bindings/associated_receiver.h"
|
||||
#include "mojo/public/cpp/bindings/associated_remote.h"
|
||||
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
|
||||
#include "third_party/blink/public/web/web_autofill_client.h"
|
||||
#include "third_party/blink/public/web/web_form_control_element.h"
|
||||
@ -254,7 +254,7 @@ class AutofillAgent : public content::RenderFrameObserver,
|
||||
|
||||
// Attempt to get submitted FormData from last_interacted_form_ or
|
||||
// provisionally_saved_form_, return true if |form| is set.
|
||||
base::Optional<FormData> GetSubmittedForm() const;
|
||||
absl::optional<FormData> GetSubmittedForm() const;
|
||||
|
||||
// Pushes the value of GetSubmittedForm() to the AutofillDriver.
|
||||
void SendPotentiallySubmittedFormToBrowser();
|
||||
@ -319,7 +319,7 @@ class AutofillAgent : public content::RenderFrameObserver,
|
||||
|
||||
// The form user interacted, it is used if last_interacted_form_ or formless
|
||||
// form can't be converted to FormData at the time of form submission.
|
||||
base::Optional<FormData> provisionally_saved_form_;
|
||||
absl::optional<FormData> provisionally_saved_form_;
|
||||
|
||||
// Keeps track of the forms for which form submitted event has been sent to
|
||||
// AutofillDriver. We use it to avoid fire duplicated submission event when
|
||||
|
@ -155,7 +155,7 @@ void FormTracker::DidFinishSameDocumentNavigation() {
|
||||
|
||||
void FormTracker::DidStartNavigation(
|
||||
const GURL& url,
|
||||
base::Optional<blink::WebNavigationType> navigation_type) {
|
||||
absl::optional<blink::WebNavigationType> navigation_type) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(form_tracker_sequence_checker_);
|
||||
blink::WebLocalFrame* navigated_frame = render_frame()->GetWebFrame();
|
||||
// Ony handle main frame.
|
||||
|
@ -97,7 +97,7 @@ class FormTracker : public content::RenderFrameObserver {
|
||||
void DidFinishSameDocumentNavigation() override;
|
||||
void DidStartNavigation(
|
||||
const GURL& url,
|
||||
base::Optional<blink::WebNavigationType> navigation_type) override;
|
||||
absl::optional<blink::WebNavigationType> navigation_type) override;
|
||||
void WillDetach() override;
|
||||
void WillSendSubmitEvent(const blink::WebFormElement& form) override;
|
||||
void WillSubmitForm(const blink::WebFormElement& form) override;
|
||||
|
@ -316,7 +316,7 @@ void PasswordGenerationAgent::TriggeredGeneratePassword(
|
||||
std::move(callback).Run(std::move(password_generation_ui_data));
|
||||
current_generation_item_->generation_popup_shown_ = true;
|
||||
} else {
|
||||
std::move(callback).Run(base::nullopt);
|
||||
std::move(callback).Run(absl::nullopt);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,6 @@
|
||||
|
||||
#include "components/autofill/content/renderer/renderer_save_password_progress_logger.h"
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/task_environment.h"
|
||||
#include "components/autofill/content/common/mojom/autofill_driver.mojom.h"
|
||||
@ -13,6 +12,7 @@
|
||||
#include "mojo/public/cpp/bindings/receiver.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace autofill {
|
||||
|
||||
@ -86,7 +86,7 @@ class FakeContentPasswordManagerDriver : public mojom::PasswordManagerDriver {
|
||||
// Records whether RecordSavePasswordProgress() gets called.
|
||||
bool called_record_save_;
|
||||
// Records data received via RecordSavePasswordProgress() call.
|
||||
base::Optional<std::string> log_;
|
||||
absl::optional<std::string> log_;
|
||||
|
||||
mojo::Receiver<mojom::PasswordManagerDriver> receiver_{this};
|
||||
};
|
||||
|
@ -76,7 +76,7 @@ class AddressProfileSaveManager {
|
||||
PersonalDataManager* const personal_data_manager_{nullptr};
|
||||
|
||||
// Data including the request id for the currently ongoing profile import.
|
||||
base::Optional<ProfileImportProcess> pending_import_;
|
||||
absl::optional<ProfileImportProcess> pending_import_;
|
||||
|
||||
base::WeakPtrFactory<AddressProfileSaveManager> weak_ptr_factory_{this};
|
||||
};
|
||||
|
@ -60,7 +60,7 @@ class TestAddressProfileSaveManager : public AddressProfileSaveManager {
|
||||
// Mocks the function that initiates the UI prompt for testing purposes.
|
||||
MOCK_METHOD(void, OfferSavePrompt, (), (override));
|
||||
|
||||
// Returns a copy of the last finished import process or 'base::nullopt' if no
|
||||
// Returns a copy of the last finished import process or 'absl::nullopt' if no
|
||||
// import process was finished.
|
||||
ProfileImportProcess* last_import();
|
||||
|
||||
@ -74,7 +74,7 @@ class TestAddressProfileSaveManager : public AddressProfileSaveManager {
|
||||
void ClearPendingImport() override;
|
||||
// Profile that is passed from the emulated UI respones in case the user
|
||||
// edited the import candidate.
|
||||
base::Optional<ProfileImportProcess> last_import_;
|
||||
absl::optional<ProfileImportProcess> last_import_;
|
||||
};
|
||||
|
||||
TestAddressProfileSaveManager::TestAddressProfileSaveManager(
|
||||
@ -102,8 +102,8 @@ struct ImportScenarioTestCase {
|
||||
AutofillProfile edited_profile;
|
||||
AutofillProfileImportType expected_import_type;
|
||||
bool is_profile_change_expected;
|
||||
base::Optional<AutofillProfile> merge_candidate;
|
||||
base::Optional<AutofillProfile> import_candidate;
|
||||
absl::optional<AutofillProfile> merge_candidate;
|
||||
absl::optional<AutofillProfile> import_candidate;
|
||||
std::vector<AutofillProfile> expected_final_profiles;
|
||||
std::vector<AutofillMetrics::EditedFieldTypeForMetrics>
|
||||
expected_edited_types_for_metrics;
|
||||
@ -274,7 +274,7 @@ TEST_F(AddressProfileSaveManagerTest, SaveNewProfile) {
|
||||
.user_decision = UserDecision::kAccepted,
|
||||
.expected_import_type = AutofillProfileImportType::kNewProfile,
|
||||
.is_profile_change_expected = true,
|
||||
.merge_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = observed_profile,
|
||||
.expected_final_profiles = {observed_profile}};
|
||||
|
||||
@ -293,8 +293,8 @@ TEST_F(AddressProfileSaveManagerTest, SaveNewProfileOnBlockedDomain) {
|
||||
.user_decision = UserDecision::kUserNotAsked,
|
||||
.expected_import_type = AutofillProfileImportType::kSuppressedNewProfile,
|
||||
.is_profile_change_expected = false,
|
||||
.merge_candidate = base::nullopt,
|
||||
.import_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = absl::nullopt,
|
||||
.expected_final_profiles = {},
|
||||
.new_profiles_suppresssed_for_domain = true};
|
||||
|
||||
@ -314,7 +314,7 @@ TEST_F(AddressProfileSaveManagerTest, SaveNewProfile_UserNotAskedFallback) {
|
||||
.user_decision = UserDecision::kUserNotAsked,
|
||||
.expected_import_type = AutofillProfileImportType::kNewProfile,
|
||||
.is_profile_change_expected = true,
|
||||
.merge_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = observed_profile,
|
||||
.expected_final_profiles = {observed_profile}};
|
||||
|
||||
@ -337,7 +337,7 @@ TEST_F(AddressProfileSaveManagerTest, SaveNewProfile_Edited) {
|
||||
.edited_profile = edited_profile,
|
||||
.expected_import_type = AutofillProfileImportType::kNewProfile,
|
||||
.is_profile_change_expected = true,
|
||||
.merge_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = observed_profile,
|
||||
.expected_final_profiles = {edited_profile},
|
||||
.expected_edited_types_for_metrics = {
|
||||
@ -360,7 +360,7 @@ TEST_F(AddressProfileSaveManagerTest, SaveNewProfile_Declined) {
|
||||
.user_decision = UserDecision::kDeclined,
|
||||
.expected_import_type = AutofillProfileImportType::kNewProfile,
|
||||
.is_profile_change_expected = false,
|
||||
.merge_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = observed_profile,
|
||||
.expected_final_profiles = {}};
|
||||
|
||||
@ -380,8 +380,8 @@ TEST_F(AddressProfileSaveManagerTest, ImportDuplicateProfile) {
|
||||
.user_decision = UserDecision::kAccepted,
|
||||
.expected_import_type = AutofillProfileImportType::kDuplicateImport,
|
||||
.is_profile_change_expected = false,
|
||||
.merge_candidate = base::nullopt,
|
||||
.import_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = absl::nullopt,
|
||||
.expected_final_profiles = {existing_profile}};
|
||||
|
||||
TestImportScenario(test_scenario);
|
||||
@ -401,8 +401,8 @@ TEST_F(AddressProfileSaveManagerTest, SilentlyUpdateProfile) {
|
||||
.is_prompt_expected = false,
|
||||
.expected_import_type = AutofillProfileImportType::kSilentUpdate,
|
||||
.is_profile_change_expected = true,
|
||||
.merge_candidate = base::nullopt,
|
||||
.import_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = absl::nullopt,
|
||||
.expected_final_profiles = {final_profile}};
|
||||
TestImportScenario(test_scenario);
|
||||
}
|
||||
@ -422,8 +422,8 @@ TEST_F(AddressProfileSaveManagerTest, SilentlyUpdateProfileOnBlockedDomain) {
|
||||
.is_prompt_expected = false,
|
||||
.expected_import_type = AutofillProfileImportType::kSilentUpdate,
|
||||
.is_profile_change_expected = true,
|
||||
.merge_candidate = base::nullopt,
|
||||
.import_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = absl::nullopt,
|
||||
.expected_final_profiles = {final_profile},
|
||||
.new_profiles_suppresssed_for_domain = true};
|
||||
TestImportScenario(test_scenario);
|
||||
@ -448,8 +448,8 @@ TEST_F(AddressProfileSaveManagerTest, SilentlyUpdateVerifiedProfile) {
|
||||
.is_prompt_expected = false,
|
||||
.expected_import_type = AutofillProfileImportType::kSilentUpdate,
|
||||
.is_profile_change_expected = true,
|
||||
.merge_candidate = base::nullopt,
|
||||
.import_candidate = base::nullopt,
|
||||
.merge_candidate = absl::nullopt,
|
||||
.import_candidate = absl::nullopt,
|
||||
.expected_final_profiles = {final_profile}};
|
||||
TestImportScenario(test_scenario);
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/optional.h"
|
||||
#include "components/autofill/core/browser/autofill_type.h"
|
||||
#include "components/autofill/core/browser/data_model/autofill_profile.h"
|
||||
#include "components/autofill/core/browser/field_types.h"
|
||||
@ -21,6 +20,7 @@
|
||||
#include "components/autofill/core/browser/proto/password_requirements.pb.h"
|
||||
#include "components/autofill/core/common/form_field_data.h"
|
||||
#include "components/autofill/core/common/signatures.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace autofill {
|
||||
|
||||
@ -158,7 +158,7 @@ class AutofillField : public FormFieldData {
|
||||
bool IsFieldFillable() const;
|
||||
|
||||
void set_initial_value_hash(uint32_t value) { initial_value_hash_ = value; }
|
||||
base::Optional<uint32_t> initial_value_hash() { return initial_value_hash_; }
|
||||
absl::optional<uint32_t> initial_value_hash() { return initial_value_hash_; }
|
||||
|
||||
void set_credit_card_number_offset(size_t position) {
|
||||
credit_card_number_offset_ = position;
|
||||
@ -191,7 +191,7 @@ class AutofillField : public FormFieldData {
|
||||
}
|
||||
|
||||
void SetPasswordRequirements(PasswordRequirementsSpec spec);
|
||||
const base::Optional<PasswordRequirementsSpec>& password_requirements()
|
||||
const absl::optional<PasswordRequirementsSpec>& password_requirements()
|
||||
const {
|
||||
return password_requirements_;
|
||||
}
|
||||
@ -219,7 +219,7 @@ class AutofillField : public FormFieldData {
|
||||
// Whether the heuristics or server predict a credit card field.
|
||||
bool IsCreditCardPrediction() const;
|
||||
|
||||
base::Optional<FieldSignature> field_signature_;
|
||||
absl::optional<FieldSignature> field_signature_;
|
||||
// The unique name of this field, generated by Autofill.
|
||||
std::u16string unique_name_;
|
||||
|
||||
@ -241,7 +241,7 @@ class AutofillField : public FormFieldData {
|
||||
|
||||
// Requirements the site imposes to passwords (for password generation).
|
||||
// Corresponds to the requirements determined by the Autofill server.
|
||||
base::Optional<PasswordRequirementsSpec> password_requirements_;
|
||||
absl::optional<PasswordRequirementsSpec> password_requirements_;
|
||||
|
||||
// The type of the field, as determined by the local heuristics.
|
||||
ServerFieldType heuristic_type_ = UNKNOWN_TYPE;
|
||||
@ -270,7 +270,7 @@ class AutofillField : public FormFieldData {
|
||||
|
||||
// A low-entropy hash of the field's initial value before user-interactions or
|
||||
// automatic fillings. This field is used to detect static placeholders.
|
||||
base::Optional<uint32_t> initial_value_hash_;
|
||||
absl::optional<uint32_t> initial_value_hash_;
|
||||
|
||||
// Used to hold the position of the first digit to be copied as a substring
|
||||
// from credit card number.
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include "components/autofill/core/browser/autofill_form_test_utils.h"
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "components/autofill/core/browser/form_structure.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace autofill {
|
||||
|
||||
|
@ -7,13 +7,13 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "base/strings/string_piece.h"
|
||||
#include "components/autofill/core/browser/autofill_field.h"
|
||||
#include "components/autofill/core/browser/field_types.h"
|
||||
#include "components/autofill/core/common/form_data.h"
|
||||
#include "components/autofill/core/common/form_field_data.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
namespace autofill {
|
||||
namespace test {
|
||||
@ -43,11 +43,11 @@ struct FieldDataDescription {
|
||||
bool is_focusable = true;
|
||||
const base::StringPiece16 label = kLabelText;
|
||||
const base::StringPiece16 name = kNameText;
|
||||
base::Optional<const char16_t*> value;
|
||||
absl::optional<const char16_t*> value;
|
||||
const base::StringPiece autocomplete_attribute;
|
||||
const base::StringPiece form_control_type = "text";
|
||||
bool should_autocomplete = true;
|
||||
base::Optional<bool> is_autofilled;
|
||||
absl::optional<bool> is_autofilled;
|
||||
};
|
||||
|
||||
// Attributes provided to the test form.
|
||||
@ -55,11 +55,11 @@ template <typename = void>
|
||||
struct TestFormAttributes {
|
||||
const base::StringPiece description_for_logging;
|
||||
std::vector<FieldDataDescription<>> fields;
|
||||
base::Optional<FormRendererId> unique_renderer_id;
|
||||
absl::optional<FormRendererId> unique_renderer_id;
|
||||
const base::StringPiece16 name = u"TestForm";
|
||||
const base::StringPiece url = kFormUrl;
|
||||
const base::StringPiece action = kFormActionUrl;
|
||||
base::Optional<url::Origin> main_frame_origin;
|
||||
absl::optional<url::Origin> main_frame_origin;
|
||||
bool is_form_tag = true;
|
||||
};
|
||||
|
||||
@ -80,11 +80,11 @@ struct TestFormFlags {
|
||||
// first value denotes whether the comparison is to be done while second
|
||||
// denotes EXPECT_TRUE for true and EXPECT_FALSE for false.
|
||||
std::pair<bool, bool> is_complete_credit_card_form = {false, false};
|
||||
// The implicit default value `base::nullopt` means no checking.
|
||||
base::Optional<int> field_count;
|
||||
base::Optional<int> autofill_count;
|
||||
base::Optional<int> section_count;
|
||||
base::Optional<int> response_field_count;
|
||||
// The implicit default value `absl::nullopt` means no checking.
|
||||
absl::optional<int> field_count;
|
||||
absl::optional<int> autofill_count;
|
||||
absl::optional<int> section_count;
|
||||
absl::optional<int> response_field_count;
|
||||
};
|
||||
|
||||
// Expected field type values to be verified with the test form.
|
||||
|
@ -292,7 +292,7 @@ void AutofillMergeTest::MergeProfiles(const std::string& profiles,
|
||||
|
||||
// Import the profile.
|
||||
std::unique_ptr<CreditCard> imported_credit_card;
|
||||
base::Optional<std::string> unused_imported_upi_id;
|
||||
absl::optional<std::string> unused_imported_upi_id;
|
||||
form_data_importer_->ImportFormData(form_structure,
|
||||
true, // address autofill enabled,
|
||||
true, // credit card autofill enabled
|
||||
|
@ -503,7 +503,7 @@ void AutofillMetricsTest::SetFidoEligibility(bool is_verifiable) {
|
||||
->AllowFidoRegistration(true);
|
||||
access_manager->is_authentication_in_progress_ = false;
|
||||
access_manager->can_fetch_unmask_details_.Signal();
|
||||
access_manager->is_user_verifiable_ = base::nullopt;
|
||||
access_manager->is_user_verifiable_ = absl::nullopt;
|
||||
}
|
||||
|
||||
void AutofillMetricsTest::OnDidGetRealPan(
|
||||
|
@ -164,7 +164,7 @@ std::vector<AutofillProfile> ProfileImportProcess::GetResultingProfiles() {
|
||||
|
||||
void ProfileImportProcess::SetUserDecision(
|
||||
UserDecision decision,
|
||||
base::Optional<AutofillProfile> edited_profile) {
|
||||
absl::optional<AutofillProfile> edited_profile) {
|
||||
// A user decision should only be supplied once.
|
||||
DCHECK_EQ(user_decision_, UserDecision::kUndefined);
|
||||
DCHECK(!confirmed_import_candidate_.has_value());
|
||||
@ -215,7 +215,7 @@ void ProfileImportProcess::AcceptWithoutEdits() {
|
||||
}
|
||||
|
||||
void ProfileImportProcess::AcceptWithEdits(AutofillProfile edited_profile) {
|
||||
SetUserDecision(UserDecision::kEdited, base::make_optional(edited_profile));
|
||||
SetUserDecision(UserDecision::kEdited, absl::make_optional(edited_profile));
|
||||
}
|
||||
|
||||
void ProfileImportProcess::Declined() {
|
||||
|
@ -83,11 +83,11 @@ class ProfileImportProcess {
|
||||
// a merge candidate exists.
|
||||
bool ImportIsMerge() const;
|
||||
|
||||
const base::Optional<AutofillProfile>& import_candidate() const {
|
||||
const absl::optional<AutofillProfile>& import_candidate() const {
|
||||
return import_candidate_;
|
||||
}
|
||||
|
||||
const base::Optional<AutofillProfile>& merge_candidate() const {
|
||||
const absl::optional<AutofillProfile>& merge_candidate() const {
|
||||
return merge_candidate_;
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ class ProfileImportProcess {
|
||||
// |edited_profile| reflect user edits to the import candidate.
|
||||
void SetUserDecision(
|
||||
AutofillClient::SaveAddressProfileOfferUserDecision decision,
|
||||
base::Optional<AutofillProfile> edited_profile = base::nullopt);
|
||||
absl::optional<AutofillProfile> edited_profile = absl::nullopt);
|
||||
|
||||
// Records UMA metrics. Should only be called after a user decision was
|
||||
// supplied.
|
||||
@ -172,10 +172,10 @@ class ProfileImportProcess {
|
||||
|
||||
// A profile in its original state that can be merged with the observed
|
||||
// profile.
|
||||
base::Optional<AutofillProfile> merge_candidate_;
|
||||
absl::optional<AutofillProfile> merge_candidate_;
|
||||
|
||||
// The import candidate that is presented to the user.
|
||||
base::Optional<AutofillProfile> import_candidate_;
|
||||
absl::optional<AutofillProfile> import_candidate_;
|
||||
|
||||
// The type of the import indicates if the profile is just a duplicate of an
|
||||
// existing profile, if an existing profile can be silently updated, or if
|
||||
@ -186,7 +186,7 @@ class ProfileImportProcess {
|
||||
|
||||
// The profile as it was confirmed by the user or as it should be imported if
|
||||
// user interactions are disabled.
|
||||
base::Optional<AutofillProfile> confirmed_import_candidate_;
|
||||
absl::optional<AutofillProfile> confirmed_import_candidate_;
|
||||
|
||||
// The decision the user made when prompted.
|
||||
AutofillClient::SaveAddressProfileOfferUserDecision user_decision_{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user