0

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:
Anton Bikineev
2021-05-15 22:35:36 +00:00
committed by Chromium LUCI CQ
parent 330c3555c6
commit 1156b5f891
1791 changed files with 7792 additions and 7790 deletions
components
account_id
account_manager_core
apdu
arc
appfuse
arc_features_parser.ccarc_features_parser.harc_features_parser_unittest.ccarc_util.cc
bluetooth
compat_mode
crash_collector
disk_quota
enterprise
ime
intent_helper
lock_screen
metrics
mojom
net
power
property
sensor
session
test
timer
usb
video_accelerator
autofill
content
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
field_filler.ccform_data_importer.ccform_data_importer.hform_data_importer_unittest.cc
form_parsing
form_processing
form_structure.ccform_structure.h
geo
metrics
pattern_provider
payments
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.h
ui
webdata
common
ios
autofill_assistant
browser
actions
autofill_assistant_onboarding_fetcher.ccclient.hclient_context_unittest.ccclient_settings.hcontroller.cccontroller.hcontroller_unittest.ccdetails.ccdetails.h
devtools
element_precondition.hevent_handler.ccevent_handler.hfake_starter_platform_delegate.ccfake_starter_platform_delegate.hfield_formatter.ccfield_formatter.hfield_formatter_unittest.ccmock_client.hprotocol_utils.ccprotocol_utils.hprotocol_utils_unittest.ccscript_executor.hscript_parameters.ccscript_parameters.hselector.h
service
starter.ccstarter.hstarter_heuristic.ccstarter_heuristic.hstarter_heuristic_unittest.ccstarter_platform_delegate.hstarter_unittest.ccstartup_util.ccstartup_util.hstartup_util_unittest.cctrigger_context.h
trigger_scripts
ui_delegate.huser_data.ccuser_data.huser_data_util_unittest.ccuser_model.ccuser_model.huser_model_unittest.ccvalue_util.ccvalue_util.hvalue_util_unittest.cc
web
background_sync
background_task_scheduler
blocked_content
blocklist
bookmarks
breadcrumbs
browser_sync
browsing_data
captive_portal
cast
cast_channel
cast_streaming
cbor
cdm
chromeos_camera
client_hints
cloud_devices
component_updater
consent_auditor
content_capture
content_settings
crash
cronet
crx_file
data_reduction_proxy
digital_asset_links
discardable_memory
dom_distiller
domain_reliability
download
embedder_support
enterprise
error_page
exo
favicon
feature_engagement
federated_learning
feed
full_restore
gcm_driver
gwp_asan
history
history_clusters
image_fetcher
invalidation
javascript_dialogs
js_injection
link_header_util
live_caption
media_message_center
media_router
metrics
mirroring
navigation_interception
network_hints
network_session_configurator
no_state_prefetch
ntp_snippets
ntp_tiles
offline_items_collection
offline_pages
omnibox
open_from_clipboard
openscreen_platform
optimization_guide
content
core
os_crypt
page_image_annotation
page_info
page_load_metrics
paint_preview
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.cc
import
leak_detection
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.h
sync
ui
votes_uploader.ccvotes_uploader.hvotes_uploader_unittest.ccwell_known_change_password_state.ccwell_known_change_password_state.h
common
ios
payments
pdf
performance_manager
permissions
policy
power_scheduler
prefs
printing
qr_code_generator
query_tiles
reading_list
remote_cocoa
reporting
safe_browsing
safe_search_api
scheduling_metrics
schema_org
search
search_engines
search_provider_logos
security_interstitials
send_tab_to_self
services
app_service
filesystem
font
heap_profiling
paint_preview_compositor
print_compositor
storage
sessions
shared_highlighting
signin
soda
sqlite_proto
startup_metric_utils
subresource_filter
suggestions
sync
base
driver
engine
loopback_server
invalidations
model
nigori
test
trusted_vault
sync_bookmarks
sync_device_info
sync_preferences
sync_sessions
sync_user_events
system_media_controls
thin_webview
translate
ui_devtools
ukm
update_client
upload_list
url_matcher
url_pattern_index
user_manager
variations
visitedlink
viz
client
common
demo
host
service
compositor_frame_fuzzer
debugger
display
display_embedder
frame_sinks
gl
hit_test
main
surfaces
transitions
test
web_cache
web_package
webapps
webauthn
webcrypto
webrtc_logging
zucchini
tools/variations/unittest_data

@ -9,7 +9,6 @@
#include "base/callback.h"
#include "base/json/json_reader.h"
#include "base/metrics/histogram_macros.h"
#include "base/optional.h"
#include "base/stl_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
@ -22,6 +21,7 @@
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/url_constants.h"
namespace safe_search_api {
@ -42,7 +42,7 @@ std::string BuildRequestData(const std::string& api_key, const GURL& url) {
// Parses a SafeSearch API |response| and stores the result in |is_porn|,
// returns true on success. Otherwise, returns false and doesn't set |is_porn|.
bool ParseResponse(const std::string& response, bool* is_porn) {
base::Optional<base::Value> optional_value = base::JSONReader::Read(response);
absl::optional<base::Value> optional_value = base::JSONReader::Read(response);
const base::DictionaryValue* dict = nullptr;
if (!optional_value || !optional_value.value().GetAsDictionary(&dict)) {
DLOG(WARNING) << "ParseResponse failed to parse global dictionary";