From c7c2eba05cea2062ef66bc53d351a9a1dd3386f7 Mon Sep 17 00:00:00 2001 From: Alexandre Poirot Date: Thu, 14 Jan 2016 05:53:00 -0800 Subject: [PATCH] Bug 1158264 - Send an observer service event when a service worker intercept a request. r=bkelly --- dom/workers/ServiceWorkerEvents.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp index a0dad6c8a853..6f4744844569 100644 --- a/dom/workers/ServiceWorkerEvents.cpp +++ b/dom/workers/ServiceWorkerEvents.cpp @@ -209,6 +209,12 @@ public: rv = mChannel->FinishSynthesizedResponse(mResponseURLSpec); NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to finish synthesized response"); + + nsCOMPtr obsService = services::GetObserverService(); + if (obsService) { + obsService->NotifyObservers(underlyingChannel, "service-worker-synthesized-response", nullptr); + } + return rv; }