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

Unified Diff: sky/engine/core/frame/Tracing.cpp

Issue 1107853003: Fix up strings Sky passes to base/trace_event (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
Index: sky/engine/core/frame/Tracing.cpp
diff --git a/sky/engine/core/frame/Tracing.cpp b/sky/engine/core/frame/Tracing.cpp
index 3359da2abb77fc51d02999922bd1cf9c567341a1..f05932615f1b50b9280f15b65d2707e78ce6dab1 100644
--- a/sky/engine/core/frame/Tracing.cpp
+++ b/sky/engine/core/frame/Tracing.cpp
@@ -21,13 +21,17 @@ Tracing::~Tracing()
void Tracing::begin(const String& name)
{
StringUTF8Adaptor utf8(name);
- TRACE_EVENT_COPY_BEGIN0("script", utf8.data());
+ // TRACE_EVENT_COPY_BEGIN0 needs a c-style null-terminated string.
jamesr 2015/04/29 00:12:46 in particular, StringUTF8Adapter::data() doesn't r
+ CString cstring(utf8.data(), utf8.length());
jamesr 2015/04/29 00:12:46 this could be std::string as well. I figured CStri
+ TRACE_EVENT_COPY_BEGIN0("script", cstring.data());
}
void Tracing::end(const String& name)
{
StringUTF8Adaptor utf8(name);
- TRACE_EVENT_COPY_END0("script", utf8.data());
+ // TRACE_EVENT_COPY_END0 needs a c-style null-terminated string.
+ CString cstring(utf8.data(), utf8.length());
+ TRACE_EVENT_COPY_END0("script", cstring.data());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698