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

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

Issue 2668753006: Special-case LocalDOMWindow for same-origin access in bindings. (Closed)
Patch Set: Rebase and address comments. Created 3 years, 10 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 | third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
index 6b679a57f3e3e10725c1cea619cb7e9b917c8fd5..516ef4dff5498d95b703de67ff7f23e7350fcaca 100644
--- a/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/BindingSecurity.cpp
@@ -216,10 +216,12 @@ bool BindingSecurity::shouldAllowAccessToDetachedWindow(
CHECK(target && !target->frame())
<< "This version of shouldAllowAccessToFrame() must be used only for "
<< "detached windows.";
- if (!target->document())
+ if (!target->isLocalDOMWindow())
return false;
- return canAccessFrame(accessingWindow,
- target->document()->getSecurityOrigin(), target,
+ Document* document = toLocalDOMWindow(target)->document();
+ if (!document)
+ return false;
+ return canAccessFrame(accessingWindow, document->getSecurityOrigin(), target,
exceptionState);
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698