Chromium Code Reviews| 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())) |