OLD | NEW |
---|---|
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 #ifndef CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
6 #define CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; | 116 typedef ObserverList<ShillPropertyChangedObserver> PropertyObserverList; |
117 | 117 |
118 void SetDefaultProperties(); | 118 void SetDefaultProperties(); |
119 void PassStubDeviceProperties(const dbus::ObjectPath& device_path, | 119 void PassStubDeviceProperties(const dbus::ObjectPath& device_path, |
120 const DictionaryValueCallback& callback) const; | 120 const DictionaryValueCallback& callback) const; |
121 | 121 |
122 // Posts a task to run a void callback with status code |status|. | 122 // Posts a task to run a void callback with status code |status|. |
123 void PostVoidCallback(const VoidDBusMethodCallback& callback, | 123 void PostVoidCallback(const VoidDBusMethodCallback& callback, |
124 DBusMethodCallStatus status); | 124 DBusMethodCallStatus status); |
125 | 125 |
126 // SetProperty helper method. | |
pneubeck (no reviews)
2015/03/27 18:26:46
The function name doesn't really explain what's th
stevenjb
2015/03/27 23:18:04
In english, 'always' and 'unconditionally' are pre
| |
127 void AlwaysSetProperty(const dbus::ObjectPath& device_path, | |
128 const std::string& name, | |
129 const base::Value& value, | |
130 const base::Closure& callback, | |
131 const ErrorCallback& error_callback); | |
132 | |
126 void NotifyObserversPropertyChanged(const dbus::ObjectPath& device_path, | 133 void NotifyObserversPropertyChanged(const dbus::ObjectPath& device_path, |
127 const std::string& property); | 134 const std::string& property); |
128 base::DictionaryValue* GetDeviceProperties(const std::string& device_path); | 135 base::DictionaryValue* GetDeviceProperties(const std::string& device_path); |
129 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); | 136 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); |
130 | 137 |
131 // Dictionary of <device_name, Dictionary>. | 138 // Dictionary of <device_name, Dictionary>. |
132 base::DictionaryValue stub_devices_; | 139 base::DictionaryValue stub_devices_; |
133 // Observer list for each device. | 140 // Observer list for each device. |
134 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; | 141 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; |
135 | 142 |
(...skipping 14 matching lines...) Expand all Loading... | |
150 // Note: This should remain the last member so it'll be destroyed and | 157 // Note: This should remain the last member so it'll be destroyed and |
151 // invalidate its weak pointers before any other members are destroyed. | 158 // invalidate its weak pointers before any other members are destroyed. |
152 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; | 159 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; |
153 | 160 |
154 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); | 161 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); |
155 }; | 162 }; |
156 | 163 |
157 } // namespace chromeos | 164 } // namespace chromeos |
158 | 165 |
159 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 166 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
OLD | NEW |