|
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.
Miscellaneous minor cleanups were applied.
BUG= 637812
Committed: https://crrev.com/0c39556939fdc7a522d9092f8a45e783550322c8
Cr-Commit-Position: refs/heads/master@{#418795}
Total comments: 10
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+77 lines, -77 lines) |
Patch |
 |
M |
chrome/common/chrome_content_client.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/common/extensions/api/extension_action/page_action_manifest_unittest.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
|
View
|
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/installer/util/beacons.cc
|
View
|
|
1 chunk |
+9 lines, -9 lines |
0 comments
|
Download
|
 |
M |
chrome/installer/util/browser_distribution.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/installer/util/lzma_file_allocator_unittest.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/installer/util/scoped_user_protocol_entry_unittest.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/renderer/extensions/extension_localization_peer.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/renderer/extensions/extension_localization_peer_unittest.cc
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/renderer/pepper/chrome_renderer_pepper_host_factory.cc
|
View
|
|
4 chunks |
+12 lines, -13 lines |
0 comments
|
Download
|
 |
M |
chrome/renderer/pepper/pepper_helper.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/renderer/security_filter_peer.cc
|
View
|
|
4 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
 |
M |
chrome/service/service_process.cc
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/service/service_process_prefs.cc
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/test/base/chrome_render_view_test.cc
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/test/base/test_browser_window.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/test/base/testing_profile.cc
|
View
|
1
|
4 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
 |
M |
chrome/test/chromedriver/chrome/devtools_client_impl_unittest.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/test/chromedriver/commands.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/test/chromedriver/net/url_request_context_getter.cc
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/utility/importer/edge_database_reader_win.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/utility/safe_browsing/mac/hfs.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/utility/safe_browsing/mac/udif.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
Total messages: 25 (15 generated)
|