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

Unified Diff: ppapi/apps_tests/experimental.socket.idl

Issue 9359040: WIP IDL-IPC2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Checkpoint before going back to returning ListValue via ExtensionMsg_Response. Created 8 years, 10 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 | « ipc/ipc_message_utils.h ('k') | ppapi/apps_tests/test1.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/apps_tests/experimental.socket.idl
diff --git a/ppapi/apps_tests/experimental.socket.idl b/ppapi/apps_tests/experimental.socket.idl
new file mode 100644
index 0000000000000000000000000000000000000000..98489bece3dff059095a2eaec6e0f5f15aed2305
--- /dev/null
+++ b/ppapi/apps_tests/experimental.socket.idl
@@ -0,0 +1,116 @@
+[nodoc] namespace experimental.socket {
+
+ // A socket event.
+ dictionary SocketEvent {
+ // A connectComplete event reports the result of a connect that blocked. A
+ // writeComplete event reports the result of a write that blocked. A
+ // dataRead event reports bytes that have arrived following a read call that
+ // blocked.
+ DOMString type;
+
+ // The result code, if the event type is writeComplete. The result code
+ // description matches that of <code>writeInfo.bytesWritten</code>.
+ long? resultCode;
+
+ // The data read, if the event type is dataRead.
+ DOMString? data;
+
+ // Whether this is the final event that this socket will send.
+ [nodoc] boolean isFinalEvent;
+
+ // An ID unique to the calling function's context so that events can get
+ // routed back to the correct callback.
+ [nodoc] long? srcId;
+ };
+
+ callback OnEventCallback = void (SocketEvent event);
+
+ // The socket options.
+ dictionary CreateOptions {
+ // This function is called with events that occur during the lifetime of the
+ // socket.
+ OnEventCallback? onEvent;
+ };
+
+ dictionary CreateCallbackSocketInfo {
+ // The id of the newly created socket.
+ long socketId;
+ };
+
+ callback CreateCallback = void (CreateCallbackSocketInfo socketInfo);
+
+ callback ConnectCallback = void (long result);
+
+ dictionary ReadCallbackReadInfo {
+ // The data received. Warning: will probably become a blob or other
+ // appropriate binary-friendly type.
+ DOMString message;
+ };
+
+ callback ReadCallback = void (ReadCallbackReadInfo readInfo);
+
+ dictionary WriteCallbackWriteInfo {
+ // The number of bytes sent, or a negative error code.
+ long bytesWritten;
+ };
+
+ callback WriteCallback = void (WriteCallbackWriteInfo writeInfo);
+
+ interface Functions {
+ // Creates a socket of the specified type that will connect to the specified
+ // remote machine.
+ // |type| : The type of socket to create. Must be <code>tcp</code> or
+ // <code>udp</code>.
+ // |address| : The address of the remote machine.
+ // |port| : The port of the remote machine.
+ // |options| : The socket options.
+ // |callback| : Called when the socket has been created.
+ static void create(DOMString type,
+ DOMString address,
+ long port,
+ optional CreateOptions options,
+ CreateCallback callBack);
+
+ // Destroys the socket. Each socket created should be destroyed after use.
+ // |socketId| : The socketId.
+ static void destroy(long socketId);
+
+ // Connects the socket to the remote machine. For UDP sockets,
+ // <code>connect</code> is a non-operation but is safe to call.
+ // |socketId| : The socketId.
+ // |callback| : Called when the connection attempt is complete.
+ static void connect(long socketId,
+ ConnectCallback callBack);
+
+ // Disconnects the socket. For UDP sockets, <code>disconnect</code> is a
+ // non-operation but is safe to call.
+ // |socketId| : The socketId.
+ static void disconnect(long socketId);
+
+ // Reads data from the given socket.
+ // |socketId| : The socketId.
+ // |callback| : Delivers data that was available to be read without
+ // blocking.
+ static void read(long socketId,
+ ReadCallback callBack);
+
+ // Writes data on the given socket.
+ // |socketId| : The socketId.
+ // |data| : The data to write. Warning: will probably become a blob or other
+ // appropriate binary-friendly type.
+ // |callback| : Called when the first of any of the following happens: the
+ // write operation completes without blocking, the write operation blocked
+ // before completion (in which case onEvent() will eventually be called with
+ // a <code>writeComplete</code> event), or an error occurred.
+ static void write(long socketId,
+ DOMString data,
+ WriteCallback callBack);
+ };
+
+ interface Events {
+ // Used to pass events back to the socket creator.
+ // |event| : The event indicating socket status.
+ static void onEvent(SocketEvent event);
+ };
+
+};
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ppapi/apps_tests/test1.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698