зеркало из https://github.com/mozilla/gecko-dev.git
bug 378637 part 10 - implement nsAHttpTransaction::ConnectionInfo r=hurley
--HG-- extra : rebase_source : b4b955c652b14e750013130428b71e2e308fead3
This commit is contained in:
Родитель
7df71d973e
Коммит
b48b19cab3
|
@ -191,6 +191,19 @@ Http2PushTransactionBuffer::OnTransportStatus(nsITransport* transport,
|
|||
{
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
Http2PushTransactionBuffer::ConnectionInfo()
|
||||
{
|
||||
if (!mPushStream) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!mPushStream->Transaction()) {
|
||||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(mPushStream->Transaction() != this);
|
||||
return mPushStream->Transaction()->ConnectionInfo();
|
||||
}
|
||||
|
||||
bool
|
||||
Http2PushTransactionBuffer::IsDone()
|
||||
{
|
||||
|
|
|
@ -2553,6 +2553,14 @@ Http2Session::Close(nsresult aReason)
|
|||
mSegmentWriter = nullptr;
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
Http2Session::ConnectionInfo()
|
||||
{
|
||||
nsRefPtr<nsHttpConnectionInfo> ci;
|
||||
GetConnectionInfo(getter_AddRefs(ci));
|
||||
return ci.get();
|
||||
}
|
||||
|
||||
void
|
||||
Http2Session::CloseTransaction(nsAHttpTransaction *aTransaction,
|
||||
nsresult aResult)
|
||||
|
|
|
@ -161,6 +161,12 @@ NullHttpTransaction::Close(nsresult reason)
|
|||
mIsDone = true;
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
NullHttpTransaction::ConnectionInfo()
|
||||
{
|
||||
return mConnectionInfo;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NullHttpTransaction::AddTransaction(nsAHttpTransaction *trans)
|
||||
{
|
||||
|
|
|
@ -32,8 +32,6 @@ public:
|
|||
uint32_t caps);
|
||||
~NullHttpTransaction();
|
||||
|
||||
nsHttpConnectionInfo *ConnectionInfo() { return mConnectionInfo; }
|
||||
|
||||
// Overload of nsAHttpTransaction methods
|
||||
bool IsNullTransaction() MOZ_OVERRIDE MOZ_FINAL { return true; }
|
||||
bool ResponseTimeoutEnabled() const MOZ_OVERRIDE MOZ_FINAL {return true; }
|
||||
|
|
|
@ -215,6 +215,19 @@ SpdyPush3TransactionBuffer::OnTransportStatus(nsITransport* transport,
|
|||
{
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
SpdyPush3TransactionBuffer::ConnectionInfo()
|
||||
{
|
||||
if (!mPushStream) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!mPushStream->Transaction()) {
|
||||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(mPushStream->Transaction() != this);
|
||||
return mPushStream->Transaction()->ConnectionInfo();
|
||||
}
|
||||
|
||||
bool
|
||||
SpdyPush3TransactionBuffer::IsDone()
|
||||
{
|
||||
|
|
|
@ -213,6 +213,19 @@ SpdyPush31TransactionBuffer::OnTransportStatus(nsITransport* transport,
|
|||
{
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
SpdyPush31TransactionBuffer::ConnectionInfo()
|
||||
{
|
||||
if (!mPushStream) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!mPushStream->Transaction()) {
|
||||
return nullptr;
|
||||
}
|
||||
MOZ_ASSERT(mPushStream->Transaction() != this);
|
||||
return mPushStream->Transaction()->ConnectionInfo();
|
||||
}
|
||||
|
||||
bool
|
||||
SpdyPush31TransactionBuffer::IsDone()
|
||||
{
|
||||
|
|
|
@ -2210,6 +2210,14 @@ SpdySession3::Close(nsresult aReason)
|
|||
mSegmentWriter = nullptr;
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
SpdySession3::ConnectionInfo()
|
||||
{
|
||||
nsRefPtr<nsHttpConnectionInfo> ci;
|
||||
GetConnectionInfo(getter_AddRefs(ci));
|
||||
return ci.get();
|
||||
}
|
||||
|
||||
void
|
||||
SpdySession3::CloseTransaction(nsAHttpTransaction *aTransaction,
|
||||
nsresult aResult)
|
||||
|
|
|
@ -2344,6 +2344,14 @@ SpdySession31::Close(nsresult aReason)
|
|||
mSegmentWriter = nullptr;
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
SpdySession31::ConnectionInfo()
|
||||
{
|
||||
nsRefPtr<nsHttpConnectionInfo> ci;
|
||||
GetConnectionInfo(getter_AddRefs(ci));
|
||||
return ci.get();
|
||||
}
|
||||
|
||||
void
|
||||
SpdySession31::CloseTransaction(nsAHttpTransaction *aTransaction,
|
||||
nsresult aResult)
|
||||
|
|
|
@ -21,6 +21,7 @@ class nsAHttpSegmentWriter;
|
|||
class nsHttpTransaction;
|
||||
class nsHttpPipeline;
|
||||
class nsHttpRequestHead;
|
||||
class nsHttpConnectionInfo;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Abstract base class for a HTTP transaction:
|
||||
|
@ -132,6 +133,9 @@ public:
|
|||
// return the load group connection information associated with the transaction
|
||||
virtual nsILoadGroupConnectionInfo *LoadGroupConnectionInfo() { return nullptr; }
|
||||
|
||||
// return the connection information associated with the transaction
|
||||
virtual nsHttpConnectionInfo *ConnectionInfo() = 0;
|
||||
|
||||
// The base definition of these is done in nsHttpTransaction.cpp
|
||||
virtual bool ResponseTimeoutEnabled() const;
|
||||
virtual PRIntervalTime ResponseTimeout();
|
||||
|
@ -174,6 +178,7 @@ public:
|
|||
nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, uint32_t *); \
|
||||
nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *); \
|
||||
void Close(nsresult reason); \
|
||||
nsHttpConnectionInfo *ConnectionInfo(); \
|
||||
void SetProxyConnectFailed(); \
|
||||
nsHttpRequestHead *RequestHead(); \
|
||||
uint32_t Http1xTransactionCount(); \
|
||||
|
|
|
@ -529,6 +529,16 @@ nsHttpPipeline::OnTransportStatus(nsITransport* transport,
|
|||
}
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
nsHttpPipeline::ConnectionInfo()
|
||||
{
|
||||
nsAHttpTransaction *trans = Request(0) ? Request(0) : Response(0);
|
||||
if (!trans) {
|
||||
return nullptr;
|
||||
}
|
||||
return trans->ConnectionInfo();
|
||||
}
|
||||
|
||||
bool
|
||||
nsHttpPipeline::IsDone()
|
||||
{
|
||||
|
|
|
@ -938,6 +938,12 @@ nsHttpTransaction::Close(nsresult reason)
|
|||
"net::http::transaction");
|
||||
}
|
||||
|
||||
nsHttpConnectionInfo *
|
||||
nsHttpTransaction::ConnectionInfo()
|
||||
{
|
||||
return mConnInfo;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHttpTransaction::AddTransaction(nsAHttpTransaction *trans)
|
||||
{
|
||||
|
|
|
@ -86,7 +86,6 @@ public:
|
|||
nsIAsyncInputStream **responseBody);
|
||||
|
||||
// attributes
|
||||
nsHttpConnectionInfo *ConnectionInfo() { return mConnInfo; }
|
||||
nsHttpResponseHead *ResponseHead() { return mHaveAllHeaders ? mResponseHead : nullptr; }
|
||||
nsISupports *SecurityInfo() { return mSecurityInfo; }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче