| 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/renderer_host/resource_dispatcher_host.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 41 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| 42 #include "content/browser/renderer_host/resource_message_filter.h" | 42 #include "content/browser/renderer_host/resource_message_filter.h" |
| 43 #include "content/browser/renderer_host/resource_queue.h" | 43 #include "content/browser/renderer_host/resource_queue.h" |
| 44 #include "content/browser/renderer_host/resource_request_details.h" | 44 #include "content/browser/renderer_host/resource_request_details.h" |
| 45 #include "content/browser/renderer_host/sync_resource_handler.h" | 45 #include "content/browser/renderer_host/sync_resource_handler.h" |
| 46 #include "content/browser/renderer_host/throttling_resource_handler.h" | 46 #include "content/browser/renderer_host/throttling_resource_handler.h" |
| 47 #include "content/browser/ssl/ssl_client_auth_handler.h" | 47 #include "content/browser/ssl/ssl_client_auth_handler.h" |
| 48 #include "content/browser/ssl/ssl_manager.h" | 48 #include "content/browser/ssl/ssl_manager.h" |
| 49 #include "content/browser/worker_host/worker_service_impl.h" | 49 #include "content/browser/worker_host/worker_service_impl.h" |
| 50 #include "content/common/resource_messages.h" | 50 #include "content/common/resource_messages.h" |
| 51 #include "content/common/ssl_status_serialization.h" |
| 51 #include "content/common/view_messages.h" | 52 #include "content/common/view_messages.h" |
| 52 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
| 53 #include "content/public/browser/content_browser_client.h" | 54 #include "content/public/browser/content_browser_client.h" |
| 54 #include "content/public/browser/download_manager.h" | 55 #include "content/public/browser/download_manager.h" |
| 55 #include "content/public/browser/global_request_id.h" | 56 #include "content/public/browser/global_request_id.h" |
| 56 #include "content/public/browser/notification_service.h" | 57 #include "content/public/browser/notification_service.h" |
| 57 #include "content/public/browser/render_view_host_delegate.h" | 58 #include "content/public/browser/render_view_host_delegate.h" |
| 58 #include "content/public/browser/resource_context.h" | 59 #include "content/public/browser/resource_context.h" |
| 59 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 60 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
| 60 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" | 61 #include "content/public/browser/resource_dispatcher_host_login_delegate.h" |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 bool ResourceDispatcherHost::CompleteResponseStarted(net::URLRequest* request) { | 1497 bool ResourceDispatcherHost::CompleteResponseStarted(net::URLRequest* request) { |
| 1497 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); | 1498 ResourceDispatcherHostRequestInfo* info = InfoForRequest(request); |
| 1498 | 1499 |
| 1499 scoped_refptr<ResourceResponse> response(new ResourceResponse); | 1500 scoped_refptr<ResourceResponse> response(new ResourceResponse); |
| 1500 PopulateResourceResponse(request, response); | 1501 PopulateResourceResponse(request, response); |
| 1501 | 1502 |
| 1502 if (request->ssl_info().cert) { | 1503 if (request->ssl_info().cert) { |
| 1503 int cert_id = | 1504 int cert_id = |
| 1504 CertStore::GetInstance()->StoreCert(request->ssl_info().cert, | 1505 CertStore::GetInstance()->StoreCert(request->ssl_info().cert, |
| 1505 info->child_id()); | 1506 info->child_id()); |
| 1506 response->security_info = | 1507 response->security_info = content::SerializeSecurityInfo( |
| 1507 SSLManager::SerializeSecurityInfo( | 1508 cert_id, request->ssl_info().cert_status, |
| 1508 cert_id, request->ssl_info().cert_status, | 1509 request->ssl_info().security_bits, |
| 1509 request->ssl_info().security_bits, | 1510 request->ssl_info().connection_status); |
| 1510 request->ssl_info().connection_status); | |
| 1511 } else { | 1511 } else { |
| 1512 // We should not have any SSL state. | 1512 // We should not have any SSL state. |
| 1513 DCHECK(!request->ssl_info().cert_status && | 1513 DCHECK(!request->ssl_info().cert_status && |
| 1514 request->ssl_info().security_bits == -1 && | 1514 request->ssl_info().security_bits == -1 && |
| 1515 !request->ssl_info().connection_status); | 1515 !request->ssl_info().connection_status); |
| 1516 } | 1516 } |
| 1517 | 1517 |
| 1518 NotifyResponseStarted(request, info->child_id()); | 1518 NotifyResponseStarted(request, info->child_id()); |
| 1519 info->set_called_on_response_started(true); | 1519 info->set_called_on_response_started(true); |
| 1520 return info->resource_handler()->OnResponseStarted(info->request_id(), | 1520 return info->resource_handler()->OnResponseStarted(info->request_id(), |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1887 -request->status().error(), | 1887 -request->status().error(), |
| 1888 base::CustomHistogram::ArrayToCustomRanges( | 1888 base::CustomHistogram::ArrayToCustomRanges( |
| 1889 kAllNetErrorCodes, arraysize(kAllNetErrorCodes))); | 1889 kAllNetErrorCodes, arraysize(kAllNetErrorCodes))); |
| 1890 } | 1890 } |
| 1891 } | 1891 } |
| 1892 | 1892 |
| 1893 std::string security_info; | 1893 std::string security_info; |
| 1894 const net::SSLInfo& ssl_info = request->ssl_info(); | 1894 const net::SSLInfo& ssl_info = request->ssl_info(); |
| 1895 if (ssl_info.cert != NULL) { | 1895 if (ssl_info.cert != NULL) { |
| 1896 int cert_id = CertStore::GetInstance()->StoreCert(ssl_info.cert, | 1896 int cert_id = CertStore::GetInstance()->StoreCert(ssl_info.cert, |
| 1897 info->child_id()); | 1897 info->child_id()); |
| 1898 security_info = SSLManager::SerializeSecurityInfo( | 1898 security_info = content::SerializeSecurityInfo( |
| 1899 cert_id, ssl_info.cert_status, ssl_info.security_bits, | 1899 cert_id, ssl_info.cert_status, ssl_info.security_bits, |
| 1900 ssl_info.connection_status); | 1900 ssl_info.connection_status); |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 if (info->resource_handler()->OnResponseCompleted(info->request_id(), | 1903 if (info->resource_handler()->OnResponseCompleted(info->request_id(), |
| 1904 request->status(), | 1904 request->status(), |
| 1905 security_info)) { | 1905 security_info)) { |
| 1906 | 1906 |
| 1907 // The request is complete so we can remove it. | 1907 // The request is complete so we can remove it. |
| 1908 RemovePendingRequest(info->child_id(), info->request_id()); | 1908 RemovePendingRequest(info->child_id(), info->request_id()); |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2301 scoped_refptr<ResourceHandler> transferred_resource_handler( | 2301 scoped_refptr<ResourceHandler> transferred_resource_handler( |
| 2302 new DoomedResourceHandler(info->resource_handler())); | 2302 new DoomedResourceHandler(info->resource_handler())); |
| 2303 info->set_resource_handler(transferred_resource_handler.get()); | 2303 info->set_resource_handler(transferred_resource_handler.get()); |
| 2304 } | 2304 } |
| 2305 | 2305 |
| 2306 bool ResourceDispatcherHost::IsTransferredNavigation( | 2306 bool ResourceDispatcherHost::IsTransferredNavigation( |
| 2307 const content::GlobalRequestID& transferred_request_id) const { | 2307 const content::GlobalRequestID& transferred_request_id) const { |
| 2308 return transferred_navigations_.find(transferred_request_id) != | 2308 return transferred_navigations_.find(transferred_request_id) != |
| 2309 transferred_navigations_.end(); | 2309 transferred_navigations_.end(); |
| 2310 } | 2310 } |
| OLD | NEW |