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

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

Issue 20296: Remember that we've white listed a certificate when we switch to a new tab.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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: chrome/browser/ssl/ssl_host_state.cc
===================================================================
--- chrome/browser/ssl/ssl_host_state.cc (revision 0)
+++ chrome/browser/ssl/ssl_host_state.cc (revision 0)
@@ -0,0 +1,47 @@
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ssl/ssl_host_state.h"
+
+SSLHostState::SSLHostState() {
+}
+
+SSLHostState::~SSLHostState() {
+}
+
+void SSLHostState::DenyCertForHost(net::X509Certificate* cert,
+ const std::string& host) {
+ DCHECK(CalledOnValidThread());
+
+ // Remember that we don't like this cert for this host.
+ cert_policy_for_host_[host].Deny(cert);
+}
+
+void SSLHostState::AllowCertForHost(net::X509Certificate* cert,
+ const std::string& host) {
+ DCHECK(CalledOnValidThread());
+
+ // Remember that we do like this cert for this host.
+ cert_policy_for_host_[host].Allow(cert);
+}
+
+net::X509Certificate::Policy::Judgment SSLHostState::QueryPolicy(
+ net::X509Certificate* cert, const std::string& host) {
+ DCHECK(CalledOnValidThread());
+
+ return cert_policy_for_host_[host].Check(cert);
+}
+
+bool SSLHostState::CanShowInsecureContent(const GURL& url) {
+ DCHECK(CalledOnValidThread());
+
+ return (can_show_insecure_content_for_host_.find(url.host()) !=
+ can_show_insecure_content_for_host_.end());
+}
+
+void SSLHostState::AllowShowInsecureContentForURL(const GURL& url) {
+ DCHECK(CalledOnValidThread());
+
+ can_show_insecure_content_for_host_.insert(url.host());
+}
Property changes on: chrome\browser\ssl\ssl_host_state.cc
___________________________________________________________________
Added: svn:executable
+ *

Powered by Google App Engine
This is Rietveld 408576698