Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Side by Side Diff: ppapi/c/private/ppb_tcp_socket_private.h

Issue 9699100: Add functionality to pppapi TCPSocket to support secure sockets in flash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/api/private/ppb_tcp_socket_private.idl ('k') | ppapi/cpp/private/tcp_socket_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_tcp_socket_private.idl modified Wed Nov 16 15:27:20 2011. */ 6 /* From private/ppb_tcp_socket_private.idl modified Wed Mar 7 15:06:53 2012. */
7 7
8 #ifndef PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_H_ 8 #ifndef PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_H_
9 #define PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_H_ 9 #define PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_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"
17 #include "ppapi/c/private/ppb_net_address_private.h" 17 #include "ppapi/c/private/ppb_net_address_private.h"
18 18
19 #define PPB_TCPSOCKET_PRIVATE_INTERFACE_0_3 "PPB_TCPSocket_Private;0.3" 19 #define PPB_TCPSOCKET_PRIVATE_INTERFACE_0_3 "PPB_TCPSocket_Private;0.3"
20 #define PPB_TCPSOCKET_PRIVATE_INTERFACE PPB_TCPSOCKET_PRIVATE_INTERFACE_0_3 20 #define PPB_TCPSOCKET_PRIVATE_INTERFACE_0_4 "PPB_TCPSocket_Private;0.4"
21 #define PPB_TCPSOCKET_PRIVATE_INTERFACE PPB_TCPSOCKET_PRIVATE_INTERFACE_0_4
21 22
22 /** 23 /**
23 * @file 24 * @file
24 * This file defines the <code>PPB_TCPSocket_Private</code> interface. 25 * This file defines the <code>PPB_TCPSocket_Private</code> interface.
25 */ 26 */
26 27
27 28
28 /** 29 /**
29 * @addtogroup Interfaces 30 * @addtogroup Interfaces
30 * @{ 31 * @{
31 */ 32 */
32 /** 33 /**
33 * The <code>PPB_TCPSocket_Private</code> interface provides TCP socket 34 * The <code>PPB_TCPSocket_Private</code> interface provides TCP socket
34 * operations. 35 * operations.
35 */ 36 */
36 struct PPB_TCPSocket_Private_0_3 { 37 struct PPB_TCPSocket_Private_0_4 {
37 /** 38 /**
38 * Allocates a TCP socket resource. 39 * Allocates a TCP socket resource.
39 */ 40 */
40 PP_Resource (*Create)(PP_Instance instance); 41 PP_Resource (*Create)(PP_Instance instance);
41 /** 42 /**
42 * Determines if a given resource is TCP socket. 43 * Determines if a given resource is TCP socket.
43 */ 44 */
44 PP_Bool (*IsTCPSocket)(PP_Resource resource); 45 PP_Bool (*IsTCPSocket)(PP_Resource resource);
45 /** 46 /**
46 * Connects to a TCP port given as a host-port pair. 47 * Connects to a TCP port given as a host-port pair.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 * If the socket is not connected, or there are pending read/write requests, 82 * If the socket is not connected, or there are pending read/write requests,
82 * SSLHandshake() will fail without starting a handshake. Otherwise, any 83 * SSLHandshake() will fail without starting a handshake. Otherwise, any
83 * failure during the handshake process will cause the socket to be 84 * failure during the handshake process will cause the socket to be
84 * disconnected. 85 * disconnected.
85 */ 86 */
86 int32_t (*SSLHandshake)(PP_Resource tcp_socket, 87 int32_t (*SSLHandshake)(PP_Resource tcp_socket,
87 const char* server_name, 88 const char* server_name,
88 uint16_t server_port, 89 uint16_t server_port,
89 struct PP_CompletionCallback callback); 90 struct PP_CompletionCallback callback);
90 /** 91 /**
92 * Returns the server's <code>PPB_Flash_X509Certificate</code> for a socket
93 * connection if an SSL connection has been established using
94 * <code>SSL_Handshake</code>. If no SSL connection has been established, a
95 * null resource is returned.
96 */
97 PP_Resource (*GetServerCertificate)(PP_Resource tcp_socket);
98 /**
99 * Add a trusted/untrusted chain building certificate to be used for this
100 * connection. The <code>PP_Resource</code> must be a
101 * <code>PPB_Flash_X509Certificate<code>. <code>PP_TRUE</code> is returned
102 * upon success.
103 */
104 PP_Bool (*AddChainBuildingCertificate)(PP_Resource tcp_socket,
105 PP_Resource certificate,
106 PP_Bool is_trusted);
107 /**
91 * Reads data from the socket. The size of |buffer| must be at least as large 108 * 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 109 * 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 110 * read or an error code. If the return value is 0, then it indicates that
94 * end-of-file was reached. 111 * end-of-file was reached.
95 * This method won't return more than 1 megabyte, so if |bytes_to_read| 112 * 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. 113 * exceeds 1 megabyte, it will always perform a partial read.
97 * Multiple outstanding read requests are not supported. 114 * Multiple outstanding read requests are not supported.
98 */ 115 */
99 int32_t (*Read)(PP_Resource tcp_socket, 116 int32_t (*Read)(PP_Resource tcp_socket,
100 char* buffer, 117 char* buffer,
(...skipping 14 matching lines...) Expand all
115 * Cancels any IO that may be pending, and disconnects the socket. Any pending 132 * Cancels any IO that may be pending, and disconnects the socket. Any pending
116 * callbacks will still run, reporting PP_Error_Aborted if pending IO was 133 * callbacks will still run, reporting PP_Error_Aborted if pending IO was
117 * interrupted. It is NOT valid to call Connect() again after a call to this 134 * interrupted. It is NOT valid to call Connect() again after a call to this
118 * method. Note: If the socket is destroyed when it is still connected, then 135 * method. Note: If the socket is destroyed when it is still connected, then
119 * it will be implicitly disconnected, so you are not required to call this 136 * it will be implicitly disconnected, so you are not required to call this
120 * method. 137 * method.
121 */ 138 */
122 void (*Disconnect)(PP_Resource tcp_socket); 139 void (*Disconnect)(PP_Resource tcp_socket);
123 }; 140 };
124 141
125 typedef struct PPB_TCPSocket_Private_0_3 PPB_TCPSocket_Private; 142 typedef struct PPB_TCPSocket_Private_0_4 PPB_TCPSocket_Private;
143
144 struct PPB_TCPSocket_Private_0_3 {
145 PP_Resource (*Create)(PP_Instance instance);
146 PP_Bool (*IsTCPSocket)(PP_Resource resource);
147 int32_t (*Connect)(PP_Resource tcp_socket,
148 const char* host,
149 uint16_t port,
150 struct PP_CompletionCallback callback);
151 int32_t (*ConnectWithNetAddress)(PP_Resource tcp_socket,
152 const struct PP_NetAddress_Private* addr,
153 struct PP_CompletionCallback callback);
154 PP_Bool (*GetLocalAddress)(PP_Resource tcp_socket,
155 struct PP_NetAddress_Private* local_addr);
156 PP_Bool (*GetRemoteAddress)(PP_Resource tcp_socket,
157 struct PP_NetAddress_Private* remote_addr);
158 int32_t (*SSLHandshake)(PP_Resource tcp_socket,
159 const char* server_name,
160 uint16_t server_port,
161 struct PP_CompletionCallback callback);
162 int32_t (*Read)(PP_Resource tcp_socket,
163 char* buffer,
164 int32_t bytes_to_read,
165 struct PP_CompletionCallback callback);
166 int32_t (*Write)(PP_Resource tcp_socket,
167 const char* buffer,
168 int32_t bytes_to_write,
169 struct PP_CompletionCallback callback);
170 void (*Disconnect)(PP_Resource tcp_socket);
171 };
126 /** 172 /**
127 * @} 173 * @}
128 */ 174 */
129 175
130 #endif /* PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_H_ */ 176 #endif /* PPAPI_C_PRIVATE_PPB_TCP_SOCKET_PRIVATE_H_ */
131 177
OLDNEW
« no previous file with comments | « ppapi/api/private/ppb_tcp_socket_private.idl ('k') | ppapi/cpp/private/tcp_socket_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698