Summary: | Regression(r220817): We should only copy the original request headers for Ping loads | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | buildbot, commit-queue, dbates, ggaren, japhet, webkit-bug-importer, youennf | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 175628 | ||||||||||
Attachments: |
|
Description
Chris Dumez
2017-08-17 12:14:30 PDT
Created attachment 318398 [details]
Patch
Comment on attachment 318398 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318398&action=review > Source/WebCore/loader/cache/CachedResourceLoader.cpp:836 > + resource->setOriginalRequestHeaders(WTFMove(originalRequestHeaders)); We should probably also set the headers in the case of DeferOption::Defer. If not, originalRequestHeaders could just be a parameter passed to CachedResource::load(). Created attachment 318406 [details]
Patch
Comment on attachment 318406 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318406&action=review > Source/WebCore/loader/cache/CachedResource.cpp:276 > + platformStrategies()->loaderStrategy()->createPingHandle(frame.loader().networkingContext(), request, HTTPHeaderMap(*m_originalRequestHeaders), *m_origin, contentSecurityPolicy, m_options); IIRC, IPC is taking const& parameters. WK2 createPingHandle could probably be implemented with just a const&. (In reply to youenn fablet from comment #4) > Comment on attachment 318406 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=318406&action=review > > > Source/WebCore/loader/cache/CachedResource.cpp:276 > > + platformStrategies()->loaderStrategy()->createPingHandle(frame.loader().networkingContext(), request, HTTPHeaderMap(*m_originalRequestHeaders), *m_origin, contentSecurityPolicy, m_options); > > IIRC, IPC is taking const& parameters. > WK2 createPingHandle could probably be implemented with just a const&. So that we remove this extra header copy. (In reply to youenn fablet from comment #5) > (In reply to youenn fablet from comment #4) > > Comment on attachment 318406 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=318406&action=review > > > > > Source/WebCore/loader/cache/CachedResource.cpp:276 > > > + platformStrategies()->loaderStrategy()->createPingHandle(frame.loader().networkingContext(), request, HTTPHeaderMap(*m_originalRequestHeaders), *m_origin, contentSecurityPolicy, m_options); > > > > IIRC, IPC is taking const& parameters. > > WK2 createPingHandle could probably be implemented with just a const&. > > So that we remove this extra header copy. WK2: loadParameters.originalRequestHeaders = WTFMove(originalRequestHeaders); > WK2:
> loadParameters.originalRequestHeaders = WTFMove(originalRequestHeaders);
Would the following work?
- Pass originalRequestHeaders as a direct parameter of NetworkConnectionToWebProcess::LoadPing. It is not used for other loads.
- Create the message with something like Messages::NetworkConnectionToWebProcess::LoadPing(loadParameters, originalRequestHeaders)
IIRC, Messages structures only needs const&.
(In reply to youenn fablet from comment #7) > > WK2: > > loadParameters.originalRequestHeaders = WTFMove(originalRequestHeaders); > > Would the following work? > - Pass originalRequestHeaders as a direct parameter of > NetworkConnectionToWebProcess::LoadPing. It is not used for other loads. > - Create the message with something like > Messages::NetworkConnectionToWebProcess::LoadPing(loadParameters, > originalRequestHeaders) > > IIRC, Messages structures only needs const&. Yes, I have confirmed Messages structures only need const&. I can do what you suggest although I am unconvinced this is a worthwhile optimization. > Yes, I have confirmed Messages structures only need const&. I can do what
> you suggest although I am unconvinced this is a worthwhile optimization.
Agreed, the main point of this patch is to limit the header copy to beacon.
As a follow-up of that patch, I think it makes sense to split the original headers from NetworkLoaderParameters since they are related to ping loads only.
It should be easy to add it back when implementing keepalive for fetch API loads, if we find these headers to be needed.
(In reply to youenn fablet from comment #9) > > Yes, I have confirmed Messages structures only need const&. I can do what > > you suggest although I am unconvinced this is a worthwhile optimization. > > Agreed, the main point of this patch is to limit the header copy to beacon. > > As a follow-up of that patch, I think it makes sense to split the original > headers from NetworkLoaderParameters since they are related to ping loads > only. > It should be easy to add it back when implementing keepalive for fetch API > loads, if we find these headers to be needed. It's trivial, I'll do another iteration. Created attachment 318423 [details]
Patch
Comment on attachment 318423 [details] Patch Clearing flags on attachment: 318423 Committed r220888: <http://trac.webkit.org/changeset/220888> All reviewed patches have been landed. Closing bug. |