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

Unified Diff: ui/PRESUBMIT.py

Issue 2308473002: ui/PRESUBMIT.py: Recommend MakeUnique() before WrapUnique() (Closed)
Patch Set: Mention WrapUnique as well as MakeUnique Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/PRESUBMIT.py
diff --git a/ui/PRESUBMIT.py b/ui/PRESUBMIT.py
index 482299dda2fc92123ffb5e9c3fa2e8240b2efb7f..4ee1ec87e3a7a8e181fea6606c602131c63c68ef 100644
--- a/ui/PRESUBMIT.py
+++ b/ui/PRESUBMIT.py
@@ -31,7 +31,8 @@ def CheckUniquePtr(input_api, output_api,
r'(=|\breturn)\s*std::unique_ptr<[^\[\]>]+>\([^)]+\)', line):
errors.append(output_api.PresubmitError(
('%s:%d uses explicit std::unique_ptr constructor. ' +
- 'Use base::WrapUnique() instead.') % (f.LocalPath(), line_number)))
+ 'Use base::MakeUnique<T>() or base::WrapUnique() instead.') %
+ (f.LocalPath(), line_number)))
# TODO(sky): this incorrectly catches templates. Fix and reenable.
# Disallow:
# std::unique_ptr<T>()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698