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

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

Issue 1375683002: Clamp PerformanceResource and PerformanceTiming to 5us. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rIC_clamp
Patch Set: Created 5 years, 3 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/Source/core/timing/PerformanceResourceTiming.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/PerformanceTiming.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp b/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
index ce7df6baaba9384ead75a57c31b5d2dfb1fb6026..52f83339f385ea7110e07b2e0ea78856f1820cb8 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
@@ -39,6 +39,7 @@
#include "core/loader/DocumentLoadTiming.h"
#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
+#include "core/timing/PerformanceBase.h"
#include "platform/network/ResourceLoadTiming.h"
#include "platform/network/ResourceResponse.h"
@@ -47,7 +48,8 @@ namespace blink {
static unsigned long long toIntegerMilliseconds(double seconds)
{
ASSERT(seconds >= 0);
- return static_cast<unsigned long long>(seconds * 1000.0);
+ double clampedSeconds = PerformanceBase::clampTimeResolution(seconds);
+ return static_cast<unsigned long long>(clampedSeconds * 1000.0);
}
static double toDoubleSeconds(unsigned long long integerMilliseconds)
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceResourceTiming.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698