|
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/ec7c3997e21fc154ab89a26779d00220c48324f4
Cr-Commit-Position: refs/heads/master@{#418167}
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+128 lines, -139 lines) |
Patch |
|
M |
base/containers/mru_cache_unittest.cc
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
base/debug/activity_analyzer.cc
|
View
|
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
base/debug/activity_analyzer_unittest.cc
|
View
|
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
base/debug/activity_tracker.cc
|
View
|
1
2
3
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
base/debug/activity_tracker_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
base/files/important_file_writer_unittest.cc
|
View
|
1
2
3
|
4 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
base/json/json_writer_unittest.cc
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
base/message_loop/message_pump_perftest.cc
|
View
|
1
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
base/metrics/histogram.cc
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
base/metrics/persistent_histogram_allocator.cc
|
View
|
|
6 chunks |
+14 lines, -14 lines |
0 comments
|
Download
|
|
M |
base/metrics/persistent_histogram_allocator_unittest.cc
|
View
|
1
2
3
|
2 chunks |
+4 lines, -6 lines |
0 comments
|
Download
|
|
M |
base/metrics/persistent_sample_map_unittest.cc
|
View
|
1
2
|
1 chunk |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
base/task_scheduler/priority_queue_unittest.cc
|
View
|
|
1 chunk |
+8 lines, -8 lines |
0 comments
|
Download
|
|
M |
base/task_scheduler/scheduler_service_thread.cc
|
View
|
1
2
3
|
1 chunk |
+4 lines, -6 lines |
0 comments
|
Download
|
|
M |
base/task_scheduler/scheduler_worker_pool_impl.cc
|
View
|
1
2
3
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
base/task_scheduler/scheduler_worker_pool_impl_unittest.cc
|
View
|
|
5 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
|
M |
base/task_scheduler/scheduler_worker_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
base/task_scheduler/sequence_unittest.cc
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
base/task_scheduler/task_scheduler_impl.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
base/task_scheduler/task_tracker_unittest.cc
|
View
|
1
2
3
|
5 chunks |
+22 lines, -22 lines |
0 comments
|
Download
|
|
M |
base/test/test_discardable_memory_allocator.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
base/test/test_mock_time_task_runner.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
base/test/test_reg_util_win.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
base/trace_event/memory_dump_manager.cc
|
View
|
1
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
base/trace_event/process_memory_dump.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
base/trace_event/trace_config.cc
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
base/trace_event/trace_event_argument_unittest.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
base/values_unittest.cc
|
View
|
|
11 chunks |
+16 lines, -16 lines |
0 comments
|
Download
|
Total messages: 31 (18 generated)
|