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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 HttpAuthResourceType HttpAuthResourceTypeOf(net::URLRequest* request) { | 248 HttpAuthResourceType HttpAuthResourceTypeOf(net::URLRequest* request) { |
249 // Use the same critera as for cookies to determine the sub-resource type | 249 // Use the same critera as for cookies to determine the sub-resource type |
250 // that is requesting to be authenticated. | 250 // that is requesting to be authenticated. |
251 if (!request->first_party_for_cookies().is_valid()) | 251 if (!request->first_party_for_cookies().is_valid()) |
252 return HTTP_AUTH_RESOURCE_TOP; | 252 return HTTP_AUTH_RESOURCE_TOP; |
253 | 253 |
254 if (net::RegistryControlledDomainService::SameDomainOrHost( | 254 if (net::RegistryControlledDomainService::SameDomainOrHost( |
255 request->first_party_for_cookies(), request->url())) | 255 request->first_party_for_cookies(), request->url())) |
256 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; | 256 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; |
257 | 257 |
258 if (CommandLine::ForCurrentProcess()->HasSwitch( | 258 if (ResourceDispatcherHost::allow_cross_origin_auth_prompt()) |
259 switches::kAllowCrossOriginAuthPrompt)) | |
260 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; | 259 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; |
261 | 260 |
262 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; | 261 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; |
263 } | 262 } |
264 | 263 |
265 } // namespace | 264 } // namespace |
266 | 265 |
267 ResourceDispatcherHost::ResourceDispatcherHost( | 266 ResourceDispatcherHost::ResourceDispatcherHost( |
268 const ResourceQueue::DelegateSet& resource_queue_delegates) | 267 const ResourceQueue::DelegateSet& resource_queue_delegates) |
269 : ALLOW_THIS_IN_INITIALIZER_LIST( | 268 : ALLOW_THIS_IN_INITIALIZER_LIST( |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2015 return is_prefetch_enabled_; | 2014 return is_prefetch_enabled_; |
2016 } | 2015 } |
2017 | 2016 |
2018 // static | 2017 // static |
2019 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 2018 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
2020 is_prefetch_enabled_ = value; | 2019 is_prefetch_enabled_ = value; |
2021 } | 2020 } |
2022 | 2021 |
2023 // static | 2022 // static |
2024 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 2023 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
| 2024 |
| 2025 // static |
| 2026 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { |
| 2027 return allow_cross_origin_auth_prompt_; |
| 2028 } |
| 2029 |
| 2030 // static |
| 2031 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { |
| 2032 allow_cross_origin_auth_prompt_ = value; |
| 2033 } |
| 2034 |
| 2035 // static |
| 2036 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt_ = false; |
| 2037 |
OLD | NEW |