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

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

Issue 398903002: Plumb redirect info out of net, through content, and into child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a TODO Created 6 years, 5 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 did_defer_(false), 120 did_defer_(false),
121 weak_ptr_factory_(this) { 121 weak_ptr_factory_(this) {
122 } 122 }
123 123
124 CrossSiteResourceHandler::~CrossSiteResourceHandler() { 124 CrossSiteResourceHandler::~CrossSiteResourceHandler() {
125 // Cleanup back-pointer stored on the request info. 125 // Cleanup back-pointer stored on the request info.
126 GetRequestInfo()->set_cross_site_handler(NULL); 126 GetRequestInfo()->set_cross_site_handler(NULL);
127 } 127 }
128 128
129 bool CrossSiteResourceHandler::OnRequestRedirected( 129 bool CrossSiteResourceHandler::OnRequestRedirected(
130 const GURL& new_url, 130 const net::RedirectInfo& redirect_info,
131 ResourceResponse* response, 131 ResourceResponse* response,
132 bool* defer) { 132 bool* defer) {
133 // Top-level requests change their cookie first-party URL on redirects, while
134 // subframes retain the parent's value.
135 if (GetRequestInfo()->GetResourceType() == ResourceType::MAIN_FRAME)
136 request()->set_first_party_for_cookies(new_url);
137
138 // We should not have started the transition before being redirected. 133 // We should not have started the transition before being redirected.
139 DCHECK(!in_cross_site_transition_); 134 DCHECK(!in_cross_site_transition_);
140 return next_handler_->OnRequestRedirected(new_url, response, defer); 135 return next_handler_->OnRequestRedirected(redirect_info, response, defer);
141 } 136 }
142 137
143 bool CrossSiteResourceHandler::OnResponseStarted( 138 bool CrossSiteResourceHandler::OnResponseStarted(
144 ResourceResponse* response, 139 ResourceResponse* response,
145 bool* defer) { 140 bool* defer) {
146 response_ = response; 141 response_ = response;
147 has_started_response_ = true; 142 has_started_response_ = true;
148 143
149 // Store this handler on the ExtraRequestInfo, so that RDH can call our 144 // Store this handler on the ExtraRequestInfo, so that RDH can call our
150 // ResumeResponse method when we are ready to resume. 145 // ResumeResponse method when we are ready to resume.
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 controller()->Resume(); 423 controller()->Resume();
429 } 424 }
430 } 425 }
431 426
432 void CrossSiteResourceHandler::OnDidDefer() { 427 void CrossSiteResourceHandler::OnDidDefer() {
433 did_defer_ = true; 428 did_defer_ = true;
434 request()->LogBlockedBy("CrossSiteResourceHandler"); 429 request()->LogBlockedBy("CrossSiteResourceHandler");
435 } 430 }
436 431
437 } // namespace content 432 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698