Java Code Examples for com.facebook.systrace.Systrace#endAsyncFlow()

The following examples show how to use com.facebook.systrace.Systrace#endAsyncFlow() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UIViewOperationQueue.java    From react-native-GPay with MIT License 5 votes vote down vote up
@Override
public void execute() {
  Systrace.endAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "createView", mTag);
  mNativeViewHierarchyManager.createView(
      mThemedContext,
      mTag,
      mClassName,
      mInitialProps);
}
 
Example 2
Source File: EventDispatcher.java    From react-native-GPay with MIT License 5 votes vote down vote up
@Override
public void run() {
  Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "DispatchEventsRunnable");
  try {
    Systrace.endAsyncFlow(
        Systrace.TRACE_TAG_REACT_JAVA_BRIDGE,
        "ScheduleDispatchFrameCallback",
        mHasDispatchScheduledCount.getAndIncrement());
    mHasDispatchScheduled = false;
    Assertions.assertNotNull(mReactEventEmitter);
    synchronized (mEventsToDispatchLock) {
      if (mEventsToDispatchSize > 0) {
        // We avoid allocating an array and iterator, and "sorting" if we don't need to.
        // This occurs when the size of mEventsToDispatch is zero or one.
        if (mEventsToDispatchSize > 1) {
          Arrays.sort(mEventsToDispatch, 0, mEventsToDispatchSize, EVENT_COMPARATOR);
        }
        for (int eventIdx = 0; eventIdx < mEventsToDispatchSize; eventIdx++) {
          Event event = mEventsToDispatch[eventIdx];
          // Event can be null if it has been coalesced into another event.
          if (event == null) {
            continue;
          }
          Systrace.endAsyncFlow(
              Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, event.getEventName(), event.getUniqueID());
          event.dispatch(mReactEventEmitter);
          event.dispose();
        }
        clearEventsToDispatch();
        mEventCookieToLastEventIdx.clear();
      }
    }
  } finally {
    Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
  }
}
 
Example 3
Source File: UIViewOperationQueue.java    From react-native-GPay with MIT License 4 votes vote down vote up
@Override
public void execute() {
  Systrace.endAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "updateLayout", mTag);
  mNativeViewHierarchyManager.updateLayout(mParentTag, mTag, mX, mY, mWidth, mHeight);
}