| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BASE_SSL_CONFIG_SERVICE_MAC_H_ | 5 #ifndef NET_BASE_SSL_CONFIG_SERVICE_MAC_H_ |
| 6 #define NET_BASE_SSL_CONFIG_SERVICE_MAC_H_ | 6 #define NET_BASE_SSL_CONFIG_SERVICE_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "net/base/ssl_config_service.h" | 10 #include "net/base/ssl_config_service.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 // This class is responsible for getting and setting the SSL configuration on | 14 // This class is responsible for getting and setting the SSL configuration on |
| 15 // Mac OS X. | 15 // Mac OS X. |
| 16 class SSLConfigServiceMac : public SSLConfigService { | 16 class SSLConfigServiceMac : public SSLConfigService { |
| 17 public: | 17 public: |
| 18 SSLConfigServiceMac(); | 18 SSLConfigServiceMac(); |
| 19 explicit SSLConfigServiceMac(base::TimeTicks now); // Used for testing. | 19 explicit SSLConfigServiceMac(base::TimeTicks now); // Used for testing. |
| 20 | 20 |
| 21 // Get the current SSL configuration settings. Can be called on any | 21 // Get the current SSL configuration settings. Can be called on any |
| 22 // thread. | 22 // thread. |
| 23 static bool GetSSLConfigNow(SSLConfig* config); | 23 static bool GetSSLConfigNow(SSLConfig* config); |
| 24 | 24 |
| 25 // Setters. Can be called on any thread. | 25 // Setters. Can be called on any thread. |
| 26 static void SetRevCheckingEnabled(bool enabled); | 26 static void SetRevCheckingEnabled(bool enabled); |
| 27 static void SetSSL2Enabled(bool enabled); | |
| 28 static void SetSSL3Enabled(bool enabled); | 27 static void SetSSL3Enabled(bool enabled); |
| 29 static void SetTLS1Enabled(bool enabled); | 28 static void SetTLS1Enabled(bool enabled); |
| 30 | 29 |
| 31 // Get the (cached) SSL configuration settings that are fresh within 10 | 30 // Get the (cached) SSL configuration settings that are fresh within 10 |
| 32 // seconds. This is cheaper than GetSSLConfigNow and is suitable when | 31 // seconds. This is cheaper than GetSSLConfigNow and is suitable when |
| 33 // we don't need the absolutely current configuration settings. This | 32 // we don't need the absolutely current configuration settings. This |
| 34 // method is not thread-safe, so it must be called on the same thread. | 33 // method is not thread-safe, so it must be called on the same thread. |
| 35 void GetSSLConfig(SSLConfig* config) { | 34 void GetSSLConfig(SSLConfig* config) { |
| 36 GetSSLConfigAt(config, base::TimeTicks::Now()); | 35 GetSSLConfigAt(config, base::TimeTicks::Now()); |
| 37 } | 36 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 48 SSLConfig config_info_; | 47 SSLConfig config_info_; |
| 49 base::TimeTicks config_time_; | 48 base::TimeTicks config_time_; |
| 50 bool ever_updated_; | 49 bool ever_updated_; |
| 51 | 50 |
| 52 DISALLOW_COPY_AND_ASSIGN(SSLConfigServiceMac); | 51 DISALLOW_COPY_AND_ASSIGN(SSLConfigServiceMac); |
| 53 }; | 52 }; |
| 54 | 53 |
| 55 } // namespace net | 54 } // namespace net |
| 56 | 55 |
| 57 #endif // NET_BASE_SSL_CONFIG_SERVICE_MAC_H_ | 56 #endif // NET_BASE_SSL_CONFIG_SERVICE_MAC_H_ |
| OLD | NEW |