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

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: fix WebRemoteFrameImpl assert 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..8d0f87c73e2a38c6e99c8a4664af75874b6b1232 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,10 @@ 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;

Powered by Google App Engine
This is Rietveld 408576698