| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
| 6 | 6 |
| 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "chrome/browser/renderer_host/resource_dispatcher_host.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 void ResourceDispatcherHost::BeginRequest( | 395 void ResourceDispatcherHost::BeginRequest( |
| 396 int request_id, | 396 int request_id, |
| 397 const ViewHostMsg_Resource_Request& request_data, | 397 const ViewHostMsg_Resource_Request& request_data, |
| 398 IPC::Message* sync_result, // only valid for sync | 398 IPC::Message* sync_result, // only valid for sync |
| 399 int route_id) { | 399 int route_id) { |
| 400 ChildProcessInfo::ProcessType process_type = receiver_->type(); | 400 ChildProcessInfo::ProcessType process_type = receiver_->type(); |
| 401 int child_id = receiver_->id(); | 401 int child_id = receiver_->id(); |
| 402 ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>( | 402 ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>( |
| 403 receiver_->GetRequestContext(request_id, request_data)); | 403 receiver_->GetRequestContext(request_id, request_data)); |
| 404 if (!context) { | 404 if (!context) { |
| 405 context = static_cast<ChromeURLRequestContext*>( | 405 URLRequestContextGetter* context_getter = |
| 406 Profile::GetDefaultRequestContext()); | 406 Profile::GetDefaultRequestContext(); |
| 407 if (context_getter) { |
| 408 context = static_cast<ChromeURLRequestContext*>( |
| 409 context_getter->GetURLRequestContext()); |
| 410 } |
| 407 } | 411 } |
| 408 | 412 |
| 409 if (is_shutdown_ || | 413 if (is_shutdown_ || |
| 410 !ShouldServiceRequest(process_type, child_id, request_data)) { | 414 !ShouldServiceRequest(process_type, child_id, request_data)) { |
| 411 URLRequestStatus status(URLRequestStatus::FAILED, net::ERR_ABORTED); | 415 URLRequestStatus status(URLRequestStatus::FAILED, net::ERR_ABORTED); |
| 412 if (sync_result) { | 416 if (sync_result) { |
| 413 SyncLoadResult result; | 417 SyncLoadResult result; |
| 414 result.status = status; | 418 result.status = status; |
| 415 ViewHostMsg_SyncLoad::WriteReplyParams(sync_result, result); | 419 ViewHostMsg_SyncLoad::WriteReplyParams(sync_result, result); |
| 416 receiver_->Send(sync_result); | 420 receiver_->Send(sync_result); |
| (...skipping 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 case ViewHostMsg_UploadProgress_ACK::ID: | 1803 case ViewHostMsg_UploadProgress_ACK::ID: |
| 1800 case ViewHostMsg_SyncLoad::ID: | 1804 case ViewHostMsg_SyncLoad::ID: |
| 1801 return true; | 1805 return true; |
| 1802 | 1806 |
| 1803 default: | 1807 default: |
| 1804 break; | 1808 break; |
| 1805 } | 1809 } |
| 1806 | 1810 |
| 1807 return false; | 1811 return false; |
| 1808 } | 1812 } |
| OLD | NEW |