Changeset 184376 in webkit


Ignore:
Timestamp:
May 15, 2015, 1:03:16 AM (10 years ago)
Author:
Carlos Garcia Campos
Message:

REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
https://bugs.webkit.org/show_bug.cgi?id=144738

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Add ResourceHandle::releaseForDownload() that releases the current
handle to be used as a download.

  • platform/network/ResourceHandle.h:
  • platform/network/soup/ResourceHandleSoup.cpp:

(WebCore::ResourceHandle::releaseForDownload):

Source/WebKit2:

When converting the main resource handle to a download, the
NetworkResourceLoader is aborted, and the ResourceHandle is
cleaned up aborting the download operation. We need to use a
different ResourceHandle for the download operation.

  • Shared/Downloads/soup/DownloadSoup.cpp:

(WebKit::Download::startWithHandle): Use ResourceHandle::releaseForDownload()
instead of reusing the given handle.

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r184374 r184376  
     12015-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
     4        https://bugs.webkit.org/show_bug.cgi?id=144738
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Add ResourceHandle::releaseForDownload() that releases the current
     9        handle to be used as a download.
     10
     11        * platform/network/ResourceHandle.h:
     12        * platform/network/soup/ResourceHandleSoup.cpp:
     13        (WebCore::ResourceHandle::releaseForDownload):
     14
    1152015-05-15  Zan Dobersek  <zdobersek@igalia.com>
    216
  • trunk/Source/WebCore/platform/network/ResourceHandle.h

    r183234 r184376  
    178178
    179179#if USE(SOUP)
     180    RefPtr<ResourceHandle> releaseForDownload(ResourceHandleClient*);
    180181    void continueDidReceiveAuthenticationChallenge(const Credential& credentialFromPersistentStorage);
    181182    void sendPendingRequest();
  • trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp

    r183672 r184376  
    10281028}
    10291029
     1030RefPtr<ResourceHandle> ResourceHandle::releaseForDownload(ResourceHandleClient* downloadClient)
     1031{
     1032    // We don't adopt the ref, as it will be released by cleanupSoupRequestOperation, which should always run.
     1033    RefPtr<ResourceHandle> newHandle = new ResourceHandle(d->m_context.get(), firstRequest(), nullptr, d->m_defersLoading, d->m_shouldContentSniff);
     1034    std::swap(d, newHandle->d);
     1035
     1036    g_signal_handlers_disconnect_matched(newHandle->d->m_soupMessage.get(), G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
     1037    g_object_set_data(G_OBJECT(newHandle->d->m_soupMessage.get()), "handle", newHandle.get());
     1038
     1039    newHandle->d->m_client = downloadClient;
     1040    continueAfterDidReceiveResponse(newHandle.get());
     1041
     1042    return newHandle;
     1043}
     1044
    10301045void ResourceHandle::sendPendingRequest()
    10311046{
  • trunk/Source/WebKit2/ChangeLog

    r184370 r184376  
     12015-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
     4        https://bugs.webkit.org/show_bug.cgi?id=144738
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        When converting the main resource handle to a download, the
     9        NetworkResourceLoader is aborted, and the ResourceHandle is
     10        cleaned up aborting the download operation. We need to use a
     11        different ResourceHandle for the download operation.
     12
     13        * Shared/Downloads/soup/DownloadSoup.cpp:
     14        (WebKit::Download::startWithHandle): Use ResourceHandle::releaseForDownload()
     15        instead of reusing the given handle.
     16
    1172015-05-14  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebKit2/Shared/Downloads/soup/DownloadSoup.cpp

    r174987 r184376  
    231231    ASSERT(!m_resourceHandle);
    232232    m_downloadClient = std::make_unique<DownloadClient>(this);
    233     resourceHandle->setClient(m_downloadClient.get());
    234     m_resourceHandle = resourceHandle;
     233    m_resourceHandle = resourceHandle->releaseForDownload(m_downloadClient.get());
    235234    didStart();
    236235    static_cast<DownloadClient*>(m_downloadClient.get())->handleResponseLater(response);
Note: See TracChangeset for help on using the changeset viewer.