Bug 1454540 - Remove WorkerPrivate::DispatchPrivate, and give WorkerPrivate::Dispatch a default argument instead. r=baku
authorJim Blandy <jimb@mozilla.com>
Mon, 16 Apr 2018 20:08:26 -0700
changeset 467743 34322841fae5072a02b15ae3f0cddb2c39c20a69
parent 467742 7b816219f70814c65453533c81b2d48e8abcd8bd
child 467744 b4a8080506760e23743261517f95b79515a42d6e
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)
reviewersbaku
bugs1454540
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 1454540 - Remove WorkerPrivate::DispatchPrivate, and give WorkerPrivate::Dispatch a default argument instead. r=baku
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -1520,18 +1520,18 @@ WorkerPrivate::Traverse(nsCycleCollectio
   if (!mBusyCount && !mMainThreadObjectsForgotten) {
     nsCycleCollectionTraversalCallback& cb = aCb;
     WorkerPrivate* tmp = this;
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParentEventTargetRef);
   }
 }
 
 nsresult
-WorkerPrivate::DispatchPrivate(already_AddRefed<WorkerRunnable> aRunnable,
-                               nsIEventTarget* aSyncLoopTarget)
+WorkerPrivate::Dispatch(already_AddRefed<WorkerRunnable> aRunnable,
+                        nsIEventTarget* aSyncLoopTarget)
 {
   // May be called on any thread!
   RefPtr<WorkerRunnable> runnable(aRunnable);
 
   {
     MutexAutoLock lock(mMutex);
 
     MOZ_ASSERT_IF(aSyncLoopTarget, mThread);
@@ -5289,17 +5289,17 @@ WorkerPrivate::EventTarget::Dispatch(alr
     return NS_ERROR_UNEXPECTED;
   }
 
   if (event) {
     workerRunnable = mWorkerPrivate->MaybeWrapAsWorkerRunnable(event.forget());
   }
 
   nsresult rv =
-    mWorkerPrivate->DispatchPrivate(workerRunnable.forget(), mNestedEventTarget);
+    mWorkerPrivate->Dispatch(workerRunnable.forget(), mNestedEventTarget);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -1176,20 +1176,18 @@ public:
   void
   UpdateGCZeal(uint8_t aGCZeal, uint32_t aFrequency);
 #endif
 
   void
   OfflineStatusChangeEvent(bool aIsOffline);
 
   nsresult
-  Dispatch(already_AddRefed<WorkerRunnable> aRunnable)
-  {
-    return DispatchPrivate(Move(aRunnable), nullptr);
-  }
+  Dispatch(already_AddRefed<WorkerRunnable> aRunnable,
+           nsIEventTarget* aSyncLoopTarget = nullptr);
 
   nsresult
   DispatchControlRunnable(already_AddRefed<WorkerControlRunnable> aWorkerControlRunnable);
 
   nsresult
   DispatchDebuggerRunnable(already_AddRefed<WorkerRunnable> aDebuggerRunnable);
 
 #ifdef DEBUG
@@ -1217,20 +1215,16 @@ private:
   WorkerPrivate(WorkerPrivate* aParent,
                 const nsAString& aScriptURL, bool aIsChromeWorker,
                 WorkerType aWorkerType, const nsAString& aWorkerName,
                 const nsACString& aServiceWorkerScope,
                 WorkerLoadInfo& aLoadInfo);
 
   ~WorkerPrivate();
 
-  nsresult
-  DispatchPrivate(already_AddRefed<WorkerRunnable> aRunnable,
-                  nsIEventTarget* aSyncLoopTarget);
-
   bool
   NotifyPrivate(WorkerStatus aStatus);
 
   bool
   TerminatePrivate()
   {
     return NotifyPrivate(Terminating);
   }