Bug 1507043 - Add profiler labels to annotate some HttpChannelChild methods with profiler category NETWORK r=mstange
authorNazım Can Altınova <canaltinova@gmail.com>
Thu, 22 Nov 2018 10:02:15 +0000
changeset 504125 3456782875d80c25bc2e6000b99b3cdce9be43d9
parent 504124 9a4db52c22c20c1d872c1eaac1bafd4b6b1cca66
child 504126 f5ada684f144e794bbb55cf6031adc3473cca387
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1507043
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507043 - Add profiler labels to annotate some HttpChannelChild methods with profiler category NETWORK r=mstange Differential Revision: https://phabricator.services.mozilla.com/D12568
netwerk/protocol/http/HttpChannelChild.cpp
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -509,16 +509,17 @@ HttpChannelChild::RecvOnStartRequest(con
                                      const NetAddr& peerAddr,
                                      const int16_t& redirectCount,
                                      const uint32_t& cacheKey,
                                      const nsCString& altDataType,
                                      const int64_t& altDataLen,
                                      const bool& aApplyConversion,
                                      const ResourceTimingStruct& aTiming)
 {
+  AUTO_PROFILER_LABEL("HttpChannelChild::RecvOnStartRequest", NETWORK);
   LOG(("HttpChannelChild::RecvOnStartRequest [this=%p]\n", this));
   // mFlushedForDiversion and mDivertingToParent should NEVER be set at this
   // stage, as they are set in the listener's OnStartRequest.
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
     "mFlushedForDiversion should be unset before OnStartRequest!");
   MOZ_RELEASE_ASSERT(!mDivertingToParent,
     "mDivertingToParent should be unset before OnStartRequest!");
 
@@ -1088,16 +1089,17 @@ HttpChannelChild::DoOnProgress(nsIReques
   }
 }
 
 void
 HttpChannelChild::DoOnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
                                     nsIInputStream* aStream,
                                     uint64_t offset, uint32_t count)
 {
+  AUTO_PROFILER_LABEL("HttpChannelChild::DoOnDataAvailable", NETWORK);
   LOG(("HttpChannelChild::DoOnDataAvailable [this=%p]\n", this));
   if (mCanceled)
     return;
 
   nsresult rv = mListener->OnDataAvailable(aRequest, aContext, aStream, offset, count);
   if (NS_FAILED(rv)) {
     CancelOnMainThread(rv);
   }
@@ -1287,16 +1289,17 @@ HttpChannelChild::OnStopRequest(const ns
     // making sure not to send any more messages after that.
     TrySendDeletingChannel();
   }
 }
 
 void
 HttpChannelChild::DoPreOnStopRequest(nsresult aStatus)
 {
+  AUTO_PROFILER_LABEL("HttpChannelChild::DoPreOnStopRequest", NETWORK);
   LOG(("HttpChannelChild::DoPreOnStopRequest [this=%p status=%" PRIx32 "]\n",
        this, static_cast<uint32_t>(aStatus)));
   mIsPending = false;
 
   MaybeCallSynthesizedCallback();
 
   MaybeReportTimingData();
 
@@ -1326,16 +1329,17 @@ HttpChannelChild::CollectOMTTelemetry()
   nsAutoCString key(NS_CP_ContentTypeName(type));
 
   Telemetry::AccumulateCategoricalKeyed(key, mOMTResult);
 }
 
 void
 HttpChannelChild::DoOnStopRequest(nsIRequest* aRequest, nsresult aChannelStatus, nsISupports* aContext)
 {
+  AUTO_PROFILER_LABEL("HttpChannelChild::DoOnStopRequest", NETWORK);
   LOG(("HttpChannelChild::DoOnStopRequest [this=%p]\n", this));
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mIsPending);
 
   // NB: We use aChannelStatus here instead of mStatus because if there was an
   // nsCORSListenerProxy on this request, it will override the tracking
   // protection's return value.
   if (aChannelStatus == NS_ERROR_TRACKING_URI ||
@@ -1409,16 +1413,17 @@ HttpChannelChild::ProcessOnProgress(cons
   MOZ_ASSERT(OnSocketThread());
   mEventQ->RunOrEnqueue(new ProgressEvent(this, aProgress, aProgressMax));
 }
 
 void
 HttpChannelChild::OnProgress(const int64_t& progress,
                              const int64_t& progressMax)
 {
+  AUTO_PROFILER_LABEL("HttpChannelChild::OnProgress", NETWORK);
   LOG(("HttpChannelChild::OnProgress [this=%p progress=%" PRId64 "/%" PRId64 "]\n",
        this, progress, progressMax));
 
   if (mCanceled)
     return;
 
   // cache the progress sink so we don't have to query for it each time.
   if (!mProgressSink) {
@@ -1456,16 +1461,17 @@ HttpChannelChild::ProcessOnStatus(const 
   LOG(("HttpChannelChild::ProcessOnStatus [this=%p]\n", this));
   MOZ_ASSERT(OnSocketThread());
   mEventQ->RunOrEnqueue(new StatusEvent(this, aStatus));
 }
 
 void
 HttpChannelChild::OnStatus(const nsresult& status)
 {
+  AUTO_PROFILER_LABEL("HttpChannelChild::OnStatus", NETWORK);
   LOG(("HttpChannelChild::OnStatus [this=%p status=%" PRIx32 "]\n",
        this, static_cast<uint32_t>(status)));
 
   if (mCanceled)
     return;
 
   // cache the progress sink so we don't have to query for it each time.
   if (!mProgressSink)
@@ -1542,16 +1548,17 @@ HttpChannelChild::FailedAsyncOpen(const 
   }
 }
 
 void
 HttpChannelChild::CleanupBackgroundChannel()
 {
   MutexAutoLock lock(mBgChildMutex);
 
+  AUTO_PROFILER_LABEL("HttpChannelChild::CleanupBackgroundChannel", NETWORK);
   LOG(("HttpChannelChild::CleanupBackgroundChannel [this=%p bgChild=%p]\n",
        this, mBgChild.get()));
 
   mBgInitFailCallback = nullptr;
 
   if (!mBgChild) {
     return;
   }
@@ -3790,16 +3797,17 @@ HttpChannelChild::ResetInterception()
   if (NS_WARN_IF(NS_FAILED(rv))) {
     Unused << Cancel(rv);
   }
 }
 
 void
 HttpChannelChild::TrySendDeletingChannel()
 {
+  AUTO_PROFILER_LABEL("HttpChannelChild::TrySendDeletingChannel", NETWORK);
   if (!mDeletingChannelSent.compareExchange(false, true)) {
     // SendDeletingChannel is already sent.
     return;
   }
 
   if (NS_IsMainThread()) {
     if (NS_WARN_IF(!mIPCOpen)) {
       // IPC actor is detroyed already, do not send more messages.