| Index: cc/PRESUBMIT.py
|
| diff --git a/cc/PRESUBMIT.py b/cc/PRESUBMIT.py
|
| index d79ca8005f7f40fa4365f969b21d04b84a9f1ba5..dc114b713adc7e9fb68148faca4a8fc038d3f751 100644
|
| --- a/cc/PRESUBMIT.py
|
| +++ b/cc/PRESUBMIT.py
|
| @@ -162,20 +162,20 @@ def CheckScopedPtr(input_api, output_api,
|
| for f in input_api.AffectedSourceFiles(source_file_filter):
|
| for line_number, line in f.ChangedContents():
|
| # Disallow:
|
| - # return scoped_ptr<T>(foo);
|
| - # bar = scoped_ptr<T>(foo);
|
| + # return std::unique_ptr<T>(foo);
|
| + # bar = std::unique_ptr<T>(foo);
|
| # But allow:
|
| - # return scoped_ptr<T[]>(foo);
|
| - # bar = scoped_ptr<T[]>(foo);
|
| - if re.search(r'(=|\breturn)\s*scoped_ptr<.*?(?<!])>\([^)]+\)', line):
|
| + # return std::unique_ptr<T[]>(foo);
|
| + # bar = std::unique_ptr<T[]>(foo);
|
| + if re.search(r'(=|\breturn)\s*std::unique_ptr<.*?(?<!])>\([^)]+\)', line):
|
| errors.append(output_api.PresubmitError(
|
| ('%s:%d uses explicit scoped_ptr constructor. ' +
|
| - 'Use make_scoped_ptr() instead.') % (f.LocalPath(), line_number)))
|
| + 'Use base::WrapUnique() instead.') % (f.LocalPath(), line_number)))
|
| # Disallow:
|
| - # scoped_ptr<T>()
|
| - if re.search(r'\bscoped_ptr<.*?>\(\)', line):
|
| + # std::unique_ptr<T>()
|
| + if re.search(r'\bstd::unique_ptr<.*?>\(\)', line):
|
| errors.append(output_api.PresubmitError(
|
| - '%s:%d uses scoped_ptr<T>(). Use nullptr instead.' %
|
| + '%s:%d uses std::unique_ptr<T>(). Use nullptr instead.' %
|
| (f.LocalPath(), line_number)))
|
| return errors
|
|
|
|
|