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

Unified Diff: Source/core/xml/parser/XMLDocumentParser.cpp

Issue 1010433007: Fire error event when script integrity check fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated comment Created 5 years, 9 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 | « Source/core/html/parser/HTMLScriptRunner.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/xml/parser/XMLDocumentParser.cpp
diff --git a/Source/core/xml/parser/XMLDocumentParser.cpp b/Source/core/xml/parser/XMLDocumentParser.cpp
index d8cd0701528c0a3c6162356a99f533c688297795..896bdb3dd579436391acca08476b9b0c8e771c87 100644
--- a/Source/core/xml/parser/XMLDocumentParser.cpp
+++ b/Source/core/xml/parser/XMLDocumentParser.cpp
@@ -485,8 +485,10 @@ void XMLDocumentParser::notifyFinished(Resource* unusedResource)
if (errorOccurred) {
scriptLoader->dispatchErrorEvent();
} else if (!wasCanceled) {
- scriptLoader->executeScript(sourceCode);
- scriptLoader->dispatchLoadEvent();
+ if (!scriptLoader->executeScript(sourceCode))
+ scriptLoader->dispatchErrorEvent();
+ else
+ scriptLoader->dispatchLoadEvent();
}
m_scriptElement = nullptr;
@@ -1102,13 +1104,16 @@ void XMLDocumentParser::endElementNs()
// FIXME: Script execution should be shared between
// the libxml2 and Qt XMLDocumentParser implementations.
+
if (scriptLoader->readyToBeParserExecuted()) {
- scriptLoader->executeScript(ScriptSourceCode(scriptLoader->scriptContent(), document()->url(), m_scriptStartPosition));
+ if (!scriptLoader->executeScript(ScriptSourceCode(scriptLoader->scriptContent(), document()->url(), m_scriptStartPosition))) {
+ scriptLoader->dispatchErrorEvent();
+ return;
+ }
} else if (scriptLoader->willBeParserExecuted()) {
m_pendingScript = scriptLoader->resource();
m_scriptElement = element;
m_pendingScript->addClient(this);
-
// m_pendingScript will be 0 if script was already loaded and
// addClient() executed it.
if (m_pendingScript)
« no previous file with comments | « Source/core/html/parser/HTMLScriptRunner.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698