nsLoadGroup.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* -*- Mode: C++; tab-width: 2; 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. #ifndef nsLoadGroup_h__
  6. #define nsLoadGroup_h__
  7. #include "nsILoadGroup.h"
  8. #include "nsILoadGroupChild.h"
  9. #include "nsPILoadGroupInternal.h"
  10. #include "nsAgg.h"
  11. #include "nsCOMPtr.h"
  12. #include "nsWeakPtr.h"
  13. #include "nsWeakReference.h"
  14. #include "nsISupportsPriority.h"
  15. #include "PLDHashTable.h"
  16. #include "mozilla/TimeStamp.h"
  17. class nsIRequestContext;
  18. class nsIRequestContextService;
  19. class nsITimedChannel;
  20. namespace mozilla {
  21. namespace net {
  22. class nsLoadGroup : public nsILoadGroup,
  23. public nsILoadGroupChild,
  24. public nsISupportsPriority,
  25. public nsSupportsWeakReference,
  26. public nsPILoadGroupInternal
  27. {
  28. public:
  29. NS_DECL_AGGREGATED
  30. ////////////////////////////////////////////////////////////////////////////
  31. // nsIRequest methods:
  32. NS_DECL_NSIREQUEST
  33. ////////////////////////////////////////////////////////////////////////////
  34. // nsILoadGroup methods:
  35. NS_DECL_NSILOADGROUP
  36. NS_DECL_NSPILOADGROUPINTERNAL
  37. ////////////////////////////////////////////////////////////////////////////
  38. // nsILoadGroupChild methods:
  39. NS_DECL_NSILOADGROUPCHILD
  40. ////////////////////////////////////////////////////////////////////////////
  41. // nsISupportsPriority methods:
  42. NS_DECL_NSISUPPORTSPRIORITY
  43. ////////////////////////////////////////////////////////////////////////////
  44. // nsLoadGroup methods:
  45. explicit nsLoadGroup(nsISupports* outer);
  46. virtual ~nsLoadGroup();
  47. nsresult Init();
  48. protected:
  49. nsresult MergeLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags);
  50. nsresult MergeDefaultLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags);
  51. protected:
  52. uint32_t mForegroundCount;
  53. uint32_t mLoadFlags;
  54. uint32_t mDefaultLoadFlags;
  55. nsCOMPtr<nsILoadGroup> mLoadGroup; // load groups can contain load groups
  56. nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
  57. nsCOMPtr<nsIRequestContext> mRequestContext;
  58. nsCOMPtr<nsIRequestContextService> mRequestContextService;
  59. nsCOMPtr<nsIRequest> mDefaultLoadRequest;
  60. PLDHashTable mRequests;
  61. nsWeakPtr mObserver;
  62. nsWeakPtr mParentLoadGroup;
  63. nsresult mStatus;
  64. int32_t mPriority;
  65. bool mIsCanceling;
  66. bool mDefaultLoadIsTimed;
  67. uint32_t mTimedRequests;
  68. uint32_t mCachedRequests;
  69. /* For nsPILoadGroupInternal */
  70. uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad;
  71. };
  72. } // namespace net
  73. } // namespace mozilla
  74. #endif // nsLoadGroup_h__