From 4b8339eede6c1b9a23a7fc9bbd7a353898e93c66 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Thu, 29 May 2014 15:02:41 -0400 Subject: [PATCH] Backed out changeset 3add0c55a799 (bug 984048) for mochitest-e10s timeouts. --- dom/interfaces/base/moz.build | 1 - .../base/nsIServiceWorkerManager.idl | 21 -- dom/workers/ServiceWorker.cpp | 10 - dom/workers/ServiceWorker.h | 3 - dom/workers/ServiceWorkerContainer.cpp | 43 +-- dom/workers/ServiceWorkerContainer.h | 5 +- dom/workers/ServiceWorkerManager.cpp | 306 ------------------ dom/workers/ServiceWorkerManager.h | 211 ------------ dom/workers/moz.build | 2 - dom/workers/test/serviceworkers/mochitest.ini | 1 - .../test_installation_simple.html | 77 ----- layout/build/nsLayoutCID.h | 4 - layout/build/nsLayoutModule.cpp | 7 - 13 files changed, 7 insertions(+), 684 deletions(-) delete mode 100644 dom/interfaces/base/nsIServiceWorkerManager.idl delete mode 100644 dom/workers/ServiceWorkerManager.cpp delete mode 100644 dom/workers/ServiceWorkerManager.h delete mode 100644 dom/workers/test/serviceworkers/test_installation_simple.html diff --git a/dom/interfaces/base/moz.build b/dom/interfaces/base/moz.build index dd21b6005ce0..bcc90e7e0532 100644 --- a/dom/interfaces/base/moz.build +++ b/dom/interfaces/base/moz.build @@ -31,7 +31,6 @@ XPIDL_SOURCES += [ 'nsIFrameRequestCallback.idl', 'nsIIdleObserver.idl', 'nsIQueryContentEventResult.idl', - 'nsIServiceWorkerManager.idl', 'nsIStructuredCloneContainer.idl', 'nsITabChild.idl', 'nsITabParent.idl', diff --git a/dom/interfaces/base/nsIServiceWorkerManager.idl b/dom/interfaces/base/nsIServiceWorkerManager.idl deleted file mode 100644 index 0a5e5a2d7127..000000000000 --- a/dom/interfaces/base/nsIServiceWorkerManager.idl +++ /dev/null @@ -1,21 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "domstubs.idl" - -[uuid(d9539ecb-6665-452c-bae7-4e42f25d23aa)] -interface nsIServiceWorkerManager : nsISupports -{ - // Returns a Promise - nsISupports register(in nsIDOMWindow aWindow, in DOMString aScope, in DOMString aScriptURI); - - // Returns a Promise - nsISupports unregister(in nsIDOMWindow aWindow, in DOMString aScope); - -}; - -%{ C++ -#define SERVICEWORKERMANAGER_CONTRACTID "@mozilla.org/serviceworkers/manager;1" -%} diff --git a/dom/workers/ServiceWorker.cpp b/dom/workers/ServiceWorker.cpp index 4baf8f78e541..7a9ba872b90f 100644 --- a/dom/workers/ServiceWorker.cpp +++ b/dom/workers/ServiceWorker.cpp @@ -44,13 +44,3 @@ ServiceWorker::WrapObject(JSContext* aCx) return ServiceWorkerBinding::Wrap(aCx, this); } - -WorkerPrivate* -ServiceWorker::GetWorkerPrivate() const -{ - // At some point in the future, this may be optimized to terminate a worker - // that hasn't been used in a certain amount of time or when there is memory - // pressure or similar. - MOZ_ASSERT(mSharedWorker); - return mSharedWorker->GetWorkerPrivate(); -} diff --git a/dom/workers/ServiceWorker.h b/dom/workers/ServiceWorker.h index 0883ad525b81..0311d06dd880 100644 --- a/dom/workers/ServiceWorker.h +++ b/dom/workers/ServiceWorker.h @@ -52,9 +52,6 @@ public: aURL = mURL; } - WorkerPrivate* - GetWorkerPrivate() const; - private: // This class can only be created from the RuntimeService. ServiceWorker(nsPIDOMWindow* aWindow, SharedWorker* aSharedWorker); diff --git a/dom/workers/ServiceWorkerContainer.cpp b/dom/workers/ServiceWorkerContainer.cpp index 064b49eec09d..2b198bd31de0 100644 --- a/dom/workers/ServiceWorkerContainer.cpp +++ b/dom/workers/ServiceWorkerContainer.cpp @@ -6,12 +6,9 @@ #include "ServiceWorkerContainer.h" -#include "nsIDocument.h" -#include "nsIServiceWorkerManager.h" #include "nsPIDOMWindow.h" #include "nsCycleCollectionParticipant.h" -#include "nsServiceManagerUtils.h" #include "mozilla/dom/Promise.h" #include "mozilla/dom/ServiceWorkerContainerBinding.h" @@ -40,46 +37,18 @@ ServiceWorkerContainer::Register(const nsAString& aScriptURL, const RegistrationOptionList& aOptions, ErrorResult& aRv) { - nsCOMPtr promise; - - nsresult rv; - nsCOMPtr swm = do_GetService(SERVICEWORKERMANAGER_CONTRACTID, &rv); - if (NS_WARN_IF(NS_FAILED(rv))) { - aRv.Throw(rv); - return nullptr; - } - - aRv = swm->Register(mWindow, aOptions.mScope, aScriptURL, getter_AddRefs(promise)); - if (aRv.Failed()) { - return nullptr; - } - - nsRefPtr ret = static_cast(promise.get()); - MOZ_ASSERT(ret); - return ret.forget(); + // FIXME(nsm): Bug 984048 + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return nullptr; } already_AddRefed ServiceWorkerContainer::Unregister(const nsAString& aScope, ErrorResult& aRv) { - nsCOMPtr promise; - - nsresult rv; - nsCOMPtr swm = do_GetService(SERVICEWORKERMANAGER_CONTRACTID, &rv); - if (NS_WARN_IF(NS_FAILED(rv))) { - aRv.Throw(rv); - return nullptr; - } - - aRv = swm->Unregister(mWindow, aScope, getter_AddRefs(promise)); - if (aRv.Failed()) { - return nullptr; - } - - nsRefPtr ret = static_cast(promise.get()); - MOZ_ASSERT(ret); - return ret.forget(); + // FIXME(nsm): Bug 984048 + aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR); + return nullptr; } already_AddRefed diff --git a/dom/workers/ServiceWorkerContainer.h b/dom/workers/ServiceWorkerContainer.h index 62cf01ee3554..ae98c7c93239 100644 --- a/dom/workers/ServiceWorkerContainer.h +++ b/dom/workers/ServiceWorkerContainer.h @@ -36,7 +36,6 @@ public: explicit ServiceWorkerContainer(nsPIDOMWindow* aWindow) : mWindow(aWindow) { - // FIXME(nsm): Bug 983497. Here the NSW should hook into SWM to be notified of events. SetIsDOMBinding(); } @@ -83,9 +82,7 @@ public: ErrorResult& aRv); private: ~ServiceWorkerContainer() - { - // FIXME(nsm): Bug 983497. Unhook from events. - } + { } nsCOMPtr mWindow; }; diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp deleted file mode 100644 index 4857100d17db..000000000000 --- a/dom/workers/ServiceWorkerManager.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "ServiceWorkerManager.h" - -#include "nsIDocument.h" -#include "nsPIDOMWindow.h" - -#include "jsapi.h" - -#include "mozilla/Preferences.h" -#include "mozilla/dom/BindingUtils.h" -#include "nsContentUtils.h" -#include "nsCxPusher.h" -#include "nsNetUtil.h" -#include "nsTArray.h" - -#include "RuntimeService.h" -#include "ServiceWorker.h" -#include "WorkerInlines.h" - -using namespace mozilla; -using namespace mozilla::dom; - -BEGIN_WORKERS_NAMESPACE - -////////////////////////// -// ServiceWorkerManager // -////////////////////////// - -NS_IMPL_ADDREF(ServiceWorkerManager) -NS_IMPL_RELEASE(ServiceWorkerManager) - -NS_INTERFACE_MAP_BEGIN(ServiceWorkerManager) - NS_INTERFACE_MAP_ENTRY(nsIServiceWorkerManager) - if (aIID.Equals(NS_GET_IID(ServiceWorkerManager))) - foundInterface = static_cast(this); - else - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIServiceWorkerManager) -NS_INTERFACE_MAP_END - -ServiceWorkerManager::ServiceWorkerManager() -{ -} - -ServiceWorkerManager::~ServiceWorkerManager() -{ - // The map will assert if it is not empty when destroyed. - mDomainMap.EnumerateRead(CleanupServiceWorkerInformation, nullptr); - mDomainMap.Clear(); -} - -/* static */ PLDHashOperator -ServiceWorkerManager::CleanupServiceWorkerInformation(const nsACString& aDomain, - ServiceWorkerDomainInfo* aDomainInfo, - void *aUnused) -{ - aDomainInfo->mServiceWorkerRegistrations.Clear(); - return PL_DHASH_NEXT; -} - -/* - * Implements the async aspects of the register algorithm. - */ -class RegisterRunnable : public nsRunnable -{ - nsCOMPtr mWindow; - const nsCString mScope; - nsCOMPtr mScriptURI; - nsRefPtr mPromise; -public: - RegisterRunnable(nsPIDOMWindow* aWindow, const nsCString aScope, - nsIURI* aScriptURI, Promise* aPromise) - : mWindow(aWindow), mScope(aScope), mScriptURI(aScriptURI), - mPromise(aPromise) - { } - - NS_IMETHODIMP - Run() - { - nsCString domain; - nsresult rv = mScriptURI->GetHost(domain); - if (NS_WARN_IF(NS_FAILED(rv))) { - mPromise->MaybeReject(rv); - return NS_OK; - } - - nsRefPtr swm = ServiceWorkerManager::GetInstance(); - ServiceWorkerManager::ServiceWorkerDomainInfo* domainInfo = - swm->mDomainMap.Get(domain); - // FIXME(nsm): Refactor this pattern. - if (!swm->mDomainMap.Get(domain, &domainInfo)) { - domainInfo = new ServiceWorkerManager::ServiceWorkerDomainInfo; - swm->mDomainMap.Put(domain, domainInfo); - } - - nsRefPtr registration = domainInfo->GetRegistration(mScope); - - nsCString spec; - rv = mScriptURI->GetSpec(spec); - if (NS_WARN_IF(NS_FAILED(rv))) { - mPromise->MaybeReject(rv); - return NS_OK; - } - - if (registration) { - registration->mPendingUninstall = false; - if (spec.Equals(registration->mScriptSpec)) { - // FIXME(nsm): Force update on Shift+Reload. Algorithm not specified for - // that yet. - - // There is an existing update in progress. Resolve with whatever it - // results in. - if (registration->HasUpdatePromise()) { - registration->AddUpdatePromiseObserver(mPromise); - return NS_OK; - } - - // There is no update in progress and since SW updating is upto the UA, we - // will not update right now. Simply resolve with whatever worker we - // have. - ServiceWorkerInfo info = registration->Newest(); - if (info.IsValid()) { - nsRefPtr serviceWorker; - nsresult rv = - swm->CreateServiceWorkerForWindow(mWindow, - info.GetScriptSpec(), - registration->mScope, - getter_AddRefs(serviceWorker)); - - if (NS_WARN_IF(NS_FAILED(rv))) { - return NS_ERROR_FAILURE; - } - - mPromise->MaybeResolve(serviceWorker); - return NS_OK; - } - } - } else { - registration = domainInfo->CreateNewRegistration(mScope); - } - - registration->mScriptSpec = spec; - - // FIXME(nsm): Call Update. Same bug, different patch. - // For now if the registration reaches this spot, the promise remains - // unresolved. - return NS_OK; - } -}; - -// If we return an error code here, the ServiceWorkerContainer will -// automatically reject the Promise. -NS_IMETHODIMP -ServiceWorkerManager::Register(nsIDOMWindow* aWindow, const nsAString& aScope, - const nsAString& aScriptURL, nsISupports** aPromise) -{ - AssertIsOnMainThread(); - MOZ_ASSERT(aWindow); - - // XXXnsm Don't allow chrome callers for now, we don't support chrome - // ServiceWorkers. - MOZ_ASSERT(!nsContentUtils::IsCallerChrome()); - - nsCOMPtr window = do_QueryInterface(aWindow); - if (!window) { - return NS_ERROR_FAILURE; - } - - nsCOMPtr sgo = do_QueryInterface(window); - nsRefPtr promise = new Promise(sgo); - - nsCOMPtr documentURI = window->GetDocumentURI(); - if (!documentURI) { - return NS_ERROR_FAILURE; - } - - // Although the spec says that the same-origin checks should also be done - // asynchronously, we do them in sync because the Promise created by the - // WebIDL infrastructure due to a returned error will be resolved - // asynchronously. We aren't making any internal state changes in these - // checks, so ordering of multiple calls is not affected. - - nsresult rv; - // FIXME(nsm): Bug 1003991. Disable check when devtools are open. - if (!Preferences::GetBool("dom.serviceWorkers.testing.enabled")) { - bool isHttps; - rv = documentURI->SchemeIs("https", &isHttps); - if (NS_FAILED(rv) || !isHttps) { - NS_WARNING("ServiceWorker registration from insecure websites is not allowed."); - return NS_ERROR_DOM_SECURITY_ERR; - } - } - - nsCOMPtr documentPrincipal; - if (window->GetExtantDoc()) { - documentPrincipal = window->GetExtantDoc()->NodePrincipal(); - } else { - documentPrincipal = do_CreateInstance("@mozilla.org/nullprincipal;1"); - } - - nsCOMPtr scriptURI; - rv = NS_NewURI(getter_AddRefs(scriptURI), aScriptURL, nullptr, documentURI); - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - // https://github.com/slightlyoff/ServiceWorker/issues/262 - // allowIfInheritsPrincipal: allow data: URLs for now. - rv = documentPrincipal->CheckMayLoad(scriptURI, true /* report */, - true /* allowIfInheritsPrincipal */); - if (NS_FAILED(rv)) { - return NS_ERROR_DOM_SECURITY_ERR; - } - - nsCOMPtr scopeURI; - rv = NS_NewURI(getter_AddRefs(scopeURI), aScope, nullptr, documentURI); - if (NS_WARN_IF(NS_FAILED(rv))) { - return NS_ERROR_DOM_SECURITY_ERR; - } - - rv = documentPrincipal->CheckMayLoad(scopeURI, true /* report */, - false /* allowIfInheritsPrinciple */); - if (NS_FAILED(rv)) { - return NS_ERROR_DOM_SECURITY_ERR; - } - - nsCString cleanedScope; - rv = scopeURI->GetSpec(cleanedScope); - if (NS_WARN_IF(NS_FAILED(rv))) { - return NS_ERROR_FAILURE; - } - - nsRefPtr registerRunnable = - new RegisterRunnable(window, cleanedScope, scriptURI, promise); - promise.forget(aPromise); - return NS_DispatchToCurrentThread(registerRunnable); -} - -NS_IMETHODIMP -ServiceWorkerManager::Update(ServiceWorkerRegistration* aRegistration, - nsPIDOMWindow* aWindow) -{ - // FIXME(nsm): Same bug, different patch. - return NS_OK; -} - -// If we return an error, ServiceWorkerContainer will reject the Promise. -NS_IMETHODIMP -ServiceWorkerManager::Unregister(nsIDOMWindow* aWindow, const nsAString& aScope, - nsISupports** aPromise) -{ - AssertIsOnMainThread(); - MOZ_ASSERT(aWindow); - - // XXXnsm Don't allow chrome callers for now. - MOZ_ASSERT(!nsContentUtils::IsCallerChrome()); - - // FIXME(nsm): Same bug, different patch. - - return NS_ERROR_DOM_NOT_SUPPORTED_ERR; -} - -/* static */ -already_AddRefed -ServiceWorkerManager::GetInstance() -{ - nsCOMPtr swm = do_GetService(SERVICEWORKERMANAGER_CONTRACTID); - nsRefPtr concrete = do_QueryObject(swm); - return concrete.forget(); -} - -NS_IMETHODIMP -ServiceWorkerManager::CreateServiceWorkerForWindow(nsPIDOMWindow* aWindow, - const nsACString& aScriptSpec, - const nsACString& aScope, - ServiceWorker** aServiceWorker) -{ - AssertIsOnMainThread(); - MOZ_ASSERT(aWindow); - - RuntimeService* rs = RuntimeService::GetOrCreateService(); - nsRefPtr serviceWorker; - - nsCOMPtr sgo = do_QueryInterface(aWindow); - - AutoSafeJSContext cx; - JS::Rooted jsGlobal(cx, sgo->GetGlobalJSObject()); - JSAutoCompartment ac(cx, jsGlobal); - - GlobalObject global(cx, jsGlobal); - nsresult rv = rs->CreateServiceWorker(global, - NS_ConvertUTF8toUTF16(aScriptSpec), - aScope, - getter_AddRefs(serviceWorker)); - - if (NS_WARN_IF(NS_FAILED(rv))) { - return rv; - } - - serviceWorker.forget(aServiceWorker); - return rv; -} - -END_WORKERS_NAMESPACE diff --git a/dom/workers/ServiceWorkerManager.h b/dom/workers/ServiceWorkerManager.h deleted file mode 100644 index 066ab453debe..000000000000 --- a/dom/workers/ServiceWorkerManager.h +++ /dev/null @@ -1,211 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_dom_workers_serviceworkermanager_h -#define mozilla_dom_workers_serviceworkermanager_h - -#include "nsIServiceWorkerManager.h" -#include "nsCOMPtr.h" - -#include "mozilla/Attributes.h" -#include "mozilla/LinkedList.h" -#include "mozilla/dom/BindingUtils.h" -#include "mozilla/dom/Promise.h" -#include "nsClassHashtable.h" -#include "nsDataHashtable.h" -#include "nsRefPtrHashtable.h" -#include "nsTArrayForwardDeclare.h" -#include "nsTWeakRef.h" - -namespace mozilla { -namespace dom { -namespace workers { - -class ServiceWorker; - -/* - * Wherever the spec treats a worker instance and a description of said worker - * as the same thing; i.e. "Resolve foo with - * _GetNewestWorker(serviceWorkerRegistration)", we represent the description - * by this class and spawn a ServiceWorker in the right global when required. - */ -class ServiceWorkerInfo -{ - const nsCString mScriptSpec; -public: - - bool - IsValid() const - { - return !mScriptSpec.IsVoid(); - } - - const nsCString& - GetScriptSpec() const - { - MOZ_ASSERT(IsValid()); - return mScriptSpec; - } - - ServiceWorkerInfo() - { } - - explicit ServiceWorkerInfo(const nsACString& aScriptSpec) - : mScriptSpec(aScriptSpec) - { } -}; - -class ServiceWorkerRegistration -{ -public: - NS_INLINE_DECL_REFCOUNTING(ServiceWorkerRegistration) - - nsCString mScope; - // The scriptURL for the registration. This may be completely different from - // the URLs of the following three workers. - nsCString mScriptSpec; - - ServiceWorkerInfo mCurrentWorker; - ServiceWorkerInfo mWaitingWorker; - ServiceWorkerInfo mInstallingWorker; - - bool mHasUpdatePromise; - - void - AddUpdatePromiseObserver(Promise* aPromise) - { - // FIXME(nsm): Same bug, different patch. - } - - bool - HasUpdatePromise() - { - return mHasUpdatePromise; - } - - // When unregister() is called on a registration, it is not immediately - // removed since documents may be controlled. It is marked as - // pendingUninstall and when all controlling documents go away, removed. - bool mPendingUninstall; - - explicit ServiceWorkerRegistration(const nsACString& aScope) - : mScope(aScope), - mHasUpdatePromise(false), - mPendingUninstall(false) - { } - - ServiceWorkerInfo - Newest() const - { - if (mInstallingWorker.IsValid()) { - return mInstallingWorker; - } else if (mWaitingWorker.IsValid()) { - return mWaitingWorker; - } else { - return mCurrentWorker; - } - } -}; - -#define NS_SERVICEWORKERMANAGER_IMPL_IID \ -{ /* f4f8755a-69ca-46e8-a65d-775745535990 */ \ - 0xf4f8755a, \ - 0x69ca, \ - 0x46e8, \ - { 0xa6, 0x5d, 0x77, 0x57, 0x45, 0x53, 0x59, 0x90 } \ -} - -/* - * The ServiceWorkerManager is a per-process global that deals with the - * installation, querying and event dispatch of ServiceWorkers for all the - * origins in the process. - */ -class ServiceWorkerManager MOZ_FINAL : public nsIServiceWorkerManager -{ - friend class RegisterRunnable; - -public: - NS_DECL_ISUPPORTS - NS_DECL_NSISERVICEWORKERMANAGER - NS_DECLARE_STATIC_IID_ACCESSOR(NS_SERVICEWORKERMANAGER_IMPL_IID) - - static ServiceWorkerManager* FactoryCreate() - { - ServiceWorkerManager* res = new ServiceWorkerManager; - NS_ADDREF(res); - return res; - } - - /* - * This struct is used for passive ServiceWorker management. - * Actively running ServiceWorkers use the SharedWorker infrastructure in - * RuntimeService for execution and lifetime management. - */ - struct ServiceWorkerDomainInfo - { - // Scope to registration. - nsRefPtrHashtable mServiceWorkerRegistrations; - - ServiceWorkerDomainInfo() - { } - - already_AddRefed - GetRegistration(const nsCString& aScope) const - { - nsRefPtr reg; - mServiceWorkerRegistrations.Get(aScope, getter_AddRefs(reg)); - return reg.forget(); - } - - ServiceWorkerRegistration* - CreateNewRegistration(const nsCString& aScope) - { - ServiceWorkerRegistration* registration = - new ServiceWorkerRegistration(aScope); - // From now on ownership of registration is with - // mServiceWorkerRegistrations. - mServiceWorkerRegistrations.Put(aScope, registration); - return registration; - } - }; - - nsClassHashtable mDomainMap; - - // FIXME(nsm): What do we do if a page calls for register("/foo_worker.js", { scope: "/*" - // }) and then another page calls register("/bar_worker.js", { scope: "/*" }) - // while the install is in progress. The async install steps for register - // bar_worker.js could finish before foo_worker.js, but bar_worker still has - // to be the winning controller. - // FIXME(nsm): Move this into per domain? - - static already_AddRefed - GetInstance(); - -private: - ServiceWorkerManager(); - ~ServiceWorkerManager(); - - NS_IMETHOD - Update(ServiceWorkerRegistration* aRegistration, nsPIDOMWindow* aWindow); - - NS_IMETHODIMP - CreateServiceWorkerForWindow(nsPIDOMWindow* aWindow, - const nsACString& aScriptSpec, - const nsACString& aScope, - ServiceWorker** aServiceWorker); - - static PLDHashOperator - CleanupServiceWorkerInformation(const nsACString& aDomain, - ServiceWorkerDomainInfo* aDomainInfo, - void *aUnused); -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(ServiceWorkerManager, - NS_SERVICEWORKERMANAGER_IMPL_IID); - -} // namespace workers -} // namespace dom -} // namespace mozilla - -#endif // mozilla_dom_workers_serviceworkermanager_h diff --git a/dom/workers/moz.build b/dom/workers/moz.build index e79c89bf2844..69595c784fd0 100644 --- a/dom/workers/moz.build +++ b/dom/workers/moz.build @@ -15,7 +15,6 @@ EXPORTS.mozilla.dom += [ ] EXPORTS.mozilla.dom.workers += [ - 'ServiceWorkerManager.h', 'Workers.h', ] @@ -51,7 +50,6 @@ SOURCES += [ 'ServiceWorker.cpp', 'ServiceWorkerContainer.cpp', 'ServiceWorkerEvents.cpp', - 'ServiceWorkerManager.cpp', 'SharedWorker.cpp', 'URL.cpp', 'WorkerPrivate.cpp', diff --git a/dom/workers/test/serviceworkers/mochitest.ini b/dom/workers/test/serviceworkers/mochitest.ini index f7b5b7d5690a..51b3fe37d32b 100644 --- a/dom/workers/test/serviceworkers/mochitest.ini +++ b/dom/workers/test/serviceworkers/mochitest.ini @@ -1,2 +1 @@ -[test_installation_simple.html] [test_navigator.html] diff --git a/dom/workers/test/serviceworkers/test_installation_simple.html b/dom/workers/test/serviceworkers/test_installation_simple.html deleted file mode 100644 index d0446834bd0e..000000000000 --- a/dom/workers/test/serviceworkers/test_installation_simple.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Bug 930348 - test stub Navigator ServiceWorker utilities. - - - - -

- -

-
-
-
-
-
diff --git a/layout/build/nsLayoutCID.h b/layout/build/nsLayoutCID.h
index fe9d2bb295ab..df74806af44e 100644
--- a/layout/build/nsLayoutCID.h
+++ b/layout/build/nsLayoutCID.h
@@ -82,8 +82,4 @@
 #define QUOTA_MANAGER_CID \
 { 0x5a75c25a, 0x5e7e, 0x4d90, { 0x8f, 0x7c, 0x07, 0xeb, 0x15, 0xcc, 0x0a, 0xa8 } }
 
-// {c74bde32-bcc7-4840-8430-c733351b212a}
-#define SERVICEWORKERMANAGER_CID \
-{ 0xc74bde32, 0xbcc7, 0x4840, { 0x84, 0x30, 0xc7, 0x33, 0x35, 0x1b, 0x21, 0x2a } }
-
 #endif /* nsLayoutCID_h__ */
diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp
index 506554f6d303..d33589aa87e0 100644
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -94,7 +94,6 @@
 #include "mozilla/dom/network/TCPServerSocketChild.h"
 #include "mozilla/dom/network/UDPSocketChild.h"
 #include "mozilla/dom/quota/QuotaManager.h"
-#include "mozilla/dom/workers/ServiceWorkerManager.h"
 #include "mozilla/OSFileConstants.h"
 #include "mozilla/Services.h"
 
@@ -253,7 +252,6 @@ using mozilla::dom::alarm::AlarmHalService;
 using mozilla::dom::indexedDB::IndexedDatabaseManager;
 using mozilla::dom::power::PowerManagerService;
 using mozilla::dom::quota::QuotaManager;
-using mozilla::dom::workers::ServiceWorkerManager;
 using mozilla::dom::TCPSocketChild;
 using mozilla::dom::TCPSocketParent;
 using mozilla::dom::TCPServerSocketChild;
@@ -294,8 +292,6 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(DOMRequestService,
                                          DOMRequestService::FactoryCreate)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(QuotaManager,
                                          QuotaManager::FactoryCreate)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(ServiceWorkerManager,
-                                         ServiceWorkerManager::FactoryCreate)
 #ifdef MOZ_WIDGET_GONK
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(SystemWorkerManager,
                                          SystemWorkerManager::FactoryCreate)
@@ -719,7 +715,6 @@ NS_DEFINE_NAMED_CID(NS_TEXTEDITOR_CID);
 NS_DEFINE_NAMED_CID(INDEXEDDB_MANAGER_CID);
 NS_DEFINE_NAMED_CID(DOMREQUEST_SERVICE_CID);
 NS_DEFINE_NAMED_CID(QUOTA_MANAGER_CID);
-NS_DEFINE_NAMED_CID(SERVICEWORKERMANAGER_CID);
 #ifdef MOZ_WIDGET_GONK
 NS_DEFINE_NAMED_CID(SYSTEMWORKERMANAGER_CID);
 #endif
@@ -1010,7 +1005,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
   { &kINDEXEDDB_MANAGER_CID, false, nullptr, IndexedDatabaseManagerConstructor },
   { &kDOMREQUEST_SERVICE_CID, false, nullptr, DOMRequestServiceConstructor },
   { &kQUOTA_MANAGER_CID, false, nullptr, QuotaManagerConstructor },
-  { &kSERVICEWORKERMANAGER_CID, false, nullptr, ServiceWorkerManagerConstructor },
 #ifdef MOZ_WIDGET_GONK
   { &kSYSTEMWORKERMANAGER_CID, true, nullptr, SystemWorkerManagerConstructor },
 #endif
@@ -1168,7 +1162,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
   { INDEXEDDB_MANAGER_CONTRACTID, &kINDEXEDDB_MANAGER_CID },
   { DOMREQUEST_SERVICE_CONTRACTID, &kDOMREQUEST_SERVICE_CID },
   { QUOTA_MANAGER_CONTRACTID, &kQUOTA_MANAGER_CID },
-  { SERVICEWORKERMANAGER_CONTRACTID, &kSERVICEWORKERMANAGER_CID },
 #ifdef MOZ_WIDGET_GONK
   { SYSTEMWORKERMANAGER_CONTRACTID, &kSYSTEMWORKERMANAGER_CID },
 #endif