Bug 1523454 - Expose isParentInterceptEnabled in nsIServiceWorkerManager;r=asuth
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 08 Feb 2019 20:05:34 +0000
changeset 458861 0dca936d2e9e
parent 458860 8826dd4a075a
child 458862 1d79453b1f68
push id35551
push usershindli@mozilla.com
push dateWed, 13 Feb 2019 21:34:09 +0000
treeherdermozilla-central@08f794a4928e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1523454
milestone67.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 1523454 - Expose isParentInterceptEnabled in nsIServiceWorkerManager;r=asuth Feel free to cancel the review if you already have a patch or if you wanted another approach. Mostly wrote this patch to make sure the DevTools patch on top of it would work. Differential Revision: https://phabricator.services.mozilla.com/D19159
dom/interfaces/base/nsIServiceWorkerManager.idl
dom/serviceworkers/ServiceWorkerManager.cpp
--- a/dom/interfaces/base/nsIServiceWorkerManager.idl
+++ b/dom/interfaces/base/nsIServiceWorkerManager.idl
@@ -175,13 +175,15 @@ interface nsIServiceWorkerManager : nsIS
                                      [optional] in uint32_t aDataLength,
                                      [optional, array, size_is(aDataLength)] in uint8_t aDataBytes);
   void sendPushSubscriptionChangeEvent(in ACString aOriginAttributes,
                                        in ACString scope);
 
   void addListener(in nsIServiceWorkerManagerListener aListener);
 
   void removeListener(in nsIServiceWorkerManagerListener aListener);
+
+  bool isParentInterceptEnabled();
 };
 
 %{ C++
 #define SERVICEWORKERMANAGER_CONTRACTID "@mozilla.org/serviceworkers/manager;1"
 %}
--- a/dom/serviceworkers/ServiceWorkerManager.cpp
+++ b/dom/serviceworkers/ServiceWorkerManager.cpp
@@ -3005,10 +3005,17 @@ void ServiceWorkerManager::MaybeSendUnre
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   Unused << mActor->SendUnregister(principalInfo,
                                    NS_ConvertUTF8toUTF16(aScope));
 }
 
+NS_IMETHODIMP
+ServiceWorkerManager::IsParentInterceptEnabled(bool* aIsEnabled) {
+  MOZ_ASSERT(NS_IsMainThread());
+  *aIsEnabled = ServiceWorkerParentInterceptEnabled();
+  return NS_OK;
+}
+
 }  // namespace dom
 }  // namespace mozilla