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

Unified Diff: device/generic_sensor/platform_sensor_provider_linux.cc

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 side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/platform_sensor_provider_linux.cc
diff --git a/device/generic_sensor/platform_sensor_provider_linux.cc b/device/generic_sensor/platform_sensor_provider_linux.cc
index 736c82ff55ab9dbfbf79dc45af2c28867d78915f..7049b615538b801ab74d12b534d606a19b7c8103 100644
--- a/device/generic_sensor/platform_sensor_provider_linux.cc
+++ b/device/generic_sensor/platform_sensor_provider_linux.cc
@@ -5,9 +5,11 @@
#include "device/generic_sensor/platform_sensor_provider_linux.h"
#include "base/memory/singleton.h"
+#include "base/task_runner_util.h"
#include "base/threading/thread.h"
#include "device/generic_sensor/linux/sensor_data_linux.h"
#include "device/generic_sensor/platform_sensor_linux.h"
+#include "device/generic_sensor/platform_sensor_reader_linux.h"
namespace device {
@@ -59,8 +61,9 @@ void PlatformSensorProviderLinux::SensorDeviceFound(
mojom::SensorType type,
mojo::ScopedSharedBufferMapping mapping,
const PlatformSensorProviderBase::CreateSensorCallback& callback,
- SensorInfoLinux* sensor_device) {
+ const SensorInfoLinux* sensor_device) {
DCHECK(CalledOnValidThread());
+ DCHECK(sensor_device);
if (!StartPollingThread()) {
callback.Run(nullptr);
« no previous file with comments | « device/generic_sensor/platform_sensor_provider_linux.h ('k') | device/generic_sensor/platform_sensor_reader_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698