OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 delete loaders; | 1798 delete loaders; |
1799 } | 1799 } |
1800 | 1800 |
1801 ResourceDispatcherHostImpl::HttpAuthResourceType | 1801 ResourceDispatcherHostImpl::HttpAuthResourceType |
1802 ResourceDispatcherHostImpl::HttpAuthResourceTypeOf(net::URLRequest* request) { | 1802 ResourceDispatcherHostImpl::HttpAuthResourceTypeOf(net::URLRequest* request) { |
1803 // Use the same critera as for cookies to determine the sub-resource type | 1803 // Use the same critera as for cookies to determine the sub-resource type |
1804 // that is requesting to be authenticated. | 1804 // that is requesting to be authenticated. |
1805 if (!request->first_party_for_cookies().is_valid()) | 1805 if (!request->first_party_for_cookies().is_valid()) |
1806 return HTTP_AUTH_RESOURCE_TOP; | 1806 return HTTP_AUTH_RESOURCE_TOP; |
1807 | 1807 |
1808 if (net::RegistryControlledDomainService::SameDomainOrHost( | 1808 if (net::registry_controlled_domains::SameDomainOrHost( |
1809 request->first_party_for_cookies(), request->url())) | 1809 request->first_party_for_cookies(), request->url(), |
| 1810 net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES)) |
1810 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; | 1811 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; |
1811 | 1812 |
1812 if (allow_cross_origin_auth_prompt()) | 1813 if (allow_cross_origin_auth_prompt()) |
1813 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; | 1814 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; |
1814 | 1815 |
1815 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; | 1816 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; |
1816 } | 1817 } |
1817 | 1818 |
1818 bool ResourceDispatcherHostImpl::allow_cross_origin_auth_prompt() { | 1819 bool ResourceDispatcherHostImpl::allow_cross_origin_auth_prompt() { |
1819 return allow_cross_origin_auth_prompt_; | 1820 return allow_cross_origin_auth_prompt_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1857 DelegateMap::iterator it = delegate_map_.find(id); | 1858 DelegateMap::iterator it = delegate_map_.find(id); |
1858 DCHECK(it->second->HasObserver(delegate)); | 1859 DCHECK(it->second->HasObserver(delegate)); |
1859 it->second->RemoveObserver(delegate); | 1860 it->second->RemoveObserver(delegate); |
1860 if (it->second->size() == 0) { | 1861 if (it->second->size() == 0) { |
1861 delete it->second; | 1862 delete it->second; |
1862 delegate_map_.erase(it); | 1863 delegate_map_.erase(it); |
1863 } | 1864 } |
1864 } | 1865 } |
1865 | 1866 |
1866 } // namespace content | 1867 } // namespace content |
OLD | NEW |