Changeset 95804 in webkit


Ignore:
Timestamp:
Sep 23, 2011 8:06:36 AM (13 years ago)
Author:
jesus@webkit.org
Message:

[Qt][WK2] QtFileDownloader ctor shouldn't call QtFileDownloader::onReadyRead()
https://bugs.webkit.org/show_bug.cgi?id=68696

Reviewed by Andreas Kling.

Instead of connecting signals and calling QtFileDownloader::onReadyRead()
on its constructor, QtFileDownloader will now handle this in start().

  • WebProcess/Downloads/qt/DownloadQt.cpp:

(WebKit::Download::start):

  • WebProcess/Downloads/qt/QtFileDownloader.cpp:

(WebKit::QtFileDownloader::QtFileDownloader):
(WebKit::QtFileDownloader::start):

  • WebProcess/Downloads/qt/QtFileDownloader.h:
Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r95773 r95804  
     12011-09-23  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
     2
     3        [Qt][WK2] QtFileDownloader ctor shouldn't call QtFileDownloader::onReadyRead()
     4        https://bugs.webkit.org/show_bug.cgi?id=68696
     5
     6        Reviewed by Andreas Kling.
     7
     8        Instead of connecting signals and calling QtFileDownloader::onReadyRead()
     9        on its constructor, QtFileDownloader will now handle this in start().
     10
     11        * WebProcess/Downloads/qt/DownloadQt.cpp:
     12        (WebKit::Download::start):
     13        * WebProcess/Downloads/qt/QtFileDownloader.cpp:
     14        (WebKit::QtFileDownloader::QtFileDownloader):
     15        (WebKit::QtFileDownloader::start):
     16        * WebProcess/Downloads/qt/QtFileDownloader.h:
     17
    1182011-09-22  Gopal Raghavan  <gopal.1.raghavan@nokia.com>
    219
  • trunk/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp

    r95631 r95804  
    4747
    4848    m_qtDownloader = new QtFileDownloader(this, adoptPtr(manager->get(m_request.toNetworkRequest())));
     49    m_qtDownloader->start();
    4950}
    5051
  • trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.cpp

    r95631 r95804  
    4444    , m_headersRead(false)
    4545{
     46}
     47
     48QtFileDownloader::~QtFileDownloader()
     49{
     50    if (!m_destinationFile)
     51        return;
     52
     53    abortDownloadWritingAndEmitError(QtFileDownloader::DownloadErrorAborted);
     54}
     55
     56void QtFileDownloader::start()
     57{
    4658    connect(m_reply.get(), SIGNAL(readyRead()), SLOT(onReadyRead()));
    4759    connect(m_reply.get(), SIGNAL(finished()), SLOT(onFinished()));
     
    5062    // Call onReadyRead just in case some data is already waiting.
    5163    onReadyRead();
    52 }
    53 
    54 QtFileDownloader::~QtFileDownloader()
    55 {
    56     if (!m_destinationFile)
    57         return;
    58 
    59     abortDownloadWritingAndEmitError(QtFileDownloader::DownloadErrorAborted);
    6064}
    6165
  • trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h

    r95631 r95804  
    4747    void decidedDestination(const QString& decidedFilePath, bool allowOverwrite);
    4848    void cancel();
     49    void start();
    4950
    5051    enum DownloadError {
Note: See TracChangeset for help on using the changeset viewer.