mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1532725
- Rename PRemoteFrame to PBrowserBridge. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D22132 --HG-- rename : dom/ipc/RemoteFrameChild.cpp => dom/ipc/BrowserBridgeChild.cpp rename : dom/ipc/RemoteFrameChild.h => dom/ipc/BrowserBridgeChild.h rename : dom/ipc/RemoteFrameParent.cpp => dom/ipc/BrowserBridgeParent.cpp rename : dom/ipc/RemoteFrameParent.h => dom/ipc/BrowserBridgeParent.h rename : dom/ipc/PRemoteFrame.ipdl => dom/ipc/PBrowserBridge.ipdl extra : rebase_source : d5ca117b96c0d266041d23d80f0f4ab9b0471fb6
This commit is contained in:
parent
67120bc4e1
commit
c39b1f89d0
@ -70,7 +70,7 @@
|
||||
#include "mozilla/dom/IPCBlobUtils.h"
|
||||
#include "mozilla/dom/NodeBinding.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/dom/RemoteFrameChild.h"
|
||||
#include "mozilla/dom/BrowserBridgeChild.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
#include "mozilla/dom/Text.h"
|
||||
@ -6199,7 +6199,7 @@ bool nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent) {
|
||||
// If the subdocument lives in another process, the frame is
|
||||
// tabbable.
|
||||
if (EventStateManager::IsRemoteTarget(aContent) ||
|
||||
RemoteFrameChild::GetFrom(aContent)) {
|
||||
BrowserBridgeChild::GetFrom(aContent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@
|
||||
#include "mozilla/dom/HTMLImageElement.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/dom/HTMLSlotElement.h"
|
||||
#include "mozilla/dom/RemoteFrameChild.h"
|
||||
#include "mozilla/dom/BrowserBridgeChild.h"
|
||||
#include "mozilla/dom/Text.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventStateManager.h"
|
||||
@ -1854,8 +1854,8 @@ void nsFocusManager::Focus(nsPIDOMWindowOuter* aWindow, Element* aElement,
|
||||
}
|
||||
|
||||
// Same as above but for out-of-process iframes
|
||||
if (RemoteFrameChild* rfc = RemoteFrameChild::GetFrom(aElement)) {
|
||||
rfc->Activate();
|
||||
if (BrowserBridgeChild* bbc = BrowserBridgeChild::GetFrom(aElement)) {
|
||||
bbc->Activate();
|
||||
LOGFOCUS(("Out-of-process iframe activated"));
|
||||
}
|
||||
}
|
||||
@ -3475,9 +3475,9 @@ nsresult nsFocusManager::GetNextTabbableContent(
|
||||
}
|
||||
|
||||
// Same as above but for out-of-process iframes
|
||||
RemoteFrameChild* rfc = RemoteFrameChild::GetFrom(currentContent);
|
||||
if (rfc) {
|
||||
rfc->NavigateByKey(aForward, aForDocumentNavigation);
|
||||
BrowserBridgeChild* bbc = BrowserBridgeChild::GetFrom(currentContent);
|
||||
if (bbc) {
|
||||
bbc->NavigateByKey(aForward, aForDocumentNavigation);
|
||||
return NS_SUCCESS_DOM_NO_OPERATION;
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@
|
||||
#include "mozilla/dom/ChildSHistory.h"
|
||||
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/RemoteFrameChild.h"
|
||||
#include "mozilla/dom/BrowserBridgeChild.h"
|
||||
|
||||
#include "mozilla/dom/HTMLBodyElement.h"
|
||||
|
||||
@ -344,15 +344,15 @@ nsresult nsFrameLoader::ReallyStartLoadingInternal() {
|
||||
AUTO_PROFILER_LABEL("nsFrameLoader::ReallyStartLoadingInternal", OTHER);
|
||||
|
||||
if (IsRemoteFrame()) {
|
||||
if (!mRemoteBrowser && !mRemoteFrameChild && !TryRemoteBrowser()) {
|
||||
if (!mRemoteBrowser && !mBrowserBridgeChild && !TryRemoteBrowser()) {
|
||||
NS_WARNING("Couldn't create child process for iframe.");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (mRemoteFrameChild) {
|
||||
if (mBrowserBridgeChild) {
|
||||
nsAutoCString spec;
|
||||
mURIToLoad->GetSpec(spec);
|
||||
Unused << mRemoteFrameChild->SendLoadURL(spec);
|
||||
Unused << mBrowserBridgeChild->SendLoadURL(spec);
|
||||
} else {
|
||||
// FIXME get error codes from child
|
||||
mRemoteBrowser->LoadURL(mURIToLoad);
|
||||
@ -806,7 +806,7 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
|
||||
NS_ASSERTION(IsRemoteFrame(),
|
||||
"ShowRemote only makes sense on remote frames.");
|
||||
|
||||
if (!mRemoteBrowser && !mRemoteFrameChild && !TryRemoteBrowser()) {
|
||||
if (!mRemoteBrowser && !mBrowserBridgeChild && !TryRemoteBrowser()) {
|
||||
NS_ERROR("Couldn't create child process.");
|
||||
return false;
|
||||
}
|
||||
@ -825,7 +825,7 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mRemoteFrameChild) {
|
||||
if (mBrowserBridgeChild) {
|
||||
nsCOMPtr<nsISupports> container =
|
||||
mOwnerContent->OwnerDoc()->GetContainer();
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container);
|
||||
@ -834,7 +834,7 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
|
||||
nsSizeMode sizeMode =
|
||||
mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal;
|
||||
|
||||
Unused << mRemoteFrameChild->SendShow(
|
||||
Unused << mBrowserBridgeChild->SendShow(
|
||||
size, ParentWindowIsActive(mOwnerContent->OwnerDoc()), sizeMode);
|
||||
mRemoteBrowserShown = true;
|
||||
return true;
|
||||
@ -863,8 +863,8 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
|
||||
if (!aFrame || !(aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
if (mRemoteBrowser) {
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
} else if (mRemoteFrameChild) {
|
||||
mRemoteFrameChild->UpdateDimensions(dimensions, size);
|
||||
} else if (mBrowserBridgeChild) {
|
||||
mBrowserBridgeChild->UpdateDimensions(dimensions, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -955,7 +955,7 @@ nsresult nsFrameLoader::SwapWithOtherRemoteLoader(
|
||||
}
|
||||
|
||||
// FIXME: Consider supporting FrameLoader swapping for remote sub frames.
|
||||
if (mRemoteFrameChild) {
|
||||
if (mBrowserBridgeChild) {
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
@ -1686,9 +1686,9 @@ void nsFrameLoader::DestroyDocShell() {
|
||||
mRemoteBrowser->Destroy();
|
||||
}
|
||||
|
||||
if (mRemoteFrameChild) {
|
||||
Unused << mRemoteFrameChild->Send__delete__(mRemoteFrameChild);
|
||||
mRemoteFrameChild = nullptr;
|
||||
if (mBrowserBridgeChild) {
|
||||
Unused << mBrowserBridgeChild->Send__delete__(mBrowserBridgeChild);
|
||||
mBrowserBridgeChild = nullptr;
|
||||
}
|
||||
|
||||
// Fire the "unload" event if we're in-process.
|
||||
@ -1732,9 +1732,9 @@ void nsFrameLoader::DestroyComplete() {
|
||||
mRemoteBrowser = nullptr;
|
||||
}
|
||||
|
||||
if (mRemoteFrameChild) {
|
||||
Unused << mRemoteFrameChild->Send__delete__(mRemoteFrameChild);
|
||||
mRemoteFrameChild = nullptr;
|
||||
if (mBrowserBridgeChild) {
|
||||
Unused << mBrowserBridgeChild->Send__delete__(mBrowserBridgeChild);
|
||||
mBrowserBridgeChild = nullptr;
|
||||
}
|
||||
|
||||
if (mMessageManager) {
|
||||
@ -2298,7 +2298,7 @@ nsresult nsFrameLoader::GetWindowDimensions(nsIntRect& aRect) {
|
||||
|
||||
nsresult nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame* aIFrame) {
|
||||
if (IsRemoteFrame()) {
|
||||
if (mRemoteBrowser || mRemoteFrameChild) {
|
||||
if (mRemoteBrowser || mBrowserBridgeChild) {
|
||||
ScreenIntSize size = aIFrame->GetSubdocumentSize();
|
||||
// If we were not able to show remote frame before, we should probably
|
||||
// retry now to send correct showInfo.
|
||||
@ -2310,8 +2310,8 @@ nsresult nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame* aIFrame) {
|
||||
mLazySize = size;
|
||||
if (mRemoteBrowser) {
|
||||
mRemoteBrowser->UpdateDimensions(dimensions, size);
|
||||
} else if (mRemoteFrameChild) {
|
||||
mRemoteFrameChild->UpdateDimensions(dimensions, size);
|
||||
} else if (mBrowserBridgeChild) {
|
||||
mBrowserBridgeChild->UpdateDimensions(dimensions, size);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
@ -2391,7 +2391,7 @@ static Tuple<ContentParent*, TabParent*> GetContentParent(Element* aBrowser) {
|
||||
}
|
||||
|
||||
bool nsFrameLoader::TryRemoteBrowser() {
|
||||
NS_ASSERTION(!mRemoteBrowser && !mRemoteFrameChild,
|
||||
NS_ASSERTION(!mRemoteBrowser && !mBrowserBridgeChild,
|
||||
"TryRemoteBrowser called with a remote browser already?");
|
||||
|
||||
if (!mOwnerContent) {
|
||||
@ -2508,11 +2508,11 @@ bool nsFrameLoader::TryRemoteBrowser() {
|
||||
|
||||
nsCOMPtr<Element> ownerElement = mOwnerContent;
|
||||
|
||||
// If we're in a content process, create a RemoteFrameChild actor.
|
||||
// If we're in a content process, create a BrowserBridgeChild actor.
|
||||
if (XRE_IsContentProcess()) {
|
||||
mRemoteFrameChild = RemoteFrameChild::Create(
|
||||
mBrowserBridgeChild = BrowserBridgeChild::Create(
|
||||
this, context, NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE));
|
||||
return !!mRemoteFrameChild;
|
||||
return !!mBrowserBridgeChild;
|
||||
}
|
||||
|
||||
mRemoteBrowser =
|
||||
@ -2586,8 +2586,8 @@ mozilla::dom::PBrowserParent* nsFrameLoader::GetRemoteBrowser() const {
|
||||
return mRemoteBrowser;
|
||||
}
|
||||
|
||||
mozilla::dom::RemoteFrameChild* nsFrameLoader::GetRemoteFrameChild() const {
|
||||
return mRemoteFrameChild;
|
||||
mozilla::dom::BrowserBridgeChild* nsFrameLoader::GetBrowserBridgeChild() const {
|
||||
return mBrowserBridgeChild;
|
||||
}
|
||||
|
||||
mozilla::layers::LayersId nsFrameLoader::GetLayersId() const {
|
||||
@ -2595,8 +2595,8 @@ mozilla::layers::LayersId nsFrameLoader::GetLayersId() const {
|
||||
if (mRemoteBrowser) {
|
||||
return mRemoteBrowser->GetRenderFrame()->GetLayersId();
|
||||
}
|
||||
if (mRemoteFrameChild) {
|
||||
return mRemoteFrameChild->GetLayersId();
|
||||
if (mBrowserBridgeChild) {
|
||||
return mBrowserBridgeChild->GetLayersId();
|
||||
}
|
||||
return mozilla::layers::LayersId{};
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class ProcessMessageManager;
|
||||
class Promise;
|
||||
class TabParent;
|
||||
class MutableTabContext;
|
||||
class RemoteFrameChild;
|
||||
class BrowserBridgeChild;
|
||||
|
||||
namespace ipc {
|
||||
class StructuredCloneData;
|
||||
@ -283,10 +283,10 @@ class nsFrameLoader final : public nsStubMutationObserver,
|
||||
PBrowserParent* GetRemoteBrowser() const;
|
||||
|
||||
/**
|
||||
* Returns the RemoteFrameChild if this is an out-of-process iframe, or null
|
||||
* Returns the BrowserBridgeChild if this is an out-of-process iframe, or null
|
||||
* otherwise.
|
||||
*/
|
||||
mozilla::dom::RemoteFrameChild* GetRemoteFrameChild() const;
|
||||
mozilla::dom::BrowserBridgeChild* GetBrowserBridgeChild() const;
|
||||
|
||||
/**
|
||||
* Returns the layers ID that this remote frame is using to render.
|
||||
@ -455,7 +455,7 @@ class nsFrameLoader final : public nsStubMutationObserver,
|
||||
uint64_t mChildID;
|
||||
|
||||
// This is used when this refers to a remote sub frame
|
||||
RefPtr<mozilla::dom::RemoteFrameChild> mRemoteFrameChild;
|
||||
RefPtr<mozilla::dom::BrowserBridgeChild> mBrowserBridgeChild;
|
||||
|
||||
// Holds the last known size of the frame.
|
||||
mozilla::ScreenIntSize mLazySize;
|
||||
|
@ -4,21 +4,22 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/dom/RemoteFrameChild.h"
|
||||
|
||||
#include "mozilla/dom/BrowserBridgeChild.h"
|
||||
#include "nsFrameLoader.h"
|
||||
#include "nsFrameLoaderOwner.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
RemoteFrameChild::RemoteFrameChild(nsFrameLoader* aFrameLoader)
|
||||
BrowserBridgeChild::BrowserBridgeChild(nsFrameLoader* aFrameLoader)
|
||||
: mLayersId{0}, mIPCOpen(true), mFrameLoader(aFrameLoader) {}
|
||||
|
||||
RemoteFrameChild::~RemoteFrameChild() {}
|
||||
BrowserBridgeChild::~BrowserBridgeChild() {}
|
||||
|
||||
already_AddRefed<RemoteFrameChild> RemoteFrameChild::Create(
|
||||
already_AddRefed<BrowserBridgeChild> BrowserBridgeChild::Create(
|
||||
nsFrameLoader* aFrameLoader, const TabContext& aContext,
|
||||
const nsString& aRemoteType) {
|
||||
MOZ_ASSERT(XRE_IsContentProcess());
|
||||
@ -33,18 +34,19 @@ already_AddRefed<RemoteFrameChild> RemoteFrameChild::Create(
|
||||
RefPtr<TabChild> tabChild = TabChild::GetFrom(docShell);
|
||||
MOZ_DIAGNOSTIC_ASSERT(tabChild);
|
||||
|
||||
RefPtr<RemoteFrameChild> remoteFrame = new RemoteFrameChild(aFrameLoader);
|
||||
// Reference is freed in TabChild::DeallocPRemoteFrameChild.
|
||||
tabChild->SendPRemoteFrameConstructor(
|
||||
do_AddRef(remoteFrame).take(),
|
||||
RefPtr<BrowserBridgeChild> browserBridge =
|
||||
new BrowserBridgeChild(aFrameLoader);
|
||||
// Reference is freed in TabChild::DeallocPBrowserBridgeChild.
|
||||
tabChild->SendPBrowserBridgeConstructor(
|
||||
do_AddRef(browserBridge).take(),
|
||||
PromiseFlatString(aContext.PresentationURL()), aRemoteType);
|
||||
remoteFrame->mIPCOpen = true;
|
||||
browserBridge->mIPCOpen = true;
|
||||
|
||||
return remoteFrame.forget();
|
||||
return browserBridge.forget();
|
||||
}
|
||||
|
||||
void RemoteFrameChild::UpdateDimensions(const nsIntRect& aRect,
|
||||
const mozilla::ScreenIntSize& aSize) {
|
||||
void BrowserBridgeChild::UpdateDimensions(const nsIntRect& aRect,
|
||||
const mozilla::ScreenIntSize& aSize) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mIPCOpen);
|
||||
|
||||
RefPtr<Element> owner = mFrameLoader->GetOwnerContent();
|
||||
@ -75,23 +77,23 @@ void RemoteFrameChild::UpdateDimensions(const nsIntRect& aRect,
|
||||
Unused << SendUpdateDimensions(di);
|
||||
}
|
||||
|
||||
void RemoteFrameChild::NavigateByKey(bool aForward,
|
||||
bool aForDocumentNavigation) {
|
||||
void BrowserBridgeChild::NavigateByKey(bool aForward,
|
||||
bool aForDocumentNavigation) {
|
||||
Unused << SendNavigateByKey(aForward, aForDocumentNavigation);
|
||||
}
|
||||
|
||||
void RemoteFrameChild::Activate() { Unused << SendActivate(); }
|
||||
void BrowserBridgeChild::Activate() { Unused << SendActivate(); }
|
||||
|
||||
/*static*/
|
||||
RemoteFrameChild* RemoteFrameChild::GetFrom(nsFrameLoader* aFrameLoader) {
|
||||
BrowserBridgeChild* BrowserBridgeChild::GetFrom(nsFrameLoader* aFrameLoader) {
|
||||
if (!aFrameLoader) {
|
||||
return nullptr;
|
||||
}
|
||||
return aFrameLoader->GetRemoteFrameChild();
|
||||
return aFrameLoader->GetBrowserBridgeChild();
|
||||
}
|
||||
|
||||
/*static*/
|
||||
RemoteFrameChild* RemoteFrameChild::GetFrom(nsIContent* aContent) {
|
||||
BrowserBridgeChild* BrowserBridgeChild::GetFrom(nsIContent* aContent) {
|
||||
RefPtr<nsFrameLoaderOwner> loaderOwner = do_QueryObject(aContent);
|
||||
if (!loaderOwner) {
|
||||
return nullptr;
|
||||
@ -100,14 +102,14 @@ RemoteFrameChild* RemoteFrameChild::GetFrom(nsIContent* aContent) {
|
||||
return GetFrom(frameLoader);
|
||||
}
|
||||
|
||||
IPCResult RemoteFrameChild::RecvSetLayersId(
|
||||
IPCResult BrowserBridgeChild::RecvSetLayersId(
|
||||
const mozilla::layers::LayersId& aLayersId) {
|
||||
MOZ_ASSERT(!mLayersId.IsValid() && aLayersId.IsValid());
|
||||
mLayersId = aLayersId;
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void RemoteFrameChild::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
void BrowserBridgeChild::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
mIPCOpen = false;
|
||||
}
|
||||
|
@ -4,10 +4,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_RemoteFrameChild_h
|
||||
#define mozilla_dom_RemoteFrameChild_h
|
||||
#ifndef mozilla_dom_BrowserBridgeChild_h
|
||||
#define mozilla_dom_BrowserBridgeChild_h
|
||||
|
||||
#include "mozilla/dom/PRemoteFrameChild.h"
|
||||
#include "mozilla/dom/PBrowserBridgeChild.h"
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
|
||||
namespace mozilla {
|
||||
@ -16,20 +16,20 @@ namespace dom {
|
||||
/**
|
||||
* Child side for a remote frame.
|
||||
*/
|
||||
class RemoteFrameChild : public PRemoteFrameChild {
|
||||
class BrowserBridgeChild : public PBrowserBridgeChild {
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(RemoteFrameChild);
|
||||
NS_INLINE_DECL_REFCOUNTING(BrowserBridgeChild);
|
||||
|
||||
TabChild* Manager() {
|
||||
MOZ_ASSERT(mIPCOpen);
|
||||
return static_cast<TabChild*>(PRemoteFrameChild::Manager());
|
||||
return static_cast<TabChild*>(PBrowserBridgeChild::Manager());
|
||||
}
|
||||
|
||||
mozilla::layers::LayersId GetLayersId() { return mLayersId; }
|
||||
|
||||
static already_AddRefed<RemoteFrameChild> Create(nsFrameLoader* aFrameLoader,
|
||||
const TabContext& aContext,
|
||||
const nsString& aRemoteType);
|
||||
static already_AddRefed<BrowserBridgeChild> Create(
|
||||
nsFrameLoader* aFrameLoader, const TabContext& aContext,
|
||||
const nsString& aRemoteType);
|
||||
|
||||
void UpdateDimensions(const nsIntRect& aRect,
|
||||
const mozilla::ScreenIntSize& aSize);
|
||||
@ -38,12 +38,12 @@ class RemoteFrameChild : public PRemoteFrameChild {
|
||||
|
||||
void Activate();
|
||||
|
||||
static RemoteFrameChild* GetFrom(nsFrameLoader* aFrameLoader);
|
||||
static BrowserBridgeChild* GetFrom(nsFrameLoader* aFrameLoader);
|
||||
|
||||
static RemoteFrameChild* GetFrom(nsIContent* aContent);
|
||||
static BrowserBridgeChild* GetFrom(nsIContent* aContent);
|
||||
|
||||
protected:
|
||||
friend class PRemoteFrameChild;
|
||||
friend class PBrowserBridgeChild;
|
||||
|
||||
mozilla::ipc::IPCResult RecvSetLayersId(
|
||||
const mozilla::layers::LayersId& aLayersId);
|
||||
@ -51,8 +51,8 @@ class RemoteFrameChild : public PRemoteFrameChild {
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
|
||||
private:
|
||||
explicit RemoteFrameChild(nsFrameLoader* aFrameLoader);
|
||||
~RemoteFrameChild();
|
||||
explicit BrowserBridgeChild(nsFrameLoader* aFrameLoader);
|
||||
~BrowserBridgeChild();
|
||||
|
||||
mozilla::layers::LayersId mLayersId;
|
||||
bool mIPCOpen;
|
||||
@ -62,4 +62,4 @@ class RemoteFrameChild : public PRemoteFrameChild {
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // !defined(mozilla_dom_RemoteFrameParent_h)
|
||||
#endif // !defined(mozilla_dom_BrowserBridgeParent_h)
|
@ -4,22 +4,23 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/dom/RemoteFrameParent.h"
|
||||
#include "mozilla/dom/BrowserBridgeParent.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/ContentProcessManager.h"
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
using namespace mozilla::layout;
|
||||
using namespace mozilla::hal;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
RemoteFrameParent::RemoteFrameParent() : mIPCOpen(false) {}
|
||||
BrowserBridgeParent::BrowserBridgeParent() : mIPCOpen(false) {}
|
||||
|
||||
RemoteFrameParent::~RemoteFrameParent() {}
|
||||
BrowserBridgeParent::~BrowserBridgeParent() {}
|
||||
|
||||
nsresult RemoteFrameParent::Init(const nsString& aPresentationURL,
|
||||
const nsString& aRemoteType) {
|
||||
nsresult BrowserBridgeParent::Init(const nsString& aPresentationURL,
|
||||
const nsString& aRemoteType) {
|
||||
mIPCOpen = true;
|
||||
|
||||
// FIXME: This should actually use a non-bogus TabContext, probably inherited
|
||||
@ -80,9 +81,9 @@ nsresult RemoteFrameParent::Init(const nsString& aPresentationURL,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
IPCResult RemoteFrameParent::RecvShow(const ScreenIntSize& aSize,
|
||||
const bool& aParentIsActive,
|
||||
const nsSizeMode& aSizeMode) {
|
||||
IPCResult BrowserBridgeParent::RecvShow(const ScreenIntSize& aSize,
|
||||
const bool& aParentIsActive,
|
||||
const nsSizeMode& aSizeMode) {
|
||||
RenderFrame* rf = mTabParent->GetRenderFrame();
|
||||
if (!rf->AttachLayerManager()) {
|
||||
MOZ_CRASH();
|
||||
@ -93,36 +94,36 @@ IPCResult RemoteFrameParent::RecvShow(const ScreenIntSize& aSize,
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
IPCResult RemoteFrameParent::RecvLoadURL(const nsCString& aUrl) {
|
||||
IPCResult BrowserBridgeParent::RecvLoadURL(const nsCString& aUrl) {
|
||||
Unused << mTabParent->SendLoadURL(aUrl, mTabParent->GetShowInfo());
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
IPCResult RemoteFrameParent::RecvUpdateDimensions(
|
||||
IPCResult BrowserBridgeParent::RecvUpdateDimensions(
|
||||
const DimensionInfo& aDimensions) {
|
||||
Unused << mTabParent->SendUpdateDimensions(aDimensions);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
IPCResult RemoteFrameParent::RecvRenderLayers(
|
||||
IPCResult BrowserBridgeParent::RecvRenderLayers(
|
||||
const bool& aEnabled, const bool& aForceRepaint,
|
||||
const layers::LayersObserverEpoch& aEpoch) {
|
||||
Unused << mTabParent->SendRenderLayers(aEnabled, aForceRepaint, aEpoch);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
IPCResult RemoteFrameParent::RecvNavigateByKey(
|
||||
IPCResult BrowserBridgeParent::RecvNavigateByKey(
|
||||
const bool& aForward, const bool& aForDocumentNavigation) {
|
||||
Unused << mTabParent->SendNavigateByKey(aForward, aForDocumentNavigation);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
IPCResult RemoteFrameParent::RecvActivate() {
|
||||
IPCResult BrowserBridgeParent::RecvActivate() {
|
||||
mTabParent->Activate();
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
void RemoteFrameParent::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
void BrowserBridgeParent::ActorDestroy(ActorDestroyReason aWhy) {
|
||||
mIPCOpen = false;
|
||||
}
|
||||
|
@ -4,20 +4,20 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_dom_RemoteFrameParent_h
|
||||
#define mozilla_dom_RemoteFrameParent_h
|
||||
#ifndef mozilla_dom_BrowserBridgeParent_h
|
||||
#define mozilla_dom_BrowserBridgeParent_h
|
||||
|
||||
#include "mozilla/dom/PRemoteFrameParent.h"
|
||||
#include "mozilla/dom/PBrowserBridgeParent.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class RemoteFrameParent : public PRemoteFrameParent {
|
||||
class BrowserBridgeParent : public PBrowserBridgeParent {
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(RemoteFrameParent);
|
||||
NS_INLINE_DECL_REFCOUNTING(BrowserBridgeParent);
|
||||
|
||||
RemoteFrameParent();
|
||||
BrowserBridgeParent();
|
||||
|
||||
// Initialize this actor after performing startup.
|
||||
nsresult Init(const nsString& aPresentationURL, const nsString& aRemoteType);
|
||||
@ -27,11 +27,11 @@ class RemoteFrameParent : public PRemoteFrameParent {
|
||||
// Get our manager actor.
|
||||
TabParent* Manager() {
|
||||
MOZ_ASSERT(mIPCOpen);
|
||||
return static_cast<TabParent*>(PRemoteFrameParent::Manager());
|
||||
return static_cast<TabParent*>(PBrowserBridgeParent::Manager());
|
||||
}
|
||||
|
||||
protected:
|
||||
friend class PRemoteFrameParent;
|
||||
friend class PBrowserBridgeParent;
|
||||
|
||||
mozilla::ipc::IPCResult RecvShow(const ScreenIntSize& aSize,
|
||||
const bool& aParentIsActive,
|
||||
@ -51,7 +51,7 @@ class RemoteFrameParent : public PRemoteFrameParent {
|
||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||
|
||||
private:
|
||||
~RemoteFrameParent();
|
||||
~BrowserBridgeParent();
|
||||
|
||||
RefPtr<TabParent> mTabParent;
|
||||
bool mIPCOpen;
|
||||
@ -60,4 +60,4 @@ class RemoteFrameParent : public PRemoteFrameParent {
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // !defined(mozilla_dom_RemoteFrameParent_h)
|
||||
#endif // !defined(mozilla_dom_BrowserBridgeParent_h)
|
@ -6,8 +6,11 @@
|
||||
|
||||
#include "nsMemoryReporterManager.h"
|
||||
#include "MemoryReportRequest.h"
|
||||
#include "mozilla/ipc/FileDescriptor.h"
|
||||
#include "mozilla/ipc/FileDescriptorUtils.h"
|
||||
|
||||
using namespace mozilla::ipc;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
|
@ -18,7 +18,7 @@ include protocol PFileDescriptorSet;
|
||||
include protocol PIPCBlobInputStream;
|
||||
include protocol PPaymentRequest;
|
||||
include protocol PWindowGlobal;
|
||||
include protocol PRemoteFrame;
|
||||
include protocol PBrowserBridge;
|
||||
|
||||
include DOMTypes;
|
||||
include IPCBlob;
|
||||
@ -142,7 +142,7 @@ nested(upto inside_cpow) sync protocol PBrowser
|
||||
manages PPluginWidget;
|
||||
manages PPaymentRequest;
|
||||
manages PWindowGlobal;
|
||||
manages PRemoteFrame;
|
||||
manages PBrowserBridge;
|
||||
|
||||
both:
|
||||
async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
|
||||
@ -178,7 +178,7 @@ parent:
|
||||
/**
|
||||
* Construct a new Remote iframe actor.
|
||||
*/
|
||||
async PRemoteFrame(nsString aPresentationURL, nsString aRemoteType);
|
||||
async PBrowserBridge(nsString aPresentationURL, nsString aRemoteType);
|
||||
|
||||
/**
|
||||
* Sends an NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW to be adopted by the
|
||||
|
@ -17,9 +17,9 @@ namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
/**
|
||||
* PRemoteFrame corresponds to a remote iframe.
|
||||
* PBrowserBridge corresponds to a remote iframe.
|
||||
*/
|
||||
async protocol PRemoteFrame {
|
||||
async protocol PBrowserBridge {
|
||||
manager PBrowser;
|
||||
|
||||
child:
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "mozilla/dom/PermissionMessageUtils.h"
|
||||
#include "mozilla/ipc/BackgroundUtils.h"
|
||||
#include "mozilla/ipc/PBackgroundSharedTypes.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "mozilla/dom/PaymentRequestChild.h"
|
||||
#include "mozilla/dom/PBrowser.h"
|
||||
#include "mozilla/dom/WindowProxyHolder.h"
|
||||
#include "mozilla/dom/RemoteFrameChild.h"
|
||||
#include "mozilla/dom/BrowserBridgeChild.h"
|
||||
#include "mozilla/gfx/CrossProcessPaint.h"
|
||||
#include "mozilla/IMEStateManager.h"
|
||||
#include "mozilla/ipc/URIUtils.h"
|
||||
@ -3195,15 +3195,16 @@ bool TabChild::DeallocPWindowGlobalChild(PWindowGlobalChild* aActor) {
|
||||
return true;
|
||||
}
|
||||
|
||||
PRemoteFrameChild* TabChild::AllocPRemoteFrameChild(const nsString&,
|
||||
const nsString&) {
|
||||
MOZ_CRASH("We should never be manually allocating PRemoteFrameChild actors");
|
||||
PBrowserBridgeChild* TabChild::AllocPBrowserBridgeChild(const nsString&,
|
||||
const nsString&) {
|
||||
MOZ_CRASH(
|
||||
"We should never be manually allocating PBrowserBridgeChild actors");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool TabChild::DeallocPRemoteFrameChild(PRemoteFrameChild* aActor) {
|
||||
// This reference was added in RemoteFrameChild::Create.
|
||||
static_cast<RemoteFrameChild*>(aActor)->Release();
|
||||
bool TabChild::DeallocPBrowserBridgeChild(PBrowserBridgeChild* aActor) {
|
||||
// This reference was added in BrowserBridgeChild::Create.
|
||||
static_cast<BrowserBridgeChild*>(aActor)->Release();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -670,10 +670,10 @@ class TabChild final : public TabChildBase,
|
||||
|
||||
virtual bool DeallocPWindowGlobalChild(PWindowGlobalChild* aActor) override;
|
||||
|
||||
virtual PRemoteFrameChild* AllocPRemoteFrameChild(
|
||||
virtual PBrowserBridgeChild* AllocPBrowserBridgeChild(
|
||||
const nsString& aName, const nsString& aRemoteType) override;
|
||||
|
||||
virtual bool DeallocPRemoteFrameChild(PRemoteFrameChild* aActor) override;
|
||||
virtual bool DeallocPBrowserBridgeChild(PBrowserBridgeChild* aActor) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvDestroy() override;
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "mozilla/dom/indexedDB/ActorsParent.h"
|
||||
#include "mozilla/dom/IPCBlobUtils.h"
|
||||
#include "mozilla/dom/PaymentRequestParent.h"
|
||||
#include "mozilla/dom/RemoteFrameParent.h"
|
||||
#include "mozilla/dom/BrowserBridgeParent.h"
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/DataSurfaceHelpers.h"
|
||||
@ -998,22 +998,22 @@ bool TabParent::DeallocPWindowGlobalParent(PWindowGlobalParent* aActor) {
|
||||
return true;
|
||||
}
|
||||
|
||||
IPCResult TabParent::RecvPRemoteFrameConstructor(PRemoteFrameParent* aActor,
|
||||
const nsString& aName,
|
||||
const nsString& aRemoteType) {
|
||||
static_cast<RemoteFrameParent*>(aActor)->Init(aName, aRemoteType);
|
||||
IPCResult TabParent::RecvPBrowserBridgeConstructor(
|
||||
PBrowserBridgeParent* aActor, const nsString& aName,
|
||||
const nsString& aRemoteType) {
|
||||
static_cast<BrowserBridgeParent*>(aActor)->Init(aName, aRemoteType);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
PRemoteFrameParent* TabParent::AllocPRemoteFrameParent(
|
||||
PBrowserBridgeParent* TabParent::AllocPBrowserBridgeParent(
|
||||
const nsString& aName, const nsString& aRemoteType) {
|
||||
// Reference freed in DeallocPRemoteFrameParent.
|
||||
return do_AddRef(new RemoteFrameParent()).take();
|
||||
// Reference freed in DeallocPBrowserBridgeParent.
|
||||
return do_AddRef(new BrowserBridgeParent()).take();
|
||||
}
|
||||
|
||||
bool TabParent::DeallocPRemoteFrameParent(PRemoteFrameParent* aActor) {
|
||||
// Free reference from AllocPRemoteFrameParent.
|
||||
static_cast<RemoteFrameParent*>(aActor)->Release();
|
||||
bool TabParent::DeallocPBrowserBridgeParent(PBrowserBridgeParent* aActor) {
|
||||
// Free reference from AllocPBrowserBridgeParent.
|
||||
static_cast<BrowserBridgeParent*>(aActor)->Release();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -315,13 +315,13 @@ class TabParent final : public PBrowserParent,
|
||||
virtual mozilla::ipc::IPCResult RecvPWindowGlobalConstructor(
|
||||
PWindowGlobalParent* aActor, const WindowGlobalInit& aInit) override;
|
||||
|
||||
PRemoteFrameParent* AllocPRemoteFrameParent(const nsString& aPresentationURL,
|
||||
const nsString& aRemoteType);
|
||||
PBrowserBridgeParent* AllocPBrowserBridgeParent(
|
||||
const nsString& aPresentationURL, const nsString& aRemoteType);
|
||||
|
||||
bool DeallocPRemoteFrameParent(PRemoteFrameParent* aActor);
|
||||
bool DeallocPBrowserBridgeParent(PBrowserBridgeParent* aActor);
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvPRemoteFrameConstructor(
|
||||
PRemoteFrameParent* aActor, const nsString& aPresentationURL,
|
||||
virtual mozilla::ipc::IPCResult RecvPBrowserBridgeConstructor(
|
||||
PBrowserBridgeParent* aActor, const nsString& aPresentationURL,
|
||||
const nsString& aRemoteType) override;
|
||||
|
||||
void LoadURL(nsIURI* aURI);
|
||||
|
@ -28,6 +28,8 @@ EXPORTS.mozilla.dom.ipc += [
|
||||
]
|
||||
|
||||
EXPORTS.mozilla.dom += [
|
||||
'BrowserBridgeChild.h',
|
||||
'BrowserBridgeParent.h',
|
||||
'CoalescedInputData.h',
|
||||
'CoalescedMouseData.h',
|
||||
'CoalescedWheelData.h',
|
||||
@ -44,8 +46,6 @@ EXPORTS.mozilla.dom += [
|
||||
'JSWindowActorService.h',
|
||||
'MemoryReportRequest.h',
|
||||
'PermissionMessageUtils.h',
|
||||
'RemoteFrameChild.h',
|
||||
'RemoteFrameParent.h',
|
||||
'TabChild.h',
|
||||
'TabContext.h',
|
||||
'TabMessageUtils.h',
|
||||
@ -64,6 +64,8 @@ EXPORTS.mozilla += [
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'BrowserBridgeChild.cpp',
|
||||
'BrowserBridgeParent.cpp',
|
||||
'CoalescedMouseData.cpp',
|
||||
'CoalescedWheelData.cpp',
|
||||
'ColorPickerParent.cpp',
|
||||
@ -82,8 +84,6 @@ UNIFIED_SOURCES += [
|
||||
'PermissionMessageUtils.cpp',
|
||||
'PreallocatedProcessManager.cpp',
|
||||
'ProcessPriorityManager.cpp',
|
||||
'RemoteFrameChild.cpp',
|
||||
'RemoteFrameParent.cpp',
|
||||
'SharedMap.cpp',
|
||||
'SharedStringMap.cpp',
|
||||
'StructuredCloneData.cpp',
|
||||
@ -106,6 +106,7 @@ IPDL_SOURCES += [
|
||||
'DOMTypes.ipdlh',
|
||||
'MemoryReportTypes.ipdlh',
|
||||
'PBrowser.ipdl',
|
||||
'PBrowserBridge.ipdl',
|
||||
'PBrowserOrId.ipdlh',
|
||||
'PColorPicker.ipdl',
|
||||
'PContent.ipdl',
|
||||
@ -117,7 +118,6 @@ IPDL_SOURCES += [
|
||||
'PPluginWidget.ipdl',
|
||||
'PProcessHangMonitor.ipdl',
|
||||
'PrefsTypes.ipdlh',
|
||||
'PRemoteFrame.ipdl',
|
||||
'PTabContext.ipdlh',
|
||||
'PURLClassifier.ipdl',
|
||||
'PURLClassifierInfo.ipdlh',
|
||||
|
@ -8,7 +8,6 @@
|
||||
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
#include "mozilla/dom/RemoteFrameChild.h"
|
||||
#include "mozilla/layers/CompositorBridgeParent.h"
|
||||
#include "mozilla/layers/CompositorTypes.h"
|
||||
#include "mozilla/layers/LayerTransactionParent.h"
|
||||
|
Loading…
Reference in New Issue
Block a user