RESOLVED FIXED64130
Implement didReceiveDataArray callback for CFNetwork based loader
https://bugs.webkit.org/show_bug.cgi?id=64130
Summary Implement didReceiveDataArray callback for CFNetwork based loader
Pratik Solanki
Reported 2011-07-07 16:16:42 PDT
Same as <https://bugs.webkit.org/show_bug.cgi?id=56838> but for the CFNetwork side.
Attachments
Patch (8.17 KB, patch)
2011-07-07 16:46 PDT, Pratik Solanki
no flags
Patch.v2 (8.77 KB, patch)
2011-07-07 18:09 PDT, Pratik Solanki
ddkilzer: review+
Pratik Solanki
Comment 1 2011-07-07 16:46:51 PDT
Pratik Solanki
Comment 2 2011-07-07 18:09:38 PDT
Created attachment 100056 [details] Patch.v2 Updated patch that should apply cleanly. It includes some of the header file changes from patch in bug 63674.
Jessie Berlin
Comment 3 2011-07-11 11:49:29 PDT
Comment on attachment 100056 [details] Patch.v2 View in context: https://bugs.webkit.org/attachment.cgi?id=100056&action=review Unofficial r=me! > Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:449 > + CFURLConnectionClient_V6 client = { 6, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0, 0, 0, didReceiveDataArray}; Is there a reason to name this "V6"? Are there versions 4 and 5 somewhere? > Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:877 > + client()->didReceiveDataArray(this, dataArray); I know you are just moving this code, but instead of the extra nesting of and if { ... } else { ... } clause here, it would be better to just do an early return: if (client()->supportsDataArray()) { client()->didReceiveDataArray(this, dataArray); return; } CFIndex count = CFArrayGetCount(.... > Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:885 > + } else { Ditto about an early return being better here.
Pratik Solanki
Comment 4 2011-07-11 11:55:01 PDT
Comment on attachment 100056 [details] Patch.v2 View in context: https://bugs.webkit.org/attachment.cgi?id=100056&action=review >> Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:449 >> + CFURLConnectionClient_V6 client = { 6, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0, 0, 0, didReceiveDataArray}; > > Is there a reason to name this "V6"? Are there versions 4 and 5 somewhere? Yes. There's CFURLConnectionClient_V4 and CFURLConnectionClient_V5 in CFURLConnection.h. >> Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:877 >> + client()->didReceiveDataArray(this, dataArray); > > I know you are just moving this code, but instead of the extra nesting of and if { ... } else { ... } clause here, it would be better to just do an early return: > > if (client()->supportsDataArray()) { > client()->didReceiveDataArray(this, dataArray); > return; > } > > CFIndex count = CFArrayGetCount(.... Ok. I can do that. >> Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:885 >> + } else { > > Ditto about an early return being better here. Ok.
David Kilzer (:ddkilzer)
Comment 5 2011-07-11 13:02:10 PDT
Comment on attachment 100056 [details] Patch.v2 r=me with jessieberlin's comments addressed.
Pratik Solanki
Comment 6 2011-07-12 11:47:34 PDT
Note You need to log in before you can comment on or make changes to this bug.