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

Unified Diff: net/url_request/url_request.cc

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing Created 8 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
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 144029f76b210d8d297f48313b61a7f10a2d360b..ba7870f7e38635da07976bedab81de94b4da2d75 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -123,17 +123,6 @@ void URLRequest::Delegate::OnSSLCertificateError(URLRequest* request,
request->Cancel();
}
-bool URLRequest::Delegate::CanGetCookies(const URLRequest* request,
- const CookieList& cookie_list) const {
- return true;
-}
-
-bool URLRequest::Delegate::CanSetCookie(const URLRequest* request,
- const std::string& cookie_line,
- CookieOptions* options) const {
- return true;
-}
-
///////////////////////////////////////////////////////////////////////////////
// URLRequest
@@ -837,15 +826,22 @@ void URLRequest::NotifySSLCertificateError(const SSLInfo& ssl_info,
}
bool URLRequest::CanGetCookies(const CookieList& cookie_list) const {
- if (delegate_)
- return delegate_->CanGetCookies(this, cookie_list);
+ DCHECK(!(load_flags_ & LOAD_DO_NOT_SEND_COOKIES));
+ if (context_ && context_->network_delegate()) {
+ return context_->network_delegate()->NotifyReadingCookies(this,
+ cookie_list);
+ }
return false;
}
bool URLRequest::CanSetCookie(const std::string& cookie_line,
CookieOptions* options) const {
- if (delegate_)
- return delegate_->CanSetCookie(this, cookie_line, options);
+ DCHECK(!(load_flags_ & LOAD_DO_NOT_SAVE_COOKIES));
+ if (context_ && context_->network_delegate()) {
+ return context_->network_delegate()->NotifySettingCookie(this,
+ cookie_line,
+ options);
+ }
return false;
}
« no previous file with comments | « net/url_request/url_request.h ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698