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

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: clang fix Created 8 years, 10 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.cc
diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
index 144029f76b210d8d297f48313b61a7f10a2d360b..9a028d9112b09b698655bdc244e089e8289a337e 100644
--- a/net/url_request/url_request.cc
+++ b/net/url_request/url_request.cc
@@ -125,13 +125,13 @@ void URLRequest::Delegate::OnSSLCertificateError(URLRequest* request,
bool URLRequest::Delegate::CanGetCookies(const URLRequest* request,
const CookieList& cookie_list) const {
- return true;
+ return false;
jam 2012/03/01 19:30:42 why?
jochen (gone - plz use gerrit) 2012/03/01 19:39:11 The default of URLRequest::CanSetCookies is false,
willchan no longer on Chromium 2012/03/01 20:30:10 Please just remove this method. Having it in both
}
bool URLRequest::Delegate::CanSetCookie(const URLRequest* request,
const std::string& cookie_line,
CookieOptions* options) const {
- return true;
+ return false;
}
///////////////////////////////////////////////////////////////////////////////
@@ -837,6 +837,10 @@ void URLRequest::NotifySSLCertificateError(const SSLInfo& ssl_info,
}
bool URLRequest::CanGetCookies(const CookieList& cookie_list) const {
+ if (context_ && context_->network_delegate()) {
+ return context_->network_delegate()->NotifyReadingCookies(this,
+ cookie_list);
+ }
if (delegate_)
return delegate_->CanGetCookies(this, cookie_list);
return false;
@@ -844,6 +848,11 @@ bool URLRequest::CanGetCookies(const CookieList& cookie_list) const {
bool URLRequest::CanSetCookie(const std::string& cookie_line,
CookieOptions* options) const {
+ if (context_ && context_->network_delegate()) {
+ return context_->network_delegate()->NotifySettingCookie(this,
+ cookie_line,
+ options);
+ }
if (delegate_)
return delegate_->CanSetCookie(this, cookie_line, options);
return false;

Powered by Google App Engine
This is Rietveld 408576698