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

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: darin comments Created 6 years, 4 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 did_defer_(false), 121 did_defer_(false),
122 weak_ptr_factory_(this) { 122 weak_ptr_factory_(this) {
123 } 123 }
124 124
125 CrossSiteResourceHandler::~CrossSiteResourceHandler() { 125 CrossSiteResourceHandler::~CrossSiteResourceHandler() {
126 // Cleanup back-pointer stored on the request info. 126 // Cleanup back-pointer stored on the request info.
127 GetRequestInfo()->set_cross_site_handler(NULL); 127 GetRequestInfo()->set_cross_site_handler(NULL);
128 } 128 }
129 129
130 bool CrossSiteResourceHandler::OnRequestRedirected( 130 bool CrossSiteResourceHandler::OnRequestRedirected(
131 const GURL& new_url, 131 const net::RedirectInfo& redirect_info,
132 ResourceResponse* response, 132 ResourceResponse* response,
133 bool* defer) { 133 bool* defer) {
134 // Top-level requests change their cookie first-party URL on redirects, while
135 // subframes retain the parent's value.
136 if (GetRequestInfo()->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME)
137 request()->set_first_party_for_cookies(new_url);
138
139 // We should not have started the transition before being redirected. 134 // We should not have started the transition before being redirected.
140 DCHECK(!in_cross_site_transition_); 135 DCHECK(!in_cross_site_transition_);
141 return next_handler_->OnRequestRedirected(new_url, response, defer); 136 return next_handler_->OnRequestRedirected(redirect_info, response, defer);
142 } 137 }
143 138
144 bool CrossSiteResourceHandler::OnResponseStarted( 139 bool CrossSiteResourceHandler::OnResponseStarted(
145 ResourceResponse* response, 140 ResourceResponse* response,
146 bool* defer) { 141 bool* defer) {
147 response_ = response; 142 response_ = response;
148 has_started_response_ = true; 143 has_started_response_ = true;
149 144
150 // Store this handler on the ExtraRequestInfo, so that RDH can call our 145 // Store this handler on the ExtraRequestInfo, so that RDH can call our
151 // ResumeResponse method when we are ready to resume. 146 // ResumeResponse method when we are ready to resume.
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 controller()->Resume(); 438 controller()->Resume();
444 } 439 }
445 } 440 }
446 441
447 void CrossSiteResourceHandler::OnDidDefer() { 442 void CrossSiteResourceHandler::OnDidDefer() {
448 did_defer_ = true; 443 did_defer_ = true;
449 request()->LogBlockedBy("CrossSiteResourceHandler"); 444 request()->LogBlockedBy("CrossSiteResourceHandler");
450 } 445 }
451 446
452 } // namespace content 447 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/cross_site_resource_handler.h ('k') | content/browser/loader/detachable_resource_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698