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

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

Created:
4 years, 4 months ago by Adam Rice
Modified:
4 years, 3 months ago
Reviewers:
clamy
CC:
chromium-reviews, asanka, yusukes+watch_chromium.org, tzik, posciak+watch_chromium.org, shuchen+watch_chromium.org, nasko+codewatch_chromium.org, dcheng, sievers+watch_chromium.org, scheib+watch_chromium.org, ortuno+watch_chromium.org, kinuko+watch, mlamouri+watch-media_chromium.org, miu+watch_chromium.org, jsbell+serviceworker_chromium.org, wjmaclean, iclelland+watch_chromium.org, jam, chasej+watch_chromium.org, jbauman+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, jkarlin+watch_chromium.org, loading-reviews_chromium.org, kalyank, blink-worker-reviews_chromium.org, creis+watch_chromium.org, Peter Beverloo, mlamouri+watch-notifications_chromium.org, Randy Smith (Not in Mondays), nhiroki, feature-media-reviews_chromium.org, mcasas+watch+vc_chromium.org, piman+watch_chromium.org, zork+watch_chromium.org, michaeln, serviceworker-reviews, avayvod+watch_chromium.org, dtapuska+chromiumwatch_chromium.org, kinuko+serviceworker, horo+watch_chromium.org, danakj+watch_chromium.org, James Su, kinuko+fileapi
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 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/641bb021db42cdfd711a97bdc16077c64bb87aea Cr-Commit-Position: refs/heads/master@{#416174}

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 2

Patch Set 3 : Replace a WrapUnique() nested inside a MakeUnique() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -134 lines) Patch
M content/browser/android/java/gin_java_bridge_dispatcher_host.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/android/overscroll_controller_android.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/appcache/appcache_request_handler_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/appcache/appcache_storage_impl_unittest.cc View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/background_sync/background_sync_manager.cc View 1 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/blob_storage/blob_url_request_job_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/bluetooth/frame_connected_bluetooth_devices_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 1 chunk +5 lines, -5 lines 0 comments Download
M content/browser/cache_storage/cache_storage.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/cache_storage/cache_storage_blob_to_disk_cache_unittest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/compositor/gpu_process_transport_factory.cc View 1 2 chunks +13 lines, -13 lines 0 comments Download
M content/browser/compositor/reflector_impl_unittest.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/dom_storage/dom_storage_context_wrapper.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/download/download_request_core.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/fileapi/dragged_file_util_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/fileapi/transient_file_util_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/frame_host/frame_tree_node.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/frame_host/render_widget_host_view_child_frame.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download
M content/browser/frame_host/render_widget_host_view_guest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/async_revalidation_driver_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/navigation_url_loader_unittest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_impl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/loader/upload_data_stream_builder.cc View 3 chunks +9 lines, -9 lines 0 comments Download
M content/browser/media/android/url_provision_fetcher.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/media/capture/screen_capture_device_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/media/capture/web_contents_video_capture_device_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/notifications/platform_notification_context_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/plugin_private_storage_helper.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/browser/renderer_host/delegated_frame_host.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/input/synthetic_pointer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/media/media_stream_dispatcher_host.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_buffer_pool_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/p2p/socket_host_udp_unittest.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/pepper/browser_ppapi_host_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_view_host_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_android.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/resource_context_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_browsertest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_dispatcher_host_unittest.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_process_manager_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_read_from_cache_job_unittest.cc View 1 3 chunks +6 lines, -6 lines 0 comments Download
M content/browser/service_worker/service_worker_url_request_job_unittest.cc View 1 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_version_unittest.cc View 1 4 chunks +4 lines, -4 lines 0 comments Download
M content/browser/storage_partition_impl_unittest.cc View 3 chunks +6 lines, -6 lines 0 comments Download
M content/browser/streams/stream_url_request_job_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/webui/url_data_manager_backend.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 27 (17 generated)
Adam Rice
4 years, 4 months ago (2016-08-19 08:03:57 UTC) #7
Adam Rice
ping
4 years, 3 months ago (2016-08-29 07:06:09 UTC) #8
mmenke
On 2016/08/29 07:06:09, Adam Rice wrote: > ping There's a huge CC list on this ...
4 years, 3 months ago (2016-08-29 10:14:28 UTC) #9
Adam Rice
-sievers, +clamy
4 years, 3 months ago (2016-08-31 08:14:23 UTC) #13
clamy
Thanks! One question below. https://codereview.chromium.org/2256173002/diff/20001/content/browser/appcache/appcache_storage_impl_unittest.cc File content/browser/appcache/appcache_storage_impl_unittest.cc (right): https://codereview.chromium.org/2256173002/diff/20001/content/browser/appcache/appcache_storage_impl_unittest.cc#newcode172 content/browser/appcache/appcache_storage_impl_unittest.cc:172: base::WrapUnique(new AppCacheInterceptor()))); This second WrapUnique ...
4 years, 3 months ago (2016-08-31 18:46:59 UTC) #16
Adam Rice
https://codereview.chromium.org/2256173002/diff/20001/content/browser/appcache/appcache_storage_impl_unittest.cc File content/browser/appcache/appcache_storage_impl_unittest.cc (right): https://codereview.chromium.org/2256173002/diff/20001/content/browser/appcache/appcache_storage_impl_unittest.cc#newcode172 content/browser/appcache/appcache_storage_impl_unittest.cc:172: base::WrapUnique(new AppCacheInterceptor()))); On 2016/08/31 18:46:59, clamy wrote: > This ...
4 years, 3 months ago (2016-09-01 11:25:14 UTC) #18
clamy
Thanks! Lgtm
4 years, 3 months ago (2016-09-01 18:22:23 UTC) #22
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/2256173002/40001
4 years, 3 months ago (2016-09-02 02:47:07 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 3 months ago (2016-09-02 02:51:27 UTC) #25
commit-bot: I haz the power
4 years, 3 months ago (2016-09-02 02:53:44 UTC) #27
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/641bb021db42cdfd711a97bdc16077c64bb87aea
Cr-Commit-Position: refs/heads/master@{#416174}

Powered by Google App Engine
This is Rietveld 408576698