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

Unified Diff: Source/modules/mediasource/SourceBuffer.cpp

Issue 212953004: Have SourceBuffer throw TypeError for non-finite doubles. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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: Source/modules/mediasource/SourceBuffer.cpp
diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp
index 87c6cf1dc05fbe9d1903a4b3021d73d0fc56ec22..04eb7d5ab06f5a2cef3dd11730720e8949610daf 100644
--- a/Source/modules/mediasource/SourceBuffer.cpp
+++ b/Source/modules/mediasource/SourceBuffer.cpp
@@ -177,7 +177,7 @@ void SourceBuffer::setTimestampOffset(double offset, ExceptionState& exceptionSt
{
// Enforce throwing an exception on restricted double values.
if (!std::isfinite(offset)) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::notAFiniteNumber(offset));
+ exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(offset));
return;
}
@@ -213,10 +213,8 @@ double SourceBuffer::appendWindowStart() const
void SourceBuffer::setAppendWindowStart(double start, ExceptionState& exceptionState)
{
// Enforce throwing an exception on restricted double values.
- if (std::isnan(start)
- || start == std::numeric_limits<double>::infinity()
- || start == -std::numeric_limits<double>::infinity()) {
- exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::notAFiniteNumber(start));
+ if (!std::isfinite(start)) {
+ exceptionState.throwTypeError(ExceptionMessages::notAFiniteNumber(start));
return;
}

Powered by Google App Engine
This is Rietveld 408576698