Bug 1641496 - P4: Send request size in OnStopRequest message r=dragana

Differential Revision: https://phabricator.services.mozilla.com/D77275
This commit is contained in:
Kershaw Chang 2020-06-04 22:56:43 +00:00
Родитель ef6ab5d3fb
Коммит cba8b4bdfc
4 изменённых файлов: 23 добавлений и 13 удалений

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

@ -475,11 +475,14 @@ HttpTransactionChild::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
responseTrailers.emplace(*headerArray);
}
Unused << SendOnStopRequest(
aStatus, mTransaction->ResponseIsComplete(),
mTransaction->GetTransferSize(),
ToTimingStructArgs(mTransaction->Timings()), responseTrailers,
mTransaction->HasStickyConnection(), mTransactionObserverResult);
int64_t requestSize = mTransaction->GetRequestSize();
Unused << SendOnStopRequest(aStatus, mTransaction->ResponseIsComplete(),
mTransaction->GetTransferSize(),
ToTimingStructArgs(mTransaction->Timings()),
responseTrailers,
mTransaction->HasStickyConnection(),
mTransactionObserverResult, requestSize);
return NS_OK;
}

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

@ -489,7 +489,8 @@ mozilla::ipc::IPCResult HttpTransactionParent::RecvOnStopRequest(
const int64_t& aTransferSize, const TimingStructArgs& aTimings,
const Maybe<nsHttpHeaderArray>& aResponseTrailers,
const bool& aHasStickyConn,
Maybe<TransactionObserverResult>&& aTransactionObserverResult) {
Maybe<TransactionObserverResult>&& aTransactionObserverResult,
const int64_t& aRequestSize) {
LOG(("HttpTransactionParent::RecvOnStopRequest [this=%p status=%" PRIx32
"]\n",
this, static_cast<uint32_t>(aStatus)));
@ -497,11 +498,12 @@ mozilla::ipc::IPCResult HttpTransactionParent::RecvOnStopRequest(
this, [self = UnsafePtr<HttpTransactionParent>(this), aStatus,
aResponseIsComplete, aTransferSize, aTimings, aResponseTrailers,
aHasStickyConn,
aTransactionObserverResult{
std::move(aTransactionObserverResult)}]() mutable {
aTransactionObserverResult{std::move(aTransactionObserverResult)},
aRequestSize]() mutable {
self->DoOnStopRequest(aStatus, aResponseIsComplete, aTransferSize,
aTimings, aResponseTrailers, aHasStickyConn,
std::move(aTransactionObserverResult));
std::move(aTransactionObserverResult),
aRequestSize);
}));
return IPC_OK();
}
@ -511,7 +513,8 @@ void HttpTransactionParent::DoOnStopRequest(
const int64_t& aTransferSize, const TimingStructArgs& aTimings,
const Maybe<nsHttpHeaderArray>& aResponseTrailers,
const bool& aHasStickyConn,
Maybe<TransactionObserverResult>&& aTransactionObserverResult) {
Maybe<TransactionObserverResult>&& aTransactionObserverResult,
const int64_t& aRequestSize) {
LOG(("HttpTransactionParent::DoOnStopRequest [this=%p]\n", this));
if (mCanceled) {
return;
@ -525,6 +528,7 @@ void HttpTransactionParent::DoOnStopRequest(
mResponseIsComplete = aResponseIsComplete;
mTransferSize = aTransferSize;
mRequestSize = aRequestSize;
TimingStructArgsToTimingsStruct(aTimings, mTimings);
if (aResponseTrailers.isSome()) {

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

@ -62,7 +62,8 @@ class HttpTransactionParent final : public PHttpTransactionParent,
const int64_t& aTransferSize, const TimingStructArgs& aTimings,
const Maybe<nsHttpHeaderArray>& responseTrailers,
const bool& aHasStickyConn,
Maybe<TransactionObserverResult>&& aTransactionObserverResult);
Maybe<TransactionObserverResult>&& aTransactionObserverResult,
const int64_t& aRequestSize);
mozilla::ipc::IPCResult RecvOnNetAddrUpdate(const NetAddr& aSelfAddr,
const NetAddr& aPeerAddr,
const bool& aResolvedByTRR);
@ -100,7 +101,8 @@ class HttpTransactionParent final : public PHttpTransactionParent,
const int64_t& aTransferSize, const TimingStructArgs& aTimings,
const Maybe<nsHttpHeaderArray>& responseTrailers,
const bool& aHasStickyConn,
Maybe<TransactionObserverResult>&& aTransactionObserverResult);
Maybe<TransactionObserverResult>&& aTransactionObserverResult,
const int64_t& aRequestSize);
void DoNotifyListener();
nsCOMPtr<nsITransportEventSink> mEventsink;

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

@ -51,7 +51,8 @@ parent:
TimingStructArgs timings,
nsHttpHeaderArray? responseTrailers,
bool hasStickyConn,
TransactionObserverResult? transactionObserverResult);
TransactionObserverResult? transactionObserverResult,
int64_t requestSize);
async OnNetAddrUpdate(NetAddr selfAddr, NetAddr peerAddr, bool resolvedByTRR);
async OnInitFailed(nsresult status);
async OnH2PushStream(uint32_t pushedStreamId,