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

Side by Side Diff: Source/core/html/parser/HTMLScriptRunner.cpp

Issue 47923008: Block execution of failed 'crossorigin' <script>s. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Minimize code changes + remove redundant leftovers. 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 // Clear the pending script before possible rentrancy from executeScript() 131 // Clear the pending script before possible rentrancy from executeScript()
132 RefPtr<Element> element = pendingScript.releaseElementAndClear(); 132 RefPtr<Element> element = pendingScript.releaseElementAndClear();
133 if (ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element.get())) { 133 if (ScriptLoader* scriptLoader = toScriptLoaderIfPossible(element.get())) {
134 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel); 134 NestingLevelIncrementer nestingLevelIncrementer(m_scriptNestingLevel);
135 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrem enter(m_document); 135 IgnoreDestructiveWriteCountIncrementer ignoreDestructiveWriteCountIncrem enter(m_document);
136 if (errorOccurred) 136 if (errorOccurred)
137 scriptLoader->dispatchErrorEvent(); 137 scriptLoader->dispatchErrorEvent();
138 else { 138 else {
139 ASSERT(isExecutingScript()); 139 ASSERT(isExecutingScript());
140 scriptLoader->executeScript(sourceCode); 140 if (scriptLoader->executePotentiallyCrossOriginScript(sourceCode))
abarth-chromium 2013/11/14 16:34:48 I see, the return value is used here. I'm surpris
141 element->dispatchEvent(createScriptLoadEvent()); 141 element->dispatchEvent(createScriptLoadEvent());
142 } 142 }
143 } 143 }
144 ASSERT(!isExecutingScript()); 144 ASSERT(!isExecutingScript());
145 } 145 }
146 146
147 void HTMLScriptRunner::watchForLoad(PendingScript& pendingScript) 147 void HTMLScriptRunner::watchForLoad(PendingScript& pendingScript)
148 { 148 {
149 ASSERT(!pendingScript.watchingForLoad()); 149 ASSERT(!pendingScript.watchingForLoad());
150 m_host->watchForLoad(pendingScript.resource()); 150 m_host->watchForLoad(pendingScript.resource());
151 pendingScript.setWatchingForLoad(true); 151 pendingScript.setWatchingForLoad(true);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 ScriptSourceCode sourceCode(script->textContent(), documentURLFo rScriptExecution(m_document), scriptStartPosition); 310 ScriptSourceCode sourceCode(script->textContent(), documentURLFo rScriptExecution(m_document), scriptStartPosition);
311 scriptLoader->executeScript(sourceCode); 311 scriptLoader->executeScript(sourceCode);
312 } 312 }
313 } else { 313 } else {
314 requestParsingBlockingScript(script); 314 requestParsingBlockingScript(script);
315 } 315 }
316 } 316 }
317 } 317 }
318 318
319 } 319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698