Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsLoadGroup_h__ |
michael@0 | 7 | #define nsLoadGroup_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsILoadGroup.h" |
michael@0 | 10 | #include "nsILoadGroupChild.h" |
michael@0 | 11 | #include "nsPILoadGroupInternal.h" |
michael@0 | 12 | #include "nsAgg.h" |
michael@0 | 13 | #include "nsCOMPtr.h" |
michael@0 | 14 | #include "nsWeakPtr.h" |
michael@0 | 15 | #include "nsWeakReference.h" |
michael@0 | 16 | #include "nsISupportsPriority.h" |
michael@0 | 17 | #include "pldhash.h" |
michael@0 | 18 | #include "mozilla/TimeStamp.h" |
michael@0 | 19 | |
michael@0 | 20 | class nsILoadGroupConnectionInfo; |
michael@0 | 21 | class nsITimedChannel; |
michael@0 | 22 | |
michael@0 | 23 | class nsLoadGroup : public nsILoadGroup, |
michael@0 | 24 | public nsILoadGroupChild, |
michael@0 | 25 | public nsISupportsPriority, |
michael@0 | 26 | public nsSupportsWeakReference, |
michael@0 | 27 | public nsPILoadGroupInternal |
michael@0 | 28 | { |
michael@0 | 29 | public: |
michael@0 | 30 | NS_DECL_AGGREGATED |
michael@0 | 31 | |
michael@0 | 32 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 33 | // nsIRequest methods: |
michael@0 | 34 | NS_DECL_NSIREQUEST |
michael@0 | 35 | |
michael@0 | 36 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 37 | // nsILoadGroup methods: |
michael@0 | 38 | NS_DECL_NSILOADGROUP |
michael@0 | 39 | NS_DECL_NSPILOADGROUPINTERNAL |
michael@0 | 40 | |
michael@0 | 41 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 42 | // nsILoadGroupChild methods: |
michael@0 | 43 | NS_DECL_NSILOADGROUPCHILD |
michael@0 | 44 | |
michael@0 | 45 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 46 | // nsISupportsPriority methods: |
michael@0 | 47 | NS_DECL_NSISUPPORTSPRIORITY |
michael@0 | 48 | |
michael@0 | 49 | //////////////////////////////////////////////////////////////////////////// |
michael@0 | 50 | // nsLoadGroup methods: |
michael@0 | 51 | |
michael@0 | 52 | nsLoadGroup(nsISupports* outer); |
michael@0 | 53 | |
michael@0 | 54 | nsresult Init(); |
michael@0 | 55 | |
michael@0 | 56 | protected: |
michael@0 | 57 | virtual ~nsLoadGroup(); |
michael@0 | 58 | |
michael@0 | 59 | nsresult MergeLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags); |
michael@0 | 60 | |
michael@0 | 61 | private: |
michael@0 | 62 | void TelemetryReport(); |
michael@0 | 63 | void TelemetryReportChannel(nsITimedChannel *timedChannel, |
michael@0 | 64 | bool defaultRequest); |
michael@0 | 65 | |
michael@0 | 66 | protected: |
michael@0 | 67 | uint32_t mForegroundCount; |
michael@0 | 68 | uint32_t mLoadFlags; |
michael@0 | 69 | uint32_t mDefaultLoadFlags; |
michael@0 | 70 | |
michael@0 | 71 | nsCOMPtr<nsILoadGroup> mLoadGroup; // load groups can contain load groups |
michael@0 | 72 | nsCOMPtr<nsIInterfaceRequestor> mCallbacks; |
michael@0 | 73 | nsCOMPtr<nsILoadGroupConnectionInfo> mConnectionInfo; |
michael@0 | 74 | |
michael@0 | 75 | nsCOMPtr<nsIRequest> mDefaultLoadRequest; |
michael@0 | 76 | PLDHashTable mRequests; |
michael@0 | 77 | |
michael@0 | 78 | nsWeakPtr mObserver; |
michael@0 | 79 | nsWeakPtr mParentLoadGroup; |
michael@0 | 80 | |
michael@0 | 81 | nsresult mStatus; |
michael@0 | 82 | int32_t mPriority; |
michael@0 | 83 | bool mIsCanceling; |
michael@0 | 84 | |
michael@0 | 85 | /* Telemetry */ |
michael@0 | 86 | mozilla::TimeStamp mDefaultRequestCreationTime; |
michael@0 | 87 | bool mDefaultLoadIsTimed; |
michael@0 | 88 | uint32_t mTimedRequests; |
michael@0 | 89 | uint32_t mCachedRequests; |
michael@0 | 90 | |
michael@0 | 91 | /* For nsPILoadGroupInternal */ |
michael@0 | 92 | uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad; |
michael@0 | 93 | }; |
michael@0 | 94 | |
michael@0 | 95 | #endif // nsLoadGroup_h__ |