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

Unified Diff: chrome/browser/ssl/ssl_policy.cc

Issue 48038: SSL Fix: Step 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/ssl/ssl_policy.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_policy.cc
===================================================================
--- chrome/browser/ssl/ssl_policy.cc (revision 11701)
+++ chrome/browser/ssl/ssl_policy.cc (working copy)
@@ -442,6 +442,24 @@
return SECURITY_STYLE_UNAUTHENTICATED;
}
+// static
+bool SSLPolicy::IsMixedContent(const GURL& url,
+ ResourceType::Type resource_type,
+ const std::string& main_frame_origin) {
+ ////////////////////////////////////////////////////////////////////////////
+ // WARNING: This function is called from both the IO and UI threads. Do //
+ // not touch any non-thread-safe objects! You have been warned. //
+ ////////////////////////////////////////////////////////////////////////////
+
+ // We can't possibly have mixed content when loading the main frame.
+ if (resource_type == ResourceType::MAIN_FRAME)
+ return false;
+
+ // TODO(abarth): This is wrong, but it matches our current behavior.
+ // I'll fix this in a subsequent step.
+ return GURL(main_frame_origin).SchemeIsSecure() && !url.SchemeIsSecure();
+}
+
SSLErrorInfo SSLPolicy::GetSSLErrorInfo(SSLManager::CertError* error) {
return SSLErrorInfo::CreateError(
SSLErrorInfo::NetErrorToErrorType(error->cert_error()),
« no previous file with comments | « chrome/browser/ssl/ssl_policy.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698