Chromium Code Reviews| 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 #include "chromeos/dbus/fake_shill_device_client.h" | 5 #include "chromeos/dbus/fake_shill_device_client.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 257 shill::kErrorResultInProgress, error_message)); | 257 shill::kErrorResultInProgress, error_message)); |
| 258 return; | 258 return; |
| 259 } | 259 } |
| 260 std::string result; | 260 std::string result; |
| 261 if (operation == shill::kTDLSStatusOperation) | 261 if (operation == shill::kTDLSStatusOperation) |
| 262 result = shill::kTDLSConnectedState; | 262 result = shill::kTDLSConnectedState; |
| 263 base::MessageLoop::current()->PostTask(FROM_HERE, | 263 base::MessageLoop::current()->PostTask(FROM_HERE, |
| 264 base::Bind(callback, result)); | 264 base::Bind(callback, result)); |
| 265 } | 265 } |
| 266 | 266 |
| 267 void FakeShillDeviceClient::AddWakeOnPacketConnection( | |
| 268 const dbus::ObjectPath& device_path, | |
| 269 const net::IPEndPoint& ip_endpoint, | |
| 270 const base::Closure& callback, | |
| 271 const ErrorCallback& error_callback) { | |
|
stevenjb
2014/11/13 22:20:17
We may want to trivially map device_path -> set<IP
Chirantan Ekbote
2014/11/14 02:47:43
Done.
| |
| 272 base::MessageLoop::current()->PostTask(FROM_HERE, callback); | |
| 273 } | |
| 274 | |
| 275 void FakeShillDeviceClient::RemoveWakeOnPacketConnection( | |
| 276 const dbus::ObjectPath& device_path, | |
| 277 const net::IPEndPoint& ip_endpoint, | |
| 278 const base::Closure& callback, | |
| 279 const ErrorCallback& error_callback) { | |
| 280 base::MessageLoop::current()->PostTask(FROM_HERE, callback); | |
| 281 } | |
| 282 | |
| 283 void FakeShillDeviceClient::RemoveAllWakeOnPacketConnections( | |
| 284 const dbus::ObjectPath& device_path, | |
| 285 const base::Closure& callback, | |
| 286 const ErrorCallback& error_callback) { | |
| 287 base::MessageLoop::current()->PostTask(FROM_HERE, callback); | |
| 288 } | |
| 289 | |
| 267 ShillDeviceClient::TestInterface* FakeShillDeviceClient::GetTestInterface() { | 290 ShillDeviceClient::TestInterface* FakeShillDeviceClient::GetTestInterface() { |
| 268 return this; | 291 return this; |
| 269 } | 292 } |
| 270 | 293 |
| 271 // ShillDeviceClient::TestInterface overrides. | 294 // ShillDeviceClient::TestInterface overrides. |
| 272 | 295 |
| 273 void FakeShillDeviceClient::AddDevice(const std::string& device_path, | 296 void FakeShillDeviceClient::AddDevice(const std::string& device_path, |
| 274 const std::string& type, | 297 const std::string& type, |
| 275 const std::string& name) { | 298 const std::string& name) { |
| 276 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> | 299 DBusThreadManager::Get()->GetShillManagerClient()->GetTestInterface()-> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 387 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = | 410 std::map<dbus::ObjectPath, PropertyObserverList*>::iterator iter = |
| 388 observer_list_.find(device_path); | 411 observer_list_.find(device_path); |
| 389 if (iter != observer_list_.end()) | 412 if (iter != observer_list_.end()) |
| 390 return *(iter->second); | 413 return *(iter->second); |
| 391 PropertyObserverList* observer_list = new PropertyObserverList(); | 414 PropertyObserverList* observer_list = new PropertyObserverList(); |
| 392 observer_list_[device_path] = observer_list; | 415 observer_list_[device_path] = observer_list; |
| 393 return *observer_list; | 416 return *observer_list; |
| 394 } | 417 } |
| 395 | 418 |
| 396 } // namespace chromeos | 419 } // namespace chromeos |
| OLD | NEW |