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 1722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 } | 1733 } |
1734 | 1734 |
1735 ResourceDispatcherHostImpl::HttpAuthResourceType | 1735 ResourceDispatcherHostImpl::HttpAuthResourceType |
1736 ResourceDispatcherHostImpl::HttpAuthResourceTypeOf(net::URLRequest* request) { | 1736 ResourceDispatcherHostImpl::HttpAuthResourceTypeOf(net::URLRequest* request) { |
1737 // Use the same critera as for cookies to determine the sub-resource type | 1737 // Use the same critera as for cookies to determine the sub-resource type |
1738 // that is requesting to be authenticated. | 1738 // that is requesting to be authenticated. |
1739 if (!request->first_party_for_cookies().is_valid()) | 1739 if (!request->first_party_for_cookies().is_valid()) |
1740 return HTTP_AUTH_RESOURCE_TOP; | 1740 return HTTP_AUTH_RESOURCE_TOP; |
1741 | 1741 |
1742 if (net::RegistryControlledDomainService::SameDomainOrHost( | 1742 if (net::RegistryControlledDomainService::SameDomainOrHost( |
1743 request->first_party_for_cookies(), request->url())) | 1743 request->first_party_for_cookies(), request->url(), |
| 1744 net::RCDS::EXCLUDE_PRIVATE_REGISTRIES)) |
1744 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; | 1745 return HTTP_AUTH_RESOURCE_SAME_DOMAIN; |
1745 | 1746 |
1746 if (allow_cross_origin_auth_prompt()) | 1747 if (allow_cross_origin_auth_prompt()) |
1747 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; | 1748 return HTTP_AUTH_RESOURCE_ALLOWED_CROSS; |
1748 | 1749 |
1749 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; | 1750 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; |
1750 } | 1751 } |
1751 | 1752 |
1752 bool ResourceDispatcherHostImpl::allow_cross_origin_auth_prompt() { | 1753 bool ResourceDispatcherHostImpl::allow_cross_origin_auth_prompt() { |
1753 return allow_cross_origin_auth_prompt_; | 1754 return allow_cross_origin_auth_prompt_; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 DelegateMap::iterator it = delegate_map_.find(id); | 1792 DelegateMap::iterator it = delegate_map_.find(id); |
1792 DCHECK(it->second->HasObserver(delegate)); | 1793 DCHECK(it->second->HasObserver(delegate)); |
1793 it->second->RemoveObserver(delegate); | 1794 it->second->RemoveObserver(delegate); |
1794 if (it->second->size() == 0) { | 1795 if (it->second->size() == 0) { |
1795 delete it->second; | 1796 delete it->second; |
1796 delegate_map_.erase(it); | 1797 delegate_map_.erase(it); |
1797 } | 1798 } |
1798 } | 1799 } |
1799 | 1800 |
1800 } // namespace content | 1801 } // namespace content |
OLD | NEW |