From 8e7b4ff4742ed5f78fa57550af1fb4cfc5705372 Mon Sep 17 00:00:00 2001 From: skuhne Date: Thu, 18 Sep 2014 16:14:17 -0700 Subject: Revert of GCM: D-Bus methods for wake-on-packet (patchset #15 id:280001 of https://codereview.chromium.org/409883006/) Reason for revert: See issue https://code.google.com/p/chromium/issues/detail?id=415281 I bissected chrome to this patch and figured that this is causing chrome to crash. Sorry. Original issue's description: > GCM: D-Bus methods for wake-on-packet > > Program the NIC to wake-on-packet for packets arriving from > the GCM server. Chrome notifies the connection manager (shill) > by calling D-Bus methods. The return status indicates if the > operation succeeded or not (depending on hardware support and > the type of connection). > > Keywords: wowlan, wake-on-lan, wake-on-wlan > > BUG=360295 > TEST=verified dbus methods are called, and packets are sent on the > TEST=connection passed to the methods. Also verified that shill > TEST=programs the NIC correctly, and packets wake up the device. > > Committed: https://crrev.com/88a95a70fa94bb578b371490d0f9868584b7096e > Cr-Commit-Position: refs/heads/master@{#294936} TBR=derat@chromium.org,fgorski@chromium.org,stevenjb@chromium.org,zea@chromium.org,scheib@chromium.org,yoz@chromium.org,semenzato@chromium.org NOTREECHECKS=true NOTRY=true BUG=360295 Review URL: https://codereview.chromium.org/584753002 Cr-Commit-Position: refs/heads/master@{#295592} --- chromeos/dbus/fake_shill_manager_client.cc | 17 ------------ chromeos/dbus/fake_shill_manager_client.h | 16 ------------ chromeos/dbus/mock_shill_manager_client.h | 12 --------- chromeos/dbus/shill_manager_client.cc | 38 --------------------------- chromeos/dbus/shill_manager_client.h | 42 ++++++++---------------------- 5 files changed, 11 insertions(+), 114 deletions(-) (limited to 'chromeos') diff --git a/chromeos/dbus/fake_shill_manager_client.cc b/chromeos/dbus/fake_shill_manager_client.cc index f5ab9a59..25ad05d 100644 --- a/chromeos/dbus/fake_shill_manager_client.cc +++ b/chromeos/dbus/fake_shill_manager_client.cc @@ -355,23 +355,6 @@ void FakeShillManagerClient::ConnectToBestServices( dbus::ObjectPath(best_service_), callback, error_callback); } -void FakeShillManagerClient::AddWakeOnPacketConnection( - const net::IPEndPoint& ip_endpoint, - const base::Closure& callback, - const ErrorCallback& error_callback) { -} - -void FakeShillManagerClient::RemoveWakeOnPacketConnection( - const net::IPEndPoint& ip_endpoint, - const base::Closure& callback, - const ErrorCallback& error_callback) { -} - -void FakeShillManagerClient::RemoveAllWakeOnPacketConnections( - const base::Closure& callback, - const ErrorCallback& error_callback) { -} - ShillManagerClient::TestInterface* FakeShillManagerClient::GetTestInterface() { return this; } diff --git a/chromeos/dbus/fake_shill_manager_client.h b/chromeos/dbus/fake_shill_manager_client.h index 7f24ca2..34b10a5 100644 --- a/chromeos/dbus/fake_shill_manager_client.h +++ b/chromeos/dbus/fake_shill_manager_client.h @@ -12,10 +12,6 @@ #include "chromeos/chromeos_export.h" #include "chromeos/dbus/shill_manager_client.h" -namespace net { -class IPEndPoint; -} - namespace chromeos { // A fake implementation of ShillManagerClient. This works in close coordination @@ -81,18 +77,6 @@ class CHROMEOS_EXPORT FakeShillManagerClient virtual void ConnectToBestServices( const base::Closure& callback, const ErrorCallback& error_callback) OVERRIDE; - virtual void AddWakeOnPacketConnection( - const net::IPEndPoint& ip_connection, - const base::Closure& callback, - const ErrorCallback& error_callback) OVERRIDE; - virtual void RemoveWakeOnPacketConnection( - const net::IPEndPoint& ip_endpoint, - const base::Closure& callback, - const ErrorCallback& error_callback) OVERRIDE; - virtual void RemoveAllWakeOnPacketConnections( - const base::Closure& callback, - const ErrorCallback& error_callback) OVERRIDE; - virtual ShillManagerClient::TestInterface* GetTestInterface() OVERRIDE; // ShillManagerClient::TestInterface overrides. diff --git a/chromeos/dbus/mock_shill_manager_client.h b/chromeos/dbus/mock_shill_manager_client.h index 63c8c9c4..bf80b64 100644 --- a/chromeos/dbus/mock_shill_manager_client.h +++ b/chromeos/dbus/mock_shill_manager_client.h @@ -8,7 +8,6 @@ #include "base/values.h" #include "chromeos/dbus/shill_manager_client.h" #include "chromeos/dbus/shill_property_changed_observer.h" -#include "net/base/ip_endpoint.h" #include "testing/gmock/include/gmock/gmock.h" namespace chromeos { @@ -67,17 +66,6 @@ class MockShillManagerClient : public ShillManagerClient { MOCK_METHOD2(ConnectToBestServices, void(const base::Closure& callback, const ErrorCallback& error_callback)); - MOCK_METHOD3(AddWakeOnPacketConnection, - void(const net::IPEndPoint& ip_connection, - const base::Closure& callback, - const ErrorCallback& error_callback)); - MOCK_METHOD3(RemoveWakeOnPacketConnection, - void(const net::IPEndPoint& ip_connection, - const base::Closure& callback, - const ErrorCallback& error_callback)); - MOCK_METHOD2(RemoveAllWakeOnPacketConnections, - void(const base::Closure& callback, - const ErrorCallback& error_callback)); MOCK_METHOD0(GetTestInterface, TestInterface*()); }; diff --git a/chromeos/dbus/shill_manager_client.cc b/chromeos/dbus/shill_manager_client.cc index d4c0019..0ad602f 100644 --- a/chromeos/dbus/shill_manager_client.cc +++ b/chromeos/dbus/shill_manager_client.cc @@ -14,7 +14,6 @@ #include "dbus/object_path.h" #include "dbus/object_proxy.h" #include "dbus/values_util.h" -#include "net/base/ip_endpoint.h" #include "third_party/cros_system_api/dbus/service_constants.h" namespace chromeos { @@ -211,43 +210,6 @@ class ShillManagerClientImpl : public ShillManagerClient { error_callback); } - virtual void AddWakeOnPacketConnection( - const net::IPEndPoint& ip_endpoint, - const base::Closure& callback, - const ErrorCallback& error_callback) OVERRIDE { - dbus::MethodCall method_call(shill::kFlimflamManagerInterface, - shill::kAddWakeOnPacketConnectionFunction); - dbus::MessageWriter writer(&method_call); - writer.AppendString(net::IPAddressToString(ip_endpoint.address())); - helper_->CallVoidMethodWithErrorCallback(&method_call, - callback, - error_callback); - } - - virtual void RemoveWakeOnPacketConnection( - const net::IPEndPoint& ip_endpoint, - const base::Closure& callback, - const ErrorCallback& error_callback) OVERRIDE { - dbus::MethodCall method_call(shill::kFlimflamManagerInterface, - shill::kRemoveWakeOnPacketConnectionFunction); - dbus::MessageWriter writer(&method_call); - writer.AppendString(net::IPAddressToString(ip_endpoint.address())); - helper_->CallVoidMethodWithErrorCallback(&method_call, - callback, - error_callback); - } - - virtual void RemoveAllWakeOnPacketConnections( - const base::Closure& callback, - const ErrorCallback& error_callback) OVERRIDE { - dbus::MethodCall method_call( - shill::kFlimflamManagerInterface, - shill::kRemoveAllWakeOnPacketConnectionsFunction); - helper_->CallVoidMethodWithErrorCallback(&method_call, - callback, - error_callback); - } - virtual TestInterface* GetTestInterface() OVERRIDE { return NULL; } diff --git a/chromeos/dbus/shill_manager_client.h b/chromeos/dbus/shill_manager_client.h index 8bc7251..9b9541d 100644 --- a/chromeos/dbus/shill_manager_client.h +++ b/chromeos/dbus/shill_manager_client.h @@ -14,12 +14,10 @@ #include "chromeos/dbus/shill_client_helper.h" namespace dbus { + class ObjectPath; -} -namespace net { -class IPEndPoint; -} +} // namespace dbus namespace chromeos { @@ -195,53 +193,35 @@ class CHROMEOS_EXPORT ShillManagerClient : public DBusClient { const ObjectPathCallback& callback, const ErrorCallback& error_callback) = 0; - // Verifies that the given data corresponds to a trusted device, and returns - // true to the callback if it is. + // Verify that the given data corresponds to a trusted device, and return true + // to the callback if it is. virtual void VerifyDestination(const VerificationProperties& properties, const BooleanCallback& callback, const ErrorCallback& error_callback) = 0; - // Verifies that the given data corresponds to a trusted device, and if it is, - // returns the encrypted credentials for connecting to the network represented + // Verify that the given data corresponds to a trusted device, and if it is, + // return the encrypted credentials for connecting to the network represented // by the given |service_path|, encrypted using the |public_key| for the - // trusted device. If the device is not trusted, returns the empty string. + // trusted device. If the device is not trusted, return the empty string. virtual void VerifyAndEncryptCredentials( const VerificationProperties& properties, const std::string& service_path, const StringCallback& callback, const ErrorCallback& error_callback) = 0; - // Verifies that the given data corresponds to a trusted device, and returns - // the |data| encrypted using the |public_key| for the trusted device. If the - // device is not trusted, returns the empty string. + // Verify that the given data corresponds to a trusted device, and return the + // |data| encrypted using the |public_key| for the trusted device. If the + // device is not trusted, return the empty string. virtual void VerifyAndEncryptData(const VerificationProperties& properties, const std::string& data, const StringCallback& callback, const ErrorCallback& error_callback) = 0; - // For each technology present, connects to the "best" service available. + // For each technology present, connect to the "best" service available. // Called once the user is logged in and certificates are loaded. virtual void ConnectToBestServices(const base::Closure& callback, const ErrorCallback& error_callback) = 0; - // Requests that shill program the NIC so that packets incoming on - // |ip_connection| wake up the CPU. - virtual void AddWakeOnPacketConnection( - const net::IPEndPoint& ip_endpoint, - const base::Closure& callback, - const ErrorCallback& error_callback) = 0; - - // Removes a request to wake up on packets coming on |ip_connection|. - virtual void RemoveWakeOnPacketConnection( - const net::IPEndPoint& ip_endpoint, - const base::Closure& callback, - const ErrorCallback& error_callback) = 0; - - // Clears all requests to wake up on packets. - virtual void RemoveAllWakeOnPacketConnections( - const base::Closure& callback, - const ErrorCallback& error_callback) = 0; - // Returns an interface for testing (stub only), or returns NULL. virtual TestInterface* GetTestInterface() = 0; -- cgit v1.1