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

Side by Side Diff: content/browser/ssl/ssl_policy_backend.h

Issue 369703002: Remember user decisions on invalid certificates behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits from sleevi Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ 5 #ifndef CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_
6 #define CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ 6 #define CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "net/cert/cert_status_flags.h" 13 #include "net/cert/cert_status_flags.h"
14 #include "net/cert/x509_certificate.h" 14 #include "net/cert/x509_certificate.h"
15 15
16 class GURL;
17
16 namespace content { 18 namespace content {
17 class NavigationControllerImpl; 19 class NavigationControllerImpl;
18 class SSLHostState; 20 class SSLHostState;
19 21
20 class SSLPolicyBackend { 22 class SSLPolicyBackend {
21 public: 23 public:
22 explicit SSLPolicyBackend(NavigationControllerImpl* controller); 24 explicit SSLPolicyBackend(NavigationControllerImpl* controller);
23 25
24 // Records that a host has run insecure content. 26 // Records that a host has run insecure content.
25 void HostRanInsecureContent(const std::string& host, int pid); 27 void HostRanInsecureContent(const std::string& host, int pid);
26 28
27 // Returns whether the specified host ran insecure content. 29 // Returns whether the specified host ran insecure content.
28 bool DidHostRunInsecureContent(const std::string& host, int pid) const; 30 bool DidHostRunInsecureContent(const std::string& host, int pid) const;
29 31
30 // Records that |cert| is not permitted to be used for |host| in the future, 32 // Records that |cert| is not permitted to be used for |host| in the future,
31 // for a specific error type. 33 // for a specific error type.
32 void DenyCertForHost(net::X509Certificate* cert, 34 void DenyCertForHost(net::X509Certificate* cert,
33 const std::string& host, 35 const GURL& url,
34 net::CertStatus error); 36 net::CertStatus error);
35 37
36 // Records that |cert| is permitted to be used for |host| in the future, for 38 // Records that |cert| is permitted to be used for |host| in the future, for
37 // a specific error type. 39 // a specific error type.
38 void AllowCertForHost(net::X509Certificate* cert, 40 void AllowCertForHost(net::X509Certificate* cert,
39 const std::string& host, 41 const GURL& url,
40 net::CertStatus error); 42 net::CertStatus error);
41 43
42 // Queries whether |cert| is allowed or denied for |host|. 44 // Queries whether |cert| is allowed or denied for |host|.
43 net::CertPolicy::Judgment QueryPolicy(net::X509Certificate* cert, 45 net::CertPolicy::Judgment QueryPolicy(net::X509Certificate* cert,
44 const std::string& host, 46 const GURL& url,
45 net::CertStatus error); 47 net::CertStatus error);
46 48
47 private: 49 private:
48 // SSL state specific for each host. 50 // SSL state specific for each host.
49 SSLHostState* ssl_host_state_; 51 SSLHostState* ssl_host_state_;
50 52
51 NavigationControllerImpl* controller_; 53 NavigationControllerImpl* controller_;
52 54
53 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend); 55 DISALLOW_COPY_AND_ASSIGN(SSLPolicyBackend);
54 }; 56 };
55 57
56 } // namespace content 58 } // namespace content
57 59
58 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_ 60 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_BACKEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698