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

Issue 2253943004: 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:
chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, imcheng+watch_chromium.org, toyoshim+midi_chromium.org, eme-reviews_chromium.org, posciak+watch_chromium.org, jasonroberts+watch_google.com, viettrungluu+watch_chromium.org, avayvod+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, feature-media-reviews_chromium.org, Aaron Boodman, mcasas+watch+vc_chromium.org, alokp+watch_chromium.org, piman+watch_chromium.org, xjz+watch_chromium.org, ben+mojo_chromium.org, isheriff+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/3cdd7ebe8bd324d3174e8ec3253190908e717a36 Cr-Commit-Position: refs/heads/master@{#414375}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -111 lines) Patch
M media/audio/fake_audio_input_stream.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/audio/fake_audio_log_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/base/android/media_codec_decoder_unittest.cc View 11 chunks +12 lines, -12 lines 0 comments Download
M media/base/android/media_codec_player_unittest.cc View 9 chunks +10 lines, -10 lines 0 comments Download
M media/base/decoder_buffer_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/base/fake_demuxer_stream.cc View 1 chunk +3 lines, -4 lines 0 comments Download
M media/base/media_tracks.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M media/base/stream_parser_buffer.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M media/blink/webmediaplayer_impl_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/capture/video/fake_video_capture_device_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M media/cast/test/sender.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M media/cast/test/simulator.cc View 2 chunks +5 lines, -6 lines 0 comments Download
M media/cast/test/utility/in_process_receiver.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/cdm/simple_cdm_allocator.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/filters/gpu_video_decoder.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/formats/mpeg/adts_stream_parser_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/formats/mpeg/mpeg1_audio_stream_parser_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/gpu/vt_video_decode_accelerator_mac.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/midi/midi_manager_alsa.cc View 3 chunks +7 lines, -7 lines 0 comments Download
M media/midi/midi_manager_android.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M media/midi/usb_midi_device_factory_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/common/media_type_converters.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M media/mojo/common/media_type_converters_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M media/mojo/common/mojo_decoder_buffer_converter.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/common/mojo_decoder_buffer_converter_unittest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M media/mojo/services/android_mojo_media_client.cc View 2 chunks +5 lines, -5 lines 0 comments Download
M media/mojo/services/main.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/services/mojo_cdm_allocator.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/mojo/services/mojo_cdm_service.cc View 4 chunks +6 lines, -7 lines 0 comments Download
M media/mojo/services/mojo_media_application_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/mojo/services/test_mojo_media_client.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M media/muxers/webm_muxer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/muxers/webm_muxer_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M media/renderers/default_renderer_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/renderers/mock_gpu_video_accelerator_factories.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M media/test/pipeline_integration_test.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M media/test/pipeline_integration_test_base.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 21 (13 generated)
Adam Rice
4 years, 4 months ago (2016-08-19 15:22:09 UTC) #10
sandersd (OOO until July 31)
rs lgtm Might be a good candidate for .git-blame-ignore-revs?
4 years, 4 months ago (2016-08-22 20:59:41 UTC) #11
Robert Sesek
lgtm
4 years, 4 months ago (2016-08-24 15:01:18 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/2253943004/1
4 years, 4 months ago (2016-08-25 02:17:30 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/280677)
4 years, 4 months ago (2016-08-25 05:36:21 UTC) #16
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/2253943004/1
4 years, 4 months ago (2016-08-25 06:12:12 UTC) #18
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-08-25 09:43:55 UTC) #19
commit-bot: I haz the power
4 years, 4 months ago (2016-08-25 09:45:34 UTC) #21
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/3cdd7ebe8bd324d3174e8ec3253190908e717a36
Cr-Commit-Position: refs/heads/master@{#414375}

Powered by Google App Engine
This is Rietveld 408576698