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

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

Issue 1085973003: Make error messages for cross-domain access OOPIF-friendly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | Source/core/frame/DOMWindow.h » ('j') | Source/core/frame/DOMWindow.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
}
« no previous file with comments | « no previous file | Source/core/frame/DOMWindow.h » ('j') | Source/core/frame/DOMWindow.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698