⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 185673 in webkit


Ignore:
Timestamp:
Jun 17, 2015, 3:47:56 PM (11 years ago)
Author:
timothy_horton@apple.com
Message:

Repro crash when swiping back from a NY Times article @ WebPageProxy::navigationGestureDidEnd
​https://bugs.webkit.org/show_bug.cgi?id=146083
<rdar://problem/20974232>

Reviewed by Darin Adler.

  • UIProcess/ios/ViewGestureControllerIOS.mm:

(WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
(WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
It is possible to get didSameDocumentNavigationForMainFrame *before*
endSwipeGesture, while the user is still interactively swiping. We
cannot remove the snapshot in this case, nor should we start the active
load monitoring timer; all of these things should happen only after the
swipe is completed and we've performed the navigation.

This was particularly bad (a crash instead of just a disappearing snapshot)
because removing the snapshot also causes m_webPageProxyForBackForwardListForCurrentSwipe
to be nulled out, but then it is dereferenced during endSwipeGesture.

Make sure that we never call removeSwipeSnapshotIfReady unless we were actually
waiting to remove the swipe snapshot (because the gesture had completed).
Most callers already did ensure this, but these two did not.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r185672 r185673  
     12015-06-17  Tim Horton  <timothy_horton@apple.com>
     2
     3        Repro crash when swiping back from a NY Times article @ WebPageProxy::navigationGestureDidEnd
     4        https://bugs.webkit.org/show_bug.cgi?id=146083
     5        <rdar://problem/20974232>
     6
     7        Reviewed by Darin Adler.
     8
     9        * UIProcess/ios/ViewGestureControllerIOS.mm:
     10        (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
     11        (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
     12        It is possible to get didSameDocumentNavigationForMainFrame *before*
     13        endSwipeGesture, while the user is still interactively swiping. We
     14        cannot remove the snapshot in this case, nor should we start the active
     15        load monitoring timer; all of these things should happen only after the
     16        swipe is completed and we've performed the navigation.
     17
     18        This was particularly bad (a crash instead of just a disappearing snapshot)
     19        because removing the snapshot also causes m_webPageProxyForBackForwardListForCurrentSwipe
     20        to be nulled out, but then it is dereferenced during endSwipeGesture.
     21
     22        Make sure that we never call removeSwipeSnapshotIfReady unless we were actually
     23        waiting to remove the swipe snapshot (because the gesture had completed).
     24        Most callers already did ensure this, but these two did not.
     25
    1262015-06-17  Joseph Pecoraro  <pecoraro@apple.com>
    227
  • trunk/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm

    r182214 r185673  
    392392
    393393    // This is nearly equivalent to didFinishLoad in the same document navigation case.
     394    if (!m_swipeWaitingForDidFinishLoad)
     395        return;
     396
    394397    m_swipeWaitingForDidFinishLoad = false;
    395398
    … …  
    403406{
    404407    if (m_webPageProxy.pageLoadState().isLoading())
     408        return;
     409
     410    if (!m_swipeWaitingForSubresourceLoads)
    405411        return;
    406412
Note: See TracChangeset for help on using the changeset viewer.