Bug 820170 - Weak ref support for globals. r=bholley

This commit is contained in:
Gabor Krizsanits 2013-04-04 11:27:40 +02:00
parent 20c0b1c5f6
commit 499a22ed0b
6 changed files with 14 additions and 3 deletions

View File

@ -168,6 +168,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsInProcessTabChildGlobal)
NS_INTERFACE_MAP_ENTRY(nsIScriptContextPrincipal)
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ContentFrameMessageManager)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)

View File

@ -20,12 +20,14 @@
#include "nsCOMArray.h"
#include "nsThreadUtils.h"
#include "nsIGlobalObject.h"
#include "nsWeakReference.h"
class nsInProcessTabChildGlobal : public nsDOMEventTargetHelper,
public nsFrameScriptExecutor,
public nsIInProcessContentFrameMessageManager,
public nsIScriptContextPrincipal,
public nsIGlobalObject,
public nsSupportsWeakReference,
public mozilla::dom::ipc::MessageManagerCallback
{
public:

View File

@ -7,11 +7,13 @@
#include "nsIGlobalObject.h"
#include "nsIPrincipal.h"
#include "nsWeakReference.h"
// This interface is public only because it is used in jsd.
// Once jsd is gone this file should be moved back to xpconnect/src.
class SandboxPrivate : public nsIGlobalObject
class SandboxPrivate : public nsIGlobalObject,
public nsSupportsWeakReference
{
public:
SandboxPrivate(nsIPrincipal *principal, JSObject *global)

View File

@ -7,11 +7,13 @@
#define BackstagePass_h__
#include "nsISupports.h"
#include "nsWeakReference.h"
#include "nsIGlobalObject.h"
class BackstagePass : public nsIGlobalObject,
public nsIXPCScriptable,
public nsIClassInfo
public nsIClassInfo,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS

View File

@ -2837,7 +2837,10 @@ nsXPCComponents_Utils::ReportError(const JS::Value &error, JSContext *cx)
#include "nsNetUtil.h"
const char kScriptSecurityManagerContractID[] = NS_SCRIPTSECURITYMANAGER_CONTRACTID;
NS_IMPL_THREADSAFE_ISUPPORTS2(SandboxPrivate, nsIScriptObjectPrincipal, nsIGlobalObject)
NS_IMPL_THREADSAFE_ISUPPORTS3(SandboxPrivate,
nsIScriptObjectPrincipal,
nsIGlobalObject,
nsISupportsWeakReference)
static JSBool
SandboxDump(JSContext *cx, unsigned argc, jsval *vp)

View File

@ -17,6 +17,7 @@ NS_INTERFACE_MAP_BEGIN(BackstagePass)
NS_INTERFACE_MAP_ENTRY(nsIXPCScriptable)
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXPCScriptable)
NS_INTERFACE_MAP_END_THREADSAFE