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

Side by Side Diff: Source/core/dom/ScriptElement.cpp

Issue 13575004: Apply script preprocessor to Web page scripts only. (Closed) Base URL: https://chromium.googlesource.com/external/WebKit_trimmed.git@master
Patch Set: Re-implment based on review Created 7 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org> 6 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "R efused to execute script from '" + m_cachedScript->url().elidedString() + "' bec ause its MIME type ('" + m_cachedScript->mimeType() + "') is not executable, and strict MIME type checking is enabled."); 303 document->addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "R efused to execute script from '" + m_cachedScript->url().elidedString() + "' bec ause its MIME type ('" + m_cachedScript->mimeType() + "') is not executable, and strict MIME type checking is enabled.");
304 return; 304 return;
305 } 305 }
306 306
307 if (frame) { 307 if (frame) {
308 { 308 {
309 IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountI ncrementer(m_isExternalScript ? document.get() : 0); 309 IgnoreDestructiveWriteCountIncrementer ignoreDesctructiveWriteCountI ncrementer(m_isExternalScript ? document.get() : 0);
310 // Create a script from the script element node, using the script 310 // Create a script from the script element node, using the script
311 // block's source and the script block's type. 311 // block's source and the script block's type.
312 // Note: This is where the script is compiled and actually executed. 312 // Note: This is where the script is compiled and actually executed.
313 frame->script()->evaluate(sourceCode); 313 frame->script()->evaluateFromWebPage(sourceCode);
pfeldman 2013/05/29 15:03:52 Do we know of entry points other than script and D
314 } 314 }
315 } 315 }
316 } 316 }
317 317
318 void ScriptElement::stopLoadRequest() 318 void ScriptElement::stopLoadRequest()
319 { 319 {
320 if (m_cachedScript) { 320 if (m_cachedScript) {
321 if (!m_willBeParserExecuted) 321 if (!m_willBeParserExecuted)
322 m_cachedScript->removeClient(this); 322 m_cachedScript->removeClient(this);
323 m_cachedScript = 0; 323 m_cachedScript = 0;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 422
423 #if ENABLE(SVG) 423 #if ENABLE(SVG)
424 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag)) 424 if (element->isSVGElement() && element->hasTagName(SVGNames::scriptTag))
425 return static_cast<SVGScriptElement*>(element); 425 return static_cast<SVGScriptElement*>(element);
426 #endif 426 #endif
427 427
428 return 0; 428 return 0;
429 } 429 }
430 430
431 } 431 }
OLDNEW
« Source/bindings/v8/ScriptController.h ('K') | « Source/bindings/v8/V8PerContextDebugData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698