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

Unified Diff: third_party/WebKit/Source/core/dom/IdleDeadline.cpp

Issue 1361803003: Clamp resolution of requestIdleCallback timeRemaining() to 5us. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rIC_histograms
Patch Set: Rebase 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 | « no previous file | third_party/WebKit/Source/core/timing/PerformanceBase.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/IdleDeadline.cpp
diff --git a/third_party/WebKit/Source/core/dom/IdleDeadline.cpp b/third_party/WebKit/Source/core/dom/IdleDeadline.cpp
index ed7f04eb2d6dec18533ce8cd777009394d5044a9..2c4da53fe8d2ed6d72ea652b9972eb6c0d7de1fa 100644
--- a/third_party/WebKit/Source/core/dom/IdleDeadline.cpp
+++ b/third_party/WebKit/Source/core/dom/IdleDeadline.cpp
@@ -5,6 +5,7 @@
#include "config.h"
#include "core/dom/IdleDeadline.h"
+#include "core/timing/PerformanceBase.h"
#include "wtf/CurrentTime.h"
namespace blink {
@@ -21,7 +22,7 @@ double IdleDeadline::timeRemaining() const
if (timeRemaining < 0)
timeRemaining = 0;
- return timeRemaining * 1000;
+ return 1000.0 * PerformanceBase::clampTimeResolution(timeRemaining);
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/timing/PerformanceBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698