diff --git a/dom/base/nsFrameLoaderOwner.cpp b/dom/base/nsFrameLoaderOwner.cpp index 4a6f5ff027f8..a84108526e73 100644 --- a/dom/base/nsFrameLoaderOwner.cpp +++ b/dom/base/nsFrameLoaderOwner.cpp @@ -7,6 +7,7 @@ #include "nsFrameLoaderOwner.h" #include "nsFrameLoader.h" #include "mozilla/dom/FrameLoaderBinding.h" +#include "mozilla/dom/BrowsingContext.h" already_AddRefed nsFrameLoaderOwner::GetFrameLoader() { return do_AddRef(mFrameLoader); @@ -16,6 +17,14 @@ void nsFrameLoaderOwner::SetFrameLoader(nsFrameLoader* aNewFrameLoader) { mFrameLoader = aNewFrameLoader; } +already_AddRefed +nsFrameLoaderOwner::GetBrowsingContext() { + if (mFrameLoader) { + return mFrameLoader->GetBrowsingContext(); + } + return nullptr; +} + void nsFrameLoaderOwner::ChangeRemoteness( const mozilla::dom::RemotenessOptions& aOptions, mozilla::ErrorResult& rv) { // If we already have a Frameloader, destroy it. diff --git a/dom/base/nsFrameLoaderOwner.h b/dom/base/nsFrameLoaderOwner.h index 7dcb49903d39..1d1902be2169 100644 --- a/dom/base/nsFrameLoaderOwner.h +++ b/dom/base/nsFrameLoaderOwner.h @@ -11,8 +11,9 @@ class nsFrameLoader; namespace mozilla { class ErrorResult; namespace dom { +class BrowsingContext; struct RemotenessOptions; -} +} // namespace dom } // namespace mozilla // IID for the FrameLoaderOwner interface @@ -38,6 +39,8 @@ class nsFrameLoaderOwner : public nsISupports { already_AddRefed GetFrameLoader(); void SetFrameLoader(nsFrameLoader* aNewFrameLoader); + already_AddRefed GetBrowsingContext(); + // Destroy (if it exists) and recreate our frameloader, based on new // remoteness requirements. This should follow the same path as // tabbrowser.js's updateBrowserRemoteness, including running the same logic diff --git a/dom/webidl/MozFrameLoaderOwner.webidl b/dom/webidl/MozFrameLoaderOwner.webidl index b909d9828244..5275b5d26bde 100644 --- a/dom/webidl/MozFrameLoaderOwner.webidl +++ b/dom/webidl/MozFrameLoaderOwner.webidl @@ -15,6 +15,9 @@ interface MozFrameLoaderOwner { [ChromeOnly] readonly attribute FrameLoader? frameLoader; + [ChromeOnly] + readonly attribute BrowsingContext? browsingContext; + [ChromeOnly, Throws] void presetOpenerWindow(WindowProxy? window);