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

Side by Side Diff: chrome/browser/ssl/ssl_host_state.h

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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:executable
+ *
OLDNEW
(Empty)
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SSL_SSL_HOST_STATE_H_
6 #define CHROME_BROWSER_SSL_SSL_HOST_STATE_H_
7
8 #include <string>
9 #include <map>
10 #include <set>
11
12 #include "base/basictypes.h"
13 #include "base/non_thread_safe.h"
14 #include "googleurl/src/gurl.h"
15 #include "net/base/x509_certificate.h"
16
17 // SSLHostState
18 //
19 // The SSLHostState encapulates the host-specific state for SSL errors. For
20 // example, SSLHostState rememebers whether the user has whitelisted a
21 // particular broken cert for use with particular host. We separate this state
22 // from the SSLManager because this state is shared across many navigation
23 // controllers.
24
25 class SSLHostState : public NonThreadSafe {
26 public:
27 SSLHostState();
28 ~SSLHostState();
29
30 // Records that |cert| is permitted to be used for |host| in the future.
31 void DenyCertForHost(net::X509Certificate* cert, const std::string& host);
32
33 // Records that |cert| is not permitted to be used for |host| in the future.
34 void AllowCertForHost(net::X509Certificate* cert, const std::string& host);
35
36 // Queries whether |cert| is allowed or denied for |host|.
37 net::X509Certificate::Policy::Judgment QueryPolicy(
38 net::X509Certificate* cert, const std::string& host);
39
40 // Allow mixed/unsafe content to be visible (non filtered) for the specified
41 // URL.
42 // Note that the current implementation allows on a host name basis.
43 void AllowShowInsecureContentForURL(const GURL& url);
44
45 // Returns whether the specified URL is allowed to show insecure (mixed or
46 // unsafe) content.
47 bool CanShowInsecureContent(const GURL& url);
48
49 private:
50 // Certificate policies for each host.
51 std::map<std::string, net::X509Certificate::Policy> cert_policy_for_host_;
52
53 // Domains for which it is OK to show insecure content.
54 std::set<std::string> can_show_insecure_content_for_host_;
55
56 DISALLOW_COPY_AND_ASSIGN(SSLHostState);
57 };
58
59 #endif // CHROME_BROWSER_SSL_SSL_HOST_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698