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

Unified Diff: tools/clang/value_cleanup/ListValueRewriter.h

Issue 2056573002: value_cleanup: fixup ListValue::Append() calls that already have a unique_ptr to use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More tests Created 4 years, 6 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 | tools/clang/value_cleanup/ListValueRewriter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/value_cleanup/ListValueRewriter.h
diff --git a/tools/clang/value_cleanup/ListValueRewriter.h b/tools/clang/value_cleanup/ListValueRewriter.h
index b264c81921d1f205a52abd1bdc13e9414e0c404e..dff54385c9b12645ddb61372fe0ff9d1b429691d 100644
--- a/tools/clang/value_cleanup/ListValueRewriter.h
+++ b/tools/clang/value_cleanup/ListValueRewriter.h
@@ -2,15 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Performs simple cleanups of base::ListValue API:
-// - base::ListValue::Append(new base::FundamentalValue(bool))
-// => base::ListValue::AppendBoolean(...)
-// - base::ListValue::Append(new base::FundamentalValue(int))
-// => base::ListValue::AppendInteger(...)
-// - base::ListValue::Append(new base::FundamentalValue(double))
-// => base::ListValue::AppendDouble(...)
-// - base::ListValue::Append(new base::StringValue(...))
-// => base::ListValue::AppendString(...)
+// Handles various rewrites for base::ListValue::Append().
#ifndef TOOLS_CLANG_VALUE_CLEANUP_LIST_VALUE_REWRITER_H_
#define TOOLS_CLANG_VALUE_CLEANUP_LIST_VALUE_REWRITER_H_
@@ -71,10 +63,24 @@ class ListValueRewriter {
const clang::ast_matchers::MatchFinder::MatchResult& result) override;
};
+ class AppendReleasedUniquePtrCallback
+ : public clang::ast_matchers::MatchFinder::MatchCallback {
+ public:
+ explicit AppendReleasedUniquePtrCallback(
+ clang::tooling::Replacements* replacements);
+
+ void run(
+ const clang::ast_matchers::MatchFinder::MatchResult& result) override;
+
+ protected:
+ clang::tooling::Replacements* const replacements_;
+ };
+
AppendBooleanCallback append_boolean_callback_;
AppendIntegerCallback append_integer_callback_;
AppendDoubleCallback append_double_callback_;
AppendStringCallback append_string_callback_;
+ AppendReleasedUniquePtrCallback append_released_unique_ptr_callback_;
};
#endif // TOOLS_CLANG_VALUE_CLEANUP_LIST_VALUE_REWRITER_H_
« no previous file with comments | « no previous file | tools/clang/value_cleanup/ListValueRewriter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698