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

Unified Diff: ppapi/cpp/websocket.h

Issue 9192009: WebSocket Pepper API: make the API out of dev (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove binary type handling interfaces 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
Index: ppapi/cpp/websocket.h
diff --git a/ppapi/cpp/dev/websocket_dev.h b/ppapi/cpp/websocket.h
similarity index 78%
rename from ppapi/cpp/dev/websocket_dev.h
rename to ppapi/cpp/websocket.h
index 2c55d51586b4ba0f43f6ee8e6b8647c933844a9c..61e61df0b66f6c1a7255bcfb223090dc315fbeb7 100644
--- a/ppapi/cpp/dev/websocket_dev.h
+++ b/ppapi/cpp/websocket.h
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef PPAPI_CPP_DEV_WEBSOCKET_DEV_H_
-#define PPAPI_CPP_DEV_WEBSOCKET_DEV_H_
+#ifndef PPAPI_CPP_WEBSOCKET_H_
+#define PPAPI_CPP_WEBSOCKET_H_
-#include "ppapi/c/dev/ppb_websocket_dev.h"
+#include "ppapi/c/ppb_websocket.h"
#include "ppapi/cpp/resource.h"
/// @file
-/// This file defines the WebSocket_Dev interface.
+/// This file defines the WebSocket interface.
namespace pp {
@@ -17,14 +17,14 @@ class CompletionCallback;
class Instance;
class Var;
-/// The <code>WebSocket_Dev</code> class
-class WebSocket_Dev : public Resource {
+/// The <code>WebSocket</code> class
+class WebSocket : public Resource {
public:
- /// Constructs a WebSocket_Dev object.
- WebSocket_Dev(Instance* instance);
+ /// Constructs a WebSocket object.
+ WebSocket(Instance* instance);
- /// Destructs a WebSocket_Dev object.
- virtual ~WebSocket_Dev();
+ /// Destructs a WebSocket object.
+ virtual ~WebSocket();
/// Connect() connects to the specified WebSocket server. Caller can call
/// this method at most once.
@@ -87,7 +87,8 @@ class WebSocket_Dev : public Resource {
///
/// @param[out] message The received message is copied to provided
/// <code>message</code>. The <code>message</code> must remain valid until
- /// the ReceiveMessage operation completes.
+ /// the ReceiveMessage operation completes. It will be a <code>Var</code> of
+ /// string or ArrayBuffer types on receiving.
/// @param[in] callback A <code>CompletionCallback</code> which is called
/// when the receiving message is completed. It is ignored if ReceiveMessage
/// completes synchronously and returns <code>PP_OK</code>.
@@ -105,13 +106,14 @@ class WebSocket_Dev : public Resource {
///
/// @param[in] data A message to send. The message is copied to internal
/// buffer. So caller can free <code>data</code> safely after returning
- /// from the function.
+ /// from the function. It must be a <code>Var</code> of string or ArrayBuffer
+ /// types.
///
/// @return An int32_t containing an error code from
/// <code>pp_errors.h</code>.
/// Returns <code>PP_ERROR_FAILED</code> if the ReadyState is
- /// <code>PP_WEBSOCKETREADYSTATE_CONNECTING_DEV</code>. It corresponds
- /// JavaScript InvalidStateError of the specification.
+ /// <code>PP_WEBSOCKETREADYSTATE_CONNECTING</code>. It corresponds JavaScript
+ /// InvalidStateError of the specification.
/// Returns <code>PP_ERROR_BADARGUMENT</code> if provided
/// <code>message</code> of string type contains an invalid character as a
/// UTF-8 string. It corresponds to JavaScript SyntaxError of the
@@ -167,44 +169,17 @@ class WebSocket_Dev : public Resource {
/// GetReadyState() returns the ready state of the specified WebSocket
/// connection.
///
- /// @return Returns <code>PP_WEBSOCKETREADYSTATE_INVALID_DEV</code> if called
+ /// @return Returns <code>PP_WEBSOCKETREADYSTATE_INVALID</code> if called
/// before connect() is called.
- PP_WebSocketReadyState_Dev GetReadyState();
+ PP_WebSocketReadyState GetReadyState();
/// GetURL() returns the URL associated with specified WebSocket connection.
///
/// @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
-#endif // PPAPI_CPP_DEV_WEBSOCKET_DEV_H_
+#endif // PPAPI_CPP_WEBSOCKET_H_

Powered by Google App Engine
This is Rietveld 408576698