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

Unified Diff: Source/core/page/PerformanceUserTiming.cpp

Issue 22311011: Improve 'performance.{mark,measure} exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | « LayoutTests/fast/performance/performance-measure-exceptions-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PerformanceUserTiming.cpp
diff --git a/Source/core/page/PerformanceUserTiming.cpp b/Source/core/page/PerformanceUserTiming.cpp
index 70b6a57630f1fdf4982816221e611a4c792927f0..a365c6ac690a94788184a0d83140b849057172ab 100644
--- a/Source/core/page/PerformanceUserTiming.cpp
+++ b/Source/core/page/PerformanceUserTiming.cpp
@@ -101,7 +101,7 @@ static void clearPeformanceEntries(PerformanceEntryMap& performanceEntryMap, con
void UserTiming::mark(const String& markName, ExceptionState& es)
{
if (restrictedKeyMap().contains(markName)) {
- es.throwDOMException(SyntaxError);
+ es.throwDOMException(SyntaxError, "'" + markName + "' is part of the PerformanceTiming interface, and cannot be used as a mark name.");
return;
}
@@ -122,13 +122,13 @@ double UserTiming::findExistingMarkStartTime(const String& markName, ExceptionSt
if (restrictedKeyMap().contains(markName)) {
double value = static_cast<double>((m_performance->timing()->*(restrictedKeyMap().get(markName)))());
if (!value) {
- es.throwDOMException(InvalidAccessError);
+ es.throwDOMException(InvalidAccessError, "'" + markName + "' is empty: either the event hasn't happened yet, or it would provide cross-origin timing information.");
return 0.0;
}
return value - m_performance->timing()->navigationStart();
}
- es.throwDOMException(SyntaxError);
+ es.throwDOMException(SyntaxError, "The mark '" + markName + "' does not exist.");
return 0.0;
}
« no previous file with comments | « LayoutTests/fast/performance/performance-measure-exceptions-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698