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

Side by Side Diff: device/generic_sensor/sensor_provider_impl.h

Issue 2865263002: Move //device/generic_sensor to be part of the internal implementation of the Device Service. (Closed)
Patch Set: code rebase 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 unified diff | Download patch
« no previous file with comments | « device/generic_sensor/sensor_impl.cc ('k') | device/generic_sensor/sensor_provider_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_
6 #define DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_
7
8 #include "base/macros.h"
9 #include "base/single_thread_task_runner.h"
10 #include "device/generic_sensor/generic_sensor_export.h"
11 #include "device/generic_sensor/public/interfaces/sensor_provider.mojom.h"
12
13 namespace device {
14
15 class PlatformSensorProvider;
16 class PlatformSensor;
17
18 // Implementation of SensorProvider mojo interface.
19 // Uses PlatformSensorProvider singleton to create platform specific instances
20 // of PlatformSensor which are used by SensorImpl.
21 class DEVICE_GENERIC_SENSOR_EXPORT SensorProviderImpl final
22 : public mojom::SensorProvider {
23 public:
24 static void Create(
25 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner,
26 mojom::SensorProviderRequest request);
27
28 ~SensorProviderImpl() override;
29
30 private:
31 explicit SensorProviderImpl(PlatformSensorProvider* provider);
32
33 // SensorProvider implementation.
34 void GetSensor(mojom::SensorType type,
35 mojom::SensorRequest sensor_request,
36 const GetSensorCallback& callback) override;
37
38 // Helper callback method to return created sensors.
39 void SensorCreated(mojom::SensorType type,
40 mojo::ScopedSharedBufferHandle cloned_handle,
41 mojom::SensorRequest sensor_request,
42 const GetSensorCallback& callback,
43 scoped_refptr<PlatformSensor> sensor);
44
45 PlatformSensorProvider* provider_;
46 base::WeakPtrFactory<SensorProviderImpl> weak_ptr_factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(SensorProviderImpl);
49 };
50
51 } // namespace device
52
53 #endif // DEVICE_GENERIC_SENSOR_SENSOR_PROVIDER_IMPL_H_
OLDNEW
« no previous file with comments | « device/generic_sensor/sensor_impl.cc ('k') | device/generic_sensor/sensor_provider_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698