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

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

Issue 2503853002: [Sensors] Improvements in fetching reading for sensors with continuous reporting mode (Closed)
Patch Set: Comments from Tim Created 4 years, 1 month 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 7e2ec4b39e382c1d9d7e68274570c48498848a1c..cb97f595831a762872d1339a1b9454542f8b4f75 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.h
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.h
@@ -10,7 +10,6 @@
#include "core/dom/ActiveDOMObject.h"
#include "core/dom/ContextLifecycleObserver.h"
#include "core/frame/PlatformEventController.h"
-#include "core/page/PageVisibilityObserver.h"
#include "modules/EventTargetModules.h"
#include "modules/sensor/SensorOptions.h"
#include "modules/sensor/SensorProxy.h"
@@ -21,12 +20,11 @@ namespace blink {
class ExceptionState;
class ScriptState;
class SensorReading;
-class SensorPollingStrategy;
+class SensorUpdateNotificationStrategy;
class Sensor : public EventTargetWithInlineData,
public ActiveScriptWrappable,
public ContextLifecycleObserver,
- public PageVisibilityObserver,
public SensorProxy::Observer {
USING_GARBAGE_COLLECTED_MIXIN(Sensor);
DEFINE_WRAPPERTYPEINFO();
@@ -89,26 +87,21 @@ class Sensor : public EventTargetWithInlineData,
void onSensorError(ExceptionCode,
const String& sanitizedMessage,
const String& unsanitizedMessage) override;
+ void onSuspended() override;
void onStartRequestCompleted(bool);
void onStopRequestCompleted(bool);
- // PageVisibilityObserver overrides.
- void pageVisibilityChanged() override;
-
void startListening();
void stopListening();
- // Makes sensor reading refresh its values from the shared buffer.
- void pollForData();
+ void onSensorUpdateNotification();
void updateState(SensorState newState);
void reportError(ExceptionCode = UnknownError,
const String& sanitizedMessage = String(),
const String& unsanitizedMessage = String());
- void updatePollingStatus();
-
void notifySensorReadingChanged();
void notifyOnActivate();
void notifyError(DOMException* error);
@@ -118,7 +111,7 @@ class Sensor : public EventTargetWithInlineData,
device::mojom::blink::SensorType m_type;
SensorState m_state;
Member<SensorProxy> m_sensorProxy;
- std::unique_ptr<SensorPollingStrategy> m_polling;
+ std::unique_ptr<SensorUpdateNotificationStrategy> m_sensorUpdateNotifier;
device::SensorReading m_storedData;
SensorConfigurationPtr m_configuration;
};
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/BUILD.gn ('k') | third_party/WebKit/Source/modules/sensor/Sensor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698