| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_RENDERER_HOST_PEPPER_SSL_CONTEXT_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_SSL_CONTEXT_HELPER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_SSL_CONTEXT_HELPER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_SSL_CONTEXT_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "net/ssl/ssl_config_service.h" | 11 #include "net/ssl/ssl_config_service.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 class CertVerifier; | 14 class CertVerifier; |
| 15 class TransportSecurityState; | 15 class TransportSecurityState; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class SSLContextHelper : public base::RefCounted<SSLContextHelper> { | 20 // TODO(mgiuca): Avoid using UnsafeRefCounted. http://crbug.com/469952. |
| 21 class SSLContextHelper : public base::UnsafeRefCounted<SSLContextHelper> { |
| 21 public: | 22 public: |
| 22 SSLContextHelper(); | 23 SSLContextHelper(); |
| 23 | 24 |
| 24 net::CertVerifier* GetCertVerifier(); | 25 net::CertVerifier* GetCertVerifier(); |
| 25 net::TransportSecurityState* GetTransportSecurityState(); | 26 net::TransportSecurityState* GetTransportSecurityState(); |
| 26 const net::SSLConfig& ssl_config() { return ssl_config_; } | 27 const net::SSLConfig& ssl_config() { return ssl_config_; } |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 friend class base::RefCounted<SSLContextHelper>; | 30 friend class base::UnsafeRefCounted<SSLContextHelper>; |
| 30 | 31 |
| 31 ~SSLContextHelper(); | 32 ~SSLContextHelper(); |
| 32 | 33 |
| 33 // This is lazily created. Users should use GetCertVerifier to retrieve it. | 34 // This is lazily created. Users should use GetCertVerifier to retrieve it. |
| 34 scoped_ptr<net::CertVerifier> cert_verifier_; | 35 scoped_ptr<net::CertVerifier> cert_verifier_; |
| 35 // This is lazily created. Users should use GetTransportSecurityState to | 36 // This is lazily created. Users should use GetTransportSecurityState to |
| 36 // retrieve it. | 37 // retrieve it. |
| 37 scoped_ptr<net::TransportSecurityState> transport_security_state_; | 38 scoped_ptr<net::TransportSecurityState> transport_security_state_; |
| 38 | 39 |
| 39 // The default SSL configuration settings are used, as opposed to Chrome's SSL | 40 // The default SSL configuration settings are used, as opposed to Chrome's SSL |
| 40 // settings. | 41 // settings. |
| 41 net::SSLConfig ssl_config_; | 42 net::SSLConfig ssl_config_; |
| 42 | 43 |
| 43 DISALLOW_COPY_AND_ASSIGN(SSLContextHelper); | 44 DISALLOW_COPY_AND_ASSIGN(SSLContextHelper); |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 } // namespace content | 47 } // namespace content |
| 47 | 48 |
| 48 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_SSL_CONTEXT_HELPER_H_ | 49 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_SSL_CONTEXT_HELPER_H_ |
| OLD | NEW |