diff options
author | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 07:06:24 +0000 |
---|---|---|
committer | dpolukhin@chromium.org <dpolukhin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-16 07:06:24 +0000 |
commit | fb575bc7182f8ecde6ede7a4978b64a72434fd02 (patch) | |
tree | 61d8a21e588aca63d0713d35148aff12e9a2fe89 /ppapi/api | |
parent | fe0eca5c30281ae58cef01593f0e4aab7fd560f2 (diff) | |
download | chromium_src-fb575bc7182f8ecde6ede7a4978b64a72434fd02.zip chromium_src-fb575bc7182f8ecde6ede7a4978b64a72434fd02.tar.gz chromium_src-fb575bc7182f8ecde6ede7a4978b64a72434fd02.tar.bz2 |
Remove 'Flash' from TCP/UDP Pepper interfaces names. This CL preserves old idl and C/C++ headers for backward compatibility. Also TCP interface should be returned by old name.
BUG=none
TEST=build
Review URL: http://codereview.chromium.org/8506016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api')
-rw-r--r-- | ppapi/api/private/ppb_tcp_socket_private.idl | 114 | ||||
-rw-r--r-- | ppapi/api/private/ppb_udp_socket_private.idl | 58 |
2 files changed, 172 insertions, 0 deletions
diff --git a/ppapi/api/private/ppb_tcp_socket_private.idl b/ppapi/api/private/ppb_tcp_socket_private.idl new file mode 100644 index 0000000..847df9f --- /dev/null +++ b/ppapi/api/private/ppb_tcp_socket_private.idl @@ -0,0 +1,114 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the <code>PPB_TCPSocket_Private</code> interface. + */ + +label Chrome { + M17 = 0.3 +}; + +/** + * The <code>PPB_TCPSocket_Private</code> interface provides TCP socket + * operations. + */ +interface PPB_TCPSocket_Private { + /** + * Allocates a TCP socket resource. + */ + PP_Resource Create([in] PP_Instance instance); + + /** + * Determines if a given resource is TCP socket. + */ + PP_Bool IsTCPSocket([in] PP_Resource resource); + + /** + * Connects to a TCP port given as a host-port pair. + * When a proxy server is used, |host| and |port| refer to the proxy server + * instead of the destination server. + */ + int32_t Connect([in] PP_Resource tcp_socket, + [in] str_t host, + [in] uint16_t port, + [in] PP_CompletionCallback callback); + + /** + * Same as Connect(), but connecting to the address given by |addr|. A typical + * use-case would be for reconnections. + */ + int32_t ConnectWithNetAddress([in] PP_Resource tcp_socket, + [in] PP_NetAddress_Private addr, + [in] PP_CompletionCallback callback); + + /** + * Gets the local address of the socket, if it has been connected. + * Returns PP_TRUE on success. + */ + PP_Bool GetLocalAddress([in] PP_Resource tcp_socket, + [out] PP_NetAddress_Private local_addr); + + /** + * Gets the remote address of the socket, if it has been connected. + * Returns PP_TRUE on success. + */ + PP_Bool GetRemoteAddress([in] PP_Resource tcp_socket, + [out] PP_NetAddress_Private remote_addr); + + /** + * Does SSL handshake and moves to sending and receiving encrypted data. The + * socket must have been successfully connected. |server_name| will be + * compared with the name(s) in the server's certificate during the SSL + * handshake. |server_port| is only used to identify an SSL server in the SSL + * session cache. + * When a proxy server is used, |server_name| and |server_port| refer to the + * destination server. + * If the socket is not connected, or there are pending read/write requests, + * SSLHandshake() will fail without starting a handshake. Otherwise, any + * failure during the handshake process will cause the socket to be + * disconnected. + */ + int32_t SSLHandshake([in] PP_Resource tcp_socket, + [in] str_t server_name, + [in] uint16_t server_port, + [in] PP_CompletionCallback callback); + + /** + * Reads data from the socket. The size of |buffer| must be at least as large + * as |bytes_to_read|. May perform a partial read. Returns the number of bytes + * read or an error code. If the return value is 0, then it indicates that + * end-of-file was reached. + * This method won't return more than 1 megabyte, so if |bytes_to_read| + * exceeds 1 megabyte, it will always perform a partial read. + * Multiple outstanding read requests are not supported. + */ + int32_t Read([in] PP_Resource tcp_socket, + [out] str_t buffer, + [in] int32_t bytes_to_read, + [in] PP_CompletionCallback callback); + + /** + * Writes data to the socket. May perform a partial write. Returns the number + * of bytes written or an error code. + * This method won't write more than 1 megabyte, so if |bytes_to_write| + * exceeds 1 megabyte, it will always perform a partial write. + * Multiple outstanding write requests are not supported. + */ + int32_t Write([in] PP_Resource tcp_socket, + [in] str_t buffer, + [in] int32_t bytes_to_write, + [in] PP_CompletionCallback callback); + + /** + * Cancels any IO that may be pending, and disconnects the socket. Any pending + * callbacks will still run, reporting PP_Error_Aborted if pending IO was + * interrupted. It is NOT valid to call Connect() again after a call to this + * method. Note: If the socket is destroyed when it is still connected, then + * it will be implicitly disconnected, so you are not required to call this + * method. + */ + void Disconnect([in] PP_Resource tcp_socket); +}; diff --git a/ppapi/api/private/ppb_udp_socket_private.idl b/ppapi/api/private/ppb_udp_socket_private.idl new file mode 100644 index 0000000..82b7c3a --- /dev/null +++ b/ppapi/api/private/ppb_udp_socket_private.idl @@ -0,0 +1,58 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * This file defines the <code>PPB_UDPSocket_Private</code> interface. + */ + +label Chrome { + M17 = 0.2 +}; + +interface PPB_UDPSocket_Private { + /** + * Creates a UDP socket resource. + */ + PP_Resource Create([in] PP_Instance instance_id); + + /** + * Determines if a given resource is a UDP socket. + */ + PP_Bool IsUDPSocket([in] PP_Resource resource_id); + + /* Creates a socket and binds to the address given by |addr|. */ + int32_t Bind([in] PP_Resource udp_socket, + [in] PP_NetAddress_Private addr, + [in] PP_CompletionCallback callback); + + /* Performs a non-blocking recvfrom call on socket. + * Bind must be called first. |callback| is invoked when recvfrom + * reads data. You must call GetRecvFromAddress to recover the + * address the data was retrieved from. + */ + int32_t RecvFrom([in] PP_Resource udp_socket, + [out] str_t buffer, + [in] int32_t num_bytes, + [in] PP_CompletionCallback callback); + + /* Upon successful completion of RecvFrom, the address that the data + * was received from is stored in |addr|. + */ + PP_Bool GetRecvFromAddress([in] PP_Resource udp_socket, + [out] PP_NetAddress_Private addr); + + /* Performs a non-blocking sendto call on the socket created and + * bound(has already called Bind). The callback |callback| is + * invoked when sendto completes. + */ + int32_t SendTo([in] PP_Resource udp_socket, + [in] str_t buffer, + [in] int32_t num_bytes, + [in] PP_NetAddress_Private addr, + [in] PP_CompletionCallback callback); + + /* Cancels all pending reads and writes, and closes the socket. */ + void Close([in] PP_Resource udp_socket); +}; |