Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(757)

Unified Diff: net/url_request/url_request.h

Issue 188693003: Allow the content browser client to specify a special cookie store to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698