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

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

Issue 2569763004: [sensors](Linux) Fix tsan data race in sensor reader (Closed)
Patch Set: rebased Created 4 years 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 | « build/sanitizers/tsan_suppressions.cc ('k') | device/generic_sensor/platform_sensor_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_LINUX_H_ 5 #ifndef DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_
6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_ 6 #define DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_
7 7
8 #include "device/generic_sensor/platform_sensor.h" 8 #include "device/generic_sensor/platform_sensor.h"
9 9
10 namespace base { 10 namespace base {
(...skipping 27 matching lines...) Expand all
38 bool StartSensor(const PlatformSensorConfiguration& configuration) override; 38 bool StartSensor(const PlatformSensorConfiguration& configuration) override;
39 void StopSensor() override; 39 void StopSensor() override;
40 bool CheckSensorConfiguration( 40 bool CheckSensorConfiguration(
41 const PlatformSensorConfiguration& configuration) override; 41 const PlatformSensorConfiguration& configuration) override;
42 PlatformSensorConfiguration GetDefaultConfiguration() override; 42 PlatformSensorConfiguration GetDefaultConfiguration() override;
43 43
44 private: 44 private:
45 const PlatformSensorConfiguration default_configuration_; 45 const PlatformSensorConfiguration default_configuration_;
46 const mojom::ReportingMode reporting_mode_; 46 const mojom::ReportingMode reporting_mode_;
47 47
48 scoped_refptr<base::SingleThreadTaskRunner> polling_thread_task_runner_;
49
48 // A sensor reader that reads values from sensor files 50 // A sensor reader that reads values from sensor files
49 // and stores them to a SensorReading structure. 51 // and stores them to a SensorReading structure.
50 std::unique_ptr<SensorReader> sensor_reader_; 52 std::unique_ptr<SensorReader> sensor_reader_;
51 53
52 // Stores previously read values that are used to 54 // Stores previously read values that are used to
53 // determine whether the recent values are changed 55 // determine whether the recent values are changed
54 // and IPC can be notified that updates are available. 56 // and IPC can be notified that updates are available.
55 SensorReading old_values_; 57 SensorReading old_values_;
56 58
57 base::WeakPtrFactory<PlatformSensorLinux> weak_factory_; 59 base::WeakPtrFactory<PlatformSensorLinux> weak_factory_;
58 60
59 DISALLOW_COPY_AND_ASSIGN(PlatformSensorLinux); 61 DISALLOW_COPY_AND_ASSIGN(PlatformSensorLinux);
60 }; 62 };
61 63
62 } // namespace device 64 } // namespace device
63 65
64 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_ 66 #endif // DEVICE_GENERIC_SENSOR_PLATFORM_SENSOR_LINUX_H_
OLDNEW
« no previous file with comments | « build/sanitizers/tsan_suppressions.cc ('k') | device/generic_sensor/platform_sensor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698