Chromium Code Reviews| Index: net/url_request/url_request.h |
| =================================================================== |
| --- net/url_request/url_request.h (revision 255909) |
| +++ net/url_request/url_request.h (working copy) |
| @@ -25,6 +25,7 @@ |
| #include "net/base/request_priority.h" |
| #include "net/base/upload_progress.h" |
| #include "net/cookies/canonical_cookie.h" |
| +#include "net/cookies/cookie_store.h" |
| #include "net/http/http_request_headers.h" |
| #include "net/http/http_response_info.h" |
| #include "net/url_request/url_request_status.h" |
| @@ -291,11 +292,20 @@ |
| virtual ~Delegate() {} |
| }; |
| + // TODO(tburkard): we should get rid of this constructor, and have each |
| + // creator of a URLRequest specifically list the cookie store to be used. |
| + // For now, this constructor will use the cookie store in |context|. |
| URLRequest(const GURL& url, |
| RequestPriority priority, |
| Delegate* delegate, |
| const URLRequestContext* context); |
| + URLRequest(const GURL& url, |
| + RequestPriority priority, |
| + Delegate* delegate, |
| + const URLRequestContext* context, |
| + CookieStore* cookie_store); |
| + |
| // If destroyed after Start() has been called but while IO is pending, |
| // then the request will be effectively canceled and the delegate |
| // will not have any more of its methods called. |
| @@ -684,6 +694,8 @@ |
| return received_response_content_length_; |
| } |
| + CookieStore* cookie_store() const; |
|
mmenke
2014/03/11 14:45:49
I think this should be protected. URLRequestJob i
tburkard
2014/03/12 14:37:27
Done.
|
| + |
| protected: |
| // Allow the URLRequestJob class to control the is_pending() flag. |
| void set_is_pending(bool value) { is_pending_ = value; } |
| @@ -730,6 +742,15 @@ |
| static void RegisterRequestInterceptor(Interceptor* interceptor); |
| static void UnregisterRequestInterceptor(Interceptor* interceptor); |
| + // Initializes the URLRequest. Code shared between the two constructors. |
| + // TODO(tburkard): This can ultimately be folded into a single constructor |
| + // again. |
| + void Init(const GURL& url, |
| + RequestPriority priotity, |
| + Delegate* delegate, |
| + const URLRequestContext* context, |
| + CookieStore* cookie_store); |
| + |
| // Resumes or blocks a request paused by the NetworkDelegate::OnBeforeRequest |
| // handler. If |blocked| is true, the request is blocked and an error page is |
| // returned indicating so. This should only be called after Start is called |
| @@ -895,6 +916,9 @@ |
| // Keeps track of whether or not OnBeforeNetworkStart has been called yet. |
| bool notified_before_network_start_; |
| + // The cookie store to be used for this request. |
| + scoped_refptr<CookieStore> cookie_store_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| }; |