Commit e08a3425 authored by Hiroyuki Ikezoe's avatar Hiroyuki Ikezoe
Browse files

Bug 1899076 - Add a log when we skip processing each input block. r=botond

parent 0827dada
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -161,6 +161,11 @@ class CancelableBlockState : public InputBlockState {
   */
  bool IsContentResponseTimerExpired() const;

  /**
   * Checks if the content has responded.
   */
  bool HasContentResponded() const { return mContentResponded; }

  /**
   * @return true iff web content cancelled this block of events.
   */
@@ -346,6 +351,13 @@ class PanGestureBlockState : public CancelableBlockState {
    return mAllowedScrollDirections;
  }

  bool IsWaitingForBrowserGestureResponse() const {
    return mWaitingForBrowserGestureResponse;
  }
  bool IsWaitingForContentResponse() const {
    return mWaitingForContentResponse;
  }

 private:
  bool mInterrupted;
  bool mWaitingForContentResponse;
@@ -378,6 +390,10 @@ class PinchGestureBlockState : public CancelableBlockState {

  void SetNeedsToWaitForContentResponse(bool aWaitForContentResponse);

  bool IsWaitingForContentResponse() const {
    return mWaitingForContentResponse;
  }

 private:
  bool mInterrupted;
  bool mWaitingForContentResponse;
+31 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@

static mozilla::LazyLogModule sApzInpLog("apz.inputqueue");
#define INPQ_LOG(...) MOZ_LOG(sApzInpLog, LogLevel::Debug, (__VA_ARGS__))
#define INPQ_LOG_TEST() MOZ_LOG_TEST(sApzInpLog, LogLevel::Debug)

namespace mozilla {
namespace layers {
@@ -1058,6 +1059,36 @@ bool InputQueue::ProcessQueue() {
    InputBlockState* curBlock = mQueuedInputs[0]->Block();
    CancelableBlockState* cancelable = curBlock->AsCancelableBlock();
    if (cancelable && !cancelable->IsReadyForHandling()) {
      if (MOZ_UNLIKELY(INPQ_LOG_TEST())) {
        nsAutoCString additionalLog;
        if (curBlock->AsTouchBlock()) {
          // touch
          additionalLog.AppendPrintf(
              "waiting-long-tap-result: %d allowed-touch-behaviors: %d",
              curBlock->AsTouchBlock()->IsWaitingLongTapResult(),
              curBlock->AsTouchBlock()->HasAllowedTouchBehaviors());
        } else if (curBlock->AsPanGestureBlock()) {
          // pan gesture
          additionalLog.AppendPrintf(
              "waiting-browser-gesture-response: %d waiting-content-response: "
              "%d",
              curBlock->AsPanGestureBlock()
                  ->IsWaitingForBrowserGestureResponse(),
              curBlock->AsPanGestureBlock()->IsWaitingForContentResponse());
        } else if (curBlock->AsPinchGestureBlock()) {
          // pinch gesture
          additionalLog.AppendPrintf(
              "waiting-content-response: %d",
              curBlock->AsPinchGestureBlock()->IsWaitingForContentResponse());
        }

        INPQ_LOG(
            "skip processing %s block %p; target-confirmed: %d "
            "content-responded: %d content-response-expired: %d %s",
            cancelable->Type(), cancelable, cancelable->IsTargetConfirmed(),
            cancelable->HasContentResponded(),
            cancelable->IsContentResponseTimerExpired(), additionalLog.get());
      }
      break;
    }