OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ |
6 #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ | 6 #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "content/public/browser/ssl_host_state_delegate.h" | 11 #include "content/public/browser/ssl_host_state_delegate.h" |
12 | 12 |
13 class Profile; | 13 class Profile; |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class Clock; | 16 class Clock; |
17 class DictionaryValue; | 17 class DictionaryValue; |
18 } // namespace base | 18 } // namespace base |
19 | 19 |
20 // Tracks whether the user has allowed a certificate error exception for a | 20 // Tracks whether the user has allowed a certificate error exception for a |
21 // specific site, SSL fingerprint, and error. Based on command-line flags and | 21 // specific site, SSL fingerprint, and error. Based on command-line flags and |
22 // experimental group, remembers this decision either until end-of-session or | 22 // experimental group, remembers this decision either until end-of-session or |
23 // for a particular length of time. | 23 // for a particular length of time. |
24 class ChromeSSLHostStateDelegate : public content::SSLHostStateDelegate { | 24 class ChromeSSLHostStateDelegate : public content::SSLHostStateDelegate { |
25 public: | 25 public: |
26 explicit ChromeSSLHostStateDelegate(Profile* profile); | 26 explicit ChromeSSLHostStateDelegate(Profile* profile); |
27 virtual ~ChromeSSLHostStateDelegate(); | 27 ~ChromeSSLHostStateDelegate() override; |
28 | 28 |
29 // SSLHostStateDelegate: | 29 // SSLHostStateDelegate: |
30 virtual void AllowCert(const std::string& host, | 30 void AllowCert(const std::string& host, |
31 const net::X509Certificate& cert, | 31 const net::X509Certificate& cert, |
32 net::CertStatus error) override; | 32 net::CertStatus error) override; |
33 virtual void Clear() override; | 33 void Clear() override; |
34 virtual CertJudgment QueryPolicy(const std::string& host, | 34 CertJudgment QueryPolicy(const std::string& host, |
35 const net::X509Certificate& cert, | 35 const net::X509Certificate& cert, |
36 net::CertStatus error, | 36 net::CertStatus error, |
37 bool* expired_previous_decision) override; | 37 bool* expired_previous_decision) override; |
38 virtual void HostRanInsecureContent(const std::string& host, | 38 void HostRanInsecureContent(const std::string& host, int pid) override; |
39 int pid) override; | 39 bool DidHostRunInsecureContent(const std::string& host, |
40 virtual bool DidHostRunInsecureContent(const std::string& host, | 40 int pid) const override; |
41 int pid) const override; | |
42 | 41 |
43 // Revokes all SSL certificate error allow exceptions made by the user for | 42 // Revokes all SSL certificate error allow exceptions made by the user for |
44 // |host| in the given Profile. | 43 // |host| in the given Profile. |
45 virtual void RevokeUserAllowExceptions(const std::string& host); | 44 virtual void RevokeUserAllowExceptions(const std::string& host); |
46 | 45 |
47 // RevokeUserAllowExceptionsHard is the same as RevokeUserAllowExceptions but | 46 // RevokeUserAllowExceptionsHard is the same as RevokeUserAllowExceptions but |
48 // additionally may close idle connections in the process. This should be used | 47 // additionally may close idle connections in the process. This should be used |
49 // *only* for rare events, such as a user controlled button, as it may be very | 48 // *only* for rare events, such as a user controlled button, as it may be very |
50 // disruptive to the networking stack. | 49 // disruptive to the networking stack. |
51 virtual void RevokeUserAllowExceptionsHard(const std::string& host); | 50 virtual void RevokeUserAllowExceptionsHard(const std::string& host); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // should be removed after the experiment has finished, and a call to Clear() | 136 // should be removed after the experiment has finished, and a call to Clear() |
138 // should be added to the constructor and destructor for members of the | 137 // should be added to the constructor and destructor for members of the |
139 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END groups. See | 138 // FORGET_SSL_EXCEPTION_DECISIONS_AT_SESSION_END groups. See |
140 // https://crbug.com/418631 for more details. | 139 // https://crbug.com/418631 for more details. |
141 const std::string current_expiration_guid_; | 140 const std::string current_expiration_guid_; |
142 | 141 |
143 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate); | 142 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDelegate); |
144 }; | 143 }; |
145 | 144 |
146 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ | 145 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DELEGATE_H_ |
OLD | NEW |