Bug 459948 - "Workers: update workers based on security review feedback". r+sr=sicking.

This commit is contained in:
Ben Turner 2008-10-15 00:21:49 -07:00
Родитель 70896e7cc0
Коммит 946e425e3d
3 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -320,7 +320,7 @@ public:
// Make sure we have a JSContext to run everything on.
JSContext* cx = (JSContext*)PR_GetThreadPrivate(gJSContextIndex);
NS_ASSERTION(cx, "nsDOMThreadService didn't give us a context!");
JS_SetContextPrivate(cx, mWorker);
// Tell the worker which context it will be using
@ -347,6 +347,9 @@ public:
protected:
void RunQueue() {
JSContext* cx = (JSContext*)PR_GetThreadPrivate(gJSContextIndex);
NS_ASSERTION(cx, "nsDOMThreadService didn't give us a context!");
while (1) {
nsCOMPtr<nsIRunnable> runnable;
{
@ -367,6 +370,9 @@ protected:
}
}
// Clear out any old cruft hanging around in the regexp statics.
JS_ClearRegExpStatics(cx);
#ifdef DEBUG
nsresult rv =
#endif

Просмотреть файл

@ -89,14 +89,16 @@ NS_IMETHODIMP
nsDOMWorkerSecurityManager::CanCreateInstance(JSContext* aJSContext,
const nsCID& aCID)
{
return NS_OK;
NS_NOTREACHED("Should not call this!");
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
nsDOMWorkerSecurityManager::CanGetService(JSContext* aJSContext,
const nsCID& aCID)
{
return NS_OK;
NS_NOTREACHED("Should not call this!");
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP

Просмотреть файл

@ -57,6 +57,8 @@ _TEST_FILES = \
test_threadErrors.html \
test_threadTimeouts.html \
test_longThread.html \
test_recursion.html \
test_regExpStatics.html \
test_xhr.html \
testXHR.txt \
$(NULL)