RESOLVED FIXED 136701
NetworkResourceLoader cleanups
https://bugs.webkit.org/show_bug.cgi?id=136701
Summary NetworkResourceLoader cleanups
Antti Koivisto
Reported 2014-09-10 06:16:43 PDT
After smashing it together with the clients it can be made nicer.
Attachments
patch (30.08 KB, patch)
2014-09-10 06:56 PDT, Antti Koivisto
darin: review+
Antti Koivisto
Comment 1 2014-09-10 06:56:55 PDT
Darin Adler
Comment 2 2014-09-10 09:13:25 PDT
Comment on attachment 237890 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=237890&action=review > Source/WebKit2/NetworkProcess/NetworkResourceLoader.h:78 > + const WebCore::ResourceRequest& originalRequest() const { return m_parameters.request; } > + // Changes with redirects. > + WebCore::ResourceRequest& currentRequest() { return m_currentRequest; } The paragraphing here made it hard for me to understand the comment. I would put a blank line before the comment. > Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp:133 > + for (size_t i = 0, count = requestBodySandboxExtensionHandles.size(); i < count; ++i) { Modern for loop would be better. > Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp:135 > + result.requestBodySandboxExtensions.append(extension); extension.release()
Antti Koivisto
Comment 3 2014-09-10 09:19:43 PDT
Comment on attachment 237890 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=237890&action=review >> Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp:133 >> + for (size_t i = 0, count = requestBodySandboxExtensionHandles.size(); i < count; ++i) { > > Modern for loop would be better. Unfortunately HandleArray is a custom array type without iterators.
Antti Koivisto
Comment 4 2014-09-10 09:36:51 PDT
Alexey Proskuryakov
Comment 5 2014-09-10 09:58:48 PDT
Comment on attachment 237890 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=237890&action=review > Source/WebKit2/ChangeLog:21 > + Instead of copying everything out from NetworkResourceLoadParameters just include the whole thing as a const field. I guess it's OK to try how this feels, but this is not how other "parameters" classes work, and it's really a layering violation between IPC and loading logic to do this. > Source/WebKit2/ChangeLog:64 > + Use original request instead of the current one. This might fix a bug where we didn't use file backing over redirects. I'd love to hear Brady's take on this. To me, this sounds incorrect - caching is always about the final URL, because redirect chains can and do change. > Source/WebKit2/ChangeLog:69 > + Decode to SanboxExtensions to the actual type rather than a handle. Good stuff - the complications with sandbox extensions were caused by lack of C++11 move support at the time the code was written, and the class itself wasn't RefCounted if I remember correctly.
Antti Koivisto
Comment 6 2014-09-10 15:03:24 PDT
> I guess it's OK to try how this feels, but this is not how other "parameters" classes work, and it's really a layering violation between IPC and loading logic to do this. Alexey, I know what our layering is. You don't need to worry about me violating it.
Alexey Proskuryakov
Comment 7 2014-09-10 15:07:06 PDT
Can you be more specific please? What makes you think that using a type that exists of IPC purposes in NetworkResourceLoader is not a layering violation?
Antti Koivisto
Comment 8 2014-09-10 15:24:47 PDT
(In reply to comment #7) > Can you be more specific please? What makes you think that using a type that exists of IPC purposes in NetworkResourceLoader is not a layering violation? Yes. Whether someone thinks something exists for "IPC purposes" is not a meaningful part of our layering.
Alexey Proskuryakov
Comment 9 2014-09-10 16:47:50 PDT
Thank you for your accurate, detailed and immensely helpful response.
Joseph Pecoraro
Comment 10 2014-09-23 16:11:34 PDT
Comment on attachment 237890 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=237890&action=review > Source/WebKit2/NetworkProcess/NetworkResourceLoader.h:89 > + bool defersLoading() const { return m_parameters.defersLoading; } Does this always match m_defersLoading? Would setDefersLoading(false) affect m_parameters.defersLoading?
Note You need to log in before you can comment on or make changes to this bug.