From 403337ebb893380101d1fa9cc435ce9b6cfeb22c Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 14 Mar 2019 12:49:42 -0700 Subject: [PATCH] Do not pass short-lived buffers as labels to Dart_TimelineEvent (#8166) Dart no longer makes a copy of the label string when recording events. See https://github.com/flutter/engine/pull/8152 --- fml/trace_event.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fml/trace_event.h b/fml/trace_event.h index b8063aca3a2..1f979d4e35e 100644 --- a/fml/trace_event.h +++ b/fml/trace_event.h @@ -205,12 +205,12 @@ void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id); class ScopedInstantEnd { public: - ScopedInstantEnd(std::string str) : label_(std::move(str)) {} + ScopedInstantEnd(const char* str) : label_(str) {} - ~ScopedInstantEnd() { TraceEventEnd(label_.c_str()); } + ~ScopedInstantEnd() { TraceEventEnd(label_); } private: - const std::string label_; + const char* label_; FML_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd); };