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

Issue 2589923002: Add a hardcoded list of methods that need a "Get" prefix. (Closed)

Created:
4 years ago by Łukasz Anforowicz
Modified:
3 years, 8 months ago
Reviewers:
sashab, dcheng, nasko
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a hardcoded list of methods that need a "Get" prefix. BUG=582312 Committed: https://crrev.com/201a8768402bf7914118360149611268ff7f1f33 Cr-Commit-Position: refs/heads/master@{#439818}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed CR feedback from dcheng@. #

Patch Set 3 : Add more methods that need "Get" prepended. #

Patch Set 4 : Remove commented-out lines. #

Total comments: 4

Patch Set 5 : |const std::string&| instead of |std::string| as a parameter type. #

Patch Set 6 : Introduce shouldPrefixFunctionName matcher. #

Patch Set 7 : Rebasing... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -3 lines) Patch
M tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp View 1 2 3 4 5 6 4 chunks +71 lines, -3 lines 0 comments Download
M tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M tools/clang/rewrite_to_chrome_style/tests/methods-original.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (10 generated)
Łukasz Anforowicz
Daniel, can you take an overall look please? https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp File tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp (right): https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp#newcode352 tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp:352: "readyState", ...
4 years ago (2016-12-19 19:07:35 UTC) #2
dcheng
https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp File tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp (right): https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp#newcode343 tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp:343: bool IsMethodNameLikelyToConflictWithTypeName(std::string method_name) { Just call this ShouldPrefixMethodName ('likely' ...
4 years ago (2016-12-19 19:26:52 UTC) #3
Łukasz Anforowicz
https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp File tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp (right): https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp#newcode343 tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp:343: bool IsMethodNameLikelyToConflictWithTypeName(std::string method_name) { On 2016/12/19 19:26:52, dcheng wrote: ...
4 years ago (2016-12-19 21:58:47 UTC) #4
Łukasz Anforowicz
https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp File tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp (right): https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp#newcode352 tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp:352: "readyState", On 2016/12/19 19:07:35, Łukasz Anforowicz wrote: > Nasko, ...
4 years ago (2016-12-20 00:32:05 UTC) #5
Łukasz Anforowicz
On 2016/12/20 00:32:05, Łukasz Anforowicz wrote: > https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp > File tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp (right): > > https://codereview.chromium.org/2589923002/diff/1/tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp#newcode352 ...
4 years ago (2016-12-20 00:39:58 UTC) #6
Łukasz Anforowicz
On 2016/12/20 00:39:58, Łukasz Anforowicz wrote: > On 2016/12/20 00:32:05, Łukasz Anforowicz wrote: > > ...
4 years ago (2016-12-20 00:41:36 UTC) #7
dcheng
LGTM Personally I would prefer that we just define ShouldPrefixMethodName (perhaps it should be called ...
4 years ago (2016-12-20 00:42:03 UTC) #8
Łukasz Anforowicz
On 2016/12/20 00:42:03, dcheng wrote: > Personally I would prefer that we just define ShouldPrefixMethodName ...
4 years ago (2016-12-20 00:58:58 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2589923002/100001
4 years ago (2016-12-20 15:40:28 UTC) #12
commit-bot: I haz the power
Failed to apply patch for tools/clang/rewrite_to_chrome_style/RewriteToChromeStyle.cpp: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-20 15:51:21 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2589923002/120001
4 years ago (2016-12-20 16:18:18 UTC) #17
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years ago (2016-12-20 16:29:37 UTC) #20
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/201a8768402bf7914118360149611268ff7f1f33 Cr-Commit-Position: refs/heads/master@{#439818}
4 years ago (2016-12-20 16:33:42 UTC) #22
sashab
Sorry to revive this old CL, but why do we need a global list of ...
3 years, 8 months ago (2017-04-11 00:21:44 UTC) #24
dcheng
3 years, 8 months ago (2017-04-11 00:30:45 UTC) #25
Message was sent while issue was closed.
On 2017/04/11 00:21:44, sashab wrote:
> Sorry to revive this old CL, but why do we need a global list of methods that
> need a "Get" prefix? After the rename, can some of these be renamed back?
Surely
> not all of these methods cause naming conflicts.

The hardcoded list is because the tool didn't have global visibility into naming
decisions. So things like WebFrame::Document() are actually problematic, but the
tool wouldn't necessarily know that. I did suggest a way to do it so we didn't
need to hardcode any lists, but it would be harder to implement and could lead
to local inconsistencies when running the tool on a subset of files.

Most, if not all, of these names still collide with typenames and will need Get
prefixes. There's a few exception in layout code which I'm addressing. Other
than layout, do you specific things in mind that we can rename back?

Powered by Google App Engine
This is Rietveld 408576698