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_provider_win.h" | 5 #include "services/device/generic_sensor/platform_sensor_provider_win.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
11 #include "device/generic_sensor/platform_sensor_win.h" | 11 #include "services/device/generic_sensor/platform_sensor_win.h" |
12 | 12 |
13 namespace device { | 13 namespace device { |
14 | 14 |
15 // static | 15 // static |
16 PlatformSensorProviderWin* PlatformSensorProviderWin::GetInstance() { | 16 PlatformSensorProviderWin* PlatformSensorProviderWin::GetInstance() { |
17 return base::Singleton< | 17 return base::Singleton< |
18 PlatformSensorProviderWin, | 18 PlatformSensorProviderWin, |
19 base::LeakySingletonTraits<PlatformSensorProviderWin>>::get(); | 19 base::LeakySingletonTraits<PlatformSensorProviderWin>>::get(); |
20 } | 20 } |
21 | 21 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 std::unique_ptr<PlatformSensorReaderWin> | 98 std::unique_ptr<PlatformSensorReaderWin> |
99 PlatformSensorProviderWin::CreateSensorReader(mojom::SensorType type) { | 99 PlatformSensorProviderWin::CreateSensorReader(mojom::SensorType type) { |
100 DCHECK(sensor_thread_->task_runner()->BelongsToCurrentThread()); | 100 DCHECK(sensor_thread_->task_runner()->BelongsToCurrentThread()); |
101 if (!InitializeSensorManager()) | 101 if (!InitializeSensorManager()) |
102 return nullptr; | 102 return nullptr; |
103 return PlatformSensorReaderWin::Create(type, sensor_manager_); | 103 return PlatformSensorReaderWin::Create(type, sensor_manager_); |
104 } | 104 } |
105 | 105 |
106 } // namespace device | 106 } // namespace device |
OLD | NEW |