bug 378637 part 3 - fix http style: comments, whitespace, formatters r=hurley

--HG--
extra : rebase_source : 9d2b0692298fca2655023b3bc6295386a96625e6
This commit is contained in:
Patrick McManus 2014-04-17 19:55:04 -04:00
Родитель 23bd6d3e13
Коммит c72c71a34e
10 изменённых файлов: 244 добавлений и 244 удалений

Просмотреть файл

@ -66,39 +66,39 @@ do { \
Http2Session::Http2Session(nsAHttpTransaction *aHttpTransaction,
nsISocketTransport *aSocketTransport,
int32_t firstPriority)
: mSocketTransport(aSocketTransport),
mSegmentReader(nullptr),
mSegmentWriter(nullptr),
mNextStreamID(3), // 1 is reserved for Updgrade handshakes
mConcurrentHighWater(0),
mDownstreamState(BUFFERING_OPENING_SETTINGS),
mInputFrameBufferSize(kDefaultBufferSize),
mInputFrameBufferUsed(0),
mInputFrameFinal(false),
mInputFrameDataStream(nullptr),
mNeedsCleanup(nullptr),
mDownstreamRstReason(NO_HTTP_ERROR),
mExpectedHeaderID(0),
mExpectedPushPromiseID(0),
mContinuedPromiseStream(0),
mShouldGoAway(false),
mClosed(false),
mCleanShutdown(false),
mTLSProfileConfirmed(false),
mGoAwayReason(NO_HTTP_ERROR),
mGoAwayID(0),
mOutgoingGoAwayID(0),
mMaxConcurrent(kDefaultMaxConcurrent),
mConcurrent(0),
mServerPushedResources(0),
mServerInitialStreamWindow(kDefaultRwin),
mLocalSessionWindow(kDefaultRwin),
mServerSessionWindow(kDefaultRwin),
mOutputQueueSize(kDefaultQueueSize),
mOutputQueueUsed(0),
mOutputQueueSent(0),
mLastReadEpoch(PR_IntervalNow()),
mPingSentEpoch(0)
: mSocketTransport(aSocketTransport)
, mSegmentReader(nullptr)
, mSegmentWriter(nullptr)
, mNextStreamID(3) // 1 is reserved for Updgrade handshakes
, mConcurrentHighWater(0)
, mDownstreamState(BUFFERING_OPENING_SETTINGS)
, mInputFrameBufferSize(kDefaultBufferSize)
, mInputFrameBufferUsed(0)
, mInputFrameFinal(false)
, mInputFrameDataStream(nullptr)
, mNeedsCleanup(nullptr)
, mDownstreamRstReason(NO_HTTP_ERROR)
, mExpectedHeaderID(0)
, mExpectedPushPromiseID(0)
, mContinuedPromiseStream(0)
, mShouldGoAway(false)
, mClosed(false)
, mCleanShutdown(false)
, mTLSProfileConfirmed(false)
, mGoAwayReason(NO_HTTP_ERROR)
, mGoAwayID(0)
, mOutgoingGoAwayID(0)
, mMaxConcurrent(kDefaultMaxConcurrent)
, mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialStreamWindow(kDefaultRwin)
, mLocalSessionWindow(kDefaultRwin)
, mServerSessionWindow(kDefaultRwin)
, mOutputQueueSize(kDefaultQueueSize)
, mOutputQueueUsed(0)
, mOutputQueueSent(0)
, mLastReadEpoch(PR_IntervalNow())
, mPingSentEpoch(0)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -552,7 +552,7 @@ Http2Session::ChangeDownstreamState(enum internalStateType newState)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("Http2Stream::ChangeDownstreamState() %p from %X to %X",
LOG3(("Http2Session::ChangeDownstreamState() %p from %X to %X",
this, mDownstreamState, newState));
mDownstreamState = newState;
}
@ -562,7 +562,7 @@ Http2Session::ResetDownstreamState()
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("Http2Stream::ResetDownstreamState() %p", this));
LOG3(("Http2Session::ResetDownstreamState() %p", this));
ChangeDownstreamState(BUFFERING_FRAME_HEADER);
if (mInputFrameFinal && mInputFrameDataStream) {

Просмотреть файл

@ -39,34 +39,34 @@ namespace net {
Http2Stream::Http2Stream(nsAHttpTransaction *httpTransaction,
Http2Session *session,
int32_t priority)
: mStreamID(0),
mSession(session),
mUpstreamState(GENERATING_HEADERS),
mState(IDLE),
mAllHeadersSent(0),
mAllHeadersReceived(0),
mTransaction(httpTransaction),
mSocketTransport(session->SocketTransport()),
mSegmentReader(nullptr),
mSegmentWriter(nullptr),
mChunkSize(session->SendingChunkSize()),
mRequestBlockedOnRead(0),
mRecvdFin(0),
mRecvdReset(0),
mSentReset(0),
mCountAsActive(0),
mSentFin(0),
mSentWaitingFor(0),
mSetTCPSocketBuffer(0),
mTxInlineFrameSize(Http2Session::kDefaultBufferSize),
mTxInlineFrameUsed(0),
mTxStreamFrameSize(0),
mRequestBodyLenRemaining(0),
mLocalUnacked(0),
mBlockedOnRwin(false),
mTotalSent(0),
mTotalRead(0),
mPushSource(nullptr)
: mStreamID(0)
, mSession(session)
, mUpstreamState(GENERATING_HEADERS)
, mState(IDLE)
, mAllHeadersSent(0)
, mAllHeadersReceived(0)
, mTransaction(httpTransaction)
, mSocketTransport(session->SocketTransport())
, mSegmentReader(nullptr)
, mSegmentWriter(nullptr)
, mChunkSize(session->SendingChunkSize())
, mRequestBlockedOnRead(0)
, mRecvdFin(0)
, mRecvdReset(0)
, mSentReset(0)
, mCountAsActive(0)
, mSentFin(0)
, mSentWaitingFor(0)
, mSetTCPSocketBuffer(0)
, mTxInlineFrameSize(Http2Session::kDefaultBufferSize)
, mTxInlineFrameUsed(0)
, mTxStreamFrameSize(0)
, mRequestBodyLenRemaining(0)
, mLocalUnacked(0)
, mBlockedOnRwin(false)
, mTotalSent(0)
, mTotalRead(0)
, mPushSource(nullptr)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);

Просмотреть файл

@ -45,34 +45,34 @@ NS_INTERFACE_MAP_BEGIN(SpdySession3)
NS_INTERFACE_MAP_END
SpdySession3::SpdySession3(nsAHttpTransaction *aHttpTransaction,
nsISocketTransport *aSocketTransport,
int32_t firstPriority)
: mSocketTransport(aSocketTransport),
mSegmentReader(nullptr),
mSegmentWriter(nullptr),
mNextStreamID(1),
mConcurrentHighWater(0),
mDownstreamState(BUFFERING_FRAME_HEADER),
mInputFrameBufferSize(kDefaultBufferSize),
mInputFrameBufferUsed(0),
mInputFrameDataLast(false),
mInputFrameDataStream(nullptr),
mNeedsCleanup(nullptr),
mShouldGoAway(false),
mClosed(false),
mCleanShutdown(false),
mDataPending(false),
mGoAwayID(0),
mMaxConcurrent(kDefaultMaxConcurrent),
mConcurrent(0),
mServerPushedResources(0),
mServerInitialWindow(kDefaultServerRwin),
mOutputQueueSize(kDefaultQueueSize),
mOutputQueueUsed(0),
mOutputQueueSent(0),
mLastReadEpoch(PR_IntervalNow()),
mPingSentEpoch(0),
mNextPingID(1)
nsISocketTransport *aSocketTransport,
int32_t firstPriority)
: mSocketTransport(aSocketTransport)
, mSegmentReader(nullptr)
, mSegmentWriter(nullptr)
, mNextStreamID(1)
, mConcurrentHighWater(0)
, mDownstreamState(BUFFERING_FRAME_HEADER)
, mInputFrameBufferSize(kDefaultBufferSize)
, mInputFrameBufferUsed(0)
, mInputFrameDataLast(false)
, mInputFrameDataStream(nullptr)
, mNeedsCleanup(nullptr)
, mShouldGoAway(false)
, mClosed(false)
, mCleanShutdown(false)
, mDataPending(false)
, mGoAwayID(0)
, mMaxConcurrent(kDefaultMaxConcurrent)
, mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialWindow(kDefaultServerRwin)
, mOutputQueueSize(kDefaultQueueSize)
, mOutputQueueUsed(0)
, mOutputQueueSent(0)
, mLastReadEpoch(PR_IntervalNow())
, mPingSentEpoch(0)
, mNextPingID(1)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -100,8 +100,8 @@ SpdySession3::SpdySession3(nsAHttpTransaction *aHttpTransaction,
PLDHashOperator
SpdySession3::ShutdownEnumerator(nsAHttpTransaction *key,
nsAutoPtr<SpdyStream3> &stream,
void *closure)
nsAutoPtr<SpdyStream3> &stream,
void *closure)
{
SpdySession3 *self = static_cast<SpdySession3 *>(closure);
@ -156,7 +156,7 @@ SpdySession3::~SpdySession3()
void
SpdySession3::LogIO(SpdySession3 *self, SpdyStream3 *stream, const char *label,
const char *data, uint32_t datalen)
const char *data, uint32_t datalen)
{
if (!LOG4_ENABLED())
return;
@ -340,7 +340,7 @@ SpdySession3::RegisterStreamID(SpdyStream3 *stream, uint32_t aNewID)
bool
SpdySession3::AddStream(nsAHttpTransaction *aHttpTransaction,
int32_t aPriority)
int32_t aPriority)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -420,7 +420,7 @@ SpdySession3::ProcessPending()
nsresult
SpdySession3::NetworkRead(nsAHttpSegmentWriter *writer, char *buf,
uint32_t count, uint32_t *countWritten)
uint32_t count, uint32_t *countWritten)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -510,7 +510,7 @@ SpdySession3::ChangeDownstreamState(enum stateType newState)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("SpdyStream3::ChangeDownstreamState() %p from %X to %X",
LOG3(("SpdySession3::ChangeDownstreamState() %p from %X to %X",
this, mDownstreamState, newState));
mDownstreamState = newState;
}
@ -520,7 +520,7 @@ SpdySession3::ResetDownstreamState()
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("SpdyStream3::ResetDownstreamState() %p", this));
LOG3(("SpdySession3::ResetDownstreamState() %p", this));
ChangeDownstreamState(BUFFERING_FRAME_HEADER);
if (mInputFrameDataLast && mInputFrameDataStream) {
@ -844,7 +844,7 @@ SpdySession3::VerifyStream(SpdyStream3 *aStream, uint32_t aOptionalID = 0)
void
SpdySession3::CleanupStream(SpdyStream3 *aStream, nsresult aResult,
rstReason aResetCode)
rstReason aResetCode)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("SpdySession3::CleanupStream %p %p 0x%X %X\n",
@ -1640,8 +1640,8 @@ SpdySession3::HandleCredential(SpdySession3 *self)
void
SpdySession3::OnTransportStatus(nsITransport* aTransport,
nsresult aStatus,
uint64_t aProgress)
nsresult aStatus,
uint64_t aProgress)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -1696,8 +1696,8 @@ SpdySession3::OnTransportStatus(nsITransport* aTransport,
nsresult
SpdySession3::ReadSegments(nsAHttpSegmentReader *reader,
uint32_t count,
uint32_t *countRead)
uint32_t count,
uint32_t *countRead)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -1802,8 +1802,8 @@ SpdySession3::ReadSegments(nsAHttpSegmentReader *reader,
nsresult
SpdySession3::WriteSegments(nsAHttpSegmentWriter *writer,
uint32_t count,
uint32_t *countWritten)
uint32_t count,
uint32_t *countWritten)
{
typedef nsresult (*Control_FX) (SpdySession3 *self);
static const Control_FX sControlFunctions[] =
@ -2240,7 +2240,7 @@ SpdySession3::Close(nsresult aReason)
void
SpdySession3::CloseTransaction(nsAHttpTransaction *aTransaction,
nsresult aResult)
nsresult aResult)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("SpdySession3::CloseTransaction %p %p %x", this, aTransaction, aResult));
@ -2268,8 +2268,8 @@ SpdySession3::CloseTransaction(nsAHttpTransaction *aTransaction,
nsresult
SpdySession3::OnReadSegment(const char *buf,
uint32_t count,
uint32_t *countRead)
uint32_t count,
uint32_t *countRead)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -2365,8 +2365,8 @@ SpdySession3::CommitToSegmentSize(uint32_t count, bool forceCommitment)
nsresult
SpdySession3::OnWriteSegment(char *buf,
uint32_t count,
uint32_t *countWritten)
uint32_t count,
uint32_t *countWritten)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
nsresult rv;
@ -2509,8 +2509,8 @@ SpdySession3::IsPersistent()
nsresult
SpdySession3::TakeTransport(nsISocketTransport **,
nsIAsyncInputStream **,
nsIAsyncOutputStream **)
nsIAsyncInputStream **,
nsIAsyncOutputStream **)
{
MOZ_ASSERT(false, "TakeTransport of SpdySession3");
return NS_ERROR_UNEXPECTED;
@ -2695,9 +2695,9 @@ SpdySession3::Connection()
nsresult
SpdySession3::OnHeadersAvailable(nsAHttpTransaction *transaction,
nsHttpRequestHead *requestHead,
nsHttpResponseHead *responseHead,
bool *reset)
nsHttpRequestHead *requestHead,
nsHttpResponseHead *responseHead,
bool *reset)
{
return mConnection->OnHeadersAvailable(transaction,
requestHead,

Просмотреть файл

@ -48,34 +48,34 @@ NS_INTERFACE_MAP_END
SpdySession31::SpdySession31(nsAHttpTransaction *aHttpTransaction,
nsISocketTransport *aSocketTransport,
int32_t firstPriority)
: mSocketTransport(aSocketTransport),
mSegmentReader(nullptr),
mSegmentWriter(nullptr),
mNextStreamID(1),
mConcurrentHighWater(0),
mDownstreamState(BUFFERING_FRAME_HEADER),
mInputFrameBufferSize(kDefaultBufferSize),
mInputFrameBufferUsed(0),
mInputFrameDataLast(false),
mInputFrameDataStream(nullptr),
mNeedsCleanup(nullptr),
mShouldGoAway(false),
mClosed(false),
mCleanShutdown(false),
mDataPending(false),
mGoAwayID(0),
mMaxConcurrent(kDefaultMaxConcurrent),
mConcurrent(0),
mServerPushedResources(0),
mServerInitialStreamWindow(kDefaultRwin),
mLocalSessionWindow(kDefaultRwin),
mRemoteSessionWindow(kDefaultRwin),
mOutputQueueSize(kDefaultQueueSize),
mOutputQueueUsed(0),
mOutputQueueSent(0),
mLastReadEpoch(PR_IntervalNow()),
mPingSentEpoch(0),
mNextPingID(1)
: mSocketTransport(aSocketTransport)
, mSegmentReader(nullptr)
, mSegmentWriter(nullptr)
, mNextStreamID(1)
, mConcurrentHighWater(0)
, mDownstreamState(BUFFERING_FRAME_HEADER)
, mInputFrameBufferSize(kDefaultBufferSize)
, mInputFrameBufferUsed(0)
, mInputFrameDataLast(false)
, mInputFrameDataStream(nullptr)
, mNeedsCleanup(nullptr)
, mShouldGoAway(false)
, mClosed(false)
, mCleanShutdown(false)
, mDataPending(false)
, mGoAwayID(0)
, mMaxConcurrent(kDefaultMaxConcurrent)
, mConcurrent(0)
, mServerPushedResources(0)
, mServerInitialStreamWindow(kDefaultRwin)
, mLocalSessionWindow(kDefaultRwin)
, mRemoteSessionWindow(kDefaultRwin)
, mOutputQueueSize(kDefaultQueueSize)
, mOutputQueueUsed(0)
, mOutputQueueSent(0)
, mLastReadEpoch(PR_IntervalNow())
, mPingSentEpoch(0)
, mNextPingID(1)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -103,9 +103,9 @@ SpdySession31::SpdySession31(nsAHttpTransaction *aHttpTransaction,
}
PLDHashOperator
SpdySession31::ShutdownEnumerator(nsAHttpTransaction *key,
nsAutoPtr<SpdyStream31> &stream,
void *closure)
SpdySession31::ShutdownEnumerator(nsAHttpTransaction *key,
nsAutoPtr<SpdyStream31> &stream,
void *closure)
{
SpdySession31 *self = static_cast<SpdySession31 *>(closure);
@ -515,7 +515,7 @@ SpdySession31::ChangeDownstreamState(enum stateType newState)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("SpdyStream31::ChangeDownstreamState() %p from %X to %X",
LOG3(("SpdySession31::ChangeDownstreamState() %p from %X to %X",
this, mDownstreamState, newState));
mDownstreamState = newState;
}
@ -525,7 +525,7 @@ SpdySession31::ResetDownstreamState()
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG3(("SpdyStream31::ResetDownstreamState() %p", this));
LOG3(("SpdySession31::ResetDownstreamState() %p", this));
ChangeDownstreamState(BUFFERING_FRAME_HEADER);
if (mInputFrameDataLast && mInputFrameDataStream) {

Просмотреть файл

@ -25,9 +25,9 @@ class SpdyPushedStream31;
class SpdyStream31;
class SpdySession31 MOZ_FINAL : public ASpdySession
, public nsAHttpConnection
, public nsAHttpSegmentReader
, public nsAHttpSegmentWriter
, public nsAHttpConnection
, public nsAHttpSegmentReader
, public nsAHttpSegmentWriter
{
public:
NS_DECL_ISUPPORTS

Просмотреть файл

@ -38,38 +38,38 @@ namespace mozilla {
namespace net {
SpdyStream3::SpdyStream3(nsAHttpTransaction *httpTransaction,
SpdySession3 *spdySession,
int32_t priority)
: mStreamID(0),
mSession(spdySession),
mUpstreamState(GENERATING_SYN_STREAM),
mSynFrameComplete(0),
mSentFinOnData(0),
mTransaction(httpTransaction),
mSocketTransport(spdySession->SocketTransport()),
mSegmentReader(nullptr),
mSegmentWriter(nullptr),
mChunkSize(spdySession->SendingChunkSize()),
mRequestBlockedOnRead(0),
mRecvdFin(0),
mFullyOpen(0),
mSentWaitingFor(0),
mReceivedData(0),
mSetTCPSocketBuffer(0),
mTxInlineFrameSize(SpdySession3::kDefaultBufferSize),
mTxInlineFrameUsed(0),
mTxStreamFrameSize(0),
mZlib(spdySession->UpstreamZlib()),
mDecompressBufferSize(SpdySession3::kDefaultBufferSize),
mDecompressBufferUsed(0),
mDecompressedBytes(0),
mRequestBodyLenRemaining(0),
mPriority(priority),
mLocalUnacked(0),
mBlockedOnRwin(false),
mTotalSent(0),
mTotalRead(0),
mPushSource(nullptr)
SpdySession3 *spdySession,
int32_t priority)
: mStreamID(0)
, mSession(spdySession)
, mUpstreamState(GENERATING_SYN_STREAM)
, mSynFrameComplete(0)
, mSentFinOnData(0)
, mTransaction(httpTransaction)
, mSocketTransport(spdySession->SocketTransport())
, mSegmentReader(nullptr)
, mSegmentWriter(nullptr)
, mChunkSize(spdySession->SendingChunkSize())
, mRequestBlockedOnRead(0)
, mRecvdFin(0)
, mFullyOpen(0)
, mSentWaitingFor(0)
, mReceivedData(0)
, mSetTCPSocketBuffer(0)
, mTxInlineFrameSize(SpdySession3::kDefaultBufferSize)
, mTxInlineFrameUsed(0)
, mTxStreamFrameSize(0)
, mZlib(spdySession->UpstreamZlib())
, mDecompressBufferSize(SpdySession3::kDefaultBufferSize)
, mDecompressBufferUsed(0)
, mDecompressedBytes(0)
, mRequestBodyLenRemaining(0)
, mPriority(priority)
, mLocalUnacked(0)
, mBlockedOnRwin(false)
, mTotalSent(0)
, mTotalRead(0)
, mPushSource(nullptr)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -189,9 +189,8 @@ SpdyStream3::ReadSegments(nsAHttpSegmentReader *reader,
}
// WriteSegments() is used to read data off the socket. Generally this is
// just the SPDY frame header and from there the appropriate SPDYStream
// is identified from the Stream-ID. The http transaction associated with
// that read then pulls in the data directly.
// just a call through to the associate nsHttpTransaciton for this stream
// for the remaining data bytes indicated by the current DATA frame.
nsresult
SpdyStream3::WriteSegments(nsAHttpSegmentWriter *writer,
@ -1343,8 +1342,8 @@ SpdyStream3::UpdateRemoteWindow(int32_t delta)
nsresult
SpdyStream3::OnReadSegment(const char *buf,
uint32_t count,
uint32_t *countRead)
uint32_t count,
uint32_t *countRead)
{
LOG3(("SpdyStream3::OnReadSegment %p count=%d state=%x",
this, count, mUpstreamState));

Просмотреть файл

@ -38,36 +38,36 @@ namespace net {
SpdyStream31::SpdyStream31(nsAHttpTransaction *httpTransaction,
SpdySession31 *spdySession,
int32_t priority)
: mStreamID(0),
mSession(spdySession),
mUpstreamState(GENERATING_SYN_STREAM),
mSynFrameComplete(0),
mSentFinOnData(0),
mTransaction(httpTransaction),
mSocketTransport(spdySession->SocketTransport()),
mSegmentReader(nullptr),
mSegmentWriter(nullptr),
mChunkSize(spdySession->SendingChunkSize()),
mRequestBlockedOnRead(0),
mRecvdFin(0),
mFullyOpen(0),
mSentWaitingFor(0),
mReceivedData(0),
mSetTCPSocketBuffer(0),
mTxInlineFrameSize(SpdySession31::kDefaultBufferSize),
mTxInlineFrameUsed(0),
mTxStreamFrameSize(0),
mZlib(spdySession->UpstreamZlib()),
mDecompressBufferSize(SpdySession31::kDefaultBufferSize),
mDecompressBufferUsed(0),
mDecompressedBytes(0),
mRequestBodyLenRemaining(0),
mPriority(priority),
mLocalUnacked(0),
mBlockedOnRwin(false),
mTotalSent(0),
mTotalRead(0),
mPushSource(nullptr)
: mStreamID(0)
, mSession(spdySession)
, mUpstreamState(GENERATING_SYN_STREAM)
, mSynFrameComplete(0)
, mSentFinOnData(0)
, mTransaction(httpTransaction)
, mSocketTransport(spdySession->SocketTransport())
, mSegmentReader(nullptr)
, mSegmentWriter(nullptr)
, mChunkSize(spdySession->SendingChunkSize())
, mRequestBlockedOnRead(0)
, mRecvdFin(0)
, mFullyOpen(0)
, mSentWaitingFor(0)
, mReceivedData(0)
, mSetTCPSocketBuffer(0)
, mTxInlineFrameSize(SpdySession31::kDefaultBufferSize)
, mTxInlineFrameUsed(0)
, mTxStreamFrameSize(0)
, mZlib(spdySession->UpstreamZlib())
, mDecompressBufferSize(SpdySession31::kDefaultBufferSize)
, mDecompressBufferUsed(0)
, mDecompressedBytes(0)
, mRequestBodyLenRemaining(0)
, mPriority(priority)
, mLocalUnacked(0)
, mBlockedOnRwin(false)
, mTotalSent(0)
, mTotalRead(0)
, mPushSource(nullptr)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@ -194,9 +194,8 @@ SpdyStream31::ReadSegments(nsAHttpSegmentReader *reader,
}
// WriteSegments() is used to read data off the socket. Generally this is
// just the SPDY frame header and from there the appropriate SPDYStream
// is identified from the Stream-ID. The http transaction associated with
// that read then pulls in the data directly.
// just a call through to the associate nsHttpTransaciton for this stream
// for the remaining data bytes indicated by the current DATA frame.
nsresult
SpdyStream31::WriteSegments(nsAHttpSegmentWriter *writer,

Просмотреть файл

@ -78,7 +78,7 @@ nsHttpConnection::nsHttpConnection()
, mResponseTimeoutEnabled(false)
, mTCPKeepaliveConfig(kTCPKeepaliveDisabled)
{
LOG(("Creating nsHttpConnection @%x\n", this));
LOG(("Creating nsHttpConnection @%p\n", this));
// the default timeout is for when this connection has not yet processed a
// transaction
@ -89,7 +89,7 @@ nsHttpConnection::nsHttpConnection()
nsHttpConnection::~nsHttpConnection()
{
LOG(("Destroying nsHttpConnection @%x\n", this));
LOG(("Destroying nsHttpConnection @%p\n", this));
if (!mEverUsedSpdy) {
LOG(("nsHttpConnection %p performed %d HTTP/1.x transactions\n",
@ -1247,7 +1247,7 @@ nsHttpConnection::EndIdleMonitoring()
void
nsHttpConnection::CloseTransaction(nsAHttpTransaction *trans, nsresult reason)
{
LOG(("nsHttpConnection::CloseTransaction[this=%p trans=%x reason=%x]\n",
LOG(("nsHttpConnection::CloseTransaction[this=%p trans=%p reason=%x]\n",
this, trans, reason));
MOZ_ASSERT(trans == mTransaction, "wrong transaction");

Просмотреть файл

@ -73,28 +73,30 @@ public:
//-------------------------------------------------------------------------
// XXX document when these are ok to call
bool SupportsPipelining();
bool IsKeepAlive() { return mUsingSpdyVersion ||
(mKeepAliveMask && mKeepAlive); }
bool CanReuse(); // can this connection be reused?
bool CanDirectlyActivate();
bool SupportsPipelining();
bool IsKeepAlive()
{
return mUsingSpdyVersion || (mKeepAliveMask && mKeepAlive);
}
bool CanReuse(); // can this connection be reused?
bool CanDirectlyActivate();
// Returns time in seconds for how long connection can be reused.
uint32_t TimeToLive();
void DontReuse();
void DontReuse();
bool IsProxyConnectInProgress()
bool IsProxyConnectInProgress()
{
return mProxyConnectInProgress;
}
bool LastTransactionExpectedNoContent()
bool LastTransactionExpectedNoContent()
{
return mLastTransactionExpectedNoContent;
}
void SetLastTransactionExpectedNoContent(bool val)
void SetLastTransactionExpectedNoContent(bool val)
{
mLastTransactionExpectedNoContent = val;
}

Просмотреть файл

@ -86,12 +86,12 @@ nsHttpConnectionMgr::nsHttpConnectionMgr()
, mTimeoutTickArmed(false)
, mTimeoutTickNext(1)
{
LOG(("Creating nsHttpConnectionMgr @%x\n", this));
LOG(("Creating nsHttpConnectionMgr @%p\n", this));
}
nsHttpConnectionMgr::~nsHttpConnectionMgr()
{
LOG(("Destroying nsHttpConnectionMgr @%x\n", this));
LOG(("Destroying nsHttpConnectionMgr @%p\n", this));
if (mTimeoutTick)
mTimeoutTick->Cancel();
}
@ -286,7 +286,7 @@ nsHttpConnectionMgr::Observe(nsISupports *subject,
nsresult
nsHttpConnectionMgr::AddTransaction(nsHttpTransaction *trans, int32_t priority)
{
LOG(("nsHttpConnectionMgr::AddTransaction [trans=%x %d]\n", trans, priority));
LOG(("nsHttpConnectionMgr::AddTransaction [trans=%p %d]\n", trans, priority));
NS_ADDREF(trans);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgNewTransaction, priority, trans);
@ -298,7 +298,7 @@ nsHttpConnectionMgr::AddTransaction(nsHttpTransaction *trans, int32_t priority)
nsresult
nsHttpConnectionMgr::RescheduleTransaction(nsHttpTransaction *trans, int32_t priority)
{
LOG(("nsHttpConnectionMgr::RescheduleTransaction [trans=%x %d]\n", trans, priority));
LOG(("nsHttpConnectionMgr::RescheduleTransaction [trans=%p %d]\n", trans, priority));
NS_ADDREF(trans);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgReschedTransaction, priority, trans);
@ -310,7 +310,7 @@ nsHttpConnectionMgr::RescheduleTransaction(nsHttpTransaction *trans, int32_t pri
nsresult
nsHttpConnectionMgr::CancelTransaction(nsHttpTransaction *trans, nsresult reason)
{
LOG(("nsHttpConnectionMgr::CancelTransaction [trans=%x reason=%x]\n", trans, reason));
LOG(("nsHttpConnectionMgr::CancelTransaction [trans=%p reason=%x]\n", trans, reason));
NS_ADDREF(trans);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgCancelTransaction,
@ -426,7 +426,7 @@ nsHttpConnectionMgr::GetSocketThreadTarget(nsIEventTarget **target)
nsresult
nsHttpConnectionMgr::ReclaimConnection(nsHttpConnection *conn)
{
LOG(("nsHttpConnectionMgr::ReclaimConnection [conn=%x]\n", conn));
LOG(("nsHttpConnectionMgr::ReclaimConnection [conn=%p]\n", conn));
NS_ADDREF(conn);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgReclaimConnection, 0, conn);
@ -1601,7 +1601,7 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
nsRefPtr<nsHttpConnection> conn = GetSpdyPreferredConn(ent);
if (conn) {
if ((caps & NS_HTTP_ALLOW_KEEPALIVE) || !conn->IsExperienced()) {
LOG((" dispatch to spdy: [conn=%x]\n", conn.get()));
LOG((" dispatch to spdy: [conn=%p]\n", conn.get()));
trans->RemoveDispatchedAsBlocking(); /* just in case */
DispatchTransaction(ent, trans, conn);
return NS_OK;
@ -1676,12 +1676,12 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
// we check if the connection can be reused before even checking if
// it is a "matching" connection.
if (!conn->CanReuse()) {
LOG((" dropping stale connection: [conn=%x]\n", conn.get()));
LOG((" dropping stale connection: [conn=%p]\n", conn.get()));
conn->Close(NS_ERROR_ABORT);
conn = nullptr;
}
else {
LOG((" reusing connection [conn=%x]\n", conn.get()));
LOG((" reusing connection [conn=%p]\n", conn.get()));
conn->EndIdleMonitoring();
}
@ -1756,7 +1756,7 @@ nsHttpConnectionMgr::DispatchTransaction(nsConnectionEntry *ent,
nsresult rv;
LOG(("nsHttpConnectionMgr::DispatchTransaction "
"[ci=%s trans=%x caps=%x conn=%x priority=%d]\n",
"[ci=%s trans=%p caps=%x conn=%p priority=%d]\n",
ent->mConnInfo->HashKey().get(), trans, caps, conn, priority));
// It is possible for a rate-paced transaction to be dispatched independent
@ -1816,7 +1816,7 @@ nsHttpConnectionMgr::DispatchAbstractTransaction(nsConnectionEntry *ent,
MOZ_ASSERT(!conn->UsingSpdy(),
"Spdy Must Not Use DispatchAbstractTransaction");
LOG(("nsHttpConnectionMgr::DispatchAbstractTransaction "
"[ci=%s trans=%x caps=%x conn=%x]\n",
"[ci=%s trans=%p caps=%x conn=%p]\n",
ent->mConnInfo->HashKey().get(), aTrans, caps, conn));
/* Use pipeline datastructure even if connection does not currently qualify