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

Issue 2251263003: 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:
chromium-reviews, asanka, msramek+watch_chromium.org, sadrul, yusukes+watch_chromium.org, michaelpg+watch-md-settings_chromium.org, hidehiko+watch_chromium.org, dcheng, noyau+watch_chromium.org, markusheintz_, extensions-reviews_chromium.org, Matt Giuca, dzhioev+watch_chromium.org, achuith+watch_chromium.org, raymes+watch_chromium.org, vabr+watchlistautofill_chromium.org, kalyank, dbeam+watch-options_chromium.org, lhchavez+watch_chromium.org, vabr+watchlistpasswordmanager_chromium.org, rouslan+autofill_chromium.org, media-router+watch_chromium.org, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, gcasto+watchlist_chromium.org, dbeam+watch-downloads_chromium.org, sync-reviews_chromium.org, elijahtaylor+arcwatch_chromium.org, michaelpg+watch-options_chromium.org, tfarina, jdonnelly+autofillwatch_chromium.org, estade+watch_chromium.org, dbeam+watch-settings_chromium.org, James Su, stevenjb+watch-md-settings_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/34f9699d9be6dd32931c9e694f61b3022346f4e5 Cr-Commit-Position: refs/heads/master@{#415600}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Rebase #

Patch Set 4 : Fix merge errors #

Patch Set 5 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -149 lines) Patch
M chrome/browser/ui/android/infobars/autofill_save_card_infobar.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/android/infobars/confirm_infobar.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/android/infobars/generated_password_saved_infobar.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/android/infobars/save_password_infobar.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/android/infobars/simple_confirm_infobar_builder.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/android/infobars/translate_infobar.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/app_list/app_list_syncable_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/arc/arc_app_model_builder.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/extension_app_model_builder.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/app_list/launcher_page_event_dispatcher.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/ui/app_list/search/launcher_search/launcher_search_icon_image_loader_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/search/launcher_search/launcher_search_provider.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/search/search_controller_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/app_list/search/search_resource_manager.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/ui/ash/app_list/app_list_service_ash.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/ash/system_tray_delegate_chromeos.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/autofill/chrome_autofill_client.cc View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/browser_window_state.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/extension_view_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.mm View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/website_settings/permission_prompt_impl_views_mac.mm View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/content_settings/content_setting_image_model.cc View 1 chunk +5 lines, -5 lines 0 comments Download
M chrome/browser/ui/extensions/extension_enable_flow.cc View 1 chunk +5 lines, -6 lines 0 comments Download
M chrome/browser/ui/omnibox/chrome_omnibox_client.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/omnibox/omnibox_controller_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/passwords/password_dialog_controller_impl_unittest.cc View 3 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/ui/passwords/password_manager_presenter.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/startup/default_browser_infobar_delegate_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/startup/startup_browser_creator_browsertest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/sync/one_click_signin_sync_starter_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/tabs/pinned_tab_service_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc View 4 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/certificate_selector_browsertest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/views/download/download_item_view_md.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/dropdown_bar_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/find_bar_view.cc View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/frame/test_with_browser_view.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/infobars/confirm_infobar.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/infobars/infobar_view.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/sync/one_click_signin_dialog_view_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/login/base_screen_handler.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_ui_unittest.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/certificate_manager_browsertest.cc View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/options/home_page_overlay_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/preferences_browsertest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/options/startup_pages_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/policy_ui_browsertest.cc View 1 2 3 4 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/policy_ui_handler.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/print_preview/extension_printer_handler_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/settings/certificates_handler.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/settings/chromeos/easy_unlock_settings_handler_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/settings/metrics_reporting_handler_unittest.cc View 1 2 3 chunks +5 lines, -9 lines 0 comments Download
M chrome/browser/ui/webui/settings/search_engines_handler.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/sync_internals_message_handler.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 54 (31 generated)
vabr (Chromium)
chrome/browser/ui/passwords/* LGTM
4 years, 4 months ago (2016-08-18 12:59:39 UTC) #6
Adam Rice
4 years, 4 months ago (2016-08-19 12:05:13 UTC) #12
sadrul
I do not own any of the code here. Perhaps you meant to add a ...
4 years, 4 months ago (2016-08-19 16:40:43 UTC) #13
Adam Rice
sadrul: Sorry about that, looks like I looked up owners in the wrong branch. +sky, ...
4 years, 4 months ago (2016-08-22 02:21:43 UTC) #15
sky
LGTM
4 years, 4 months ago (2016-08-22 15:11:49 UTC) #16
Dan Beam
lgtm rs
4 years, 4 months ago (2016-08-23 05:54:03 UTC) #17
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/2251263003/20001
4 years, 4 months ago (2016-08-24 01:50:07 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_amd64-generic_chromium_compile_only_ng/builds/188448) chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 4 months ago (2016-08-24 01:53:56 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/2251263003/40001
4 years, 3 months ago (2016-08-26 11:44:03 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/268280)
4 years, 3 months ago (2016-08-26 11:56:54 UTC) #27
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/2251263003/60001
4 years, 3 months ago (2016-08-29 03:31:26 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/59873) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 3 months ago (2016-08-29 03:33:50 UTC) #32
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/2251263003/80001
4 years, 3 months ago (2016-08-29 03:39:45 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/131619)
4 years, 3 months ago (2016-08-29 04:47:39 UTC) #37
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/2251263003/80001
4 years, 3 months ago (2016-08-29 05:16:11 UTC) #39
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/131666)
4 years, 3 months ago (2016-08-29 06:02:01 UTC) #41
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/2251263003/80001
4 years, 3 months ago (2016-08-29 07:58:52 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/131772)
4 years, 3 months ago (2016-08-29 08:29:38 UTC) #45
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/2251263003/80001
4 years, 3 months ago (2016-08-30 08:22:05 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/283924)
4 years, 3 months ago (2016-08-30 09:16:11 UTC) #49
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/2251263003/80001
4 years, 3 months ago (2016-08-31 08:08:48 UTC) #51
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-08-31 10:14:51 UTC) #52
commit-bot: I haz the power
4 years, 3 months ago (2016-08-31 10:16:42 UTC) #54
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/34f9699d9be6dd32931c9e694f61b3022346f4e5
Cr-Commit-Position: refs/heads/master@{#415600}

Powered by Google App Engine
This is Rietveld 408576698