Commit 39cf806a authored by morrita@chromium.org's avatar morrita@chromium.org

HTML Imports: A speculative fix for fast/dom/custom/imports-custom-element-abort.html

The test occasionally crashes by touching null HTMLImportsController:m_master in a timer function.
This change cancel the timer when m_master is cleared, and add an ASSERT() to make sure that
|m_master| is available when timer is fired.

BUG=355640
TEST=imports-custom-element-abort.html
R=dominicc

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

git-svn-id: svn://svn.chromium.org/blink/trunk@169962 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 0327c27a
...@@ -66,6 +66,7 @@ void HTMLImportsController::clear() ...@@ -66,6 +66,7 @@ void HTMLImportsController::clear()
if (m_master) if (m_master)
m_master->setImport(0); m_master->setImport(0);
m_master = 0; m_master = 0;
m_recalcTimer.stop();
} }
HTMLImportChild* HTMLImportsController::createChild(const KURL& url, HTMLImport* parent, HTMLImportChildClient* client) HTMLImportChild* HTMLImportsController::createChild(const KURL& url, HTMLImport* parent, HTMLImportChildClient* client)
...@@ -166,13 +167,15 @@ void HTMLImportsController::stateDidChange() ...@@ -166,13 +167,15 @@ void HTMLImportsController::stateDidChange()
void HTMLImportsController::scheduleRecalcState() void HTMLImportsController::scheduleRecalcState()
{ {
if (m_recalcTimer.isActive()) if (m_recalcTimer.isActive() || !m_master)
return; return;
m_recalcTimer.startOneShot(0, FROM_HERE); m_recalcTimer.startOneShot(0, FROM_HERE);
} }
void HTMLImportsController::recalcTimerFired(Timer<HTMLImportsController>*) void HTMLImportsController::recalcTimerFired(Timer<HTMLImportsController>*)
{ {
ASSERT(m_master);
do { do {
m_recalcTimer.stop(); m_recalcTimer.stop();
HTMLImport::recalcTreeState(this); HTMLImport::recalcTreeState(this);
......
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