OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SensorReading_h | 5 #ifndef SensorReading_h |
6 #define SensorReading_h | 6 #define SensorReading_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/dom/DOMHighResTimeStamp.h" | 9 #include "core/dom/DOMHighResTimeStamp.h" |
10 #include "core/dom/DOMTimeStamp.h" | 10 #include "core/dom/DOMTimeStamp.h" |
11 #include "modules/sensor/SensorProxy.h" | 11 #include "modules/sensor/SensorProxy.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class ExecutionContext; | |
16 class ScriptState; | 15 class ScriptState; |
17 | 16 |
18 class SensorReading : public GarbageCollectedFinalized<SensorReading>, | 17 class SensorReading : public GarbageCollectedFinalized<SensorReading>, |
19 public ScriptWrappable { | 18 public ScriptWrappable { |
20 DEFINE_WRAPPERTYPEINFO(); | 19 DEFINE_WRAPPERTYPEINFO(); |
21 | 20 |
22 public: | 21 public: |
23 DECLARE_VIRTUAL_TRACE(); | 22 DECLARE_VIRTUAL_TRACE(); |
24 | 23 |
25 DOMHighResTimeStamp timeStamp(ScriptState*) const; | 24 DOMHighResTimeStamp timeStamp(ScriptState*) const; |
26 | 25 |
27 // Returns 'true' if the current reading value is different than the given | 26 // Returns 'true' if the current reading value is different than the given |
28 // previous one; otherwise returns 'false'. | 27 // previous one; otherwise returns 'false'. |
29 virtual bool isReadingUpdated(const SensorProxy::Reading& previous) const = 0; | 28 virtual bool isReadingUpdated(const SensorProxy::Reading& previous) const = 0; |
30 | 29 |
31 virtual ~SensorReading(); | 30 virtual ~SensorReading(); |
32 | 31 |
33 protected: | 32 protected: |
34 explicit SensorReading(SensorProxy*); | 33 explicit SensorReading(SensorProxy*); |
35 | 34 |
36 protected: | 35 protected: |
37 Member<SensorProxy> m_sensorProxy; | 36 Member<SensorProxy> m_sensorProxy; |
38 }; | 37 }; |
39 | 38 |
40 } // namepsace blink | 39 } // namepsace blink |
41 | 40 |
42 #endif // SensorReading_h | 41 #endif // SensorReading_h |
OLD | NEW |