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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 void ResourceLoader::OnReceivedRedirect(net::URLRequest* unused, | 193 void ResourceLoader::OnReceivedRedirect(net::URLRequest* unused, |
194 const GURL& new_url, | 194 const GURL& new_url, |
195 bool* defer) { | 195 bool* defer) { |
196 DCHECK_EQ(request_.get(), unused); | 196 DCHECK_EQ(request_.get(), unused); |
197 | 197 |
198 VLOG(1) << "OnReceivedRedirect: " << request_->url().spec(); | 198 VLOG(1) << "OnReceivedRedirect: " << request_->url().spec(); |
199 DCHECK(request_->status().is_success()); | 199 DCHECK(request_->status().is_success()); |
200 | 200 |
201 ResourceRequestInfoImpl* info = GetRequestInfo(); | 201 ResourceRequestInfoImpl* info = GetRequestInfo(); |
202 | 202 |
203 if (info->process_type() != PROCESS_TYPE_PLUGIN && | 203 if (info->GetProcessType() != PROCESS_TYPE_PLUGIN && |
204 !ChildProcessSecurityPolicyImpl::GetInstance()-> | 204 !ChildProcessSecurityPolicyImpl::GetInstance()-> |
205 CanRequestURL(info->GetChildID(), new_url)) { | 205 CanRequestURL(info->GetChildID(), new_url)) { |
206 VLOG(1) << "Denied unauthorized request for " | 206 VLOG(1) << "Denied unauthorized request for " |
207 << new_url.possibly_invalid_spec(); | 207 << new_url.possibly_invalid_spec(); |
208 | 208 |
209 // Tell the renderer that this request was disallowed. | 209 // Tell the renderer that this request was disallowed. |
210 Cancel(); | 210 Cancel(); |
211 return; | 211 return; |
212 } | 212 } |
213 | 213 |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 case net::URLRequestStatus::FAILED: | 676 case net::URLRequestStatus::FAILED: |
677 status = STATUS_UNDEFINED; | 677 status = STATUS_UNDEFINED; |
678 break; | 678 break; |
679 } | 679 } |
680 | 680 |
681 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); | 681 UMA_HISTOGRAM_ENUMERATION("Net.Prefetch.Pattern", status, STATUS_MAX); |
682 } | 682 } |
683 } | 683 } |
684 | 684 |
685 } // namespace content | 685 } // namespace content |
OLD | NEW |