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

Side by Side Diff: content/browser/loader/cross_site_resource_handler.cc

Issue 264613006: Move first-party cookie URL logic to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/loader/cross_site_resource_handler.h" 5 #include "content/browser/loader/cross_site_resource_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 CrossSiteResourceHandler::~CrossSiteResourceHandler() { 114 CrossSiteResourceHandler::~CrossSiteResourceHandler() {
115 // Cleanup back-pointer stored on the request info. 115 // Cleanup back-pointer stored on the request info.
116 GetRequestInfo()->set_cross_site_handler(NULL); 116 GetRequestInfo()->set_cross_site_handler(NULL);
117 } 117 }
118 118
119 bool CrossSiteResourceHandler::OnRequestRedirected( 119 bool CrossSiteResourceHandler::OnRequestRedirected(
120 int request_id, 120 int request_id,
121 const GURL& new_url, 121 const GURL& new_url,
122 ResourceResponse* response, 122 ResourceResponse* response,
123 bool* defer) { 123 bool* defer) {
124 // Top-level requests change their cookie first-party URL on redirects, while
125 // subframes retain the parent's value.
126 if (GetRequestInfo()->GetResourceType() == ResourceType::MAIN_FRAME)
127 request()->set_first_party_for_cookies(new_url);
128
124 // We should not have started the transition before being redirected. 129 // We should not have started the transition before being redirected.
125 DCHECK(!in_cross_site_transition_); 130 DCHECK(!in_cross_site_transition_);
126 return next_handler_->OnRequestRedirected( 131 return next_handler_->OnRequestRedirected(
127 request_id, new_url, response, defer); 132 request_id, new_url, response, defer);
128 } 133 }
129 134
130 bool CrossSiteResourceHandler::OnResponseStarted( 135 bool CrossSiteResourceHandler::OnResponseStarted(
131 int request_id, 136 int request_id,
132 ResourceResponse* response, 137 ResourceResponse* response,
133 bool* defer) { 138 bool* defer) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 controller()->Resume(); 383 controller()->Resume();
379 } 384 }
380 } 385 }
381 386
382 void CrossSiteResourceHandler::OnDidDefer() { 387 void CrossSiteResourceHandler::OnDidDefer() {
383 did_defer_ = true; 388 did_defer_ = true;
384 request()->LogBlockedBy("CrossSiteResourceHandler"); 389 request()->LogBlockedBy("CrossSiteResourceHandler");
385 } 390 }
386 391
387 } // namespace content 392 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/async_resource_handler.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698