| 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 Sensor_h | 5 #ifndef Sensor_h |
| 6 #define Sensor_h | 6 #define Sensor_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
| 10 #include "core/dom/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 class SensorReading; | 24 class SensorReading; |
| 25 | 25 |
| 26 class Sensor : public EventTargetWithInlineData, | 26 class Sensor : public EventTargetWithInlineData, |
| 27 public ActiveScriptWrappable<Sensor>, | 27 public ActiveScriptWrappable<Sensor>, |
| 28 public ContextLifecycleObserver, | 28 public ContextLifecycleObserver, |
| 29 public SensorProxy::Observer { | 29 public SensorProxy::Observer { |
| 30 USING_GARBAGE_COLLECTED_MIXIN(Sensor); | 30 USING_GARBAGE_COLLECTED_MIXIN(Sensor); |
| 31 DEFINE_WRAPPERTYPEINFO(); | 31 DEFINE_WRAPPERTYPEINFO(); |
| 32 | 32 |
| 33 public: | 33 public: |
| 34 enum class SensorState { Idle, Activating, Activated, Errored }; | 34 enum class SensorState { Unconnected, Activating, Activated, Idle, Errored }; |
| 35 | 35 |
| 36 ~Sensor() override; | 36 ~Sensor() override; |
| 37 | 37 |
| 38 void start(ScriptState*, ExceptionState&); | 38 void start(ScriptState*, ExceptionState&); |
| 39 void stop(ScriptState*, ExceptionState&); | 39 void stop(ScriptState*, ExceptionState&); |
| 40 | 40 |
| 41 // EventTarget overrides. | 41 // EventTarget overrides. |
| 42 const AtomicString& interfaceName() const override { | 42 const AtomicString& interfaceName() const override { |
| 43 return EventTargetNames::Sensor; | 43 return EventTargetNames::Sensor; |
| 44 } | 44 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 SensorState m_state; | 110 SensorState m_state; |
| 111 Member<SensorProxy> m_sensorProxy; | 111 Member<SensorProxy> m_sensorProxy; |
| 112 device::SensorReading m_storedData; | 112 device::SensorReading m_storedData; |
| 113 SensorConfigurationPtr m_configuration; | 113 SensorConfigurationPtr m_configuration; |
| 114 double m_lastUpdateTimestamp; | 114 double m_lastUpdateTimestamp; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace blink | 117 } // namespace blink |
| 118 | 118 |
| 119 #endif // Sensor_h | 119 #endif // Sensor_h |
| OLD | NEW |