Index: content/public/browser/ssl_host_state.h |
diff --git a/content/public/browser/ssl_host_state.h b/content/public/browser/ssl_host_state.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9367e5ea3b7da313da40d7111c5f2b6edd8d28a7 |
--- /dev/null |
+++ b/content/public/browser/ssl_host_state.h |
@@ -0,0 +1,59 @@ |
+// Copyright (c) 2012 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. |
+ |
+#ifndef CONTENT_PUBLIC_BROWSER_SSL_SSL_HOST_STATE_H_ |
+#define CONTENT_PUBLIC_BROWSER_SSL_SSL_HOST_STATE_H_ |
+ |
+#include <map> |
+#include <set> |
+#include <string> |
+ |
+#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
+#include "base/supports_user_data.h" |
+#include "base/threading/non_thread_safe.h" |
+#include "content/common/content_export.h" |
+#include "net/cert/cert_status_flags.h" |
+#include "net/cert/x509_certificate.h" |
+ |
+namespace content { |
+class BrowserContext; |
+class SSLHostStateDelegate; |
+ |
+// SSLHostState |
+// |
+// The SSLHostState encapulates the host-specific state for SSL errors. For |
+// example, SSLHostState remembers whether the user has whitelisted a |
+// particular broken cert for use with particular host. We separate this state |
+// from the SSLManager because this state is shared across many navigation |
+// controllers. |
+class CONTENT_EXPORT SSLHostState |
+ : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
+ public: |
+ SSLHostState(BrowserContext*); |
+ virtual ~SSLHostState() {} |
+ |
+ // Revoke all allow/deny preferences for a given host. The |
+ // RevokeAllowAndDenyPreferencesHard version may close idle connections in the |
+ // process. This version should be used *only* for rare events, such as a user |
+ // controlled button, as it may be very disruptive to the networking stack. |
+ virtual void RevokeAllowAndDenyPreferences(const std::string& host); |
+ virtual void RevokeAllowAndDenyPreferencesHard(const std::string& host); |
+ |
+ virtual bool HasAllowedOrDeniedCert(const std::string& host); |
+ |
+ void set_delegate(SSLHostStateDelegate* delegate) { delegate_ = delegate; } |
+ |
+ protected: |
+ // BrowserContext that the state was created on. |
+ BrowserContext* browser_context_; |
+ |
+ // The certificate decision store. It may be NULL, depending on the browsing |
+ // context. This is owned by the browsing context. |
+ SSLHostStateDelegate* delegate_; |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_BROWSER_SSL_SSL_HOST_STATE_H_ |