mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-11 21:58:41 +02:00
Bug 1567222 - Add a LOAD_STOP marker when a request goes through a service worker r=asuth,necko-reviewers,valentin,gerald
Differential Revision: https://phabricator.services.mozilla.com/D107714
This commit is contained in:
parent
25fa34ae40
commit
1081130547
2 changed files with 33 additions and 4 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include "InterceptedHttpChannel.h"
|
||||
#include "nsContentSecurityManager.h"
|
||||
#include "nsEscape.h"
|
||||
#include "mozilla/ProfilerMarkers.h"
|
||||
#include "mozilla/SchedulerGroup.h"
|
||||
#include "mozilla/ScopeExit.h"
|
||||
#include "mozilla/dom/ChannelInfo.h"
|
||||
|
|
@ -1071,6 +1072,32 @@ InterceptedHttpChannel::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
|
|||
// Register entry to the PerformanceStorage resource timing
|
||||
MaybeReportTimingData();
|
||||
|
||||
#ifdef MOZ_GECKO_PROFILER
|
||||
if (profiler_can_accept_markers()) {
|
||||
// These do allocations/frees/etc; avoid if not active
|
||||
nsAutoCString requestMethod;
|
||||
GetRequestMethod(requestMethod);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
GetURI(getter_AddRefs(uri));
|
||||
int32_t priority = PRIORITY_NORMAL;
|
||||
GetPriority(&priority);
|
||||
|
||||
uint64_t size = 0;
|
||||
GetEncodedBodySize(&size);
|
||||
|
||||
nsAutoCString contentType;
|
||||
if (mResponseHead) {
|
||||
mResponseHead->ContentType(contentType);
|
||||
}
|
||||
profiler_add_network_marker(
|
||||
uri, requestMethod, priority, mChannelId, NetworkLoadType::LOAD_STOP,
|
||||
mAsyncOpenTime, TimeStamp::Now(), size, kCacheUnknown,
|
||||
mLoadInfo->GetInnerWindowID(), &mTransactionTimings, nullptr,
|
||||
std::move(mSource), Some(nsDependentCString(contentType.get())));
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (mListener) {
|
||||
rv = mListener->OnStopRequest(this, mStatus);
|
||||
|
|
|
|||
|
|
@ -8117,16 +8117,18 @@ nsresult nsHttpChannel::ContinueOnStopRequest(nsresult aStatus, bool aIsFromNet,
|
|||
int32_t priority = PRIORITY_NORMAL;
|
||||
GetPriority(&priority);
|
||||
|
||||
uint64_t size = 0;
|
||||
GetEncodedBodySize(&size);
|
||||
|
||||
nsAutoCString contentType;
|
||||
if (mResponseHead) {
|
||||
mResponseHead->ContentType(contentType);
|
||||
}
|
||||
profiler_add_network_marker(
|
||||
uri, requestMethod, priority, mChannelId, NetworkLoadType::LOAD_STOP,
|
||||
mLastStatusReported, TimeStamp::Now(), mLogicalOffset,
|
||||
mCacheDisposition, mLoadInfo->GetInnerWindowID(), &mTransactionTimings,
|
||||
nullptr, std::move(mSource),
|
||||
Some(nsDependentCString(contentType.get())));
|
||||
mLastStatusReported, TimeStamp::Now(), size, mCacheDisposition,
|
||||
mLoadInfo->GetInnerWindowID(), &mTransactionTimings, nullptr,
|
||||
std::move(mSource), Some(nsDependentCString(contentType.get())));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue