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

Unified Diff: Source/bindings/core/v8/V8Initializer.cpp

Issue 1087203002: Patch 2/3 to get WebScheduler via WebThread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Style nits Created 5 years, 8 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 | Source/core/dom/ScriptRunner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/V8Initializer.cpp
diff --git a/Source/bindings/core/v8/V8Initializer.cpp b/Source/bindings/core/v8/V8Initializer.cpp
index f585b25cafa81593c0b54009674b5331dfc7ad61..9c20ad6f444c1415e4d75c494341d507beca1d85 100644
--- a/Source/bindings/core/v8/V8Initializer.cpp
+++ b/Source/bindings/core/v8/V8Initializer.cpp
@@ -56,8 +56,9 @@
#include "platform/RuntimeEnabledFeatures.h"
#include "platform/TraceEvent.h"
#include "platform/heap/AddressSanitizer.h"
-#include "platform/scheduler/Scheduler.h"
#include "public/platform/Platform.h"
+#include "public/platform/WebScheduler.h"
+#include "public/platform/WebThread.h"
#include "wtf/ArrayBufferContents.h"
#include "wtf/RefPtr.h"
#include "wtf/text/WTFString.h"
@@ -320,15 +321,15 @@ static void idleGCTaskInMainThread(double deadlineSeconds)
ASSERT(RuntimeEnabledFeatures::v8IdleTasksEnabled());
bool gcFinished = false;
v8::Isolate* isolate = v8::Isolate::GetCurrent();
- if (deadlineSeconds > Platform::current()->monotonicallyIncreasingTime())
+
+ Platform* platform = Platform::current();
+ if (deadlineSeconds > platform->monotonicallyIncreasingTime())
gcFinished = isolate->IdleNotificationDeadline(deadlineSeconds);
- Scheduler* scheduler = Scheduler::shared();
- ASSERT(scheduler);
if (gcFinished)
- scheduler->postIdleTaskAfterWakeup(FROM_HERE, WTF::bind<double>(idleGCTaskInMainThread));
+ platform->currentThread()->scheduler()->postIdleTaskAfterWakeup(FROM_HERE, WTF::bind<double>(idleGCTaskInMainThread));
else
- scheduler->postIdleTask(FROM_HERE, WTF::bind<double>(idleGCTaskInMainThread));
+ platform->currentThread()->scheduler()->postIdleTask(FROM_HERE, WTF::bind<double>(idleGCTaskInMainThread));
}
static void timerTraceProfilerInMainThread(const char* name, int status)
@@ -397,7 +398,7 @@ void V8Initializer::initializeMainThreadIfNeeded()
v8::V8::SetAllowCodeGenerationFromStringsCallback(codeGenerationCheckCallbackInMainThread);
if (RuntimeEnabledFeatures::v8IdleTasksEnabled())
- Scheduler::shared()->postIdleTask(FROM_HERE, WTF::bind<double>(idleGCTaskInMainThread));
+ Platform::current()->currentThread()->scheduler()->postIdleTask(FROM_HERE, WTF::bind<double>(idleGCTaskInMainThread));
isolate->SetEventLogger(timerTraceProfilerInMainThread);
isolate->SetPromiseRejectCallback(promiseRejectHandlerInMainThread);
« no previous file with comments | « no previous file | Source/core/dom/ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698