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

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

Issue 10440097: Move socket API from experimental to dev channel and remove some dead code (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Update Created 8 years, 5 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
« no previous file with comments | « chrome/common/extensions/api/api.gyp ('k') | chrome/common/extensions/api/socket.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
deleted file mode 100644
index e405b48f28990623e0db120b711509439d4e3f74..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/api/experimental_socket.idl
+++ /dev/null
@@ -1,167 +0,0 @@
-// 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.
-
-// File-level comment to appease parser. Eventually this will not be necessary.
-
-namespace experimental.socket {
- enum SocketType {
- tcp,
- udp
- };
-
- // The socket options.
- dictionary CreateOptions {
- // The schema generator does not support dictionaries without any fields.
- // Ignore this field.
- [nodoc] long? dummyValue;
- };
-
- dictionary CreateInfo {
- // The id of the newly created socket.
- long socketId;
- };
-
- callback CreateCallback = void (CreateInfo createInfo);
-
- callback ConnectCallback = void (long result);
-
- callback BindCallback = void (long result);
-
- dictionary ReadInfo {
- // The resultCode returned from the underlying read() call.
- long resultCode;
-
- ArrayBuffer data;
- };
-
- callback ReadCallback = void (ReadInfo readInfo);
-
- dictionary WriteInfo {
- // The number of bytes sent, or a negative error code.
- long bytesWritten;
- };
-
- callback WriteCallback = void (WriteInfo writeInfo);
-
- dictionary RecvFromInfo {
- // The resultCode returned from the underlying recvfrom() call.
- long resultCode;
-
- ArrayBuffer data;
-
- // The address of the remote machine.
- DOMString address;
-
- long port;
- };
-
- callback RecvFromCallback = void (RecvFromInfo recvFromInfo);
-
- callback SendToCallback = void (WriteInfo writeInfo);
-
- callback SetKeepAliveCallback = void (boolean result);
-
- callback SetNoDelayCallback = void (boolean result);
-
- interface Functions {
- // Creates a socket of the specified type that will connect to the specified
- // remote machine.
- // |type| : The type of socket to create. Must be <code>tcp</code> or
- // <code>udp</code>.
- // |options| : The socket options.
- // |callback| : Called when the socket has been created.
- static void create(SocketType type,
- optional CreateOptions options,
- CreateCallback callback);
-
- // Destroys the socket. Each socket created should be destroyed after use.
- // |socketId| : The socketId.
- static void destroy(long socketId);
-
- // Connects the socket to the remote machine.
- // |socketId| : The socketId.
- // |hostname| : The hostname or IP address of the remote machine.
- // |port| : The port of the remote machine.
- // |callback| : Called when the connection attempt is complete.
- static void connect(long socketId,
- DOMString hostname,
- long port,
- ConnectCallback callback);
-
- // Binds the local address for socket. Currently, it does not support
- // TCP socket.
- // |socketId| : The socketId.
- // |address| : The address of the local machine.
- // |port| : The port of the local machine.
- // |callback| : Called when the bind attempt is complete.
- static void bind(long socketId,
- DOMString address,
- long port,
- BindCallback callback);
-
- // Disconnects the socket. For UDP sockets, <code>disconnect</code> is a
- // non-operation but is safe to call.
- // |socketId| : The socketId.
- static void disconnect(long socketId);
-
- // Reads data from the given connected socket.
- // |socketId| : The socketId.
- // |bufferSize| : The read buffer size.
- // |callback| : Delivers data that was available to be read without
- // blocking.
- static void read(long socketId,
- optional long bufferSize,
- ReadCallback callback);
-
- // Writes data on the given connected socket.
- // |socketId| : The socketId.
- // |data| : The data to write.
- // |callback| : Called when the write operation completes without blocking
- // or an error occurs.
- static void write(long socketId,
- ArrayBuffer data,
- WriteCallback callback);
-
- // Receives data from the given UDP socket.
- // |socketId| : The socketId.
- // |bufferSize| : The receive buffer size.
- // |callback| : Returns result of the recvFrom operation.
- static void recvFrom(long socketId,
- optional long bufferSize,
- RecvFromCallback callback);
-
- // Sends data on the given UDP socket to the given address and port.
- // |socketId| : The socketId.
- // |data| : The data to write.
- // |address| : The address of the remote machine.
- // |port| : The port of the remote machine.
- // |callback| : Called when the send operation completes without blocking
- // or an error occurs.
- static void sendTo(long socketId,
- ArrayBuffer data,
- DOMString address,
- long port,
- SendToCallback callback);
-
- // Enable/disable keep-alive functionality for a TCP connection.
- // |socketId| : The socketId.
- // |enable| : If true, enable keep-alive functionality.
- // |delay| : Set the delay seconds between the last data packet received
- // and the first keepalive probe. Default is 0.
- // |callback| : Called when the setKeepAlive attempt is complete.
- static void setKeepAlive(long socketId,
- boolean enable,
- optional long delay,
- SetKeepAliveCallback callback);
-
- // Enable/disable Nagle algorithm.
- // |socketId| : The socketId.
- // |noDelay| : If true, disable Nagle algorithm.
- // |callback| : Called when the setNoDelay attempt is complete.
- static void setNoDelay(long socketId,
- boolean noDelay,
- SetNoDelayCallback callback);
- };
-
-};
« no previous file with comments | « chrome/common/extensions/api/api.gyp ('k') | chrome/common/extensions/api/socket.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698