OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2021 | 2021 |
2022 // Sub resources, objects and media are lower priority than potentially | 2022 // Sub resources, objects and media are lower priority than potentially |
2023 // blocking stylesheets, scripts and fonts, but are higher priority than | 2023 // blocking stylesheets, scripts and fonts, but are higher priority than |
2024 // images because if they exist they are probably more central to the page | 2024 // images because if they exist they are probably more central to the page |
2025 // focus than images on the page. | 2025 // focus than images on the page. |
2026 case ResourceType::SUB_RESOURCE: | 2026 case ResourceType::SUB_RESOURCE: |
2027 case ResourceType::OBJECT: | 2027 case ResourceType::OBJECT: |
2028 case ResourceType::MEDIA: | 2028 case ResourceType::MEDIA: |
2029 case ResourceType::WORKER: | 2029 case ResourceType::WORKER: |
2030 case ResourceType::SHARED_WORKER: | 2030 case ResourceType::SHARED_WORKER: |
| 2031 case ResourceType::XHR: |
2031 return net::LOW; | 2032 return net::LOW; |
2032 | 2033 |
2033 // Images are the "lowest" priority because they typically do not block | 2034 // Images are the "lowest" priority because they typically do not block |
2034 // downloads or rendering and most pages have some useful content without | 2035 // downloads or rendering and most pages have some useful content without |
2035 // them. | 2036 // them. |
2036 case ResourceType::IMAGE: | 2037 case ResourceType::IMAGE: |
2037 // Favicons aren't required for rendering the current page, but | 2038 // Favicons aren't required for rendering the current page, but |
2038 // are user visible. | 2039 // are user visible. |
2039 case ResourceType::FAVICON: | 2040 case ResourceType::FAVICON: |
2040 return net::LOWEST; | 2041 return net::LOWEST; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; | 2084 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; |
2084 } | 2085 } |
2085 | 2086 |
2086 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { | 2087 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { |
2087 return allow_cross_origin_auth_prompt_; | 2088 return allow_cross_origin_auth_prompt_; |
2088 } | 2089 } |
2089 | 2090 |
2090 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { | 2091 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { |
2091 allow_cross_origin_auth_prompt_ = value; | 2092 allow_cross_origin_auth_prompt_ = value; |
2092 } | 2093 } |
OLD | NEW |