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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 bool* defer) { | 254 bool* defer) { |
255 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("loading"), | 255 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("loading"), |
256 "ResourceLoader::OnReceivedRedirect"); | 256 "ResourceLoader::OnReceivedRedirect"); |
257 DCHECK_EQ(request_.get(), unused); | 257 DCHECK_EQ(request_.get(), unused); |
258 | 258 |
259 DVLOG(1) << "OnReceivedRedirect: " << request_->url().spec(); | 259 DVLOG(1) << "OnReceivedRedirect: " << request_->url().spec(); |
260 DCHECK(request_->status().is_success()); | 260 DCHECK(request_->status().is_success()); |
261 | 261 |
262 ResourceRequestInfoImpl* info = GetRequestInfo(); | 262 ResourceRequestInfoImpl* info = GetRequestInfo(); |
263 | 263 |
264 if (info->GetProcessType() != PROCESS_TYPE_PLUGIN && | 264 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanRequestURL( |
265 !ChildProcessSecurityPolicyImpl::GetInstance()-> | 265 info->GetChildID(), redirect_info.new_url)) { |
266 CanRequestURL(info->GetChildID(), redirect_info.new_url)) { | |
267 DVLOG(1) << "Denied unauthorized request for " | 266 DVLOG(1) << "Denied unauthorized request for " |
268 << redirect_info.new_url.possibly_invalid_spec(); | 267 << redirect_info.new_url.possibly_invalid_spec(); |
269 | 268 |
270 // Tell the renderer that this request was disallowed. | 269 // Tell the renderer that this request was disallowed. |
271 Cancel(); | 270 Cancel(); |
272 return; | 271 return; |
273 } | 272 } |
274 | 273 |
275 delegate_->DidReceiveRedirect(this, redirect_info.new_url); | 274 delegate_->DidReceiveRedirect(this, redirect_info.new_url); |
276 | 275 |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 case net::URLRequestStatus::FAILED: | 740 case net::URLRequestStatus::FAILED: |
742 status = STATUS_UNDEFINED; | 741 status = STATUS_UNDEFINED; |
743 break; | 742 break; |
744 } | 743 } |
745 | 744 |
746 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 745 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
747 } | 746 } |
748 } | 747 } |
749 | 748 |
750 } // namespace content | 749 } // namespace content |
OLD | NEW |