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

Unified Diff: ppapi/c/dev/ppb_websocket_dev.h

Issue 8821010: WebSocket Pepper API: C++ bindings implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: straightforward C++ interface Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/c/dev/ppb_websocket_dev.h
diff --git a/ppapi/c/dev/ppb_websocket_dev.h b/ppapi/c/dev/ppb_websocket_dev.h
index 0e54db1b341075af4779aac20188cc466862d202..55f2394a13349716391c02ee3a05a4b0b3e68deb 100644
--- a/ppapi/c/dev/ppb_websocket_dev.h
+++ b/ppapi/c/dev/ppb_websocket_dev.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From dev/ppb_websocket_dev.idl modified Wed Nov 16 02:46:08 2011. */
+/* From dev/ppb_websocket_dev.idl modified Fri Dec 9 16:54:10 2011. */
#ifndef PPAPI_C_DEV_PPB_WEBSOCKET_DEV_H_
#define PPAPI_C_DEV_PPB_WEBSOCKET_DEV_H_
@@ -121,8 +121,7 @@ struct PPB_WebSocket_Dev {
* @param[in] protocols A pointer to an array of <code>PP_Var</code>
* specifying sub-protocols. Each <code>PP_Var</code> represents one
* sub-protocol and its <code>PP_VarType</code> must be
- * <code>PP_VARTYPE_STRING</code>. This argument can be null only if
- * <code>protocol_count</code> is 0.
+ * <code>PP_VARTYPE_STRING</code>.
*
* @param[in] protocol_count The number of sub-protocols in
* <code>protocols</code>.
@@ -131,11 +130,12 @@ struct PPB_WebSocket_Dev {
* when the connection is established or an error occurs in establishing
* connection.
*
- * @return In case of immediate failure, returns an error code as follows.
- * Returns <code>PP_ERROR_BADARGUMENT</code> corresponding to JavaScript
- * SyntaxError and <code>PP_ERROR_NOACCESS</code> corresponding to JavaScript
- * SecurityError. Otherwise, returns <code>PP_OK_COMPLETIONPENDING</code>
- * and invokes <code>callback</code> later.
+ * @return Returns <code>PP_OK_COMPLETIONPENDING</code> then callback is
+ * invoked with one of following results.
+ * <code>PP_ERROR_BADARGUMENT</code> corresponds to JavaScript SyntaxError,
+ * <code>PP_ERROR_NOACCESS</code> corresponds to JavaScript SecurityError,
+ * and returns <code>PP_ERROR_INPROGRESS</code> if the call is not the first
+ * time.
*/
int32_t (*Connect)(PP_Resource web_socket,
struct PP_Var url,
@@ -159,12 +159,12 @@ struct PPB_WebSocket_Dev {
* @param[in] callback A <code>PP_CompletionCallback</code> which is called
* when the connection is closed or an error occurs in closing connection.
*
- * @return In case of immediate failure, returns an error code as follows.
- * Returns <code>PP_ERROR_BADARGUMENT</code> corresponding to JavaScript
- * SyntaxError and <code>PP_ERROR_NOACCESS</code> corresponding to JavaScript
- * InvalidAccessError. Otherwise, returns
- * <code>PP_OK_COMPLETIONPENDING</code> and invokes <code>callback</code>
- * later.
+ * @return Returns <code>PP_OK_COMPLETIONPENDING</code> then callback is
+ * invoked with one of following results.
+ * <code>PP_ERROR_BADARGUMENT</code> corresponds to JavaScript SyntaxError,
+ * <code>PP_ERROR_NOACCESS</code> corresponding to JavaScript
+ * InvalidAccessError. Returns <code>PP_ERROR_INPROGRESS</code> if the call
+ * is not the first time.
*/
int32_t (*Close)(PP_Resource web_socket,
uint16_t code,
@@ -186,13 +186,12 @@ struct PPB_WebSocket_Dev {
* when the receiving message is completed. It is ignored when the function
* return <code>PP_OK</code>.
*
- * @return In case of immediate failure, returns
- * <code>PP_ERROR_FAILED</code>. If a message is currently available, returns
- * <code>PP_OK</code>. Otherwise, returns <PP_OK_COMPLETIONPENDING</code>
- * and invokes <code>callback</code> later. At that case, if GetReadyState()
- * returns <code>PP_WEBSOCKETREADYSTATE_OPEN</code>, the received
- * message is also copied to procided <code>message</code>. Otherwise,
- * the connection is closed and ReceiveMessage() failed to receive a message.
+ * @return Returns <code>PP_OK_COMPLETIONPENDING</code> then callback is
+ * invoked with <code>PP_OK</code> or <code>PP_ERROR_FAILED</code>.
+ * If an error is detected or connection is closed, returns
+ * <code>PP_ERROR_FAILED</code> after all buffered messages are received.
+ * Until buffered message become empty, continues to returns
+ * <code>PP_OK</code> as if connection is still established without errors.
*/
int32_t (*ReceiveMessage)(PP_Resource web_socket,
struct PP_Var* message,
@@ -220,10 +219,6 @@ struct PPB_WebSocket_Dev {
* messages that have been queued for the WebSocket connection to send but
* have not been transmitted to the network yet.
*
- * Note: This interface might not be able to return exact bytes in the first
- * release. Current WebSocket implementation can not estimate exact protocol
- * frame overheads.
- *
* @param[in] web_socket A <code>PP_Resource</code> corresponding to a
* WebSocket.
*
@@ -247,8 +242,8 @@ struct PPB_WebSocket_Dev {
* @param[in] web_socket A <code>PP_Resource</code> corresponding to a
* WebSocket.
*
- * @return Returns a <code>PP_VARTYPE_STRING</code> var. if called before the
- * close reason is set, its data is empty string. Returns a
+ * @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the
+ * close reason is set, it contains empty string. Returns a
* <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource.
*/
struct PP_Var (*GetCloseReason)(PP_Resource web_socket);
@@ -286,7 +281,7 @@ struct PPB_WebSocket_Dev {
* WebSocket.
*
* @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the
- * connection is established, its data is empty string. Returns a
+ * connection is established, it contains empty string. Returns a
* <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource.
*/
struct PP_Var (*GetProtocol)(PP_Resource web_socket);
@@ -308,7 +303,7 @@ struct PPB_WebSocket_Dev {
* WebSocket.
*
* @return Returns a <code>PP_VARTYPE_STRING</code> var. If called before the
- * connection is established, its data is empty string. Return a
+ * connection is established, it contains empty string. Return a
* <code>PP_VARTYPE_UNDEFINED</code> if called on an invalid resource.
*/
struct PP_Var (*GetURL)(PP_Resource web_socket);

Powered by Google App Engine
This is Rietveld 408576698