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

Side by Side Diff: net/nqe/network_quality_store.cc

Issue 2423713002: Remove usage of FOR_EACH_OBSERVER macro in net (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « net/log/net_log.cc ('k') | net/proxy/polling_proxy_config_service.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "net/nqe/network_quality_store.h" 5 #include "net/nqe/network_quality_store.h"
6 6
7 #include "net/base/network_change_notifier.h" 7 #include "net/base/network_change_notifier.h"
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 oldest_entry_iterator = it; 53 oldest_entry_iterator = it;
54 } 54 }
55 cached_network_qualities_.erase(oldest_entry_iterator); 55 cached_network_qualities_.erase(oldest_entry_iterator);
56 } 56 }
57 57
58 cached_network_qualities_.insert( 58 cached_network_qualities_.insert(
59 std::make_pair(network_id, cached_network_quality)); 59 std::make_pair(network_id, cached_network_quality));
60 DCHECK_LE(cached_network_qualities_.size(), 60 DCHECK_LE(cached_network_qualities_.size(),
61 static_cast<size_t>(kMaximumNetworkQualityCacheSize)); 61 static_cast<size_t>(kMaximumNetworkQualityCacheSize));
62 62
63 FOR_EACH_OBSERVER( 63 for (auto& observer : network_qualities_cache_observer_list_)
64 NetworkQualitiesCacheObserver, network_qualities_cache_observer_list_, 64 observer.OnChangeInCachedNetworkQuality(network_id, cached_network_quality);
65 OnChangeInCachedNetworkQuality(network_id, cached_network_quality));
66 } 65 }
67 66
68 bool NetworkQualityStore::GetById( 67 bool NetworkQualityStore::GetById(
69 const nqe::internal::NetworkID& network_id, 68 const nqe::internal::NetworkID& network_id,
70 nqe::internal::CachedNetworkQuality* cached_network_quality) { 69 nqe::internal::CachedNetworkQuality* cached_network_quality) {
71 DCHECK(thread_checker_.CalledOnValidThread()); 70 DCHECK(thread_checker_.CalledOnValidThread());
72 71
73 CachedNetworkQualities::const_iterator it = 72 CachedNetworkQualities::const_iterator it =
74 cached_network_qualities_.find(network_id); 73 cached_network_qualities_.find(network_id);
75 74
(...skipping 16 matching lines...) Expand all
92 observer) { 91 observer) {
93 DCHECK(thread_checker_.CalledOnValidThread()); 92 DCHECK(thread_checker_.CalledOnValidThread());
94 network_qualities_cache_observer_list_.RemoveObserver(observer); 93 network_qualities_cache_observer_list_.RemoveObserver(observer);
95 } 94 }
96 95
97 } // namespace internal 96 } // namespace internal
98 97
99 } // namespace nqe 98 } // namespace nqe
100 99
101 } // namespace net 100 } // namespace net
OLDNEW
« no previous file with comments | « net/log/net_log.cc ('k') | net/proxy/polling_proxy_config_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698