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

Issue 338653005: Don't allow direct const char* trace value (Closed)

Created:
6 years, 6 months ago by Xianzhu
Modified:
6 years, 6 months ago
Reviewers:
dsinclair, nduca
CC:
ben+views_chromium.org, cc-bugs_chromium.org, chromium-reviews, darin-cc_chromium.org, dsinclair+watch_chromium.org, erikwright+watch_chromium.org, feature-media-reviews_chromium.org, haitaol+watch_chromium.org, jam, jdduke+watch_chromium.org, maniscalco+watch_chromium.org, sadrul, tdanderson+views_chromium.org, tdresser+watch_chromium.org, tfarina, tim+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

Remove TraceStringWrapper::operator const char*() Remove the operator to avoid misuse like the following: TRACE_EVENT1("a", "b", "c", condition ? TRACE_STR_COPY(short_live_string) : "literal"); In the above case, the argument value is actually const char*, not TraceValueWithCopy because it is automatically converted back to const char* with the const char* operator. Found no errornous usages in chromium, but found one error in WebKit. R=dsinclair BUG=382789 (perhaps the reason) Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278061

Patch Set 1 #

Patch Set 2 : TraceStringWithCopy/TraceStringWithoutCopy #

Patch Set 3 : #

Patch Set 4 : Fix win build #

Patch Set 5 : Subset #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -8 lines) Patch
M base/debug/trace_event.h View 1 2 3 4 4 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Xianzhu
6 years, 6 months ago (2014-06-17 19:35:55 UTC) #1
dsinclair
lgtm
6 years, 6 months ago (2014-06-17 22:26:21 UTC) #2
Xianzhu
The CQ bit was checked by wangxianzhu@chromium.org
6 years, 6 months ago (2014-06-17 23:02:47 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/338653005/40001
6 years, 6 months ago (2014-06-17 23:06:54 UTC) #4
Xianzhu
The CQ bit was checked by wangxianzhu@chromium.org
6 years, 6 months ago (2014-06-17 23:23:57 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/338653005/60001
6 years, 6 months ago (2014-06-17 23:24:38 UTC) #6
Xianzhu
Unfortunately, clang thinks "const T*" and "const char(&)[N]" are ambiguous in overloaded functions. Haven't found ...
6 years, 6 months ago (2014-06-18 00:10:01 UTC) #7
Xianzhu
The CQ bit was checked by wangxianzhu@chromium.org
6 years, 6 months ago (2014-06-18 00:28:58 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/338653005/80001
6 years, 6 months ago (2014-06-18 00:30:58 UTC) #9
commit-bot: I haz the power
6 years, 6 months ago (2014-06-18 14:43:53 UTC) #10
Message was sent while issue was closed.
Change committed as 278061

Powered by Google App Engine
This is Rietveld 408576698