Commit 168f3dcc authored by rmcilroy's avatar rmcilroy Committed by Commit bot

[renderer]: Fix RendererScheduler shutdown logic to ensure it is shutdown before the MessageLoop.

The RendererScheduler needs to be shutdown before the MessageLoop. Previously
this was the case as blink was shutdown before the message loop, however now
the message loop is shutdown first. This CL ensures that the renderer
scheduler is shutdown just before the message loop.

BUG=467369

Review URL: https://codereview.chromium.org/1014643002

Cr-Commit-Position: refs/heads/master@{#320908}
parent 373bf95a
......@@ -761,11 +761,12 @@ void RenderThreadImpl::Shutdown() {
NPChannelBase::CleanupChannels();
#endif
// Shut down the message loop before shutting down Blink.
// This prevents a scenario where a pending task in the message loop accesses
// Blink objects after Blink shuts down.
// 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.
// This must be at the very end of the shutdown sequence. You must not touch
// the message loop after this.
renderer_scheduler_->Shutdown();
main_message_loop_.reset();
if (blink_platform_impl_)
blink::shutdown();
......
......@@ -85,9 +85,7 @@ void WebSchedulerImpl::postLoadingTask(
}
void WebSchedulerImpl::shutdown() {
idle_task_runner_ = nullptr;
loading_task_runner_ = nullptr;
return renderer_scheduler_->Shutdown();
// TODO(rmcilroy): Delete this method once the blink side is removed.
}
} // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment