Commit f898cd59 authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[DevTools] paint worklet should report context destroyed

If someone reports context to inspector with contextCreated, then this context should be reported as destroyed.

BUG=chromium:657450, chromium:656626
R=ikilpatrick@chromium.org, dgozman@chromium.org

Review-Url: https://chromiumcodereview.appspot.com/2431223009
Cr-Commit-Position: refs/heads/master@{#426893}
parent 869b93ac
<!DOCTYPE html>
<html>
<body>
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
function gc()
{
if (window.GCController) {
GCController.collect();
} else {
for (var i = 0; i < 10000; ++i)
new Object;
}
}
function tryCrash()
{
document.frame.paintWorklet;
tCF1.outerHTML = "";
gc();
if (window.testRunner)
testRunner.notifyDone();
}
</script>
<div id=tCF1><iframe onload="tryCrash()" name=frame id=frame></iframe></div>
</body>
</html>
......@@ -47,6 +47,8 @@ PaintWorkletGlobalScope::PaintWorkletGlobalScope(
PaintWorkletGlobalScope::~PaintWorkletGlobalScope() {}
void PaintWorkletGlobalScope::dispose() {
MainThreadDebugger::instance()->contextWillBeDestroyed(
scriptController()->getScriptState());
// Explicitly clear the paint defininitions to break a reference cycle
// between them and this global scope.
m_paintDefinitions.clear();
......
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