Bug 39182 - FrameLoader: factor applyUserAgent(), addExtraFieldsToRequest(), and addHTTPOriginIfNeeded() out of the FrameLoader class
Summary: FrameLoader: factor applyUserAgent(), addExtraFieldsToRequest(), and addHTTPO...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Chris Jerdonek
URL:
Keywords:
Depends on:
Blocks: 29947
  Show dependency treegraph
 
Reported: 2010-05-16 13:11 PDT by Chris Jerdonek
Modified: 2011-06-12 02:30 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jerdonek 2010-05-16 13:11:13 PDT
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.
Comment 1 Adam Barth 2010-05-16 17:38:37 PDT
Hum...  It's not 100% clear to me where we'd put these methods.  What did you have in mind?
Comment 2 Chris Jerdonek 2010-05-16 17:47:14 PDT
(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.
Comment 3 Adam Barth 2010-05-16 18:01:02 PDT
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...
Comment 4 Adam Barth 2011-06-12 02:30:39 PDT
Marking WONTFIX for now.  We can revisit this later if we still think this is a good idea.