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

This commit is contained in:
Gabor Krizsanits 2013-04-04 11:27:40 +02:00
Родитель 20c0b1c5f6
Коммит 499a22ed0b
6 изменённых файлов: 14 добавлений и 3 удалений

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

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

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

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

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

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

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

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

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

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

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

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