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

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

Created:
6 years, 6 months ago by Xianzhu
Modified:
6 years, 6 months ago
CC:
abarth-chromium, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-events_chromium.org, dglazkov+blink, eae+blinkwatch
Project:
blink
Visibility:
Public.

Description

Remove TraceStringWithCopy::operator const char*() Remove it 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 and fixed one error in WebKit. Also changed some TRACE_STR_COPY(cstring.ascii().data()) to cstring.ascii() because we always copy CStrings. R=dsinclair,haraken TBR=... changes of callers about TRACE_STR_NO_COPY BUG=382789 (perhaps the reason) Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176375

Patch Set 1 #

Total comments: 5

Patch Set 2 : TraceStringWithCopy/TraceStringWithoutCopy #

Patch Set 3 : Subset #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -25 lines) Patch
M Source/bindings/v8/V8ScriptRunner.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/frame/FrameView.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/PlatformInstrumentation.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/platform/TraceEvent.h View 1 2 3 chunks +13 lines, -21 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (0 generated)
Xianzhu
6 years, 6 months ago (2014-06-17 19:42:45 UTC) #1
Xianzhu
https://codereview.chromium.org/342513003/diff/1/Source/web/WebViewImpl.cpp File Source/web/WebViewImpl.cpp (left): https://codereview.chromium.org/342513003/diff/1/Source/web/WebViewImpl.cpp#oldcode1864 Source/web/WebViewImpl.cpp:1864: TRACE_EVENT1("input", "WebViewImpl::handleInputEvent", "type", inputEventName ? TRACE_STR_COPY(inputEventName->ascii().data()) : "unknown"); Because ...
6 years, 6 months ago (2014-06-17 19:47:13 UTC) #2
dsinclair
https://codereview.chromium.org/342513003/diff/1/Source/platform/TraceEvent.h File Source/platform/TraceEvent.h (right): https://codereview.chromium.org/342513003/diff/1/Source/platform/TraceEvent.h#newcode745 Source/platform/TraceEvent.h:745: template <bool Copy> Can we make the template parameter ...
6 years, 6 months ago (2014-06-17 20:47:16 UTC) #3
Xianzhu
https://codereview.chromium.org/342513003/diff/1/Source/platform/TraceEvent.h File Source/platform/TraceEvent.h (right): https://codereview.chromium.org/342513003/diff/1/Source/platform/TraceEvent.h#newcode745 Source/platform/TraceEvent.h:745: template <bool Copy> On 2014/06/17 20:47:16, dsinclair wrote: > ...
6 years, 6 months ago (2014-06-17 21:27:35 UTC) #4
dsinclair
lgtm
6 years, 6 months ago (2014-06-17 22:14:45 UTC) #5
Xianzhu
On 2014/06/17 22:14:45, dsinclair wrote: > lgtm Thanks. Please also review the similar chromium-side change: ...
6 years, 6 months ago (2014-06-17 22:19:49 UTC) #6
Xianzhu
The CQ bit was checked by wangxianzhu@chromium.org
6 years, 6 months ago (2014-06-17 23:03:41 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/342513003/20001
6 years, 6 months ago (2014-06-17 23:03:56 UTC) #8
haraken
LGTM for bindings/
6 years, 6 months ago (2014-06-17 23:34:14 UTC) #9
Xianzhu
The CQ bit was unchecked by wangxianzhu@chromium.org
6 years, 6 months ago (2014-06-18 00:12:25 UTC) #10
Xianzhu
The CQ bit was checked by wangxianzhu@chromium.org
6 years, 6 months ago (2014-06-18 00:28:32 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/wangxianzhu@chromium.org/342513003/40001
6 years, 6 months ago (2014-06-18 00:29:45 UTC) #12
commit-bot: I haz the power
6 years, 6 months ago (2014-06-18 01:34:42 UTC) #13
Message was sent while issue was closed.
Change committed as 176375

Powered by Google App Engine
This is Rietveld 408576698