void ScriptLoader::cancel(Document* contextDocument) { if (!m_resource) return; finishLoading(contextDocument, FinishWithErrorOrCancel); stopLoadRequest(); }
void ScriptElementData::notifyFinished(CachedResource* o) { CachedScript* cs = static_cast<CachedScript*>(o); ASSERT(cs == m_cachedScript); // Evaluating the script could lead to a garbage collection which can // delete the script element so we need to protect it and us with it! RefPtr<Element> protector(m_element); if (cs->errorOccurred()) m_scriptElement->dispatchErrorEvent(); else { evaluateScript(ScriptSourceCode(cs)); m_scriptElement->dispatchLoadEvent(); } stopLoadRequest(); }
ScriptElementData::~ScriptElementData() { stopLoadRequest(); }