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

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

Issue 2715533007: Use ScriptLoader::errorOccurred() instead of Resource in ScriptLoader (Closed)
Patch Set: Use ScriptLoader::errorOccurred() Created 3 years, 9 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
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 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 } 845 }
846 846
847 DCHECK(m_asyncExecType != ScriptRunner::None); 847 DCHECK(m_asyncExecType != ScriptRunner::None);
848 848
849 Document* contextDocument = m_element->document().contextDocument(); 849 Document* contextDocument = m_element->document().contextDocument();
850 if (!contextDocument) { 850 if (!contextDocument) {
851 detachPendingScript(); 851 detachPendingScript();
852 return; 852 return;
853 } 853 }
854 854
855 DCHECK_EQ(pendingScript->resource(), m_resource); 855 DCHECK_EQ(pendingScript->resource(), m_resource);
sof 2017/02/24 07:29:22 Given the DCHECK_EQ() at the start of this method,
hiroshige 2017/02/24 18:16:57 The DCHECK_EQ() at the start of this method checks
sof 2017/02/24 18:26:43 If you really think that's valuable, then move it
hiroshige 2017/02/25 00:31:50 Done.
856 856
857 if (m_resource->errorOccurred()) { 857 if (errorOccurred()) {
858 contextDocument->scriptRunner()->notifyScriptLoadError(this, 858 contextDocument->scriptRunner()->notifyScriptLoadError(this,
859 m_asyncExecType); 859 m_asyncExecType);
860 detachPendingScript(); 860 detachPendingScript();
861 dispatchErrorEvent(); 861 dispatchErrorEvent();
862 return; 862 return;
863 } 863 }
864 contextDocument->scriptRunner()->notifyScriptReady(this, m_asyncExecType); 864 contextDocument->scriptRunner()->notifyScriptReady(this, m_asyncExecType);
865 m_pendingScript->stopWatchingForLoad(); 865 m_pendingScript->stopWatchingForLoad();
866 } 866 }
867 867
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 if (isHTMLScriptLoader(element)) 917 if (isHTMLScriptLoader(element))
918 return toHTMLScriptElement(element)->loader(); 918 return toHTMLScriptElement(element)->loader();
919 919
920 if (isSVGScriptLoader(element)) 920 if (isSVGScriptLoader(element))
921 return toSVGScriptElement(element)->loader(); 921 return toSVGScriptElement(element)->loader();
922 922
923 return 0; 923 return 0;
924 } 924 }
925 925
926 } // namespace blink 926 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698