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

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

Issue 1504403003: Calling isSecureContext() with no arguments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small refactoring to isSecureContext() calls Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4d75bab3529a61a2a191458c4ae88b59fa55fdeb..72295e0e04ed30e5abfd75fac167771b574dc569 100644
--- a/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
+++ b/third_party/WebKit/Source/platform/weborigin/SecurityOrigin.cpp
@@ -356,6 +356,15 @@ bool SecurityOrigin::canDisplay(const KURL& url) const
bool SecurityOrigin::isPotentiallyTrustworthy(String& errorMessage) const
{
+ if (isPotentiallyTrustworthy())
+ return true;
+
+ errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).";
+ return false;
+}
+
+bool SecurityOrigin::isPotentiallyTrustworthy() const
+{
ASSERT(m_protocol != "data");
if (SchemeRegistry::shouldTreatURLSchemeAsSecure(m_protocol) || isLocal() || isLocalhost())
return true;
@@ -363,7 +372,6 @@ bool SecurityOrigin::isPotentiallyTrustworthy(String& errorMessage) const
if (SecurityPolicy::isOriginWhiteListedTrustworthy(*this))
return true;
- errorMessage = "Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).";
return false;
}
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SecurityOrigin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698