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 PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ |
6 #define PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ | 6 #define PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Write | 39 // The maximum number of bytes that each PpapiHostMsg_PPBTCPSocket_Write |
40 // message is allowed to carry. | 40 // message is allowed to carry. |
41 static const int32_t kMaxWriteSize; | 41 static const int32_t kMaxWriteSize; |
42 | 42 |
43 // Resource overrides. | 43 // Resource overrides. |
44 virtual PPB_TCPSocket_Private_API* AsPPB_TCPSocket_Private_API() OVERRIDE; | 44 virtual PPB_TCPSocket_Private_API* AsPPB_TCPSocket_Private_API() OVERRIDE; |
45 | 45 |
46 // PPB_TCPSocket_Private_API implementation. | 46 // PPB_TCPSocket_Private_API implementation. |
47 virtual int32_t Connect(const char* host, | 47 virtual int32_t Connect(const char* host, |
48 uint16_t port, | 48 uint16_t port, |
49 PP_CompletionCallback callback) OVERRIDE; | 49 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
50 virtual int32_t ConnectWithNetAddress( | 50 virtual int32_t ConnectWithNetAddress( |
51 const PP_NetAddress_Private* addr, | 51 const PP_NetAddress_Private* addr, |
52 PP_CompletionCallback callback) OVERRIDE; | 52 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
53 virtual PP_Bool GetLocalAddress(PP_NetAddress_Private* local_addr) OVERRIDE; | 53 virtual PP_Bool GetLocalAddress(PP_NetAddress_Private* local_addr) OVERRIDE; |
54 virtual PP_Bool GetRemoteAddress(PP_NetAddress_Private* remote_addr) OVERRIDE; | 54 virtual PP_Bool GetRemoteAddress(PP_NetAddress_Private* remote_addr) OVERRIDE; |
55 virtual int32_t SSLHandshake(const char* server_name, | 55 virtual int32_t SSLHandshake( |
56 uint16_t server_port, | 56 const char* server_name, |
57 PP_CompletionCallback callback) OVERRIDE; | 57 uint16_t server_port, |
| 58 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
58 virtual PP_Resource GetServerCertificate() OVERRIDE; | 59 virtual PP_Resource GetServerCertificate() OVERRIDE; |
59 virtual PP_Bool AddChainBuildingCertificate(PP_Resource certificate, | 60 virtual PP_Bool AddChainBuildingCertificate(PP_Resource certificate, |
60 PP_Bool trusted) OVERRIDE; | 61 PP_Bool trusted) OVERRIDE; |
61 virtual int32_t Read(char* buffer, | 62 virtual int32_t Read(char* buffer, |
62 int32_t bytes_to_read, | 63 int32_t bytes_to_read, |
63 PP_CompletionCallback callback) OVERRIDE; | 64 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
64 virtual int32_t Write(const char* buffer, | 65 virtual int32_t Write(const char* buffer, |
65 int32_t bytes_to_write, | 66 int32_t bytes_to_write, |
66 PP_CompletionCallback callback) OVERRIDE; | 67 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
67 virtual void Disconnect() OVERRIDE; | 68 virtual void Disconnect() OVERRIDE; |
68 | 69 |
69 // Notifications on operations completion. | 70 // Notifications on operations completion. |
70 void OnConnectCompleted(bool succeeded, | 71 void OnConnectCompleted(bool succeeded, |
71 const PP_NetAddress_Private& local_addr, | 72 const PP_NetAddress_Private& local_addr, |
72 const PP_NetAddress_Private& remote_addr); | 73 const PP_NetAddress_Private& remote_addr); |
73 void OnSSLHandshakeCompleted( | 74 void OnSSLHandshakeCompleted( |
74 bool succeeded, | 75 bool succeeded, |
75 const PPB_X509Certificate_Fields& certificate_fields); | 76 const PPB_X509Certificate_Fields& certificate_fields); |
76 void OnReadCompleted(bool succeeded, const std::string& data); | 77 void OnReadCompleted(bool succeeded, const std::string& data); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 128 |
128 std::vector<std::vector<char> > trusted_certificates_; | 129 std::vector<std::vector<char> > trusted_certificates_; |
129 std::vector<std::vector<char> > untrusted_certificates_; | 130 std::vector<std::vector<char> > untrusted_certificates_; |
130 | 131 |
131 DISALLOW_COPY_AND_ASSIGN(TCPSocketPrivateImpl); | 132 DISALLOW_COPY_AND_ASSIGN(TCPSocketPrivateImpl); |
132 }; | 133 }; |
133 | 134 |
134 } // namespace ppapi | 135 } // namespace ppapi |
135 | 136 |
136 #endif // PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ | 137 #endif // PPAPI_SHARED_IMPL_PRIVATE_TCP_SOCKET_PRIVATE_IMPL_H_ |
OLD | NEW |