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

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

Issue 2800923002: Assume Resource is always non-null in external classic script (Closed)
Patch Set: Assume Resource is always non-null in external classic script Created 3 years, 8 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 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 UseCounter::count(frame, UseCounter::BlockedSniffingCSVToScript); 728 UseCounter::count(frame, UseCounter::BlockedSniffingCSVToScript);
729 return false; 729 return false;
730 } 730 }
731 731
732 logScriptMIMEType(frame, resource, mimeType); 732 logScriptMIMEType(frame, resource, mimeType);
733 } 733 }
734 734
735 AccessControlStatus accessControlStatus = NotSharableCrossOrigin; 735 AccessControlStatus accessControlStatus = NotSharableCrossOrigin;
736 if (!m_isExternalScript) { 736 if (!m_isExternalScript) {
737 accessControlStatus = SharableCrossOrigin; 737 accessControlStatus = SharableCrossOrigin;
738 } else if (sourceCode.resource()) { 738 } else {
739 CHECK(sourceCode.resource());
739 accessControlStatus = sourceCode.resource()->calculateAccessControlStatus( 740 accessControlStatus = sourceCode.resource()->calculateAccessControlStatus(
740 m_element->document().getSecurityOrigin()); 741 m_element->document().getSecurityOrigin());
741 } 742 }
742 743
743 const bool isImportedScript = contextDocument != elementDocument; 744 const bool isImportedScript = contextDocument != elementDocument;
744 745
745 // 3. "If the script is from an external file, 746 // 3. "If the script is from an external file,
746 // or the script's type is module", 747 // or the script's type is module",
747 // then increment the ignore-destructive-writes counter of the 748 // then increment the ignore-destructive-writes counter of the
748 // script element's node document. Let neutralized doc be that Document." 749 // script element's node document. Let neutralized doc be that Document."
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 // then abort these steps at this point. The script is not executed. 864 // then abort these steps at this point. The script is not executed.
864 return equalIgnoringCase(eventAttribute, "onload") || 865 return equalIgnoringCase(eventAttribute, "onload") ||
865 equalIgnoringCase(eventAttribute, "onload()"); 866 equalIgnoringCase(eventAttribute, "onload()");
866 } 867 }
867 868
868 String ScriptLoader::scriptContent() const { 869 String ScriptLoader::scriptContent() const {
869 return m_element->textFromChildren(); 870 return m_element->textFromChildren();
870 } 871 }
871 872
872 } // namespace blink 873 } // 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