Skip to content
  • commit-queue@webkit.org's avatar
    [Qt][WK2] Implement Download support in WebProcess · e131cac9
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=68153
    
    Patch by Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> on 2011-09-21
    Reviewed by Andreas Kling.
    
    Source/WebCore:
    
    Refactored QNetworkReplyHandler::finish() in order to add
    and use the static function QNetworkReplyHandler::errorForReply().
    This will be used by our Download implementation in WebKit2 (WebProcess)
    when handling ResourceError.
    
    * platform/network/qt/QNetworkReplyHandler.cpp:
    (WebCore::QNetworkReplyHandler::finish):
    (WebCore::QNetworkReplyHandler::errorForReply):
    * platform/network/qt/QNetworkReplyHandler.h:
    * platform/network/qt/ResourceRequest.h:
    
    Source/WebKit2:
    
    We implement the necessary functions of Download.h, and our QtFileDownloader
    to handle all network communication and call the necessary functions of Download.
    
    We use the download policy for any MIME type not supported by WebKit. This
    behaves like Qt non-WebKit2 except that we don't force download when
    we encounter Content-Disposition: attachment. We still use the "filename="
    field for file name suggestion though.
    
    Based on original patches by: Kimmo Kinnunen <kimmo.t.kinnunen@nokia.com>,
    Jocelyn Turcotte <jocelyn.turcotte@nokia.com>, Simon Hausmann <simon.hausmann@nokia.com>
    and Zalan Bujtas <zalan.bujtas@nokia.com>.
    
    * UIProcess/API/qt/qweberror.cpp: Adding DownloadError
    (QWebError::type):
    * UIProcess/API/qt/qweberror.h: Adding DownloadError
    * WebKit2.pro:
    * WebProcess/Downloads/Download.cpp: Adding QtFileDownloader, Qt platform specific
    (WebKit::Download::Download):
    * WebProcess/Downloads/Download.h: Adding QtFileDownloader, Qt platform specific
    * WebProcess/Downloads/qt/DownloadQt.cpp:
    (WebKit::Download::start):
    (WebKit::Download::startWithHandle):
    (WebKit::Download::cancel):
    (WebKit::Download::platformInvalidate):
    (WebKit::Download::didDecideDestination):
    * WebProcess/Downloads/qt/QtFileDownloader.cpp: Added.
    (WebKit::QtFileDownloader::QtFileDownloader):
    (WebKit::QtFileDownloader::~QtFileDownloader):
    (WebKit::QtFileDownloader::determineFilename):
    (WebKit::QtFileDownloader::decidedDestination):
    (WebKit::QtFileDownloader::abortDownloadWritingAndEmitError):
    (WebKit::QtFileDownloader::onReadyRead):
    (WebKit::QtFileDownloader::onFinished):
    (WebKit::QtFileDownloader::onError):
    (WebKit::QtFileDownloader::cancel):
    * WebProcess/Downloads/qt/QtFileDownloader.h: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    e131cac9