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 17 matching lines...) Expand all Loading... |
28 #include "wtf/text/TextPosition.h" | 28 #include "wtf/text/TextPosition.h" |
29 #include "wtf/text/WTFString.h" | 29 #include "wtf/text/WTFString.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class Element; | 33 class Element; |
34 class ScriptLoaderClient; | 34 class ScriptLoaderClient; |
35 class ScriptSourceCode; | 35 class ScriptSourceCode; |
36 | 36 |
37 | 37 |
38 class ScriptLoader FINAL : private ScriptResourceClient { | 38 class ScriptLoader final : private ScriptResourceClient { |
39 public: | 39 public: |
40 static PassOwnPtr<ScriptLoader> create(Element*, bool createdByParser, bool
isEvaluated); | 40 static PassOwnPtr<ScriptLoader> create(Element*, bool createdByParser, bool
isEvaluated); |
41 virtual ~ScriptLoader(); | 41 virtual ~ScriptLoader(); |
42 | 42 |
43 Element* element() const { return m_element; } | 43 Element* element() const { return m_element; } |
44 | 44 |
45 enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeI
nTypeAttribute }; | 45 enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeI
nTypeAttribute }; |
46 bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::m
inimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute); | 46 bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::m
inimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute); |
47 | 47 |
48 String scriptCharset() const { return m_characterEncoding; } | 48 String scriptCharset() const { return m_characterEncoding; } |
(...skipping 28 matching lines...) Expand all Loading... |
77 | 77 |
78 bool ignoresLoadRequest() const; | 78 bool ignoresLoadRequest() const; |
79 bool isScriptForEventSupported() const; | 79 bool isScriptForEventSupported() const; |
80 | 80 |
81 bool fetchScript(const String& sourceUrl, FetchRequest::DeferOption); | 81 bool fetchScript(const String& sourceUrl, FetchRequest::DeferOption); |
82 void stopLoadRequest(); | 82 void stopLoadRequest(); |
83 | 83 |
84 ScriptLoaderClient* client() const; | 84 ScriptLoaderClient* client() const; |
85 | 85 |
86 // ResourceClient | 86 // ResourceClient |
87 virtual void notifyFinished(Resource*) OVERRIDE; | 87 virtual void notifyFinished(Resource*) override; |
88 | 88 |
89 // FIXME: Oilpan: This should become a Member once ResourceClient is moved t
o the heap. | 89 // FIXME: Oilpan: This should become a Member once ResourceClient is moved t
o the heap. |
90 Element* m_element; | 90 Element* m_element; |
91 ResourcePtr<ScriptResource> m_resource; | 91 ResourcePtr<ScriptResource> m_resource; |
92 WTF::OrdinalNumber m_startLineNumber; | 92 WTF::OrdinalNumber m_startLineNumber; |
93 bool m_parserInserted : 1; | 93 bool m_parserInserted : 1; |
94 bool m_isExternalScript : 1; | 94 bool m_isExternalScript : 1; |
95 bool m_alreadyStarted : 1; | 95 bool m_alreadyStarted : 1; |
96 bool m_haveFiredLoad : 1; | 96 bool m_haveFiredLoad : 1; |
97 bool m_willBeParserExecuted : 1; // Same as "The parser will handle executin
g the script." | 97 bool m_willBeParserExecuted : 1; // Same as "The parser will handle executin
g the script." |
98 bool m_readyToBeParserExecuted : 1; | 98 bool m_readyToBeParserExecuted : 1; |
99 bool m_willExecuteWhenDocumentFinishedParsing : 1; | 99 bool m_willExecuteWhenDocumentFinishedParsing : 1; |
100 bool m_forceAsync : 1; | 100 bool m_forceAsync : 1; |
101 bool m_willExecuteInOrder : 1; | 101 bool m_willExecuteInOrder : 1; |
102 String m_characterEncoding; | 102 String m_characterEncoding; |
103 String m_fallbackCharacterEncoding; | 103 String m_fallbackCharacterEncoding; |
104 }; | 104 }; |
105 | 105 |
106 ScriptLoader* toScriptLoaderIfPossible(Element*); | 106 ScriptLoader* toScriptLoaderIfPossible(Element*); |
107 | 107 |
108 inline PassOwnPtr<ScriptLoader> ScriptLoader::create(Element* element, bool crea
tedByParser, bool isEvaluated) | 108 inline PassOwnPtr<ScriptLoader> ScriptLoader::create(Element* element, bool crea
tedByParser, bool isEvaluated) |
109 { | 109 { |
110 return adoptPtr(new ScriptLoader(element, createdByParser, isEvaluated)); | 110 return adoptPtr(new ScriptLoader(element, createdByParser, isEvaluated)); |
111 } | 111 } |
112 | 112 |
113 } | 113 } |
114 | 114 |
115 | 115 |
116 #endif | 116 #endif |
OLD | NEW |