From f4f334e5cfb15e1d8abaf2dd6d3b440f96e521ce Mon Sep 17 00:00:00 2001 From: garyqian Date: Thu, 14 Feb 2019 11:22:57 -0800 Subject: [PATCH] Track flow id --- .../darwin/ios/framework/Source/FlutterEngine.mm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm index 6a855650b9125..8b8bd33fdba2a 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngine.mm @@ -10,6 +10,7 @@ #include "flutter/fml/message_loop.h" #include "flutter/fml/platform/darwin/platform_version.h" +#include "flutter/fml/trace_event.h" #include "flutter/shell/common/engine.h" #include "flutter/shell/common/platform_view.h" #include "flutter/shell/common/shell.h" @@ -61,6 +62,8 @@ @implementation FlutterEngine { int64_t _nextTextureId; + uint64_t _nextPointerFlowId; + BOOL _allowHeadlessExecution; } @@ -117,12 +120,15 @@ - (void)updateViewportMetrics:(blink::ViewportMetrics)viewportMetrics { } - (void)dispatchPointerDataPacket:(std::unique_ptr)packet { - self.shell.GetTaskRunners().GetUITaskRunner()->PostTask( - fml::MakeCopyable([engine = self.shell.GetEngine(), packet = std::move(packet)] { + TRACE_EVENT0("flutter", "dispatchPointerDataPacket"); + TRACE_FLOW_BEGIN("flutter", "PointerEvent", _nextPointerFlowId); + self.shell.GetTaskRunners().GetUITaskRunner()->PostTask(fml::MakeCopyable( + [engine = self.shell.GetEngine(), packet = std::move(packet), flow_id = _nextPointerFlowId] { if (engine) { - engine->DispatchPointerDataPacket(*packet); + engine->DispatchPointerDataPacket(*packet, flow_id); } })); + _nextPointerFlowId++; } - (fml::WeakPtr)platformView {