Bug 1379243 P1 Make WorkerControlEventTarget implement nsISerialEventTarget. r=baku
authorBen Kelly <ben@wanderview.com>
Fri, 21 Jul 2017 08:16:23 -0700
changeset 419037 b9e732a302c53f56f9fc05ba43e26d37d40cd1cf
parent 419036 1b2ab38ba0b83e2c5dd137b6c8959bfa575c4d7d
child 419038 b4943cb22f016ef64254fdac03a7deea8731fbb2
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1379243
milestone56.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 1379243 P1 Make WorkerControlEventTarget implement nsISerialEventTarget. r=baku
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -1623,17 +1623,17 @@ public:
     return NS_OK;
   }
 };
 
 } // anonymous namespace
 
 BEGIN_WORKERS_NAMESPACE
 
-class WorkerControlEventTarget final : public nsIEventTarget
+class WorkerControlEventTarget final : public nsISerialEventTarget
 {
   mozilla::Mutex mMutex;
   WorkerPrivate* mWorkerPrivate;
 
   ~WorkerControlEventTarget() = default;
 
 public:
   explicit WorkerControlEventTarget(WorkerPrivate* aWorkerPrivate)
@@ -1699,17 +1699,18 @@ public:
     MOZ_ASSERT(aIsOnCurrentThread);
     *aIsOnCurrentThread = IsOnCurrentThreadInfallible();
     return NS_OK;
   }
 
   NS_DECL_THREADSAFE_ISUPPORTS
 };
 
-NS_IMPL_ISUPPORTS(WorkerControlEventTarget, nsIEventTarget)
+NS_IMPL_ISUPPORTS(WorkerControlEventTarget, nsIEventTarget,
+                                            nsISerialEventTarget)
 
 END_WORKERS_NAMESPACE
 
 WorkerLoadInfo::WorkerLoadInfo()
   : mLoadFlags(nsIRequest::LOAD_NORMAL)
   , mWindowID(UINT64_MAX)
   , mServiceWorkerID(0)
   , mReferrerPolicy(net::RP_Unset)
@@ -5184,17 +5185,17 @@ WorkerPrivate::DispatchToMainThread(alre
 {
   nsCOMPtr<nsIRunnable> runnable = aRunnable;
   if (nsCOMPtr<nsINamed> named = do_QueryInterface(runnable)) {
     named->SetName("WorkerRunnable");
   }
   return mMainThreadEventTarget->Dispatch(runnable.forget(), aFlags);
 }
 
-nsIEventTarget*
+nsISerialEventTarget*
 WorkerPrivate::ControlEventTarget()
 {
   return mWorkerControlEventTarget;
 }
 
 void
 WorkerPrivate::InitializeGCTimers()
 {
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -1456,17 +1456,17 @@ public:
 
   nsresult
   DispatchToMainThread(already_AddRefed<nsIRunnable> aRunnable,
                        uint32_t aFlags = NS_DISPATCH_NORMAL);
 
   // Get an event target that will dispatch runnables as control runnables on
   // the worker thread.  Implement nsICancelableRunnable if you wish to take
   // action on cancelation.
-  nsIEventTarget*
+  nsISerialEventTarget*
   ControlEventTarget();
 
 private:
   WorkerPrivate(WorkerPrivate* aParent,
                 const nsAString& aScriptURL, bool aIsChromeWorker,
                 WorkerType aWorkerType, const nsAString& aWorkerName,
                 const nsACString& aServiceWorkerScope,
                 WorkerLoadInfo& aLoadInfo);