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

Issue 446203003: scoped_refptr implicit conversion cleanup tool. (Closed)

Created:
6 years, 4 months ago by dcheng
Modified:
6 years, 4 months ago
Reviewers:
Nico, Ryan Sleevi, mdempsky
CC:
chromium-reviews
Project:
chromium
Visibility:
Public.

Description

scoped_refptr implicit conversion cleanup tool. Adapted from rsleevi's original patch. The initial version of the tool rewrites all implicit conversions of scoped_refptr<T> to T*, even unsafe ones where a temporary scoped_refptr<T> is assigned to a T*. A small tweak/hack has also been added to run_tool.py to allow it to handle replacements that contain embedded newlines. BUG=110610 R=mdempsky@chromium.org, thakis@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288163

Patch Set 1 #

Patch Set 2 : Fix for macros. Trial and error is best programming method. #

Patch Set 3 : Small comment changes, synthesize missing original test for an expected result #

Total comments: 4

Patch Set 4 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+871 lines, -12 lines) Patch
A + tools/clang/rewrite_scoped_refptr/Makefile View 1 chunk +1 line, -1 line 0 comments Download
A tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp View 1 2 3 1 chunk +237 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/scoped_refptr.h View 1 chunk +43 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test1-expected.cc View 1 chunk +16 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test1-original.cc View 1 chunk +16 lines, -0 lines 0 comments Download
A + tools/clang/rewrite_scoped_refptr/tests/test10-expected.cc View 1 chunk +9 lines, -5 lines 0 comments Download
A + tools/clang/rewrite_scoped_refptr/tests/test10-original.cc View 1 2 1 chunk +9 lines, -5 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test11-expected.cc View 1 chunk +22 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test11-original.cc View 1 chunk +22 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test12-expected.cc View 1 chunk +45 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test12-original.cc View 1 chunk +45 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test2-expected.cc View 1 chunk +19 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test2-original.cc View 1 chunk +19 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test3-expected.cc View 1 chunk +22 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test3-original.cc View 1 chunk +22 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test4-expected.cc View 1 chunk +22 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test4-original.cc View 1 chunk +22 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test5-expected.cc View 1 chunk +23 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test5-original.cc View 1 chunk +23 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test6-expected.cc View 1 chunk +24 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test6-original.cc View 1 chunk +24 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test7-expected.cc View 1 chunk +21 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test7-original.cc View 1 chunk +21 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test8-expected.cc View 1 chunk +26 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test8-original.cc View 1 chunk +26 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test9-expected.cc View 1 chunk +45 lines, -0 lines 0 comments Download
A tools/clang/rewrite_scoped_refptr/tests/test9-original.cc View 1 chunk +45 lines, -0 lines 0 comments Download
M tools/clang/scripts/run_tool.py View 1 chunk +1 line, -0 lines 0 comments Download
M tools/clang/scripts/test_tool.py View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
dcheng
I'm planning on making a few more updates to this tool before actually running it, ...
6 years, 4 months ago (2014-08-07 18:38:58 UTC) #1
mdempsky
https://codereview.chromium.org/446203003/diff/40001/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp File tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp (right): https://codereview.chromium.org/446203003/diff/40001/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp#newcode54 tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp:54: if (const clang::CXXOperatorCallExpr* op = Might be worth adding ...
6 years, 4 months ago (2014-08-07 22:25:10 UTC) #2
dcheng
https://codereview.chromium.org/446203003/diff/40001/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp File tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp (right): https://codereview.chromium.org/446203003/diff/40001/tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp#newcode54 tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp:54: if (const clang::CXXOperatorCallExpr* op = On 2014/08/07 22:25:10, mdempsky ...
6 years, 4 months ago (2014-08-07 23:11:22 UTC) #3
mdempsky
lgtm
6 years, 4 months ago (2014-08-07 23:13:24 UTC) #4
Nico
rslgtm Maybe add tools/clang/rewrite_scoped_refptr/OWNERS containing you and mdempsky
6 years, 4 months ago (2014-08-07 23:37:33 UTC) #5
dcheng
6 years, 4 months ago (2014-08-07 23:40:37 UTC) #6
Message was sent while issue was closed.
Committed patchset #4 manually as 288163 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698