2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsHttpHandler_h__
|
|
|
|
#define nsHttpHandler_h__
|
|
|
|
|
|
|
|
#include "nsHttp.h"
|
|
|
|
#include "nsHttpAuthCache.h"
|
|
|
|
#include "nsHttpConnection.h"
|
|
|
|
#include "nsHttpConnectionMgr.h"
|
2012-05-25 14:37:01 -07:00
|
|
|
#include "ASpdySession.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsXPIDLString.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsWeakReference.h"
|
|
|
|
|
|
|
|
#include "nsIHttpProtocolHandler.h"
|
|
|
|
#include "nsIProtocolProxyService.h"
|
|
|
|
#include "nsIIOService.h"
|
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsIObserverService.h"
|
|
|
|
#include "nsIStreamConverterService.h"
|
|
|
|
#include "nsICacheSession.h"
|
|
|
|
#include "nsICookieService.h"
|
|
|
|
#include "nsIIDNService.h"
|
|
|
|
#include "nsITimer.h"
|
2010-06-03 14:03:17 -07:00
|
|
|
#include "nsIStrictTransportSecurityService.h"
|
2012-04-25 05:54:42 -07:00
|
|
|
#include "nsISpeculativeConnect.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsHttpConnectionInfo;
|
|
|
|
class nsHttpHeaderArray;
|
|
|
|
class nsHttpTransaction;
|
|
|
|
class nsAHttpTransaction;
|
|
|
|
class nsIHttpChannel;
|
|
|
|
class nsIPrefBranch;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// nsHttpHandler - protocol handler for HTTP and HTTPS
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class nsHttpHandler : public nsIHttpProtocolHandler
|
|
|
|
, public nsIObserver
|
|
|
|
, public nsSupportsWeakReference
|
2012-04-25 05:54:42 -07:00
|
|
|
, public nsISpeculativeConnect
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPROTOCOLHANDLER
|
|
|
|
NS_DECL_NSIPROXIEDPROTOCOLHANDLER
|
|
|
|
NS_DECL_NSIHTTPPROTOCOLHANDLER
|
|
|
|
NS_DECL_NSIOBSERVER
|
2012-04-25 05:54:42 -07:00
|
|
|
NS_DECL_NSISPECULATIVECONNECT
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsHttpHandler();
|
|
|
|
virtual ~nsHttpHandler();
|
|
|
|
|
|
|
|
nsresult Init();
|
2012-09-14 13:27:46 -07:00
|
|
|
nsresult AddStandardRequestHeaders(nsHttpHeaderArray *);
|
|
|
|
nsresult AddConnectionHeader(nsHttpHeaderArray *,
|
|
|
|
uint8_t capabilities);
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsAcceptableEncoding(const char *encoding);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
const nsAFlatCString &UserAgent();
|
|
|
|
|
|
|
|
nsHttpVersion HttpVersion() { return mHttpVersion; }
|
|
|
|
nsHttpVersion ProxyHttpVersion() { return mProxyHttpVersion; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t ReferrerLevel() { return mReferrerLevel; }
|
2011-09-28 23:19:26 -07:00
|
|
|
bool SendSecureXSiteReferrer() { return mSendSecureXSiteReferrer; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t RedirectionLimit() { return mRedirectionLimit; }
|
2012-02-23 17:58:43 -08:00
|
|
|
PRIntervalTime IdleTimeout() { return mIdleTimeout; }
|
|
|
|
PRIntervalTime SpdyTimeout() { return mSpdyTimeout; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint16_t MaxRequestAttempts() { return mMaxRequestAttempts; }
|
2007-03-22 10:30:00 -07:00
|
|
|
const char *DefaultSocketType() { return mDefaultSocketType.get(); /* ok to return null */ }
|
|
|
|
nsIIDNService *IDNConverter() { return mIDNConverter; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t PhishyUserPassLength() { return mPhishyUserPassLength; }
|
|
|
|
uint8_t GetQoSBits() { return mQoSBits; }
|
|
|
|
uint16_t GetIdleSynTimeout() { return mIdleSynTimeout; }
|
2011-09-28 23:19:26 -07:00
|
|
|
bool FastFallbackToIPv4() { return mFastFallbackToIPv4; }
|
2012-09-14 13:27:46 -07:00
|
|
|
bool ProxyPipelining() { return mProxyPipelining; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t MaxSocketCount();
|
2012-03-22 16:39:31 -07:00
|
|
|
bool EnforceAssocReq() { return mEnforceAssocReq; }
|
2011-08-27 03:49:40 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool IsPersistentHttpsCachingEnabled() { return mEnablePersistentHttpsCaching; }
|
2012-02-27 07:32:09 -08:00
|
|
|
bool IsTelemetryEnabled() { return mTelemetryEnabled; }
|
|
|
|
bool AllowExperiments() { return mTelemetryEnabled && mAllowExperiments; }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-12-13 07:55:50 -08:00
|
|
|
bool IsSpdyEnabled() { return mEnableSpdy; }
|
2012-05-25 14:37:08 -07:00
|
|
|
bool IsSpdyV2Enabled() { return mSpdyV2; }
|
|
|
|
bool IsSpdyV3Enabled() { return mSpdyV3; }
|
2011-12-13 07:55:50 -08:00
|
|
|
bool CoalesceSpdy() { return mCoalesceSpdy; }
|
|
|
|
bool UseAlternateProtocol() { return mUseAlternateProtocol; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t SpdySendingChunkSize() { return mSpdySendingChunkSize; }
|
2012-10-06 17:48:20 -07:00
|
|
|
uint32_t SpdySendBufferSize() { return mSpdySendBufferSize; }
|
2012-02-23 17:58:43 -08:00
|
|
|
PRIntervalTime SpdyPingThreshold() { return mSpdyPingThreshold; }
|
|
|
|
PRIntervalTime SpdyPingTimeout() { return mSpdyPingTimeout; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t ConnectTimeout() { return mConnectTimeout; }
|
2011-12-13 07:55:50 -08:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool PromptTempRedirect() { return mPromptTempRedirect; }
|
2009-02-24 11:46:51 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsHttpAuthCache *AuthCache() { return &mAuthCache; }
|
|
|
|
nsHttpConnectionMgr *ConnMgr() { return mConnMgr; }
|
|
|
|
|
|
|
|
// cache support
|
2012-05-31 15:20:05 -07:00
|
|
|
bool UseCache() const { return mUseCache; }
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t GenerateUniqueID() { return ++mLastUniqueID; }
|
|
|
|
uint32_t SessionStartTime() { return mSessionStartTime; }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
//
|
|
|
|
// Connection management methods:
|
|
|
|
//
|
|
|
|
// - the handler only owns idle connections; it does not own active
|
|
|
|
// connections.
|
|
|
|
//
|
|
|
|
// - the handler keeps a count of active connections to enforce the
|
|
|
|
// steady-state max-connections pref.
|
|
|
|
//
|
|
|
|
|
|
|
|
// Called to kick-off a new transaction, by default the transaction
|
|
|
|
// will be put on the pending transaction queue if it cannot be
|
|
|
|
// initiated at this time. Callable from any thread.
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult InitiateTransaction(nsHttpTransaction *trans, int32_t priority)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
return mConnMgr->AddTransaction(trans, priority);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Called to change the priority of an existing transaction that has
|
|
|
|
// already been initiated.
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult RescheduleTransaction(nsHttpTransaction *trans, int32_t priority)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
return mConnMgr->RescheduleTransaction(trans, priority);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Called to cancel a transaction, which may or may not be assigned to
|
|
|
|
// a connection. Callable from any thread.
|
|
|
|
nsresult CancelTransaction(nsHttpTransaction *trans, nsresult reason)
|
|
|
|
{
|
|
|
|
return mConnMgr->CancelTransaction(trans, reason);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Called when a connection is done processing a transaction. Callable
|
|
|
|
// from any thread.
|
|
|
|
nsresult ReclaimConnection(nsHttpConnection *conn)
|
|
|
|
{
|
|
|
|
return mConnMgr->ReclaimConnection(conn);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult ProcessPendingQ(nsHttpConnectionInfo *cinfo)
|
|
|
|
{
|
|
|
|
return mConnMgr->ProcessPendingQ(cinfo);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult GetSocketThreadTarget(nsIEventTarget **target)
|
|
|
|
{
|
|
|
|
return mConnMgr->GetSocketThreadTarget(target);
|
|
|
|
}
|
|
|
|
|
2012-04-25 05:54:42 -07:00
|
|
|
nsresult SpeculativeConnect(nsHttpConnectionInfo *ci,
|
|
|
|
nsIInterfaceRequestor *callbacks,
|
|
|
|
nsIEventTarget *target)
|
|
|
|
{
|
|
|
|
return mConnMgr->SpeculativeConnect(ci, callbacks, target);
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
//
|
|
|
|
// The HTTP handler caches pointers to specific XPCOM services, and
|
|
|
|
// provides the following helper routines for accessing those services:
|
|
|
|
//
|
|
|
|
nsresult GetStreamConverterService(nsIStreamConverterService **);
|
|
|
|
nsresult GetIOService(nsIIOService** service);
|
|
|
|
nsICookieService * GetCookieService(); // not addrefed
|
2010-06-03 14:03:17 -07:00
|
|
|
nsIStrictTransportSecurityService * GetSTSService();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-02-27 07:32:09 -08:00
|
|
|
// callable from socket thread only
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t Get32BitsOfPseudoRandom();
|
2012-02-27 07:32:09 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// Called by the channel before writing a request
|
|
|
|
void OnModifyRequest(nsIHttpChannel *chan)
|
|
|
|
{
|
|
|
|
NotifyObservers(chan, NS_HTTP_ON_MODIFY_REQUEST_TOPIC);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Called by the channel once headers are available
|
|
|
|
void OnExamineResponse(nsIHttpChannel *chan)
|
|
|
|
{
|
|
|
|
NotifyObservers(chan, NS_HTTP_ON_EXAMINE_RESPONSE_TOPIC);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Called by the channel once headers have been merged with cached headers
|
|
|
|
void OnExamineMergedResponse(nsIHttpChannel *chan)
|
|
|
|
{
|
|
|
|
NotifyObservers(chan, NS_HTTP_ON_EXAMINE_MERGED_RESPONSE_TOPIC);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Called by channels before a redirect happens. This notifies both the
|
|
|
|
// channel's and the global redirect observers.
|
2010-07-28 11:33:06 -07:00
|
|
|
nsresult AsyncOnChannelRedirect(nsIChannel* oldChan, nsIChannel* newChan,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t flags);
|
2009-02-11 20:16:00 -08:00
|
|
|
|
|
|
|
// Called by the channel when the response is read from the cache without
|
|
|
|
// communicating with the server.
|
|
|
|
void OnExamineCachedResponse(nsIHttpChannel *chan)
|
|
|
|
{
|
|
|
|
NotifyObservers(chan, NS_HTTP_ON_EXAMINE_CACHED_RESPONSE_TOPIC);
|
|
|
|
}
|
2010-02-18 06:42:32 -08:00
|
|
|
|
|
|
|
// Generates the host:port string for use in the Host: header as well as the
|
|
|
|
// CONNECT line for proxies. This handles IPv6 literals correctly.
|
2012-08-22 08:56:38 -07:00
|
|
|
static nsresult GenerateHostPort(const nsCString& host, int32_t port,
|
2010-02-18 06:42:32 -08:00
|
|
|
nsCString& hostLine);
|
|
|
|
|
2012-03-22 16:39:31 -07:00
|
|
|
bool GetPipelineAggressive() { return mPipelineAggressive; }
|
2012-08-22 08:56:38 -07:00
|
|
|
void GetMaxPipelineObjectSize(int64_t *outVal)
|
2012-03-22 16:39:31 -07:00
|
|
|
{
|
2012-04-09 07:21:17 -07:00
|
|
|
*outVal = mMaxPipelineObjectSize;
|
2012-03-22 16:39:31 -07:00
|
|
|
}
|
2012-04-11 10:49:32 -07:00
|
|
|
|
|
|
|
bool GetPipelineEnabled()
|
|
|
|
{
|
|
|
|
return mCapabilities & NS_HTTP_ALLOW_PIPELINING;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool GetPipelineRescheduleOnTimeout()
|
|
|
|
{
|
|
|
|
return mPipelineRescheduleOnTimeout;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRIntervalTime GetPipelineRescheduleTimeout()
|
|
|
|
{
|
|
|
|
return mPipelineRescheduleTimeout;
|
|
|
|
}
|
|
|
|
|
2012-03-22 16:39:31 -07:00
|
|
|
PRIntervalTime GetPipelineTimeout() { return mPipelineReadTimeout; }
|
2012-03-22 16:39:31 -07:00
|
|
|
|
2012-05-25 14:37:01 -07:00
|
|
|
mozilla::net::SpdyInformation *SpdyInfo() { return &mSpdyInfo; }
|
|
|
|
|
2012-09-14 13:27:46 -07:00
|
|
|
// returns true in between Init and Shutdown states
|
|
|
|
bool Active() { return mHandlerActive; }
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
|
|
|
|
|
|
|
//
|
|
|
|
// Useragent/prefs helper methods
|
|
|
|
//
|
|
|
|
void BuildUserAgent();
|
|
|
|
void InitUserAgentComponents();
|
|
|
|
void PrefsChanged(nsIPrefBranch *prefs, const char *pref);
|
|
|
|
|
|
|
|
nsresult SetAccept(const char *);
|
|
|
|
nsresult SetAcceptLanguages(const char *);
|
|
|
|
nsresult SetAcceptEncodings(const char *);
|
|
|
|
|
|
|
|
nsresult InitConnectionMgr();
|
|
|
|
|
|
|
|
void NotifyObservers(nsIHttpChannel *chan, const char *event);
|
|
|
|
|
2012-10-04 18:08:58 -07:00
|
|
|
static void TimerCallback(nsITimer * aTimer, void * aClosure);
|
2007-03-22 10:30:00 -07:00
|
|
|
private:
|
|
|
|
|
|
|
|
// cached services
|
|
|
|
nsCOMPtr<nsIIOService> mIOService;
|
|
|
|
nsCOMPtr<nsIStreamConverterService> mStreamConvSvc;
|
|
|
|
nsCOMPtr<nsIObserverService> mObserverService;
|
|
|
|
nsCOMPtr<nsICookieService> mCookieService;
|
|
|
|
nsCOMPtr<nsIIDNService> mIDNConverter;
|
2010-06-03 14:03:17 -07:00
|
|
|
nsCOMPtr<nsIStrictTransportSecurityService> mSTSService;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// the authentication credentials cache
|
|
|
|
nsHttpAuthCache mAuthCache;
|
|
|
|
|
|
|
|
// the connection manager
|
|
|
|
nsHttpConnectionMgr *mConnMgr;
|
|
|
|
|
|
|
|
//
|
|
|
|
// prefs
|
|
|
|
//
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t mHttpVersion;
|
|
|
|
uint8_t mProxyHttpVersion;
|
|
|
|
uint8_t mCapabilities;
|
|
|
|
uint8_t mReferrerLevel;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mFastFallbackToIPv4;
|
2012-09-14 13:27:46 -07:00
|
|
|
bool mProxyPipelining;
|
2012-02-23 17:58:43 -08:00
|
|
|
PRIntervalTime mIdleTimeout;
|
|
|
|
PRIntervalTime mSpdyTimeout;
|
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint16_t mMaxRequestAttempts;
|
|
|
|
uint16_t mMaxRequestDelay;
|
|
|
|
uint16_t mIdleSynTimeout;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-10-04 18:08:58 -07:00
|
|
|
bool mPipeliningEnabled;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint16_t mMaxConnections;
|
|
|
|
uint8_t mMaxPersistentConnectionsPerServer;
|
|
|
|
uint8_t mMaxPersistentConnectionsPerProxy;
|
|
|
|
uint16_t mMaxPipelinedRequests;
|
|
|
|
uint16_t mMaxOptimisticPipelinedRequests;
|
2012-03-22 16:39:31 -07:00
|
|
|
bool mPipelineAggressive;
|
2012-08-22 08:56:38 -07:00
|
|
|
int64_t mMaxPipelineObjectSize;
|
2012-04-11 10:49:32 -07:00
|
|
|
bool mPipelineRescheduleOnTimeout;
|
|
|
|
PRIntervalTime mPipelineRescheduleTimeout;
|
2012-03-22 16:39:31 -07:00
|
|
|
PRIntervalTime mPipelineReadTimeout;
|
2012-10-04 18:08:58 -07:00
|
|
|
nsCOMPtr<nsITimer> mPipelineTestTimer;
|
2012-03-22 16:39:31 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t mRedirectionLimit;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// we'll warn the user if we load an URL containing a userpass field
|
|
|
|
// unless its length is less than this threshold. this warning is
|
|
|
|
// intended to protect the user against spoofing attempts that use
|
|
|
|
// the userpass field of the URL to obscure the actual origin server.
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t mPhishyUserPassLength;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t mQoSBits;
|
2010-06-02 19:25:01 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mPipeliningOverSSL;
|
2012-03-22 16:39:31 -07:00
|
|
|
bool mEnforceAssocReq;
|
2008-02-06 20:04:56 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCString mAccept;
|
|
|
|
nsCString mAcceptLanguages;
|
|
|
|
nsCString mAcceptEncodings;
|
|
|
|
|
|
|
|
nsXPIDLCString mDefaultSocketType;
|
|
|
|
|
|
|
|
// cache support
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mLastUniqueID;
|
|
|
|
uint32_t mSessionStartTime;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// useragent components
|
2010-08-27 00:02:10 -07:00
|
|
|
nsCString mLegacyAppName;
|
|
|
|
nsCString mLegacyAppVersion;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCString mPlatform;
|
|
|
|
nsCString mOscpu;
|
|
|
|
nsCString mMisc;
|
2007-07-02 11:20:24 -07:00
|
|
|
nsCString mProduct;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsXPIDLCString mProductSub;
|
2010-08-27 00:02:10 -07:00
|
|
|
nsXPIDLCString mAppName;
|
|
|
|
nsXPIDLCString mAppVersion;
|
|
|
|
nsCString mCompatFirefox;
|
2012-06-22 04:52:47 -07:00
|
|
|
bool mCompatFirefoxEnabled;
|
2012-01-31 20:04:23 -08:00
|
|
|
nsXPIDLCString mCompatDevice;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsCString mUserAgent;
|
|
|
|
nsXPIDLCString mUserAgentOverride;
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mUserAgentIsDirty; // true if mUserAgent should be rebuilt
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mUseCache;
|
2009-02-24 11:46:51 -08:00
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mPromptTempRedirect;
|
2007-03-22 10:30:00 -07:00
|
|
|
// mSendSecureXSiteReferrer: default is false,
|
|
|
|
// if true allow referrer headers between secure non-matching hosts
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mSendSecureXSiteReferrer;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// Persistent HTTPS caching flag
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mEnablePersistentHttpsCaching;
|
2011-01-05 11:53:21 -08:00
|
|
|
|
|
|
|
// For broadcasting the preference to not be tracked
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mDoNotTrackEnabled;
|
2011-12-13 07:55:50 -08:00
|
|
|
|
2012-02-27 07:32:09 -08:00
|
|
|
// Whether telemetry is reported or not
|
|
|
|
bool mTelemetryEnabled;
|
|
|
|
|
|
|
|
// The value of network.allow-experiments
|
|
|
|
bool mAllowExperiments;
|
|
|
|
|
2012-09-14 13:27:46 -07:00
|
|
|
// true in between init and shutdown states
|
|
|
|
bool mHandlerActive;
|
|
|
|
|
2011-12-13 07:55:50 -08:00
|
|
|
// Try to use SPDY features instead of HTTP/1.1 over SSL
|
2012-05-25 14:37:01 -07:00
|
|
|
mozilla::net::SpdyInformation mSpdyInfo;
|
2011-12-13 07:55:50 -08:00
|
|
|
bool mEnableSpdy;
|
2012-05-25 14:37:08 -07:00
|
|
|
bool mSpdyV2;
|
|
|
|
bool mSpdyV3;
|
2011-12-13 07:55:50 -08:00
|
|
|
bool mCoalesceSpdy;
|
|
|
|
bool mUseAlternateProtocol;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mSpdySendingChunkSize;
|
2012-10-06 17:48:20 -07:00
|
|
|
uint32_t mSpdySendBufferSize;
|
2012-02-23 17:58:43 -08:00
|
|
|
PRIntervalTime mSpdyPingThreshold;
|
|
|
|
PRIntervalTime mSpdyPingTimeout;
|
2012-07-23 16:10:00 -07:00
|
|
|
|
|
|
|
// The maximum amount of time to wait for socket transport to be
|
|
|
|
// established. In milliseconds.
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mConnectTimeout;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
extern nsHttpHandler *gHttpHandler;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// nsHttpsHandler - thin wrapper to distinguish the HTTP handler from the
|
|
|
|
// HTTPS handler (even though they share the same impl).
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class nsHttpsHandler : public nsIHttpProtocolHandler
|
|
|
|
, public nsSupportsWeakReference
|
2012-04-25 05:54:42 -07:00
|
|
|
, public nsISpeculativeConnect
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
// we basically just want to override GetScheme and GetDefaultPort...
|
|
|
|
// all other methods should be forwarded to the nsHttpHandler instance.
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPROTOCOLHANDLER
|
|
|
|
NS_FORWARD_NSIPROXIEDPROTOCOLHANDLER (gHttpHandler->)
|
|
|
|
NS_FORWARD_NSIHTTPPROTOCOLHANDLER (gHttpHandler->)
|
2012-04-25 05:54:42 -07:00
|
|
|
NS_FORWARD_NSISPECULATIVECONNECT (gHttpHandler->)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsHttpsHandler() { }
|
|
|
|
virtual ~nsHttpsHandler() { }
|
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsHttpHandler_h__
|