nsIUrlClassifierHashCompleter.idl 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. /**
  6. * This interface is implemented by nsIUrlClassifierHashCompleter clients.
  7. */
  8. [scriptable, uuid(da16de40-df26-414d-bde7-c4faf4504868)]
  9. interface nsIUrlClassifierHashCompleterCallback : nsISupports
  10. {
  11. /**
  12. * A complete hash has been found that matches the partial hash.
  13. * This method may be called 0-n times for a given
  14. * nsIUrlClassifierCompleter::complete() call.
  15. *
  16. * @param hash
  17. * The 128-bit hash that was discovered.
  18. * @param table
  19. * The name of the table that this hash belongs to.
  20. * @param chunkId
  21. * The database chunk that this hash belongs to.
  22. */
  23. void completion(in ACString hash,
  24. in ACString table,
  25. in uint32_t chunkId);
  26. /**
  27. * The completion is complete. This method is called once per
  28. * nsIUrlClassifierCompleter::complete() call, after all completion()
  29. * calls are finished.
  30. *
  31. * @param status
  32. * NS_OK if the request completed successfully, or an error code.
  33. */
  34. void completionFinished(in nsresult status);
  35. };
  36. /**
  37. * Clients updating the url-classifier database have the option of sending
  38. * partial (32-bit) hashes of URL fragments to be blacklisted. If the
  39. * url-classifier encounters one of these truncated hashes, it will ask an
  40. * nsIUrlClassifierCompleter instance to asynchronously provide the complete
  41. * hash, along with some associated metadata.
  42. * This is only ever used for testing and should absolutely be deleted (I
  43. * think).
  44. */
  45. [scriptable, uuid(231fb2ad-ea8a-4e63-a331-eafc3b434811)]
  46. interface nsIUrlClassifierHashCompleter : nsISupports
  47. {
  48. /**
  49. * Request a completed hash from the given gethash url.
  50. *
  51. * @param partialHash
  52. * The 32-bit hash encountered by the url-classifier.
  53. * @param gethashUrl
  54. * The gethash url to use.
  55. * @param callback
  56. * An nsIUrlClassifierCompleterCallback instance.
  57. */
  58. void complete(in ACString partialHash,
  59. in ACString gethashUrl,
  60. in nsIUrlClassifierHashCompleterCallback callback);
  61. };