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

Unified Diff: Source/core/html/TimeRanges.cpp

Issue 197213012: Improve media-related exception messages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove redundant TimeRanges test 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/track/vtt/VTTCue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/TimeRanges.cpp
diff --git a/Source/core/html/TimeRanges.cpp b/Source/core/html/TimeRanges.cpp
index bdf477b72029fa06e1f03e3f4f62c0f3d9a5c1ca..67c4cf9ae02ab21319b48df335b8475577e3c4c8 100644
--- a/Source/core/html/TimeRanges.cpp
+++ b/Source/core/html/TimeRanges.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "core/html/TimeRanges.h"
+#include "bindings/v8/ExceptionMessages.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/ExceptionStatePlaceholder.h"
#include "core/dom/ExceptionCode.h"
@@ -116,7 +117,7 @@ void TimeRanges::unionWith(const TimeRanges* other)
double TimeRanges::start(unsigned index, ExceptionState& exceptionState) const
{
if (index >= length()) {
- exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is not less than the object's length (" + String::number(length()) + ").");
+ exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound("index", index, length()));
return 0;
}
return m_ranges[index].m_start;
@@ -125,7 +126,7 @@ double TimeRanges::start(unsigned index, ExceptionState& exceptionState) const
double TimeRanges::end(unsigned index, ExceptionState& exceptionState) const
{
if (index >= length()) {
- exceptionState.throwDOMException(IndexSizeError, "The index provided (" + String::number(index) + ") is not less than the object's length (" + String::number(length()) + ").");
+ exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound("index", index, length()));
return 0;
}
return m_ranges[index].m_end;
« no previous file with comments | « Source/core/html/HTMLMediaElement.cpp ('k') | Source/core/html/track/vtt/VTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698