Bug 1259290: Part 2 - Remove the cx from [Add|Remove]ChildWorker. r=bz
--- 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