OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
| 5 // Use the <code>chrome.diagnostics</code> API to query various properties of |
| 6 // the environment that may be useful for diagnostics. |
5 namespace diagnostics { | 7 namespace diagnostics { |
6 dictionary SendPacketOptions { | 8 dictionary SendPacketOptions { |
7 // Target IP address. | 9 // Target IP address. |
8 DOMString ip; | 10 DOMString ip; |
9 // Packet time to live value. If omitted, the system default value will be | 11 // Packet time to live value. If omitted, the system default value will be |
10 // used. | 12 // used. |
11 long? ttl; | 13 long? ttl; |
12 // Packet timeout in seconds. If omitted, the system default value will be | 14 // Packet timeout in seconds. If omitted, the system default value will be |
13 // used. | 15 // used. |
14 long? timeout; | 16 long? timeout; |
15 // Size of the payload. If omitted, the system default value will be used. | 17 // Size of the payload. If omitted, the system default value will be used. |
16 long? size; | 18 long? size; |
17 }; | 19 }; |
18 | 20 |
19 dictionary SendPacketResult { | 21 dictionary SendPacketResult { |
20 // The IP of the host which we recieves the ICMP reply from. | 22 // The IP of the host which we recieves the ICMP reply from. |
21 // The IP may differs from our target IP if the packet's ttl is used up. | 23 // The IP may differs from our target IP if the packet's ttl is used up. |
22 DOMString ip; | 24 DOMString ip; |
23 | 25 |
24 // Latency in millisenconds. | 26 // Latency in millisenconds. |
25 double latency; | 27 double latency; |
26 }; | 28 }; |
27 | 29 |
28 callback SendPacketCallback = void(SendPacketResult result); | 30 callback SendPacketCallback = void(SendPacketResult result); |
29 | 31 |
30 interface Functions { | 32 interface Functions { |
31 // Send a packet of the given type with the given parameters. | 33 // Send a packet of the given type with the given parameters. |
32 static void sendPacket(SendPacketOptions options, | 34 static void sendPacket(SendPacketOptions options, |
33 SendPacketCallback callback); | 35 SendPacketCallback callback); |
34 }; | 36 }; |
35 }; | 37 }; |
OLD | NEW |