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

Unified Diff: services/device/device_service.cc

Issue 2885203004: Refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors (Closed)
Patch Set: updated content/renderer/BUILD.gn Created 3 years, 7 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.cc
diff --git a/services/device/device_service.cc b/services/device/device_service.cc
index f43c3ca2eac6702aff1b69b40ba442a305fe5c99..562b7e0e1632d1911b0905c6e77d811b4662fb57 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -13,7 +13,6 @@
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "device/generic_sensor/sensor_provider_impl.h"
-#include "device/sensors/device_sensor_host.h"
#include "device/wake_lock/wake_lock_provider.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "services/device/fingerprint/fingerprint.h"
@@ -91,13 +90,6 @@ DeviceService::~DeviceService() {
void DeviceService::OnStart() {
registry_.AddInterface<mojom::Fingerprint>(base::Bind(
&DeviceService::BindFingerprintRequest, base::Unretained(this)));
- registry_.AddInterface<mojom::MotionSensor>(base::Bind(
- &DeviceService::BindMotionSensorRequest, base::Unretained(this)));
- registry_.AddInterface<mojom::OrientationSensor>(base::Bind(
- &DeviceService::BindOrientationSensorRequest, base::Unretained(this)));
- registry_.AddInterface<mojom::OrientationAbsoluteSensor>(
- base::Bind(&DeviceService::BindOrientationAbsoluteSensorRequest,
- base::Unretained(this)));
registry_.AddInterface<mojom::PowerMonitor>(base::Bind(
&DeviceService::BindPowerMonitorRequest, base::Unretained(this)));
registry_.AddInterface<mojom::ScreenOrientationListener>(
@@ -166,59 +158,6 @@ void DeviceService::BindFingerprintRequest(
Fingerprint::Create(std::move(request));
}
-void DeviceService::BindMotionSensorRequest(
- const service_manager::BindSourceInfo& source_info,
- mojom::MotionSensorRequest request) {
-#if defined(OS_ANDROID)
- // On Android the device sensors implementations need to run on the UI thread
- // to communicate to Java.
- DeviceMotionHost::Create(std::move(request));
-#else
- // On platforms other than Android the device sensors implementations run on
- // the IO thread.
- if (io_task_runner_) {
- io_task_runner_->PostTask(FROM_HERE, base::Bind(&DeviceMotionHost::Create,
- base::Passed(&request)));
- }
-#endif // defined(OS_ANDROID)
-}
-
-void DeviceService::BindOrientationSensorRequest(
- const service_manager::BindSourceInfo& source_info,
- mojom::OrientationSensorRequest request) {
-#if defined(OS_ANDROID)
- // On Android the device sensors implementations need to run on the UI thread
- // to communicate to Java.
- DeviceOrientationHost::Create(std::move(request));
-#else
- // On platforms other than Android the device sensors implementations run on
- // the IO thread.
- if (io_task_runner_) {
- io_task_runner_->PostTask(
- FROM_HERE,
- base::Bind(&DeviceOrientationHost::Create, base::Passed(&request)));
- }
-#endif // defined(OS_ANDROID)
-}
-
-void DeviceService::BindOrientationAbsoluteSensorRequest(
- const service_manager::BindSourceInfo& source_info,
- mojom::OrientationAbsoluteSensorRequest request) {
-#if defined(OS_ANDROID)
- // On Android the device sensors implementations need to run on the UI thread
- // to communicate to Java.
- DeviceOrientationAbsoluteHost::Create(std::move(request));
-#else
- // On platforms other than Android the device sensors implementations run on
- // the IO thread.
- if (io_task_runner_) {
- io_task_runner_->PostTask(FROM_HERE,
- base::Bind(&DeviceOrientationAbsoluteHost::Create,
- base::Passed(&request)));
- }
-#endif // defined(OS_ANDROID)
-}
-
void DeviceService::BindPowerMonitorRequest(
const service_manager::BindSourceInfo& source_info,
mojom::PowerMonitorRequest request) {

Powered by Google App Engine
This is Rietveld 408576698