Bug 1525720, part 13 - Stop inheriting nsIRemoteTab interface in BrowserParent. r=nika
This commit removes nsIRemoteTab as a parent class from BrowserParent, so that BrowserHost is the only concrete implementation of nsIRemoteTab. Some static_cast's are updated to cast to BrowserHost, and other places have to be updated to pass a BrowserHost instead of a BrowserParent. WindowGlobalParent had a getter to return it's managing BrowserParent as a nsIRemoteTab. I couldn't find a use of this in-tree, so I've just opt-ed to remove it. If there's a use-case, we can add something back in. Differential Revision: https://phabricator.services.mozilla.com/D31444
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
#include "mozilla/dom/CustomEvent.h"
|
#include "mozilla/dom/CustomEvent.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/dom/ScriptSettings.h"
|
#include "mozilla/dom/ScriptSettings.h"
|
||||||
|
#include "mozilla/dom/BrowserHost.h"
|
||||||
|
|
||||||
#include "nsIDocShellTreeItem.h"
|
#include "nsIDocShellTreeItem.h"
|
||||||
#include "nsIDocShellTreeOwner.h"
|
#include "nsIDocShellTreeOwner.h"
|
||||||
@@ -669,12 +670,12 @@ ProxyAccessible* RootAccessible::GetPrimaryRemoteTopLevelContentDoc() const {
|
|||||||
mDocumentNode->GetDocShell()->GetTreeOwner(getter_AddRefs(owner));
|
mDocumentNode->GetDocShell()->GetTreeOwner(getter_AddRefs(owner));
|
||||||
NS_ENSURE_TRUE(owner, nullptr);
|
NS_ENSURE_TRUE(owner, nullptr);
|
||||||
|
|
||||||
nsCOMPtr<nsIRemoteTab> browserParent;
|
nsCOMPtr<nsIRemoteTab> remoteTab;
|
||||||
owner->GetPrimaryRemoteTab(getter_AddRefs(browserParent));
|
owner->GetPrimaryRemoteTab(getter_AddRefs(remoteTab));
|
||||||
if (!browserParent) {
|
if (!remoteTab) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tab = static_cast<dom::BrowserParent*>(browserParent.get());
|
auto tab = static_cast<dom::BrowserHost*>(remoteTab.get());
|
||||||
return tab->GetTopLevelDocAccessible();
|
return tab->GetTopLevelDocAccessible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2599,13 +2599,10 @@ bool nsFrameLoader::TryRemoteBrowser() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
BrowserParent* openingTab =
|
|
||||||
BrowserParent::GetFrom(parentDocShell->GetOpener());
|
|
||||||
RefPtr<ContentParent> openerContentParent;
|
RefPtr<ContentParent> openerContentParent;
|
||||||
RefPtr<BrowserParent> sameTabGroupAs;
|
RefPtr<BrowserParent> sameTabGroupAs;
|
||||||
|
if (auto* host = BrowserHost::GetFrom(parentDocShell->GetOpener())) {
|
||||||
if (openingTab && openingTab->Manager()) {
|
openerContentParent = host->GetActor()->Manager();
|
||||||
openerContentParent = openingTab->Manager();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// <iframe mozbrowser> gets to skip these checks.
|
// <iframe mozbrowser> gets to skip these checks.
|
||||||
@@ -3367,12 +3364,12 @@ void nsFrameLoader::StartPersistence(
|
|||||||
|
|
||||||
void nsFrameLoader::MaybeUpdatePrimaryBrowserParent(
|
void nsFrameLoader::MaybeUpdatePrimaryBrowserParent(
|
||||||
BrowserParentChange aChange) {
|
BrowserParentChange aChange) {
|
||||||
if (!mOwnerContent) {
|
if (!mOwnerContent || !mRemoteBrowser) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<BrowserParent> browserParent = GetBrowserParent();
|
RefPtr<BrowserHost> browserHost = mRemoteBrowser->AsBrowserHost();
|
||||||
if (!browserParent) {
|
if (!browserHost) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3397,11 +3394,11 @@ void nsFrameLoader::MaybeUpdatePrimaryBrowserParent(
|
|||||||
mObservingOwnerContent = true;
|
mObservingOwnerContent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
parentTreeOwner->RemoteTabRemoved(browserParent);
|
parentTreeOwner->RemoteTabRemoved(browserHost);
|
||||||
if (aChange == eBrowserParentChanged) {
|
if (aChange == eBrowserParentChanged) {
|
||||||
bool isPrimary = mOwnerContent->AttrValueIs(
|
bool isPrimary = mOwnerContent->AttrValueIs(
|
||||||
kNameSpaceID_None, nsGkAtoms::primary, nsGkAtoms::_true, eIgnoreCase);
|
kNameSpaceID_None, nsGkAtoms::primary, nsGkAtoms::_true, eIgnoreCase);
|
||||||
parentTreeOwner->RemoteTabAdded(browserParent, isPrimary);
|
parentTreeOwner->RemoteTabAdded(browserHost, isPrimary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ interface WindowGlobalParent {
|
|||||||
|
|
||||||
readonly attribute WindowGlobalChild? childActor; // in-process only
|
readonly attribute WindowGlobalChild? childActor; // in-process only
|
||||||
|
|
||||||
readonly attribute RemoteTab? remoteTab; // out-of-process only
|
|
||||||
|
|
||||||
// Information about the currently loaded document.
|
// Information about the currently loaded document.
|
||||||
readonly attribute Principal documentPrincipal;
|
readonly attribute Principal documentPrincipal;
|
||||||
readonly attribute URI? documentURI;
|
readonly attribute URI? documentURI;
|
||||||
|
|||||||
@@ -18,6 +18,10 @@ BrowserHost::BrowserHost(BrowserParent* aParent) : mRoot(aParent) {
|
|||||||
mRoot->SetBrowserHost(this);
|
mRoot->SetBrowserHost(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BrowserHost* BrowserHost::GetFrom(nsIRemoteTab* aRemoteTab) {
|
||||||
|
return static_cast<BrowserHost*>(aRemoteTab);
|
||||||
|
}
|
||||||
|
|
||||||
mozilla::layers::LayersId BrowserHost::GetLayersId() const {
|
mozilla::layers::LayersId BrowserHost::GetLayersId() const {
|
||||||
return mRoot->GetRenderFrame()->GetLayersId();
|
return mRoot->GetRenderFrame()->GetLayersId();
|
||||||
}
|
}
|
||||||
@@ -31,6 +35,10 @@ nsILoadContext* BrowserHost::GetLoadContext() const {
|
|||||||
return loadContext;
|
return loadContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a11y::DocAccessibleParent* BrowserHost::GetTopLevelDocAccessible() const {
|
||||||
|
return mRoot->GetTopLevelDocAccessible();
|
||||||
|
}
|
||||||
|
|
||||||
void BrowserHost::LoadURL(nsIURI* aURI) { mRoot->LoadURL(aURI); }
|
void BrowserHost::LoadURL(nsIURI* aURI) { mRoot->LoadURL(aURI); }
|
||||||
|
|
||||||
void BrowserHost::ResumeLoad(uint64_t aPendingSwitchId) {
|
void BrowserHost::ResumeLoad(uint64_t aPendingSwitchId) {
|
||||||
|
|||||||
@@ -11,9 +11,18 @@
|
|||||||
#include "mozilla/dom/RemoteBrowser.h"
|
#include "mozilla/dom/RemoteBrowser.h"
|
||||||
#include "mozilla/dom/BrowserParent.h"
|
#include "mozilla/dom/BrowserParent.h"
|
||||||
|
|
||||||
|
class nsPIDOMWindowOuter;
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
|
namespace a11y {
|
||||||
|
class DocAccessibleParent;
|
||||||
|
} // namespace a11y
|
||||||
|
|
||||||
namespace dom {
|
namespace dom {
|
||||||
|
|
||||||
|
class Element;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BrowserHost manages a remote browser from the chrome process.
|
* BrowserHost manages a remote browser from the chrome process.
|
||||||
*
|
*
|
||||||
@@ -29,6 +38,8 @@ class BrowserHost : public RemoteBrowser, public nsIRemoteTab {
|
|||||||
|
|
||||||
explicit BrowserHost(BrowserParent* aParent);
|
explicit BrowserHost(BrowserParent* aParent);
|
||||||
|
|
||||||
|
static BrowserHost* GetFrom(nsIRemoteTab* aRemoteTab);
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
// nsIRemoteTab
|
// nsIRemoteTab
|
||||||
NS_DECL_NSIREMOTETAB
|
NS_DECL_NSIREMOTETAB
|
||||||
@@ -44,6 +55,12 @@ class BrowserHost : public RemoteBrowser, public nsIRemoteTab {
|
|||||||
BrowsingContext* GetBrowsingContext() const override;
|
BrowsingContext* GetBrowsingContext() const override;
|
||||||
nsILoadContext* GetLoadContext() const override;
|
nsILoadContext* GetLoadContext() const override;
|
||||||
|
|
||||||
|
Element* GetOwnerElement() const { return mRoot->GetOwnerElement(); }
|
||||||
|
already_AddRefed<nsPIDOMWindowOuter> GetParentWindowOuter() const {
|
||||||
|
return mRoot->GetParentWindowOuter();
|
||||||
|
}
|
||||||
|
a11y::DocAccessibleParent* GetTopLevelDocAccessible() const;
|
||||||
|
|
||||||
void LoadURL(nsIURI* aURI) override;
|
void LoadURL(nsIURI* aURI) override;
|
||||||
void ResumeLoad(uint64_t aPendingSwitchId) override;
|
void ResumeLoad(uint64_t aPendingSwitchId) override;
|
||||||
void DestroyStart() override;
|
void DestroyStart() override;
|
||||||
|
|||||||
@@ -160,10 +160,9 @@ BrowserParent::LayerToBrowserParentTable*
|
|||||||
BrowserParent::sLayerToBrowserParentTable = nullptr;
|
BrowserParent::sLayerToBrowserParentTable = nullptr;
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BrowserParent)
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BrowserParent)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIRemoteTab)
|
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIAuthPromptProvider)
|
NS_INTERFACE_MAP_ENTRY(nsIAuthPromptProvider)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIRemoteTab)
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEventListener)
|
||||||
NS_INTERFACE_MAP_END
|
NS_INTERFACE_MAP_END
|
||||||
NS_IMPL_CYCLE_COLLECTION(BrowserParent, mFrameElement, mBrowserDOMWindow,
|
NS_IMPL_CYCLE_COLLECTION(BrowserParent, mFrameElement, mBrowserDOMWindow,
|
||||||
mLoadContext, mFrameLoader, mBrowsingContext)
|
mLoadContext, mFrameLoader, mBrowsingContext)
|
||||||
@@ -260,11 +259,6 @@ BrowserParent* BrowserParent::GetFrom(nsFrameLoader* aFrameLoader) {
|
|||||||
return aFrameLoader->GetBrowserParent();
|
return aFrameLoader->GetBrowserParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static*/
|
|
||||||
BrowserParent* BrowserParent::GetFrom(nsIRemoteTab* aBrowserParent) {
|
|
||||||
return static_cast<BrowserParent*>(aBrowserParent);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*static*/
|
/*static*/
|
||||||
BrowserParent* BrowserParent::GetFrom(PBrowserParent* aBrowserParent) {
|
BrowserParent* BrowserParent::GetFrom(PBrowserParent* aBrowserParent) {
|
||||||
return static_cast<BrowserParent*>(aBrowserParent);
|
return static_cast<BrowserParent*>(aBrowserParent);
|
||||||
@@ -484,15 +478,15 @@ void BrowserParent::SetOwnerElement(Element* aElement) {
|
|||||||
newTopLevelWin = nsContentUtils::GetWindowRoot(aElement->OwnerDoc());
|
newTopLevelWin = nsContentUtils::GetWindowRoot(aElement->OwnerDoc());
|
||||||
}
|
}
|
||||||
bool isSameTopLevelWin = curTopLevelWin == newTopLevelWin;
|
bool isSameTopLevelWin = curTopLevelWin == newTopLevelWin;
|
||||||
if (curTopLevelWin && !isSameTopLevelWin) {
|
if (mBrowserHost && curTopLevelWin && !isSameTopLevelWin) {
|
||||||
curTopLevelWin->RemoveBrowser(this);
|
curTopLevelWin->RemoveBrowser(mBrowserHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update to the new content, and register to listen for events from it.
|
// Update to the new content, and register to listen for events from it.
|
||||||
mFrameElement = aElement;
|
mFrameElement = aElement;
|
||||||
|
|
||||||
if (newTopLevelWin && !isSameTopLevelWin) {
|
if (mBrowserHost && newTopLevelWin && !isSameTopLevelWin) {
|
||||||
newTopLevelWin->AddBrowser(this);
|
newTopLevelWin->AddBrowser(mBrowserHost);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mFrameElement) {
|
if (mFrameElement) {
|
||||||
@@ -731,9 +725,8 @@ void BrowserParent::ActorDestroy(ActorDestroyReason why) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mFrameLoader = nullptr;
|
mFrameLoader = nullptr;
|
||||||
|
if (os && mBrowserHost) {
|
||||||
if (os) {
|
os->NotifyObservers(NS_ISUPPORTS_CAST(nsIRemoteTab*, mBrowserHost),
|
||||||
os->NotifyObservers(NS_ISUPPORTS_CAST(nsIRemoteTab*, this),
|
|
||||||
"ipc:browser-destroyed", nullptr);
|
"ipc:browser-destroyed", nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ class StructuredCloneData;
|
|||||||
*/
|
*/
|
||||||
class BrowserParent final : public PBrowserParent,
|
class BrowserParent final : public PBrowserParent,
|
||||||
public nsIDOMEventListener,
|
public nsIDOMEventListener,
|
||||||
public nsIRemoteTab,
|
|
||||||
public nsIAuthPromptProvider,
|
public nsIAuthPromptProvider,
|
||||||
public nsIKeyEventInPluginCallback,
|
public nsIKeyEventInPluginCallback,
|
||||||
public nsSupportsWeakReference,
|
public nsSupportsWeakReference,
|
||||||
@@ -104,12 +103,10 @@ class BrowserParent final : public PBrowserParent,
|
|||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||||
NS_DECL_NSIAUTHPROMPTPROVIDER
|
NS_DECL_NSIAUTHPROMPTPROVIDER
|
||||||
// nsIRemoteTab
|
|
||||||
NS_DECL_NSIREMOTETAB
|
|
||||||
// nsIDOMEventListener interfaces
|
// nsIDOMEventListener interfaces
|
||||||
NS_DECL_NSIDOMEVENTLISTENER
|
NS_DECL_NSIDOMEVENTLISTENER
|
||||||
|
|
||||||
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(BrowserParent, nsIRemoteTab)
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(BrowserParent, nsIDOMEventListener)
|
||||||
|
|
||||||
BrowserParent(ContentParent* aManager, const TabId& aTabId,
|
BrowserParent(ContentParent* aManager, const TabId& aTabId,
|
||||||
const TabContext& aContext,
|
const TabContext& aContext,
|
||||||
@@ -127,8 +124,6 @@ class BrowserParent final : public PBrowserParent,
|
|||||||
|
|
||||||
static BrowserParent* GetFrom(nsFrameLoader* aFrameLoader);
|
static BrowserParent* GetFrom(nsFrameLoader* aFrameLoader);
|
||||||
|
|
||||||
static BrowserParent* GetFrom(nsIRemoteTab* aBrowserParent);
|
|
||||||
|
|
||||||
static BrowserParent* GetFrom(PBrowserParent* aBrowserParent);
|
static BrowserParent* GetFrom(PBrowserParent* aBrowserParent);
|
||||||
|
|
||||||
static BrowserParent* GetFrom(nsIContent* aContent);
|
static BrowserParent* GetFrom(nsIContent* aContent);
|
||||||
@@ -678,6 +673,35 @@ class BrowserParent final : public PBrowserParent,
|
|||||||
|
|
||||||
void SkipBrowsingContextDetach();
|
void SkipBrowsingContextDetach();
|
||||||
|
|
||||||
|
NS_IMETHOD GetDocShellIsActive(bool* aDocShellIsActive);
|
||||||
|
NS_IMETHOD SetDocShellIsActive(bool aDocShellIsActive);
|
||||||
|
NS_IMETHOD GetRenderLayers(bool* aRenderLayers);
|
||||||
|
NS_IMETHOD SetRenderLayers(bool aRenderLayers);
|
||||||
|
NS_IMETHOD GetHasLayers(bool* aHasLayers);
|
||||||
|
NS_IMETHOD ForceRepaint(void);
|
||||||
|
NS_IMETHOD NotifyResolutionChanged(void);
|
||||||
|
NS_IMETHOD Deprioritize(void);
|
||||||
|
NS_IMETHOD PreserveLayers(bool aPreserveLayers);
|
||||||
|
NS_IMETHOD GetTabId(uint64_t* aTabId);
|
||||||
|
NS_IMETHOD GetContentProcessId(uint64_t* aContentProcessId);
|
||||||
|
NS_IMETHOD GetOsPid(int32_t* aOsPid);
|
||||||
|
NS_IMETHOD GetHasContentOpener(bool* aHasContentOpener);
|
||||||
|
NS_IMETHOD GetHasPresented(bool* aHasPresented);
|
||||||
|
NS_IMETHOD GetWindowGlobalParents(
|
||||||
|
nsTArray<RefPtr<WindowGlobalParent>>& aWindowGlobalParents);
|
||||||
|
NS_IMETHOD TransmitPermissionsForPrincipal(nsIPrincipal* aPrincipal);
|
||||||
|
NS_IMETHOD GetHasBeforeUnload(bool* aHasBeforeUnload);
|
||||||
|
NS_IMETHOD GetOwnerElement(mozilla::dom::Element** aOwnerElement);
|
||||||
|
NS_IMETHOD StartApzAutoscroll(float aAnchorX, float aAnchorY,
|
||||||
|
nsViewID aScrollId, uint32_t aPresShellId,
|
||||||
|
bool* _retval);
|
||||||
|
NS_IMETHOD StopApzAutoscroll(nsViewID aScrollId, uint32_t aPresShellId);
|
||||||
|
NS_IMETHOD SaveRecording(const nsAString& aFileName, bool* _retval);
|
||||||
|
NS_IMETHOD GetContentBlockingLog(::mozilla::dom::Promise** _retval);
|
||||||
|
NS_IMETHOD MaybeCancelContentJSExecutionFromScript(
|
||||||
|
nsIRemoteTab::NavigationType aNavigationType,
|
||||||
|
JS::Handle<JS::Value> aCancelContentJSOptions, JSContext* aCx);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend BrowserBridgeParent;
|
friend BrowserBridgeParent;
|
||||||
friend BrowserHost;
|
friend BrowserHost;
|
||||||
|
|||||||
@@ -4683,7 +4683,7 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
const bool& aCalledFromJS, const bool& aPositionSpecified,
|
const bool& aCalledFromJS, const bool& aPositionSpecified,
|
||||||
const bool& aSizeSpecified, nsIURI* aURIToLoad, const nsCString& aFeatures,
|
const bool& aSizeSpecified, nsIURI* aURIToLoad, const nsCString& aFeatures,
|
||||||
const float& aFullZoom, uint64_t aNextRemoteTabId, const nsString& aName,
|
const float& aFullZoom, uint64_t aNextRemoteTabId, const nsString& aName,
|
||||||
nsresult& aResult, nsCOMPtr<nsIRemoteTab>& aNewBrowserParent,
|
nsresult& aResult, nsCOMPtr<nsIRemoteTab>& aNewRemoteTab,
|
||||||
bool* aWindowIsNew, int32_t& aOpenLocation,
|
bool* aWindowIsNew, int32_t& aOpenLocation,
|
||||||
nsIPrincipal* aTriggeringPrincipal, nsIReferrerInfo* aReferrerInfo,
|
nsIPrincipal* aTriggeringPrincipal, nsIReferrerInfo* aReferrerInfo,
|
||||||
bool aLoadURI, nsIContentSecurityPolicy* aCsp)
|
bool aLoadURI, nsIContentSecurityPolicy* aCsp)
|
||||||
@@ -4700,6 +4700,9 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
}
|
}
|
||||||
|
|
||||||
BrowserParent* thisBrowserParent = BrowserParent::GetFrom(aThisTab);
|
BrowserParent* thisBrowserParent = BrowserParent::GetFrom(aThisTab);
|
||||||
|
BrowserHost* thisBrowserHost =
|
||||||
|
thisBrowserParent ? thisBrowserParent->GetBrowserHost() : nullptr;
|
||||||
|
MOZ_ASSERT(!thisBrowserParent == !thisBrowserHost);
|
||||||
nsCOMPtr<nsIContent> frame;
|
nsCOMPtr<nsIContent> frame;
|
||||||
if (thisBrowserParent) {
|
if (thisBrowserParent) {
|
||||||
frame = thisBrowserParent->GetOwnerElement();
|
frame = thisBrowserParent->GetOwnerElement();
|
||||||
@@ -4749,8 +4752,8 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
|
|
||||||
// Read the origin attributes for the tab from the opener browserParent.
|
// Read the origin attributes for the tab from the opener browserParent.
|
||||||
OriginAttributes openerOriginAttributes;
|
OriginAttributes openerOriginAttributes;
|
||||||
if (thisBrowserParent) {
|
if (thisBrowserHost) {
|
||||||
nsCOMPtr<nsILoadContext> loadContext = thisBrowserParent->GetLoadContext();
|
nsCOMPtr<nsILoadContext> loadContext = thisBrowserHost->GetLoadContext();
|
||||||
loadContext->GetOriginAttributes(openerOriginAttributes);
|
loadContext->GetOriginAttributes(openerOriginAttributes);
|
||||||
} else if (Preferences::GetBool("browser.privatebrowsing.autostart")) {
|
} else if (Preferences::GetBool("browser.privatebrowsing.autostart")) {
|
||||||
openerOriginAttributes.mPrivateBrowsingId = 1;
|
openerOriginAttributes.mPrivateBrowsingId = 1;
|
||||||
@@ -4786,7 +4789,7 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
if (NS_SUCCEEDED(aResult) && frameLoaderOwner) {
|
if (NS_SUCCEEDED(aResult) && frameLoaderOwner) {
|
||||||
RefPtr<nsFrameLoader> frameLoader = frameLoaderOwner->GetFrameLoader();
|
RefPtr<nsFrameLoader> frameLoader = frameLoaderOwner->GetFrameLoader();
|
||||||
if (frameLoader) {
|
if (frameLoader) {
|
||||||
aNewBrowserParent = frameLoader->GetRemoteTab();
|
aNewRemoteTab = frameLoader->GetRemoteTab();
|
||||||
// At this point, it's possible the inserted frameloader hasn't gone
|
// At this point, it's possible the inserted frameloader hasn't gone
|
||||||
// through layout yet. To ensure that the dimensions that we send down
|
// through layout yet. To ensure that the dimensions that we send down
|
||||||
// when telling the frameloader to display will be correct (instead of
|
// when telling the frameloader to display will be correct (instead of
|
||||||
@@ -4816,13 +4819,15 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
}
|
}
|
||||||
|
|
||||||
aResult = pwwatch->OpenWindowWithRemoteTab(
|
aResult = pwwatch->OpenWindowWithRemoteTab(
|
||||||
thisBrowserParent, aFeatures, aCalledFromJS, aFullZoom, aNextRemoteTabId,
|
thisBrowserHost, aFeatures, aCalledFromJS, aFullZoom, aNextRemoteTabId,
|
||||||
!aSetOpener, getter_AddRefs(aNewBrowserParent));
|
!aSetOpener, getter_AddRefs(aNewRemoteTab));
|
||||||
if (NS_WARN_IF(NS_FAILED(aResult))) {
|
if (NS_WARN_IF(NS_FAILED(aResult))) {
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(aNewBrowserParent);
|
MOZ_ASSERT(aNewRemoteTab);
|
||||||
|
BrowserHost* newBrowserHost = BrowserHost::GetFrom(aNewRemoteTab.get());
|
||||||
|
BrowserParent* newBrowserParent = newBrowserHost->GetActor();
|
||||||
|
|
||||||
// At this point, it's possible the inserted frameloader hasn't gone through
|
// At this point, it's possible the inserted frameloader hasn't gone through
|
||||||
// layout yet. To ensure that the dimensions that we send down when telling
|
// layout yet. To ensure that the dimensions that we send down when telling
|
||||||
@@ -4833,8 +4838,7 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
// This involves doing a bit of gymnastics in order to get at the FrameLoader,
|
// This involves doing a bit of gymnastics in order to get at the FrameLoader,
|
||||||
// so we scope this to avoid polluting the main function scope.
|
// so we scope this to avoid polluting the main function scope.
|
||||||
{
|
{
|
||||||
nsCOMPtr<Element> frameElement =
|
nsCOMPtr<Element> frameElement = newBrowserHost->GetOwnerElement();
|
||||||
BrowserParent::GetFrom(aNewBrowserParent)->GetOwnerElement();
|
|
||||||
MOZ_ASSERT(frameElement);
|
MOZ_ASSERT(frameElement);
|
||||||
RefPtr<nsFrameLoaderOwner> frameLoaderOwner = do_QueryObject(frameElement);
|
RefPtr<nsFrameLoaderOwner> frameLoaderOwner = do_QueryObject(frameElement);
|
||||||
MOZ_ASSERT(frameLoaderOwner);
|
MOZ_ASSERT(frameLoaderOwner);
|
||||||
@@ -4846,8 +4850,7 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
// If we were passed a name for the window which would override the default,
|
// If we were passed a name for the window which would override the default,
|
||||||
// we should send it down to the new tab.
|
// we should send it down to the new tab.
|
||||||
if (nsContentUtils::IsOverridingWindowName(aName)) {
|
if (nsContentUtils::IsOverridingWindowName(aName)) {
|
||||||
Unused
|
Unused << newBrowserParent->SendSetWindowName(aName);
|
||||||
<< BrowserParent::GetFrom(aNewBrowserParent)->SendSetWindowName(aName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't send down the OriginAttributes if the content process is handling
|
// Don't send down the OriginAttributes if the content process is handling
|
||||||
@@ -4856,8 +4859,7 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
// If we send it down in the non-async case, then we might set the
|
// If we send it down in the non-async case, then we might set the
|
||||||
// OriginAttributes after the document has already navigated.
|
// OriginAttributes after the document has already navigated.
|
||||||
if (!aSetOpener) {
|
if (!aSetOpener) {
|
||||||
Unused << BrowserParent::GetFrom(aNewBrowserParent)
|
Unused << newBrowserParent->SendSetOriginAttributes(openerOriginAttributes);
|
||||||
->SendSetOriginAttributes(openerOriginAttributes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aURIToLoad && aLoadURI) {
|
if (aURIToLoad && aLoadURI) {
|
||||||
@@ -4866,7 +4868,7 @@ mozilla::ipc::IPCResult ContentParent::CommonCreateWindow(
|
|||||||
openerWindow = thisBrowserParent->GetParentWindowOuter();
|
openerWindow = thisBrowserParent->GetParentWindowOuter();
|
||||||
}
|
}
|
||||||
nsCOMPtr<nsIBrowserDOMWindow> newBrowserDOMWin =
|
nsCOMPtr<nsIBrowserDOMWindow> newBrowserDOMWin =
|
||||||
BrowserParent::GetFrom(aNewBrowserParent)->GetBrowserDOMWindow();
|
newBrowserParent->GetBrowserDOMWindow();
|
||||||
if (NS_WARN_IF(!newBrowserDOMWin)) {
|
if (NS_WARN_IF(!newBrowserDOMWin)) {
|
||||||
aResult = NS_ERROR_ABORT;
|
aResult = NS_ERROR_ABORT;
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
@@ -4946,7 +4948,8 @@ mozilla::ipc::IPCResult ContentParent::RecvCreateWindow(
|
|||||||
if (sNextBrowserParents.GetAndRemove(nextRemoteTabId).valueOr(nullptr)) {
|
if (sNextBrowserParents.GetAndRemove(nextRemoteTabId).valueOr(nullptr)) {
|
||||||
cwi.windowOpened() = false;
|
cwi.windowOpened() = false;
|
||||||
}
|
}
|
||||||
MOZ_ASSERT(BrowserParent::GetFrom(newRemoteTab) == newTab);
|
MOZ_ASSERT(BrowserHost::GetFrom(newRemoteTab.get()) ==
|
||||||
|
newTab->GetBrowserHost());
|
||||||
|
|
||||||
newTab->SwapFrameScriptsFrom(cwi.frameScripts());
|
newTab->SwapFrameScriptsFrom(cwi.frameScripts());
|
||||||
newTab->MaybeShowFrame();
|
newTab->MaybeShowFrame();
|
||||||
|
|||||||
@@ -681,7 +681,7 @@ class ContentParent final : public PContentParent,
|
|||||||
const bool& aSizeSpecified, nsIURI* aURIToLoad,
|
const bool& aSizeSpecified, nsIURI* aURIToLoad,
|
||||||
const nsCString& aFeatures, const float& aFullZoom,
|
const nsCString& aFeatures, const float& aFullZoom,
|
||||||
uint64_t aNextRemoteTabId, const nsString& aName, nsresult& aResult,
|
uint64_t aNextRemoteTabId, const nsString& aName, nsresult& aResult,
|
||||||
nsCOMPtr<nsIRemoteTab>& aNewBrowserParent, bool* aWindowIsNew,
|
nsCOMPtr<nsIRemoteTab>& aNewRemoteTab, bool* aWindowIsNew,
|
||||||
int32_t& aOpenLocation, nsIPrincipal* aTriggeringPrincipal,
|
int32_t& aOpenLocation, nsIPrincipal* aTriggeringPrincipal,
|
||||||
nsIReferrerInfo* aReferrerInfo, bool aLoadUri,
|
nsIReferrerInfo* aReferrerInfo, bool aLoadUri,
|
||||||
nsIContentSecurityPolicy* aCsp);
|
nsIContentSecurityPolicy* aCsp);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void JSWindowActorParent::SendRawMessage(const JSWindowActorMessageMeta& aMeta,
|
|||||||
|
|
||||||
// Cross-process case - send data over WindowGlobalParent to other side.
|
// Cross-process case - send data over WindowGlobalParent to other side.
|
||||||
ClonedMessageData msgData;
|
ClonedMessageData msgData;
|
||||||
RefPtr<BrowserParent> browserParent = mManager->GetRemoteTab();
|
RefPtr<BrowserParent> browserParent = mManager->GetBrowserParent();
|
||||||
ContentParent* cp = browserParent->Manager();
|
ContentParent* cp = browserParent->Manager();
|
||||||
if (NS_WARN_IF(!aData.BuildClonedMessageDataForParent(cp, msgData))) {
|
if (NS_WARN_IF(!aData.BuildClonedMessageDataForParent(cp, msgData))) {
|
||||||
aRv.Throw(NS_ERROR_DOM_DATA_CLONE_ERR);
|
aRv.Throw(NS_ERROR_DOM_DATA_CLONE_ERR);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "mozilla/ClearOnShutdown.h"
|
#include "mozilla/ClearOnShutdown.h"
|
||||||
#include "mozilla/dom/ContentParent.h"
|
#include "mozilla/dom/ContentParent.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
|
#include "mozilla/dom/BrowserHost.h"
|
||||||
#include "mozilla/dom/BrowserParent.h"
|
#include "mozilla/dom/BrowserParent.h"
|
||||||
#include "mozilla/Hal.h"
|
#include "mozilla/Hal.h"
|
||||||
#include "mozilla/IntegerPrintfMacros.h"
|
#include "mozilla/IntegerPrintfMacros.h"
|
||||||
@@ -683,16 +684,18 @@ void ParticularProcessPriorityManager::OnRemoteBrowserFrameShown(
|
|||||||
|
|
||||||
void ParticularProcessPriorityManager::OnBrowserParentDestroyed(
|
void ParticularProcessPriorityManager::OnBrowserParentDestroyed(
|
||||||
nsISupports* aSubject) {
|
nsISupports* aSubject) {
|
||||||
nsCOMPtr<nsIRemoteTab> tp = do_QueryInterface(aSubject);
|
nsCOMPtr<nsIRemoteTab> remoteTab = do_QueryInterface(aSubject);
|
||||||
NS_ENSURE_TRUE_VOID(tp);
|
NS_ENSURE_TRUE_VOID(remoteTab);
|
||||||
|
BrowserHost* browserHost = BrowserHost::GetFrom(remoteTab.get());
|
||||||
|
BrowserParent* browserParent = browserHost->GetActor();
|
||||||
|
|
||||||
MOZ_ASSERT(XRE_IsParentProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
if (BrowserParent::GetFrom(tp)->Manager() != mContentParent) {
|
if (browserParent->Manager() != mContentParent) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t tabId;
|
uint64_t tabId;
|
||||||
if (NS_WARN_IF(NS_FAILED(tp->GetTabId(&tabId)))) {
|
if (NS_WARN_IF(NS_FAILED(browserParent->GetTabId(&tabId)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "mozilla/dom/BrowserBridgeParent.h"
|
#include "mozilla/dom/BrowserBridgeParent.h"
|
||||||
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
||||||
#include "mozilla/dom/ContentParent.h"
|
#include "mozilla/dom/ContentParent.h"
|
||||||
|
#include "mozilla/dom/BrowserHost.h"
|
||||||
#include "mozilla/dom/BrowserParent.h"
|
#include "mozilla/dom/BrowserParent.h"
|
||||||
#include "mozilla/dom/WindowGlobalActorsBinding.h"
|
#include "mozilla/dom/WindowGlobalActorsBinding.h"
|
||||||
#include "mozilla/dom/WindowGlobalChild.h"
|
#include "mozilla/dom/WindowGlobalChild.h"
|
||||||
@@ -143,7 +144,7 @@ already_AddRefed<WindowGlobalChild> WindowGlobalParent::GetChildActor() {
|
|||||||
return do_AddRef(static_cast<WindowGlobalChild*>(otherSide));
|
return do_AddRef(static_cast<WindowGlobalChild*>(otherSide));
|
||||||
}
|
}
|
||||||
|
|
||||||
already_AddRefed<BrowserParent> WindowGlobalParent::GetRemoteTab() {
|
already_AddRefed<BrowserParent> WindowGlobalParent::GetBrowserParent() {
|
||||||
if (IsInProcess() || mIPCClosed) {
|
if (IsInProcess() || mIPCClosed) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
@@ -164,7 +165,7 @@ IPCResult WindowGlobalParent::RecvBecomeCurrentWindowGlobal() {
|
|||||||
|
|
||||||
IPCResult WindowGlobalParent::RecvDestroy() {
|
IPCResult WindowGlobalParent::RecvDestroy() {
|
||||||
if (!mIPCClosed) {
|
if (!mIPCClosed) {
|
||||||
RefPtr<BrowserParent> browserParent = GetRemoteTab();
|
RefPtr<BrowserParent> browserParent = GetBrowserParent();
|
||||||
if (!browserParent || !browserParent->IsDestroyed()) {
|
if (!browserParent || !browserParent->IsDestroyed()) {
|
||||||
// Make a copy so that we can avoid potential iterator invalidation when
|
// Make a copy so that we can avoid potential iterator invalidation when
|
||||||
// calling the user-provided Destroy() methods.
|
// calling the user-provided Destroy() methods.
|
||||||
@@ -200,7 +201,7 @@ void WindowGlobalParent::ReceiveRawMessage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const nsAString& WindowGlobalParent::GetRemoteType() {
|
const nsAString& WindowGlobalParent::GetRemoteType() {
|
||||||
if (RefPtr<BrowserParent> browserParent = GetRemoteTab()) {
|
if (RefPtr<BrowserParent> browserParent = GetBrowserParent()) {
|
||||||
return browserParent->Manager()->GetRemoteType();
|
return browserParent->Manager()->GetRemoteType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +254,7 @@ IPCResult WindowGlobalParent::RecvDidEmbedBrowsingContext(
|
|||||||
already_AddRefed<Promise> WindowGlobalParent::ChangeFrameRemoteness(
|
already_AddRefed<Promise> WindowGlobalParent::ChangeFrameRemoteness(
|
||||||
dom::BrowsingContext* aBc, const nsAString& aRemoteType,
|
dom::BrowsingContext* aBc, const nsAString& aRemoteType,
|
||||||
uint64_t aPendingSwitchId, ErrorResult& aRv) {
|
uint64_t aPendingSwitchId, ErrorResult& aRv) {
|
||||||
RefPtr<BrowserParent> browserParent = GetRemoteTab();
|
RefPtr<BrowserParent> browserParent = GetBrowserParent();
|
||||||
if (NS_WARN_IF(!browserParent)) {
|
if (NS_WARN_IF(!browserParent)) {
|
||||||
aRv.Throw(NS_ERROR_FAILURE);
|
aRv.Throw(NS_ERROR_FAILURE);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ class WindowGlobalParent final : public WindowGlobalActor,
|
|||||||
|
|
||||||
// Get this actor's manager if it is not an in-process actor. Returns
|
// Get this actor's manager if it is not an in-process actor. Returns
|
||||||
// |nullptr| if the actor has been torn down, or is in-process.
|
// |nullptr| if the actor has been torn down, or is in-process.
|
||||||
already_AddRefed<BrowserParent> GetRemoteTab();
|
already_AddRefed<BrowserParent> GetBrowserParent();
|
||||||
|
|
||||||
void ReceiveRawMessage(const JSWindowActorMessageMeta& aMeta,
|
void ReceiveRawMessage(const JSWindowActorMessageMeta& aMeta,
|
||||||
ipc::StructuredCloneData&& aData);
|
ipc::StructuredCloneData&& aData);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/dom/Event.h"
|
#include "mozilla/dom/Event.h"
|
||||||
#include "mozilla/dom/BrowserParent.h"
|
#include "mozilla/dom/BrowserHost.h"
|
||||||
#include "nsIContentPolicy.h"
|
#include "nsIContentPolicy.h"
|
||||||
#include "nsIHttpChannelInternal.h"
|
#include "nsIHttpChannelInternal.h"
|
||||||
#include "nsIHttpHeaderVisitor.h"
|
#include "nsIHttpHeaderVisitor.h"
|
||||||
@@ -140,10 +140,10 @@ already_AddRefed<ChannelWrapper> ChannelWrapper::Get(const GlobalObject& global,
|
|||||||
|
|
||||||
already_AddRefed<ChannelWrapper> ChannelWrapper::GetRegisteredChannel(
|
already_AddRefed<ChannelWrapper> ChannelWrapper::GetRegisteredChannel(
|
||||||
const GlobalObject& global, uint64_t aChannelId,
|
const GlobalObject& global, uint64_t aChannelId,
|
||||||
const WebExtensionPolicy& aAddon, nsIRemoteTab* aBrowserParent) {
|
const WebExtensionPolicy& aAddon, nsIRemoteTab* aRemoteTab) {
|
||||||
ContentParent* contentParent = nullptr;
|
ContentParent* contentParent = nullptr;
|
||||||
if (BrowserParent* parent = static_cast<BrowserParent*>(aBrowserParent)) {
|
if (BrowserHost* host = BrowserHost::GetFrom(aRemoteTab)) {
|
||||||
contentParent = parent->Manager();
|
contentParent = host->GetActor()->Manager();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& webreq = WebRequestService::GetSingleton();
|
auto& webreq = WebRequestService::GetSingleton();
|
||||||
@@ -682,12 +682,12 @@ void ChannelWrapper::RegisterTraceableChannel(const WebExtensionPolicy& aAddon,
|
|||||||
|
|
||||||
already_AddRefed<nsITraceableChannel> ChannelWrapper::GetTraceableChannel(
|
already_AddRefed<nsITraceableChannel> ChannelWrapper::GetTraceableChannel(
|
||||||
nsAtom* aAddonId, dom::ContentParent* aContentParent) const {
|
nsAtom* aAddonId, dom::ContentParent* aContentParent) const {
|
||||||
nsCOMPtr<nsIRemoteTab> browserParent;
|
nsCOMPtr<nsIRemoteTab> remoteTab;
|
||||||
if (mAddonEntries.Get(aAddonId, getter_AddRefs(browserParent))) {
|
if (mAddonEntries.Get(aAddonId, getter_AddRefs(remoteTab))) {
|
||||||
ContentParent* contentParent = nullptr;
|
ContentParent* contentParent = nullptr;
|
||||||
if (browserParent) {
|
if (remoteTab) {
|
||||||
contentParent =
|
contentParent =
|
||||||
static_cast<BrowserParent*>(browserParent.get())->Manager();
|
BrowserHost::GetFrom(remoteTab.get())->GetActor()->Manager();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contentParent == aContentParent) {
|
if (contentParent == aContentParent) {
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
#include "mozilla/dom/Storage.h"
|
#include "mozilla/dom/Storage.h"
|
||||||
#include "mozilla/dom/ScriptSettings.h"
|
#include "mozilla/dom/ScriptSettings.h"
|
||||||
#include "mozilla/dom/BrowserParent.h"
|
#include "mozilla/dom/BrowserParent.h"
|
||||||
|
#include "mozilla/dom/BrowserHost.h"
|
||||||
#include "mozilla/dom/DocGroup.h"
|
#include "mozilla/dom/DocGroup.h"
|
||||||
#include "mozilla/dom/TabGroup.h"
|
#include "mozilla/dom/TabGroup.h"
|
||||||
#include "nsIXULWindow.h"
|
#include "nsIXULWindow.h"
|
||||||
@@ -476,7 +477,7 @@ nsWindowWatcher::OpenWindowWithRemoteTab(
|
|||||||
if (aRemoteTab) {
|
if (aRemoteTab) {
|
||||||
// We need to examine the window that aRemoteTab belongs to in
|
// We need to examine the window that aRemoteTab belongs to in
|
||||||
// order to inform us of what kind of window we're going to open.
|
// order to inform us of what kind of window we're going to open.
|
||||||
BrowserParent* openingTab = BrowserParent::GetFrom(aRemoteTab);
|
BrowserHost* openingTab = BrowserHost::GetFrom(aRemoteTab);
|
||||||
parentWindowOuter = openingTab->GetParentWindowOuter();
|
parentWindowOuter = openingTab->GetParentWindowOuter();
|
||||||
|
|
||||||
// Propagate the privacy & fission status of the parent window, if
|
// Propagate the privacy & fission status of the parent window, if
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
#include "mozilla/dom/Element.h"
|
#include "mozilla/dom/Element.h"
|
||||||
#include "mozilla/dom/Event.h"
|
#include "mozilla/dom/Event.h"
|
||||||
#include "mozilla/dom/ScriptSettings.h"
|
#include "mozilla/dom/ScriptSettings.h"
|
||||||
|
#include "mozilla/dom/BrowserHost.h"
|
||||||
#include "mozilla/dom/BrowserParent.h"
|
#include "mozilla/dom/BrowserParent.h"
|
||||||
|
|
||||||
#ifdef MOZ_NEW_XULSTORE
|
#ifdef MOZ_NEW_XULSTORE
|
||||||
@@ -352,9 +353,8 @@ nsTArray<RefPtr<mozilla::LiveResizeListener>>
|
|||||||
nsXULWindow::GetLiveResizeListeners() {
|
nsXULWindow::GetLiveResizeListeners() {
|
||||||
nsTArray<RefPtr<mozilla::LiveResizeListener>> listeners;
|
nsTArray<RefPtr<mozilla::LiveResizeListener>> listeners;
|
||||||
if (mPrimaryBrowserParent) {
|
if (mPrimaryBrowserParent) {
|
||||||
BrowserParent* parent =
|
BrowserHost* host = BrowserHost::GetFrom(mPrimaryBrowserParent.get());
|
||||||
static_cast<BrowserParent*>(mPrimaryBrowserParent.get());
|
listeners.AppendElement(host->GetActor());
|
||||||
listeners.AppendElement(parent);
|
|
||||||
}
|
}
|
||||||
return listeners;
|
return listeners;
|
||||||
}
|
}
|
||||||
@@ -1864,9 +1864,9 @@ nsXULWindow::GetPrimaryContentSize(int32_t* aWidth, int32_t* aHeight) {
|
|||||||
|
|
||||||
nsresult nsXULWindow::GetPrimaryRemoteTabSize(int32_t* aWidth,
|
nsresult nsXULWindow::GetPrimaryRemoteTabSize(int32_t* aWidth,
|
||||||
int32_t* aHeight) {
|
int32_t* aHeight) {
|
||||||
BrowserParent* browserParent = BrowserParent::GetFrom(mPrimaryBrowserParent);
|
BrowserHost* host = BrowserHost::GetFrom(mPrimaryBrowserParent.get());
|
||||||
// Need strong ref, since Client* can run script.
|
// Need strong ref, since Client* can run script.
|
||||||
nsCOMPtr<Element> element = browserParent->GetOwnerElement();
|
nsCOMPtr<Element> element = host->GetOwnerElement();
|
||||||
NS_ENSURE_STATE(element);
|
NS_ENSURE_STATE(element);
|
||||||
|
|
||||||
*aWidth = element->ClientWidth();
|
*aWidth = element->ClientWidth();
|
||||||
|
|||||||
Reference in New Issue
Block a user