Bug 56715 - [Qt] Refactor handling of deferred loads
Summary: [Qt] Refactor handling of deferred loads
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2011-03-19 13:46 PDT by Andreas Kling
Modified: 2011-03-19 15:15 PDT (History)
2 users (show)

See Also:


Attachments
Proposed patch (9.48 KB, patch)
2011-03-19 13:46 PDT, Andreas Kling
kenneth: review+
Details | Formatted Diff | Diff
Proposed patch v2 (10.61 KB, patch)
2011-03-19 14:58 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2011-03-19 13:46:07 PDT
QNetworkReplyHandler is delicious spaghetti.
Comment 1 Andreas Kling 2011-03-19 13:46:42 PDT
Created attachment 86271 [details]
Proposed patch
Comment 2 WebKit Review Bot 2011-03-19 13:50:10 PDT
Attachment 86271 [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:47:  The parameter name "handle" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Kenneth Rohde Christiansen 2011-03-19 13:55:53 PDT
Comment on attachment 86271 [details]
Proposed patch

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

Generally looks good. All tests are passing I suppose :-) ?

> Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:182
> +    , m_deferStart(true)

Shouldn't it be defers?

> Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:184
> +    , m_deferSendResponseIfNeeded(false)

So what is ifNeeded? the defer or the send? tricky how to name these.
Comment 4 Kenneth Rohde Christiansen 2011-03-19 13:59:11 PDT
(In reply to comment #3)
> (From update of attachment 86271 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=86271&action=review
> 
> Generally looks good. All tests are passing I suppose :-) ?
> 
> > Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:182
> > +    , m_deferStart(true)
> 
> Shouldn't it be defers?
> 
> > Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp:184
> > +    , m_deferSendResponseIfNeeded(false)
> 
> So what is ifNeeded? the defer or the send? tricky how to name these.

Btw, I dislike the names loadSynchro.. Also it is not really a kind/mode anymore and it is either sync or async.
Comment 5 Kenneth Rohde Christiansen 2011-03-19 14:19:40 PDT
DataType { AsynchronousData, SynchronousData } ? just thinking here.
Comment 6 Andreas Kling 2011-03-19 14:58:03 PDT
Created attachment 86272 [details]
Proposed patch v2

Updated patch with improved names.
Also sprinkled some assertions over the code.
Comment 7 Benjamin Poulain 2011-03-19 15:08:33 PDT
Comment on attachment 86272 [details]
Proposed patch v2

That looks good to me.

I you have the courage to continue cleaning, it would be nice to make redirection a bit easier to understand. :)
Maybe the constructor should be just calling init() so that the same init() could be called from the redirection called. This recycling of the current QNetworkReplyHandler is confusing :(
Comment 8 Andreas Kling 2011-03-19 15:15:27 PDT
Comment on attachment 86272 [details]
Proposed patch v2

Clearing flags on attachment: 86272

Committed r81560: <http://trac.webkit.org/changeset/81560>
Comment 9 Andreas Kling 2011-03-19 15:15:34 PDT
All reviewed patches have been landed.  Closing bug.