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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 2093983002: scheduler: Tell v8 about the current RAIL mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing gyp dependencies Created 4 years, 6 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 | « content/renderer/render_thread_impl.h ('k') | content/test/fake_renderer_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 4e7a4d193aeab0ec54841fb87dfe813728f6c6da..b66d6766d71a64f4d5d64937d7b47fd5c3d345b6 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -963,6 +963,7 @@ void RenderThreadImpl::Shutdown() {
// Shut down the message loop and the renderer scheduler before shutting down
// Blink. This prevents a scenario where a pending task in the message loop
// accesses Blink objects after Blink shuts down.
+ renderer_scheduler_->SetRAILModeObserver(nullptr);
renderer_scheduler_->Shutdown();
if (main_message_loop_)
main_message_loop_->RunUntilIdle();
@@ -1176,6 +1177,7 @@ void RenderThreadImpl::InitializeWebKit(
v8::Isolate* isolate = blink::mainThreadIsolate();
isolate->SetCreateHistogramFunction(CreateHistogram);
isolate->SetAddHistogramSampleFunction(AddHistogramSample);
+ renderer_scheduler_->SetRAILModeObserver(this);
main_thread_compositor_task_runner_ =
renderer_scheduler_->CompositorTaskRunner();
@@ -1643,6 +1645,11 @@ bool RenderThreadImpl::IsThreadedAnimationEnabled() {
return is_threaded_animation_enabled_;
}
+void RenderThreadImpl::OnRAILModeChanged(v8::RAILMode rail_mode) {
+ blink::mainThreadIsolate()->SetRAILMode(rail_mode);
+ blink::setRAILModeOnWorkerThreadIsolates(rail_mode);
+}
+
bool RenderThreadImpl::IsMainThread() {
return !!current();
}
« no previous file with comments | « content/renderer/render_thread_impl.h ('k') | content/test/fake_renderer_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698