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

Issue 2311783002: Re-enable PRESUBMIT check for empty unique_ptr<> rvalue (Closed)

Created:
4 years, 3 months ago by Adam Rice
Modified:
4 years, 3 months ago
Reviewers:
sky
CC:
chromium-reviews, ozone-reviews_chromium.org, tdresser+watch_chromium.org, Peter Beverloo, tfarina, mlamouri+watch-notifications_chromium.org, dtapuska+chromiumwatch_chromium.org, oshima+watch_chromium.org, kalyank
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Re-enable PRESUBMIT check for empty unique_ptr<> rvalue ui/PRESUBMIT.py contained a check for constructing an empty unique_ptr<> as an rvalue. It's almost always better to use nullptr instead. However, this check was disabled because it was overly broad, matching things like std::vector<std::unique_ptr<T>>() which cannot be replaced by nullptr. Make the check stricter so that it will not overmatch, and re-enable it. Also fix some violations of the rule that were found during testing. BUG= Committed: https://crrev.com/e3646b0b4f464ac2a648ec228f04ec2cf86141de Cr-Commit-Position: refs/heads/master@{#416865}

Patch Set 1 : Fix it for real #

Total comments: 4

Patch Set 2 : Remove obsolete TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -12 lines) Patch
M ui/PRESUBMIT.py View 1 1 chunk +4 lines, -5 lines 0 comments Download
M ui/display/chromeos/display_configurator_unittest.cc View 1 chunk +2 lines, -3 lines 0 comments Download
M ui/events/blink/input_handler_proxy_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/views/examples/examples_main.cc View 1 chunk +2 lines, -3 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 15 (7 generated)
Adam Rice
4 years, 3 months ago (2016-09-05 08:19:32 UTC) #5
sky
Did you make sure this handles the case that lead me to revert the change ...
4 years, 3 months ago (2016-09-06 18:19:17 UTC) #6
Adam Rice
On 2016/09/06 18:19:17, sky wrote: > Did you make sure this handles the case that ...
4 years, 3 months ago (2016-09-07 02:33:01 UTC) #7
Adam Rice
https://codereview.chromium.org/2311783002/diff/40001/ui/PRESUBMIT.py File ui/PRESUBMIT.py (right): https://codereview.chromium.org/2311783002/diff/40001/ui/PRESUBMIT.py#newcode36 ui/PRESUBMIT.py:36: # TODO(sky): this incorrectly catches templates. Fix and reenable. ...
4 years, 3 months ago (2016-09-07 02:44:09 UTC) #8
sky
LGTM
4 years, 3 months ago (2016-09-07 03:43:35 UTC) #9
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/2311783002/60001
4 years, 3 months ago (2016-09-07 05:29:30 UTC) #11
commit-bot: I haz the power
Committed patchset #2 (id:60001)
4 years, 3 months ago (2016-09-07 06:32:37 UTC) #13
commit-bot: I haz the power
4 years, 3 months ago (2016-09-07 06:34:23 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/e3646b0b4f464ac2a648ec228f04ec2cf86141de
Cr-Commit-Position: refs/heads/master@{#416865}

Powered by Google App Engine
This is Rietveld 408576698