summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl/ssl_policy.cc
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 09:18:06 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 09:18:06 +0000
commitc46b0e667387bb42a18be86e8b1f85e968902953 (patch)
tree801ddb204b400e25ecd3fe1211584e5b5519e93e /chrome/browser/ssl/ssl_policy.cc
parentffc45869f044885b81265e6a67cb0220758113b5 (diff)
downloadchromium_src-c46b0e667387bb42a18be86e8b1f85e968902953.zip
chromium_src-c46b0e667387bb42a18be86e8b1f85e968902953.tar.gz
chromium_src-c46b0e667387bb42a18be86e8b1f85e968902953.tar.bz2
SSLPolicy Fix: Step 3.
Plumbing the security origin of the frame making the request to SSL land. R=wtc BUG=8706 Review URL: http://codereview.chromium.org/48038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl/ssl_policy.cc')
-rw-r--r--chrome/browser/ssl/ssl_policy.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc
index 1748639..6e627fb 100644
--- a/chrome/browser/ssl/ssl_policy.cc
+++ b/chrome/browser/ssl/ssl_policy.cc
@@ -442,6 +442,24 @@ SecurityStyle SSLPolicy::GetDefaultStyle(const GURL& url) {
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()),