| 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 | 5 |
| 6 /* From private/ppb_flash_tcp_socket.idl modified Thu Nov 10 10:21:43 2011. */ | 6 /* From private/ppb_flash_tcp_socket.idl modified Tue Feb 21 10:34:59 2012. */ |
| 7 | 7 |
| 8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ |
| 9 #define PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ | 9 #define PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ |
| 10 | 10 |
| 11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
| 13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
| 15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
| 16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 * If the socket is not connected, or there are pending read/write requests, | 81 * If the socket is not connected, or there are pending read/write requests, |
| 82 * SSLHandshake() will fail without starting a handshake. Otherwise, any | 82 * SSLHandshake() will fail without starting a handshake. Otherwise, any |
| 83 * failure during the handshake process will cause the socket to be | 83 * failure during the handshake process will cause the socket to be |
| 84 * disconnected. | 84 * disconnected. |
| 85 */ | 85 */ |
| 86 int32_t (*SSLHandshake)(PP_Resource tcp_socket, | 86 int32_t (*SSLHandshake)(PP_Resource tcp_socket, |
| 87 const char* server_name, | 87 const char* server_name, |
| 88 uint16_t server_port, | 88 uint16_t server_port, |
| 89 struct PP_CompletionCallback callback); | 89 struct PP_CompletionCallback callback); |
| 90 /** | 90 /** |
| 91 * Returns the <code>PPB_Flash_X509Certificate</code> for a socket connection |
| 92 * if an SSL connection has been established using <code>SSL_Handshake</code>. |
| 93 * If no SSL connection has been established, a null resource is returned. |
| 94 */ |
| 95 PP_Resource (*GetX509Certificate)(PP_Resource tcp_socket); |
| 96 /** |
| 97 * Add a trusted/untrusted chain building certificate to be used for this |
| 98 * connection. The <code>PP_Resource</code> must be a |
| 99 * <code>PPB_Flash_X509Certificate<code>. <code>PP_TRUE</code> is returned |
| 100 * upon success. |
| 101 */ |
| 102 PP_Bool (*AddChainBuildingCertificate)(PP_Resource certificate, |
| 103 PP_Bool is_trusted); |
| 104 /** |
| 91 * Reads data from the socket. The size of |buffer| must be at least as large | 105 * Reads data from the socket. The size of |buffer| must be at least as large |
| 92 * as |bytes_to_read|. May perform a partial read. Returns the number of bytes | 106 * as |bytes_to_read|. May perform a partial read. Returns the number of bytes |
| 93 * read or an error code. If the return value is 0, then it indicates that | 107 * read or an error code. If the return value is 0, then it indicates that |
| 94 * end-of-file was reached. | 108 * end-of-file was reached. |
| 95 * This method won't return more than 1 megabyte, so if |bytes_to_read| | 109 * This method won't return more than 1 megabyte, so if |bytes_to_read| |
| 96 * exceeds 1 megabyte, it will always perform a partial read. | 110 * exceeds 1 megabyte, it will always perform a partial read. |
| 97 * Multiple outstanding read requests are not supported. | 111 * Multiple outstanding read requests are not supported. |
| 98 */ | 112 */ |
| 99 int32_t (*Read)(PP_Resource tcp_socket, | 113 int32_t (*Read)(PP_Resource tcp_socket, |
| 100 char* buffer, | 114 char* buffer, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 122 void (*Disconnect)(PP_Resource tcp_socket); | 136 void (*Disconnect)(PP_Resource tcp_socket); |
| 123 }; | 137 }; |
| 124 | 138 |
| 125 typedef struct PPB_Flash_TCPSocket_0_2 PPB_Flash_TCPSocket; | 139 typedef struct PPB_Flash_TCPSocket_0_2 PPB_Flash_TCPSocket; |
| 126 /** | 140 /** |
| 127 * @} | 141 * @} |
| 128 */ | 142 */ |
| 129 | 143 |
| 130 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ */ | 144 #endif /* PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ */ |
| 131 | 145 |
| OLD | NEW |