Commit 4d5765f4 authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

Fix pepper crash when reattaching plugins in style recalc

Method document::updateLayoutTree creates ScriptForbiddenScope.

An HTML plugin can be reattached while updating layout tree. Pepper plugin
can be destroyed while reattaching and executes some scripts. This execution
produces crash on ScriptForbidden assert.

BUG=550427
R=pfeldman@chromium.org,dcheng@chromium.org,dgozman@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#376084}
parent 93628b8a
......@@ -1729,6 +1729,10 @@ void Document::updateLayoutTree(StyleRecalcChange change)
ASSERT(isMainThread());
ScriptForbiddenScope forbidScript;
// We should forbid script execution for plugins here because update while layout is changing,
// HTMLPlugin element can be reattached and plugin can be destroyed. Plugin can execute scripts
// on destroy. It produces crash without PluginScriptForbiddenScope: crbug.com/550427.
PluginScriptForbiddenScope pluginForbidScript;
if (!view() || !isActive())
return;
......
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