Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2028613002: Have detached ScriptLoaders detach their PendingScripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 dispatchErrorEvent(); 458 dispatchErrorEvent();
459 } 459 }
460 m_resource = nullptr; 460 m_resource = nullptr;
461 } 461 }
462 462
463 void ScriptLoader::notifyFinished(Resource* resource) 463 void ScriptLoader::notifyFinished(Resource* resource)
464 { 464 {
465 DCHECK(!m_willBeParserExecuted); 465 DCHECK(!m_willBeParserExecuted);
466 466
467 Document* contextDocument = m_element->document().contextDocument(); 467 Document* contextDocument = m_element->document().contextDocument();
468 if (!contextDocument) 468 if (!contextDocument) {
469 detach();
469 return; 470 return;
471 }
470 472
471 ASSERT_UNUSED(resource, resource == m_resource); 473 ASSERT_UNUSED(resource, resource == m_resource);
472 474
473 ScriptRunner::ExecutionType runOrder = m_willExecuteInOrder ? ScriptRunner:: IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION; 475 ScriptRunner::ExecutionType runOrder = m_willExecuteInOrder ? ScriptRunner:: IN_ORDER_EXECUTION : ScriptRunner::ASYNC_EXECUTION;
474 if (m_resource->errorOccurred()) { 476 if (m_resource->errorOccurred()) {
475 contextDocument->scriptRunner()->notifyScriptLoadError(this, runOrder); 477 contextDocument->scriptRunner()->notifyScriptLoadError(this, runOrder);
476 detach(); 478 detach();
477 dispatchErrorEvent(); 479 dispatchErrorEvent();
478 return; 480 return;
479 } 481 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 if (isHTMLScriptLoader(element)) 524 if (isHTMLScriptLoader(element))
523 return toHTMLScriptElement(element)->loader(); 525 return toHTMLScriptElement(element)->loader();
524 526
525 if (isSVGScriptLoader(element)) 527 if (isSVGScriptLoader(element))
526 return toSVGScriptElement(element)->loader(); 528 return toSVGScriptElement(element)->loader();
527 529
528 return 0; 530 return 0;
529 } 531 }
530 532
531 } // namespace blink 533 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698