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

Unified Diff: Source/platform/weborigin/SecurityOrigin.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/platform/weborigin/SecurityOrigin.h ('k') | Source/platform/weborigin/SecurityOriginHash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/weborigin/SecurityOrigin.cpp
diff --git a/Source/platform/weborigin/SecurityOrigin.cpp b/Source/platform/weborigin/SecurityOrigin.cpp
index ef2b1b3d4ad2840f1df1bbe6131b2cabb943031b..38614c4c90aa3a4a7dd7510401c56d1aa9a2b7bd 100644
--- a/Source/platform/weborigin/SecurityOrigin.cpp
+++ b/Source/platform/weborigin/SecurityOrigin.cpp
@@ -286,6 +286,17 @@ bool SecurityOrigin::canAccess(const SecurityOrigin* other) const
return canAccess;
}
+bool SecurityOrigin::canAccessCheckSuborigins(const SecurityOrigin* other) const
+{
+ if (hasSuborigin() != other->hasSuborigin())
+ return false;
+
+ if (hasSuborigin() && suboriginName() != other->suboriginName())
+ return false;
+
+ return canAccess(other);
+}
+
bool SecurityOrigin::passesFileCheck(const SecurityOrigin* other) const
{
ASSERT(isLocal() && other->isLocal());
@@ -320,6 +331,11 @@ bool SecurityOrigin::canRequest(const KURL& url) const
return false;
}
+bool SecurityOrigin::canRequestNoSuborigin(const KURL& url) const
+{
+ return !hasSuborigin() && canRequest(url);
+}
+
bool SecurityOrigin::taintsCanvas(const KURL& url) const
{
if (canRequest(url))
@@ -560,6 +576,11 @@ bool SecurityOrigin::isSameSchemeHostPort(const SecurityOrigin* other) const
return true;
}
+bool SecurityOrigin::isSameSchemeHostPortAndSuborigin(const SecurityOrigin* other) const
+{
+ return isSameSchemeHostPort(other) && (!hasSuborigin() || suboriginName() == other->suboriginName());
+}
+
const KURL& SecurityOrigin::urlWithUniqueSecurityOrigin()
{
ASSERT(isMainThread());
« no previous file with comments | « Source/platform/weborigin/SecurityOrigin.h ('k') | Source/platform/weborigin/SecurityOriginHash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698