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

Side by Side Diff: components/navigation_interception/intercept_navigation_resource_throttle.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
« no previous file with comments | « chrome/renderer/security_filter_peer.cc ('k') | content/browser/appcache/appcache_update_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/navigation_interception/intercept_navigation_resource_throt tle.h" 5 #include "components/navigation_interception/intercept_navigation_resource_throt tle.h"
6 6
7 #include "components/navigation_interception/navigation_params.h" 7 #include "components/navigation_interception/navigation_params.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "content/public/browser/child_process_security_policy.h" 9 #include "content/public/browser/child_process_security_policy.h"
10 #include "content/public/browser/render_frame_host.h" 10 #include "content/public/browser/render_frame_host.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 } 85 }
86 86
87 const char* InterceptNavigationResourceThrottle::GetNameForLogging() const { 87 const char* InterceptNavigationResourceThrottle::GetNameForLogging() const {
88 return "InterceptNavigationResourceThrottle"; 88 return "InterceptNavigationResourceThrottle";
89 } 89 }
90 90
91 std::string InterceptNavigationResourceThrottle::GetMethodAfterRedirect() { 91 std::string InterceptNavigationResourceThrottle::GetMethodAfterRedirect() {
92 net::HttpResponseHeaders* headers = request_->response_headers(); 92 net::HttpResponseHeaders* headers = request_->response_headers();
93 if (!headers) 93 if (!headers)
94 return request_->method(); 94 return request_->method();
95 // TODO(davidben): Plumb net::RedirectInfo through content::ResourceThrottle
96 // and unexpose net::URLRequest::ComputeMethodForRedirect.
95 return net::URLRequest::ComputeMethodForRedirect( 97 return net::URLRequest::ComputeMethodForRedirect(
96 request_->method(), headers->response_code()); 98 request_->method(), headers->response_code());
97 } 99 }
98 100
99 bool InterceptNavigationResourceThrottle::CheckIfShouldIgnoreNavigation( 101 bool InterceptNavigationResourceThrottle::CheckIfShouldIgnoreNavigation(
100 const GURL& url, 102 const GURL& url,
101 const std::string& method, 103 const std::string& method,
102 bool is_redirect) { 104 bool is_redirect) {
103 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request_); 105 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request_);
104 if (!info) 106 if (!info)
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 141 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
140 142
141 if (should_ignore_navigation) { 143 if (should_ignore_navigation) {
142 controller()->CancelAndIgnore(); 144 controller()->CancelAndIgnore();
143 } else { 145 } else {
144 controller()->Resume(); 146 controller()->Resume();
145 } 147 }
146 } 148 }
147 149
148 } // namespace navigation_interception 150 } // namespace navigation_interception
OLDNEW
« no previous file with comments | « chrome/renderer/security_filter_peer.cc ('k') | content/browser/appcache/appcache_update_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698