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

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

Created:
4 years, 4 months ago by Adam Rice
Modified:
4 years, 4 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), ortuno+watch_chromium.org, qsr+mojo_chromium.org, scheib+watch_chromium.org, viettrungluu+watch_chromium.org, yzshen+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/0c937aa64f5309be50d077dd0d29014cf2d0e9b3 Cr-Commit-Position: refs/heads/master@{#414312}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Rebase #

Messages

Total messages: 24 (16 generated)
Adam Rice
4 years, 4 months ago (2016-08-24 09:26:33 UTC) #12
Reilly Grant (use Gerrit)
lgtm
4 years, 4 months ago (2016-08-24 17:25:19 UTC) #15
rkc
lgtm You'll probably need ortuno@ or scheib@ for the rest of BT though.
4 years, 4 months ago (2016-08-24 17:34:53 UTC) #16
Adam Rice
+ortuno for the rest of BT.
4 years, 4 months ago (2016-08-25 03:12:15 UTC) #18
ortuno
lgtm
4 years, 4 months ago (2016-08-25 03:49:21 UTC) #19
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/2254833003/40001
4 years, 4 months ago (2016-08-25 04:56:59 UTC) #21
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 4 months ago (2016-08-25 05:24:26 UTC) #22
commit-bot: I haz the power
4 years, 4 months ago (2016-08-25 05:26:07 UTC) #24
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/0c937aa64f5309be50d077dd0d29014cf2d0e9b3
Cr-Commit-Position: refs/heads/master@{#414312}

Powered by Google App Engine
This is Rietveld 408576698