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

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

Issue 2674703002: [Sensors] Stop throwing InvalidStateError exceptions (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1e6c98b68e689b579c6f9730bd3d165a813bb550..6dbe8240277cff5274ef77c72ed51cfb1bc108cf 100644
--- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -64,12 +64,8 @@ Sensor::~Sensor() = default;
void Sensor::start(ScriptState* scriptState, ExceptionState& exceptionState) {
if (m_state != Sensor::SensorState::Idle &&
- m_state != Sensor::SensorState::Errored) {
- exceptionState.throwDOMException(
- InvalidStateError,
- "Cannot start because SensorState is not Idle or errored");
+ m_state != Sensor::SensorState::Errored)
return;
- }
initSensorProxyIfNeeded();
@@ -84,12 +80,8 @@ void Sensor::start(ScriptState* scriptState, ExceptionState& exceptionState) {
void Sensor::stop(ScriptState*, ExceptionState& exceptionState) {
if (m_state == Sensor::SensorState::Idle ||
- m_state == Sensor::SensorState::Errored) {
- exceptionState.throwDOMException(
- InvalidStateError,
- "Cannot stop because SensorState is either Idle or errored");
+ m_state == Sensor::SensorState::Errored)
return;
- }
stopListening();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698