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