summaryrefslogtreecommitdiff
path: root/dom/network/interfaces/nsINetworkStatsServiceProxy.idl
blob: cd6765c68a4da9b32d466e72c571d914a8854155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

interface nsINetworkInfo;

[scriptable, function, uuid(5f821529-1d80-4ab5-a933-4e1b3585b6bc)]
interface nsINetworkStatsServiceProxyCallback : nsISupports
{
  /*
   * @param aResult callback result with boolean value
   * @param aMessage message
   */
  void notify(in boolean aResult, in jsval aMessage);
};

[scriptable, uuid(f4f3e901-e102-499d-9d37-dc9951f52df7)]
interface nsINetworkStatsServiceProxy : nsISupports
{
  /*
   * An interface used to record per-app traffic data.
   * @param aAppId app id
   * @param aIsInIsolatedMozBrowser
   *        true if the frame is an isolated mozbrowser element. <iframe
   *        mozbrowser mozapp> and <xul:browser> are not considered to be
   *        mozbrowser elements.  <iframe mozbrowser noisolation> does not count
   *        as isolated since isolation is disabled.  Isolation can only be
   *        disabled if the containing document is chrome.
   * @param aNetworkInterface network
   * @param aTimeStamp time stamp
   * @param aRxBytes received data amount
   * @param aTxBytes transmitted data amount
   * @param aIsAccumulative is stats accumulative
   * @param aCallback an optional callback
   */
  void saveAppStats(in unsigned long aAppId,
                    in boolean aIsInIsolatedMozBrowser,
                    in nsINetworkInfo aNetworkInfo,
                    in unsigned long long aTimeStamp,
                    in unsigned long long aRxBytes,
                    in unsigned long long aTxBytes,
                    in boolean aIsAccumulative,
         [optional] in nsINetworkStatsServiceProxyCallback aCallback);

  /*
   * An interface used to record per-system service traffic data.
   * @param aServiceType system service type
   * @param aNetworkInterface network
   * @param aTimeStamp time stamp
   * @param aRxBytes received data amount
   * @param aTxBytes transmitted data amount
   * @param aIsAccumulative is stats accumulative
   * @param aCallback an optional callback
   */
  void saveServiceStats(in string aServiceType,
                        in nsINetworkInfo aNetworkInfo,
                        in unsigned long long aTimeStamp,
                        in unsigned long long aRxBytes,
                        in unsigned long long aTxBytes,
                        in boolean aIsAccumulative,
             [optional] in nsINetworkStatsServiceProxyCallback aCallback);
};