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

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

Issue 2296953004: Send certificates to devtools when it's open instead of using certId (Closed)
Patch Set: self review Created 4 years, 3 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 | « content/browser/ssl/ssl_policy.h ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/ssl/ssl_policy.cc
diff --git a/content/browser/ssl/ssl_policy.cc b/content/browser/ssl/ssl_policy.cc
index f94d0c6963d9034ff4dbc2f26c5f8dc7e72cf906..9f2acd4595d8365e317cca193e066fbddc126f6c 100644
--- a/content/browser/ssl/ssl_policy.cc
+++ b/content/browser/ssl/ssl_policy.cc
@@ -17,6 +17,7 @@
#include "content/browser/site_instance_impl.h"
#include "content/browser/ssl/ssl_error_handler.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/common/security_style_util.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/resource_type.h"
@@ -232,27 +233,6 @@ void SSLPolicy::UpdateEntry(NavigationEntryImpl* entry,
}
}
-// Static
-SecurityStyle SSLPolicy::GetSecurityStyleForResource(
- const GURL& url,
- int cert_id,
- net::CertStatus cert_status) {
- // An HTTPS response may not have a certificate for some reason. When that
- // happens, use the unauthenticated (HTTP) rather than the authentication
- // broken security style so that we can detect this error condition.
- if (!url.SchemeIsCryptographic() || !cert_id)
- return SECURITY_STYLE_UNAUTHENTICATED;
-
- // Minor errors don't lower the security style to
- // SECURITY_STYLE_AUTHENTICATION_BROKEN.
- if (net::IsCertStatusError(cert_status) &&
- !net::IsCertStatusMinorError(cert_status)) {
- return SECURITY_STYLE_AUTHENTICATION_BROKEN;
- }
-
- return SECURITY_STYLE_AUTHENTICATED;
-}
-
////////////////////////////////////////////////////////////////////////////////
// Certificate Error Routines
@@ -279,7 +259,7 @@ void SSLPolicy::InitializeEntryIfNeeded(NavigationEntryImpl* entry) {
return;
entry->GetSSL().security_style = GetSecurityStyleForResource(
- entry->GetURL(), entry->GetSSL().cert_id, entry->GetSSL().cert_status);
+ entry->GetURL(), !!entry->GetSSL().cert_id, entry->GetSSL().cert_status);
}
} // namespace content
« no previous file with comments | « content/browser/ssl/ssl_policy.h ('k') | content/child/web_url_loader_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698