From 5fc1f2fe6fff14e550486285f4ce5b4b97637dbf Mon Sep 17 00:00:00 2001 From: Andreea Pavel Date: Sun, 10 Feb 2019 05:31:06 +0200 Subject: [PATCH] Backed out 9 changesets (bug 1500257) for multiple failures e.g. test_browserElement_oop_FirstPaint.html on a CLOSED TREE Backed out changeset 6097503e6300 (bug 1500257) Backed out changeset a62c02951031 (bug 1500257) Backed out changeset 62ad54fb95eb (bug 1500257) Backed out changeset caafb04b7dd4 (bug 1500257) Backed out changeset c19bc81c4f43 (bug 1500257) Backed out changeset 697a9159e0d2 (bug 1500257) Backed out changeset f228f043e6cf (bug 1500257) Backed out changeset 12d7dba34733 (bug 1500257) Backed out changeset 3abe61f5dc5c (bug 1500257) --- dom/base/nsFrameLoader.cpp | 114 +++-------- dom/base/nsFrameLoader.h | 37 ++-- dom/ipc/PBrowser.ipdl | 7 - dom/ipc/PRemoteFrame.ipdl | 42 ---- dom/ipc/RemoteFrameChild.cpp | 88 --------- dom/ipc/RemoteFrameChild.h | 57 ------ dom/ipc/RemoteFrameParent.cpp | 119 ------------ dom/ipc/RemoteFrameParent.h | 58 ------ dom/ipc/TabChild.cpp | 13 -- dom/ipc/TabChild.h | 5 - dom/ipc/TabParent.cpp | 34 +--- dom/ipc/TabParent.h | 13 +- dom/ipc/moz.build | 5 - dom/ipc/nsIContentParent.cpp | 2 - dom/ipc/tests/file_dummy.html | 1 - dom/ipc/tests/mochitest.ini | 4 - dom/ipc/tests/test_force_oop_iframe.html | 55 ------ gfx/vr/ipc/PVR.ipdl | 2 +- layout/generic/nsSubDocumentFrame.cpp | 13 +- layout/generic/nsSubDocumentFrame.h | 4 +- layout/ipc/RenderFrame.cpp | 72 ++++--- layout/ipc/RenderFrame.h | 28 ++- modules/libpref/init/all.js | 2 +- .../mochitest/tests/SimpleTest/ChromeTask.js | 179 ------------------ testing/mochitest/tests/SimpleTest/moz.build | 1 - xpcom/ds/StaticAtoms.py | 1 - 26 files changed, 126 insertions(+), 830 deletions(-) delete mode 100644 dom/ipc/PRemoteFrame.ipdl delete mode 100644 dom/ipc/RemoteFrameChild.cpp delete mode 100644 dom/ipc/RemoteFrameChild.h delete mode 100644 dom/ipc/RemoteFrameParent.cpp delete mode 100644 dom/ipc/RemoteFrameParent.h delete mode 100644 dom/ipc/tests/file_dummy.html delete mode 100644 dom/ipc/tests/test_force_oop_iframe.html delete mode 100644 testing/mochitest/tests/SimpleTest/ChromeTask.js diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index d797f0d91f14..728b4d89a45a 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -101,8 +101,6 @@ #include "mozilla/dom/ParentSHistory.h" #include "mozilla/dom/ChildSHistory.h" #include "mozilla/dom/CanonicalBrowsingContext.h" -#include "mozilla/dom/ContentChild.h" -#include "mozilla/dom/RemoteFrameChild.h" #include "mozilla/dom/HTMLBodyElement.h" @@ -351,19 +349,13 @@ nsresult nsFrameLoader::ReallyStartLoadingInternal() { AUTO_PROFILER_LABEL("nsFrameLoader::ReallyStartLoadingInternal", OTHER); if (IsRemoteFrame()) { - if (!mRemoteBrowser && !mRemoteFrameChild && !TryRemoteBrowser()) { + if (!mRemoteBrowser && !TryRemoteBrowser()) { NS_WARNING("Couldn't create child process for iframe."); return NS_ERROR_FAILURE; } - if (mRemoteFrameChild) { - nsAutoCString spec; - mURIToLoad->GetSpec(spec); - Unused << mRemoteFrameChild->SendLoadURL(spec); - } else { - // FIXME get error codes from child - mRemoteBrowser->LoadURL(mURIToLoad); - } + // FIXME get error codes from child + mRemoteBrowser->LoadURL(mURIToLoad); if (!mRemoteBrowserShown) { // This can fail if it's too early to show the frame, we will retry later. @@ -798,7 +790,7 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size, NS_ASSERTION(IsRemoteFrame(), "ShowRemote only makes sense on remote frames."); - if (!mRemoteBrowser && !mRemoteFrameChild && !TryRemoteBrowser()) { + if (!mRemoteBrowser && !TryRemoteBrowser()) { NS_ERROR("Couldn't create child process."); return false; } @@ -817,25 +809,12 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size, return false; } - if (mRemoteFrameChild) { - nsCOMPtr container = - mOwnerContent->OwnerDoc()->GetContainer(); - nsCOMPtr baseWindow = do_QueryInterface(container); - nsCOMPtr mainWidget; - baseWindow->GetMainWidget(getter_AddRefs(mainWidget)); - nsSizeMode sizeMode = - mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal; - - Unused << mRemoteFrameChild->SendShow( - size, ParentWindowIsActive(mOwnerContent->OwnerDoc()), sizeMode); - mRemoteBrowserShown = true; - return true; + RenderFrame* rf = GetCurrentRenderFrame(); + if (!rf) { + return false; } - RenderFrame* rf = - mRemoteBrowser ? mRemoteBrowser->GetRenderFrame() : nullptr; - - if (!rf || !rf->AttachLayerManager()) { + if (!rf->AttachLayerManager()) { // This is just not going to work. return false; } @@ -853,11 +832,7 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size, // Don't show remote iframe if we are waiting for the completion of reflow. if (!aFrame || !(aFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) { - if (mRemoteBrowser) { - mRemoteBrowser->UpdateDimensions(dimensions, size); - } else if (mRemoteFrameChild) { - mRemoteFrameChild->UpdateDimensions(dimensions, size); - } + mRemoteBrowser->UpdateDimensions(dimensions, size); } } @@ -946,11 +921,6 @@ nsresult nsFrameLoader::SwapWithOtherRemoteLoader( return NS_ERROR_NOT_IMPLEMENTED; } - // FIXME: Consider supporting FrameLoader swapping for remote sub frames. - if (mRemoteFrameChild) { - return NS_ERROR_NOT_IMPLEMENTED; - } - if (!mRemoteBrowser || !aOther->mRemoteBrowser) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -1694,11 +1664,6 @@ void nsFrameLoader::DestroyDocShell() { mRemoteBrowser->Destroy(); } - if (mRemoteFrameChild) { - Unused << mRemoteFrameChild->Send__delete__(mRemoteFrameChild); - mRemoteFrameChild = nullptr; - } - // Fire the "unload" event if we're in-process. if (mChildMessageManager) { mChildMessageManager->FireUnloadEvent(); @@ -1740,11 +1705,6 @@ void nsFrameLoader::DestroyComplete() { mRemoteBrowser = nullptr; } - if (mRemoteFrameChild) { - Unused << mRemoteFrameChild->Send__delete__(mRemoteFrameChild); - mRemoteFrameChild = nullptr; - } - if (mMessageManager) { mMessageManager->Disconnect(); } @@ -1774,6 +1734,10 @@ void nsFrameLoader::SetOwnerContent(Element* aContent) { UpdateReflectorGlobal(jsapi.cx(), wrapper, rv); Unused << NS_WARN_IF(rv.Failed()); } + + if (RenderFrame* rfp = GetCurrentRenderFrame()) { + rfp->OwnerContentChanged(aContent); + } } bool nsFrameLoader::OwnerIsMozBrowserFrame() { @@ -1816,13 +1780,6 @@ bool nsFrameLoader::ShouldUseRemoteProcess() { return false; } - // Check if the force fission test attribute is enabled. - if (XRE_IsContentProcess() && - Preferences::GetBool("browser.fission.oopif.attribute", false) && - mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::fission)) { - return true; - } - if (XRE_IsContentProcess() && !(PR_GetEnv("MOZ_NESTED_OOP_TABS") || Preferences::GetBool("dom.ipc.tabs.nested.enabled", false))) { @@ -1844,6 +1801,14 @@ bool nsFrameLoader::ShouldUseRemoteProcess() { nsGkAtoms::_true, eCaseMatters); } +bool nsFrameLoader::IsRemoteFrame() { + if (mRemoteFrame) { + MOZ_ASSERT(!mDocShell, "Found a remote frame with a DocShell"); + return true; + } + return false; +} + static already_AddRefed CreateBrowsingContext( BrowsingContext* aParentContext, BrowsingContext* aOpenerContext, const nsAString& aName, bool aIsContent) { @@ -2310,7 +2275,7 @@ nsresult nsFrameLoader::GetWindowDimensions(nsIntRect& aRect) { nsresult nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame* aIFrame) { if (IsRemoteFrame()) { - if (mRemoteBrowser || mRemoteFrameChild) { + if (mRemoteBrowser) { ScreenIntSize size = aIFrame->GetSubdocumentSize(); // If we were not able to show remote frame before, we should probably // retry now to send correct showInfo. @@ -2320,11 +2285,7 @@ nsresult nsFrameLoader::UpdatePositionAndSize(nsSubDocumentFrame* aIFrame) { nsIntRect dimensions; NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE); mLazySize = size; - if (mRemoteBrowser) { - mRemoteBrowser->UpdateDimensions(dimensions, size); - } else if (mRemoteFrameChild) { - mRemoteFrameChild->UpdateDimensions(dimensions, size); - } + mRemoteBrowser->UpdateDimensions(dimensions, size); } return NS_OK; } @@ -2426,7 +2387,7 @@ static Tuple GetContentParent(Element* aBrowser) { } bool nsFrameLoader::TryRemoteBrowser() { - NS_ASSERTION(!mRemoteBrowser && !mRemoteFrameChild, + NS_ASSERTION(!mRemoteBrowser, "TryRemoteBrowser called with a remote browser already?"); if (!mOwnerContent) { @@ -2472,9 +2433,7 @@ bool nsFrameLoader::TryRemoteBrowser() { // iframes for JS plugins also get to skip these checks. We control the URL // that gets loaded, but the load is triggered from the document containing // the plugin. - // out of process iframes also get to skip this check. - if (!OwnerIsMozBrowserFrame() && !IsForJSPlugin() && - !XRE_IsContentProcess()) { + if (!OwnerIsMozBrowserFrame() && !IsForJSPlugin()) { if (parentDocShell->ItemType() != nsIDocShellTreeItem::typeChrome) { // Allow about:addon an exception to this rule so it can load remote // extension options pages. @@ -2544,14 +2503,6 @@ bool nsFrameLoader::TryRemoteBrowser() { } nsCOMPtr ownerElement = mOwnerContent; - - // If we're in a content process, create a RemoteFrameChild actor. - if (XRE_IsContentProcess()) { - mRemoteFrameChild = RemoteFrameChild::Create( - this, context, NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE)); - return !!mRemoteFrameChild; - } - mRemoteBrowser = ContentParent::CreateBrowser(context, ownerElement, openerContentParent, sameTabGroupAs, nextTabParentId); @@ -2611,24 +2562,15 @@ bool nsFrameLoader::TryRemoteBrowser() { return true; } -bool nsFrameLoader::IsRemoteFrame() { - if (mRemoteFrame) { - MOZ_ASSERT(!mDocShell, "Found a remote frame with a DocShell"); - return true; - } - return false; -} - mozilla::dom::PBrowserParent* nsFrameLoader::GetRemoteBrowser() const { return mRemoteBrowser; } -mozilla::layers::LayersId nsFrameLoader::GetLayersId() const { - MOZ_ASSERT(mRemoteFrame); +RenderFrame* nsFrameLoader::GetCurrentRenderFrame() const { if (mRemoteBrowser) { - return mRemoteBrowser->GetRenderFrame()->GetLayersId(); + return mRemoteBrowser->GetRenderFrame(); } - return mRemoteFrameChild->GetLayersId(); + return nullptr; } void nsFrameLoader::ActivateRemoteFrame(ErrorResult& aRv) { diff --git a/dom/base/nsFrameLoader.h b/dom/base/nsFrameLoader.h index 49d5b1c8a583..6c7775faa887 100644 --- a/dom/base/nsFrameLoader.h +++ b/dom/base/nsFrameLoader.h @@ -24,7 +24,6 @@ #include "mozilla/dom/Element.h" #include "mozilla/dom/ParentSHistory.h" #include "mozilla/Attributes.h" -#include "mozilla/layers/LayersTypes.h" #include "nsStubMutationObserver.h" #include "Units.h" #include "nsIFrame.h" @@ -59,7 +58,6 @@ class ProcessMessageManager; class Promise; class TabParent; class MutableTabContext; -class RemoteFrameChild; namespace ipc { class StructuredCloneData; @@ -272,26 +270,23 @@ class nsFrameLoader final : public nsStubMutationObserver, return mOwnerContent ? mOwnerContent->OwnerDoc() : nullptr; } - /** - * Returns whether this frame is a remote frame. - * - * This is true for either a top-level remote browser in the parent process, - * or a remote subframe in the child process. - */ - bool IsRemoteFrame(); - - /** - * Returns the IPDL actor used if this is a top-level remote browser, or null - * otherwise. - */ PBrowserParent* GetRemoteBrowser() const; /** - * Returns the layers ID that this remote frame is using to render. + * The "current" render frame is the one on which the most recent + * remote layer-tree transaction was executed. If no content has + * been drawn yet, or the remote browser doesn't have any drawn + * content for whatever reason, return nullptr. The returned render + * frame has an associated shadow layer tree. * - * This must only be called if this is a remote frame. + * Note that the returned render frame might not be a frame + * constructed for this->GetURL(). This can happen, e.g., if the + * was just navigated to a new URL, but hasn't painted the + * new page yet. A render frame for the previous page may be + * returned. (In-process behaves similarly, and this + * behavior seems desirable.) */ - mozilla::layers::LayersId GetLayersId() const; + RenderFrame* GetCurrentRenderFrame() const; mozilla::dom::ChromeMessageSender* GetFrameMessageManager() { return mMessageManager; @@ -363,6 +358,11 @@ class nsFrameLoader final : public nsStubMutationObserver, bool ShouldUseRemoteProcess(); + /** + * Return true if the frame is a remote frame. Return false otherwise + */ + bool IsRemoteFrame(); + bool IsForJSPlugin() { return mJSPluginID != nsFakePluginTag::NOT_JSPLUGIN; } /** @@ -456,9 +456,6 @@ class nsFrameLoader final : public nsStubMutationObserver, TabParent* mRemoteBrowser; uint64_t mChildID; - // This is used when this refers to a remote sub frame - RefPtr mRemoteFrameChild; - int32_t mJSPluginID; // Holds the last known size of the frame. diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index b71d12d14aeb..b4c894376090 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -19,7 +19,6 @@ include protocol PFileDescriptorSet; include protocol PIPCBlobInputStream; include protocol PPaymentRequest; include protocol PWindowGlobal; -include protocol PRemoteFrame; include DOMTypes; include IPCBlob; @@ -143,7 +142,6 @@ nested(upto inside_cpow) sync protocol PBrowser manages PPluginWidget; manages PPaymentRequest; manages PWindowGlobal; - manages PRemoteFrame; both: async AsyncMessage(nsString aMessage, CpowEntry[] aCpows, @@ -176,11 +174,6 @@ parent: */ async PWindowGlobal(WindowGlobalInit init); - /** - * Construct a new Remote iframe actor. - */ - async PRemoteFrame(nsString aPresentationURL, nsString aRemoteType); - /** * Sends an NS_NATIVE_CHILD_OF_SHAREABLE_WINDOW to be adopted by the * widget's shareable window on the chrome side. Only used on Windows. diff --git a/dom/ipc/PRemoteFrame.ipdl b/dom/ipc/PRemoteFrame.ipdl deleted file mode 100644 index 963d6925f3f4..000000000000 --- a/dom/ipc/PRemoteFrame.ipdl +++ /dev/null @@ -1,42 +0,0 @@ -/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */ -/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 protocol PBrowser; - -include DOMTypes; - -using ScreenIntSize from "Units.h"; -using nsSizeMode from "nsIWidgetListener.h"; -using mozilla::layers::LayersObserverEpoch from "mozilla/layers/LayersTypes.h"; -using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h"; - -namespace mozilla { -namespace dom { - -/** - * PRemoteFrame corresponds to a remote iframe. - */ -async protocol PRemoteFrame { - manager PBrowser; - -child: - async SetLayersId(LayersId layersId); - -parent: - // Destroy the remote web browser due to the nsFrameLoader going away. - async __delete__(); - - // DocShell messaging. - async LoadURL(nsCString aSpec); - - // Out of process rendering. - async Show(ScreenIntSize size, bool parentIsActive, nsSizeMode sizeMode); - async UpdateDimensions(DimensionInfo dimensions) compressall; - async RenderLayers(bool aEnabled, bool aForceRepaint, LayersObserverEpoch aEpoch); -}; - -} // namespace dom -} // namespace mozilla diff --git a/dom/ipc/RemoteFrameChild.cpp b/dom/ipc/RemoteFrameChild.cpp deleted file mode 100644 index c4a9e6c8ef86..000000000000 --- a/dom/ipc/RemoteFrameChild.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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" - -using namespace mozilla::ipc; - -namespace mozilla { -namespace dom { - -RemoteFrameChild::RemoteFrameChild(nsFrameLoader* aFrameLoader) - : mLayersId{0}, mIPCOpen(true), mFrameLoader(aFrameLoader) {} - -RemoteFrameChild::~RemoteFrameChild() {} - -already_AddRefed RemoteFrameChild::Create( - nsFrameLoader* aFrameLoader, const TabContext& aContext, - const nsString& aRemoteType) { - MOZ_ASSERT(XRE_IsContentProcess()); - - // Determine our embedder's TabChild actor. - RefPtr owner = aFrameLoader->GetOwnerContent(); - MOZ_DIAGNOSTIC_ASSERT(owner); - - nsCOMPtr docShell = do_GetInterface(owner->GetOwnerGlobal()); - MOZ_DIAGNOSTIC_ASSERT(docShell); - - RefPtr tabChild = TabChild::GetFrom(docShell); - MOZ_DIAGNOSTIC_ASSERT(tabChild); - - RefPtr remoteFrame = new RemoteFrameChild(aFrameLoader); - // Reference is freed in TabChild::DeallocPRemoteFrameChild. - tabChild->SendPRemoteFrameConstructor( - do_AddRef(remoteFrame).take(), - PromiseFlatString(aContext.PresentationURL()), aRemoteType); - remoteFrame->mIPCOpen = true; - - return remoteFrame.forget(); -} - -void RemoteFrameChild::UpdateDimensions(const nsIntRect& aRect, - const mozilla::ScreenIntSize& aSize) { - MOZ_DIAGNOSTIC_ASSERT(mIPCOpen); - - RefPtr owner = mFrameLoader->GetOwnerContent(); - nsCOMPtr widget = nsContentUtils::WidgetForContent(owner); - if (!widget) { - widget = nsContentUtils::WidgetForDocument(owner->OwnerDoc()); - } - MOZ_DIAGNOSTIC_ASSERT(widget); - - CSSToLayoutDeviceScale widgetScale = widget->GetDefaultScale(); - - LayoutDeviceIntRect devicePixelRect = ViewAs( - aRect, PixelCastJustification::LayoutDeviceIsScreenForTabDims); - LayoutDeviceIntSize devicePixelSize = ViewAs( - aSize, PixelCastJustification::LayoutDeviceIsScreenForTabDims); - - // XXX What are clientOffset and chromeOffset used for? Are they meaningful - // for nested iframes with transforms? - LayoutDeviceIntPoint clientOffset; - LayoutDeviceIntPoint chromeOffset; - - CSSRect unscaledRect = devicePixelRect / widgetScale; - CSSSize unscaledSize = devicePixelSize / widgetScale; - hal::ScreenOrientation orientation = hal::eScreenOrientation_Default; - DimensionInfo di(unscaledRect, unscaledSize, orientation, clientOffset, - chromeOffset); - - Unused << SendUpdateDimensions(di); -} - -IPCResult RemoteFrameChild::RecvSetLayersId( - const mozilla::layers::LayersId& aLayersId) { - MOZ_ASSERT(!mLayersId.IsValid() && aLayersId.IsValid()); - mLayersId = aLayersId; - return IPC_OK(); -} - -void RemoteFrameChild::ActorDestroy(ActorDestroyReason aWhy) { - mIPCOpen = false; -} - -} // namespace dom -} // namespace mozilla diff --git a/dom/ipc/RemoteFrameChild.h b/dom/ipc/RemoteFrameChild.h deleted file mode 100644 index 4bdbc4dbcbcf..000000000000 --- a/dom/ipc/RemoteFrameChild.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 - -#include "mozilla/dom/PRemoteFrameChild.h" -#include "mozilla/dom/TabChild.h" - -namespace mozilla { -namespace dom { - -/** - * Child side for a remote frame. - */ -class RemoteFrameChild : public PRemoteFrameChild { - public: - NS_INLINE_DECL_REFCOUNTING(RemoteFrameChild); - - TabChild* Manager() { - MOZ_ASSERT(mIPCOpen); - return static_cast(PRemoteFrameChild::Manager()); - } - - mozilla::layers::LayersId GetLayersId() { return mLayersId; } - - static already_AddRefed Create(nsFrameLoader* aFrameLoader, - const TabContext& aContext, - const nsString& aRemoteType); - - void UpdateDimensions(const nsIntRect& aRect, - const mozilla::ScreenIntSize& aSize); - - protected: - friend class PRemoteFrameChild; - - mozilla::ipc::IPCResult RecvSetLayersId( - const mozilla::layers::LayersId& aLayersId); - - void ActorDestroy(ActorDestroyReason aWhy) override; - - private: - explicit RemoteFrameChild(nsFrameLoader* aFrameLoader); - ~RemoteFrameChild(); - - mozilla::layers::LayersId mLayersId; - bool mIPCOpen; - RefPtr mFrameLoader; -}; - -} // namespace dom -} // namespace mozilla - -#endif // !defined(mozilla_dom_RemoteFrameParent_h) diff --git a/dom/ipc/RemoteFrameParent.cpp b/dom/ipc/RemoteFrameParent.cpp deleted file mode 100644 index cfc994e0b1c4..000000000000 --- a/dom/ipc/RemoteFrameParent.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/ContentParent.h" -#include "mozilla/dom/ContentProcessManager.h" - -using namespace mozilla::ipc; -using namespace mozilla::layout; - -namespace mozilla { -namespace dom { - -RemoteFrameParent::RemoteFrameParent() : mIPCOpen(false) {} - -RemoteFrameParent::~RemoteFrameParent() {} - -nsresult RemoteFrameParent::Init(const nsString& aPresentationURL, - const nsString& aRemoteType) { - mIPCOpen = true; - - // FIXME: This should actually use a non-bogus TabContext, probably inherited - // from our Manager(). - OriginAttributes attrs; - attrs.mInIsolatedMozBrowser = false; - attrs.mAppId = nsIScriptSecurityManager::NO_APP_ID; - attrs.SyncAttributesWithPrivateBrowsing(false); - MutableTabContext tabContext; - tabContext.SetTabContext(false, 0, UIStateChangeType_Set, - UIStateChangeType_Set, attrs, aPresentationURL); - - ProcessPriority initialPriority = PROCESS_PRIORITY_FOREGROUND; - - // Get our ConstructorSender object. - RefPtr constructorSender = - ContentParent::GetNewOrUsedBrowserProcess( - nullptr, aRemoteType, initialPriority, nullptr, false); - if (NS_WARN_IF(!constructorSender)) { - MOZ_ASSERT(false, "Unable to allocate content process!"); - return NS_ERROR_FAILURE; - } - - ContentProcessManager* cpm = ContentProcessManager::GetSingleton(); - TabId tabId(nsContentUtils::GenerateTabId()); - cpm->RegisterRemoteFrame(tabId, ContentParentId(0), TabId(0), - tabContext.AsIPCTabContext(), - constructorSender->ChildID()); - - // Construct the TabParent object for our subframe. - uint32_t chromeFlags = 0; - RefPtr tabParent( - new TabParent(constructorSender, tabId, tabContext, chromeFlags)); - - PBrowserParent* browser = constructorSender->SendPBrowserConstructor( - // DeallocPBrowserParent() releases this ref. - tabParent.forget().take(), tabId, TabId(0), tabContext.AsIPCTabContext(), - chromeFlags, constructorSender->ChildID(), - constructorSender->IsForBrowser()); - if (NS_WARN_IF(!browser)) { - MOZ_ASSERT(false, "Browser Constructor Failed"); - return NS_ERROR_FAILURE; - } - - // Set our TabParent object to the newly created browser. - mTabParent = TabParent::GetFrom(browser); - mTabParent->SetOwnerElement(Manager()->GetOwnerElement()); - mTabParent->InitRendering(); - - RenderFrame* rf = mTabParent->GetRenderFrame(); - if (NS_WARN_IF(!rf)) { - MOZ_ASSERT(false, "No RenderFrame"); - return NS_ERROR_FAILURE; - } - - // Send the newly created layers ID back into content. - Unused << SendSetLayersId(rf->GetLayersId()); - return NS_OK; -} - -IPCResult RemoteFrameParent::RecvShow(const ScreenIntSize& aSize, - const bool& aParentIsActive, - const nsSizeMode& aSizeMode) { - RenderFrame* rf = mTabParent->GetRenderFrame(); - if (!rf->AttachLayerManager()) { - MOZ_CRASH(); - } - - Unused << mTabParent->SendShow(aSize, mTabParent->GetShowInfo(), - aParentIsActive, aSizeMode); - return IPC_OK(); -} - -IPCResult RemoteFrameParent::RecvLoadURL(const nsCString& aUrl) { - Unused << mTabParent->SendLoadURL(aUrl, mTabParent->GetShowInfo()); - return IPC_OK(); -} - -IPCResult RemoteFrameParent::RecvUpdateDimensions( - const DimensionInfo& aDimensions) { - Unused << mTabParent->SendUpdateDimensions(aDimensions); - return IPC_OK(); -} - -IPCResult RemoteFrameParent::RecvRenderLayers( - const bool& aEnabled, const bool& aForceRepaint, - const layers::LayersObserverEpoch& aEpoch) { - Unused << mTabParent->SendRenderLayers(aEnabled, aForceRepaint, aEpoch); - return IPC_OK(); -} - -void RemoteFrameParent::ActorDestroy(ActorDestroyReason aWhy) { - mIPCOpen = false; -} - -} // namespace dom -} // namespace mozilla diff --git a/dom/ipc/RemoteFrameParent.h b/dom/ipc/RemoteFrameParent.h deleted file mode 100644 index 159da71f3dbe..000000000000 --- a/dom/ipc/RemoteFrameParent.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* vim: set ts=8 sts=2 et sw=2 tw=80: */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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 - -#include "mozilla/dom/PRemoteFrameParent.h" -#include "mozilla/dom/TabParent.h" - -namespace mozilla { -namespace dom { - -class RemoteFrameParent : public PRemoteFrameParent { - public: - NS_INLINE_DECL_REFCOUNTING(RemoteFrameParent); - - RemoteFrameParent(); - - // Initialize this actor after performing startup. - nsresult Init(const nsString& aPresentationURL, const nsString& aRemoteType); - - TabParent* GetTabParent() { return mTabParent; } - - // Get our manager actor. - TabParent* Manager() { - MOZ_ASSERT(mIPCOpen); - return static_cast(PRemoteFrameParent::Manager()); - } - - protected: - friend class PRemoteFrameParent; - - mozilla::ipc::IPCResult RecvShow(const ScreenIntSize& aSize, - const bool& aParentIsActive, - const nsSizeMode& aSizeMode); - mozilla::ipc::IPCResult RecvLoadURL(const nsCString& aUrl); - mozilla::ipc::IPCResult RecvUpdateDimensions( - const DimensionInfo& aDimensions); - mozilla::ipc::IPCResult RecvRenderLayers(const bool& aEnabled, - const bool& aForceRepaint, - const LayersObserverEpoch& aEpoch); - - void ActorDestroy(ActorDestroyReason aWhy) override; - - private: - ~RemoteFrameParent(); - - RefPtr mTabParent; - bool mIPCOpen; -}; - -} // namespace dom -} // namespace mozilla - -#endif // !defined(mozilla_dom_RemoteFrameParent_h) diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 88e2f5ab11b4..3c3c6a87e612 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -30,7 +30,6 @@ #include "mozilla/dom/PaymentRequestChild.h" #include "mozilla/dom/PBrowser.h" #include "mozilla/dom/WindowProxyHolder.h" -#include "mozilla/dom/RemoteFrameChild.h" #include "mozilla/gfx/CrossProcessPaint.h" #include "mozilla/IMEStateManager.h" #include "mozilla/ipc/URIUtils.h" @@ -3180,18 +3179,6 @@ bool TabChild::DeallocPWindowGlobalChild(PWindowGlobalChild* aActor) { return true; } -PRemoteFrameChild* TabChild::AllocPRemoteFrameChild(const nsString&, - const nsString&) { - MOZ_CRASH("We should never be manually allocating PRemoteFrameChild actors"); - return nullptr; -} - -bool TabChild::DeallocPRemoteFrameChild(PRemoteFrameChild* aActor) { - // This reference was added in RemoteFrameChild::Create. - static_cast(aActor)->Release(); - return true; -} - ScreenIntSize TabChild::GetInnerSize() { LayoutDeviceIntSize innerSize = RoundedToInt(mUnscaledInnerSize * mPuppetWidget->GetDefaultScale()); diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index b174053d772b..34d4f5882862 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -670,11 +670,6 @@ class TabChild final : public TabChildBase, virtual bool DeallocPWindowGlobalChild(PWindowGlobalChild* aActor) override; - virtual PRemoteFrameChild* AllocPRemoteFrameChild( - const nsString& aName, const nsString& aRemoteType) override; - - virtual bool DeallocPRemoteFrameChild(PRemoteFrameChild* aActor) override; - virtual mozilla::ipc::IPCResult RecvDestroy() override; virtual mozilla::ipc::IPCResult RecvSetDocShellIsActive( diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index ecae3f02141b..bff37e57b5eb 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -22,7 +22,6 @@ #include "mozilla/dom/indexedDB/ActorsParent.h" #include "mozilla/dom/IPCBlobUtils.h" #include "mozilla/dom/PaymentRequestParent.h" -#include "mozilla/dom/RemoteFrameParent.h" #include "mozilla/EventStateManager.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/DataSurfaceHelpers.h" @@ -304,10 +303,6 @@ void TabParent::SetOwnerElement(Element* aElement) { Unused << SendSetWidgetNativeData(widgetNativeData); } } - - if (mRenderFrame.IsInitialized()) { - mRenderFrame.OwnerContentChanged(); - } } NS_IMETHODIMP TabParent::GetOwnerElement(Element** aElement) { @@ -621,8 +616,16 @@ void TabParent::LoadURL(nsIURI* aURI) { } void TabParent::InitRendering() { + RefPtr frameLoader = GetFrameLoader(); + MOZ_ASSERT(!mRenderFrame.IsInitialized()); - mRenderFrame.Initialize(this); + MOZ_ASSERT(frameLoader); + + if (!frameLoader) { + return; + } + + mRenderFrame.Initialize(frameLoader); MOZ_ASSERT(mRenderFrame.IsInitialized()); layers::LayersId layersId = mRenderFrame.GetLayersId(); @@ -1012,25 +1015,6 @@ bool TabParent::DeallocPWindowGlobalParent(PWindowGlobalParent* aActor) { return true; } -IPCResult TabParent::RecvPRemoteFrameConstructor(PRemoteFrameParent* aActor, - const nsString& aName, - const nsString& aRemoteType) { - static_cast(aActor)->Init(aName, aRemoteType); - return IPC_OK(); -} - -PRemoteFrameParent* TabParent::AllocPRemoteFrameParent( - const nsString& aName, const nsString& aRemoteType) { - // Reference freed in DeallocPRemoteFrameParent. - return do_AddRef(new RemoteFrameParent()).take(); -} - -bool TabParent::DeallocPRemoteFrameParent(PRemoteFrameParent* aActor) { - // Free reference from AllocPRemoteFrameParent. - static_cast(aActor)->Release(); - return true; -} - void TabParent::SendMouseEvent(const nsAString& aType, float aX, float aY, int32_t aButton, int32_t aClickCount, int32_t aModifiers, diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index 804f66dc21c3..a3bc9b535144 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -316,15 +316,6 @@ class TabParent final : public PBrowserParent, virtual mozilla::ipc::IPCResult RecvPWindowGlobalConstructor( PWindowGlobalParent* aActor, const WindowGlobalInit& aInit) override; - PRemoteFrameParent* AllocPRemoteFrameParent(const nsString& aPresentationURL, - const nsString& aRemoteType); - - bool DeallocPRemoteFrameParent(PRemoteFrameParent* aActor); - - virtual mozilla::ipc::IPCResult RecvPRemoteFrameConstructor( - PRemoteFrameParent* aActor, const nsString& aPresentationURL, - const nsString& aRemoteType) override; - void LoadURL(nsIURI* aURI); void InitRendering(); @@ -558,8 +549,6 @@ class TabParent final : public PBrowserParent, void NavigateByKey(bool aForward, bool aForDocumentNavigation); - ShowInfo GetShowInfo(); - protected: bool ReceiveMessage( const nsString& aMessage, bool aSync, ipc::StructuredCloneData* aData, @@ -728,6 +717,8 @@ class TabParent final : public PBrowserParent, int32_t mActiveSupressDisplayportCount; #endif + ShowInfo GetShowInfo(); + private: // This is used when APZ needs to find the TabParent associated with a layer // to dispatch events. diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build index f848c5485f57..0ebf17a29bdd 100644 --- a/dom/ipc/moz.build +++ b/dom/ipc/moz.build @@ -47,8 +47,6 @@ EXPORTS.mozilla.dom += [ 'nsIContentChild.h', 'nsIContentParent.h', 'PermissionMessageUtils.h', - 'RemoteFrameChild.h', - 'RemoteFrameParent.h', 'TabChild.h', 'TabContext.h', 'TabMessageUtils.h', @@ -88,8 +86,6 @@ UNIFIED_SOURCES += [ 'PermissionMessageUtils.cpp', 'PreallocatedProcessManager.cpp', 'ProcessPriorityManager.cpp', - 'RemoteFrameChild.cpp', - 'RemoteFrameParent.cpp', 'SharedMap.cpp', 'SharedStringMap.cpp', 'StructuredCloneData.cpp', @@ -124,7 +120,6 @@ IPDL_SOURCES += [ 'PPluginWidget.ipdl', 'PProcessHangMonitor.ipdl', 'PrefsTypes.ipdlh', - 'PRemoteFrame.ipdl', 'PTabContext.ipdlh', 'PURLClassifier.ipdl', 'PURLClassifierInfo.ipdlh', diff --git a/dom/ipc/nsIContentParent.cpp b/dom/ipc/nsIContentParent.cpp index 1e5eec307225..850a5d427b44 100644 --- a/dom/ipc/nsIContentParent.cpp +++ b/dom/ipc/nsIContentParent.cpp @@ -20,7 +20,6 @@ #include "mozilla/jsipc/CrossProcessObjectWrappers.h" #include "mozilla/ipc/FileDescriptorSetParent.h" #include "mozilla/ipc/PFileDescriptorSetParent.h" -#include "mozilla/ipc/PIPCBlobInputStreamParent.h" #include "mozilla/ipc/IPCStreamAlloc.h" #include "mozilla/ipc/IPCStreamDestination.h" #include "mozilla/ipc/IPCStreamSource.h" @@ -31,7 +30,6 @@ #include "nsPrintfCString.h" #include "xpcpublic.h" -using namespace mozilla::ipc; using namespace mozilla::jsipc; // XXX need another bug to move this to a common header. diff --git a/dom/ipc/tests/file_dummy.html b/dom/ipc/tests/file_dummy.html deleted file mode 100644 index 41de16a74957..000000000000 --- a/dom/ipc/tests/file_dummy.html +++ /dev/null @@ -1 +0,0 @@ -

This is a dummy file!

diff --git a/dom/ipc/tests/mochitest.ini b/dom/ipc/tests/mochitest.ini index ec86dbbb6ab5..79142013f790 100644 --- a/dom/ipc/tests/mochitest.ini +++ b/dom/ipc/tests/mochitest.ini @@ -23,7 +23,3 @@ support-files = !/dom/canvas/test/captureStream_common.js [test_Preallocated.html] skip-if = !e10s -[test_force_oop_iframe.html] -skip-if = !e10s || webrender # oop-iframes trigger a debug assertion in webrender picture caching -support-files = - file_dummy.html diff --git a/dom/ipc/tests/test_force_oop_iframe.html b/dom/ipc/tests/test_force_oop_iframe.html deleted file mode 100644 index df86a0faebb3..000000000000 --- a/dom/ipc/tests/test_force_oop_iframe.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - diff --git a/gfx/vr/ipc/PVR.ipdl b/gfx/vr/ipc/PVR.ipdl index 17a6259f9deb..f99e55b7cbee 100644 --- a/gfx/vr/ipc/PVR.ipdl +++ b/gfx/vr/ipc/PVR.ipdl @@ -4,7 +4,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ using mozilla::TimeStamp from "mozilla/TimeStamp.h"; -using mozilla::gfx::OpenVRControllerType from "VRMessageUtils.h"; +using mozilla::gfx::OpenVRControllerType from "gfxVR.h"; using mozilla::dom::NativeThreadId from "mozilla/dom/TabMessageUtils.h"; include GraphicsMessages; diff --git a/layout/generic/nsSubDocumentFrame.cpp b/layout/generic/nsSubDocumentFrame.cpp index 7bd5cd62bde5..25bdb4648a97 100644 --- a/layout/generic/nsSubDocumentFrame.cpp +++ b/layout/generic/nsSubDocumentFrame.cpp @@ -301,7 +301,10 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, if (!IsVisibleForPainting()) return; nsFrameLoader* frameLoader = FrameLoader(); - bool isRemoteFrame = frameLoader && frameLoader->IsRemoteFrame(); + RenderFrame* rf = nullptr; + if (frameLoader) { + rf = frameLoader->GetCurrentRenderFrame(); + } // If we are pointer-events:none then we don't need to HitTest background bool pointerEventsNone = @@ -309,7 +312,7 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, if (!aBuilder->IsForEventDelivery() || !pointerEventsNone) { nsDisplayListCollection decorations(aBuilder); DisplayBorderBackgroundOutline(aBuilder, decorations); - if (isRemoteFrame) { + if (rf) { // Wrap background colors of