Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed)

Created:
4 years, 4 months ago by Adam Rice
Modified:
4 years, 3 months ago
CC:
asvitkine+watch_chromium.org, browser-components-watch_chromium.org, cbentzel+watch_chromium.org, chromium-reviews, darin-cc_chromium.org, devtools-reviews_chromium.org, dougsteed+watch_chromium.org, elijahtaylor+arcwatch_chromium.org, estade+watch_chromium.org, gcasto+watchlist_chromium.org, hidehiko+watch_chromium.org, jam, jdonnelly+autofillwatch_chromium.org, jochen+watch_chromium.org, kinuko+fileapi, lhchavez+watch_chromium.org, markusheintz_, mlamouri+watch-test-runner_chromium.org, mlamouri+watch-content_chromium.org, msramek+watch_chromium.org, nhiroki, noyau+watch_chromium.org, ntp-dev+reviews_chromium.org, oshima+watch_chromium.org, pfeldman, raymes+watch_chromium.org, rouslan+autofill_chromium.org, ryanchung+watch_chromium.org, sheretov+watch_chromium.org, sync-reviews_chromium.org, tfarina, tzik, vabr+watchlistpasswordmanager_chromium.org, vabr+watchlistautofill_chromium.org, vadimgo+watch_chromium.org, wifiprefetch-reviews_google.com, yusukes+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Re-write many calls to WrapUnique() with MakeUnique() A mostly-automated change to convert instances of WrapUnique(new Foo(...)) to MakeUnique<Foo>(...). See the thread at https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/iQgMedVA8-k for background. To avoid requiring too many manual fixups, the change skips some cases that are frequently problematic. In particular, in methods named Foo::Method() it will not try to change WrapUnique(new Foo()) to MakeUnique<Foo>(). This is because Foo::Method() may be accessing an internal constructor of Foo. Cases where MakeUnique<NestedClass>(...) is called within a method of OuterClass are common but hard to detect automatically, so have been fixed-up manually. The only types of manual fix ups applied are: 1) Revert MakeUnique back to WrapUnique 2) Change NULL to nullptr in argument list (MakeUnique cannot forward NULL correctly) 3) Add base:: namespace qualifier where missing. WrapUnique(new Foo) has not been converted to MakeUnique<Foo>() as this might change behaviour if Foo does not have a user-defined constructor. For example, WrapUnique(new int) creates an unitialised integer, but MakeUnique<int>() creates an integer initialised to 0. git cl format has been been run over the CL. Spot-checking has uncovered no cases of mis-formatting. BUG=637812 Committed: https://crrev.com/85ec579564402fad9b6f0d593decf686846fb61f Cr-Commit-Position: refs/heads/master@{#415593}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+349 lines, -384 lines) Patch
M components/arc/arc_service_manager.cc View 2 chunks +12 lines, -13 lines 0 comments Download
M components/arc/bluetooth/arc_bluetooth_bridge.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M components/autofill/content/browser/content_autofill_driver_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/autofill/content/renderer/password_autofill_agent.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/autofill/content/renderer/password_form_conversion_utils_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/autofill/core/browser/payments/payments_client.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M components/bookmarks/browser/bookmark_expanded_state_tracker_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/bookmarks/browser/bookmark_index_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/browsing_data/core/counters/browsing_data_counter.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/browsing_data/core/counters/history_counter.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/cast_certificate/cast_cert_validator.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M components/cast_certificate/cast_crl.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M components/certificate_reporting/error_reporter.cc View 1 chunk +8 lines, -7 lines 0 comments Download
M components/component_updater/component_updater_service.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M components/component_updater/component_updater_service_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M components/content_settings/core/browser/content_settings_pref_provider.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/content_settings/core/browser/content_settings_registry.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M components/content_settings/core/browser/content_settings_utils.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/content_settings/core/browser/website_settings_registry_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/cronet/android/cronet_data_reduction_proxy.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/cronet/android/cronet_url_request_context_adapter.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M components/cronet/android/url_request_context_adapter.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M components/cronet/ios/test/cronet_bidirectional_stream_test.mm View 1 chunk +1 line, -1 line 0 comments Download
M components/cronet/url_request_context_config_unittest.cc View 1 2 chunks +6 lines, -4 lines 0 comments Download
M components/devtools_http_handler/devtools_http_handler_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/display_compositor/buffer_queue.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/display_compositor/compositor_overlay_candidate_validator_android.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/display_compositor/compositor_overlay_candidate_validator_ozone.cc View 1 chunk +3 lines, -5 lines 0 comments Download
M components/dom_distiller/core/distillable_page_detector_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/dom_distiller/core/dom_distiller_store_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/domain_reliability/monitor.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M components/drive/chromeos/change_list_loader.cc View 3 chunks +5 lines, -6 lines 0 comments Download
M components/drive/chromeos/file_system/download_operation.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/drive/chromeos/search_metadata.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/drive/resource_metadata_storage.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/drive/service/fake_drive_service.cc View 10 chunks +13 lines, -15 lines 0 comments Download
M components/exo/buffer.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M components/exo/display.cc View 6 chunks +12 lines, -12 lines 0 comments Download
M components/exo/shared_memory.cc View 1 chunk +8 lines, -8 lines 0 comments Download
M components/exo/shared_memory_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/exo/sub_surface_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/exo/wayland/server.cc View 1 2 11 chunks +19 lines, -20 lines 0 comments Download
M components/feedback/anonymizer_tool.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/feedback/feedback_data_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/feedback/feedback_uploader_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/guest_view/browser/guest_view_base.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/guest_view/browser/guest_view_message_filter.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/history/core/browser/visitsegment_database.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/history/core/test/history_client_fake_bookmarks.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/history/core/test/history_service_test_util.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/invalidation/impl/gcm_invalidation_bridge.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/invalidation/impl/sync_system_resources.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M components/invalidation/impl/ticl_invalidation_service_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/metrics/file_metrics_provider.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/metrics/metrics_log_manager_unittest.cc View 6 chunks +20 lines, -20 lines 0 comments Download
M components/metrics/metrics_service.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
M components/navigation_interception/intercept_navigation_delegate.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/navigation_interception/intercept_navigation_throttle_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_database.cc View 4 chunks +5 lines, -10 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_fetcher_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M components/precache/core/precache_fetcher.cc View 1 3 chunks +6 lines, -6 lines 0 comments Download
M components/prefs/in_memory_pref_store_unittest.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M components/prefs/json_pref_store_unittest.cc View 10 chunks +15 lines, -24 lines 0 comments Download
M components/prefs/overlay_user_pref_store_unittest.cc View 4 chunks +9 lines, -9 lines 0 comments Download
M components/prefs/pref_value_map_unittest.cc View 8 chunks +19 lines, -29 lines 0 comments Download
M components/prefs/testing_pref_store.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M components/printing/test/print_test_content_renderer_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/rappor/rappor_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/safe_browsing_db/database_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/search_engines/default_search_policy_handler.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M components/search_engines/default_search_policy_handler_unittest.cc View 1 2 chunks +10 lines, -11 lines 0 comments Download
M components/search_engines/search_engine_data_type_controller_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/search_engines/template_url_service_util_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/search_provider_logos/logo_cache.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/signin/core/browser/test_signin_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/signin/core/browser/webdata/token_web_data.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/ssl_errors/error_classification_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/subresource_filter/content/browser/subresource_filter_navigation_throttle_unittests.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M components/subresource_filter/core/browser/ruleset_service_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M components/suggestions/image_encoder_ios.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync_bookmarks/bookmark_data_type_controller_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync_sessions/favicon_cache_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync_sessions/revisit/bookmarks_page_revisit_observer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/sync_sessions/revisit/page_revisit_broadcaster.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M components/sync_sessions/revisit/sessions_page_revisit_observer_unittest.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M components/sync_sessions/revisit/typed_url_page_revisit_observer.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/sync_sessions/sync_sessions_metrics_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/syncable_prefs/pref_service_syncable_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/test_runner/tracked_dictionary.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/test_runner/web_test_interfaces.cc View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M components/translate/core/browser/translate_manager_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/translate/core/browser/translate_ui_delegate_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/undo/undo_manager_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/url_matcher/url_matcher_factory.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M components/user_prefs/tracked/segregated_pref_store_unittest.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M components/variations/service/variations_service.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M components/variations/service/variations_service_unittest.cc View 15 chunks +18 lines, -18 lines 0 comments Download
M components/web_resource/web_resource_service.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/webcrypto/algorithms/sha.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/wifi_sync/wifi_config_delegate_chromeos_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/wifi_sync/wifi_credential.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/wifi_sync/wifi_credential_syncable_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M components/wifi_sync/wifi_credential_syncable_service_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 28 (16 generated)
vabr (Chromium)
components/autofill/* LGTM
4 years, 4 months ago (2016-08-18 12:55:53 UTC) #4
Adam Rice
4 years, 4 months ago (2016-08-19 07:48:39 UTC) #8
jochen (gone - plz use gerrit)
lgtm
4 years, 4 months ago (2016-08-23 12:53:22 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2257793002/1
4 years, 3 months ago (2016-08-30 08:27:50 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/249016) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 3 months ago (2016-08-30 08:31:22 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2257793002/20001
4 years, 3 months ago (2016-08-30 11:41:47 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/271281)
4 years, 3 months ago (2016-08-30 11:52:21 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2257793002/20001
4 years, 3 months ago (2016-08-31 03:19:47 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/271951)
4 years, 3 months ago (2016-08-31 03:27:53 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2257793002/40001
4 years, 3 months ago (2016-08-31 07:59:07 UTC) #25
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 3 months ago (2016-08-31 09:34:30 UTC) #26
commit-bot: I haz the power
4 years, 3 months ago (2016-08-31 09:37:08 UTC) #28
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/85ec579564402fad9b6f0d593decf686846fb61f
Cr-Commit-Position: refs/heads/master@{#415593}

Powered by Google App Engine
This is Rietveld 408576698