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

Side by Side Diff: chromeos/dbus/fake_shill_service_client.cc

Issue 2413963002: Replace FOR_EACH_OBSERVER in chromeos/ with range-based for (Closed)
Patch Set: Run the script again with '/mg' 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 | « chromeos/dbus/fake_shill_manager_client.cc ('k') | chromeos/dbus/fake_update_engine_client.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 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 "chromeos/dbus/fake_shill_service_client.h" 5 #include "chromeos/dbus/fake_shill_service_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 if (!stub_services_.GetDictionaryWithoutPathExpansion(path, &dict)) { 514 if (!stub_services_.GetDictionaryWithoutPathExpansion(path, &dict)) {
515 LOG(ERROR) << "Notify for unknown service: " << path; 515 LOG(ERROR) << "Notify for unknown service: " << path;
516 return; 516 return;
517 } 517 }
518 base::Value* value = NULL; 518 base::Value* value = NULL;
519 if (!dict->GetWithoutPathExpansion(property, &value)) { 519 if (!dict->GetWithoutPathExpansion(property, &value)) {
520 LOG(ERROR) << "Notify for unknown property: " 520 LOG(ERROR) << "Notify for unknown property: "
521 << path << " : " << property; 521 << path << " : " << property;
522 return; 522 return;
523 } 523 }
524 FOR_EACH_OBSERVER(ShillPropertyChangedObserver, 524 for (auto& observer : GetObserverList(service_path))
525 GetObserverList(service_path), 525 observer.OnPropertyChanged(property, *value);
526 OnPropertyChanged(property, *value));
527 } 526 }
528 527
529 base::DictionaryValue* FakeShillServiceClient::GetModifiableServiceProperties( 528 base::DictionaryValue* FakeShillServiceClient::GetModifiableServiceProperties(
530 const std::string& service_path, bool create_if_missing) { 529 const std::string& service_path, bool create_if_missing) {
531 base::DictionaryValue* properties = NULL; 530 base::DictionaryValue* properties = NULL;
532 if (!stub_services_.GetDictionaryWithoutPathExpansion(service_path, 531 if (!stub_services_.GetDictionaryWithoutPathExpansion(service_path,
533 &properties) && 532 &properties) &&
534 create_if_missing) { 533 create_if_missing) {
535 properties = new base::DictionaryValue; 534 properties = new base::DictionaryValue;
536 stub_services_.Set(service_path, properties); 535 stub_services_.Set(service_path, properties);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 base::StringValue(shill::kErrorBadPassphrase))); 626 base::StringValue(shill::kErrorBadPassphrase)));
628 } else { 627 } else {
629 // Set Online. 628 // Set Online.
630 VLOG(1) << "Setting state to Online " << service_path; 629 VLOG(1) << "Setting state to Online " << service_path;
631 SetServiceProperty(service_path, shill::kStateProperty, 630 SetServiceProperty(service_path, shill::kStateProperty,
632 base::StringValue(shill::kStateOnline)); 631 base::StringValue(shill::kStateOnline));
633 } 632 }
634 } 633 }
635 634
636 } // namespace chromeos 635 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_manager_client.cc ('k') | chromeos/dbus/fake_update_engine_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698