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 e405b48f28990623e0db120b711509439d4e3f74..ccfefc8263875f1bacf626627bd8df9aea883b2c 100644 |
--- a/chrome/common/extensions/api/experimental_socket.idl |
+++ b/chrome/common/extensions/api/experimental_socket.idl |
@@ -56,6 +56,27 @@ namespace experimental.socket { |
long port; |
}; |
+ dictionary SocketInfo { |
+ // The type of the passed socket. This will be code <code>tcp</code> or |
benwells
2012/07/26 04:18:37
In "This will be code <code>tcp..." is the first c
thorogood
2012/07/26 06:19:50
Typo, thanks.
|
+ // <code>udp</code>. |
+ SocketType socketType; |
+ |
+ // Whether this socket is currently connected. |
+ boolean connected; |
+ |
+ // If this socket is connected, contains the IPv4/6 address of the peer. |
+ DOMString? peerAddress; |
+ |
+ // Optionally contains the port of the connected peer. |
benwells
2012/07/26 04:18:37
As this is a return value optional is unclear. You
thorogood
2012/07/26 06:19:50
Done.
|
+ long? peerPort; |
+ |
+ // If this socket is bound or connected, contains its local IPv4/6 address. |
+ DOMString? localAddress; |
+ |
+ // Optionally contains the local port. |
benwells
2012/07/26 04:18:37
Same re optional
thorogood
2012/07/26 06:19:50
Done.
|
+ long? localPort; |
+ }; |
+ |
callback RecvFromCallback = void (RecvFromInfo recvFromInfo); |
callback SendToCallback = void (WriteInfo writeInfo); |
@@ -64,6 +85,8 @@ namespace experimental.socket { |
callback SetNoDelayCallback = void (boolean result); |
+ callback GetInfoCallback = void (SocketInfo result); |
+ |
interface Functions { |
// Creates a socket of the specified type that will connect to the specified |
// remote machine. |
@@ -162,6 +185,12 @@ namespace experimental.socket { |
static void setNoDelay(long socketId, |
boolean noDelay, |
SetNoDelayCallback callback); |
+ |
+ // Retrieve the state of the given socket. |
+ // |socketId| : The socketId. |
+ // |callback| : Called when the state is available. |
+ static void getInfo(long socketId, |
+ GetInfoCallback callback); |
}; |
}; |