Bug 39182
Summary: | FrameLoader: factor applyUserAgent(), addExtraFieldsToRequest(), and addHTTPOriginIfNeeded() out of the FrameLoader class | ||
---|---|---|---|
Product: | WebKit | Reporter: | Chris Jerdonek <cjerdonek> |
Component: | WebCore Misc. | Assignee: | Chris Jerdonek <cjerdonek> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | abarth, cjerdonek |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
Bug Depends on: | |||
Bug Blocks: | 29947 |
Chris Jerdonek
It looks like none of these methods that add information to a ResourceRequest (applyUserAgent, addExtraFieldsToRequest, and addHTTPOriginIfNeeded) require access to private FrameLoader data, so we should be able to make all of them non-member, non-friend. Teasing these out will increase encapsulation a bit more.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Adam Barth
Hum... It's not 100% clear to me where we'd put these methods. What did you have in mind?
Chris Jerdonek
(In reply to comment #1)
> Hum... It's not 100% clear to me where we'd put these methods. What did you have in mind?
I had in mind declaring applyUserAgent() and addHTTPOriginIfNeeded() in FrameLoader.h outside of the class (suitably renamed). addExtraFieldsToRequest() can be declared static (file-scope) in the .cpp file.
Adam Barth
Generally, we prefer keeping methods in the class, except for some kinds of utility methods.
One thing that might make sense is putting these methods on some sort of request object because they operate on the request. You'll have to look to see which layer of request makes the most sense. ResourceRequest might be slightly too low-level because the platform directory isn't allowed to depend on anything else in WebCore...
Adam Barth
Marking WONTFIX for now. We can revisit this later if we still think this is a good idea.