| 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> |
| 9 #include <set> |
| 8 #include <string> | 10 #include <string> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 11 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
| 12 #include "chromeos/dbus/shill_device_client.h" | 14 #include "chromeos/dbus/shill_device_client.h" |
| 13 | 15 |
| 14 namespace chromeos { | 16 namespace chromeos { |
| 15 | 17 |
| 16 // A fake implementation of ShillDeviceClient. | 18 // A fake implementation of ShillDeviceClient. |
| 17 // Implemented: Stub cellular device for SMS testing. | 19 // Implemented: Stub cellular device for SMS testing. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 const ErrorCallback& error_callback) override; | 77 const ErrorCallback& error_callback) override; |
| 76 virtual void Reset(const dbus::ObjectPath& device_path, | 78 virtual void Reset(const dbus::ObjectPath& device_path, |
| 77 const base::Closure& callback, | 79 const base::Closure& callback, |
| 78 const ErrorCallback& error_callback) override; | 80 const ErrorCallback& error_callback) override; |
| 79 virtual void PerformTDLSOperation( | 81 virtual void PerformTDLSOperation( |
| 80 const dbus::ObjectPath& device_path, | 82 const dbus::ObjectPath& device_path, |
| 81 const std::string& operation, | 83 const std::string& operation, |
| 82 const std::string& peer, | 84 const std::string& peer, |
| 83 const StringCallback& callback, | 85 const StringCallback& callback, |
| 84 const ErrorCallback& error_callback) override; | 86 const ErrorCallback& error_callback) override; |
| 87 void AddWakeOnPacketConnection( |
| 88 const dbus::ObjectPath& device_path, |
| 89 const net::IPEndPoint& ip_endpoint, |
| 90 const base::Closure& callback, |
| 91 const ErrorCallback& error_callback) override; |
| 92 void RemoveWakeOnPacketConnection( |
| 93 const dbus::ObjectPath& device_path, |
| 94 const net::IPEndPoint& ip_endpoint, |
| 95 const base::Closure& callback, |
| 96 const ErrorCallback& error_callback) override; |
| 97 void RemoveAllWakeOnPacketConnections( |
| 98 const dbus::ObjectPath& device_path, |
| 99 const base::Closure& callback, |
| 100 const ErrorCallback& error_callback) override; |
| 85 | 101 |
| 86 virtual ShillDeviceClient::TestInterface* GetTestInterface() override; | 102 virtual ShillDeviceClient::TestInterface* GetTestInterface() override; |
| 87 | 103 |
| 88 // ShillDeviceClient::TestInterface overrides. | 104 // ShillDeviceClient::TestInterface overrides. |
| 89 virtual void AddDevice(const std::string& device_path, | 105 virtual void AddDevice(const std::string& device_path, |
| 90 const std::string& type, | 106 const std::string& type, |
| 91 const std::string& name) override; | 107 const std::string& name) override; |
| 92 virtual void RemoveDevice(const std::string& device_path) override; | 108 virtual void RemoveDevice(const std::string& device_path) override; |
| 93 virtual void ClearDevices() override; | 109 virtual void ClearDevices() override; |
| 94 virtual void SetDeviceProperty(const std::string& device_path, | 110 virtual void SetDeviceProperty(const std::string& device_path, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 114 base::DictionaryValue* GetDeviceProperties(const std::string& device_path); | 130 base::DictionaryValue* GetDeviceProperties(const std::string& device_path); |
| 115 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); | 131 PropertyObserverList& GetObserverList(const dbus::ObjectPath& device_path); |
| 116 | 132 |
| 117 // Dictionary of <device_name, Dictionary>. | 133 // Dictionary of <device_name, Dictionary>. |
| 118 base::DictionaryValue stub_devices_; | 134 base::DictionaryValue stub_devices_; |
| 119 // Observer list for each device. | 135 // Observer list for each device. |
| 120 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; | 136 std::map<dbus::ObjectPath, PropertyObserverList*> observer_list_; |
| 121 | 137 |
| 122 int tdls_busy_count_; // Number of times to return InProgress for TDLS. | 138 int tdls_busy_count_; // Number of times to return InProgress for TDLS. |
| 123 | 139 |
| 140 // Wake on packet connections for each device. |
| 141 std::map<dbus::ObjectPath, std::set<net::IPEndPoint> > |
| 142 wake_on_packet_connections_; |
| 143 |
| 124 // Note: This should remain the last member so it'll be destroyed and | 144 // Note: This should remain the last member so it'll be destroyed and |
| 125 // invalidate its weak pointers before any other members are destroyed. | 145 // invalidate its weak pointers before any other members are destroyed. |
| 126 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; | 146 base::WeakPtrFactory<FakeShillDeviceClient> weak_ptr_factory_; |
| 127 | 147 |
| 128 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); | 148 DISALLOW_COPY_AND_ASSIGN(FakeShillDeviceClient); |
| 129 }; | 149 }; |
| 130 | 150 |
| 131 } // namespace chromeos | 151 } // namespace chromeos |
| 132 | 152 |
| 133 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ | 153 #endif // CHROMEOS_DBUS_FAKE_SHILL_DEVICE_CLIENT_H_ |
| OLD | NEW |