Remove D-Bus dependency from Manager
Here are the main changes:
1. Cleanup Manager::CreateService and Manager::RemoveService API
to remove D-Bus dependency.
1. Use refptr for Service since it will be maintained by both
Manager and its adaptor.
2. Move the monitoring of the service creator/owner to the adaptor,
since the DBusServiceWatcher is D-Bus specific.
Bug: 24194427
TEST=Start AP service on Brillo board, stop weaved, verify service
is destroyed and removed from apmanager.
TEST=Verify device setup works on Brillo board.
TEST=Verify apmanager does not crash on restart.
TEST=Run unittests on both Brillo and Chrome OS.
Change-Id: I33fd4eec2c1adf12830484ca087bd9dd56767288
diff --git a/mock_manager.h b/mock_manager.h
index d67d87e..f8b54b7 100644
--- a/mock_manager.h
+++ b/mock_manager.h
@@ -33,7 +33,7 @@
MOCK_METHOD0(Start, void());
MOCK_METHOD0(Stop, void());
- MOCK_METHOD1(RegisterDevice, void(scoped_refptr<Device> device));
+ MOCK_METHOD1(RegisterDevice, void(const scoped_refptr<Device>& device));
MOCK_METHOD0(GetAvailableDevice, scoped_refptr<Device>());
MOCK_METHOD1(GetDeviceFromInterfaceName,
scoped_refptr<Device>(const std::string& interface_name));