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/ActiveDOMObject.h" | 10 #include "core/dom/ActiveDOMObject.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); | 57 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
58 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | 58 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); |
59 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 59 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
60 | 60 |
61 // ActiveScriptWrappable overrides. | 61 // ActiveScriptWrappable overrides. |
62 bool hasPendingActivity() const override; | 62 bool hasPendingActivity() const override; |
63 | 63 |
64 DECLARE_VIRTUAL_TRACE(); | 64 DECLARE_VIRTUAL_TRACE(); |
65 | 65 |
66 protected: | 66 protected: |
67 Sensor(ExecutionContext*, const SensorOptions&, device::mojom::blink::Sensor
Type); | 67 Sensor(ScriptState*, const SensorOptions&, ExceptionState&, device::mojom::b
link::SensorType); |
68 virtual SensorReading* createSensorReading(SensorProxy*) = 0; | 68 virtual SensorReading* createSensorReading(SensorProxy*) = 0; |
69 | 69 |
70 using SensorConfigurationPtr = device::mojom::blink::SensorConfigurationPtr; | 70 using SensorConfigurationPtr = device::mojom::blink::SensorConfigurationPtr; |
71 using SensorConfiguration = device::mojom::blink::SensorConfiguration; | 71 using SensorConfiguration = device::mojom::blink::SensorConfiguration; |
72 virtual SensorConfigurationPtr createSensorConfig(const SensorOptions&, cons
t SensorConfiguration& defaultConfiguration) = 0; | 72 virtual SensorConfigurationPtr createSensorConfig(const SensorOptions&, cons
t SensorConfiguration& defaultConfiguration) = 0; |
73 | 73 |
74 private: | 74 private: |
75 void initSensorProxyIfNeeded(); | 75 void initSensorProxyIfNeeded(); |
76 | 76 |
77 // ContextLifecycleObserver overrides. | 77 // ContextLifecycleObserver overrides. |
(...skipping 28 matching lines...) Expand all Loading... |
106 SensorState m_state; | 106 SensorState m_state; |
107 Member<SensorProxy> m_sensorProxy; | 107 Member<SensorProxy> m_sensorProxy; |
108 std::unique_ptr<SensorPollingStrategy> m_polling; | 108 std::unique_ptr<SensorPollingStrategy> m_polling; |
109 SensorProxy::Reading m_storedData; | 109 SensorProxy::Reading m_storedData; |
110 SensorConfigurationPtr m_configuration; | 110 SensorConfigurationPtr m_configuration; |
111 }; | 111 }; |
112 | 112 |
113 } // namespace blink | 113 } // namespace blink |
114 | 114 |
115 #endif // Sensor_h | 115 #endif // Sensor_h |
OLD | NEW |