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 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1806 } | 1806 } |
1807 it->second->AddObserver(delegate); | 1807 it->second->AddObserver(delegate); |
1808 } | 1808 } |
1809 | 1809 |
1810 void ResourceDispatcherHostImpl::UnregisterResourceMessageDelegate( | 1810 void ResourceDispatcherHostImpl::UnregisterResourceMessageDelegate( |
1811 const GlobalRequestID& id, ResourceMessageDelegate* delegate) { | 1811 const GlobalRequestID& id, ResourceMessageDelegate* delegate) { |
1812 DCHECK(ContainsKey(delegate_map_, id)); | 1812 DCHECK(ContainsKey(delegate_map_, id)); |
1813 DelegateMap::iterator it = delegate_map_.find(id); | 1813 DelegateMap::iterator it = delegate_map_.find(id); |
1814 DCHECK(it->second->HasObserver(delegate)); | 1814 DCHECK(it->second->HasObserver(delegate)); |
1815 it->second->RemoveObserver(delegate); | 1815 it->second->RemoveObserver(delegate); |
1816 if (it->second->size() == 0) { | 1816 if (!it->second->might_have_observers()) { |
1817 delete it->second; | 1817 delete it->second; |
1818 delegate_map_.erase(it); | 1818 delegate_map_.erase(it); |
1819 } | 1819 } |
1820 } | 1820 } |
1821 | 1821 |
1822 int ResourceDispatcherHostImpl::BuildLoadFlagsForRequest( | 1822 int ResourceDispatcherHostImpl::BuildLoadFlagsForRequest( |
1823 const ResourceHostMsg_Request& request_data, | 1823 const ResourceHostMsg_Request& request_data, |
1824 int child_id, | 1824 int child_id, |
1825 bool is_sync_load) { | 1825 bool is_sync_load) { |
1826 int load_flags = request_data.load_flags; | 1826 int load_flags = request_data.load_flags; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1871 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 1871 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
1872 && !policy->CanReadRawCookies(child_id)) { | 1872 && !policy->CanReadRawCookies(child_id)) { |
1873 VLOG(1) << "Denied unauthorized request for raw headers"; | 1873 VLOG(1) << "Denied unauthorized request for raw headers"; |
1874 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 1874 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
1875 } | 1875 } |
1876 | 1876 |
1877 return load_flags; | 1877 return load_flags; |
1878 } | 1878 } |
1879 | 1879 |
1880 } // namespace content | 1880 } // namespace content |
OLD | NEW |