summaryrefslogtreecommitdiffstats
path: root/ppapi/api
diff options
context:
space:
mode:
authorygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-22 15:56:03 +0000
committerygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-22 15:56:03 +0000
commit20e3112e65dd794b794bdabd53bc4542b767ad2d (patch)
treef84c170eab4600c7036af549039078eeb477a262 /ppapi/api
parent11039d76fa14f1b007272144c0b300a19711532b (diff)
downloadchromium_src-20e3112e65dd794b794bdabd53bc4542b767ad2d.zip
chromium_src-20e3112e65dd794b794bdabd53bc4542b767ad2d.tar.gz
chromium_src-20e3112e65dd794b794bdabd53bc4542b767ad2d.tar.bz2
Exposed Listen and Accept methods to in-process plugins.
BUG=108277 TEST=UI test TestTCPServerSocketPrivate Review URL: http://codereview.chromium.org/9283022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api')
-rw-r--r--ppapi/api/private/ppb_tcp_server_socket_private.idl61
1 files changed, 61 insertions, 0 deletions
diff --git a/ppapi/api/private/ppb_tcp_server_socket_private.idl b/ppapi/api/private/ppb_tcp_server_socket_private.idl
new file mode 100644
index 0000000..a1224e1
--- /dev/null
+++ b/ppapi/api/private/ppb_tcp_server_socket_private.idl
@@ -0,0 +1,61 @@
+/* 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.
+ */
+
+/**
+ * This file defines the <code>PPB_TCPServerSocket_Private</code> interface.
+ */
+
+label Chrome {
+ M18 = 0.1
+};
+
+/**
+ * The <code>PPB_TCPServerSocket_Private</code> interface provides TCP
+ * server socket operations.
+ */
+interface PPB_TCPServerSocket_Private {
+ /**
+ * Allocates a TCP server socket resource.
+ */
+ PP_Resource Create([in] PP_Instance instance);
+
+ /**
+ * Determines if a given resource is TCP server socket.
+ */
+ PP_Bool IsTCPServerSocket([in] PP_Resource resource);
+
+ /**
+ * Binds |tcp_server_socket| to the address given by |addr| and
+ * starts listening. The |backlog| argument defines the maximum
+ * length to which the queue of pending connections may
+ * grow. |callback| is invoked when |tcp_server_socket| is ready to
+ * accept incoming connections or in the case of failure. Returns
+ * PP_ERROR_NOSPACE if socket can't be initialized, or
+ * PP_ERROR_FAILED in the case of Listen failure. Otherwise, returns
+ * PP_OK.
+ */
+ int32_t Listen([in] PP_Resource tcp_server_socket,
+ [in] PP_NetAddress_Private addr,
+ [in] int32_t backlog,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Accepts single connection, creates instance of
+ * PPB_TCPSocket_Private and stores reference to it in
+ * |tcp_socket|. |callback| is invoked when connection is accepted
+ * or in the case of failure. This method can be called only after
+ * succesfull Listen call on |tcp_server_socket|.
+ */
+ int32_t Accept([in] PP_Resource tcp_server_socket,
+ [out] PP_Resource tcp_socket,
+ [in] PP_CompletionCallback callback);
+
+ /**
+ * Cancels all pending callbacks reporting PP_ERROR_ABORTED and
+ * closes the socket. Note: this method is implicitly called when
+ * server socket is destroyed.
+ */
+ void StopListening([in] PP_Resource tcp_server_socket);
+};