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

Unified Diff: services/device/device_service.cc

Issue 2795883002: Eliminate OnConnect usage (Closed)
Patch Set: . Created 3 years, 8 months 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
« no previous file with comments | « services/device/device_service.h ('k') | services/file/file_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/device/device_service.cc
diff --git a/services/device/device_service.cc b/services/device/device_service.cc
index a0aae54d745cd30b2806cbdb39077f33085415c2..7cb98e0d828528421dfe34d0ee4d52133d0d59b1 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -83,32 +83,35 @@ DeviceService::~DeviceService() {
#endif
}
-void DeviceService::OnStart() {}
-
-bool DeviceService::OnConnect(const service_manager::ServiceInfo& remote_info,
- service_manager::InterfaceRegistry* registry) {
- registry->AddInterface<mojom::Fingerprint>(this);
- registry->AddInterface<mojom::LightSensor>(this);
- registry->AddInterface<mojom::MotionSensor>(this);
- registry->AddInterface<mojom::OrientationSensor>(this);
- registry->AddInterface<mojom::OrientationAbsoluteSensor>(this);
- registry->AddInterface<mojom::PowerMonitor>(this);
- registry->AddInterface<mojom::ScreenOrientationListener>(this);
- registry->AddInterface<mojom::TimeZoneMonitor>(this);
- registry->AddInterface<mojom::WakeLockContextProvider>(this);
+void DeviceService::OnStart() {
+ registry_.AddInterface<mojom::Fingerprint>(this);
+ registry_.AddInterface<mojom::LightSensor>(this);
+ registry_.AddInterface<mojom::MotionSensor>(this);
+ registry_.AddInterface<mojom::OrientationSensor>(this);
+ registry_.AddInterface<mojom::OrientationAbsoluteSensor>(this);
+ registry_.AddInterface<mojom::PowerMonitor>(this);
+ registry_.AddInterface<mojom::ScreenOrientationListener>(this);
+ registry_.AddInterface<mojom::TimeZoneMonitor>(this);
+ registry_.AddInterface<mojom::WakeLockContextProvider>(this);
#if defined(OS_ANDROID)
- registry->AddInterface(
+ registry_.AddInterface(
GetJavaInterfaceProvider()->CreateInterfaceFactory<BatteryMonitor>());
- registry->AddInterface(
+ registry_.AddInterface(
GetJavaInterfaceProvider()
->CreateInterfaceFactory<mojom::VibrationManager>());
#else
- registry->AddInterface<BatteryMonitor>(this);
- registry->AddInterface<mojom::VibrationManager>(this);
+ registry_.AddInterface<BatteryMonitor>(this);
+ registry_.AddInterface<mojom::VibrationManager>(this);
#endif
+}
- return true;
+void DeviceService::OnBindInterface(
+ const service_manager::ServiceInfo& source_info,
+ const std::string& interface_name,
+ mojo::ScopedMessagePipeHandle interface_pipe) {
+ registry_.BindInterface(source_info.identity, interface_name,
+ std::move(interface_pipe));
}
#if !defined(OS_ANDROID)
« no previous file with comments | « services/device/device_service.h ('k') | services/file/file_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698