Index: ppapi/cpp/dev/websocket_dev.h |
diff --git a/ppapi/cpp/dev/websocket_dev.h b/ppapi/cpp/dev/websocket_dev.h |
index 42981f6dcff332996fd366349ebb319729683486..c4d1ca2b2d96246bd0c9f388b1d1877197bf305c 100644 |
--- a/ppapi/cpp/dev/websocket_dev.h |
+++ b/ppapi/cpp/dev/websocket_dev.h |
@@ -176,6 +176,33 @@ class WebSocket_Dev : public Resource { |
/// @return Returns a <code>Var</code> of string type. If called before the |
/// connection is established, it contains the empty string. |
Var GetURL(); |
+ |
+ /// SetBinaryType() specifies the binary object type for receiving binary |
+ /// frames representation. Receiving text frames are always mapped to |
+ /// <PP_VARTYPE_STRING</code> var regardless of this attribute. |
+ /// This function should be called before Connect() to ensure receiving all |
+ /// incoming binary frames as the specified binary object type. |
+ /// Default type is <code>PP_WEBSOCKETBINARYTYPE_BLOB_DEV</code>. |
+ /// |
+ /// Currently, Blob bindings is not supported in Pepper, so receiving binary |
+ /// type is always ArrayBuffer. To ensure backward compatibility, you must |
+ /// call this function with |
+ /// <code>PP_WEBSOCKETBINARYTYPE_ARRAYBUFFER_DEV</code> to use binary frames. |
+ /// |
+ /// @param[in] binary_type Binary object type for receiving binary frames |
+ /// representation. |
+ /// |
+ /// @return Returns <code>false</code> if the specified type is not |
+ /// supported. Otherwise, returns <code>true</code>. |
+ /// |
+ bool SetBinaryType(PP_WebSocketBinaryType_Dev binary_type); |
+ |
+ /// GetBinaryType() returns the currently specified binary object type for |
+ /// receiving binary frames. |
+ /// |
+ /// @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents the |
+ /// current binary object type. |
+ PP_WebSocketBinaryType_Dev GetBinaryType(); |
}; |
} // namespace pp |