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

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

Issue 299253003: [webcrypto] Only allow crypto.subtle.* to be used from "secure origins". (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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: Source/platform/weborigin/SecurityOrigin.cpp
diff --git a/Source/platform/weborigin/SecurityOrigin.cpp b/Source/platform/weborigin/SecurityOrigin.cpp
index 652560af325dcf8ba1f0ae4a4f97b609654b7ef5..2dbee60a5f0ca3b1ae9f6e720e5d1d11a9246370 100644
--- a/Source/platform/weborigin/SecurityOrigin.cpp
+++ b/Source/platform/weborigin/SecurityOrigin.cpp
@@ -375,6 +375,21 @@ bool SecurityOrigin::canDisplay(const KURL& url) const
return true;
}
+bool SecurityOrigin::canAccessFeatureRequiringSecureOrigin() const
+{
+ if (isLocal())
+ return true;
+
+ if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol))
+ return true;
+
+ // FIXME: According to http://www.chromium.org/Home/chromium-security/security-faq#TOC-Which-origins-are-secure- should match all of 127/8 and ::1/8
palmer 2014/05/24 01:44:30 Should be ::1/128. Also provide a reference to htt
+ if (m_protocol != "" && !m_domainWasSetInDOM && (m_domain == "localhost" || m_domain == "127.0.0.1" || m_domain == "[::1]"))
+ return true;
+
+ return false;
+}
+
SecurityOrigin::Policy SecurityOrigin::canShowNotifications() const
{
if (m_universalAccess)

Powered by Google App Engine
This is Rietveld 408576698