Chromium Code Reviews| 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..b77324284e9f0c0bff79db1d9a3636afe2c42de7 100644 |
| --- a/third_party/WebKit/Source/modules/sensor/SensorReading.h |
| +++ b/third_party/WebKit/Source/modules/sensor/SensorReading.h |
| @@ -8,38 +8,32 @@ |
| #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 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(); |
| + DECLARE_VIRTUAL_TRACE(); |
| - DOMHighResTimeStamp timeStamp(bool& isNull); |
| + DOMHighResTimeStamp timeStamp() const; |
| - void setTimeStamp(DOMHighResTimeStamp time) { m_timeStamp = time; } |
| + void attach(SensorProxy*); |
| + void detach(); |
| - DECLARE_VIRTUAL_TRACE(); |
| + virtual bool isReadingUpdated(const SensorProxy::Reading& previous) const = 0; |
| protected: |
| - bool m_canProvideTimeStamp; |
| - DOMHighResTimeStamp m_timeStamp; |
| + explicit SensorReading(ExecutionContext*); |
| - SensorReading(); |
| - SensorReading(bool providesTimeStamp, DOMHighResTimeStamp timestamp); |
| +protected: |
| + WeakMember<SensorProxy> m_sensorProxy; |
| + WeakMember<ExecutionContext> m_context; |
|
haraken
2016/09/06 05:04:29
Is there any reason they need to be weak members?
Mikhail
2016/09/06 07:13:58
'm_sensorProxy' might have a different lifetime (s
|
| }; |
| } // namepsace blink |