Bug 1454633 - Client API doesn't need to use WorkerHolder with status = Closing, r=bkelly
☠☠ backed out by 73615fe67ab6 ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 17 Apr 2018 20:51:04 +0200
changeset 467715 f4989e0da2216f6cf3fbe3d3a616d31447f068ec
parent 467714 08239799d43e6ddb85c9d149622151702ddac6f6
child 467716 945d0f8a4594a47be4db59df6c6810fa4a057038
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
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);