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

Side by Side Diff: chrome/common/extensions/api/experimental.socket.idl

Issue 10272021: Files generated by the JSON schema compiler are named incorrectly (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Renamed json files Created 8 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // File-level comment to appease parser. Eventually this will not be necessary.
6
7 [nodoc] namespace experimental.socket {
8 // The socket options.
9 dictionary CreateOptions {
10 // The schema generator does not support dictionaries without any fields.
11 // Ignore this field.
12 [nodoc] long? dummyValue;
13 };
14
15 dictionary CreateInfo {
16 // The id of the newly created socket.
17 long socketId;
18 };
19
20 callback CreateCallback = void (CreateInfo createInfo);
21
22 callback ConnectCallback = void (long result);
23
24 callback BindCallback = void (long result);
25
26 dictionary ReadInfo {
27 // The resultCode returned from the underlying read() call.
28 long resultCode;
29
30 // The data received. Warning: will probably become a blob or other
31 // appropriate binary-friendly type.
32 // TODO(miket): [instanceOf=ArrayBuffer]object data;
33 long[] data;
34 };
35
36 callback ReadCallback = void (ReadInfo readInfo);
37
38 dictionary WriteInfo {
39 // The number of bytes sent, or a negative error code.
40 long bytesWritten;
41 };
42
43 callback WriteCallback = void (WriteInfo writeInfo);
44
45 dictionary RecvFromInfo {
46 // The resultCode returned from the underlying read() call.
47 long resultCode;
48
49 // The data received. Warning: will probably become a blob or other
50 // appropriate binary-friendly type.
51 // TODO(miket): [instanceOf=ArrayBuffer]object data;
52 long[] data;
53 DOMString address;
54 long port;
55 };
56
57 callback RecvFromCallback = void (RecvFromInfo recvFromInfo);
58
59 callback SendToCallback = void (WriteInfo writeInfo);
60
61 interface Functions {
62 // Creates a socket of the specified type that will connect to the specified
63 // remote machine.
64 // |type| : The type of socket to create. Must be <code>tcp</code> or
65 // <code>udp</code>.
66 // |options| : The socket options.
67 // |callback| : Called when the socket has been created.
68 static void create(DOMString type,
69 optional CreateOptions options,
70 CreateCallback callback);
71
72 // Destroys the socket. Each socket created should be destroyed after use.
73 // |socketId| : The socketId.
74 static void destroy(long socketId);
75
76 // Connects the socket to the remote machine.
77 // |socketId| : The socketId.
78 // |address| : The address of the remote machine.
79 // |port| : The port of the remote machine.
80 // |callback| : Called when the connection attempt is complete.
81 static void connect(long socketId,
82 DOMString address,
83 long port,
84 ConnectCallback callback);
85
86 // Binds the local address for UDP socket. Currently, it does not support
87 // TCP socket.
88 // |socketId| : The socketId.
89 // |address| : The address of the remote machine.
90 // |port| : The port of the remote machine.
91 // |callback| : Called when the connection attempt is complete.
92 static void bind(long socketId,
93 DOMString address,
94 long port,
95 BindCallback callback);
96
97 // Disconnects the socket. For UDP sockets, <code>disconnect</code> is a
98 // non-operation but is safe to call.
99 // |socketId| : The socketId.
100 static void disconnect(long socketId);
101
102 // Reads data from the given socket.
103 // |socketId| : The socketId.
104 // |bufferSize| : The read buffer size.
105 // |callback| : Delivers data that was available to be read without
106 // blocking.
107 static void read(long socketId,
108 optional long bufferSize,
109 ReadCallback callback);
110
111 // Writes data on the given socket.
112 // |socketId| : The socketId.
113 // |data| : The data to write. Warning: will probably become a blob or other
114 // appropriate binary-friendly type.
115 // |callback| : Called when the first of any of the following happens: the
116 // write operation completes without blocking, the write operation blocked
117 // before completion (in which case onEvent() will eventually be called with
118 // a <code>writeComplete</code> event), or an error occurred.
119 // TODO(miket): [instanceOf=ArrayBuffer]object data;
120 static void write(long socketId,
121 long[] data,
122 WriteCallback callback);
123
124 // Reads data from the given socket.
125 // |socketId| : The socketId.
126 // |bufferSize| : The receive buffer size.
127 // |callback| : Delivers data that was available to be read without
128 // blocking.
129 static void recvFrom(long socketId,
130 optional long bufferSize,
131 RecvFromCallback callback);
132
133 // Writes data on the given socket.
134 // |socketId| : The socketId.
135 // |data| : The data to write. Warning: will probably become a blob or other
136 // appropriate binary-friendly type.
137 // |address| : The address of the remote machine.
138 // |port| : The port of the remote machine.
139 // |callback| : Called when the first of any of the following happens: the
140 // write operation completes without blocking, the write operation blocked
141 // before completion (in which case onEvent() will eventually be called with
142 // a <code>writeComplete</code> event), or an error occurred.
143 static void sendTo(long socketId,
144 long[] data,
145 DOMString address,
146 long port,
147 SendToCallback callback);
148 };
149
150 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698