Bug 1164564 - WorkerDebugger.initialize should not return failure when called more than once;r=khuey

This commit is contained in:
Eddy Bruël 2015-06-02 16:52:17 +02:00
parent 027ecf2f1f
commit 3a3005f6b5

View File

@ -4370,17 +4370,19 @@ WorkerDebugger::Initialize(const nsAString& aURL, JSContext* aCx)
MutexAutoLock lock(mMutex);
if (!mWorkerPrivate || mIsInitialized) {
if (!mWorkerPrivate) {
return NS_ERROR_UNEXPECTED;
}
nsRefPtr<CompileDebuggerScriptRunnable> runnable =
new CompileDebuggerScriptRunnable(mWorkerPrivate, aURL);
if (!runnable->Dispatch(aCx)) {
return NS_ERROR_FAILURE;
}
if (!mIsInitialized) {
nsRefPtr<CompileDebuggerScriptRunnable> runnable =
new CompileDebuggerScriptRunnable(mWorkerPrivate, aURL);
if (!runnable->Dispatch(aCx)) {
return NS_ERROR_FAILURE;
}
mIsInitialized = true;
mIsInitialized = true;
}
return NS_OK;
}