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

Issue 2259823002: 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:
Julia Tuttle
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org, viettrungluu+watch_chromium.org, kinuko+cache_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, eroman, Paweł Hajdan Jr., darin (slow to review), ben+mojo_chromium.org, mmenke, qsr+mojo_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/2deef68d60652155b338b88b1acc1f4be1c51ee3 Cr-Commit-Position: refs/heads/master@{#417532}

Patch Set 1 #

Patch Set 2 : Rebase #

Patch Set 3 : Rebase #

Patch Set 4 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+354 lines, -355 lines) Patch
M net/base/chunked_upload_data_stream.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M net/base/elements_upload_data_stream_unittest.cc View 1 12 chunks +27 lines, -27 lines 0 comments Download
M net/cert/internal/path_builder.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/cert/internal/signature_algorithm.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cert_net/cert_net_fetcher_impl_unittest.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M net/cookies/cookie_monster.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/cookies/cookie_monster_store_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/cookies/cookie_monster_unittest.cc View 1 2 3 2 chunks +2 lines, -2 lines 0 comments Download
M net/disk_cache/simple/simple_backend_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/dns/dns_session.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/dns/dns_transaction_unittest.cc View 5 chunks +13 lines, -13 lines 0 comments Download
M net/dns/host_resolver_impl.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/dns/host_resolver_impl_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/ftp/ftp_network_layer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/bidirectional_stream.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/http/bidirectional_stream_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_auth_handler_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/http_auth_handler_negotiate_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/http_cache.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_cache_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/http/http_network_transaction_unittest.cc View 1 2 3 14 chunks +20 lines, -20 lines 0 comments Download
M net/http/http_stream_factory_impl_job_controller_unittest.cc View 1 2 3 8 chunks +22 lines, -22 lines 0 comments Download
M net/http/http_stream_parser_unittest.cc View 1 2 3 5 chunks +11 lines, -10 lines 0 comments Download
M net/http/mock_http_cache.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/http/transport_security_state.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/log/net_log_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/proxy/dhcp_proxy_script_fetcher_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/mock_proxy_resolver.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/mojo_proxy_resolver_factory_impl.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M net/proxy/mojo_proxy_resolver_impl.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/proxy/proxy_resolver_factory_mojo_unittest.cc View 1 2 3 5 chunks +13 lines, -12 lines 0 comments Download
M net/proxy/proxy_resolver_v8_tracing_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/proxy/proxy_script_fetcher_impl_unittest.cc View 1 chunk +7 lines, -7 lines 0 comments Download
M net/proxy/proxy_service.cc View 1 2 3 6 chunks +11 lines, -12 lines 0 comments Download
M net/proxy/proxy_service_mojo.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/proxy/proxy_service_mojo_unittest.cc View 1 2 3 2 chunks +5 lines, -5 lines 0 comments Download
M net/proxy/proxy_service_unittest.cc View 1 2 3 16 chunks +16 lines, -17 lines 0 comments Download
M net/proxy/proxy_service_v8.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/quic/chromium/crypto_test_utils_chromium.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M net/quic/chromium/quic_chromium_client_session.cc View 1 2 3 2 chunks +6 lines, -6 lines 0 comments Download
M net/quic/chromium/quic_end_to_end_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/quic/chromium/quic_http_stream_test.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/quic/chromium/quic_stream_factory.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M net/quic/test_tools/quic_test_packet_maker.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M net/server/http_server.cc View 1 chunk +1 line, -2 lines 0 comments Download
M net/server/web_socket_encoder.cc View 2 chunks +8 lines, -8 lines 0 comments Download
M net/socket/fuzzed_socket_factory.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M net/spdy/bidirectional_stream_spdy_impl_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/spdy/spdy_network_transaction_unittest.cc View 1 2 3 4 chunks +12 lines, -12 lines 0 comments Download
M net/spdy/spdy_test_util_common.cc View 1 2 3 2 chunks +5 lines, -5 lines 0 comments Download
M net/ssl/default_channel_id_store_unittest.cc View 8 chunks +37 lines, -37 lines 0 comments Download
M net/ssl/ssl_platform_key_chromecast.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/ssl/ssl_platform_key_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/ssl/ssl_platform_key_nss.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/ssl/test_ssl_private_key.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/test/embedded_test_server/request_handler_util.cc View 1 chunk +1 line, -2 lines 0 comments Download
M net/test/url_request/url_request_hanging_read_job.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/test/url_request/url_request_mock_data_job.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/tools/cert_verify_tool/verify_using_path_builder.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/tools/get_server_time/get_server_time.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_fetcher_impl_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_context_builder.cc View 6 chunks +10 lines, -10 lines 0 comments Download
M net/url_request/url_request_context_builder_unittest.cc View 2 chunks +5 lines, -4 lines 0 comments Download
M net/url_request/url_request_data_job_fuzzer.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_ftp_job_unittest.cc View 2 chunks +6 lines, -5 lines 0 comments Download
M net/url_request/url_request_simple_job_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_test_job.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/url_request/url_request_test_util.cc View 1 2 3 3 chunks +14 lines, -13 lines 0 comments Download
M net/url_request/url_request_unittest.cc View 1 2 3 4 chunks +7 lines, -8 lines 0 comments Download
M net/url_request/view_cache_helper_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/websockets/websocket_channel_test.cc View 6 chunks +10 lines, -10 lines 0 comments Download
M net/websockets/websocket_deflate_predictor_impl_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M net/websockets/websocket_stream.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M net/websockets/websocket_stream_cookie_test.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M net/websockets/websocket_stream_test.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 29 (21 generated)
Adam Rice
4 years, 3 months ago (2016-08-29 03:34:37 UTC) #18
Adam Rice
ping gavinp Do you want me to reassign?
4 years, 3 months ago (2016-08-31 08:19:32 UTC) #19
Adam Rice
-gavinp, +juliatuttle
4 years, 3 months ago (2016-09-02 14:06:09 UTC) #21
Adam Rice
ping juliatuttle
4 years, 3 months ago (2016-09-07 08:29:00 UTC) #22
Julia Tuttle
lgtm; sorry for the delay.
4 years, 3 months ago (2016-09-07 12:35:20 UTC) #23
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/2259823002/60001
4 years, 3 months ago (2016-09-09 06:54:14 UTC) #26
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 3 months ago (2016-09-09 08:04:26 UTC) #27
commit-bot: I haz the power
4 years, 3 months ago (2016-09-09 08:06:45 UTC) #29
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/2deef68d60652155b338b88b1acc1f4be1c51ee3
Cr-Commit-Position: refs/heads/master@{#417532}

Powered by Google App Engine
This is Rietveld 408576698