nsIDashboard.idl 2.0 KB

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