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

Unified Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 1550563002: Blink Platform: Remove time functions from Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merrrge agaaain. Created 4 years, 10 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
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index 2b953d83646578b3e9c5c7f0e7d59d4642783a4a..7649f2f24aa2bde04ca28a192c2685cea493f0b4 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -45,6 +45,7 @@
#include "public/platform/WebScheduler.h"
#include "public/platform/WebThread.h"
#include "public/platform/WebTraceLocation.h"
+#include "wtf/CurrentTime.h"
#include "wtf/DataLog.h"
#include "wtf/Partitions.h"
#include "wtf/ThreadingPrimitives.h"
@@ -728,7 +729,7 @@ void ThreadState::performIdleGC(double deadlineSeconds)
if (gcState() != IdleGCScheduled)
return;
- double idleDeltaInSeconds = deadlineSeconds - Platform::current()->monotonicallyIncreasingTimeSeconds();
+ double idleDeltaInSeconds = deadlineSeconds - monotonicallyIncreasingTime();
TRACE_EVENT2("blink_gc", "ThreadState::performIdleGC", "idleDeltaInSeconds", idleDeltaInSeconds, "estimatedMarkingTime", Heap::estimatedMarkingTime());
if (idleDeltaInSeconds <= Heap::estimatedMarkingTime() && !Platform::current()->currentThread()->scheduler()->canExceedIdleDeadlineIfRequired()) {
// If marking is estimated to take longer than the deadline and we can't
@@ -755,7 +756,7 @@ void ThreadState::performIdleLazySweep(double deadlineSeconds)
if (sweepForbidden())
return;
- TRACE_EVENT1("blink_gc", "ThreadState::performIdleLazySweep", "idleDeltaInSeconds", deadlineSeconds - Platform::current()->monotonicallyIncreasingTimeSeconds());
+ TRACE_EVENT1("blink_gc", "ThreadState::performIdleLazySweep", "idleDeltaInSeconds", deadlineSeconds - monotonicallyIncreasingTime());
bool sweepCompleted = true;
SweepForbiddenScope scope(this);
@@ -767,7 +768,7 @@ void ThreadState::performIdleLazySweep(double deadlineSeconds)
// lazySweepWithDeadline() won't check the deadline until it sweeps
// 10 pages. So we give a small slack for safety.
double slack = 0.001;
- double remainingBudget = deadlineSeconds - slack - Platform::current()->monotonicallyIncreasingTimeSeconds();
+ double remainingBudget = deadlineSeconds - slack - monotonicallyIncreasingTime();
if (remainingBudget <= 0 || !m_heaps[i]->lazySweepWithDeadline(deadlineSeconds)) {
// We couldn't finish the sweeping within the deadline.
// We request another idle task for the remaining sweeping.
« no previous file with comments | « third_party/WebKit/Source/platform/heap/SafePoint.cpp ('k') | third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698