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

Unified Diff: third_party/WebKit/Source/modules/sensor/SensorReading.h

Issue 2051083002: WIP : Generic Sensor API implementation Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 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: third_party/WebKit/Source/modules/sensor/SensorReading.h
diff --git a/third_party/WebKit/Source/modules/sensor/SensorReading.h b/third_party/WebKit/Source/modules/sensor/SensorReading.h
index 0796dfcdec4fa16b9fd6823083690ba18e726e0b..81d1c274fb942ff54eb6cbce965e4958359548eb 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorReading.h
+++ b/third_party/WebKit/Source/modules/sensor/SensorReading.h
@@ -9,37 +9,31 @@
#include "core/dom/DOMHighResTimeStamp.h"
#include "core/dom/DOMTimeStamp.h"
#include "modules/ModulesExport.h"
+#include "modules/sensor/SensorController.h"
namespace blink {
-class MODULES_EXPORT SensorReading : public GarbageCollectedFinalized<SensorReading>, public ScriptWrappable {
+class MODULES_EXPORT SensorReading : public GarbageCollected<SensorReading>,
+ public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
-
public:
- static SensorReading* create()
- {
- return new SensorReading;
- }
-
- static SensorReading* create(bool providesTimeStamp, DOMHighResTimeStamp timestamp)
- {
- return new SensorReading(providesTimeStamp, timestamp);
- }
-
- virtual ~SensorReading();
-
- DOMHighResTimeStamp timeStamp(bool& isNull);
+ DECLARE_VIRTUAL_TRACE();
- void setTimeStamp(DOMHighResTimeStamp time) { m_timeStamp = time; }
+ virtual DOMHighResTimeStamp timeStamp() const = 0;
- DECLARE_VIRTUAL_TRACE();
+ enum UpdateStatus {
+ Updated,
+ Error,
+ Same
+ };
+ virtual UpdateStatus updateInternalData() = 0;
protected:
- bool m_canProvideTimeStamp;
- DOMHighResTimeStamp m_timeStamp;
+ SensorReading() = default;
+ explicit SensorReading(SensorController* controller);
- SensorReading();
- SensorReading(bool providesTimeStamp, DOMHighResTimeStamp timestamp);
+protected:
+ WeakMember<SensorController> m_controller;
};
} // namepsace blink

Powered by Google App Engine
This is Rietveld 408576698