Skip to content

Commit

Permalink
Track flow id (flutter#7826)
Browse files Browse the repository at this point in the history
(Authored by @nathanrogersgoogle )
  • Loading branch information
GaryQian authored Feb 14, 2019
1 parent b1ce6b7 commit a8aa1ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions shell/platform/darwin/ios/framework/Source/FlutterEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -61,6 +62,8 @@ @implementation FlutterEngine {

int64_t _nextTextureId;

uint64_t _nextPointerFlowId;

BOOL _allowHeadlessExecution;
}

Expand Down Expand Up @@ -117,12 +120,15 @@ - (void)updateViewportMetrics:(blink::ViewportMetrics)viewportMetrics {
}

- (void)dispatchPointerDataPacket:(std::unique_ptr<blink::PointerDataPacket>)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<shell::PlatformView>)platformView {
Expand Down

0 comments on commit a8aa1ee

Please sign in to comment.