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

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

Issue 2798923003: [Sensors] Update exceptions throwing from OrientationSensor.populateMatrix() (Closed)
Patch Set: Comments from Alex Created 3 years, 8 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 | « third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html ('k') | 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/OrientationSensor.cpp
diff --git a/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp b/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp
index c04e065940004d6f215b10dbb863e467d8e5104d..34db10b792206656de45cf06de3e2fe340944cb3 100644
--- a/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp
+++ b/third_party/WebKit/Source/modules/sensor/OrientationSensor.cpp
@@ -84,13 +84,11 @@ void OrientationSensor::populateMatrixInternal(Matrix* targetMatrix,
"Target buffer must have at least 16 elements.");
return;
}
- if (!isActivated()) {
- exceptionState.throwDOMException(
- InvalidStateError, "The sensor must be in 'connected' state.");
+ if (!canReturnReadings()) {
+ exceptionState.throwDOMException(NotReadableError,
+ "Sensor data is not available.");
return;
}
- if (!canReturnReadings())
- return;
double x = readingValueUnchecked(0);
double y = readingValueUnchecked(1);
« no previous file with comments | « third_party/WebKit/LayoutTests/sensor/absolute-orientation-sensor.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698