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

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

Created:
4 years, 4 months ago by Adam Rice
Modified:
4 years, 4 months ago
Reviewers:
vabr (Chromium), droger
CC:
chromium-reviews, cbentzel+watch_chromium.org, vabr+watchlistpasswordmanager_chromium.org, ntp-dev+reviews_chromium.org, Peter Beverloo, tfarina, johnme+watch_chromium.org, browser-components-watch_chromium.org, dcheng, jdonnelly+autofillwatch_chromium.org, rouslan+autofill_chromium.org, noyau+watch_chromium.org, asvitkine+watch_chromium.org, zea+watch_chromium.org, vabr+watchlistautofill_chromium.org, estade+watch_chromium.org, gcasto+watchlist_chromium.org, James Su, sync-reviews_chromium.org, sdefresne+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/2b385fe1ca886bbfbc38648f1498a154ac85925a Cr-Commit-Position: refs/heads/master@{#413087}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -120 lines) Patch
M ios/chrome/browser/application_context_impl.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M ios/chrome/browser/autocomplete/autocomplete_classifier_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/autocomplete/shortcuts_backend_factory.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/bookmarks/bookmark_model_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/bookmarks/startup_task_runner_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ios/chrome/browser/browser_state/test_chrome_browser_state.mm View 3 chunks +5 lines, -5 lines 0 comments Download
M ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/favicon/favicon_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/favicon/ios_chrome_favicon_loader_factory.mm View 1 chunk +3 lines, -3 lines 0 comments Download
M ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/google/google_url_tracker_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/history/history_client_impl.cc View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/history/history_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/history/web_history_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.mm View 1 chunk +4 lines, -4 lines 0 comments Download
M ios/chrome/browser/ios_chrome_io_thread.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/ios_chrome_main_parts.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/metrics/ios_chrome_metrics_services_manager_client.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/metrics/ios_chrome_origins_seen_service_factory.cc View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/net/cookie_util.mm View 2 chunks +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/net/ios_chrome_url_request_context_getter.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M ios/chrome/browser/net/proxy_service_factory.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/open_from_clipboard/create_clipboard_recent_content.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/passwords/ios_chrome_password_manager_setting_migrator_service_factory.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M ios/chrome/browser/passwords/password_controller.mm View 1 chunk +3 lines, -3 lines 0 comments Download
M ios/chrome/browser/passwords/password_controller_off_the_record_unittest.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/passwords/password_controller_unittest.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/search_engines/template_url_service_factory.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/services/gcm/ios_chrome_gcm_profile_service_factory.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/signin/account_consistency_service_factory.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/signin/fake_oauth2_token_service_builder.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/signin/gaia_cookie_manager_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/signin/signin_client_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/suggestions/suggestions_service_factory.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.cc View 2 chunks +3 lines, -4 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_profile_sync_test_util.cc View 2 chunks +6 lines, -6 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_sync_client.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/sync/sync_setup_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/translate/translate_accept_languages_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/ui/autofill/autofill_client_ios.mm View 2 chunks +4 lines, -4 lines 0 comments Download
M ios/chrome/browser/web_data_service_factory.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/crnet/crnet_environment.mm View 1 chunk +2 lines, -2 lines 0 comments Download
M ios/net/cookies/cookie_store_ios_unittest.mm View 2 chunks +2 lines, -2 lines 0 comments Download
M ios/net/crn_http_protocol_handler.mm View 2 chunks +3 lines, -3 lines 0 comments Download
M ios/web/shell/shell_url_request_context_getter.mm View 4 chunks +10 lines, -9 lines 0 comments Download
M ios/web/webui/url_data_manager_ios_backend.mm View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (8 generated)
vabr (Chromium)
ios/chrome/browser/passwords/* LGTM
4 years, 4 months ago (2016-08-18 12:57:33 UTC) #6
Adam Rice
4 years, 4 months ago (2016-08-19 07:07:07 UTC) #8
droger
lgtm
4 years, 4 months ago (2016-08-19 08:30:19 UTC) #10
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/2256193002/1
4 years, 4 months ago (2016-08-19 08:30:41 UTC) #11
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-08-19 08:35:29 UTC) #12
commit-bot: I haz the power
4 years, 4 months ago (2016-08-19 08:37:02 UTC) #14
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/2b385fe1ca886bbfbc38648f1498a154ac85925a
Cr-Commit-Position: refs/heads/master@{#413087}

Powered by Google App Engine
This is Rietveld 408576698