OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 request->set_referrer(CommandLine::ForCurrentProcess()->HasSwitch( | 418 request->set_referrer(CommandLine::ForCurrentProcess()->HasSwitch( |
419 switches::kNoReferrers) ? std::string() : request_data.referrer.spec()); | 419 switches::kNoReferrers) ? std::string() : request_data.referrer.spec()); |
420 net::HttpRequestHeaders headers; | 420 net::HttpRequestHeaders headers; |
421 headers.AddHeadersFromString(request_data.headers); | 421 headers.AddHeadersFromString(request_data.headers); |
422 request->SetExtraRequestHeaders(headers); | 422 request->SetExtraRequestHeaders(headers); |
423 | 423 |
424 int load_flags = request_data.load_flags; | 424 int load_flags = request_data.load_flags; |
425 // EV certificate verification could be expensive. We don't want to spend | 425 // EV certificate verification could be expensive. We don't want to spend |
426 // time performing EV certificate verification on all resources because | 426 // time performing EV certificate verification on all resources because |
427 // EV status is irrelevant to sub-frames and sub-resources. | 427 // EV status is irrelevant to sub-frames and sub-resources. |
428 if (request_data.resource_type == ResourceType::MAIN_FRAME) | 428 if (request_data.resource_type == ResourceType::MAIN_FRAME) { |
429 load_flags |= net::LOAD_VERIFY_EV_CERT; | 429 load_flags |= net::LOAD_VERIFY_EV_CERT | net::LOAD_MAIN_FRAME; |
| 430 } else if (request_data.resource_type == ResourceType::SUB_FRAME) { |
| 431 load_flags |= net::LOAD_SUB_FRAME; |
| 432 } |
430 request->set_load_flags(load_flags); | 433 request->set_load_flags(load_flags); |
431 request->set_context(context); | 434 request->set_context(context); |
432 request->set_priority(DetermineRequestPriority(request_data.resource_type)); | 435 request->set_priority(DetermineRequestPriority(request_data.resource_type)); |
433 | 436 |
434 // Set upload data. | 437 // Set upload data. |
435 uint64 upload_size = 0; | 438 uint64 upload_size = 0; |
436 if (request_data.upload_data) { | 439 if (request_data.upload_data) { |
437 request->set_upload(request_data.upload_data); | 440 request->set_upload(request_data.upload_data); |
438 upload_size = request_data.upload_data->GetContentLength(); | 441 upload_size = request_data.upload_data->GetContentLength(); |
439 } | 442 } |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1839 // them. | 1842 // them. |
1840 case ResourceType::IMAGE: | 1843 case ResourceType::IMAGE: |
1841 return net::LOWEST; | 1844 return net::LOWEST; |
1842 | 1845 |
1843 default: | 1846 default: |
1844 // When new resource types are added, their priority must be considered. | 1847 // When new resource types are added, their priority must be considered. |
1845 NOTREACHED(); | 1848 NOTREACHED(); |
1846 return net::LOW; | 1849 return net::LOW; |
1847 } | 1850 } |
1848 } | 1851 } |
OLD | NEW |