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

Issue 2254173002: 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:
blink-worker-reviews_chromium.org, chromium-reviews, cmumford, darin-cc_chromium.org, harkness+watch_chromium.org, horo+watch_chromium.org, jam, johnme+watch_chromium.org, jsbell+serviceworker_chromium.org, jsbell+idb_chromium.org, kinuko+serviceworker, kinuko+watch, nhiroki, Peter Beverloo, serviceworker-reviews, tzik
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/bb40326f4ba96cb2691e33855d07a75cbb9c57b7 Cr-Commit-Position: refs/heads/master@{#414315}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+60 lines, -63 lines) Patch
M content/child/child_discardable_shared_memory_manager.cc View 2 chunks +2 lines, -3 lines 0 comments Download
M content/child/child_shared_bitmap_manager.cc View 3 chunks +3 lines, -4 lines 0 comments Download
M content/child/indexed_db/webidbcursor_impl_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/child/push_messaging/push_provider.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/child/resource_dispatcher.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/child/resource_dispatcher_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M content/child/service_worker/web_service_worker_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/child/service_worker/web_service_worker_registration_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/child/shared_memory_data_consumer_handle.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/child/shared_memory_data_consumer_handle_unittest.cc View 6 chunks +25 lines, -25 lines 0 comments Download
M content/child/shared_memory_received_data_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/child/url_response_body_consumer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/child/url_response_body_consumer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/child/web_data_consumer_handle_impl_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/child/web_url_loader_impl.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M content/child/web_url_loader_impl_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 17 (9 generated)
Adam Rice
4 years, 4 months ago (2016-08-22 07:26:07 UTC) #6
michaeln
lgtm, sry i didn't notice earlier i'm not a /content owner, but for mechanical cls ...
4 years, 3 months ago (2016-08-24 00:42:49 UTC) #7
Adam Rice
+jochen Sorry, I used automatic owner assignment and it did the wrong thing on this ...
4 years, 3 months ago (2016-08-24 02:04:50 UTC) #9
esprehn
lgtm
4 years, 3 months ago (2016-08-24 05:22:03 UTC) #11
jochen (gone - plz use gerrit)
lgtm
4 years, 3 months ago (2016-08-24 21:00:00 UTC) #12
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/2254173002/1
4 years, 3 months ago (2016-08-25 03:16:22 UTC) #14
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 3 months ago (2016-08-25 05:27:08 UTC) #15
commit-bot: I haz the power
4 years, 3 months ago (2016-08-25 05:28:33 UTC) #17
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/bb40326f4ba96cb2691e33855d07a75cbb9c57b7
Cr-Commit-Position: refs/heads/master@{#414315}

Powered by Google App Engine
This is Rietveld 408576698