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

Unified Diff: chromeos/dbus/shill_device_client.cc

Issue 722043004: Clean up wake on wifi handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/shill_device_client.cc
diff --git a/chromeos/dbus/shill_device_client.cc b/chromeos/dbus/shill_device_client.cc
index 1a523ffd3342167b0d6abd70336a9ebdeaf7120e..5fd63b95a75a74220ee467e83df0e85fac6be473 100644
--- a/chromeos/dbus/shill_device_client.cc
+++ b/chromeos/dbus/shill_device_client.cc
@@ -14,6 +14,8 @@
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "dbus/values_util.h"
+#include "net/base/ip_endpoint.h"
+#include "net/base/net_util.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos {
@@ -23,7 +25,7 @@ namespace {
// The ShillDeviceClient implementation.
class ShillDeviceClientImpl : public ShillDeviceClient {
public:
- explicit ShillDeviceClientImpl()
+ ShillDeviceClientImpl()
: bus_(NULL) {
}
@@ -206,6 +208,54 @@ class ShillDeviceClientImpl : public ShillDeviceClient {
&method_call, callback, error_callback);
}
+ void AddWakeOnPacketConnection(
+ const dbus::ObjectPath& device_path,
+ const net::IPEndPoint& ip_endpoint,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {
+ if (ip_endpoint.address().empty()) {
+ LOG(ERROR) << "AddWakeOnPacketConnection: null address";
+ return;
+ }
+ dbus::MethodCall method_call(shill::kFlimflamDeviceInterface,
+ shill::kAddWakeOnPacketConnectionFunction);
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendString(net::IPAddressToString(ip_endpoint.address()));
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
+ }
+
+ void RemoveWakeOnPacketConnection(
+ const dbus::ObjectPath& device_path,
+ const net::IPEndPoint& ip_endpoint,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {
+ if (ip_endpoint.address().empty()) {
+ LOG(ERROR) << "RemoveWakeOnPacketConnection: null address";
+ return;
+ }
+ dbus::MethodCall method_call(shill::kFlimflamDeviceInterface,
+ shill::kRemoveWakeOnPacketConnectionFunction);
+ dbus::MessageWriter writer(&method_call);
+ writer.AppendString(net::IPAddressToString(ip_endpoint.address()));
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
+ }
+
+ void RemoveAllWakeOnPacketConnections(
+ const dbus::ObjectPath& device_path,
+ const base::Closure& callback,
+ const ErrorCallback& error_callback) override {
+ dbus::MethodCall method_call(
+ shill::kFlimflamDeviceInterface,
+ shill::kRemoveAllWakeOnPacketConnectionsFunction);
+ GetHelper(device_path)->CallVoidMethodWithErrorCallback(&method_call,
+ callback,
+ error_callback);
+ }
+
virtual TestInterface* GetTestInterface() override {
return NULL;
}

Powered by Google App Engine
This is Rietveld 408576698