Title: [95804] trunk/Source/WebKit2
- Revision
- 95804
- Author
- [email protected]
- Date
- 2011-09-23 08:06:36 -0700 (Fri, 23 Sep 2011)
Log 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:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (95803 => 95804)
--- trunk/Source/WebKit2/ChangeLog 2011-09-23 14:59:31 UTC (rev 95803)
+++ trunk/Source/WebKit2/ChangeLog 2011-09-23 15:06:36 UTC (rev 95804)
@@ -1,3 +1,20 @@
+2011-09-23 Jesus Sanchez-Palencia <[email protected]>
+
+ [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:
+
2011-09-22 Gopal Raghavan <[email protected]>
[Qt] TouchWebView load test not running
Modified: trunk/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp (95803 => 95804)
--- trunk/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp 2011-09-23 14:59:31 UTC (rev 95803)
+++ trunk/Source/WebKit2/WebProcess/Downloads/qt/DownloadQt.cpp 2011-09-23 15:06:36 UTC (rev 95804)
@@ -46,6 +46,7 @@
ASSERT(!m_qtDownloader);
m_qtDownloader = new QtFileDownloader(this, adoptPtr(manager->get(m_request.toNetworkRequest())));
+ m_qtDownloader->start();
}
void Download::startWithHandle(WebPage* initiatingPage, ResourceHandle* handle, const ResourceRequest& initialRequest, const ResourceResponse& resp)
Modified: trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.cpp (95803 => 95804)
--- trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.cpp 2011-09-23 14:59:31 UTC (rev 95803)
+++ trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.cpp 2011-09-23 15:06:36 UTC (rev 95804)
@@ -43,12 +43,6 @@
, m_error(QNetworkReply::NoError)
, m_headersRead(false)
{
- connect(m_reply.get(), SIGNAL(readyRead()), SLOT(onReadyRead()));
- connect(m_reply.get(), SIGNAL(finished()), SLOT(onFinished()));
- connect(m_reply.get(), SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError)));
-
- // Call onReadyRead just in case some data is already waiting.
- onReadyRead();
}
QtFileDownloader::~QtFileDownloader()
@@ -59,6 +53,16 @@
abortDownloadWritingAndEmitError(QtFileDownloader::DownloadErrorAborted);
}
+void QtFileDownloader::start()
+{
+ connect(m_reply.get(), SIGNAL(readyRead()), SLOT(onReadyRead()));
+ connect(m_reply.get(), SIGNAL(finished()), SLOT(onFinished()));
+ connect(m_reply.get(), SIGNAL(error(QNetworkReply::NetworkError)), SLOT(onError(QNetworkReply::NetworkError)));
+
+ // Call onReadyRead just in case some data is already waiting.
+ onReadyRead();
+}
+
void QtFileDownloader::determineFilename()
{
ASSERT(!m_destinationFile);
Modified: trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h (95803 => 95804)
--- trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h 2011-09-23 14:59:31 UTC (rev 95803)
+++ trunk/Source/WebKit2/WebProcess/Downloads/qt/QtFileDownloader.h 2011-09-23 15:06:36 UTC (rev 95804)
@@ -46,6 +46,7 @@
virtual ~QtFileDownloader();
void decidedDestination(const QString& decidedFilePath, bool allowOverwrite);
void cancel();
+ void start();
enum DownloadError {
DownloadErrorAborted = 0,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes