Chromium Code Reviews| Index: third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp |
| diff --git a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp |
| index a441e80df2c64cdf136c1d2e41f7130994e55d5a..d67632a171e35f0304e4774704134b64f0a5ca82 100644 |
| --- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp |
| +++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp |
| @@ -366,6 +366,28 @@ bool SecurityOrigin::canDisplay(const KURL& url) const |
| return true; |
| } |
| +bool SecurityOrigin::areSamePageUrls(const KURL& a, const KURL& b) const |
| +{ |
| + if (m_universalAccess) |
| + return true; |
| + |
| + if (isUnique()) |
| + return false; |
| + |
| + if (!equalIgnoringPathQueryAndFragment(a, b)) |
|
brettw
2015/12/08 05:41:32
Personally, I would prefer manually checking schem
robwu
2015/12/08 08:45:17
Checking for scheme/host/port equality is not suff
Mike West
2015/12/08 13:45:19
This is defined somewhat strangely in HTML as "If
robwu
2015/12/08 14:10:39
I presume that you're fine with exposing the value
Mike West
2015/12/08 14:18:41
I would dearly love to murder that property entire
|
| + return false; |
| + |
| + RefPtr<SecurityOrigin> originA = SecurityOrigin::create(a); |
| + if (originA->isUnique() || !isSameSchemeHostPort(originA.get())) |
| + return false; |
| + |
| + RefPtr<SecurityOrigin> originB = SecurityOrigin::create(b); |
| + if (originB->isUnique() || !isSameSchemeHostPort(originB.get())) |
| + return false; |
| + |
| + return true; |
| +} |
| + |
| bool SecurityOrigin::isPotentiallyTrustworthy(String& errorMessage) const |
| { |
| ASSERT(m_protocol != "data"); |