2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00: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-24 22:58:42 +00:00
|
|
|
|
|
|
|
#ifndef nsLoadGroup_h__
|
|
|
|
#define nsLoadGroup_h__
|
|
|
|
|
|
|
|
#include "nsILoadGroup.h"
|
2013-04-09 17:38:48 +00:00
|
|
|
#include "nsILoadGroupChild.h"
|
2013-04-15 13:41:27 +00:00
|
|
|
#include "nsPILoadGroupInternal.h"
|
1999-06-24 22:58:42 +00:00
|
|
|
#include "nsAgg.h"
|
1999-08-26 22:45:55 +00:00
|
|
|
#include "nsCOMPtr.h"
|
1999-09-09 23:55:19 +00:00
|
|
|
#include "nsWeakPtr.h"
|
1999-09-20 05:27:50 +00:00
|
|
|
#include "nsWeakReference.h"
|
2005-02-21 20:58:01 +00:00
|
|
|
#include "nsISupportsPriority.h"
|
2002-07-09 01:03:45 +00:00
|
|
|
#include "pldhash.h"
|
2011-07-01 20:22:18 +00:00
|
|
|
#include "mozilla/TimeStamp.h"
|
1999-06-24 22:58:42 +00:00
|
|
|
|
2013-09-22 03:04:57 +00:00
|
|
|
class nsILoadGroupConnectionInfo;
|
|
|
|
class nsITimedChannel;
|
1999-06-24 22:58:42 +00:00
|
|
|
|
1999-09-20 05:27:50 +00:00
|
|
|
class nsLoadGroup : public nsILoadGroup,
|
2013-04-09 17:38:48 +00:00
|
|
|
public nsILoadGroupChild,
|
2005-02-21 20:58:01 +00:00
|
|
|
public nsISupportsPriority,
|
2013-04-15 13:41:27 +00:00
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsPILoadGroupInternal
|
1999-06-24 22:58:42 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_AGGREGATED
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsIRequest methods:
|
1999-08-22 13:26:18 +00:00
|
|
|
NS_DECL_NSIREQUEST
|
1999-06-24 22:58:42 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsILoadGroup methods:
|
1999-08-22 13:26:18 +00:00
|
|
|
NS_DECL_NSILOADGROUP
|
2013-04-15 13:41:27 +00:00
|
|
|
NS_DECL_NSPILOADGROUPINTERNAL
|
1999-11-22 05:46:03 +00:00
|
|
|
|
2013-04-09 17:38:48 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsILoadGroupChild methods:
|
|
|
|
NS_DECL_NSILOADGROUPCHILD
|
|
|
|
|
2005-02-21 20:58:01 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsISupportsPriority methods:
|
|
|
|
NS_DECL_NSISUPPORTSPRIORITY
|
|
|
|
|
1999-06-24 22:58:42 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsLoadGroup methods:
|
|
|
|
|
2014-08-05 13:20:24 +00:00
|
|
|
explicit nsLoadGroup(nsISupports* outer);
|
1999-11-22 05:46:03 +00:00
|
|
|
virtual ~nsLoadGroup();
|
1999-06-24 22:58:42 +00:00
|
|
|
|
2015-05-13 00:33:44 +00:00
|
|
|
protected:
|
2001-04-10 06:01:08 +00:00
|
|
|
nsresult MergeLoadFlags(nsIRequest *aRequest, nsLoadFlags& flags);
|
1999-08-26 22:45:55 +00:00
|
|
|
|
2011-07-01 20:22:18 +00:00
|
|
|
private:
|
|
|
|
void TelemetryReport();
|
|
|
|
void TelemetryReportChannel(nsITimedChannel *timedChannel,
|
|
|
|
bool defaultRequest);
|
|
|
|
|
1999-06-24 22:58:42 +00:00
|
|
|
protected:
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mForegroundCount;
|
|
|
|
uint32_t mLoadFlags;
|
2013-09-06 06:33:29 +00:00
|
|
|
uint32_t mDefaultLoadFlags;
|
1999-08-26 22:45:55 +00:00
|
|
|
|
2001-04-10 06:01:08 +00:00
|
|
|
nsCOMPtr<nsILoadGroup> mLoadGroup; // load groups can contain load groups
|
|
|
|
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
|
2012-12-04 23:06:29 +00:00
|
|
|
nsCOMPtr<nsILoadGroupConnectionInfo> mConnectionInfo;
|
1999-11-22 05:46:03 +00:00
|
|
|
|
2001-04-10 06:01:08 +00:00
|
|
|
nsCOMPtr<nsIRequest> mDefaultLoadRequest;
|
2015-05-19 23:46:17 +00:00
|
|
|
PLDHashTable mRequests;
|
2001-04-10 06:01:08 +00:00
|
|
|
|
|
|
|
nsWeakPtr mObserver;
|
2013-04-09 17:38:48 +00:00
|
|
|
nsWeakPtr mParentLoadGroup;
|
2001-02-21 20:38:08 +00:00
|
|
|
|
2001-04-10 06:01:08 +00:00
|
|
|
nsresult mStatus;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mPriority;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsCanceling;
|
2011-07-01 20:22:18 +00:00
|
|
|
|
|
|
|
/* Telemetry */
|
|
|
|
mozilla::TimeStamp mDefaultRequestCreationTime;
|
|
|
|
bool mDefaultLoadIsTimed;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mTimedRequests;
|
|
|
|
uint32_t mCachedRequests;
|
2013-04-15 13:41:27 +00:00
|
|
|
|
|
|
|
/* For nsPILoadGroupInternal */
|
|
|
|
uint32_t mTimedNonCachedRequestsUntilOnEndPageLoad;
|
1999-06-24 22:58:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsLoadGroup_h__
|