Bug 1454633 Client API doesn't need to use WorkerHolder with status = Closing, r=bkelly
☠☠ backed out by 2eb8596e5602 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 17 Apr 2018 15:57:46 +0200
changeset 467644 64ca4238a4208fe6283806a92d74e50067900309
parent 467643 4868cb6ca4a6cf04e3376f0c3fe8ab5710a22fa5
child 467645 0d65829a60e72992181f7536d970f05b6245687b
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1454633
milestone61.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 1454633 Client API doesn't need to use WorkerHolder with status = Closing, r=bkelly This is not needed because Client API is used in ServiceWorkerGlobalScope where self.close() doesn't exist.
dom/clients/api/Client.cpp
dom/clients/api/ClientDOMUtil.h
dom/clients/manager/ClientManager.cpp
--- a/dom/clients/api/Client.cpp
+++ b/dom/clients/api/Client.cpp
@@ -171,17 +171,17 @@ Client::Focus(ErrorResult& aRv)
     outerPromise->MaybeReject(NS_ERROR_DOM_INVALID_ACCESS_ERR);
     return outerPromise.forget();
   }
 
   // Hold the worker thread alive while we perform the async operation
   // and also avoid invoking callbacks if the worker starts shutting
   // down.
   RefPtr<WorkerHolderToken> token =
-    WorkerHolderToken::Create(GetCurrentThreadWorkerPrivate(), Closing);
+    WorkerHolderToken::Create(GetCurrentThreadWorkerPrivate(), Terminating);
 
   EnsureHandle();
   RefPtr<ClientStatePromise> innerPromise = mHandle->Focus();
   RefPtr<Client> self = this;
 
   innerPromise->Then(mGlobal->EventTargetFor(TaskCategory::Other), __func__,
     [self, token, outerPromise] (const ClientState& aResult) {
       if (token->IsShuttingDown()) {
--- a/dom/clients/api/ClientDOMUtil.h
+++ b/dom/clients/api/ClientDOMUtil.h
@@ -22,17 +22,17 @@ namespace dom {
 template<typename Func, typename Arg, typename Resolve, typename Reject>
 void
 StartClientManagerOp(Func aFunc, const Arg& aArg, nsISerialEventTarget* aTarget,
                      Resolve aResolve, Reject aReject)
 {
   RefPtr<WorkerHolderToken> token;
   if (!NS_IsMainThread()) {
     token = WorkerHolderToken::Create(GetCurrentThreadWorkerPrivate(),
-                                      WorkerStatus::Closing);
+                                      WorkerStatus::Terminating);
   }
 
   RefPtr<ClientOpPromise> promise = aFunc(aArg, aTarget);
   promise->Then(aTarget, __func__,
     [aResolve, token](const ClientOpResult& aResult) {
       if (token && token->IsShuttingDown()) {
         return;
       }
--- a/dom/clients/manager/ClientManager.cpp
+++ b/dom/clients/manager/ClientManager.cpp
@@ -41,17 +41,17 @@ ClientManager::ClientManager()
   }
 
   RefPtr<WorkerHolderToken> workerHolderToken;
   if (!NS_IsMainThread()) {
     WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
     MOZ_DIAGNOSTIC_ASSERT(workerPrivate);
 
     workerHolderToken =
-      WorkerHolderToken::Create(workerPrivate, Closing,
+      WorkerHolderToken::Create(workerPrivate, Terminating,
                                 WorkerHolderToken::AllowIdleShutdownStart);
     if (NS_WARN_IF(!workerHolderToken)) {
       Shutdown();
       return;
     }
   }
 
   ClientManagerChild* actor = new ClientManagerChild(workerHolderToken);