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

Unified Diff: device/generic_sensor/platform_sensor_provider_linux.h

Issue 2569763004: [sensors](Linux) Fix tsan data race in sensor reader (Closed)
Patch Set: modify code comments 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 side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/platform_sensor_provider_linux.h
diff --git a/device/generic_sensor/platform_sensor_provider_linux.h b/device/generic_sensor/platform_sensor_provider_linux.h
index 7e15590c40487f14d154e636796475678eefb46f..071adb355119155c08a7be85dbf262c2b7a9ea7d 100644
--- a/device/generic_sensor/platform_sensor_provider_linux.h
+++ b/device/generic_sensor/platform_sensor_provider_linux.h
@@ -17,6 +17,7 @@ class Thread;
namespace device {
+class SensorReader;
struct SensorInfoLinux;
class DEVICE_GENERIC_SENSOR_EXPORT PlatformSensorProviderLinux
@@ -53,11 +54,14 @@ class DEVICE_GENERIC_SENSOR_EXPORT PlatformSensorProviderLinux
PlatformSensorProviderLinux();
- void SensorDeviceFound(
+ // Creates a platform sensor using a sensor reader created on a different
+ // thread.
Reilly Grant (use Gerrit) 2016/12/14 18:56:08 *created on |polling_thread_|.
maksims (do not use this acc) 2016/12/16 08:39:22 comment removed
+ void SensorReaderCreated(
mojom::SensorType type,
mojo::ScopedSharedBufferMapping mapping,
const PlatformSensorProviderBase::CreateSensorCallback& callback,
- SensorInfoLinux* sensor_device);
+ SensorInfoLinux* const sensor_device,
Reilly Grant (use Gerrit) 2016/12/14 18:56:08 You mean const SensorInfoLinux*.
maksims (do not use this acc) 2016/12/16 08:39:22 Done.
+ std::unique_ptr<SensorReader> sensor_reader);
bool StartPollingThread();
@@ -80,10 +84,6 @@ class DEVICE_GENERIC_SENSOR_EXPORT PlatformSensorProviderLinux
// Processed stored requests in |request_map_|.
void ProcessStoredRequests();
- // Called when sensors are created asynchronously after enumeration is done.
- void CreateSensorAndNotify(mojom::SensorType type,
- SensorInfoLinux* sensor_device);
-
// SensorDeviceManager::Delegate implements:
void OnSensorNodesEnumerated() override;
void OnDeviceAdded(mojom::SensorType type,

Powered by Google App Engine
This is Rietveld 408576698