Chromium Code Reviews| 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_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ | 5 #ifndef PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ |
| 6 #define PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ | 6 #define PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_stdint.h" | 8 #include "ppapi/c/pp_stdint.h" |
| 9 #include "ppapi/c/private/ppb_tcp_socket_private.h" | 9 #include "ppapi/c/private/ppb_tcp_socket_private.h" |
| 10 #include "ppapi/cpp/pass_ref.h" | 10 #include "ppapi/cpp/pass_ref.h" |
| 11 #include "ppapi/cpp/private/x509_certificate_private.h" | |
| 11 #include "ppapi/cpp/resource.h" | 12 #include "ppapi/cpp/resource.h" |
| 12 | 13 |
| 13 namespace pp { | 14 namespace pp { |
| 14 | 15 |
| 15 class CompletionCallback; | 16 class CompletionCallback; |
| 16 class InstanceHandle; | 17 class InstanceHandle; |
| 17 | 18 |
| 18 class TCPSocketPrivate : public Resource { | 19 class TCPSocketPrivate : public Resource { |
| 19 public: | 20 public: |
| 20 explicit TCPSocketPrivate(const InstanceHandle& instance); | 21 explicit TCPSocketPrivate(const InstanceHandle& instance); |
| 21 | 22 |
| 22 TCPSocketPrivate(PassRef, PP_Resource resource); | 23 TCPSocketPrivate(PassRef, PP_Resource resource); |
| 23 | 24 |
| 24 // Returns true if the required interface is available. | 25 // Returns true if the required interface is available. |
| 25 static bool IsAvailable(); | 26 static bool IsAvailable(); |
| 26 | 27 |
| 27 int32_t Connect(const char* host, | 28 int32_t Connect(const char* host, |
| 28 uint16_t port, | 29 uint16_t port, |
| 29 const CompletionCallback& callback); | 30 const CompletionCallback& callback); |
| 30 int32_t ConnectWithNetAddress(const PP_NetAddress_Private* addr, | 31 int32_t ConnectWithNetAddress(const PP_NetAddress_Private* addr, |
| 31 const CompletionCallback& callback); | 32 const CompletionCallback& callback); |
| 32 bool GetLocalAddress(PP_NetAddress_Private* local_addr); | 33 bool GetLocalAddress(PP_NetAddress_Private* local_addr); |
| 33 bool GetRemoteAddress(PP_NetAddress_Private* remote_addr); | 34 bool GetRemoteAddress(PP_NetAddress_Private* remote_addr); |
| 34 int32_t SSLHandshake(const char* server_name, | 35 int32_t SSLHandshake(const char* server_name, |
| 35 uint16_t server_port, | 36 uint16_t server_port, |
| 36 const CompletionCallback& callback); | 37 const CompletionCallback& callback); |
| 38 X509Certificate GetServerCertificate(); | |
|
Ryan Sleevi
2012/04/06 00:37:49
bool GetServerCertificate(X509Certificate* cert);
yzshen1
2012/04/06 19:24:33
Actually, you should have 'Private' in the name of
raymes
2012/04/06 23:22:47
A copy to the out param would still have to happen
| |
| 39 bool AddChainBuildingCertificate(const X509Certificate& cert, | |
| 40 bool trusted); | |
| 41 | |
| 37 int32_t Read(char* buffer, | 42 int32_t Read(char* buffer, |
| 38 int32_t bytes_to_read, | 43 int32_t bytes_to_read, |
| 39 const CompletionCallback& callback); | 44 const CompletionCallback& callback); |
| 40 int32_t Write(const char* buffer, | 45 int32_t Write(const char* buffer, |
| 41 int32_t bytes_to_write, | 46 int32_t bytes_to_write, |
| 42 const CompletionCallback& callback); | 47 const CompletionCallback& callback); |
| 43 void Disconnect(); | 48 void Disconnect(); |
| 44 }; | 49 }; |
| 45 | 50 |
| 46 } // namespace pp | 51 } // namespace pp |
| 47 | 52 |
| 48 #endif // PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ | 53 #endif // PPAPI_CPP_PRIVATE_TCP_SOCKET_PRIVATE_H_ |
| OLD | NEW |