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