| 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 // 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 "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 #include "net/base/load_flags.h" | 99 #include "net/base/load_flags.h" |
| 100 #include "net/base/mime_util.h" | 100 #include "net/base/mime_util.h" |
| 101 #include "net/base/net_errors.h" | 101 #include "net/base/net_errors.h" |
| 102 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 102 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 103 #include "net/base/request_priority.h" | 103 #include "net/base/request_priority.h" |
| 104 #include "net/base/upload_data_stream.h" | 104 #include "net/base/upload_data_stream.h" |
| 105 #include "net/cert/cert_status_flags.h" | 105 #include "net/cert/cert_status_flags.h" |
| 106 #include "net/cookies/cookie_monster.h" | 106 #include "net/cookies/cookie_monster.h" |
| 107 #include "net/http/http_response_headers.h" | 107 #include "net/http/http_response_headers.h" |
| 108 #include "net/http/http_response_info.h" | 108 #include "net/http/http_response_info.h" |
| 109 #include "net/ssl/client_cert_store.h" |
| 109 #include "net/ssl/ssl_cert_request_info.h" | 110 #include "net/ssl/ssl_cert_request_info.h" |
| 110 #include "net/url_request/url_request.h" | 111 #include "net/url_request/url_request.h" |
| 111 #include "net/url_request/url_request_context.h" | 112 #include "net/url_request/url_request_context.h" |
| 112 #include "net/url_request/url_request_job_factory.h" | 113 #include "net/url_request/url_request_job_factory.h" |
| 113 #include "storage/browser/blob/blob_data_handle.h" | 114 #include "storage/browser/blob/blob_data_handle.h" |
| 114 #include "storage/browser/blob/blob_storage_context.h" | 115 #include "storage/browser/blob/blob_storage_context.h" |
| 115 #include "storage/browser/blob/blob_url_request_job_factory.h" | 116 #include "storage/browser/blob/blob_url_request_job_factory.h" |
| 116 #include "storage/browser/blob/shareable_file_reference.h" | 117 #include "storage/browser/blob/shareable_file_reference.h" |
| 117 #include "storage/browser/fileapi/file_permission_policy.h" | 118 #include "storage/browser/fileapi/file_permission_policy.h" |
| 118 #include "storage/browser/fileapi/file_system_context.h" | 119 #include "storage/browser/fileapi/file_system_context.h" |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 info->GetResourceType()); | 1099 info->GetResourceType()); |
| 1099 } | 1100 } |
| 1100 | 1101 |
| 1101 if (delegate_) | 1102 if (delegate_) |
| 1102 delegate_->RequestComplete(loader->request()); | 1103 delegate_->RequestComplete(loader->request()); |
| 1103 | 1104 |
| 1104 // Destroy the ResourceLoader. | 1105 // Destroy the ResourceLoader. |
| 1105 RemovePendingRequest(info->GetChildID(), info->GetRequestID()); | 1106 RemovePendingRequest(info->GetChildID(), info->GetRequestID()); |
| 1106 } | 1107 } |
| 1107 | 1108 |
| 1109 std::unique_ptr<net::ClientCertStore> |
| 1110 ResourceDispatcherHostImpl::CreateClientCertStore(ResourceLoader* loader) { |
| 1111 return delegate_->CreateClientCertStore( |
| 1112 loader->GetRequestInfo()->GetContext()); |
| 1113 } |
| 1114 |
| 1108 void ResourceDispatcherHostImpl::OnInit() { | 1115 void ResourceDispatcherHostImpl::OnInit() { |
| 1109 scheduler_.reset(new ResourceScheduler); | 1116 scheduler_.reset(new ResourceScheduler); |
| 1110 } | 1117 } |
| 1111 | 1118 |
| 1112 void ResourceDispatcherHostImpl::OnShutdown() { | 1119 void ResourceDispatcherHostImpl::OnShutdown() { |
| 1113 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1120 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1114 | 1121 |
| 1115 is_shutdown_ = true; | 1122 is_shutdown_ = true; |
| 1116 pending_loaders_.clear(); | 1123 pending_loaders_.clear(); |
| 1117 | 1124 |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2640 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); | 2647 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); |
| 2641 response->head.security_info = SerializeSecurityInfo(ssl); | 2648 response->head.security_info = SerializeSecurityInfo(ssl); |
| 2642 } | 2649 } |
| 2643 | 2650 |
| 2644 CertStore* ResourceDispatcherHostImpl::GetCertStore() { | 2651 CertStore* ResourceDispatcherHostImpl::GetCertStore() { |
| 2645 return cert_store_for_testing_ ? cert_store_for_testing_ | 2652 return cert_store_for_testing_ ? cert_store_for_testing_ |
| 2646 : CertStore::GetInstance(); | 2653 : CertStore::GetInstance(); |
| 2647 } | 2654 } |
| 2648 | 2655 |
| 2649 } // namespace content | 2656 } // namespace content |
| OLD | NEW |