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 61fffb76c38d0e9c1df10853f420fd77231001a6..4cac0e825fdbd4f39a88dc43cdf19c1eaa386416 100644 |
--- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp |
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp |
@@ -126,6 +126,7 @@ SecurityOrigin::SecurityOrigin(const KURL& url) |
, m_universalAccess(false) |
, m_domainWasSetInDOM(false) |
, m_blockLocalAccessFromLocalOrigin(false) |
+ , m_isUniqueOriginPotentiallyTrustworthy(false) |
{ |
// Suborigins are serialized into the host, so extract it if necessary. |
String suboriginName; |
@@ -154,6 +155,7 @@ SecurityOrigin::SecurityOrigin() |
, m_domainWasSetInDOM(false) |
, m_canLoadLocalResources(false) |
, m_blockLocalAccessFromLocalOrigin(false) |
+ , m_isUniqueOriginPotentiallyTrustworthy(false) |
{ |
} |
@@ -169,6 +171,7 @@ SecurityOrigin::SecurityOrigin(const SecurityOrigin* other) |
, m_domainWasSetInDOM(other->m_domainWasSetInDOM) |
, m_canLoadLocalResources(other->m_canLoadLocalResources) |
, m_blockLocalAccessFromLocalOrigin(other->m_blockLocalAccessFromLocalOrigin) |
+ , m_isUniqueOriginPotentiallyTrustworthy(other->m_isUniqueOriginPotentiallyTrustworthy) |
{ |
} |
@@ -356,6 +359,9 @@ bool SecurityOrigin::canDisplay(const KURL& url) const |
bool SecurityOrigin::isPotentiallyTrustworthy() const |
{ |
ASSERT(m_protocol != "data"); |
+ if (isUnique()) |
+ return m_isUniqueOriginPotentiallyTrustworthy; |
+ |
if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost()) |
return true; |
@@ -551,4 +557,10 @@ void SecurityOrigin::transferPrivilegesFrom(PassOwnPtr<PrivilegeData> privilegeD |
m_blockLocalAccessFromLocalOrigin = privilegeData->m_blockLocalAccessFromLocalOrigin; |
} |
+void SecurityOrigin::setUniqueOriginIsPotentiallyTrustworthy(bool isUniqueOriginPotentiallyTrustworthy) |
+{ |
+ ASSERT(!isUniqueOriginPotentiallyTrustworthy || isUnique()); |
+ m_isUniqueOriginPotentiallyTrustworthy = isUniqueOriginPotentiallyTrustworthy; |
+} |
+ |
} // namespace blink |