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

Unified Diff: device/generic_sensor/public/cpp/sensor_shared_buffer_reader.h

Issue 2929603003: Add RELATIVE_ORIENTATION sensor implementation on macOS to //device/generic_sensor (Closed)
Patch Set: updated OnSensorError() Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/public/cpp/sensor_shared_buffer_reader.h
diff --git a/device/generic_sensor/public/cpp/sensor_shared_buffer_reader.h b/device/generic_sensor/public/cpp/sensor_shared_buffer_reader.h
new file mode 100644
index 0000000000000000000000000000000000000000..41499c8335c4afc4532d9c08a74c7e2d6fa19318
--- /dev/null
+++ b/device/generic_sensor/public/cpp/sensor_shared_buffer_reader.h
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_SHARED_BUFFER_READER_H_
+#define DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_SHARED_BUFFER_READER_H_
+
+#include "base/macros.h"
+#include "device/generic_sensor/public/cpp/generic_sensor_public_export.h"
+
+namespace device {
+
+struct SensorReading;
+struct SensorReadingSharedBuffer;
+
+class DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorSharedBufferReader {
Mikhail 2017/06/20 13:50:00 It's a good idea to export this functionality sinc
juncai 2017/06/20 19:50:55 Done.
+ public:
+ explicit SensorSharedBufferReader(const SensorReadingSharedBuffer* buffer);
+ ~SensorSharedBufferReader();
+
+ // Get sensor reading from shared buffer.
+ bool GetSensorReading(SensorReading* result);
+
+ private:
+ bool TryReadFromBuffer(SensorReading* result);
+
+ const SensorReadingSharedBuffer* buffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(SensorSharedBufferReader);
+};
+
+} // namespace device
+
+#endif // DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_SHARED_BUFFER_READER_H_

Powered by Google App Engine
This is Rietveld 408576698