Changeset 214801 in webkit


Ignore:
Timestamp:
Apr 3, 2017 9:46:21 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r214392 - media/restore-from-page-cache.html causes NoEventDispatchAssertion::isEventAllowedInMainThread() assertion failure
https://bugs.webkit.org/show_bug.cgi?id=170087
<rdar://problem/31254822>

Reviewed by Simon Fraser.

Reduce the scope of code that should never dispatch DOM events so as to allow updating contents size
after restoring a page from the page cache.

In r214014 we instantiate a NoEventDispatchAssertion in FrameLoader::commitProvisionalLoad()
around the call to CachedPage::restore() to assert when a DOM event is dispatched during
page restoration as such events can cause re-entrancy into the page cache. As it turns out
it is sufficient to ensure that no DOM events are dispatched after restoring all cached frames
as opposed to after CachedPage::restore() returns.

Also rename Document::enqueue{Pageshow, Popstate}Event() to dispatch{Pageshow, Popstate}Event(),
respectively, since they synchronously dispatch events :(. We hope in the future to make them
asynchronously dispatch events.

  • dom/Document.cpp:

(WebCore::Document::implicitClose): Update for renaming.
(WebCore::Document::statePopped): Ditto.
(WebCore::Document::dispatchPageshowEvent): Renamed; formerly named enqueuePageshowEvent().
(WebCore::Document::dispatchPopstateEvent): Renamed; formerly named enqueuePopstateEvent().
(WebCore::Document::enqueuePageshowEvent): Deleted.
(WebCore::Document::enqueuePopstateEvent): Deleted.

  • dom/Document.h:
  • history/CachedPage.cpp:

(WebCore::firePageShowAndPopStateEvents): Moved logic from FrameLoader::didRestoreFromCachedPage() to here.
(WebCore::CachedPage::restore): Modified to call firePageShowAndPopStateEvents().

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::commitProvisionalLoad): Removed use of NoEventDispatchAssertion RAII object. We
will instantiate it in CachedPage::restore() with a smaller scope.
(WebCore::FrameLoader::didRestoreFromCachedPage): Deleted; moved logic from here to WebCore::firePageShowAndPopStateEvents().

  • loader/FrameLoader.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog

    r214800 r214801  
     12017-03-24  Daniel Bates  <dabates@apple.com>
     2
     3        media/restore-from-page-cache.html causes NoEventDispatchAssertion::isEventAllowedInMainThread() assertion failure
     4        https://bugs.webkit.org/show_bug.cgi?id=170087
     5        <rdar://problem/31254822>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Reduce the scope of code that should never dispatch DOM events so as to allow updating contents size
     10        after restoring a page from the page cache.
     11
     12        In r214014 we instantiate a NoEventDispatchAssertion in FrameLoader::commitProvisionalLoad()
     13        around the call to CachedPage::restore() to assert when a DOM event is dispatched during
     14        page restoration as such events can cause re-entrancy into the page cache. As it turns out
     15        it is sufficient to ensure that no DOM events are dispatched after restoring all cached frames
     16        as opposed to after CachedPage::restore() returns.
     17
     18        Also rename Document::enqueue{Pageshow, Popstate}Event() to dispatch{Pageshow, Popstate}Event(),
     19        respectively, since they synchronously dispatch events :(. We hope in the future to make them
     20        asynchronously dispatch events.
     21
     22        * dom/Document.cpp:
     23        (WebCore::Document::implicitClose): Update for renaming.
     24        (WebCore::Document::statePopped): Ditto.
     25        (WebCore::Document::dispatchPageshowEvent): Renamed; formerly named enqueuePageshowEvent().
     26        (WebCore::Document::dispatchPopstateEvent): Renamed; formerly named enqueuePopstateEvent().
     27        (WebCore::Document::enqueuePageshowEvent): Deleted.
     28        (WebCore::Document::enqueuePopstateEvent): Deleted.
     29        * dom/Document.h:
     30        * history/CachedPage.cpp:
     31        (WebCore::firePageShowAndPopStateEvents): Moved logic from FrameLoader::didRestoreFromCachedPage() to here.
     32        (WebCore::CachedPage::restore): Modified to call firePageShowAndPopStateEvents().
     33        * loader/FrameLoader.cpp:
     34        (WebCore::FrameLoader::commitProvisionalLoad): Removed use of NoEventDispatchAssertion RAII object. We
     35        will instantiate it in CachedPage::restore() with a smaller scope.
     36        (WebCore::FrameLoader::didRestoreFromCachedPage): Deleted; moved logic from here to WebCore::firePageShowAndPopStateEvents().
     37        * loader/FrameLoader.h:
     38
    1392017-03-24  Brady Eidson  <beidson@apple.com>
    240
Note: See TracChangeset for help on using the changeset viewer.