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

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

Issue 2056153003: value_cleanup: Rewrite more base::ListValue::Append(base::Value*) calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback 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 dff54385c9b12645ddb61372fe0ff9d1b429691d..5c788db0ee8892bfab7f5eb34f0d830cbf570e10 100644
--- a/tools/clang/value_cleanup/ListValueRewriter.h
+++ b/tools/clang/value_cleanup/ListValueRewriter.h
@@ -8,6 +8,7 @@
#define TOOLS_CLANG_VALUE_CLEANUP_LIST_VALUE_REWRITER_H_
#include <memory>
+#include <unordered_set>
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Tooling/Refactoring.h"
@@ -72,8 +73,21 @@ class ListValueRewriter {
void run(
const clang::ast_matchers::MatchFinder::MatchResult& result) override;
- protected:
+ private:
+ clang::tooling::Replacements* const replacements_;
+ };
+
+ class AppendRawPtrCallback
+ : public clang::ast_matchers::MatchFinder::MatchCallback {
+ public:
+ explicit AppendRawPtrCallback(clang::tooling::Replacements* replacements);
+
+ void run(
+ const clang::ast_matchers::MatchFinder::MatchResult& result) override;
+
+ private:
clang::tooling::Replacements* const replacements_;
+ std::unordered_set<const clang::VarDecl*> visited_;
};
AppendBooleanCallback append_boolean_callback_;
@@ -81,6 +95,7 @@ class ListValueRewriter {
AppendDoubleCallback append_double_callback_;
AppendStringCallback append_string_callback_;
AppendReleasedUniquePtrCallback append_released_unique_ptr_callback_;
+ AppendRawPtrCallback append_raw_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