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

Side by Side Diff: chromeos/dbus/fake_shill_manager_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_device_client.cc ('k') | chromeos/dbus/fake_shill_service_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_manager_client.h" 5 #include "chromeos/dbus/fake_shill_manager_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
959 void FakeShillManagerClient::NotifyObserversPropertyChanged( 959 void FakeShillManagerClient::NotifyObserversPropertyChanged(
960 const std::string& property) { 960 const std::string& property) {
961 VLOG(1) << "NotifyObserversPropertyChanged: " << property; 961 VLOG(1) << "NotifyObserversPropertyChanged: " << property;
962 base::Value* value = NULL; 962 base::Value* value = NULL;
963 if (!stub_properties_.GetWithoutPathExpansion(property, &value)) { 963 if (!stub_properties_.GetWithoutPathExpansion(property, &value)) {
964 LOG(ERROR) << "Notify for unknown property: " << property; 964 LOG(ERROR) << "Notify for unknown property: " << property;
965 return; 965 return;
966 } 966 }
967 if (property == shill::kServiceCompleteListProperty) { 967 if (property == shill::kServiceCompleteListProperty) {
968 std::unique_ptr<base::ListValue> services(GetEnabledServiceList(property)); 968 std::unique_ptr<base::ListValue> services(GetEnabledServiceList(property));
969 FOR_EACH_OBSERVER(ShillPropertyChangedObserver, 969 for (auto& observer : observer_list_)
970 observer_list_, 970 observer.OnPropertyChanged(property, *(services.get()));
971 OnPropertyChanged(property, *(services.get())));
972 return; 971 return;
973 } 972 }
974 FOR_EACH_OBSERVER(ShillPropertyChangedObserver, 973 for (auto& observer : observer_list_)
975 observer_list_, 974 observer.OnPropertyChanged(property, *value);
976 OnPropertyChanged(property, *value));
977 } 975 }
978 976
979 base::ListValue* FakeShillManagerClient::GetListProperty( 977 base::ListValue* FakeShillManagerClient::GetListProperty(
980 const std::string& property) { 978 const std::string& property) {
981 base::ListValue* list_property = NULL; 979 base::ListValue* list_property = NULL;
982 if (!stub_properties_.GetListWithoutPathExpansion( 980 if (!stub_properties_.GetListWithoutPathExpansion(
983 property, &list_property)) { 981 property, &list_property)) {
984 list_property = new base::ListValue; 982 list_property = new base::ListValue;
985 stub_properties_.SetWithoutPathExpansion(property, list_property); 983 stub_properties_.SetWithoutPathExpansion(property, list_property);
986 } 984 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 LOG(WARNING) << "Invalid state: " << state << " for " << type; 1228 LOG(WARNING) << "Invalid state: " << state << " for " << type;
1231 result = shill::kStateIdle; 1229 result = shill::kStateIdle;
1232 } 1230 }
1233 } 1231 }
1234 VLOG(1) << "Initial state for: " << type << " = " << result 1232 VLOG(1) << "Initial state for: " << type << " = " << result
1235 << " Enabled: " << *enabled; 1233 << " Enabled: " << *enabled;
1236 return result; 1234 return result;
1237 } 1235 }
1238 1236
1239 } // namespace chromeos 1237 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_shill_device_client.cc ('k') | chromeos/dbus/fake_shill_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698