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

Side by Side Diff: chrome/browser/extensions/api/mdns/dns_sd_registry.cc

Issue 2422963002: Remove FOR_EACH_OBSERVER macro usage in chrome/browser/extensions (Closed)
Patch Set: extensions 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/extensions/api/mdns/dns_sd_registry.h" 5 #include "chrome/browser/extensions/api/mdns/dns_sd_registry.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "chrome/browser/extensions/api/mdns/dns_sd_device_lister.h" 10 #include "chrome/browser/extensions/api/mdns/dns_sd_device_lister.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 bool is_cleared = service_data_map_[service_type]->ClearServices(); 224 bool is_cleared = service_data_map_[service_type]->ClearServices();
225 VLOG(1) << "ServicesFlushed: is_cleared: " << is_cleared; 225 VLOG(1) << "ServicesFlushed: is_cleared: " << is_cleared;
226 226
227 if (is_cleared) 227 if (is_cleared)
228 DispatchApiEvent(service_type); 228 DispatchApiEvent(service_type);
229 } 229 }
230 230
231 void DnsSdRegistry::DispatchApiEvent(const std::string& service_type) { 231 void DnsSdRegistry::DispatchApiEvent(const std::string& service_type) {
232 VLOG(1) << "DispatchApiEvent: service_type: " << service_type; 232 VLOG(1) << "DispatchApiEvent: service_type: " << service_type;
233 FOR_EACH_OBSERVER(DnsSdObserver, observers_, OnDnsSdEvent( 233 for (auto& observer : observers_) {
234 service_type, service_data_map_[service_type]->GetServiceList())); 234 observer.OnDnsSdEvent(service_type,
235 service_data_map_[service_type]->GetServiceList());
236 }
235 } 237 }
236 238
237 bool DnsSdRegistry::IsRegistered(const std::string& service_type) { 239 bool DnsSdRegistry::IsRegistered(const std::string& service_type) {
238 return service_data_map_.find(service_type) != service_data_map_.end(); 240 return service_data_map_.find(service_type) != service_data_map_.end();
239 } 241 }
240 242
241 } // namespace extensions 243 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_api.cc ('k') | chrome/browser/extensions/blacklist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698