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

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

Issue 2665503002: Make |ScriptLoader::m_characterEncoding| a local variable (Closed)
Patch Set: Created 3 years, 10 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 | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | 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) 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 }; 61 };
62 static bool isValidScriptTypeAndLanguage( 62 static bool isValidScriptTypeAndLanguage(
63 const String& typeAttributeValue, 63 const String& typeAttributeValue,
64 const String& languageAttributeValue, 64 const String& languageAttributeValue,
65 LegacyTypeSupport supportLegacyTypes); 65 LegacyTypeSupport supportLegacyTypes);
66 66
67 bool prepareScript( 67 bool prepareScript(
68 const TextPosition& scriptStartPosition = TextPosition::minimumPosition(), 68 const TextPosition& scriptStartPosition = TextPosition::minimumPosition(),
69 LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute); 69 LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
70 70
71 String scriptCharset() const { return m_characterEncoding; }
72 String scriptContent() const; 71 String scriptContent() const;
73 // Returns false if and only if execution was blocked. 72 // Returns false if and only if execution was blocked.
74 bool executeScript(const ScriptSourceCode&); 73 bool executeScript(const ScriptSourceCode&);
75 virtual void execute(); 74 virtual void execute();
76 75
77 // XML parser calls these 76 // XML parser calls these
78 void dispatchLoadEvent(); 77 void dispatchLoadEvent();
79 void dispatchErrorEvent(); 78 void dispatchErrorEvent();
80 bool isScriptTypeSupported(LegacyTypeSupport) const; 79 bool isScriptTypeSupported(LegacyTypeSupport) const;
81 80
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ScriptLoader(Element*, 121 ScriptLoader(Element*,
123 bool createdByParser, 122 bool createdByParser,
124 bool isEvaluated, 123 bool isEvaluated,
125 bool createdDuringDocumentWrite); 124 bool createdDuringDocumentWrite);
126 125
127 private: 126 private:
128 bool ignoresLoadRequest() const; 127 bool ignoresLoadRequest() const;
129 bool isScriptForEventSupported() const; 128 bool isScriptForEventSupported() const;
130 void logScriptMIMEType(LocalFrame*, ScriptResource*, const String&); 129 void logScriptMIMEType(LocalFrame*, ScriptResource*, const String&);
131 130
132 bool fetchScript(const String& sourceUrl, FetchRequest::DeferOption); 131 bool fetchScript(const String& sourceUrl,
132 const String& encoding,
133 FetchRequest::DeferOption);
133 bool doExecuteScript(const ScriptSourceCode&); 134 bool doExecuteScript(const ScriptSourceCode&);
134 135
135 ScriptLoaderClient* client() const; 136 ScriptLoaderClient* client() const;
136 137
137 // PendingScriptClient 138 // PendingScriptClient
138 void pendingScriptFinished(PendingScript*) override; 139 void pendingScriptFinished(PendingScript*) override;
139 140
140 Member<Element> m_element; 141 Member<Element> m_element;
141 Member<ScriptResource> m_resource; 142 Member<ScriptResource> m_resource;
142 WTF::OrdinalNumber m_startLineNumber; 143 WTF::OrdinalNumber m_startLineNumber;
143 String m_characterEncoding;
144 String m_fallbackCharacterEncoding;
145 144
146 bool m_parserInserted : 1; 145 bool m_parserInserted : 1;
147 bool m_isExternalScript : 1; 146 bool m_isExternalScript : 1;
148 bool m_alreadyStarted : 1; 147 bool m_alreadyStarted : 1;
149 bool m_haveFiredLoad : 1; 148 bool m_haveFiredLoad : 1;
150 // Same as "The parser will handle executing the script." 149 // Same as "The parser will handle executing the script."
151 bool m_willBeParserExecuted : 1; 150 bool m_willBeParserExecuted : 1;
152 bool m_readyToBeParserExecuted : 1; 151 bool m_readyToBeParserExecuted : 1;
153 bool m_willExecuteWhenDocumentFinishedParsing : 1; 152 bool m_willExecuteWhenDocumentFinishedParsing : 1;
154 bool m_forceAsync : 1; 153 bool m_forceAsync : 1;
(...skipping 16 matching lines...) Expand all
171 DocumentWriteIntervention m_documentWriteIntervention; 170 DocumentWriteIntervention m_documentWriteIntervention;
172 171
173 Member<PendingScript> m_pendingScript; 172 Member<PendingScript> m_pendingScript;
174 }; 173 };
175 174
176 ScriptLoader* toScriptLoaderIfPossible(Element*); 175 ScriptLoader* toScriptLoaderIfPossible(Element*);
177 176
178 } // namespace blink 177 } // namespace blink
179 178
180 #endif // ScriptLoader_h 179 #endif // ScriptLoader_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698