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

Unified Diff: third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp

Issue 1723753002: Make Document::isSecureContext() work for OOPIFs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more rebase fixups Created 4 years, 9 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
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

Powered by Google App Engine
This is Rietveld 408576698