summaryrefslogtreecommitdiffstats
path: root/dom/workers/ServiceWorkerEvents.cpp
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-04-29 14:44:20 +0200
committerGitHub <noreply@github.com>2018-04-29 14:44:20 +0200
commit6fe08dcf34417e825b7b9b6b33141a4a3b46ba24 (patch)
treef5d213986dcdb7c281e23ce93e176b7ca9fca92c /dom/workers/ServiceWorkerEvents.cpp
parentdc35e5c26dfa8c7fe6d27f7bc96f7a6e3c02de9b (diff)
parente040ed925030f899f845d458c226f7e439f4ec8b (diff)
downloadUXP-6fe08dcf34417e825b7b9b6b33141a4a3b46ba24.tar
UXP-6fe08dcf34417e825b7b9b6b33141a4a3b46ba24.tar.gz
UXP-6fe08dcf34417e825b7b9b6b33141a4a3b46ba24.tar.lz
UXP-6fe08dcf34417e825b7b9b6b33141a4a3b46ba24.tar.xz
UXP-6fe08dcf34417e825b7b9b6b33141a4a3b46ba24.zip
Merge pull request #293 from janekptacijarabaci/js_dom_performance-resource-timing_1
moebius#158: The Performance Resource Timing (added support for "workerStart")
Diffstat (limited to 'dom/workers/ServiceWorkerEvents.cpp')
-rw-r--r--dom/workers/ServiceWorkerEvents.cpp10
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);