| 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..3944e775203654b0150a9f01587706fe55ef6bd3
|
| --- /dev/null
|
| +++ b/chrome/common/extensions/api/experimental_socket.idl
|
| @@ -0,0 +1,36 @@
|
| +// 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 {
|
| +
|
| + 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.
|
| + // |backlog| : Length of the socket's accept queue.
|
| + static void listen(long socketId,
|
| + 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);
|
| + };
|
| +
|
| +};
|
|
|