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

Unified Diff: services/device/device_service.h

Issue 2692993006: Port device_sensors to be hosted in Device Service (Closed)
Patch Set: code rebase Created 3 years, 10 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
Index: services/device/device_service.h
diff --git a/services/device/device_service.h b/services/device/device_service.h
index a8ef507036bcb02d5831b870443bdaab5923218e..4ee1227fa17c82ce9ef7e00bfd5f57be13c80e0a 100644
--- a/services/device/device_service.h
+++ b/services/device/device_service.h
@@ -6,6 +6,9 @@
#define SERVICES_DEVICE_DEVICE_SERVICE_H_
#include "base/memory/ref_counted.h"
+#include "device/sensors/public/interfaces/light.mojom.h"
+#include "device/sensors/public/interfaces/motion.mojom.h"
+#include "device/sensors/public/interfaces/orientation.mojom.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "services/device/public/interfaces/power_monitor.mojom.h"
#include "services/device/public/interfaces/time_zone_monitor.mojom.h"
@@ -17,14 +20,21 @@ namespace device {
class TimeZoneMonitor;
std::unique_ptr<service_manager::Service> CreateDeviceService(
- scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
+ scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
class DeviceService
: public service_manager::Service,
+ public service_manager::InterfaceFactory<mojom::LightSensor>,
+ public service_manager::InterfaceFactory<mojom::MotionSensor>,
+ public service_manager::InterfaceFactory<mojom::OrientationSensor>,
+ public service_manager::InterfaceFactory<
+ mojom::OrientationAbsoluteSensor>,
public service_manager::InterfaceFactory<mojom::PowerMonitor>,
public service_manager::InterfaceFactory<mojom::TimeZoneMonitor> {
public:
- DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner);
+ DeviceService(scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
~DeviceService() override;
private:
@@ -33,6 +43,22 @@ class DeviceService
bool OnConnect(const service_manager::ServiceInfo& remote_info,
service_manager::InterfaceRegistry* registry) override;
+ // InterfaceFactory<mojom::LightSensor>:
+ void Create(const service_manager::Identity& remote_identity,
+ mojom::LightSensorRequest request) override;
+
+ // InterfaceFactory<mojom::MotionSensor>:
+ void Create(const service_manager::Identity& remote_identity,
+ mojom::MotionSensorRequest request) override;
+
+ // InterfaceFactory<mojom::OrientationSensor>:
+ void Create(const service_manager::Identity& remote_identity,
+ mojom::OrientationSensorRequest request) override;
+
+ // InterfaceFactory<mojom::OrientationAbsolueSensor>:
+ void Create(const service_manager::Identity& remote_identity,
+ mojom::OrientationAbsoluteSensorRequest request) override;
+
// InterfaceFactory<mojom::PowerMonitor>:
void Create(const service_manager::Identity& remote_identity,
mojom::PowerMonitorRequest request) override;
@@ -44,6 +70,7 @@ class DeviceService
std::unique_ptr<device::TimeZoneMonitor> time_zone_monitor_;
scoped_refptr<base::SingleThreadTaskRunner> file_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
DISALLOW_COPY_AND_ASSIGN(DeviceService);
};

Powered by Google App Engine
This is Rietveld 408576698