mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 937317 - Make TabChildGlobal implement nsIGlobalObject. r=bz
This commit is contained in:
parent
d98938d032
commit
7bba051425
@ -2492,6 +2492,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TabChildGlobal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISyncMessageSender)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIContentFrameMessageManager)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIGlobalObject)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(ContentFrameMessageManager)
|
||||
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
|
||||
|
||||
@ -2556,10 +2557,20 @@ TabChildGlobal::GetJSContextForEventHandlers()
|
||||
return nsContentUtils::GetSafeJSContext();
|
||||
}
|
||||
|
||||
nsIPrincipal*
|
||||
nsIPrincipal*
|
||||
TabChildGlobal::GetPrincipal()
|
||||
{
|
||||
if (!mTabChild)
|
||||
return nullptr;
|
||||
return mTabChild->GetPrincipal();
|
||||
}
|
||||
|
||||
JSObject*
|
||||
TabChildGlobal::GetGlobalJSObject()
|
||||
{
|
||||
NS_ENSURE_TRUE(mTabChild, nullptr);
|
||||
nsCOMPtr<nsIXPConnectJSObjectHolder> ref = mTabChild->GetGlobal();
|
||||
NS_ENSURE_TRUE(ref, nullptr);
|
||||
return ref->GetJSObject();
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,8 @@ class ClonedMessageData;
|
||||
|
||||
class TabChildGlobal : public nsDOMEventTargetHelper,
|
||||
public nsIContentFrameMessageManager,
|
||||
public nsIScriptObjectPrincipal
|
||||
public nsIScriptObjectPrincipal,
|
||||
public nsIGlobalObject
|
||||
{
|
||||
public:
|
||||
TabChildGlobal(TabChild* aTabChild);
|
||||
@ -127,6 +128,7 @@ public:
|
||||
|
||||
virtual JSContext* GetJSContextForEventHandlers() MOZ_OVERRIDE;
|
||||
virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE;
|
||||
virtual JSObject* GetGlobalJSObject() MOZ_OVERRIDE;
|
||||
|
||||
nsCOMPtr<nsIContentFrameMessageManager> mMessageManager;
|
||||
TabChild* mTabChild;
|
||||
|
Loading…
Reference in New Issue
Block a user