michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /* A JavaScript callback function that takes a JSON as its parameter. michael@0: * The returned JSON contains arrays with data michael@0: */ michael@0: [scriptable, function, uuid(19d7f24f-a95a-4fd9-87e2-d96e9e4b1f6d)] michael@0: interface NetDashboardCallback : nsISupports michael@0: { michael@0: void onDashboardDataAvailable(in jsval data); michael@0: }; michael@0: michael@0: /* The dashboard service. michael@0: * The async API returns JSONs, which hold arrays with the required info. michael@0: * Only one request of each type may be pending at any time. michael@0: */ michael@0: [scriptable, uuid(c79eb3c6-091a-45a6-8544-5a8d1ab79537)] michael@0: interface nsIDashboard : nsISupports michael@0: { michael@0: /* Arrays: host, port, tcp, active, socksent, sockreceived michael@0: * Values: sent, received */ michael@0: void requestSockets(in NetDashboardCallback cb); michael@0: michael@0: /* Arrays: host, port, spdy, ssl michael@0: * Array of arrays: active, idle */ michael@0: void requestHttpConnections(in NetDashboardCallback cb); michael@0: michael@0: /* Arrays: hostport, encrypted, msgsent, msgreceived, sentsize, receivedsize */ michael@0: void requestWebsocketConnections(in NetDashboardCallback cb); michael@0: michael@0: /* Arrays: hostname, family, hostaddr, expiration */ michael@0: void requestDNSInfo(in NetDashboardCallback cb); michael@0: michael@0: /* aProtocol: a transport layer protocol: michael@0: * ex: "ssl", "tcp", default is "tcp". michael@0: * aHost: the host's name michael@0: * aPort: the port which the connection will open on michael@0: * aTimeout: the timespan before the connection will be timed out */ michael@0: void requestConnection(in ACString aHost, in unsigned long aPort, michael@0: in string aProtocol, in unsigned long aTimeout, michael@0: in NetDashboardCallback cb); michael@0: michael@0: /* When true, the service will log websocket events */ michael@0: attribute boolean enableLogging; michael@0: michael@0: /* DNS resolver for host name michael@0: * aHost: host name */ michael@0: void requestDNSLookup(in ACString aHost, in NetDashboardCallback cb); michael@0: };