Changeset 90779 in webkit


Ignore:
Timestamp:
Jul 11, 2011 12:33:32 PM (13 years ago)
Author:
yi.4.shen@nokia.com
Message:

[Qt] ASSERTION FAILED in ResourceHandle::setDefersLoading causes crash
https://bugs.webkit.org/show_bug.cgi?id=62808

Source/WebCore:

Reviewed by Benjamin Poulain.

The assertion in ResourceHandle::setDefersLoading assumes asynchronous
content delivery -- To resume a page, first, its main resource loader
calls setDefersLoading to resume loading the main content; then all the
sub-resource loaders calls setDefersLoading to resume sub-contents.
However, since QNetworkReplyHandler delivers content synchronously,
some new sub-resource loaders get created as soon as the main resource
loader resumed, and all these new sub-resource loaders set their
defersLoading flag to false. Then, the assertion fails for these new
sub-resource loaders when calling setDefersLoading on them. As a fix,
this path makes QNetworkReplyHandler deliver content asynchronously.

Test: loader/load-defer-resume-crash.html

  • platform/network/qt/QNetworkReplyHandler.cpp:

(WebCore::QNetworkReplyHandlerCallQueue::setDeferSignals):

  • platform/network/qt/QNetworkReplyHandler.h:

LayoutTests:

Added a test for the crash occurs when load deferring is turned off.

Reviewed by Benjamin Poulain.

  • loader/load-defer-resume-crash-expected.txt: Added.
  • loader/load-defer-resume-crash.html: Added.
  • loader/resources/images.html: Added.
  • platform/chromium/test_expectations.txt: Skip this test since the LayoutTestController::setDefersLoading is not implemented for chromium.
Location:
trunk
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90777 r90779  
     12011-07-11  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        [Qt] ASSERTION FAILED in ResourceHandle::setDefersLoading causes crash
     4        https://bugs.webkit.org/show_bug.cgi?id=62808
     5
     6        Added a test for the crash occurs when load deferring is turned off.
     7
     8        Reviewed by Benjamin Poulain.
     9
     10        * loader/load-defer-resume-crash-expected.txt: Added.
     11        * loader/load-defer-resume-crash.html: Added.
     12        * loader/resources/images.html: Added.
     13        * platform/chromium/test_expectations.txt: Skip this test since the LayoutTestController::setDefersLoading is not implemented for chromium.
     14
    1152011-07-11  Stephen White  <senorblanco@chromium.org>
    216
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r90777 r90779  
    213213// Unskip after implementing LayoutTestController::setDefersLoading and ::goBack.
    214214BUGWK60877 SKIP : loader/navigation-while-deferring-loads.html = FAIL
     215BUGWK60877 SKIP : loader/load-defer-resume-crash.html = FAIL
    215216
    216217// Skipped until new WebSocket protocol is implemented.
  • trunk/Source/WebCore/ChangeLog

    r90775 r90779  
     12011-07-11  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        [Qt] ASSERTION FAILED in ResourceHandle::setDefersLoading causes crash
     4        https://bugs.webkit.org/show_bug.cgi?id=62808
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        The assertion in ResourceHandle::setDefersLoading assumes asynchronous
     9        content delivery -- To resume a page, first, its main resource loader
     10        calls setDefersLoading to resume loading the main content; then all the
     11        sub-resource loaders calls setDefersLoading to resume sub-contents.
     12        However, since QNetworkReplyHandler delivers content synchronously,
     13        some new sub-resource loaders get created as soon as the main resource
     14        loader resumed, and all these new sub-resource loaders set their
     15        defersLoading flag to false. Then, the assertion fails for these new
     16        sub-resource loaders when calling setDefersLoading on them. As a fix,
     17        this path makes QNetworkReplyHandler deliver content asynchronously.
     18
     19        Test: loader/load-defer-resume-crash.html
     20
     21        * platform/network/qt/QNetworkReplyHandler.cpp:
     22        (WebCore::QNetworkReplyHandlerCallQueue::setDeferSignals):
     23        * platform/network/qt/QNetworkReplyHandler.h:
     24
    1252011-07-08  Ryosuke Niwa  <rniwa@webkit.org>
    226
  • trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp

    r88612 r90779  
    182182{
    183183    m_deferSignals = defer;
    184     flush();
     184    QMetaObject::invokeMethod(this, "flush",  Qt::QueuedConnection);
    185185}
    186186
  • trunk/Source/WebCore/platform/network/qt/QNetworkReplyHandler.h

    r88612 r90779  
    4242class QNetworkReplyHandler;
    4343
    44 class QNetworkReplyHandlerCallQueue {
     44class QNetworkReplyHandlerCallQueue : public QObject {
     45    Q_OBJECT
    4546public:
    4647    QNetworkReplyHandlerCallQueue(QNetworkReplyHandler*, bool deferSignals);
     
    6162    QList<EnqueuedCall> m_enqueuedCalls;
    6263
    63     void flush();
     64    Q_INVOKABLE void flush();
    6465};
    6566
Note: See TracChangeset for help on using the changeset viewer.