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
This commit is contained in:
Jason Simmons 2019-03-14 12:49:42 -07:00 committed by GitHub
parent e514f0bd18
commit 403337ebb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
};