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

Unified Diff: Source/core/dom/ScriptLoader.h

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 7 years, 1 month 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/css/resolver/StyleResourceLoader.cpp ('k') | Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptLoader.h
diff --git a/Source/core/dom/ScriptLoader.h b/Source/core/dom/ScriptLoader.h
index e6ba8d3b080a8381caf99d256b575fdc4c62a3a3..72f51972005175c266f869254168c96496c1aff6 100644
--- a/Source/core/dom/ScriptLoader.h
+++ b/Source/core/dom/ScriptLoader.h
@@ -50,6 +50,12 @@ public:
void executeScript(const ScriptSourceCode&);
void execute(ScriptResource*);
+ // Check if potentially cross-origin enabled script is accessible
+ // prior to execution. Returns 'false' if not accessible, signalling
+ // that callers must not dispatch load events as the cross-origin
+ // fetch failed.
+ bool executePotentiallyCrossOriginScript(const ScriptSourceCode&);
+
// XML parser calls these
void dispatchLoadEvent();
void dispatchErrorEvent();
@@ -65,6 +71,7 @@ public:
bool isParserInserted() const { return m_parserInserted; }
bool alreadyStarted() const { return m_alreadyStarted; }
bool forceAsync() const { return m_forceAsync; }
+ bool isPotentiallyCORSEnabled() const { return m_isPotentiallyCORSEnabled; }
// Helper functions used by our parent classes.
void didNotifySubtreeInsertionsToDocument();
@@ -98,6 +105,7 @@ private:
bool m_willExecuteWhenDocumentFinishedParsing : 1;
bool m_forceAsync : 1;
bool m_willExecuteInOrder : 1;
+ bool m_isPotentiallyCORSEnabled : 1;
String m_characterEncoding;
String m_fallbackCharacterEncoding;
};
« no previous file with comments | « Source/core/css/resolver/StyleResourceLoader.cpp ('k') | Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698