2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-06-25 02:58:42 +04:00
|
|
|
|
|
|
|
#ifndef nsLoadGroup_h__
|
|
|
|
#define nsLoadGroup_h__
|
|
|
|
|
|
|
|
#include "nsILoadGroup.h"
|
2013-04-09 21:38:48 +04:00
|
|
|
#include "nsILoadGroupChild.h"
|
2013-04-15 17:41:27 +04:00
|
|
|
#include "nsPILoadGroupInternal.h"
|
1999-06-25 02:58:42 +04:00
|
|
|
#include "nsAgg.h"
|
1999-08-27 02:45:55 +04:00
|
|
|
#include "nsCOMPtr.h"
|
1999-09-10 03:55:19 +04:00
|
|
|
#include "nsWeakPtr.h"
|
1999-09-20 09:27:50 +04:00
|
|
|
#include "nsWeakReference.h"
|
2005-02-21 23:58:01 +03:00
|
|
|
#include "nsISupportsPriority.h"
|
2015-09-16 06:49:53 +03:00
|
|
|
#include "PLDHashTable.h"
|
2011-07-02 00:22:18 +04:00
|
|
|
#include "mozilla/TimeStamp.h"
|
1999-06-25 02:58:42 +04:00
|
|
|
|
2015-07-31 23:50:08 +03:00
|
|
|
class nsISchedulingContext;
|
|
|
|
class nsISchedulingContextService;
|
2013-09-22 07:04:57 +04:00
|
|
|
class nsITimedChannel;
|
1999-06-25 02:58:42 +04:00
|
|
|
|
1999-09-20 09:27:50 +04:00
|
|
|
class nsLoadGroup : public nsILoadGroup,
|
2013-04-09 21:38:48 +04:00
|
|
|
public nsILoadGroupChild,
|
2005-02-21 23:58:01 +03:00
|
|
|
public nsISupportsPriority,
|
2013-04-15 17:41:27 +04:00
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsPILoadGroupInternal
|
1999-06-25 02:58:42 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_AGGREGATED
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsIRequest methods:
|
1999-08-22 17:26:18 +04:00
|
|
|
NS_DECL_NSIREQUEST
|
1999-06-25 02:58:42 +04:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsILoadGroup methods:
|
1999-08-22 17:26:18 +04:00
|
|
|
NS_DECL_NSILOADGROUP
|
2013-04-15 17:41:27 +04:00
|
|
|
NS_DECL_NSPILOADGROUPINTERNAL
|
1999-11-22 08:46:03 +03:00
|
|
|
|
2013-04-09 21:38:48 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsILoadGroupChild methods:
|
|
|
|
NS_DECL_NSILOADGROUPCHILD
|
|
|
|
|
2005-02-21 23:58:01 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsISupportsPriority methods:
|
|
|
|
NS_DECL_NSISUPPORTSPRIORITY
|
|
|
|
|
1999-06-25 02:58:42 +04:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsLoadGroup methods:
|
|
|
|
|
2014-08-05 17:20:24 +04:00
|
|
|
explicit nsLoadGroup(nsISupports* outer);
|
1999-11-22 08:46:03 +03:00
|
|
|
virtual ~nsLoadGroup();
|
1999-06-25 02:58:42 +04:00
|
|
|
|
2015-07-31 23:50:08 +03:00
|
|
|
nsresult Init();
|
|
|
|
|
2015-05-13 03:33:44 +03:00
|
|
|
protected:
|
2001-04-10 10:01:08 +04:00
|
|
|
nsresult MergeLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags);
|
2015-07-21 16:23:00 +03:00
|
|
|
nsresult MergeDefaultLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags);
|
1999-08-27 02:45:55 +04:00
|
|
|
|
2011-07-02 00:22:18 +04:00
|
|
|
private:
|
|
|
|
void TelemetryReport();
|
|
|
|
void TelemetryReportChannel(nsITimedChannel *timedChannel,
|
|
|
|
bool defaultRequest);
|
|
|
|
|
1999-06-25 02:58:42 +04:00
|
|
|
protected:
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mForegroundCount;
|
|
|
|
uint32_t mLoadFlags;
|
2013-09-06 10:33:29 +04:00
|
|
|
uint32_t mDefaultLoadFlags;
|
1999-08-27 02:45:55 +04:00
|
|
|
|
2001-04-10 10:01:08 +04:00
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup; // load groups can contain load groups
|
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
2015-07-31 23:50:08 +03:00
|
|
|
nsCOMPtr<nsISchedulingContext> mSchedulingContext;
|
|
|
|
nsCOMPtr<nsISchedulingContextService> mSchedulingContextService;
|
1999-11-22 08:46:03 +03:00
|
|
|
|
2001-04-10 10:01:08 +04:00
|
|
|
nsCOMPtr<nsIRequest> mDefaultLoadRequest;
|
2015-05-20 02:46:17 +03:00
|
|
|
PLDHashTable mRequests;
|
2001-04-10 10:01:08 +04:00
|
|
|
|
|
|
|
nsWeakPtr mObserver;
|
2013-04-09 21:38:48 +04:00
|
|
|
nsWeakPtr mParentLoadGroup;
|
2001-02-21 23:38:08 +03:00
|
|
|
|
2001-04-10 10:01:08 +04:00
|
|
|
nsresult mStatus;
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mPriority;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mIsCanceling;
|
2011-07-02 00:22:18 +04:00
|
|
|
|
|
|
|
/* Telemetry */
|
|
|
|
mozilla::TimeStamp mDefaultRequestCreationTime;
|
|
|
|
bool mDefaultLoadIsTimed;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mTimedRequests;
|
|
|
|
uint32_t mCachedRequests;
|
2013-04-15 17:41:27 +04:00
|
|
|
|
|
|
|
/* For nsPILoadGroupInternal */
|
|
|
|
uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad;
|
1999-06-25 02:58:42 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsLoadGroup_h__
|