Bug 1646519: Fix GetInProcessTopInternal usage in GetZone. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D80092
This commit is contained in:
Kris Maglione
2020-08-07 22:02:02 +00:00
parent 111e08a96e
commit f0696974a8
3 changed files with 41 additions and 20 deletions

View File

@@ -12,6 +12,7 @@
#include "mozilla/dom/BrowsingContext.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/ClearOnShutdown.h"
#include "nsGlobalWindowInner.h"
#include "nsIScriptError.h"
#include "nsRefPtrHashtable.h"
#include "nsContentUtils.h"
@@ -53,6 +54,14 @@ bool WindowContext::IsCached() const {
return mBrowsingContext->mCurrentWindowContext != this;
}
nsGlobalWindowInner* WindowContext::GetInnerWindow() const {
if (mInProcess) {
// FIXME: Replace this with something more efficient.
return nsGlobalWindowInner::GetInnerWindowWithId(mInnerWindowId);
}
return nullptr;
}
WindowContext* WindowContext::GetParentWindowContext() {
return mBrowsingContext->GetParentWindowContext();
}