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/renderer_host/resource_loader.h" | 5 #include "content/browser/renderer_host/resource_loader.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "content/browser/child_process_security_policy_impl.h" | 9 #include "content/browser/child_process_security_policy_impl.h" |
10 #include "content/browser/renderer_host/doomed_resource_handler.h" | 10 #include "content/browser/renderer_host/doomed_resource_handler.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->process_type() != PROCESS_TYPE_PLUGIN && |
204 !ChildProcessSecurityPolicyImpl::GetInstance()-> | 204 !ChildProcessSecurityPolicyImpl::GetInstance()-> |
205 CanRequestURL(info->GetChildID(), new_url)) { | 205 CanRequestURL(info->GetChildID(), new_url, |
| 206 info->GetResourceType())) { |
206 VLOG(1) << "Denied unauthorized request for " | 207 VLOG(1) << "Denied unauthorized request for " |
207 << new_url.possibly_invalid_spec(); | 208 << new_url.possibly_invalid_spec(); |
208 | 209 |
209 // Tell the renderer that this request was disallowed. | 210 // Tell the renderer that this request was disallowed. |
210 Cancel(); | 211 Cancel(); |
211 return; | 212 return; |
212 } | 213 } |
213 | 214 |
214 delegate_->DidReceiveRedirect(this, new_url); | 215 delegate_->DidReceiveRedirect(this, new_url); |
215 | 216 |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 // we resume. | 574 // we resume. |
574 deferred_stage_ = DEFERRED_FINISH; | 575 deferred_stage_ = DEFERRED_FINISH; |
575 } | 576 } |
576 } | 577 } |
577 | 578 |
578 void ResourceLoader::CallDidFinishLoading() { | 579 void ResourceLoader::CallDidFinishLoading() { |
579 delegate_->DidFinishLoading(this); | 580 delegate_->DidFinishLoading(this); |
580 } | 581 } |
581 | 582 |
582 } // namespace content | 583 } // namespace content |
OLD | NEW |