0

Replace DISALLOW_COPY_AND_ASSIGN in components/

This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).

This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.

IWYU cleanup is left as a separate pass that is easier when these macros
go away.

Bug: 1010217
Change-Id: I917bfbff1357e9e2cfe330d242feff6bb73e1bce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167004
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923103}
This commit is contained in:
Peter Boström
2021-09-20 22:43:27 +00:00
committed by Chromium LUCI CQ
parent 977a1519dd
commit 09c0182fae
2059 changed files with 9520 additions and 5139 deletions
components
android_autofill
apdu
arc
appfuse
arc_service_manager.harc_util_unittest.cc
audio
camera
clipboard
disk_quota
ime
lock_screen
media_session
metrics
midis
net
obb_mounter
power
rotation_lock
session
storage_manager
test
timer
usb
video_accelerator
wake_lock
assist_ranker
autofill
content
core
browser
address_normalization_manager.haddress_normalizer_impl.ccaddress_normalizer_impl.haddress_normalizer_impl_unittest.ccautocomplete_history_manager.hautocomplete_history_manager_unittest.ccautofill_address_policy_handler.hautofill_credit_card_policy_handler.hautofill_driver_factory.hautofill_driver_factory_unittest.ccautofill_external_delegate.hautofill_field.hautofill_manager.hautofill_merge_unittest.ccautofill_policy_handler.hautofill_profile_validator.hautofill_profile_validator_unittest.ccbrowser_autofill_manager.h
data_model
form_data_importer.h
form_parsing
form_structure.h
geo
logging
payments
test_autofill_client.htest_autofill_clock.htest_autofill_download_manager.htest_autofill_external_delegate.htest_autofill_profile_validator_delayed.htest_autofill_tick_clock.htest_browser_autofill_manager.htest_event_waiter.htest_form_structure.htest_personal_data_manager.h
ui
webdata
common
ios
autofill_assistant
background_sync
background_task_scheduler
blocked_content
blocklist
bookmarks
browser_sync
browser_ui
browser_watcher
browsing_data
captive_portal
cast
api_bindings
cast_certificate
cast_channel
cbor
cdm
certificate_transparency
chromeos_camera
client_hints
cloud_devices
component_updater
consent_auditor
constrained_window
content_capture
content_settings
contextual_search
crash
cronet
data_reduction_proxy
data_use_measurement
dbus
device_event_log
digital_asset_links
discardable_memory
dom_distiller
domain_reliability
download
content
database
internal
network
public
drive
embedder_support
enterprise
exo
favicon
favicon_base
feature_engagement
feedback
flags_ui
fullscreen_control
gcm_driver
grpc_support
guest_os
guest_view
heap_profiling
heavy_ad_intervention
history
image_fetcher
infobars
invalidation
javascript_dialogs
js_injection
keep_alive_registry
keyed_service
language
leveldb_proto
location
media_message_center
media_router
metrics
android_metrics_provider.hcall_stack_profile_builder.hcall_stack_profile_collector.hcall_stack_profile_metrics_provider.hchild_call_stack_profile_collector.hchild_call_stack_profile_collector_unittest.cccloned_install_detector.hcomponent_metrics_provider.hcomponent_metrics_provider_unittest.cc
content
cpu_metrics_provider.hdaily_event.hdata_use_tracker.hdelegating_provider.h
demographics
drive_metrics_provider.henvironment_recorder.henvironment_recorder_unittest.ccexpired_histograms_checker.hfield_trials_provider.hfile_metrics_provider.h
library_support
metrics_log.ccmetrics_log.hmetrics_log_manager.hmetrics_log_manager_unittest.ccmetrics_log_store.hmetrics_log_store_unittest.ccmetrics_log_unittest.ccmetrics_provider.hmetrics_reporting_service.hmetrics_rotation_scheduler.hmetrics_scheduler.hmetrics_service.hmetrics_service_client.hmetrics_service_client_unittest.ccmetrics_service_unittest.ccmetrics_state_manager.hmetrics_upload_scheduler.h
net
persistent_system_profile.hpersistent_system_profile_unittest.ccreporting_service.hreporting_service_unittest.cc
serialization
single_sample_metrics.ccsingle_sample_metrics_factory_impl.ccsingle_sample_metrics_factory_impl.hsingle_sample_metrics_factory_impl_unittest.ccstability_metrics_helper.hstability_metrics_provider.hstability_metrics_provider_unittest.cc
system_session_analyzer
test
ui
unsent_log_store.hunsent_log_store_metrics.hunsent_log_store_metrics_impl.h
metrics_services_manager
mirroring
nacl
navigation_interception
net_log
network_hints
network_time
no_state_prefetch
ntp_tiles
offline_items_collection
offline_pages
content
core
archive_manager.harchive_validator.h
background
downloads
model
offline_page_metadata_store_test_util.hoffline_page_test_archiver.h
prefetch
test_scoped_offline_clock.h
task
open_from_clipboard
optimization_guide
os_crypt
ownership
page_image_annotation
page_info
page_load_metrics
password_manager
content
core
browser
android_affiliation
export
fake_form_fetcher.hfield_info_table.hform_fetcher.hform_fetcher_impl.hform_fetcher_impl_unittest.cc
form_parsing
form_saver.hform_saver_impl.hform_saver_impl_unittest.cc
generation
hash_password_manager.hhsts_query_unittest.cchttp_credentials_cleaner.hhttp_credentials_cleaner_unittest.cchttp_password_store_migrator.hhttp_password_store_migrator_unittest.cc
import
insecure_credentials_table.hleak_detection_delegate_helper.hlogin_database.cclogin_database.hmock_password_form_manager_for_ui.hmulti_store_form_fetcher.hmulti_store_form_fetcher_unittest.ccpassword_autofill_manager.hpassword_feature_manager.hpassword_feature_manager_impl.hpassword_form_manager.hpassword_generation_frame_helper.hpassword_manager.hpassword_manager_client.hpassword_manager_driver.hpassword_manager_metrics_recorder.hpassword_manager_test_utils.hpassword_requirements_service.hpassword_reuse_detection_manager.hpassword_reuse_detection_manager_unittest.ccpassword_save_manager.h
site_affiliation
statistics_table.hstub_credentials_filter.hstub_form_saver.hstub_password_manager_client.hstub_password_manager_driver.h
sync
sync_credentials_filter.hsync_credentials_filter_unittest.cc
ios
payments
pdf
performance_manager
permissions
plugins
prefs
proxy_config
pwg_encoder
qr_code_generator
query_parser
query_tiles
quirks
reading_list
remote_cocoa
renderer_context_menu
rlz
safe_browsing
safe_search_api
scheduling_metrics
search_engines
search_provider_logos
security_interstitials
send_tab_to_self
services
session_manager
sessions
signin
core
internal
ios
public
site_engagement
speech
spellcheck
storage_monitor
subresource_filter
sync
base
driver
engine
model
nigori
test
sync_bookmarks
sync_device_info
sync_preferences
sync_sessions
sync_user_events
system_media_controls
thin_webview
tracing
translate
ui_devtools
ukm
undo
unified_consent
update_client
url_matcher
url_pattern_index
user_manager
user_prefs
variations
visitedlink
viz
client
common
demo
host
service
compositor_frame_fuzzer
display
display_embedder
frame_sinks
gl
hit_test
main
surfaces
test
web_cache
web_modal
web_package
web_resource
webapps
webcrypto
webdata
webdata_services
webxr
wifi
zoom

@ -16,6 +16,10 @@ namespace safe_search_api {
class FakeURLCheckerClient : public URLCheckerClient {
public:
FakeURLCheckerClient();
FakeURLCheckerClient(const FakeURLCheckerClient&) = delete;
FakeURLCheckerClient& operator=(const FakeURLCheckerClient&) = delete;
~FakeURLCheckerClient() override;
// Fake override that simply holds references of |url| and |callback|.
@ -33,8 +37,6 @@ class FakeURLCheckerClient : public URLCheckerClient {
private:
ClientCheckCallback callback_;
GURL url_;
DISALLOW_COPY_AND_ASSIGN(FakeURLCheckerClient);
};
} // namespace safe_search_api

@ -31,6 +31,10 @@ class SafeSearchURLCheckerClient : public URLCheckerClient {
const net::NetworkTrafficAnnotationTag& traffic_annotation,
const std::string& api_key = google_apis::GetAPIKey());
SafeSearchURLCheckerClient(const SafeSearchURLCheckerClient&) = delete;
SafeSearchURLCheckerClient& operator=(const SafeSearchURLCheckerClient&) =
delete;
~SafeSearchURLCheckerClient() override;
// Checks whether an |url| is restricted according to SafeSearch.
@ -52,8 +56,6 @@ class SafeSearchURLCheckerClient : public URLCheckerClient {
const std::string api_key_;
CheckList checks_in_progress_;
DISALLOW_COPY_AND_ASSIGN(SafeSearchURLCheckerClient);
};
} // namespace safe_search_api

@ -29,6 +29,10 @@ class URLChecker;
class StubURLChecker {
public:
StubURLChecker();
StubURLChecker(const StubURLChecker&) = delete;
StubURLChecker& operator=(const StubURLChecker&) = delete;
~StubURLChecker();
// Returns a URLChecker that will use the stubbed-out responses. Can be called
@ -51,8 +55,6 @@ class StubURLChecker {
network::TestURLLoaderFactory test_url_loader_factory_;
scoped_refptr<network::SharedURLLoaderFactory> test_shared_loader_factory_;
DISALLOW_COPY_AND_ASSIGN(StubURLChecker);
};
} // namespace safe_search_api

@ -43,6 +43,9 @@ class URLChecker {
URLChecker(std::unique_ptr<URLCheckerClient> async_checker,
size_t cache_size);
URLChecker(const URLChecker&) = delete;
URLChecker& operator=(const URLChecker&) = delete;
~URLChecker();
// Returns whether |callback| was run synchronously.
@ -73,8 +76,6 @@ class URLChecker {
base::TimeDelta cache_timeout_;
base::WeakPtrFactory<URLChecker> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(URLChecker);
};
} // namespace safe_search_api