| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "device/generic_sensor/platform_sensor.h" | 5 #include "services/device/generic_sensor/platform_sensor.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "device/generic_sensor/platform_sensor_provider.h" | 10 #include "services/device/generic_sensor/platform_sensor_provider.h" |
| 11 #include "device/generic_sensor/public/cpp/platform_sensor_configuration.h" | 11 #include "services/device/public/cpp/generic_sensor/platform_sensor_configuratio
n.h" |
| 12 | 12 |
| 13 namespace device { | 13 namespace device { |
| 14 | 14 |
| 15 PlatformSensor::PlatformSensor(mojom::SensorType type, | 15 PlatformSensor::PlatformSensor(mojom::SensorType type, |
| 16 mojo::ScopedSharedBufferMapping mapping, | 16 mojo::ScopedSharedBufferMapping mapping, |
| 17 PlatformSensorProvider* provider) | 17 PlatformSensorProvider* provider) |
| 18 : task_runner_(base::ThreadTaskRunnerHandle::Get()), | 18 : task_runner_(base::ThreadTaskRunnerHandle::Get()), |
| 19 shared_buffer_mapping_(std::move(mapping)), | 19 shared_buffer_mapping_(std::move(mapping)), |
| 20 type_(type), | 20 type_(type), |
| 21 provider_(provider), | 21 provider_(provider), |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 if (!optimal_configuration) { | 134 if (!optimal_configuration) { |
| 135 StopSensor(); | 135 StopSensor(); |
| 136 return true; | 136 return true; |
| 137 } | 137 } |
| 138 | 138 |
| 139 return StartSensor(*optimal_configuration); | 139 return StartSensor(*optimal_configuration); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } // namespace device | 142 } // namespace device |
| OLD | NEW |