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

Unified Diff: Source/bindings/core/v8/V8DOMWrapper.cpp

Issue 1323453005: Modifies V8WrapperInstantiationScope::SecurityCheck to only call BindingSecurity::shouldAllowAccess… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed haraken@'s comments. Created 5 years, 3 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/core/v8/V8DOMWrapper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3bcdcd1e4d58fce06cfd32b4a9a248131424000c 100644
--- a/Source/bindings/core/v8/V8DOMWrapper.cpp
+++ b/Source/bindings/core/v8/V8DOMWrapper.cpp
@@ -130,13 +130,19 @@ bool V8DOMWrapper::hasInternalFieldsSet(v8::Local<v8::Value> value)
&& untrustedWrapperTypeInfo->ginEmbedder == gin::kEmbedderBlink;
}
-void V8WrapperInstantiationScope::SecurityCheck(v8::Isolate* isolate, v8::Local<v8::Context> contextForWrapper)
+void V8WrapperInstantiationScope::securityCheck(v8::Isolate* isolate, v8::Local<v8::Context> contextForWrapper)
{
- if (!m_context.IsEmpty()) {
- // 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 (m_context.IsEmpty())
+ return;
+ // If the context is different, we need to make sure that the current
+ // context has access to the creation context.
+ Frame* frame = toFrameIfNotDetached(contextForWrapper);
+ if (!frame)
+ return;
+ const DOMWrapperWorld& currentWorld = DOMWrapperWorld::world(m_context);
+ RELEASE_ASSERT(currentWorld.worldId() == DOMWrapperWorld::world(contextForWrapper).worldId());
+ if (currentWorld.isMainWorld()) {
+ RELEASE_ASSERT(BindingSecurity::shouldAllowAccessToFrame(isolate, frame, DoNotReportSecurityError));
}
}
« no previous file with comments | « Source/bindings/core/v8/V8DOMWrapper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698