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

Unified Diff: chrome/common/extensions/api/experimental_socket.idl

Issue 10796067: Improve the socket API documentation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix review issues. Created 8 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/api/experimental_socket.idl
diff --git a/chrome/common/extensions/api/experimental_socket.idl b/chrome/common/extensions/api/experimental_socket.idl
index bb17d763ca27f4ffc83d182dadbbe306a2d3c973..e405b48f28990623e0db120b711509439d4e3f74 100644
--- a/chrome/common/extensions/api/experimental_socket.idl
+++ b/chrome/common/extensions/api/experimental_socket.idl
@@ -45,11 +45,14 @@ namespace experimental.socket {
callback WriteCallback = void (WriteInfo writeInfo);
dictionary RecvFromInfo {
- // The resultCode returned from the underlying read() call.
+ // The resultCode returned from the underlying recvfrom() call.
long resultCode;
ArrayBuffer data;
+
+ // The address of the remote machine.
DOMString address;
+
long port;
};
@@ -102,7 +105,7 @@ namespace experimental.socket {
// |socketId| : The socketId.
static void disconnect(long socketId);
- // Reads data from the given socket.
+ // Reads data from the given connected socket.
// |socketId| : The socketId.
// |bufferSize| : The read buffer size.
// |callback| : Delivers data that was available to be read without
@@ -111,35 +114,30 @@ namespace experimental.socket {
optional long bufferSize,
ReadCallback callback);
- // Writes data on the given socket.
+ // Writes data on the given connected socket.
// |socketId| : The socketId.
// |data| : The data to write.
- // |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.
+ // |callback| : Called when the write operation completes without blocking
+ // or an error occurs.
static void write(long socketId,
ArrayBuffer data,
WriteCallback callback);
- // Reads data from the given socket.
+ // Receives data from the given UDP socket.
// |socketId| : The socketId.
// |bufferSize| : The receive buffer size.
- // |callback| : Delivers data that was available to be read without
- // blocking.
+ // |callback| : Returns result of the recvFrom operation.
static void recvFrom(long socketId,
optional long bufferSize,
RecvFromCallback callback);
- // Writes data on the given socket.
+ // Sends data on the given UDP socket to the given address and port.
// |socketId| : The socketId.
// |data| : The data to write.
// |address| : The address of the remote machine.
// |port| : The port of the remote machine.
- // |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.
+ // |callback| : Called when the send operation completes without blocking
+ // or an error occurs.
static void sendTo(long socketId,
ArrayBuffer data,
DOMString address,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698