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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2648753002: Revert of Inline Document::allowExecutingScripts logic (Closed)
Patch Set: Created 3 years, 11 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 | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index d9699ddccb9a3ac229208db5f5a443bd3dcfef35..e72fec6902ea51c77bbaf39b96c48bcaa5cc8bf3 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5558,6 +5558,20 @@
return true;
}
+bool Document::allowExecutingScripts(Node* node) {
+ // FIXME: Eventually we'd like to evaluate scripts which are inserted into a
+ // viewless document but this'll do for now.
+ // See http://bugs.webkit.org/show_bug.cgi?id=5727
+ LocalFrame* frame = executingFrame();
+ if (!frame)
+ return false;
+ if (!node->document().executingFrame())
+ return false;
+ if (!frame->script().canExecuteScripts(AboutToExecuteScript))
+ return false;
+ return true;
+}
+
void Document::enforceSandboxFlags(SandboxFlags mask) {
RefPtr<SecurityOrigin> standInOrigin = getSecurityOrigin();
applySandboxFlags(mask);
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698