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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp

Issue 2571063002: Remove Blink-in-JS (Closed)
Patch Set: Created 4 years 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
Index: third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
index d6d58c058eb92b026696323618b1204c090df3ac..f6d5d7586ecf06a6c36dad021dd0f9129e5f4b9e 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptController.cpp
@@ -267,20 +267,10 @@ void ScriptController::namedItemRemoved(HTMLDocument* doc,
windowProxy(DOMWrapperWorld::mainWorld())->namedItemRemoved(doc, name);
}
-static bool isInPrivateScriptIsolateWorld(v8::Isolate* isolate) {
- v8::Local<v8::Context> context = isolate->GetCurrentContext();
- return !context.IsEmpty() && toDOMWindow(context) &&
- DOMWrapperWorld::current(isolate).isPrivateScriptIsolatedWorld();
-}
-
bool ScriptController::canExecuteScripts(
ReasonForCallingCanExecuteScripts reason) {
- // For performance reasons, we check isInPrivateScriptIsolateWorld() only if
- // canExecuteScripts is going to return false.
if (frame()->document() && frame()->document()->isSandboxed(SandboxScripts)) {
- if (isInPrivateScriptIsolateWorld(isolate()))
- return true;
// FIXME: This message should be moved off the console once a solution to
// https://bugs.webkit.org/show_bug.cgi?id=103274 exists.
if (reason == AboutToExecuteScript)
@@ -303,8 +293,7 @@ bool ScriptController::canExecuteScripts(
return false;
Settings* settings = frame()->settings();
const bool allowed =
- client->allowScript(settings && settings->scriptEnabled()) ||
- isInPrivateScriptIsolateWorld(isolate());
+ client->allowScript(settings && settings->scriptEnabled());
if (!allowed && reason == AboutToExecuteScript)
client->didNotAllowScript();
return allowed;

Powered by Google App Engine
This is Rietveld 408576698