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

Side by Side Diff: third_party/WebKit/Source/modules/sensor/SensorReading.h

Issue 2332323002: [sensors] Ambient light sensor bindings implementation (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
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; 15 class ExecutionContext;
16 class ScriptState; 16 class ScriptState;
17 17
18 class SensorReading 18 class SensorReading
19 : public GarbageCollected<SensorReading> 19 : public GarbageCollectedFinalized<SensorReading>
20 , public ScriptWrappable { 20 , public ScriptWrappable {
21 DEFINE_WRAPPERTYPEINFO(); 21 DEFINE_WRAPPERTYPEINFO();
22 public: 22 public:
23 DECLARE_VIRTUAL_TRACE(); 23 DECLARE_VIRTUAL_TRACE();
24 24
25 DOMHighResTimeStamp timeStamp(ScriptState*) const; 25 DOMHighResTimeStamp timeStamp(ScriptState*) const;
26 26
27 // Returns 'true' if the current reading value is different than the given 27 // Returns 'true' if the current reading value is different than the given
28 // previous one; otherwise returns 'false'. 28 // previous one; otherwise returns 'false'.
29 virtual bool isReadingUpdated(const SensorProxy::Reading& previous) const = 0; 29 virtual bool isReadingUpdated(const SensorProxy::Reading& previous) const;
30
31 // Required by GarbageCollectedFinalized.
haraken 2016/09/13 09:45:04 You can use GarbageCollected.
shalamov 2016/09/13 10:34:17 I made SensorReading GarbageCollectedMixin and der
32 virtual ~SensorReading();
30 33
31 protected: 34 protected:
32 explicit SensorReading(SensorProxy*); 35 explicit SensorReading(SensorProxy*);
33 36
34 protected: 37 protected:
35 Member<SensorProxy> m_sensorProxy; 38 Member<SensorProxy> m_sensorProxy;
36 }; 39 };
37 40
38 } // namepsace blink 41 } // namepsace blink
39 42
40 #endif // SensorReading_h 43 #endif // SensorReading_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698