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

Unified Diff: ppapi/api/dev/ppb_websocket_dev.idl

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/api/dev/ppb_websocket_dev.idl
diff --git a/ppapi/api/dev/ppb_websocket_dev.idl b/ppapi/api/dev/ppb_websocket_dev.idl
index 6dd0bd86c08de14cdefa5cdfb46252473980fdd4..4a5e5e9d2a10b667ea7be399af3be849a8ef01b3 100644
--- a/ppapi/api/dev/ppb_websocket_dev.idl
+++ b/ppapi/api/dev/ppb_websocket_dev.idl
@@ -103,8 +103,7 @@ interface 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>.
@@ -113,11 +112,12 @@ interface 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([in] PP_Resource web_socket,
[in] PP_Var url,
@@ -142,12 +142,12 @@ interface 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([in] PP_Resource web_socket,
[in] uint16_t code,
@@ -170,13 +170,12 @@ interface 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([in] PP_Resource web_socket,
[out] PP_Var message,
@@ -207,10 +206,6 @@ interface 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.
*
@@ -236,8 +231,8 @@ interface 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.
*/
PP_Var GetCloseReason([in] PP_Resource web_socket);
@@ -278,7 +273,7 @@ interface 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.
*/
PP_Var GetProtocol([in] PP_Resource web_socket);
@@ -302,7 +297,7 @@ interface 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.
*/
PP_Var GetURL([in] PP_Resource web_socket);

Powered by Google App Engine
This is Rietveld 408576698