Index: Source/bindings/core/v8/V8DOMWrapper.cpp |
diff --git a/Source/bindings/core/v8/V8DOMWrapper.cpp b/Source/bindings/core/v8/V8DOMWrapper.cpp |
index feedad6cec93ab07a5f39de2a73c13c5aae1168b..e4a7fa6ca27d1d62e4617e82e5f55bc93bba792e 100644 |
--- a/Source/bindings/core/v8/V8DOMWrapper.cpp |
+++ b/Source/bindings/core/v8/V8DOMWrapper.cpp |
@@ -136,7 +136,13 @@ void V8WrapperInstantiationScope::SecurityCheck(v8::Isolate* isolate, v8::Local< |
// If the context is different, we need to make sure that the current |
// context has access to the creation context. |
Frame* frame = toFrameIfNotDetached(contextForWrapper); |
- RELEASE_ASSERT(!frame || BindingSecurity::shouldAllowAccessToFrame(isolate, frame, DoNotReportSecurityError)); |
+ if (!frame) |
+ return; |
+ const DOMWrapperWorld& currentWorld = DOMWrapperWorld::world(m_context); |
+ RELEASE_ASSERT(currentWorld.worldId() == DOMWrapperWorld::world(contextForWrapper).worldId()); |
haraken
2015/09/09 15:41:42
Does this need to be RELEASE_ASSERT?
epertoso
2015/09/09 15:52:11
I think it's a valid assumption.
|
+ if (currentWorld.isMainWorld()) { |
+ RELEASE_ASSERT(BindingSecurity::shouldAllowAccessToFrame(isolate, frame, DoNotReportSecurityError)); |
+ } |
} |
} |