| OLD | NEW |
| 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/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 void ResourceLoader::OnReceivedRedirect(net::URLRequest* unused, | 252 void ResourceLoader::OnReceivedRedirect(net::URLRequest* unused, |
| 253 const net::RedirectInfo& redirect_info, | 253 const net::RedirectInfo& redirect_info, |
| 254 bool* defer) { | 254 bool* defer) { |
| 255 DCHECK_EQ(request_.get(), unused); | 255 DCHECK_EQ(request_.get(), unused); |
| 256 | 256 |
| 257 DVLOG(1) << "OnReceivedRedirect: " << request_->url().spec(); | 257 DVLOG(1) << "OnReceivedRedirect: " << request_->url().spec(); |
| 258 DCHECK(request_->status().is_success()); | 258 DCHECK(request_->status().is_success()); |
| 259 | 259 |
| 260 ResourceRequestInfoImpl* info = GetRequestInfo(); | 260 ResourceRequestInfoImpl* info = GetRequestInfo(); |
| 261 | 261 |
| 262 if (info->GetProcessType() != PROCESS_TYPE_PLUGIN && | 262 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL( |
| 263 !ChildProcessSecurityPolicyImpl::GetInstance()-> | 263 info->GetChildID(), redirect_info.new_url)) { |
| 264 CanRequestURL(info->GetChildID(), redirect_info.new_url)) { | |
| 265 DVLOG(1) << "Denied unauthorized request for " | 264 DVLOG(1) << "Denied unauthorized request for " |
| 266 << redirect_info.new_url.possibly_invalid_spec(); | 265 << redirect_info.new_url.possibly_invalid_spec(); |
| 267 | 266 |
| 268 // Tell the renderer that this request was disallowed. | 267 // Tell the renderer that this request was disallowed. |
| 269 Cancel(); | 268 Cancel(); |
| 270 return; | 269 return; |
| 271 } | 270 } |
| 272 | 271 |
| 273 delegate_->DidReceiveRedirect(this, redirect_info.new_url); | 272 delegate_->DidReceiveRedirect(this, redirect_info.new_url); |
| 274 | 273 |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 case net::URLRequestStatus::FAILED: | 732 case net::URLRequestStatus::FAILED: |
| 734 status = STATUS_UNDEFINED; | 733 status = STATUS_UNDEFINED; |
| 735 break; | 734 break; |
| 736 } | 735 } |
| 737 | 736 |
| 738 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 737 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
| 739 } | 738 } |
| 740 } | 739 } |
| 741 | 740 |
| 742 } // namespace content | 741 } // namespace content |
| OLD | NEW |