From b73d131e8846ea55bab7bb2d1a6e40c7627d9b4a Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Thu, 31 Mar 2016 00:58:05 -0400 Subject: [PATCH] Bug 1251032 - Send RenderFrame info down to child in BrowserFrameOpenWindow. r=kanru MozReview-Commit-ID: LsFr95rujEJ --HG-- extra : rebase_source : 3589facedf84f6d46890de002a48207907e50476 --- dom/browser-element/BrowserElementParent.cpp | 15 ++++++++++++++- dom/browser-element/BrowserElementParent.h | 13 ++++++++++++- dom/ipc/ContentChild.cpp | 5 +++-- dom/ipc/PBrowser.ipdl | 8 +++++--- dom/ipc/TabParent.cpp | 8 ++++++-- dom/ipc/TabParent.h | 5 ++++- 6 files changed, 44 insertions(+), 10 deletions(-) diff --git a/dom/browser-element/BrowserElementParent.cpp b/dom/browser-element/BrowserElementParent.cpp index 6448de1303ab..2ca34323c313 100644 --- a/dom/browser-element/BrowserElementParent.cpp +++ b/dom/browser-element/BrowserElementParent.cpp @@ -23,9 +23,12 @@ #include "nsVariant.h" #include "mozilla/dom/BrowserElementDictionariesBinding.h" #include "mozilla/dom/CustomEvent.h" +#include "mozilla/layout/RenderFrameParent.h" using namespace mozilla; using namespace mozilla::dom; +using namespace mozilla::layers; +using namespace mozilla::layout; namespace { @@ -205,9 +208,12 @@ BrowserElementParent::DispatchOpenWindowEvent(Element* aOpenerFrameElement, BrowserElementParent::OpenWindowResult BrowserElementParent::OpenWindowOOP(TabParent* aOpenerTabParent, TabParent* aPopupTabParent, + PRenderFrameParent* aRenderFrame, const nsAString& aURL, const nsAString& aName, - const nsAString& aFeatures) + const nsAString& aFeatures, + TextureFactoryIdentifier* aTextureFactoryIdentifier, + uint64_t* aLayersId) { // Create an iframe owned by the same document which owns openerFrameElement. nsCOMPtr openerFrameElement = aOpenerTabParent->GetOwnerElement(); @@ -241,6 +247,13 @@ BrowserElementParent::OpenWindowOOP(TabParent* aOpenerTabParent, aPopupTabParent->SetOwnerElement(popupFrameElement); popupFrameElement->AllowCreateFrameLoader(); popupFrameElement->CreateRemoteFrameLoader(aPopupTabParent); + + RenderFrameParent* rfp = static_cast(aRenderFrame); + if (!aPopupTabParent->SetRenderFrame(rfp) || + !aPopupTabParent->GetRenderFrameInfo(aTextureFactoryIdentifier, aLayersId)) { + return BrowserElementParent::OPEN_WINDOW_IGNORED; + } + return opened; } diff --git a/dom/browser-element/BrowserElementParent.h b/dom/browser-element/BrowserElementParent.h index e6664e131202..a5f5a886e98d 100644 --- a/dom/browser-element/BrowserElementParent.h +++ b/dom/browser-element/BrowserElementParent.h @@ -22,6 +22,14 @@ namespace dom { class TabParent; } // namespace dom +namespace layers { +struct TextureFactoryIdentifier; +} // namespace layers + +namespace layout { +class PRenderFrameParent; +} // namespace layout + /** * BrowserElementParent implements a portion of the parent-process side of *