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

Unified Diff: third_party/WebKit/Source/modules/sensor/Sensor.h

Issue 2668173003: [Sensors] Remove SensorReading interfaces (Closed)
Patch Set: updated global-interface-listing.html Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/sensor/Sensor.h
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.h b/third_party/WebKit/Source/modules/sensor/Sensor.h
index 1f1e25d498589d5195fc16e7c15069ff051e8489..76540175c23263163a63384ee4dd1cee827e751d 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.h
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.h
@@ -8,6 +8,8 @@
#include "bindings/core/v8/ActiveScriptWrappable.h"
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/dom/ContextLifecycleObserver.h"
+#include "core/dom/DOMHighResTimeStamp.h"
+#include "core/dom/DOMTimeStamp.h"
#include "core/dom/SuspendableObject.h"
#include "core/frame/PlatformEventController.h"
#include "modules/EventTargetModules.h"
@@ -46,8 +48,7 @@ class Sensor : public EventTargetWithInlineData,
// Getters
String state() const;
- // TODO(riju): crbug.com/614797 .
- SensorReading* reading() const;
+ DOMHighResTimeStamp timestamp(ScriptState*, bool& isNull) const;
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
@@ -63,8 +64,6 @@ class Sensor : public EventTargetWithInlineData,
const SensorOptions&,
ExceptionState&,
device::mojom::blink::SensorType);
- virtual std::unique_ptr<SensorReadingFactory>
- createSensorReadingFactory() = 0;
using SensorConfigurationPtr = device::mojom::blink::SensorConfigurationPtr;
using SensorConfiguration = device::mojom::blink::SensorConfiguration;
@@ -73,6 +72,7 @@ class Sensor : public EventTargetWithInlineData,
// concrete sensor implementations can override this method to handle other
// parameters if needed.
virtual SensorConfigurationPtr createSensorConfig();
+ double readingValue(int index, bool& isNull) const;
private:
void initSensorProxyIfNeeded();
@@ -102,6 +102,8 @@ class Sensor : public EventTargetWithInlineData,
void notifyOnActivate();
void notifyError(DOMException* error);
+ bool canReturnReadings() const;
+
private:
SensorOptions m_sensorOptions;
device::mojom::blink::SensorType m_type;

Powered by Google App Engine
This is Rietveld 408576698