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

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

Issue 10827390: Implement chrome.socket.bind/listen/accept for TCP server socket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add error if trying to bind TCP socket, remove TCP client socket bind. Created 8 years, 3 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: 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
new file mode 100644
index 0000000000000000000000000000000000000000..7165cd932c25b80da0d0e243c0b38479ae18bc88
--- /dev/null
+++ b/chrome/common/extensions/api/experimental_socket.idl
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+namespace experimental.socket {
miket_OOO 2012/09/24 18:14:21 Please take a look at "[extensions-team] Mixing st
justinlin 2012/09/26 08:59:59 Done.
+
+ dictionary AcceptInfo {
+ // The id of the accepted socket.
+ long socketId;
+ long resultCode;
+ };
+
+ callback ListenCallback = void (long result);
+
+ callback AcceptCallback = void (AcceptInfo acceptInfo);
+
+ interface Functions {
+ // This method applies to TCP sockets only.
+ // Listens for connections on the specified port that this socket was bound
+ // to. This effectively makes this a server socket and client socket
+ // functions (connect, read, write) can no longer be used on this socket.
+ // |socketId| : The socketId.
+ // |address| : The address of the local machine.
+ // |port| : The port of the local machine.
+ // |backlog| : Length of the socket's accept queue.
+ static void listen(long socketId,
+ DOMString address,
+ long port,
+ long backlog,
+ ListenCallback callback);
+
+ // This method applies to TCP sockets only.
+ // Starts waiting for connections on the listening server socket.
+ // |socketId| : The socketId.
+ // |callback| : The callback is invoked when a new socket is accepted.
+ static void accept(long socketId,
+ AcceptCallback callback);
+ };
+
+};

Powered by Google App Engine
This is Rietveld 408576698