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/sensor_provider_impl.h" | 5 #include "services/device/generic_sensor/sensor_provider_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "device/generic_sensor/platform_sensor_provider.h" | |
12 #include "device/generic_sensor/sensor_impl.h" | |
13 #include "mojo/public/cpp/bindings/strong_binding.h" | 11 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 12 #include "services/device/generic_sensor/platform_sensor_provider.h" |
| 13 #include "services/device/generic_sensor/sensor_impl.h" |
14 | 14 |
15 namespace device { | 15 namespace device { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 void RunCallback(mojom::SensorInitParamsPtr init_params, | 19 void RunCallback(mojom::SensorInitParamsPtr init_params, |
20 mojom::SensorClientRequest client, | 20 mojom::SensorClientRequest client, |
21 const SensorProviderImpl::GetSensorCallback& callback) { | 21 const SensorProviderImpl::GetSensorCallback& callback) { |
22 callback.Run(std::move(init_params), std::move(client)); | 22 callback.Run(std::move(init_params), std::move(client)); |
23 } | 23 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 init_params->minimum_frequency = sensor->GetMinimumSupportedFrequency(); | 103 init_params->minimum_frequency = sensor->GetMinimumSupportedFrequency(); |
104 DCHECK_GT(init_params->minimum_frequency, 0.0); | 104 DCHECK_GT(init_params->minimum_frequency, 0.0); |
105 | 105 |
106 NotifySensorCreated(std::move(init_params), sensor_impl->GetClient(), | 106 NotifySensorCreated(std::move(init_params), sensor_impl->GetClient(), |
107 callback); | 107 callback); |
108 | 108 |
109 mojo::MakeStrongBinding(std::move(sensor_impl), std::move(sensor_request)); | 109 mojo::MakeStrongBinding(std::move(sensor_impl), std::move(sensor_request)); |
110 } | 110 } |
111 | 111 |
112 } // namespace device | 112 } // namespace device |
OLD | NEW |