private void scrollNativeTo(int x, int y) {
    x = clampHorizontalScroll(x);
    y = clampVerticalScroll(y);

    // We shouldn't do the store to native while processing a touch event since that confuses
    // the gesture processing logic.
    if (mProcessingTouchEvent) {
      mDeferredNativeScrollX = x;
      mDeferredNativeScrollY = y;
      mApplyDeferredNativeScroll = true;
      return;
    }

    if (x == mNativeScrollX && y == mNativeScrollY) return;

    // The scrollNativeTo call should be a simple store, so it's OK to assume it always
    // succeeds.
    mNativeScrollX = x;
    mNativeScrollY = y;

    mDelegate.scrollNativeTo(x, y);
  }