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

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

Created:
4 years, 4 months ago by Adam Rice
Modified:
4 years, 3 months ago
Reviewers:
Avi (use Gerrit)
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, Peter Beverloo, posciak+watch_chromium.org, avayvod+watch_chromium.org, johnme+watch_chromium.org, nasko+codewatch_chromium.org, jam, dtapuska+chromiumwatch_chromium.org, feature-media-reviews_chromium.org, scheib+watch_chromium.org, ortuno+watch_chromium.org, mcasas+watch+vc_chromium.org, piman+watch_chromium.org, darin-cc_chromium.org, creis+watch_chromium.org, harkness+watch_chromium.org, mlamouri+watch-media_chromium.org, miu+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/29649b991045c05394dc42641068934b9d494e80 Cr-Commit-Position: refs/heads/master@{#415592}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -72 lines) Patch
M content/renderer/bluetooth/web_bluetooth_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/gpu/frame_swap_message_queue.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/gpu/frame_swap_message_queue_unittest.cc View 2 chunks +7 lines, -7 lines 0 comments Download
M content/renderer/history_controller.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/input/input_event_filter.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/android/media_player_renderer_client_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/media/gpu/rtc_video_encoder_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/media/renderer_gpu_video_accelerator_factories.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/rtc_certificate_generator.cc View 1 chunk +6 lines, -5 lines 0 comments Download
M content/renderer/pepper/content_renderer_pepper_host_factory.cc View 5 chunks +24 lines, -26 lines 0 comments Download
M content/renderer/presentation/presentation_dispatcher.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/push_messaging/push_messaging_dispatcher.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 5 chunks +12 lines, -12 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 22 (12 generated)
Adam Rice
4 years, 4 months ago (2016-08-19 08:07:56 UTC) #6
Adam Rice
This looks like another case where automatically choosing the most-specific reviewer failed. Sorry. -esprehn, +avi
4 years, 3 months ago (2016-08-29 07:21:50 UTC) #8
Avi (use Gerrit)
lgtm stampity stamp
4 years, 3 months ago (2016-08-29 16:00:17 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/2253053003/1
4 years, 3 months ago (2016-08-30 03:45:42 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/288705)
4 years, 3 months ago (2016-08-30 05:33:58 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/2253053003/1
4 years, 3 months ago (2016-08-30 06:34:48 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/288775)
4 years, 3 months ago (2016-08-30 07:55:37 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/2253053003/1
4 years, 3 months ago (2016-08-31 08:08:51 UTC) #19
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 3 months ago (2016-08-31 09:30:40 UTC) #20
commit-bot: I haz the power
4 years, 3 months ago (2016-08-31 09:32:35 UTC) #22
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/29649b991045c05394dc42641068934b9d494e80
Cr-Commit-Position: refs/heads/master@{#415592}

Powered by Google App Engine
This is Rietveld 408576698