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

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

Issue 19596004: Allow sites to enable 'window.onerror' handlers for cross-domain scripts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 4 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/dom/ScriptExecutionContext.cpp ('k') | Source/core/loader/CrossOriginAccessControl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ScriptLoader.cpp
diff --git a/Source/core/dom/ScriptLoader.cpp b/Source/core/dom/ScriptLoader.cpp
index e9189835e5afef00793d27bb6ea105529484d582..4cf45bb77a6198f86a7aba742445d9c9b8f38612 100644
--- a/Source/core/dom/ScriptLoader.cpp
+++ b/Source/core/dom/ScriptLoader.cpp
@@ -335,10 +335,14 @@ void ScriptLoader::executeScript(const ScriptSourceCode& sourceCode)
if (isHTMLScriptLoader(m_element))
executingDocument->pushCurrentScript(toHTMLScriptElement(m_element));
+ AccessControlStatus corsCheck = NotSharableCrossOrigin;
+ if (sourceCode.cachedScript() && sourceCode.cachedScript()->passesAccessControlCheck(m_element->document()->securityOrigin()))
+ corsCheck = SharableCrossOrigin;
+
// Create a script from the script element node, using the script
// block's source and the script block's type.
// Note: This is where the script is compiled and actually executed.
- frame->script()->executeScriptInMainWorld(sourceCode);
+ frame->script()->executeScriptInMainWorld(sourceCode, corsCheck);
if (isHTMLScriptLoader(m_element)) {
ASSERT(executingDocument->currentScript() == m_element);
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.cpp ('k') | Source/core/loader/CrossOriginAccessControl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698