зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1542781 - Expose browsingContext on FrameLoaderOwner, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D26548 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
96425af79a
Коммит
91f0500959
|
@ -7,6 +7,7 @@
|
|||
#include "nsFrameLoaderOwner.h"
|
||||
#include "nsFrameLoader.h"
|
||||
#include "mozilla/dom/FrameLoaderBinding.h"
|
||||
#include "mozilla/dom/BrowsingContext.h"
|
||||
|
||||
already_AddRefed<nsFrameLoader> nsFrameLoaderOwner::GetFrameLoader() {
|
||||
return do_AddRef(mFrameLoader);
|
||||
|
@ -16,6 +17,14 @@ void nsFrameLoaderOwner::SetFrameLoader(nsFrameLoader* aNewFrameLoader) {
|
|||
mFrameLoader = aNewFrameLoader;
|
||||
}
|
||||
|
||||
already_AddRefed<mozilla::dom::BrowsingContext>
|
||||
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.
|
||||
|
|
|
@ -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<nsFrameLoader> GetFrameLoader();
|
||||
void SetFrameLoader(nsFrameLoader* aNewFrameLoader);
|
||||
|
||||
already_AddRefed<mozilla::dom::BrowsingContext> 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
|
||||
|
|
|
@ -15,6 +15,9 @@ interface MozFrameLoaderOwner {
|
|||
[ChromeOnly]
|
||||
readonly attribute FrameLoader? frameLoader;
|
||||
|
||||
[ChromeOnly]
|
||||
readonly attribute BrowsingContext? browsingContext;
|
||||
|
||||
[ChromeOnly, Throws]
|
||||
void presetOpenerWindow(WindowProxy? window);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче