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

Unified Diff: net/dns/mdns_client_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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/user_input_monitor.cc ('k') | sync/js/sync_js_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mdns_client_impl.cc
diff --git a/net/dns/mdns_client_impl.cc b/net/dns/mdns_client_impl.cc
index 8f79edf4cdf8808e810e91626e56adeba036dc38..a90ac64505a22081878a276297aaca9ff5490c55 100644
--- a/net/dns/mdns_client_impl.cc
+++ b/net/dns/mdns_client_impl.cc
@@ -378,7 +378,7 @@ void MDnsClientImpl::Core::RemoveListener(MDnsListenerImpl* listener) {
observer_list_iterator->second->RemoveObserver(listener);
// Remove the observer list from the map if it is empty
- if (observer_list_iterator->second->size() == 0) {
+ if (!observer_list_iterator->second->might_have_observers()) {
// Schedule the actual removal for later in case the listener removal
// happens while iterating over the observer list.
base::MessageLoop::current()->PostTask(
@@ -389,7 +389,7 @@ void MDnsClientImpl::Core::RemoveListener(MDnsListenerImpl* listener) {
void MDnsClientImpl::Core::CleanupObserverList(const ListenerKey& key) {
ListenerMap::iterator found = listeners_.find(key);
- if (found != listeners_.end() && found->second->size() == 0) {
+ if (found != listeners_.end() && !found->second->might_have_observers()) {
delete found->second;
listeners_.erase(found);
}
« no previous file with comments | « media/base/user_input_monitor.cc ('k') | sync/js/sync_js_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698