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

Unified Diff: content/child/web_url_loader_impl.cc

Issue 264613006: Move first-party cookie URL logic to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DCHECK. Created 6 years, 7 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: content/child/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index 7724a50e6e0c7b6bb89f0d2e5331d552d2ebe979..ef02a2a282a77984c0bcd24d43438128c523d886 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -238,11 +238,9 @@ class WebURLLoaderImpl::Context : public base::RefCounted<Context>,
// RequestPeer methods:
virtual void OnUploadProgress(uint64 position, uint64 size) OVERRIDE;
- virtual bool OnReceivedRedirect(
- const GURL& new_url,
- const ResourceResponseInfo& info,
- bool* has_new_first_party_for_cookies,
- GURL* new_first_party_for_cookies) OVERRIDE;
+ virtual bool OnReceivedRedirect(const GURL& new_url,
+ const GURL& new_first_party_for_cookies,
+ const ResourceResponseInfo& info) OVERRIDE;
virtual void OnReceivedResponse(const ResourceResponseInfo& info) OVERRIDE;
virtual void OnDownloadedData(int len, int encoded_data_length) OVERRIDE;
virtual void OnReceivedData(const char* data,
@@ -472,9 +470,8 @@ void WebURLLoaderImpl::Context::OnUploadProgress(uint64 position, uint64 size) {
bool WebURLLoaderImpl::Context::OnReceivedRedirect(
const GURL& new_url,
- const ResourceResponseInfo& info,
- bool* has_new_first_party_for_cookies,
- GURL* new_first_party_for_cookies) {
+ const GURL& new_first_party_for_cookies,
+ const ResourceResponseInfo& info) {
if (!client_)
return false;
@@ -485,7 +482,7 @@ bool WebURLLoaderImpl::Context::OnReceivedRedirect(
// TODO(darin): We lack sufficient information to construct the actual
// request that resulted from the redirect.
WebURLRequest new_request(new_url);
- new_request.setFirstPartyForCookies(request_.firstPartyForCookies());
+ new_request.setFirstPartyForCookies(new_first_party_for_cookies);
new_request.setDownloadToFile(request_.downloadToFile());
WebString referrer_string = WebString::fromUTF8("Referer");
@@ -505,8 +502,12 @@ bool WebURLLoaderImpl::Context::OnReceivedRedirect(
client_->willSendRequest(loader_, new_request, response);
request_ = new_request;
- *has_new_first_party_for_cookies = true;
- *new_first_party_for_cookies = request_.firstPartyForCookies();
+
+ // First-party cookie logic moved from DocumentLoader in Blink to
+ // CrossSiteResourceHandler in the browser. Assert that Blink didn't try to
+ // change it to something else.
+ DCHECK_EQ(new_first_party_for_cookies.spec(),
+ request_.firstPartyForCookies().string().utf8());
davidben 2014/05/09 22:08:04 Had to move this to the conditional below. Turns o
// Only follow the redirect if WebKit left the URL unmodified.
if (new_url == GURL(new_request.url()))

Powered by Google App Engine
This is Rietveld 408576698