Summary: | Buildfix for NetworkResourceLoader::continueWillSendRequest() on !PLATFORM(MAC) platforms | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Csaba Osztrogonác <ossy> | ||||||
Component: | New Bugs | Assignee: | Csaba Osztrogonác <ossy> | ||||||
Status: | RESOLVED DUPLICATE | ||||||||
Severity: | Normal | CC: | ap, beidson, brian.holt, cgarcia, darin, kbalazs, mrobinson, ossy, skyul | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 110141 | ||||||||
Attachments: |
|
Description
Csaba Osztrogonác
2013-09-16 07:04:19 PDT
Created attachment 211780 [details]
Patch
It is the originally proposed fix, because there wasn't a better suggestion.
Could you suggest any better fix for it or is it OK after the comment of Kwang Yul Seo? It seems obvious that the issue here is that there is not a function that does what newRequest.nsURLRequest(DoNotUpdateHTTPBody) does without involving a platform-specific request object. Putting in an #ifdef is just a way to avoid doing that. I understand why this code doesn’t compile, but I don’t understand why there is no need to do the operation on non-Mac platforms. I haven’t had time to look more deeply myself and find the answer. This thing was introduced in http://trac.webkit.org/changeset/144216. I'm going to check this change. (In reply to comment #3) > It seems obvious that the issue here is that there is not a function that does what newRequest.nsURLRequest(DoNotUpdateHTTPBody) does without involving a platform-specific request object. Putting in an #ifdef is just a way to avoid doing that. I understand why this code doesn’t compile, but I don’t understand why there is no need to do the operation on non-Mac platforms. > > I haven’t had time to look more deeply myself and find the answer. It turns out we don't even need m_suggestedRequestForWillSendRequest.updateFromDelegatePreservingOldHTTPBody(newRequest); for the Network Process to work on GTK, and the patch in https://bugs.webkit.org/show_bug.cgi?id=125422 is sufficient (I didn't know about this bug when I filed and uploaded that patch). What is still unclear is why we don't need this, but Mac does. Alexey, do you mind giving some insight into this particular line of code? HTTP request body is not sent over IPC, for two reasons: - it's impossible serialize when it's a stream, - it can be huge, and clients don't need it anyway for policy decisions. So I think that all ports need this. Created attachment 219642 [details]
Another patch
I wonder if we can avoid the platform ifdef entirely by moving the NSURLRequest to the platform specific file.
Comment on attachment 219642 [details] Another patch View in context: https://bugs.webkit.org/attachment.cgi?id=219642&action=review > Source/WebCore/platform/network/mac/ResourceRequestMac.mm:229 > - *this = delegateProvidedRequest; > + *this = delegateProvidedRequest.nsURLRequest(DoNotUpdateHTTPBody); This looks like a much slower way to do the same, as we'll need to move all fields into NSURLRequest first, and then back into WebCore types. (In reply to comment #9) > (From update of attachment 219642 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=219642&action=review > > > Source/WebCore/platform/network/mac/ResourceRequestMac.mm:229 > > - *this = delegateProvidedRequest; > > + *this = delegateProvidedRequest.nsURLRequest(DoNotUpdateHTTPBody); > > This looks like a much slower way to do the same, as we'll need to move all fields into NSURLRequest first, and then back into WebCore types. Right, but it's already done by the caller anyway no? Not sure, are you saying that delegateProvidedRequest only has an NSURLRequest in it, and platform request fields are not updated? (In reply to comment #11) > Not sure, are you saying that delegateProvidedRequest only has an NSURLRequest in it, and platform request fields are not updated? What I mean is that the caller already creates a ResourceRequest from a NSURLRequest, so I guess it's equivalent, I'm just moving the request.nsURLRequest(DoNotUpdateHTTPBody) from the caller to the implementation, or am I missing something? m_suggestedRequestForWillSendRequest.updateFromDelegatePreservingOldHTTPBody(newRequest.nsURLRequest(DoNotUpdateHTTPBody)); There are two callers of updateFromDelegatePreservingOldHTTPBody(). The other one is in Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp, and it passes an existing ResourceRequest, not one created from NSURLRequest just for this purpose. It seems that this patch adds another round-trip in this case. (In reply to comment #13) > There are two callers of updateFromDelegatePreservingOldHTTPBody(). The other one is in Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp, and it passes an existing ResourceRequest, not one created from NSURLRequest just for this purpose. > > It seems that this patch adds another round-trip in this case. Oh, fair enough, I missed the other caller. Thanks for clarifying. Comment on attachment 219642 [details]
Another patch
Issue might still exist, but this has changed quite a bit since December, and the patch as-is won’t be needed.
Comment on attachment 211780 [details]
Patch
Looks like we landed something like this a long time ago.
*** This bug has been marked as a duplicate of bug 125422 *** |