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

Issue 2259523003: 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:
Nathan Parker
CC:
chromium-reviews, grt+watch_chromium.org, extensions-reviews_chromium.org, chromium-apps-reviews_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/fccaf874e0338cd3a27c0ef71c635399d2197de2 Cr-Commit-Position: refs/heads/master@{#413399}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -52 lines) Patch
M chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer_win.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/blacklist_load_incident_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/delayed_callback_runner_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/download_metadata_manager.cc View 3 chunks +9 lines, -11 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/extension_data_collection_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/incident_reporting_service_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/last_download_finder_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/preference_validation_delegate.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/resource_request_detector.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/variations_seed_signature_analyzer.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/variations_seed_signature_incident_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/safe_browsing/permission_reporter.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_blocking_page.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_database_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (7 generated)
Adam Rice
4 years, 4 months ago (2016-08-19 07:42:48 UTC) #6
Nathan Parker
lgtm I didn't review every file, but I assume it's just the mechanical changes.
4 years, 4 months ago (2016-08-19 17:15:08 UTC) #7
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/2259523003/1
4 years, 4 months ago (2016-08-22 01:54:26 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-08-22 03:39:25 UTC) #10
commit-bot: I haz the power
4 years, 4 months ago (2016-08-22 03:41:08 UTC) #12
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/fccaf874e0338cd3a27c0ef71c635399d2197de2
Cr-Commit-Position: refs/heads/master@{#413399}

Powered by Google App Engine
This is Rietveld 408576698