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..2eaf7e6a177db48e75962b885ee31ae8b643de3d 100644 |
--- a/third_party/WebKit/Source/modules/sensor/SensorReading.h |
+++ b/third_party/WebKit/Source/modules/sensor/SensorReading.h |
@@ -8,38 +8,31 @@ |
#include "bindings/core/v8/ScriptWrappable.h" |
#include "core/dom/DOMHighResTimeStamp.h" |
#include "core/dom/DOMTimeStamp.h" |
-#include "modules/ModulesExport.h" |
+#include "modules/sensor/SensorProxy.h" |
namespace blink { |
-class MODULES_EXPORT SensorReading : public GarbageCollectedFinalized<SensorReading>, public ScriptWrappable { |
- DEFINE_WRAPPERTYPEINFO(); |
+class ExecutionContext; |
+class ScriptState; |
+class 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; } |
+ DOMHighResTimeStamp timeStamp(ScriptState*) const; |
- DECLARE_VIRTUAL_TRACE(); |
+ // Returns 'true' if the current reading value is different than the given |
+ // previous one; otherwise returns 'false'. |
+ virtual bool isReadingUpdated(const SensorProxy::Reading& previous) const = 0; |
protected: |
- bool m_canProvideTimeStamp; |
- DOMHighResTimeStamp m_timeStamp; |
+ explicit SensorReading(SensorProxy*); |
- SensorReading(); |
- SensorReading(bool providesTimeStamp, DOMHighResTimeStamp timestamp); |
+protected: |
+ Member<SensorProxy> m_sensorProxy; |
}; |
} // namepsace blink |