Bug 1412293 - Get rid of GetWorkerCrossThreadDispatcher, r=qdot
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 27 Oct 2017 22:14:02 +0200
changeset 688140 455c134d1689b1d53a3443dbd460c87915f120fd
parent 688139 231dd755ea0bc47160ed405f5c56b9dc83fb425f
child 688141 6f9a97d89dfd68a6c0f3ed29841535d5a5408c9d
push id86669
push userhikezoe@mozilla.com
push dateSat, 28 Oct 2017 10:13:18 +0000
reviewersqdot
bugs1412293
milestone58.0a1
Bug 1412293 - Get rid of GetWorkerCrossThreadDispatcher, r=qdot
dom/workers/WorkerPrivate.cpp
dom/workers/Workers.h
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -7210,26 +7210,12 @@ EventTarget::IsOnCurrentThreadInfallible
     return false;
   }
 
   return mWorkerPrivate->IsOnCurrentThread();
 }
 
 BEGIN_WORKERS_NAMESPACE
 
-WorkerCrossThreadDispatcher*
-GetWorkerCrossThreadDispatcher(JSContext* aCx, const JS::Value& aWorker)
-{
-  if (!aWorker.isObject()) {
-    return nullptr;
-  }
-
-  JS::Rooted<JSObject*> obj(aCx, &aWorker.toObject());
-  WorkerPrivate* w = nullptr;
-  UNWRAP_OBJECT(Worker, &obj, w);
-  MOZ_ASSERT(w);
-  return w->GetCrossThreadDispatcher();
-}
-
 // Force instantiation.
 template class WorkerPrivateParent<WorkerPrivate>;
 
 END_WORKERS_NAMESPACE
--- a/dom/workers/Workers.h
+++ b/dom/workers/Workers.h
@@ -361,19 +361,16 @@ public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WorkerCrossThreadDispatcher)
 
   // Generically useful function for running a bit of C++ code on the worker
   // thread.
   bool
   PostTask(WorkerTask* aTask);
 };
 
-WorkerCrossThreadDispatcher*
-GetWorkerCrossThreadDispatcher(JSContext* aCx, const JS::Value& aWorker);
-
 // Random unique constant to facilitate JSPrincipal debugging
 const uint32_t kJSPrincipalsDebugToken = 0x7e2df9d2;
 
 bool
 IsWorkerGlobal(JSObject* global);
 
 bool
 IsDebuggerGlobal(JSObject* global);