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

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

Issue 2121313002: [sensors] Generic Sensors Framework blink side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sensors_mojo_interfaces
Patch Set: Properly handle default sensor options Created 4 years, 4 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..3ba59882c903c55ff9991276f29b817a155fabaf 100644
--- a/third_party/WebKit/Source/modules/sensor/SensorReading.h
+++ b/third_party/WebKit/Source/modules/sensor/SensorReading.h
@@ -8,38 +8,33 @@
#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"
riju_ 2016/08/31 10:35:49 forward declaration below is enough
Mikhail 2016/08/31 12:01:07 We're using nested type SensorProxy::Reading, so u
namespace blink {
-class MODULES_EXPORT SensorReading : public GarbageCollectedFinalized<SensorReading>, public ScriptWrappable {
- DEFINE_WRAPPERTYPEINFO();
+class ExecutionContext;
+class SensorProxy;
+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;
};
} // namepsace blink

Powered by Google App Engine
This is Rietveld 408576698