зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1141026 - BroadcastChannel should throw if it fails registering the worker feature, r=smaug
This commit is contained in:
Родитель
96b90bb043
Коммит
117c2d6e8e
|
@ -513,6 +513,8 @@ BroadcastChannel::Constructor(const GlobalObject& aGlobal,
|
|||
JSContext* cx = workerPrivate->GetJSContext();
|
||||
if (NS_WARN_IF(!workerPrivate->AddFeature(cx, bc->mWorkerFeature))) {
|
||||
NS_WARNING("Failed to register the BroadcastChannel worker feature.");
|
||||
bc->mWorkerFeature = nullptr;
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5415,7 +5415,7 @@ WorkerPrivate::AddFeature(JSContext* aCx, WorkerFeature* aFeature)
|
|||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(!mFeatures.Contains(aFeature), "Already know about this one!");
|
||||
MOZ_ASSERT(!mFeatures.Contains(aFeature), "Already know about this one!");
|
||||
mFeatures.AppendElement(aFeature);
|
||||
|
||||
return mFeatures.Length() == 1 ?
|
||||
|
@ -5428,7 +5428,7 @@ WorkerPrivate::RemoveFeature(JSContext* aCx, WorkerFeature* aFeature)
|
|||
{
|
||||
AssertIsOnWorkerThread();
|
||||
|
||||
NS_ASSERTION(mFeatures.Contains(aFeature), "Didn't know about this one!");
|
||||
MOZ_ASSERT(mFeatures.Contains(aFeature), "Didn't know about this one!");
|
||||
mFeatures.RemoveElement(aFeature);
|
||||
|
||||
if (mFeatures.IsEmpty() && !ModifyBusyCountFromWorker(aCx, false)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче