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_EXTENSIONS_API_SOCKET_TLS_SOCKET_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SOCKET_TLS_SOCKET_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_TLS_SOCKET_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SOCKET_TLS_SOCKET_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "extensions/browser/api/socket/socket.h" | 10 #include "extensions/browser/api/socket/socket.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Note: |callback| may be synchronously invoked before | 90 // Note: |callback| may be synchronously invoked before |
91 // UpgradeSocketToTLS() returns. Currently using the older chrome.socket | 91 // UpgradeSocketToTLS() returns. Currently using the older chrome.socket |
92 // version of SecureOptions, to avoid having the older API implementation | 92 // version of SecureOptions, to avoid having the older API implementation |
93 // depend on the newer one. | 93 // depend on the newer one. |
94 static void UpgradeSocketToTLS( | 94 static void UpgradeSocketToTLS( |
95 Socket* socket, | 95 Socket* socket, |
96 scoped_refptr<net::SSLConfigService> config_service, | 96 scoped_refptr<net::SSLConfigService> config_service, |
97 net::CertVerifier* cert_verifier, | 97 net::CertVerifier* cert_verifier, |
98 net::TransportSecurityState* transport_security_state, | 98 net::TransportSecurityState* transport_security_state, |
99 const std::string& extension_id, | 99 const std::string& extension_id, |
100 core_api::socket::SecureOptions* options, | 100 api::socket::SecureOptions* options, |
101 const SecureCallback& callback); | 101 const SecureCallback& callback); |
102 | 102 |
103 private: | 103 private: |
104 int WriteImpl(net::IOBuffer* io_buffer, | 104 int WriteImpl(net::IOBuffer* io_buffer, |
105 int io_buffer_size, | 105 int io_buffer_size, |
106 const net::CompletionCallback& callback) override; | 106 const net::CompletionCallback& callback) override; |
107 | 107 |
108 void OnReadComplete(const scoped_refptr<net::IOBuffer>& io_buffer, | 108 void OnReadComplete(const scoped_refptr<net::IOBuffer>& io_buffer, |
109 int result); | 109 int result); |
110 | 110 |
111 scoped_ptr<net::StreamSocket> tls_socket_; | 111 scoped_ptr<net::StreamSocket> tls_socket_; |
112 ReadCompletionCallback read_callback_; | 112 ReadCompletionCallback read_callback_; |
113 }; | 113 }; |
114 | 114 |
115 } // namespace extensions | 115 } // namespace extensions |
116 | 116 |
117 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_TLS_SOCKET_H_ | 117 #endif // CHROME_BROWSER_EXTENSIONS_API_SOCKET_TLS_SOCKET_H_ |
118 | 118 |
OLD | NEW |