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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 2370001: Store blocked cookies in the tab contents. (Closed)
Patch Set: updates Created 10 years, 6 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_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index 7041b8d974d569c648734f9d2f5d5b331f890a38..2c6fa79dbbc6179317b6eefbf23c3e5c9ca6a0f3 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -441,8 +441,9 @@ void URLRequestHttpJob::OnCanGetCookiesCompleted(int policy) {
// If the request was destroyed, then there is no more work to do.
if (request_ && request_->delegate()) {
if (policy == net::ERR_ACCESS_DENIED) {
- request_->delegate()->OnGetCookiesBlocked(request_);
+ request_->delegate()->OnGetCookies(request_, true);
} else if (policy == net::OK && request_->context()->cookie_store()) {
+ request_->delegate()->OnGetCookies(request_, false);
net::CookieOptions options;
options.set_include_httponly();
std::string cookies =
@@ -454,7 +455,7 @@ void URLRequestHttpJob::OnCanGetCookiesCompleted(int policy) {
net::HttpRequestHeaders::kCookie, cookies);
}
}
- // We may have been canceled within OnGetCookiesBlocked.
+ // We may have been canceled within OnGetCookies.
if (GetStatus().is_success()) {
StartTransaction();
} else {
@@ -468,7 +469,10 @@ void URLRequestHttpJob::OnCanSetCookieCompleted(int policy) {
// If the request was destroyed, then there is no more work to do.
if (request_ && request_->delegate()) {
if (policy == net::ERR_ACCESS_DENIED) {
- request_->delegate()->OnSetCookieBlocked(request_);
+ request_->delegate()->OnSetCookie(
+ request_,
+ response_cookies_[response_cookies_save_index_],
+ true);
} else if ((policy == net::OK || policy == net::OK_FOR_SESSION_ONLY) &&
request_->context()->cookie_store()) {
// OK to save the current response cookie now.
@@ -479,9 +483,13 @@ void URLRequestHttpJob::OnCanSetCookieCompleted(int policy) {
request_->context()->cookie_store()->SetCookieWithOptions(
request_->url(), response_cookies_[response_cookies_save_index_],
options);
+ request_->delegate()->OnSetCookie(
+ request_,
+ response_cookies_[response_cookies_save_index_],
+ false);
}
response_cookies_save_index_++;
- // We may have been canceled within OnSetCookieBlocked.
+ // We may have been canceled within OnSetCookie.
if (GetStatus().is_success()) {
SaveNextCookie();
} else {

Powered by Google App Engine
This is Rietveld 408576698