nsIApplicationCacheChannel.idl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsIApplicationCacheContainer.idl"
  7. /**
  8. * Interface implemented by channels that support application caches.
  9. */
  10. [scriptable, uuid(6FA816B1-6D5F-4380-9704-054D0908CFA3)]
  11. interface nsIApplicationCacheChannel : nsIApplicationCacheContainer
  12. {
  13. /**
  14. * TRUE when the resource came from the application cache. This
  15. * might be false even there is assigned an application cache
  16. * e.g. in case of fallback of load of an entry matching bypass
  17. * namespace.
  18. */
  19. readonly attribute boolean loadedFromApplicationCache;
  20. /**
  21. * When true, the channel will ask its notification callbacks for
  22. * an application cache if one is not explicitly provided. Default
  23. * value is true.
  24. *
  25. * NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen()
  26. * is called.
  27. */
  28. attribute boolean inheritApplicationCache;
  29. /**
  30. * When true, the channel will choose an application cache if one
  31. * was not explicitly provided and none is available from the
  32. * notification callbacks. Default value is false.
  33. *
  34. * This attribute will not be transferred through a redirect.
  35. *
  36. * NS_ERROR_ALREADY_OPENED will be thrown if set after AsyncOpen()
  37. * is called.
  38. */
  39. attribute boolean chooseApplicationCache;
  40. /**
  41. * A shortcut method to mark the cache item of this channel as 'foreign'.
  42. * See the 'cache selection algorithm' and CACHE_SELECTION_RELOAD
  43. * action handling in nsContentSink.
  44. */
  45. void markOfflineCacheEntryAsForeign();
  46. /**
  47. * Set offline application cache object to instruct the channel
  48. * to cache for offline use using this application cache.
  49. */
  50. attribute nsIApplicationCache applicationCacheForWrite;
  51. };