Fabric: Fixed incorrect systrace marker in UIManagerBinding::dispatchEvent

Summary: `SystraceSection` relies on RAII, so previously it measured only `if (eventTarget) {`'s body.

Reviewed By: mdvacca

Differential Revision: D13123047

fbshipit-source-id: 463fba783763f694b51325f98314d36b7da2f887
This commit is contained in:
Valentin Shergin 2018-11-27 20:58:28 -08:00 committed by Facebook Github Bot
parent 7197aa026b
commit 106de1201b

View File

@ -68,10 +68,11 @@ void UIManagerBinding::dispatchEvent(
const EventTarget *eventTarget, const EventTarget *eventTarget,
const std::string &type, const std::string &type,
const folly::dynamic &payload) const { const folly::dynamic &payload) const {
SystraceSection s("UIManagerBinding::dispatchEvent");
auto eventTargetValue = jsi::Value::null(); auto eventTargetValue = jsi::Value::null();
if (eventTarget) { if (eventTarget) {
SystraceSection s("UIManagerBinding::JSIDispatchFabricEventToTarget");
auto &eventTargetWrapper = auto &eventTargetWrapper =
static_cast<const EventTargetWrapper &>(*eventTarget); static_cast<const EventTargetWrapper &>(*eventTarget);
eventTargetValue = eventTargetWrapper.instanceHandle.lock(runtime); eventTargetValue = eventTargetWrapper.instanceHandle.lock(runtime);