From 5c857ee5bdec4158e3efe79943504adcae72f10e Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 17 Apr 2018 16:02:06 -0700 Subject: [PATCH] Set the start timestamp in the contructor of the first shell. (#5030) --- shell/common/shell.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/shell/common/shell.cc b/shell/common/shell.cc index 468ebaf99b9..dd2940dccbf 100644 --- a/shell/common/shell.cc +++ b/shell/common/shell.cc @@ -16,6 +16,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/glue/trace_event.h" #include "flutter/runtime/dart_vm.h" +#include "flutter/runtime/start_up.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/common/skia_event_tracer_impl.h" #include "flutter/shell/common/switches.h" @@ -145,11 +146,19 @@ std::unique_ptr Shell::CreateShellOnPlatformThread( return shell; } +static void RecordStartupTimestamp() { + if (blink::engine_main_enter_ts == 0) { + blink::engine_main_enter_ts = Dart_TimelineGetMicros(); + } +} + std::unique_ptr Shell::Create( blink::TaskRunners task_runners, blink::Settings settings, Shell::CreateCallback on_create_platform_view, Shell::CreateCallback on_create_rasterizer) { + RecordStartupTimestamp(); + fxl::LogSettings log_settings; log_settings.min_log_level = settings.verbose_logging ? fxl::LOG_INFO : fxl::LOG_ERROR;