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

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

Issue 425653002: content: ResourceType cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: REBASE 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // Cleanup back-pointer stored on the request info. 127 // Cleanup back-pointer stored on the request info.
128 GetRequestInfo()->set_cross_site_handler(NULL); 128 GetRequestInfo()->set_cross_site_handler(NULL);
129 } 129 }
130 130
131 bool CrossSiteResourceHandler::OnRequestRedirected( 131 bool CrossSiteResourceHandler::OnRequestRedirected(
132 const GURL& new_url, 132 const GURL& new_url,
133 ResourceResponse* response, 133 ResourceResponse* response,
134 bool* defer) { 134 bool* defer) {
135 // Top-level requests change their cookie first-party URL on redirects, while 135 // Top-level requests change their cookie first-party URL on redirects, while
136 // subframes retain the parent's value. 136 // subframes retain the parent's value.
137 if (GetRequestInfo()->GetResourceType() == ResourceType::MAIN_FRAME) 137 if (GetRequestInfo()->GetResourceType() == RESOURCE_TYPE_MAIN_FRAME)
138 request()->set_first_party_for_cookies(new_url); 138 request()->set_first_party_for_cookies(new_url);
139 139
140 // We should not have started the transition before being redirected. 140 // We should not have started the transition before being redirected.
141 DCHECK(!in_cross_site_transition_); 141 DCHECK(!in_cross_site_transition_);
142 return next_handler_->OnRequestRedirected(new_url, response, defer); 142 return next_handler_->OnRequestRedirected(new_url, response, defer);
143 } 143 }
144 144
145 bool CrossSiteResourceHandler::OnResponseStarted( 145 bool CrossSiteResourceHandler::OnResponseStarted(
146 ResourceResponse* response, 146 ResourceResponse* response,
147 bool* defer) { 147 bool* defer) {
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 controller()->Resume(); 439 controller()->Resume();
440 } 440 }
441 } 441 }
442 442
443 void CrossSiteResourceHandler::OnDidDefer() { 443 void CrossSiteResourceHandler::OnDidDefer() {
444 did_defer_ = true; 444 did_defer_ = true;
445 request()->LogBlockedBy("CrossSiteResourceHandler"); 445 request()->LogBlockedBy("CrossSiteResourceHandler");
446 } 446 }
447 447
448 } // namespace content 448 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/async_resource_handler.cc ('k') | content/browser/loader/resource_dispatcher_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698