Bug 910910 - Enable Event ctors in workers, r=khuey

--HG--
extra : rebase_source : 983d01d13aa66a8499350a4960b5913b22c9783a
This commit is contained in:
Olli Pettay 2013-09-10 21:27:32 +03:00
parent 257af9d20d
commit 02db8bbd32
3 changed files with 6 additions and 2 deletions

View File

@ -1792,7 +1792,9 @@ GlobalObject::GlobalObject(JSContext* aCx, JSObject* aObject)
nsISupports*
GlobalObject::GetAsSupports() const
{
MOZ_ASSERT(NS_IsMainThread());
if (!NS_IsMainThread()) {
return nullptr;
}
if (mGlobalObject) {
return mGlobalObject;

View File

@ -1395,7 +1395,7 @@ WantsQueryInterface<T, true>
{
static bool Enabled(JSContext* aCx, JSObject* aGlobal)
{
return IsChromeOrXBL(aCx, aGlobal);
return NS_IsMainThread() && IsChromeOrXBL(aCx, aGlobal);
}
};

View File

@ -10,6 +10,7 @@
#include "js/OldDebugAPI.h"
#include "mozilla/Util.h"
#include "mozilla/dom/DOMJSClass.h"
#include "mozilla/dom/EventBinding.h"
#include "mozilla/dom/EventTargetBinding.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/DOMExceptionBinding.h"
@ -1097,6 +1098,7 @@ CreateDedicatedWorkerGlobalScope(JSContext* aCx)
// Init other paris-bindings.
if (!DOMExceptionBinding::GetConstructorObject(aCx, global) ||
!EventBinding::GetConstructorObject(aCx, global) ||
!FileReaderSyncBinding_workers::GetConstructorObject(aCx, global) ||
!ImageDataBinding::GetConstructorObject(aCx, global) ||
!TextDecoderBinding::GetConstructorObject(aCx, global) ||