2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim:set et cin ts=4 sw=4 sts=4: */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is Mozilla.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2001
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Darin Fisher <darin@netscape.com> (original author)
|
|
|
|
* Christian Biesinger <cbiesinger@web.de>
|
2010-04-07 01:43:09 -07:00
|
|
|
* Daniel Witte <dwitte@mozilla.com>
|
2010-06-22 17:33:57 -07:00
|
|
|
* Jason Duell <jduell.mcbugs@gmail.com>
|
2007-03-22 10:30:00 -07:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef nsHttpChannel_h__
|
|
|
|
#define nsHttpChannel_h__
|
|
|
|
|
2010-04-07 01:43:09 -07:00
|
|
|
#include "HttpBaseChannel.h"
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsHttpTransaction.h"
|
|
|
|
#include "nsInputStreamPump.h"
|
|
|
|
#include "nsThreadUtils.h"
|
2010-07-28 11:33:06 -07:00
|
|
|
#include "nsTArray.h"
|
2010-04-07 01:43:09 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIHttpEventSink.h"
|
|
|
|
#include "nsICachingChannel.h"
|
|
|
|
#include "nsICacheEntryDescriptor.h"
|
|
|
|
#include "nsICacheListener.h"
|
2008-11-04 02:20:27 -08:00
|
|
|
#include "nsIApplicationCacheChannel.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIPrompt.h"
|
|
|
|
#include "nsIResumableChannel.h"
|
|
|
|
#include "nsIProtocolProxyCallback.h"
|
|
|
|
#include "nsICancelable.h"
|
2010-06-17 11:33:42 -07:00
|
|
|
#include "nsIHttpAuthenticableChannel.h"
|
2008-08-25 10:21:28 -07:00
|
|
|
#include "nsITraceableChannel.h"
|
2010-06-17 11:33:42 -07:00
|
|
|
#include "nsIHttpChannelAuthProvider.h"
|
2010-07-28 11:33:06 -07:00
|
|
|
#include "nsIAsyncVerifyRedirectCallback.h"
|
2010-11-26 09:13:37 -08:00
|
|
|
#include "nsICryptoHash.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsAHttpConnection;
|
2010-06-03 14:03:17 -07:00
|
|
|
class AutoRedirectVetoNotifier;
|
2010-04-07 01:43:09 -07:00
|
|
|
|
|
|
|
using namespace mozilla::net;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// nsHttpChannel
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2010-04-07 01:43:09 -07:00
|
|
|
class nsHttpChannel : public HttpBaseChannel
|
2007-03-22 10:30:00 -07:00
|
|
|
, public nsIStreamListener
|
|
|
|
, public nsICachingChannel
|
|
|
|
, public nsICacheListener
|
|
|
|
, public nsITransportEventSink
|
|
|
|
, public nsIProtocolProxyCallback
|
2010-06-17 11:33:42 -07:00
|
|
|
, public nsIHttpAuthenticableChannel
|
2008-08-25 10:21:28 -07:00
|
|
|
, public nsITraceableChannel
|
2008-11-04 02:20:27 -08:00
|
|
|
, public nsIApplicationCacheChannel
|
2010-07-28 11:33:06 -07:00
|
|
|
, public nsIAsyncVerifyRedirectCallback
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_NSIREQUESTOBSERVER
|
|
|
|
NS_DECL_NSISTREAMLISTENER
|
2010-06-23 23:55:19 -07:00
|
|
|
NS_DECL_NSICACHEINFOCHANNEL
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSICACHINGCHANNEL
|
|
|
|
NS_DECL_NSICACHELISTENER
|
|
|
|
NS_DECL_NSITRANSPORTEVENTSINK
|
|
|
|
NS_DECL_NSIPROTOCOLPROXYCALLBACK
|
|
|
|
NS_DECL_NSIPROXIEDCHANNEL
|
2008-08-25 10:21:28 -07:00
|
|
|
NS_DECL_NSITRACEABLECHANNEL
|
2008-08-26 16:09:02 -07:00
|
|
|
NS_DECL_NSIAPPLICATIONCACHECONTAINER
|
2008-11-04 02:20:27 -08:00
|
|
|
NS_DECL_NSIAPPLICATIONCACHECHANNEL
|
2010-07-28 11:33:06 -07:00
|
|
|
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
|
2010-06-17 11:33:42 -07:00
|
|
|
|
|
|
|
// nsIHttpAuthenticableChannel. We can't use
|
|
|
|
// NS_DECL_NSIHTTPAUTHENTICABLECHANNEL because it duplicates cancel() and
|
|
|
|
// others.
|
|
|
|
NS_IMETHOD GetIsSSL(PRBool *aIsSSL);
|
|
|
|
NS_IMETHOD GetProxyMethodIsConnect(PRBool *aProxyMethodIsConnect);
|
|
|
|
NS_IMETHOD GetServerResponseHeader(nsACString & aServerResponseHeader);
|
|
|
|
NS_IMETHOD GetProxyChallenges(nsACString & aChallenges);
|
|
|
|
NS_IMETHOD GetWWWChallenges(nsACString & aChallenges);
|
|
|
|
NS_IMETHOD SetProxyCredentials(const nsACString & aCredentials);
|
|
|
|
NS_IMETHOD SetWWWCredentials(const nsACString & aCredentials);
|
|
|
|
NS_IMETHOD OnAuthAvailable();
|
|
|
|
NS_IMETHOD OnAuthCancelled(PRBool userCancel);
|
2010-06-22 17:33:57 -07:00
|
|
|
// Functions we implement from nsIHttpAuthenticableChannel but are
|
|
|
|
// declared in HttpBaseChannel must be implemented in this class. We
|
|
|
|
// just call the HttpBaseChannel:: impls.
|
|
|
|
NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags);
|
|
|
|
NS_IMETHOD GetURI(nsIURI **aURI);
|
|
|
|
NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks);
|
|
|
|
NS_IMETHOD GetLoadGroup(nsILoadGroup **aLoadGroup);
|
|
|
|
NS_IMETHOD GetRequestMethod(nsACString& aMethod);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsHttpChannel();
|
|
|
|
virtual ~nsHttpChannel();
|
|
|
|
|
2010-06-22 17:33:57 -07:00
|
|
|
virtual nsresult Init(nsIURI *aURI, PRUint8 aCaps, nsProxyInfo *aProxyInfo);
|
|
|
|
|
2010-04-07 01:43:09 -07:00
|
|
|
// Methods HttpBaseChannel didn't implement for us or that we override.
|
|
|
|
//
|
|
|
|
// nsIRequest
|
|
|
|
NS_IMETHOD Cancel(nsresult status);
|
|
|
|
NS_IMETHOD Suspend();
|
|
|
|
NS_IMETHOD Resume();
|
|
|
|
// nsIChannel
|
|
|
|
NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo);
|
|
|
|
NS_IMETHOD AsyncOpen(nsIStreamListener *listener, nsISupports *aContext);
|
|
|
|
// nsIHttpChannelInternal
|
|
|
|
NS_IMETHOD SetupFallbackChannel(const char *aFallbackKey);
|
2010-04-10 21:53:35 -07:00
|
|
|
// nsISupportsPriority
|
|
|
|
NS_IMETHOD SetPriority(PRInt32 value);
|
2010-08-10 20:07:09 -07:00
|
|
|
// nsIResumableChannel
|
|
|
|
NS_IMETHOD ResumeAt(PRUint64 startPos, const nsACString& entityID);
|
2010-04-07 01:43:09 -07:00
|
|
|
|
|
|
|
public: /* internal necko use only */
|
2007-03-22 10:30:00 -07:00
|
|
|
typedef void (nsHttpChannel:: *nsAsyncCallback)(void);
|
2010-10-01 21:17:23 -07:00
|
|
|
|
2010-05-30 15:30:28 -07:00
|
|
|
void InternalSetUploadStream(nsIInputStream *uploadStream)
|
|
|
|
{ mUploadStream = uploadStream; }
|
|
|
|
void SetUploadStreamHasHeaders(PRBool hasHeaders)
|
|
|
|
{ mUploadStreamHasHeaders = hasHeaders; }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-04-07 01:43:44 -07:00
|
|
|
nsresult SetReferrerInternal(nsIURI *referrer) {
|
|
|
|
nsCAutoString spec;
|
|
|
|
nsresult rv = referrer->GetAsciiSpec(spec);
|
|
|
|
if (NS_FAILED(rv)) return rv;
|
|
|
|
mReferrer = referrer;
|
|
|
|
mRequestHead.SetHeader(nsHttp::Referer, spec);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2010-07-28 11:33:06 -07:00
|
|
|
typedef nsresult (nsHttpChannel::*nsContinueRedirectionFunc)(nsresult result);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// AsyncCall may be used to call a member function asynchronously.
|
2009-02-11 20:16:00 -08:00
|
|
|
// retval isn't refcounted and is set only when event was successfully
|
|
|
|
// posted, the event is returned for the purpose of cancelling when needed
|
|
|
|
nsresult AsyncCall(nsAsyncCallback funcPtr,
|
|
|
|
nsRunnableMethod<nsHttpChannel> **retval = nsnull);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
PRBool RequestIsConditional();
|
|
|
|
nsresult Connect(PRBool firstTime = PR_TRUE);
|
|
|
|
nsresult AsyncAbort(nsresult status);
|
2007-08-23 11:56:12 -07:00
|
|
|
// Send OnStartRequest/OnStopRequest to our listener, if any.
|
|
|
|
void HandleAsyncNotifyListener();
|
|
|
|
void DoNotifyListener();
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult SetupTransaction();
|
|
|
|
nsresult CallOnStartRequest();
|
|
|
|
nsresult ProcessResponse();
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult ContinueProcessResponse(nsresult);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult ProcessNormal();
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult ContinueProcessNormal(nsresult);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult ProcessNotModified();
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult AsyncProcessRedirection(PRUint32 httpStatus);
|
|
|
|
nsresult ContinueProcessRedirection(nsresult);
|
|
|
|
nsresult ContinueProcessRedirectionAfterFallback(nsresult);
|
2009-05-17 07:22:55 -07:00
|
|
|
PRBool ShouldSSLProxyResponseContinue(PRUint32 httpStatus);
|
2009-04-23 12:49:32 -07:00
|
|
|
nsresult ProcessFailedSSLConnect(PRUint32 httpStatus);
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult ProcessFallback(PRBool *waitingForRedirectCallback);
|
|
|
|
nsresult ContinueProcessFallback(nsresult);
|
2007-03-22 10:30:00 -07:00
|
|
|
PRBool ResponseWouldVary();
|
|
|
|
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult ContinueOnStartRequest1(nsresult);
|
|
|
|
nsresult ContinueOnStartRequest2(nsresult);
|
|
|
|
nsresult ContinueOnStartRequest3(nsresult);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// redirection specific methods
|
|
|
|
void HandleAsyncRedirect();
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult ContinueHandleAsyncRedirect(nsresult);
|
2007-03-22 10:30:00 -07:00
|
|
|
void HandleAsyncNotModified();
|
2008-09-30 11:34:23 -07:00
|
|
|
void HandleAsyncFallback();
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult ContinueHandleAsyncFallback(nsresult);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult PromptTempRedirect();
|
2010-08-10 20:11:57 -07:00
|
|
|
virtual nsresult SetupReplacementChannel(nsIURI *, nsIChannel *, PRBool preserveMethod);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// proxy specific methods
|
|
|
|
nsresult ProxyFailover();
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult AsyncDoReplaceWithProxy(nsIProxyInfo *);
|
|
|
|
nsresult ContinueDoReplaceWithProxy(nsresult);
|
2007-08-23 11:56:12 -07:00
|
|
|
void HandleAsyncReplaceWithProxy();
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult ContinueHandleAsyncReplaceWithProxy(nsresult);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult ResolveProxy();
|
|
|
|
|
|
|
|
// cache specific methods
|
2010-09-15 15:46:17 -07:00
|
|
|
nsresult OpenCacheEntry();
|
|
|
|
nsresult OnOfflineCacheEntryAvailable(nsICacheEntryDescriptor *aEntry,
|
|
|
|
nsCacheAccessMode aAccess,
|
|
|
|
nsresult aResult,
|
|
|
|
PRBool aSync);
|
|
|
|
nsresult OpenNormalCacheEntry(PRBool aSync);
|
|
|
|
nsresult OnNormalCacheEntryAvailable(nsICacheEntryDescriptor *aEntry,
|
|
|
|
nsCacheAccessMode aAccess,
|
|
|
|
nsresult aResult,
|
|
|
|
PRBool aSync);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult OpenOfflineCacheEntryForWriting();
|
2008-10-10 09:14:51 -07:00
|
|
|
nsresult GenerateCacheKey(PRUint32 postID, nsACString &key);
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult UpdateExpirationTime();
|
|
|
|
nsresult CheckCache();
|
|
|
|
nsresult ShouldUpdateOfflineCacheEntry(PRBool *shouldCacheForOfflineUse);
|
|
|
|
nsresult ReadFromCache();
|
2008-09-09 18:39:38 -07:00
|
|
|
void CloseCacheEntry(PRBool doomOnFailure);
|
2007-03-22 10:30:00 -07:00
|
|
|
void CloseOfflineCacheEntry();
|
|
|
|
nsresult InitCacheEntry();
|
|
|
|
nsresult InitOfflineCacheEntry();
|
|
|
|
nsresult AddCacheEntryHeaders(nsICacheEntryDescriptor *entry);
|
|
|
|
nsresult StoreAuthorizationMetaData(nsICacheEntryDescriptor *entry);
|
|
|
|
nsresult FinalizeCacheEntry();
|
|
|
|
nsresult InstallCacheListener(PRUint32 offset = 0);
|
|
|
|
nsresult InstallOfflineCacheListener();
|
2008-10-10 09:14:51 -07:00
|
|
|
void MaybeInvalidateCacheEntryForSubsequentGet();
|
|
|
|
nsCacheStoragePolicy DetermineStoragePolicy();
|
2010-09-15 15:46:17 -07:00
|
|
|
nsresult DetermineCacheAccess(nsCacheAccessMode *_retval);
|
2009-02-11 20:16:00 -08:00
|
|
|
void AsyncOnExamineCachedResponse();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-07-31 17:55:14 -07:00
|
|
|
// Handle the bogus Content-Encoding Apache sometimes sends
|
|
|
|
void ClearBogusContentEncodingIfNeeded();
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// byte range request specific methods
|
|
|
|
nsresult SetupByteRangeRequest(PRUint32 partialLen);
|
|
|
|
nsresult ProcessPartialContent();
|
|
|
|
nsresult OnDoneReadingPartialCacheEntry(PRBool *streamDone);
|
|
|
|
|
|
|
|
nsresult DoAuthRetry(nsAHttpConnection *);
|
2009-06-16 09:27:17 -07:00
|
|
|
PRBool MustValidateBasedOnQueryUrl();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-06-03 14:03:17 -07:00
|
|
|
void HandleAsyncRedirectChannelToHttps();
|
|
|
|
nsresult AsyncRedirectChannelToHttps();
|
|
|
|
nsresult ContinueAsyncRedirectChannelToHttps(nsresult rv);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A function that takes care of reading STS headers and enforcing STS
|
|
|
|
* load rules. After a secure channel is erected, STS requires the channel
|
|
|
|
* to be trusted or any STS header data on the channel is ignored.
|
|
|
|
* This is called from ProcessResponse.
|
|
|
|
*/
|
|
|
|
nsresult ProcessSTSHeader();
|
|
|
|
|
2010-11-26 09:13:37 -08:00
|
|
|
/**
|
|
|
|
* Computes and returns a 64 bit encoded string holding a hash of the
|
|
|
|
* input buffer. Input buffer must be a null-terminated string.
|
|
|
|
*/
|
|
|
|
nsresult Hash(const char *buf, nsACString &hash);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
|
|
|
nsCOMPtr<nsISupports> mSecurityInfo;
|
|
|
|
nsCOMPtr<nsICancelable> mProxyRequest;
|
|
|
|
|
|
|
|
nsRefPtr<nsInputStreamPump> mTransactionPump;
|
2010-04-07 01:43:09 -07:00
|
|
|
nsRefPtr<nsHttpTransaction> mTransaction;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-08-12 01:51:46 -07:00
|
|
|
PRUint64 mLogicalOffset;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// cache specific data
|
|
|
|
nsCOMPtr<nsICacheEntryDescriptor> mCacheEntry;
|
|
|
|
nsRefPtr<nsInputStreamPump> mCachePump;
|
2010-04-07 01:43:09 -07:00
|
|
|
nsAutoPtr<nsHttpResponseHead> mCachedResponseHead;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCacheAccessMode mCacheAccess;
|
|
|
|
PRUint32 mPostID;
|
|
|
|
PRUint32 mRequestTime;
|
|
|
|
|
2010-09-15 15:46:17 -07:00
|
|
|
typedef nsresult (nsHttpChannel:: *nsOnCacheEntryAvailableCallback)(
|
|
|
|
nsICacheEntryDescriptor *, nsCacheAccessMode, nsresult, PRBool);
|
|
|
|
nsOnCacheEntryAvailableCallback mOnCacheEntryAvailableCallback;
|
|
|
|
PRBool mAsyncCacheOpen;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<nsICacheEntryDescriptor> mOfflineCacheEntry;
|
|
|
|
nsCacheAccessMode mOfflineCacheAccess;
|
2007-07-24 23:31:27 -07:00
|
|
|
nsCString mOfflineCacheClientID;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// auth specific data
|
2010-06-17 11:33:42 -07:00
|
|
|
nsCOMPtr<nsIHttpChannelAuthProvider> mAuthProvider;
|
2009-07-20 11:29:41 -07:00
|
|
|
|
2007-08-23 11:56:12 -07:00
|
|
|
// Function pointer that can be set to indicate that we got suspended while
|
|
|
|
// waiting on an AsyncCall. When we get resumed we should AsyncCall this
|
|
|
|
// function.
|
|
|
|
nsAsyncCallback mPendingAsyncCallOnResume;
|
|
|
|
|
|
|
|
// Proxy info to replace with
|
|
|
|
nsCOMPtr<nsIProxyInfo> mTargetProxyInfo;
|
|
|
|
|
|
|
|
// Suspend counter. This is used if someone tries to suspend/resume us
|
|
|
|
// before we have either a cache pump or a transaction pump.
|
|
|
|
PRUint32 mSuspendCount;
|
|
|
|
|
2008-09-30 11:34:23 -07:00
|
|
|
// If the channel is associated with a cache, and the URI matched
|
|
|
|
// a fallback namespace, this will hold the key for the fallback
|
|
|
|
// cache entry.
|
|
|
|
nsCString mFallbackKey;
|
|
|
|
|
2010-06-03 14:03:17 -07:00
|
|
|
friend class AutoRedirectVetoNotifier;
|
2010-07-28 11:33:06 -07:00
|
|
|
nsCOMPtr<nsIURI> mRedirectURI;
|
|
|
|
nsCOMPtr<nsIChannel> mRedirectChannel;
|
|
|
|
PRUint32 mRedirectType;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// state flags
|
|
|
|
PRUint32 mCachedContentIsValid : 1;
|
|
|
|
PRUint32 mCachedContentIsPartial : 1;
|
|
|
|
PRUint32 mTransactionReplaced : 1;
|
|
|
|
PRUint32 mAuthRetryPending : 1;
|
|
|
|
PRUint32 mResuming : 1;
|
|
|
|
PRUint32 mInitedCacheEntry : 1;
|
|
|
|
PRUint32 mCacheForOfflineUse : 1;
|
2008-09-30 11:34:23 -07:00
|
|
|
// True if mCacheForOfflineUse was set because we were caching
|
|
|
|
// opportunistically.
|
|
|
|
PRUint32 mCachingOpportunistically : 1;
|
|
|
|
// True if we are loading a fallback cache entry from the
|
|
|
|
// application cache.
|
|
|
|
PRUint32 mFallbackChannel : 1;
|
2008-08-25 10:21:28 -07:00
|
|
|
PRUint32 mTracingEnabled : 1;
|
2009-10-21 10:34:47 -07:00
|
|
|
// True if consumer added its own If-None-Match or If-Modified-Since
|
2009-10-21 03:18:08 -07:00
|
|
|
// headers. In such a case we must not override them in the cache code
|
|
|
|
// and also we want to pass possible 304 code response through.
|
|
|
|
PRUint32 mCustomConditionalRequest : 1;
|
2010-07-28 11:33:06 -07:00
|
|
|
PRUint32 mFallingBack : 1;
|
|
|
|
PRUint32 mWaitingForRedirectCallback : 1;
|
2010-08-02 13:24:18 -07:00
|
|
|
// True if mRequestTime has been set. In such a case it is safe to update
|
|
|
|
// the cache entry's expiration time. Otherwise, it is not(see bug 567360).
|
|
|
|
PRUint32 mRequestTimeInitialized : 1;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-07-28 11:33:06 -07:00
|
|
|
nsTArray<nsContinueRedirectionFunc> mRedirectFuncStack;
|
|
|
|
|
2010-11-26 09:13:37 -08:00
|
|
|
nsCOMPtr<nsICryptoHash> mHasher;
|
|
|
|
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult WaitForRedirectCallback();
|
|
|
|
void PushRedirectAsyncFunc(nsContinueRedirectionFunc func);
|
|
|
|
void PopRedirectAsyncFunc(nsContinueRedirectionFunc func);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsHttpChannel_h__
|