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

Unified Diff: ppapi/cpp/dev/websocket_dev.h

Issue 9026007: WebSocket Pepper API: WebArrayBuffer support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add C++ interfaces to handle binary types Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ppapi/cpp/dev/websocket_dev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..67acc23af0526125fffdc37f16554b73f0a3cde7 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 receibing binary frames
dmichael (off chromium) 2012/01/17 22:14:28 receibing->receiving
Takashi Toyoshima 2012/01/18 12:10:44 Done here and in api/dev/ppb_websocket_dev_idl.
+ /// 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 currently specified binary object type for
dmichael (off chromium) 2012/01/17 22:14:28 nit: returns "the" currently
Takashi Toyoshima 2012/01/18 12:10:44 Ditto.
+ /// receiving binary frames representation.
dmichael (off chromium) 2012/01/17 22:14:28 nit: I think "representation" is redundant.
Takashi Toyoshima 2012/01/18 12:10:44 Ditto.
+ ///
+ /// @return Returns <code>PP_WebSocketBinaryType_Dev</code> represents
+ /// current binary object type.
dmichael (off chromium) 2012/01/17 22:14:28 "the" current
Takashi Toyoshima 2012/01/18 12:10:44 Ditto.
+ PP_WebSocketBinaryType_Dev GetBinaryType();
};
} // namespace pp
« no previous file with comments | « no previous file | ppapi/cpp/dev/websocket_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698