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

Unified Diff: Source/core/frame/DOMWindow.cpp

Issue 1180923003: Add window access checks for Suborigins (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix tests on Windows Created 5 years, 6 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/core/dom/ExecutionContext.cpp ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/DOMWindow.cpp
diff --git a/Source/core/frame/DOMWindow.cpp b/Source/core/frame/DOMWindow.cpp
index e37b3401677ba447e87e551ccb4595e5e5ddb34b..ee9a4a4773ae5fcf5ea58c659767e6c503d1814a 100644
--- a/Source/core/frame/DOMWindow.cpp
+++ b/Source/core/frame/DOMWindow.cpp
@@ -131,7 +131,7 @@ bool DOMWindow::isInsecureScriptAccess(LocalDOMWindow& callingWindow, const Stri
// FIXME: The name canAccess seems to be a roundabout way to ask "can execute script".
// Can we name the SecurityOrigin function better to make this more clear?
- if (callingWindow.frame()->securityContext()->securityOrigin()->canAccess(frame()->securityContext()->securityOrigin()))
+ if (callingWindow.frame()->securityContext()->securityOrigin()->canAccessCheckSuborigins(frame()->securityContext()->securityOrigin()))
return false;
}
@@ -220,7 +220,7 @@ String DOMWindow::sanitizedCrossDomainAccessErrorMessage(LocalDOMWindow* calling
if (callingWindowURL.isNull())
return String();
- ASSERT(!callingWindow->document()->securityOrigin()->canAccess(frame()->securityContext()->securityOrigin()));
+ ASSERT(!callingWindow->document()->securityOrigin()->canAccessCheckSuborigins(frame()->securityContext()->securityOrigin()));
SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin();
String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a cross-origin frame.";
@@ -242,7 +242,7 @@ String DOMWindow::crossDomainAccessErrorMessage(LocalDOMWindow* callingWindow)
// FIXME: This message, and other console messages, have extra newlines. Should remove them.
SecurityOrigin* activeOrigin = callingWindow->document()->securityOrigin();
SecurityOrigin* targetOrigin = frame()->securityContext()->securityOrigin();
- ASSERT(!activeOrigin->canAccess(targetOrigin));
+ ASSERT(!activeOrigin->canAccessCheckSuborigins(targetOrigin));
String message = "Blocked a frame with origin \"" + activeOrigin->toString() + "\" from accessing a frame with origin \"" + targetOrigin->toString() + "\". ";
« no previous file with comments | « Source/core/dom/ExecutionContext.cpp ('k') | Source/core/frame/LocalDOMWindow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698