Index: Source/bindings/core/v8/BindingSecurity.cpp |
diff --git a/Source/bindings/core/v8/BindingSecurity.cpp b/Source/bindings/core/v8/BindingSecurity.cpp |
index 61c8742b83008cd4bedacf1fd2bc8b86848c9d37..97fee48e07625f2f33c875c5844f3bda600f93ee 100644 |
--- a/Source/bindings/core/v8/BindingSecurity.cpp |
+++ b/Source/bindings/core/v8/BindingSecurity.cpp |
@@ -85,13 +85,21 @@ bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* targ |
{ |
if (!target || !target->isLocalFrame()) |
return false; |
+ |
return canAccessDocument(isolate, toLocalFrame(target)->document(), reportingOption); |
} |
bool BindingSecurity::shouldAllowAccessToFrame(v8::Isolate* isolate, Frame* target, ExceptionState& exceptionState) |
{ |
- if (!target || !target->isLocalFrame()) |
+ if (!target) |
+ return false; |
+ |
+ if (target->isRemoteFrame() && target->domWindow()) { |
+ LocalDOMWindow* callingWindow = callingDOMWindow(isolate); |
+ exceptionState.throwSecurityError(target->domWindow()->sanitizedCrossDomainAccessErrorMessage(callingWindow), target->domWindow()->crossDomainAccessErrorMessage(callingWindow)); |
return false; |
+ } |
+ |
return canAccessDocument(isolate, toLocalFrame(target)->document(), exceptionState); |
alexmos
2015/04/15 17:15:17
It seems like I can also go further and turn canAc
dcheng
2015/04/15 21:03:49
Yes, let's try to simplify this.
|
} |