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> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
18 #include "base/shared_memory.h" | 18 #include "base/shared_memory.h" |
19 #include "base/stl_util-inl.h" | 19 #include "base/stl_util-inl.h" |
20 #include "base/time.h" | 20 #include "base/time.h" |
21 #include "chrome/browser/browser_process.h" | |
jam
2011/05/25 21:08:45
this is adding a dependency from content to chrome
| |
21 #include "chrome/browser/download/download_file_manager.h" | 22 #include "chrome/browser/download/download_file_manager.h" |
22 #include "chrome/browser/download/download_manager.h" | 23 #include "chrome/browser/download/download_manager.h" |
23 #include "chrome/browser/download/download_request_limiter.h" | 24 #include "chrome/browser/download/download_request_limiter.h" |
24 #include "chrome/browser/download/download_util.h" | 25 #include "chrome/browser/download/download_util.h" |
25 #include "chrome/browser/download/save_file_manager.h" | 26 #include "chrome/browser/download/save_file_manager.h" |
26 #include "chrome/browser/external_protocol_handler.h" | 27 #include "chrome/browser/external_protocol_handler.h" |
27 #include "chrome/browser/net/url_request_tracking.h" | 28 #include "chrome/browser/net/url_request_tracking.h" |
28 #include "chrome/browser/prerender/prerender_manager.h" | 29 #include "chrome/browser/prerender/prerender_manager.h" |
29 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
30 #include "chrome/browser/renderer_host/download_resource_handler.h" | 31 #include "chrome/browser/renderer_host/download_resource_handler.h" |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
250 HttpAuthResourceType HttpAuthResourceTypeOf(net::URLRequest* request) { | 251 HttpAuthResourceType HttpAuthResourceTypeOf(net::URLRequest* request) { |
251 // Use the same critera as for cookies to determine the sub-resource type | 252 // Use the same critera as for cookies to determine the sub-resource type |
252 // that is requesting to be authenticated. | 253 // that is requesting to be authenticated. |
253 if (!request->first_party_for_cookies().is_valid()) | 254 if (!request->first_party_for_cookies().is_valid()) |
254 return HTTP_AUTH_RESOURCE_TOP; | 255 return HTTP_AUTH_RESOURCE_TOP; |
255 | 256 |
256 if (net::RegistryControlledDomainService::SameDomainOrHost( | 257 if (net::RegistryControlledDomainService::SameDomainOrHost( |
257 request->first_party_for_cookies(), request->url())) | 258 request->first_party_for_cookies(), request->url())) |
258 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; | 259 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; |
259 | 260 |
260 if (CommandLine::ForCurrentProcess()->HasSwitch( | 261 if (g_browser_process->allow_cross_origin_auth_prompt()) |
261 switches::kAllowCrossOriginAuthPrompt)) | |
262 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; | 262 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; |
263 | 263 |
264 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; | 264 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; |
265 } | 265 } |
266 | 266 |
267 } // namespace | 267 } // namespace |
268 | 268 |
269 ResourceDispatcherHost::ResourceDispatcherHost( | 269 ResourceDispatcherHost::ResourceDispatcherHost( |
270 const ResourceQueue::DelegateSet& resource_queue_delegates) | 270 const ResourceQueue::DelegateSet& resource_queue_delegates) |
271 : ALLOW_THIS_IN_INITIALIZER_LIST( | 271 : ALLOW_THIS_IN_INITIALIZER_LIST( |
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2064 return is_prefetch_enabled_; | 2064 return is_prefetch_enabled_; |
2065 } | 2065 } |
2066 | 2066 |
2067 // static | 2067 // static |
2068 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { | 2068 void ResourceDispatcherHost::set_is_prefetch_enabled(bool value) { |
2069 is_prefetch_enabled_ = value; | 2069 is_prefetch_enabled_ = value; |
2070 } | 2070 } |
2071 | 2071 |
2072 // static | 2072 // static |
2073 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; | 2073 bool ResourceDispatcherHost::is_prefetch_enabled_ = false; |
2074 | |
OLD | NEW |