Bug 1440407 P1 Add nsPIDOMWindowInner::AsGlobal() to cheaply cast to nsIGlobalObject*. r=mystor

This commit is contained in:
Ben Kelly 2018-02-22 14:28:39 -08:00
parent 855b730941
commit d3ec34f518
2 changed files with 15 additions and 0 deletions

View File

@ -7937,6 +7937,18 @@ nsPIDOMWindowInner::GetDocGroup() const
return nullptr;
}
nsIGlobalObject*
nsPIDOMWindowInner::AsGlobal()
{
return nsGlobalWindowInner::Cast(this);
}
const nsIGlobalObject*
nsPIDOMWindowInner::AsGlobal() const
{
return nsGlobalWindowInner::Cast(this);
}
// XXX: Can we define this in a header instead of here?
namespace mozilla {
namespace dom {

View File

@ -155,6 +155,9 @@ public:
return this;
}
nsIGlobalObject* AsGlobal();
const nsIGlobalObject* AsGlobal() const;
nsPIDOMWindowOuter* GetOuterWindow() const {
return mOuterWindow;
}