Bug 1259290: Part 2 - Remove the cx from [Add|Remove]ChildWorker. r=bz
authorKyle Huey <khuey@kylehuey.com>
Mon, 28 Mar 2016 10:28:14 -0700
changeset 290735 780e64f25e1a2bb3ef072ac83a5bc94d8c31dde2
parent 290734 a25d3a1c24b73bdfedf2196c0cee3b37bfb606a1
child 290736 d317ee09ff1a1bda98797be54b7d2f7dc10b84d6
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1259290
milestone48.0a1
Bug 1259290: Part 2 - Remove the cx from [Add|Remove]ChildWorker. r=bz
dom/workers/RuntimeService.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -1490,17 +1490,17 @@ RuntimeService::RegisterWorker(JSContext
         new SharedWorkerInfo(aWorkerPrivate, sharedWorkerScriptSpec,
                              sharedWorkerName);
       domainInfo->mSharedWorkerInfos.Put(key, sharedWorkerInfo);
     }
   }
 
   // From here on out we must call UnregisterWorker if something fails!
   if (parent) {
-    if (!parent->AddChildWorker(aCx, aWorkerPrivate)) {
+    if (!parent->AddChildWorker(aWorkerPrivate)) {
       UnregisterWorker(aCx, aWorkerPrivate);
       return false;
     }
   }
   else {
     if (!mNavigatorPropertiesLoaded) {
       Navigator::AppName(mNavigatorProperties.mAppName,
                          false /* aUsePrefOverriddenValue */);
@@ -1647,17 +1647,17 @@ RuntimeService::UnregisterWorker(JSConte
 
   if (aWorkerPrivate->IsSharedWorker() ||
       aWorkerPrivate->IsServiceWorker()) {
     AssertIsOnMainThread();
     aWorkerPrivate->CloseAllSharedWorkers();
   }
 
   if (parent) {
-    parent->RemoveChildWorker(aCx, aWorkerPrivate);
+    parent->RemoveChildWorker(aWorkerPrivate);
   }
   else if (aWorkerPrivate->IsSharedWorker()) {
     AssertIsOnMainThread();
 
     for (auto iter = mWindowMap.Iter(); !iter.Done(); iter.Next()) {
       nsAutoPtr<nsTArray<WorkerPrivate*>>& workers = iter.Data();
       MOZ_ASSERT(workers.get());
 
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -5111,17 +5111,17 @@ WorkerPrivate::ModifyBusyCountFromWorker
   }
 
   RefPtr<ModifyBusyCountRunnable> runnable =
     new ModifyBusyCountRunnable(this, aIncrease);
   return runnable->Dispatch();
 }
 
 bool
-WorkerPrivate::AddChildWorker(JSContext* aCx, ParentType* aChildWorker)
+WorkerPrivate::AddChildWorker(ParentType* aChildWorker)
 {
   AssertIsOnWorkerThread();
 
 #ifdef DEBUG
   {
     Status currentStatus;
     {
       MutexAutoLock lock(mMutex);
@@ -5137,17 +5137,17 @@ WorkerPrivate::AddChildWorker(JSContext*
   mChildWorkers.AppendElement(aChildWorker);
 
   return mChildWorkers.Length() == 1 ?
          ModifyBusyCountFromWorker(true) :
          true;
 }
 
 void
-WorkerPrivate::RemoveChildWorker(JSContext* aCx, ParentType* aChildWorker)
+WorkerPrivate::RemoveChildWorker(ParentType* aChildWorker)
 {
   AssertIsOnWorkerThread();
 
   NS_ASSERTION(mChildWorkers.Contains(aChildWorker),
                "Didn't know about this one!");
   mChildWorkers.RemoveElement(aChildWorker);
 
   if (mChildWorkers.IsEmpty() && !ModifyBusyCountFromWorker(false)) {
--- a/dom/workers/WorkerPrivate.h
+++ b/dom/workers/WorkerPrivate.h
@@ -1061,20 +1061,20 @@ public:
 
   void
   TraceTimeouts(const TraceCallbacks& aCallbacks, void* aClosure) const;
 
   bool
   ModifyBusyCountFromWorker(bool aIncrease);
 
   bool
-  AddChildWorker(JSContext* aCx, ParentType* aChildWorker);
+  AddChildWorker(ParentType* aChildWorker);
 
   void
-  RemoveChildWorker(JSContext* aCx, ParentType* aChildWorker);
+  RemoveChildWorker(ParentType* aChildWorker);
 
   bool
   AddFeature(WorkerFeature* aFeature);
 
   void
   RemoveFeature(WorkerFeature* aFeature);
 
   void