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

Unified Diff: services/device/device_service.cc

Issue 2698083007: Port device_generic_sensor to be hosted in Device Service. (Closed)
Patch Set: code rebase Created 3 years, 9 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/device/manifest.json » ('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..6510d98bbab952c5ef8736f837929a59a93cf2db 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -14,6 +14,7 @@
#include "device/battery/battery_monitor.mojom.h"
#include "device/battery/battery_monitor_impl.h"
#include "device/battery/battery_status_service.h"
+#include "device/generic_sensor/sensor_provider_impl.h"
#include "device/sensors/device_sensor_host.h"
#include "device/wake_lock/wake_lock_context_provider.h"
#include "mojo/public/cpp/system/message_pipe.h"
@@ -94,6 +95,7 @@ bool DeviceService::OnConnect(const service_manager::ServiceInfo& remote_info,
registry->AddInterface<mojom::OrientationAbsoluteSensor>(this);
registry->AddInterface<mojom::PowerMonitor>(this);
registry->AddInterface<mojom::ScreenOrientationListener>(this);
+ registry->AddInterface<mojom::SensorProvider>(this);
blundell 2017/03/27 14:56:52 We should preserve the check about the feature bei
ke.he 2017/03/28 05:41:11 The check code is: "if (base::FeatureList::IsEnabl
blundell 2017/03/28 07:03:52 Ah, great point! You are correct that a dep from /
registry->AddInterface<mojom::TimeZoneMonitor>(this);
registry->AddInterface<mojom::WakeLockContextProvider>(this);
@@ -215,6 +217,15 @@ void DeviceService::Create(const service_manager::Identity& remote_identity,
}
void DeviceService::Create(const service_manager::Identity& remote_identity,
+ mojom::SensorProviderRequest request) {
+ if (io_task_runner_) {
+ io_task_runner_->PostTask(
+ FROM_HERE, base::Bind(&device::SensorProviderImpl::Create,
+ file_task_runner_, base::Passed(&request)));
+ }
+}
+
+void DeviceService::Create(const service_manager::Identity& remote_identity,
mojom::TimeZoneMonitorRequest request) {
if (!time_zone_monitor_)
time_zone_monitor_ = TimeZoneMonitor::Create(file_task_runner_);
« no previous file with comments | « services/device/device_service.h ('k') | services/device/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698