Bug 1714224 Comment 5 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

This is regression.
See the code before bug 1712930, `CancelSyncTimeoutTimer` should be always called after `SpinEventLoopUntil`.

```
    if (NS_SUCCEEDED(rv)) {
      nsAutoSyncOperation sync(mSuspendedDoc,
                               SyncOperationBehavior::eSuspendInput);
      if (!SpinEventLoopUntil([&]() { return !mFlagSyncLooping; })) {
        rv = NS_ERROR_UNEXPECTED;
      }

      // Time expired... We should throw.
      if (syncTimeoutType == eTimerStarted && !mSyncTimeoutTimer) {
        rv = NS_ERROR_DOM_NETWORK_ERR;
      }

      CancelSyncTimeoutTimer();
    }
```
This is a regression.
See the code before bug 1712930, `CancelSyncTimeoutTimer` should be always called after `SpinEventLoopUntil`.

```
    if (NS_SUCCEEDED(rv)) {
      nsAutoSyncOperation sync(mSuspendedDoc,
                               SyncOperationBehavior::eSuspendInput);
      if (!SpinEventLoopUntil([&]() { return !mFlagSyncLooping; })) {
        rv = NS_ERROR_UNEXPECTED;
      }

      // Time expired... We should throw.
      if (syncTimeoutType == eTimerStarted && !mSyncTimeoutTimer) {
        rv = NS_ERROR_DOM_NETWORK_ERR;
      }

      CancelSyncTimeoutTimer();
    }
```
This is a regression.
See the code before bug 1712930 below, `CancelSyncTimeoutTimer` should be always called after `SpinEventLoopUntil`.

```
    if (NS_SUCCEEDED(rv)) {
      nsAutoSyncOperation sync(mSuspendedDoc,
                               SyncOperationBehavior::eSuspendInput);
      if (!SpinEventLoopUntil([&]() { return !mFlagSyncLooping; })) {
        rv = NS_ERROR_UNEXPECTED;
      }

      // Time expired... We should throw.
      if (syncTimeoutType == eTimerStarted && !mSyncTimeoutTimer) {
        rv = NS_ERROR_DOM_NETWORK_ERR;
      }

      CancelSyncTimeoutTimer();
    }
```

Back to Bug 1714224 Comment 5