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

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

Issue 2684743003: [Sensors] start() and stop() methods do not throw (Closed)
Patch Set: Created 3 years, 10 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.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
index 8c01f6aa7e50f945ab115ef81a867b2ce6cb002b..f0ed3d8095b0b6f98af81ac24997d34f138ad836 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -62,24 +62,24 @@ Sensor::Sensor(ExecutionContext* executionContext,
Sensor::~Sensor() = default;
-void Sensor::start(ScriptState* scriptState, ExceptionState& exceptionState) {
+void Sensor::start() {
if (m_state != Sensor::SensorState::Unconnected &&
m_state != Sensor::SensorState::Idle &&
m_state != Sensor::SensorState::Errored)
return;
initSensorProxyIfNeeded();
-
if (!m_sensorProxy) {
- exceptionState.throwDOMException(
- InvalidStateError, "The Sensor is no longer associated to a frame.");
+ reportError(InvalidStateError,
+ "The Sensor is no longer associated to a frame.");
return;
}
+
m_lastUpdateTimestamp = WTF::monotonicallyIncreasingTime();
startListening();
}
-void Sensor::stop(ScriptState*, ExceptionState& exceptionState) {
+void Sensor::stop() {
if (m_state == Sensor::SensorState::Unconnected ||
m_state == Sensor::SensorState::Idle ||
m_state == Sensor::SensorState::Errored)
« no previous file with comments | « third_party/WebKit/Source/modules/sensor/Sensor.h ('k') | third_party/WebKit/Source/modules/sensor/Sensor.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698