nsISpeculativeConnect.idl 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsISupports.idl"
  6. interface nsIPrincipal;
  7. interface nsIURI;
  8. interface nsIInterfaceRequestor;
  9. [scriptable, uuid(d74a17ac-5b8a-4824-a309-b1f04a3c4aed)]
  10. interface nsISpeculativeConnect : nsISupports
  11. {
  12. /**
  13. * Called as a hint to indicate a new transaction for the URI is likely coming
  14. * soon. The implementer may use this information to start a TCP
  15. * and/or SSL level handshake for that resource immediately so that it is
  16. * ready and/or progressed when the transaction is actually submitted.
  17. *
  18. * No obligation is taken on by the implementer, nor is the submitter obligated
  19. * to actually open the new channel.
  20. *
  21. * @param aURI the URI of the hinted transaction
  22. * @param aPrincipal the principal that will be used for opening the
  23. * channel of the hinted transaction.
  24. * @param aCallbacks any security callbacks for use with SSL for interfaces
  25. * such as nsIBadCertListener. May be null.
  26. *
  27. */
  28. void speculativeConnect(in nsIURI aURI,
  29. in nsIInterfaceRequestor aCallbacks);
  30. void speculativeConnect2(in nsIURI aURI,
  31. in nsIPrincipal aPrincipal,
  32. in nsIInterfaceRequestor aCallbacks);
  33. void speculativeAnonymousConnect(in nsIURI aURI,
  34. in nsIInterfaceRequestor aCallbacks);
  35. void speculativeAnonymousConnect2(in nsIURI aURI,
  36. in nsIPrincipal aPrincipal,
  37. in nsIInterfaceRequestor aCallbacks);
  38. };
  39. /**
  40. * This is used to override the default values for various values (documented
  41. * inline) to determine whether or not to actually make a speculative
  42. * connection.
  43. */
  44. [builtinclass, uuid(1040ebe3-6ed1-45a6-8587-995e082518d7)]
  45. interface nsISpeculativeConnectionOverrider : nsISupports
  46. {
  47. /**
  48. * Used to determine the maximum number of unused speculative connections
  49. * we will have open for a host at any one time
  50. */
  51. [infallible] readonly attribute unsigned long parallelSpeculativeConnectLimit;
  52. /**
  53. * Used to determine if we will ignore the existence of any currently idle
  54. * connections when we decide whether or not to make a speculative
  55. * connection.
  56. */
  57. [infallible] readonly attribute boolean ignoreIdle;
  58. /*
  59. * Used by the Predictor to gather telemetry data on speculative connection
  60. * usage.
  61. */
  62. [infallible] readonly attribute boolean isFromPredictor;
  63. /**
  64. * by default speculative connections are not made to RFC 1918 addresses
  65. */
  66. [infallible] readonly attribute boolean allow1918;
  67. };