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

Unified Diff: third_party/WebKit/Source/core/dom/ScriptLoader.cpp

Issue 2665503002: Make |ScriptLoader::m_characterEncoding| a local variable (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index e6a6769683aa230c961fb234b0c5fbd15492a219..16c5e50d74c88c5fa276f2fe1e64983009b9733e 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -247,10 +247,11 @@ bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition,
if (!isScriptForEventSupported())
return false;
+ String encoding;
if (!client->charsetAttributeValue().isEmpty())
- m_characterEncoding = client->charsetAttributeValue();
+ encoding = client->charsetAttributeValue();
else
- m_characterEncoding = elementDocument.characterSet();
+ encoding = elementDocument.characterSet();
if (client->hasSourceAttribute()) {
FetchRequest::DeferOption defer = FetchRequest::NoDefer;
@@ -260,7 +261,7 @@ bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition,
if (m_documentWriteIntervention ==
DocumentWriteIntervention::FetchDocWrittenScriptDeferIdle)
defer = FetchRequest::IdleLoad;
- if (!fetchScript(client->sourceAttributeValue(), defer))
+ if (!fetchScript(client->sourceAttributeValue(), encoding, defer))
return false;
}
@@ -327,6 +328,7 @@ bool ScriptLoader::prepareScript(const TextPosition& scriptStartPosition,
}
bool ScriptLoader::fetchScript(const String& sourceUrl,
+ const String& encoding,
FetchRequest::DeferOption defer) {
DCHECK(m_element);
@@ -345,7 +347,7 @@ bool ScriptLoader::fetchScript(const String& sourceUrl,
if (crossOrigin != CrossOriginAttributeNotSet)
request.setCrossOriginAccessControl(elementDocument->getSecurityOrigin(),
crossOrigin);
- request.setCharset(scriptCharset());
+ request.setCharset(encoding);
if (ContentSecurityPolicy::isNonceableElement(m_element.get()))
request.setContentSecurityPolicyNonce(client()->nonce());
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698