summaryrefslogtreecommitdiffstats
path: root/toolkit/components/url-classifier/nsIUrlClassifierInfo.idl
blob: 0056d8fc8e038575735c451eb9da3c8e3536c8d7 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* 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"
#include "nsIArray.idl"

/**
 * nsIUrlClassifierPositiveCacheEntry Represents a positive cache entry.
 */
[scriptable, uuid(b3c27f8c-7db8-4f3f-97a5-5a94d781e565)]
interface nsIUrlClassifierPositiveCacheEntry : nsISupports {
  /**
   * Fullhash for the positive cache entry.
   */
  readonly attribute ACString fullhash;

  /**
   * Positive cache expiry.
   */
  readonly attribute long long expiry;
};

/**
 * nsIUrlClassifierCacheEntry contains cache information for
 * a given prefix.
 */
[scriptable, uuid(d6297907-8236-4126-adaf-c3aa239a0d40)]
interface nsIUrlClassifierCacheEntry : nsISupports {
  /**
   * Prefix for this cache entry.
   */
  readonly attribute ACString prefix;

  /**
   * Negative cache expiry.
   */
  readonly attribute long long expiry;

  /**
   * An array of nsIUrlClassifierPositiveCacheEntry, each item represents
   * a positive cache entry with its fullhash and expiry.
   */
  readonly attribute nsIArray matches;
};

/**
 * Cache information for a given table.
 */
[scriptable, function, uuid(69384f24-d9c5-4462-b24e-351c69e3b46a)]
interface nsIUrlClassifierCacheInfo : nsISupports {
  /**
   * Table name.
   */
  readonly attribute ACString table;

  /*
   * An array of nsIUrlClassifierCacheEntry.
   */
  readonly attribute nsIArray entries;
};

[scriptable, uuid(26e12ea4-14ff-4c77-858f-6745998b7659)]
interface nsIUrlClassifierGetCacheCallback : nsISupports {

  void onGetCacheComplete(in nsIUrlClassifierCacheInfo info);
};

/**
 * Interface to query url-classifier information.
 */
[scriptable, function, uuid(411bbff4-1b88-4687-aa36-e2bbdd93f6e8)]
interface nsIUrlClassifierInfo : nsISupports {
  /**
   * An asynchronous call to return cache information for the table.
   */
  void getCacheInfo(in ACString table,
                    in nsIUrlClassifierGetCacheCallback callback);
};