| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 return; | 326 return; |
| 327 } | 327 } |
| 328 | 328 |
| 329 // Construct the request. | 329 // Construct the request. |
| 330 URLRequest* request = new URLRequest(request_data.url, this); | 330 URLRequest* request = new URLRequest(request_data.url, this); |
| 331 request->set_method(request_data.method); | 331 request->set_method(request_data.method); |
| 332 request->set_first_party_for_cookies(request_data.first_party_for_cookies); | 332 request->set_first_party_for_cookies(request_data.first_party_for_cookies); |
| 333 request->set_referrer(request_data.referrer.spec()); | 333 request->set_referrer(request_data.referrer.spec()); |
| 334 request->SetExtraRequestHeaders(request_data.headers); | 334 request->SetExtraRequestHeaders(request_data.headers); |
| 335 int load_flags = request_data.load_flags; | 335 int load_flags = request_data.load_flags; |
| 336 // EV certificate verification could be expensive. We don't want to spend |
| 337 // time performing EV certificate verification on all resources because |
| 338 // EV status is irrelevant to sub-frames and sub-resources. |
| 336 if (request_data.resource_type == ResourceType::MAIN_FRAME) | 339 if (request_data.resource_type == ResourceType::MAIN_FRAME) |
| 337 load_flags |= net::LOAD_VERIFY_EV_CERT; | 340 load_flags |= net::LOAD_VERIFY_EV_CERT; |
| 338 request->set_load_flags(load_flags); | 341 request->set_load_flags(load_flags); |
| 339 request->set_context(context); | 342 request->set_context(context); |
| 340 request->set_origin_pid(request_data.origin_pid); | 343 request->set_origin_pid(request_data.origin_pid); |
| 341 | 344 |
| 342 if (IsHttpPrioritizationEnabled()) { | 345 if (IsHttpPrioritizationEnabled()) { |
| 343 // If the request is for the top level page or a frame/iframe, then we | 346 // If the request is for the top level page or a frame/iframe, then we |
| 344 // should prioritize it higher than other resource types. Currently, we | 347 // should prioritize it higher than other resource types. Currently, we |
| 345 // just use priorities 1 and 0. | 348 // just use priorities 1 and 0. |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 response->response_head.filter_policy = info->filter_policy; | 923 response->response_head.filter_policy = info->filter_policy; |
| 921 response->response_head.content_length = request->GetExpectedContentSize(); | 924 response->response_head.content_length = request->GetExpectedContentSize(); |
| 922 response->response_head.app_cache_id = WebAppCacheContext::kNoAppCacheId; | 925 response->response_head.app_cache_id = WebAppCacheContext::kNoAppCacheId; |
| 923 request->GetMimeType(&response->response_head.mime_type); | 926 request->GetMimeType(&response->response_head.mime_type); |
| 924 | 927 |
| 925 if (request->ssl_info().cert) { | 928 if (request->ssl_info().cert) { |
| 926 int cert_id = | 929 int cert_id = |
| 927 CertStore::GetSharedInstance()->StoreCert( | 930 CertStore::GetSharedInstance()->StoreCert( |
| 928 request->ssl_info().cert, | 931 request->ssl_info().cert, |
| 929 info->process_id); | 932 info->process_id); |
| 930 int cert_status = request->ssl_info().cert_status; | |
| 931 // EV certificate verification could be expensive. We don't want to spend | |
| 932 // time performing EV certificate verification on all resources because | |
| 933 // EV status is irrelevant to sub-frames and sub-resources. So we call | |
| 934 // IsEV here rather than in the network layer because the network layer | |
| 935 // doesn't know the resource type. | |
| 936 if (info->resource_type == ResourceType::MAIN_FRAME && | |
| 937 request->ssl_info().cert->IsEV(cert_status)) | |
| 938 cert_status |= net::CERT_STATUS_IS_EV; | |
| 939 | |
| 940 response->response_head.security_info = | 933 response->response_head.security_info = |
| 941 SSLManager::SerializeSecurityInfo(cert_id, | 934 SSLManager::SerializeSecurityInfo(cert_id, |
| 942 cert_status, | 935 request->ssl_info().cert_status, |
| 943 request->ssl_info().security_bits); | 936 request->ssl_info().security_bits); |
| 944 } else { | 937 } else { |
| 945 // We should not have any SSL state. | 938 // We should not have any SSL state. |
| 946 DCHECK(!request->ssl_info().cert_status && | 939 DCHECK(!request->ssl_info().cert_status && |
| 947 (request->ssl_info().security_bits == -1 || | 940 (request->ssl_info().security_bits == -1 || |
| 948 request->ssl_info().security_bits == 0)); | 941 request->ssl_info().security_bits == 0)); |
| 949 } | 942 } |
| 950 | 943 |
| 951 NotifyResponseStarted(request, info->process_id); | 944 NotifyResponseStarted(request, info->process_id); |
| 952 return info->resource_handler->OnResponseStarted(info->request_id, | 945 return info->resource_handler->OnResponseStarted(info->request_id, |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1555 case ViewHostMsg_UploadProgress_ACK::ID: | 1548 case ViewHostMsg_UploadProgress_ACK::ID: |
| 1556 case ViewHostMsg_SyncLoad::ID: | 1549 case ViewHostMsg_SyncLoad::ID: |
| 1557 return true; | 1550 return true; |
| 1558 | 1551 |
| 1559 default: | 1552 default: |
| 1560 break; | 1553 break; |
| 1561 } | 1554 } |
| 1562 | 1555 |
| 1563 return false; | 1556 return false; |
| 1564 } | 1557 } |
| OLD | NEW |