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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceLongTaskTiming.cpp

Issue 2593853002: Remove unnecessary wrapper on DomHighResTimestamp, and clamp resolution to 1 millisecond (Closed)
Patch Set: address format nit Created 4 years 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/Source/core/timing/PerformanceBase.cpp ('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/core/timing/PerformanceLongTaskTiming.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceLongTaskTiming.cpp b/third_party/WebKit/Source/core/timing/PerformanceLongTaskTiming.cpp
index f8266a5224eed9a044d86b3fb3149888d5db85ad..6b9032c647c9b6071fc0a6423dfbec676c70ceef 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceLongTaskTiming.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceLongTaskTiming.cpp
@@ -8,13 +8,25 @@
namespace blink {
+namespace {
+
+double clampToMillisecond(double timeInMillis) {
+ // Long task times are clamped to 1 millisecond for security.
+ return floor(timeInMillis);
+}
+
+} // namespace
+
PerformanceLongTaskTiming::PerformanceLongTaskTiming(double startTime,
double endTime,
String name,
String culpritFrameSrc,
String culpritFrameId,
String culpritFrameName)
- : PerformanceEntry(name, "longtask", startTime, endTime),
+ : PerformanceEntry(name,
+ "longtask",
+ clampToMillisecond(startTime),
+ clampToMillisecond(endTime)),
m_culpritFrameSrc(culpritFrameSrc),
m_culpritFrameId(culpritFrameId),
m_culpritFrameName(culpritFrameName) {}
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698