Bug 1362388 - Remove nsAHttpTransaction::Available as footgun r=nwgh

nsAHttpTransaction::Available() obtained a bytecount from the abstract
transaction's input stream. If that stream was derived from a file://
it would create janky IO - so remove the interface.

Http2Push maintains a non-inherited interface which is used to check
the number of bytes it has internally buffered in memory.

MozReview-Commit-ID: IQHt8yGsqDE

--HG--
extra : rebase_source : 78dbd5cae35bc6cb1ce2f03192226cb85564298e
This commit is contained in:
Patrick McManus 2017-05-05 18:12:36 -04:00
Родитель 3db60df302
Коммит 1a4ed2cc65
6 изменённых файлов: 1 добавлений и 36 удалений

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

@ -113,6 +113,7 @@ public:
private:
virtual ~Http2PushTransactionBuffer();
uint64_t Available();
const static uint32_t kDefaultBufferSize = 4096;

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

@ -4041,13 +4041,6 @@ Http2Session::SetDNSWasRefreshed()
MOZ_ASSERT(false, "Http2Session::SetDNSWasRefreshed()");
}
uint64_t
Http2Session::Available()
{
MOZ_ASSERT(false, "Http2Session::Available()");
return 0;
}
nsHttpRequestHead *
Http2Session::RequestHead()
{

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

@ -208,12 +208,6 @@ NullHttpTransaction::SetDNSWasRefreshed()
mCapsToClear |= NS_HTTP_REFRESH_DNS;
}
uint64_t
NullHttpTransaction::Available()
{
return 0;
}
nsresult
NullHttpTransaction::ReadSegments(nsAHttpSegmentReader *reader,
uint32_t count, uint32_t *countRead)

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

@ -616,16 +616,6 @@ TLSFilterTransaction::SetDNSWasRefreshed()
mTransaction->SetDNSWasRefreshed();
}
uint64_t
TLSFilterTransaction::Available()
{
if (!mTransaction) {
return 0;
}
return mTransaction->Available();
}
void
TLSFilterTransaction::SetProxyConnectFailed()
{

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

@ -64,9 +64,6 @@ public:
// called to notify that a requested DNS cache entry was refreshed.
virtual void SetDNSWasRefreshed() = 0;
// called to find out how much request data is available for writing.
virtual uint64_t Available() = 0;
// called to read request data from the transaction.
virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader *reader,
uint32_t count,
@ -214,7 +211,6 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsAHttpTransaction, NS_AHTTPTRANSACTION_IID)
nsresult Status() override; \
uint32_t Caps() override; \
void SetDNSWasRefreshed() override; \
uint64_t Available() override; \
virtual MOZ_MUST_USE nsresult ReadSegments(nsAHttpSegmentReader *, uint32_t, uint32_t *) override; \
virtual MOZ_MUST_USE nsresult WriteSegments(nsAHttpSegmentWriter *, uint32_t, uint32_t *) override; \
virtual void Close(nsresult reason) override; \

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

@ -652,15 +652,6 @@ nsHttpTransaction::SetDNSWasRefreshed()
mCapsToClear |= NS_HTTP_REFRESH_DNS;
}
uint64_t
nsHttpTransaction::Available()
{
uint64_t size;
if (NS_FAILED(mRequestStream->Available(&size)))
size = 0;
return size;
}
nsresult
nsHttpTransaction::ReadRequestSegment(nsIInputStream *stream,
void *closure,