File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,7 +189,14 @@ void DartRunner::StartComponent(
189189 fuchsia::sys::Package package,
190190 fuchsia::sys::StartupInfo startup_info,
191191 ::fidl::InterfaceRequest<fuchsia::sys::ComponentController> controller) {
192- TRACE_EVENT1 (" dart" , " StartComponent" , " url" , package.resolved_url .c_str ());
192+ // TRACE_DURATION currently requires that the string data does not change
193+ // in the traced scope. Since |package| gets moved in the construction of
194+ // |thread| below, we cannot ensure that |package.resolved_url| does not
195+ // move or change, so we make a copy to pass to TRACE_DURATION.
196+ // TODO(PT-169): Remove this copy when TRACE_DURATION reads string arguments
197+ // eagerly.
198+ std::string url_copy = package.resolved_url ;
199+ TRACE_EVENT1 (" dart" , " StartComponent" , " url" , url_copy.c_str ());
193200 std::thread thread (RunApplication, this , std::move (package),
194201 std::move (startup_info), context_->svc (),
195202 std::move (controller));
Original file line number Diff line number Diff line change @@ -137,7 +137,14 @@ void Runner::StartComponent(
137137 fuchsia::sys::Package package,
138138 fuchsia::sys::StartupInfo startup_info,
139139 fidl::InterfaceRequest<fuchsia::sys::ComponentController> controller) {
140- TRACE_EVENT0 (" flutter" , " StartComponent" );
140+ // TRACE_DURATION currently requires that the string data does not change
141+ // in the traced scope. Since |package| gets moved in the Application::Create
142+ // call below, we cannot ensure that |package.resolved_url| does not move or
143+ // change, so we make a copy to pass to TRACE_DURATION.
144+ // TODO(PT-169): Remove this copy when TRACE_DURATION reads string arguments
145+ // eagerly.
146+ std::string url_copy = package.resolved_url ;
147+ TRACE_EVENT1 (" flutter" , " StartComponent" , " url" , url_copy.c_str ());
141148 // Notes on application termination: Application typically terminate on the
142149 // thread on which they were created. This usually means the thread was
143150 // specifically created to host the application. But we want to ensure that
You can’t perform that action at this time.
0 commit comments