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..e308314e9645c3b688a82eb52d6e9a55c7f6d5d1 100644 |
--- a/chrome/common/extensions/api/experimental_socket.idl |
+++ b/chrome/common/extensions/api/experimental_socket.idl |
@@ -53,6 +53,22 @@ namespace experimental.socket { |
long port; |
}; |
+ dictionary SocketInfo { |
+ // The type of the passed socket. |
+ SocketType socketType; |
+ |
+ // Whether this socket is currently connected. |
+ boolean connected; |
+ |
+ // Optionally represents the connected peer on this socket. This will be |
+ // in the form <code>ip:port</code>, e.g., <code>10.0.0.1:1234</code>. |
benwells
2012/07/24 08:05:33
Does it make more sense to have the port available
thorogood
2012/07/26 01:49:59
Yes, probably. I've broken it out.
|
+ DOMString? peer; |
+ |
+ // If bound, this is the local address of this socket. This will be in the |
+ // form <code>ip:port</code>, e.g., <code>[::0]:80</code>. |
+ DOMString? local; |
+ }; |
+ |
callback RecvFromCallback = void (RecvFromInfo recvFromInfo); |
callback SendToCallback = void (WriteInfo writeInfo); |
@@ -61,6 +77,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. |
@@ -164,6 +182,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); |
benwells
2012/07/24 08:05:33
nit: indentation
thorogood
2012/07/26 01:49:59
Done.
|
}; |
}; |