|
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 |
|
6 #ifndef nsLoadGroup_h__ |
|
7 #define nsLoadGroup_h__ |
|
8 |
|
9 #include "nsILoadGroup.h" |
|
10 #include "nsILoadGroupChild.h" |
|
11 #include "nsPILoadGroupInternal.h" |
|
12 #include "nsAgg.h" |
|
13 #include "nsCOMPtr.h" |
|
14 #include "nsWeakPtr.h" |
|
15 #include "nsWeakReference.h" |
|
16 #include "nsISupportsPriority.h" |
|
17 #include "pldhash.h" |
|
18 #include "mozilla/TimeStamp.h" |
|
19 |
|
20 class nsILoadGroupConnectionInfo; |
|
21 class nsITimedChannel; |
|
22 |
|
23 class nsLoadGroup : public nsILoadGroup, |
|
24 public nsILoadGroupChild, |
|
25 public nsISupportsPriority, |
|
26 public nsSupportsWeakReference, |
|
27 public nsPILoadGroupInternal |
|
28 { |
|
29 public: |
|
30 NS_DECL_AGGREGATED |
|
31 |
|
32 //////////////////////////////////////////////////////////////////////////// |
|
33 // nsIRequest methods: |
|
34 NS_DECL_NSIREQUEST |
|
35 |
|
36 //////////////////////////////////////////////////////////////////////////// |
|
37 // nsILoadGroup methods: |
|
38 NS_DECL_NSILOADGROUP |
|
39 NS_DECL_NSPILOADGROUPINTERNAL |
|
40 |
|
41 //////////////////////////////////////////////////////////////////////////// |
|
42 // nsILoadGroupChild methods: |
|
43 NS_DECL_NSILOADGROUPCHILD |
|
44 |
|
45 //////////////////////////////////////////////////////////////////////////// |
|
46 // nsISupportsPriority methods: |
|
47 NS_DECL_NSISUPPORTSPRIORITY |
|
48 |
|
49 //////////////////////////////////////////////////////////////////////////// |
|
50 // nsLoadGroup methods: |
|
51 |
|
52 nsLoadGroup(nsISupports* outer); |
|
53 |
|
54 nsresult Init(); |
|
55 |
|
56 protected: |
|
57 virtual ~nsLoadGroup(); |
|
58 |
|
59 nsresult MergeLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags); |
|
60 |
|
61 private: |
|
62 void TelemetryReport(); |
|
63 void TelemetryReportChannel(nsITimedChannel *timedChannel, |
|
64 bool defaultRequest); |
|
65 |
|
66 protected: |
|
67 uint32_t mForegroundCount; |
|
68 uint32_t mLoadFlags; |
|
69 uint32_t mDefaultLoadFlags; |
|
70 |
|
71 nsCOMPtr<nsILoadGroup> mLoadGroup; // load groups can contain load groups |
|
72 nsCOMPtr<nsIInterfaceRequestor> mCallbacks; |
|
73 nsCOMPtr<nsILoadGroupConnectionInfo> mConnectionInfo; |
|
74 |
|
75 nsCOMPtr<nsIRequest> mDefaultLoadRequest; |
|
76 PLDHashTable mRequests; |
|
77 |
|
78 nsWeakPtr mObserver; |
|
79 nsWeakPtr mParentLoadGroup; |
|
80 |
|
81 nsresult mStatus; |
|
82 int32_t mPriority; |
|
83 bool mIsCanceling; |
|
84 |
|
85 /* Telemetry */ |
|
86 mozilla::TimeStamp mDefaultRequestCreationTime; |
|
87 bool mDefaultLoadIsTimed; |
|
88 uint32_t mTimedRequests; |
|
89 uint32_t mCachedRequests; |
|
90 |
|
91 /* For nsPILoadGroupInternal */ |
|
92 uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad; |
|
93 }; |
|
94 |
|
95 #endif // nsLoadGroup_h__ |