Commit cf54903d authored by tzik's avatar tzik Committed by Commit Bot

Detach v8::Context from Worker and Worklet in its shutdown process

v8::Context may refer C++ object embedded by Blink, and it was left
stale on Worker and Worklet shutdown.
This CL ensures them to be cleared at the end of the shutdown process.

Bug: 804661
Change-Id: Ib66d1bf6bc88370310d65b04210ca763474ff8a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1578518
Commit-Queue: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653526}
parent 023683fd
......@@ -130,6 +130,13 @@ void WorkerOrWorkletScriptController::DisposeContextIfNeeded() {
script_state_->GetContext());
}
{
ScriptState::Scope scope(script_state_);
// This detaches v8::MicrotaskQueue pointer from v8::Context, so that we can
// destroy EventLoop safely.
script_state_->GetContext()->DetachGlobal();
}
script_state_->DisposePerContextData();
script_state_->DissociateContext();
}
......
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