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

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

Issue 2330943002: [Sensors] Handle default sensor configuration (Closed)
Patch Set: Rebased 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 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(ExecutionContext*, const SensorOptions&, device::mojom::blink::Sensor Type);
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 virtual SensorConfigurationPtr createSensorConfig(const SensorOptions&) = 0; 71 using SensorConfiguration = device::mojom::blink::SensorConfiguration;
72 virtual SensorConfigurationPtr createSensorConfig(const SensorOptions&, cons t SensorConfiguration& defaultConfiguration) = 0;
72 73
73 private: 74 private:
74 void initSensorProxyIfNeeded(); 75 void initSensorProxyIfNeeded();
75 76
76 // ContextLifecycleObserver overrides. 77 // ContextLifecycleObserver overrides.
77 void contextDestroyed() override; 78 void contextDestroyed() override;
78 79
79 // SensorController::Observer overrides. 80 // SensorController::Observer overrides.
80 void onSensorInitialized() override; 81 void onSensorInitialized() override;
81 void onSensorReadingChanged() override; 82 void onSensorReadingChanged() override;
(...skipping 23 matching lines...) Expand all
105 SensorState m_state; 106 SensorState m_state;
106 Member<SensorProxy> m_sensorProxy; 107 Member<SensorProxy> m_sensorProxy;
107 std::unique_ptr<SensorPollingStrategy> m_polling; 108 std::unique_ptr<SensorPollingStrategy> m_polling;
108 SensorProxy::Reading m_storedData; 109 SensorProxy::Reading m_storedData;
109 SensorConfigurationPtr m_configuration; 110 SensorConfigurationPtr m_configuration;
110 }; 111 };
111 112
112 } // namespace blink 113 } // namespace blink
113 114
114 #endif // Sensor_h 115 #endif // Sensor_h
OLDNEW
« no previous file with comments | « device/generic_sensor/sensor_provider_impl.cc ('k') | third_party/WebKit/Source/modules/sensor/Sensor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698