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

Unified Diff: Source/bindings/v8/ScriptController.cpp

Issue 182903003: Make DOMWrapperWorld::current() callable from workers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/ScriptController.cpp
diff --git a/Source/bindings/v8/ScriptController.cpp b/Source/bindings/v8/ScriptController.cpp
index b171af01ab9f857cfa5538ca106baf9544d207c9..7b61e887409778bb1643107872fb572c14add20c 100644
--- a/Source/bindings/v8/ScriptController.cpp
+++ b/Source/bindings/v8/ScriptController.cpp
@@ -262,10 +262,11 @@ V8WindowShell* ScriptController::windowShell(DOMWrapperWorld* world)
bool ScriptController::shouldBypassMainWorldContentSecurityPolicy()
{
+ v8::Handle<v8::Context> context = m_isolate->GetCurrentContext();
+ if (context.IsEmpty() || !toDOMWindow(context))
+ return false;
DOMWrapperWorld* world = DOMWrapperWorld::current(m_isolate);
- if (world && world->isIsolatedWorld())
- return world->isolatedWorldHasContentSecurityPolicy();
- return false;
+ return world->isIsolatedWorld() ? world->isolatedWorldHasContentSecurityPolicy() : false;
}
TextPosition ScriptController::eventHandlerPosition() const
« no previous file with comments | « Source/bindings/v8/PageScriptDebugServer.cpp ('k') | Source/bindings/v8/V8Binding.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698