diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 11:49:50 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 11:49:50 +0200 |
commit | e040ed925030f899f845d458c226f7e439f4ec8b (patch) | |
tree | 797edf76896b10a38446171aa341da8dfef8ca08 /dom/workers/ServiceWorkerEvents.cpp | |
parent | aff03b0a67c41cf7af5df9c9eef715a8b27a2667 (diff) | |
download | UXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar UXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar.gz UXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar.lz UXP-e040ed925030f899f845d458c226f7e439f4ec8b.tar.xz UXP-e040ed925030f899f845d458c226f7e439f4ec8b.zip |
moebius#158: The Performance Resource Timing (added support for "workerStart")
https://github.com/MoonchildProductions/moebius/pull/158
Diffstat (limited to 'dom/workers/ServiceWorkerEvents.cpp')
-rw-r--r-- | dom/workers/ServiceWorkerEvents.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp index 780b2f5f8..1f79e2c92 100644 --- a/dom/workers/ServiceWorkerEvents.cpp +++ b/dom/workers/ServiceWorkerEvents.cpp @@ -12,6 +12,7 @@ #include "nsINetworkInterceptController.h" #include "nsIOutputStream.h" #include "nsIScriptError.h" +#include "nsITimedChannel.h" #include "nsIUnicodeDecoder.h" #include "nsIUnicodeEncoder.h" #include "nsContentPolicyUtils.h" @@ -108,6 +109,12 @@ NS_IMETHODIMP CancelChannelRunnable::Run() { MOZ_ASSERT(NS_IsMainThread()); + + // TODO: When bug 1204254 is implemented, this time marker should be moved to + // the point where the body of the network request is complete. + mChannel->SetHandleFetchEventEnd(TimeStamp::Now()); + mChannel->SaveTimeStampsToUnderlyingChannel(); + mChannel->Cancel(mStatus); mRegistration->MaybeScheduleUpdate(); return NS_OK; @@ -230,6 +237,9 @@ public: return NS_OK; } + mChannel->SetHandleFetchEventEnd(TimeStamp::Now()); + mChannel->SaveTimeStampsToUnderlyingChannel(); + nsCOMPtr<nsIObserverService> obsService = services::GetObserverService(); if (obsService) { obsService->NotifyObservers(underlyingChannel, "service-worker-synthesized-response", nullptr); |