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

Unified Diff: Source/web/WebKit.cpp

Issue 364873002: Introduce a basic Blink Scheduler (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleaned up includes + build fix. Created 6 years, 5 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: Source/web/WebKit.cpp
diff --git a/Source/web/WebKit.cpp b/Source/web/WebKit.cpp
index 16809ed4767079b4b01f4db1237e17ba5d5b048c..59fabd934529c27945a79205cb4bad769ee321ec 100644
--- a/Source/web/WebKit.cpp
+++ b/Source/web/WebKit.cpp
@@ -50,6 +50,7 @@
#include "platform/heap/Heap.h"
#include "platform/heap/glue/MessageLoopInterruptor.h"
#include "platform/heap/glue/PendingGCRunner.h"
+#include "platform/scheduler/Scheduler.h"
#include "public/platform/Platform.h"
#include "public/platform/WebPrerenderingSupport.h"
#include "public/platform/WebThread.h"
@@ -146,7 +147,7 @@ static void cryptographicallyRandomValues(unsigned char* buffer, size_t length)
static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* context)
{
- Platform::current()->callOnMainThread(function, context);
+ WebCore::Scheduler::shared()->postTask(bind(function, context));
}
void initializeWithoutV8(Platform* platform)
@@ -161,6 +162,7 @@ void initializeWithoutV8(Platform* platform)
WTF::initialize(currentTimeFunction, monotonicallyIncreasingTimeFunction);
WTF::initializeMainThread(callOnMainThreadFunction);
WebCore::Heap::init();
+ WebCore::Scheduler::initializeOnMainThread();
WebCore::ThreadState::attachMainThread();
// currentThread will always be non-null in production, but can be null in Chromium unit tests.
@@ -203,6 +205,7 @@ void shutdown()
ASSERT(s_isolateInterruptor);
WebCore::ThreadState::current()->removeInterruptor(s_isolateInterruptor);
+ WebCore::Scheduler::shutdown();
// currentThread will always be non-null in production, but can be null in Chromium unit tests.
if (Platform::current()->currentThread()) {

Powered by Google App Engine
This is Rietveld 408576698