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

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

Created:
4 years, 4 months ago by Adam Rice
Modified:
4 years, 4 months ago
Reviewers:
sadrul
CC:
chromium-reviews, sadrul, yusukes+watch_chromium.org, hidehiko+watch_chromium.org, sievers+watch_chromium.org, rsesek+watch_chromium.org, lhchavez+watch_chromium.org, ozone-reviews_chromium.org, Matt Giuca, jbauman+watch_chromium.org, nona+watch_chromium.org, kalyank, tdresser+watch_chromium.org, Peter Beverloo, mlamouri+watch-notifications_chromium.org, oshima+watch_chromium.org, piman+watch_chromium.org, elijahtaylor+arcwatch_chromium.org, Ian Vollick, tfarina, shuchen+watch_chromium.org, danakj+watch_chromium.org, James Su
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/eb5cdbe2b1cb6dedbb51c544b0cc94b20984eadf Cr-Commit-Position: refs/heads/master@{#413389}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+198 lines, -222 lines) Patch
M ui/app_list/search/mixer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/app_list_view_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M ui/app_list/views/search_box_view.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/app_list/views/search_result_page_view.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/arc/notification/arc_notification_item.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/aura/window.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/ime/input_method_factory.cc View 1 chunk +7 lines, -7 lines 0 comments Download
M ui/base/ime/linux/fake_input_method_context_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/nine_image_painter_factory.cc View 1 chunk +1 line, -2 lines 0 comments Download
M ui/compositor/layer_owner.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/compositor/test/in_process_context_factory.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/display/chromeos/update_display_configuration_task_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/events/event.cc View 1 chunk +11 lines, -13 lines 0 comments Download
M ui/events/event_processor_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M ui/events/gestures/blink/web_gesture_curve_impl.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/events/ozone/device/device_manager.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/ozone/device/udev/device_manager_udev.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/ozone/evdev/event_converter_test_util.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M ui/events/ozone/evdev/event_factory_evdev.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/ozone/evdev/input_device_factory_evdev.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/events/ozone/evdev/libgestures_glue/gesture_property_provider.cc View 2 chunks +7 lines, -7 lines 0 comments Download
M ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/platform/platform_event_source.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/platform/x11/x11_event_source_glib.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/events/platform/x11/x11_event_source_libevent.cc View 2 chunks +28 lines, -35 lines 0 comments Download
M ui/events/test/event_generator.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/events/test/test_event_target.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/events/x/events_x_unittest.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M ui/gfx/image/image.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M ui/gl/gl_context.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/message_center/message_center_impl_unittest.cc View 9 chunks +9 lines, -17 lines 0 comments Download
M ui/message_center/message_center_tray.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/message_center/views/message_popup_collection_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/ozone/common/display_snapshot_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/common/native_display_delegate_ozone.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/demo/ozone_demo.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/ozone/platform/caca/ozone_platform_caca.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/ozone/platform/cast/client_native_pixmap_factory_cast.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/cast/overlay_manager_cast.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/cast/ozone_platform_cast.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc View 1 chunk +1 line, -2 lines 0 comments Download
M ui/ozone/platform/drm/gpu/drm_thread.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/ozone/platform/drm/gpu/drm_thread_proxy.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/drm_window.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/gpu/screen_manager.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M ui/ozone/platform/drm/host/drm_display_host.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/host/drm_display_host_manager.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M ui/ozone/platform/drm/host/drm_overlay_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/drm/ozone_platform_gbm.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M ui/ozone/platform/headless/ozone_platform_headless.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ui/ozone/platform/wayland/fake_server.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/wayland/ozone_platform_wayland.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/ozone/platform/wayland/wayland_connection.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/ozone/platform/wayland/wayland_surface_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/ozone/platform/x11/ozone_platform_x11.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M ui/touch_selection/touch_handle_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/touch_selection/touch_selection_controller_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/border.cc View 2 chunks +5 lines, -6 lines 0 comments Download
M ui/views/controls/button/label_button.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/controls/button/md_text_button.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/controls/menu/menu_scroll_view_container.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/mus/native_widget_mus.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/mus/native_widget_mus_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/mus/views_mus_test_suite.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/mus/window_tree_host_mus.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/painter.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M ui/views/style/mac/dialog_button_border_mac_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/style/platform_style.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M ui/views/style/platform_style_mac.mm View 1 chunk +4 lines, -4 lines 0 comments Download
M ui/views/test/combobox_test_api.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/view.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/wm/core/focus_controller_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (7 generated)
Adam Rice
4 years, 4 months ago (2016-08-19 11:14:56 UTC) #6
sadrul
lgtm
4 years, 4 months ago (2016-08-19 16:51:23 UTC) #7
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/2259753003/1
4 years, 4 months ago (2016-08-22 01:51:12 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-08-22 02:47:45 UTC) #10
commit-bot: I haz the power
4 years, 4 months ago (2016-08-22 02:50:23 UTC) #12
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/eb5cdbe2b1cb6dedbb51c544b0cc94b20984eadf
Cr-Commit-Position: refs/heads/master@{#413389}

Powered by Google App Engine
This is Rietveld 408576698