michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsLoadGroup_h__ michael@0: #define nsLoadGroup_h__ michael@0: michael@0: #include "nsILoadGroup.h" michael@0: #include "nsILoadGroupChild.h" michael@0: #include "nsPILoadGroupInternal.h" michael@0: #include "nsAgg.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsWeakPtr.h" michael@0: #include "nsWeakReference.h" michael@0: #include "nsISupportsPriority.h" michael@0: #include "pldhash.h" michael@0: #include "mozilla/TimeStamp.h" michael@0: michael@0: class nsILoadGroupConnectionInfo; michael@0: class nsITimedChannel; michael@0: michael@0: class nsLoadGroup : public nsILoadGroup, michael@0: public nsILoadGroupChild, michael@0: public nsISupportsPriority, michael@0: public nsSupportsWeakReference, michael@0: public nsPILoadGroupInternal michael@0: { michael@0: public: michael@0: NS_DECL_AGGREGATED michael@0: michael@0: //////////////////////////////////////////////////////////////////////////// michael@0: // nsIRequest methods: michael@0: NS_DECL_NSIREQUEST michael@0: michael@0: //////////////////////////////////////////////////////////////////////////// michael@0: // nsILoadGroup methods: michael@0: NS_DECL_NSILOADGROUP michael@0: NS_DECL_NSPILOADGROUPINTERNAL michael@0: michael@0: //////////////////////////////////////////////////////////////////////////// michael@0: // nsILoadGroupChild methods: michael@0: NS_DECL_NSILOADGROUPCHILD michael@0: michael@0: //////////////////////////////////////////////////////////////////////////// michael@0: // nsISupportsPriority methods: michael@0: NS_DECL_NSISUPPORTSPRIORITY michael@0: michael@0: //////////////////////////////////////////////////////////////////////////// michael@0: // nsLoadGroup methods: michael@0: michael@0: nsLoadGroup(nsISupports* outer); michael@0: michael@0: nsresult Init(); michael@0: michael@0: protected: michael@0: virtual ~nsLoadGroup(); michael@0: michael@0: nsresult MergeLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags); michael@0: michael@0: private: michael@0: void TelemetryReport(); michael@0: void TelemetryReportChannel(nsITimedChannel *timedChannel, michael@0: bool defaultRequest); michael@0: michael@0: protected: michael@0: uint32_t mForegroundCount; michael@0: uint32_t mLoadFlags; michael@0: uint32_t mDefaultLoadFlags; michael@0: michael@0: nsCOMPtr mLoadGroup; // load groups can contain load groups michael@0: nsCOMPtr mCallbacks; michael@0: nsCOMPtr mConnectionInfo; michael@0: michael@0: nsCOMPtr mDefaultLoadRequest; michael@0: PLDHashTable mRequests; michael@0: michael@0: nsWeakPtr mObserver; michael@0: nsWeakPtr mParentLoadGroup; michael@0: michael@0: nsresult mStatus; michael@0: int32_t mPriority; michael@0: bool mIsCanceling; michael@0: michael@0: /* Telemetry */ michael@0: mozilla::TimeStamp mDefaultRequestCreationTime; michael@0: bool mDefaultLoadIsTimed; michael@0: uint32_t mTimedRequests; michael@0: uint32_t mCachedRequests; michael@0: michael@0: /* For nsPILoadGroupInternal */ michael@0: uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad; michael@0: }; michael@0: michael@0: #endif // nsLoadGroup_h__