| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 class ScriptSourceCode; | 37 class ScriptSourceCode; |
| 38 | 38 |
| 39 | 39 |
| 40 class CORE_EXPORT ScriptLoader : public NoBaseWillBeGarbageCollectedFinalized<Sc
riptLoader>, private ScriptResourceClient { | 40 class CORE_EXPORT ScriptLoader : public NoBaseWillBeGarbageCollectedFinalized<Sc
riptLoader>, private ScriptResourceClient { |
| 41 public: | 41 public: |
| 42 static PassOwnPtrWillBeRawPtr<ScriptLoader> create(Element* element, bool cr
eatedByParser, bool isEvaluated) | 42 static PassOwnPtrWillBeRawPtr<ScriptLoader> create(Element* element, bool cr
eatedByParser, bool isEvaluated) |
| 43 { | 43 { |
| 44 return adoptPtrWillBeNoop(new ScriptLoader(element, createdByParser, isE
valuated)); | 44 return adoptPtrWillBeNoop(new ScriptLoader(element, createdByParser, isE
valuated)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual ~ScriptLoader(); | 47 ~ScriptLoader() override; |
| 48 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
| 49 | 49 |
| 50 Element* element() const { return m_element; } | 50 Element* element() const { return m_element; } |
| 51 | 51 |
| 52 enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeI
nTypeAttribute }; | 52 enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeI
nTypeAttribute }; |
| 53 bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::m
inimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute); | 53 bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::m
inimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute); |
| 54 | 54 |
| 55 String scriptCharset() const { return m_characterEncoding; } | 55 String scriptCharset() const { return m_characterEncoding; } |
| 56 String scriptContent() const; | 56 String scriptContent() const; |
| 57 // Returns false if and only if execution was blocked. | 57 // Returns false if and only if execution was blocked. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 bool ignoresLoadRequest() const; | 92 bool ignoresLoadRequest() const; |
| 93 bool isScriptForEventSupported() const; | 93 bool isScriptForEventSupported() const; |
| 94 | 94 |
| 95 bool fetchScript(const String& sourceUrl, FetchRequest::DeferOption); | 95 bool fetchScript(const String& sourceUrl, FetchRequest::DeferOption); |
| 96 | 96 |
| 97 ScriptLoaderClient* client() const; | 97 ScriptLoaderClient* client() const; |
| 98 | 98 |
| 99 // ResourceClient | 99 // ResourceClient |
| 100 virtual void notifyFinished(Resource*) override; | 100 void notifyFinished(Resource*) override; |
| 101 | 101 |
| 102 RawPtrWillBeMember<Element> m_element; | 102 RawPtrWillBeMember<Element> m_element; |
| 103 ResourcePtr<ScriptResource> m_resource; | 103 ResourcePtr<ScriptResource> m_resource; |
| 104 WTF::OrdinalNumber m_startLineNumber; | 104 WTF::OrdinalNumber m_startLineNumber; |
| 105 String m_characterEncoding; | 105 String m_characterEncoding; |
| 106 String m_fallbackCharacterEncoding; | 106 String m_fallbackCharacterEncoding; |
| 107 | 107 |
| 108 PendingScript m_pendingScript; | 108 PendingScript m_pendingScript; |
| 109 | 109 |
| 110 bool m_parserInserted : 1; | 110 bool m_parserInserted : 1; |
| 111 bool m_isExternalScript : 1; | 111 bool m_isExternalScript : 1; |
| 112 bool m_alreadyStarted : 1; | 112 bool m_alreadyStarted : 1; |
| 113 bool m_haveFiredLoad : 1; | 113 bool m_haveFiredLoad : 1; |
| 114 bool m_willBeParserExecuted : 1; // Same as "The parser will handle executin
g the script." | 114 bool m_willBeParserExecuted : 1; // Same as "The parser will handle executin
g the script." |
| 115 bool m_readyToBeParserExecuted : 1; | 115 bool m_readyToBeParserExecuted : 1; |
| 116 bool m_willExecuteWhenDocumentFinishedParsing : 1; | 116 bool m_willExecuteWhenDocumentFinishedParsing : 1; |
| 117 bool m_forceAsync : 1; | 117 bool m_forceAsync : 1; |
| 118 bool m_willExecuteInOrder : 1; | 118 bool m_willExecuteInOrder : 1; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 ScriptLoader* toScriptLoaderIfPossible(Element*); | 121 ScriptLoader* toScriptLoaderIfPossible(Element*); |
| 122 | 122 |
| 123 } // namespace blink | 123 } // namespace blink |
| 124 | 124 |
| 125 #endif // ScriptLoader_h | 125 #endif // ScriptLoader_h |
| OLD | NEW |