Bug 57075

Summary: [Qt] QNetworkReplyHandler refactoring: signal queue
Product: WebKit Reporter: Luiz Agostini <luiz>
Component: New BugsAssignee: Luiz Agostini <luiz>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, hausmann, jturcotte, kenneth, kling, menard, ossy, webkit.review.bot
Priority: P3 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 57049    
Bug Blocks: 57083, 58375    
Attachments:
Description Flags
patch
none
patch
none
patch none

Description Luiz Agostini 2011-03-24 19:59:58 PDT
Now the idea is to make all signals that come from the QNetworkReply to pass through a queue and to stop that queue when loading is deferred.

This way almost all the deferred logic can be removed from QNetworkReplyHandler class and encapsulated in its own class.
Comment 1 Luiz Agostini 2011-03-24 21:31:00 PDT
Created attachment 86877 [details]
patch

I will not set the review flag because this patch depends on the patch in bug 57049 and all bots would be red.

But please review it.
Comment 2 Jocelyn Turcotte 2011-03-28 07:37:26 PDT
- Please explain why Lock is needed in QNetworkReplyWrapper::receiveMetaData, in a comment as well would be great.
- m_queue->setDeferSignals(m_queue->deferSignals()) could cause surprises if more logic is added to setDeferSignals. Deferring bugs easily slip through tests and some explicit flush() method call would be safer.
- Unless I'm missing something, you shouldn't need the inline keyword at the declaration of receiveReadyRead
Comment 3 Luiz Agostini 2011-04-12 11:31:44 PDT
Created attachment 89232 [details]
patch
Comment 4 WebKit Review Bot 2011-04-12 11:34:20 PDT
Attachment 89232 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebCore/platform/network/qt/QNetworkReplyHandler.h:42:  The parameter name "handler" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/WebCore/platform/network/qt/QNetworkReplyHandler.h:62:  The parameter name "queue" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 2 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Andreas Kling 2011-04-12 11:41:40 PDT
Comment on attachment 89232 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=89232&action=review

> Source/WebCore/platform/network/qt/QNetworkReplyHandler.h:77
> +    void readyRead();

didReceiveReadyRead()?
Comment 6 Luiz Agostini 2011-04-12 11:46:18 PDT
Created attachment 89234 [details]
patch

style fix
Comment 7 Andreas Kling 2011-04-12 11:53:53 PDT
Comment on attachment 89234 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=89234&action=review

r=me. This is a great step towards making this spaghetti understandable without spending 2 hours reading it. :)

> Source/WebCore/platform/network/qt/QNetworkReplyHandler.h:77
> +    void readyRead();

didReceiveReadyRead() or something like that would sound more slot-like.
Comment 8 Luiz Agostini 2011-04-12 14:25:02 PDT
	M	Source/WebCore/ChangeLog
	M	Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
	M	Source/WebCore/platform/network/qt/QNetworkReplyHandler.h
	M	Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
Committed r83634
Comment 9 Csaba Osztrogonác 2011-04-12 17:26:31 PDT
(In reply to comment #8)
>     M    Source/WebCore/ChangeLog
>     M    Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
>     M    Source/WebCore/platform/network/qt/QNetworkReplyHandler.h
>     M    Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
> Committed r83634

It was rolled out by http://trac.webkit.org/changeset/83673,
because it made two layout tests time out:

http://build.webkit.org/results/Qt%20Linux%20Release/r83635%20%2831280%29/results.html
Comment 10 Luiz Agostini 2011-04-12 21:08:06 PDT
	M	Source/WebCore/ChangeLog
	M	Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
	M	Source/WebCore/platform/network/qt/QNetworkReplyHandler.h
	M	Source/WebCore/platform/network/qt/ResourceHandleQt.cpp
Committed r83691
Comment 11 Alexis Menard (darktears) 2011-04-27 09:28:06 PDT
I don't see why It should be part of 2.1.x. It's a huge refactoring with some other patches and has no purpose to be in 2.1.x.