1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/base/src/nsLoadGroup.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,95 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsLoadGroup_h__ 1.10 +#define nsLoadGroup_h__ 1.11 + 1.12 +#include "nsILoadGroup.h" 1.13 +#include "nsILoadGroupChild.h" 1.14 +#include "nsPILoadGroupInternal.h" 1.15 +#include "nsAgg.h" 1.16 +#include "nsCOMPtr.h" 1.17 +#include "nsWeakPtr.h" 1.18 +#include "nsWeakReference.h" 1.19 +#include "nsISupportsPriority.h" 1.20 +#include "pldhash.h" 1.21 +#include "mozilla/TimeStamp.h" 1.22 + 1.23 +class nsILoadGroupConnectionInfo; 1.24 +class nsITimedChannel; 1.25 + 1.26 +class nsLoadGroup : public nsILoadGroup, 1.27 + public nsILoadGroupChild, 1.28 + public nsISupportsPriority, 1.29 + public nsSupportsWeakReference, 1.30 + public nsPILoadGroupInternal 1.31 +{ 1.32 +public: 1.33 + NS_DECL_AGGREGATED 1.34 + 1.35 + //////////////////////////////////////////////////////////////////////////// 1.36 + // nsIRequest methods: 1.37 + NS_DECL_NSIREQUEST 1.38 + 1.39 + //////////////////////////////////////////////////////////////////////////// 1.40 + // nsILoadGroup methods: 1.41 + NS_DECL_NSILOADGROUP 1.42 + NS_DECL_NSPILOADGROUPINTERNAL 1.43 + 1.44 + //////////////////////////////////////////////////////////////////////////// 1.45 + // nsILoadGroupChild methods: 1.46 + NS_DECL_NSILOADGROUPCHILD 1.47 + 1.48 + //////////////////////////////////////////////////////////////////////////// 1.49 + // nsISupportsPriority methods: 1.50 + NS_DECL_NSISUPPORTSPRIORITY 1.51 + 1.52 + //////////////////////////////////////////////////////////////////////////// 1.53 + // nsLoadGroup methods: 1.54 + 1.55 + nsLoadGroup(nsISupports* outer); 1.56 + 1.57 + nsresult Init(); 1.58 + 1.59 +protected: 1.60 + virtual ~nsLoadGroup(); 1.61 + 1.62 + nsresult MergeLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags); 1.63 + 1.64 +private: 1.65 + void TelemetryReport(); 1.66 + void TelemetryReportChannel(nsITimedChannel *timedChannel, 1.67 + bool defaultRequest); 1.68 + 1.69 +protected: 1.70 + uint32_t mForegroundCount; 1.71 + uint32_t mLoadFlags; 1.72 + uint32_t mDefaultLoadFlags; 1.73 + 1.74 + nsCOMPtr<nsILoadGroup> mLoadGroup; // load groups can contain load groups 1.75 + nsCOMPtr<nsIInterfaceRequestor> mCallbacks; 1.76 + nsCOMPtr<nsILoadGroupConnectionInfo> mConnectionInfo; 1.77 + 1.78 + nsCOMPtr<nsIRequest> mDefaultLoadRequest; 1.79 + PLDHashTable mRequests; 1.80 + 1.81 + nsWeakPtr mObserver; 1.82 + nsWeakPtr mParentLoadGroup; 1.83 + 1.84 + nsresult mStatus; 1.85 + int32_t mPriority; 1.86 + bool mIsCanceling; 1.87 + 1.88 + /* Telemetry */ 1.89 + mozilla::TimeStamp mDefaultRequestCreationTime; 1.90 + bool mDefaultLoadIsTimed; 1.91 + uint32_t mTimedRequests; 1.92 + uint32_t mCachedRequests; 1.93 + 1.94 + /* For nsPILoadGroupInternal */ 1.95 + uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad; 1.96 +}; 1.97 + 1.98 +#endif // nsLoadGroup_h__