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

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

Issue 2306333002: [sensors] Add Generic Sensor platform unit tests. (Closed)
Patch Set: Tim's comments Created 4 years, 2 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
OLDNEW
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 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_
6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 const PlatformSensorConfiguration& configuration) = 0; 62 const PlatformSensorConfiguration& configuration) = 0;
63 virtual void StopSensor() = 0; 63 virtual void StopSensor() = 0;
64 virtual bool CheckSensorConfiguration( 64 virtual bool CheckSensorConfiguration(
65 const PlatformSensorConfiguration& configuration) = 0; 65 const PlatformSensorConfiguration& configuration) = 0;
66 66
67 void NotifySensorReadingChanged(); 67 void NotifySensorReadingChanged();
68 void NotifySensorError(); 68 void NotifySensorError();
69 69
70 mojo::ScopedSharedBufferMapping shared_buffer_mapping_; 70 mojo::ScopedSharedBufferMapping shared_buffer_mapping_;
71 71
72 // For testing purposes.
73 const ConfigMap& config_map() const { return config_map_; }
74
72 private: 75 private:
73 friend class base::RefCountedThreadSafe<PlatformSensor>; 76 friend class base::RefCountedThreadSafe<PlatformSensor>;
74 77
75 mojom::SensorType type_; 78 mojom::SensorType type_;
76 base::ObserverList<Client, true> clients_; 79 base::ObserverList<Client, true> clients_;
77 ConfigMap config_map_; 80 ConfigMap config_map_;
78 PlatformSensorProvider* provider_; 81 PlatformSensorProvider* provider_;
79 base::WeakPtrFactory<PlatformSensor> weak_factory_; 82 base::WeakPtrFactory<PlatformSensor> weak_factory_;
80 DISALLOW_COPY_AND_ASSIGN(PlatformSensor); 83 DISALLOW_COPY_AND_ASSIGN(PlatformSensor);
81 }; 84 };
82 85
83 } // namespace device 86 } // namespace device
84 87
85 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_ 88 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_H_
OLDNEW
« no previous file with comments | « device/generic_sensor/fake_platform_sensor_provider.cc ('k') | device/generic_sensor/platform_sensor_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698