Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 23190045: Switch ObserverList::size() to ObserverList::might_have_observers() Pt.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/shill_manager_client_stub.cc ('k') | content/browser/media/webrtc_internals.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_manager_client_stub.cc ('k') | content/browser/media/webrtc_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698