• yi.4.shen@nokia.com's avatar
    [Qt] ASSERTION FAILED in ResourceHandle::setDefersLoading causes crash · 78acf879
    yi.4.shen@nokia.com authored
    https://bugs.webkit.org/show_bug.cgi?id=62808
    
    Source/WebCore:
    
    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
    when its load type is set to SynchronousLoad.
    
    Reviewed by Benjamin Poulain.
    
    Test: loader/load-defer-resume-crash.html
    
    * platform/network/qt/QNetworkReplyHandler.cpp:
    (WebCore::QNetworkReplyHandlerCallQueue::setDeferSignals):
    * platform/network/qt/QNetworkReplyHandler.h:
    (WebCore::QNetworkReplyHandler::setLoadingDeferred):
    
    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.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    78acf879
load-defer-resume-crash-expected.txt 49 Bytes