|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #include "nsISupports.idl" |
|
6 |
|
7 /* A JavaScript callback function that takes a JSON as its parameter. |
|
8 * The returned JSON contains arrays with data |
|
9 */ |
|
10 [scriptable, function, uuid(19d7f24f-a95a-4fd9-87e2-d96e9e4b1f6d)] |
|
11 interface NetDashboardCallback : nsISupports |
|
12 { |
|
13 void onDashboardDataAvailable(in jsval data); |
|
14 }; |
|
15 |
|
16 /* The dashboard service. |
|
17 * The async API returns JSONs, which hold arrays with the required info. |
|
18 * Only one request of each type may be pending at any time. |
|
19 */ |
|
20 [scriptable, uuid(c79eb3c6-091a-45a6-8544-5a8d1ab79537)] |
|
21 interface nsIDashboard : nsISupports |
|
22 { |
|
23 /* Arrays: host, port, tcp, active, socksent, sockreceived |
|
24 * Values: sent, received */ |
|
25 void requestSockets(in NetDashboardCallback cb); |
|
26 |
|
27 /* Arrays: host, port, spdy, ssl |
|
28 * Array of arrays: active, idle */ |
|
29 void requestHttpConnections(in NetDashboardCallback cb); |
|
30 |
|
31 /* Arrays: hostport, encrypted, msgsent, msgreceived, sentsize, receivedsize */ |
|
32 void requestWebsocketConnections(in NetDashboardCallback cb); |
|
33 |
|
34 /* Arrays: hostname, family, hostaddr, expiration */ |
|
35 void requestDNSInfo(in NetDashboardCallback cb); |
|
36 |
|
37 /* aProtocol: a transport layer protocol: |
|
38 * ex: "ssl", "tcp", default is "tcp". |
|
39 * aHost: the host's name |
|
40 * aPort: the port which the connection will open on |
|
41 * aTimeout: the timespan before the connection will be timed out */ |
|
42 void requestConnection(in ACString aHost, in unsigned long aPort, |
|
43 in string aProtocol, in unsigned long aTimeout, |
|
44 in NetDashboardCallback cb); |
|
45 |
|
46 /* When true, the service will log websocket events */ |
|
47 attribute boolean enableLogging; |
|
48 |
|
49 /* DNS resolver for host name |
|
50 * aHost: host name */ |
|
51 void requestDNSLookup(in ACString aHost, in NetDashboardCallback cb); |
|
52 }; |