OLD | NEW |
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 NET_SSL_SSL_CONFIG_SERVICE_H_ | 5 #ifndef NET_SSL_SSL_CONFIG_SERVICE_H_ |
6 #define NET_SSL_SSL_CONFIG_SERVICE_H_ | 6 #define NET_SSL_SSL_CONFIG_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
13 #include "net/cert/crl_set.h" | 13 #include "net/cert/crl_set.h" |
| 14 #include "net/cert/ct_ev_whitelist.h" |
14 #include "net/ssl/ssl_config.h" | 15 #include "net/ssl/ssl_config.h" |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 | 18 |
18 // The interface for retrieving the SSL configuration. This interface | 19 // The interface for retrieving the SSL configuration. This interface |
19 // does not cover setting the SSL configuration, as on some systems, the | 20 // does not cover setting the SSL configuration, as on some systems, the |
20 // SSLConfigService objects may not have direct access to the configuration, or | 21 // SSLConfigService objects may not have direct access to the configuration, or |
21 // live longer than the configuration preferences. | 22 // live longer than the configuration preferences. |
22 class NET_EXPORT SSLConfigService | 23 class NET_EXPORT SSLConfigService |
23 : public base::RefCountedThreadSafe<SSLConfigService> { | 24 : public base::RefCountedThreadSafe<SSLConfigService> { |
(...skipping 19 matching lines...) Expand all Loading... |
43 | 44 |
44 SSLConfigService(); | 45 SSLConfigService(); |
45 | 46 |
46 // May not be thread-safe, should only be called on the IO thread. | 47 // May not be thread-safe, should only be called on the IO thread. |
47 virtual void GetSSLConfig(SSLConfig* config) = 0; | 48 virtual void GetSSLConfig(SSLConfig* config) = 0; |
48 | 49 |
49 // Sets and gets the current, global CRL set. | 50 // Sets and gets the current, global CRL set. |
50 static void SetCRLSet(scoped_refptr<CRLSet> crl_set); | 51 static void SetCRLSet(scoped_refptr<CRLSet> crl_set); |
51 static scoped_refptr<CRLSet> GetCRLSet(); | 52 static scoped_refptr<CRLSet> GetCRLSet(); |
52 | 53 |
| 54 // Sets and gets the current, global EV certificates whitelist |
| 55 static void SetEVCertsWhitelist( |
| 56 scoped_refptr<ct::EVCertsWhitelist> ev_whitelist); |
| 57 static scoped_refptr<ct::EVCertsWhitelist> GetEVCertsWhitelist(); |
| 58 |
53 // Is SNI available in this configuration? | 59 // Is SNI available in this configuration? |
54 static bool IsSNIAvailable(SSLConfigService* service); | 60 static bool IsSNIAvailable(SSLConfigService* service); |
55 | 61 |
56 // Add an observer of this service. | 62 // Add an observer of this service. |
57 void AddObserver(Observer* observer); | 63 void AddObserver(Observer* observer); |
58 | 64 |
59 // Remove an observer of this service. | 65 // Remove an observer of this service. |
60 void RemoveObserver(Observer* observer); | 66 void RemoveObserver(Observer* observer); |
61 | 67 |
62 // Calls the OnSSLConfigChanged method of registered observers. Should only be | 68 // Calls the OnSSLConfigChanged method of registered observers. Should only be |
63 // called on the IO thread. | 69 // called on the IO thread. |
64 void NotifySSLConfigChange(); | 70 void NotifySSLConfigChange(); |
65 | 71 |
66 protected: | 72 protected: |
67 friend class base::RefCountedThreadSafe<SSLConfigService>; | 73 friend class base::RefCountedThreadSafe<SSLConfigService>; |
68 | 74 |
69 virtual ~SSLConfigService(); | 75 virtual ~SSLConfigService(); |
70 | 76 |
71 // Process before/after config update. | 77 // Process before/after config update. |
72 void ProcessConfigUpdate(const SSLConfig& orig_config, | 78 void ProcessConfigUpdate(const SSLConfig& orig_config, |
73 const SSLConfig& new_config); | 79 const SSLConfig& new_config); |
74 | 80 |
75 private: | 81 private: |
76 ObserverList<Observer> observer_list_; | 82 ObserverList<Observer> observer_list_; |
77 }; | 83 }; |
78 | 84 |
79 } // namespace net | 85 } // namespace net |
80 | 86 |
81 #endif // NET_SSL_SSL_CONFIG_SERVICE_H_ | 87 #endif // NET_SSL_SSL_CONFIG_SERVICE_H_ |
OLD | NEW |