Commit 86c43476 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Fix missing string copy for a font trace event

The trace event is setting an args on a SkString which may no longer
exists when the trace event id dumped. This trace event needs to
duplicate the string.

As this is a SkString, we can't use the default tracing macro that detect
a str::string argument.

R=oysteine@chromium.org
TBR=drott@chromium.org

Change-Id: I2935bb8162c79edc2f3dc213eb1600fa7f2183e5
Reviewed-on: https://chromium-review.googlesource.com/c/1486873
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Reviewed-by: default avataroysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635241}
parent e86c2dce
...@@ -40,7 +40,7 @@ bool FontLoader::matchFamilyName(const char family_name[], ...@@ -40,7 +40,7 @@ bool FontLoader::matchFamilyName(const char family_name[],
SkStreamAsset* FontLoader::openStream(const FontIdentity& identity) { SkStreamAsset* FontLoader::openStream(const FontIdentity& identity) {
TRACE_EVENT2("font_loader", "FontLoader::openStream", "identity", TRACE_EVENT2("font_loader", "FontLoader::openStream", "identity",
identity.fID, "name", identity.fString.c_str()); identity.fID, "name", TRACE_STR_COPY(identity.fString.c_str()));
{ {
base::AutoLock lock(lock_); base::AutoLock lock(lock_);
auto mapped_font_files_it = mapped_font_files_.find(identity.fID); auto mapped_font_files_it = mapped_font_files_.find(identity.fID);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment