author | Mike Conley <mconley@mozilla.com> |
Tue, 29 Mar 2016 14:32:41 -0400 | |
changeset 291882 | 31f191d9708903fe6403539e4b7ace0f7551f2f5 |
parent 291881 | 736edb6b89247066c7131852e965bb4ca3986695 |
child 291883 | 5acaba393ffe9aed0d0d28c386e7d9f190fa52fd |
push id | 74708 |
push user | mconley@mozilla.com |
push date | Wed, 06 Apr 2016 13:24:03 +0000 |
treeherder | mozilla-inbound@5acaba393ffe [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kanru |
bugs | 1251032 |
milestone | 48.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -847,16 +847,20 @@ ContentChild::ProvideWindowCommon(TabChi url.SetIsVoid(true); } nsString name(aName); nsAutoCString features(aFeatures); nsTArray<FrameScriptInfo> frameScripts; nsCString urlToLoad; + PRenderFrameChild* renderFrame = newChild->SendPRenderFrameConstructor(); + TextureFactoryIdentifier textureFactoryIdentifier; + uint64_t layersId = 0; + if (aIframeMoz) { MOZ_ASSERT(aTabOpener); newChild->SendBrowserFrameOpenWindow(aTabOpener, NS_ConvertUTF8toUTF16(url), name, NS_ConvertUTF8toUTF16(features), aWindowIsNew); } else { nsAutoCString baseURIString; if (aTabOpener) { @@ -880,47 +884,47 @@ ContentChild::ProvideWindowCommon(TabChi nsCOMPtr<nsIContentViewer> cv; openerDocShell->GetContentViewer(getter_AddRefs(cv)); if (cv) { cv->GetFullZoom(&fullZoom); } } nsresult rv; - if (!SendCreateWindow(aTabOpener, newChild, + if (!SendCreateWindow(aTabOpener, newChild, renderFrame, aChromeFlags, aCalledFromJS, aPositionSpecified, aSizeSpecified, url, name, features, baseURIString, openerDocShell ? openerDocShell->GetOriginAttributes() : DocShellOriginAttributes(), fullZoom, &rv, aWindowIsNew, &frameScripts, - &urlToLoad)) { + &urlToLoad, + &textureFactoryIdentifier, + &layersId)) { + PRenderFrameChild::Send__delete__(renderFrame); return NS_ERROR_NOT_AVAILABLE; } if (NS_FAILED(rv)) { + PRenderFrameChild::Send__delete__(renderFrame); + PBrowserChild::Send__delete__(newChild); return rv; } } if (!*aWindowIsNew) { + PRenderFrameChild::Send__delete__(renderFrame); PBrowserChild::Send__delete__(newChild); return NS_ERROR_ABORT; } - TextureFactoryIdentifier textureFactoryIdentifier; - uint64_t layersId = 0; - PRenderFrameChild* renderFrame = newChild->SendPRenderFrameConstructor(); - newChild->SendGetRenderFrameInfo(renderFrame, - &textureFactoryIdentifier, - &layersId); if (layersId == 0) { // if renderFrame is invalid. PRenderFrameChild::Send__delete__(renderFrame); renderFrame = nullptr; } ShowInfo showInfo(EmptyString(), false, false, true, 0, 0); auto* opener = nsPIDOMWindowOuter::From(aParent); nsIDocShell* openerShell;
--- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -83,16 +83,17 @@ #include "mozilla/ipc/PFileDescriptorSetParent.h" #include "mozilla/ipc/TestShellParent.h" #include "mozilla/ipc/InputStreamUtils.h" #include "mozilla/jsipc/CrossProcessObjectWrappers.h" #include "mozilla/layers/PAPZParent.h" #include "mozilla/layers/CompositorBridgeParent.h" #include "mozilla/layers/ImageBridgeParent.h" #include "mozilla/layers/SharedBufferManagerParent.h" +#include "mozilla/layout/RenderFrameParent.h" #include "mozilla/LookAndFeel.h" #include "mozilla/media/MediaParent.h" #include "mozilla/Move.h" #include "mozilla/net/NeckoParent.h" #include "mozilla/plugins/PluginBridge.h" #include "mozilla/Preferences.h" #include "mozilla/ProcessHangMonitor.h" #include "mozilla/ProcessHangMonitorIPC.h" @@ -298,16 +299,17 @@ using namespace mozilla::dom::mobilemess using namespace mozilla::dom::telephony; using namespace mozilla::dom::voicemail; using namespace mozilla::media; using namespace mozilla::embedding; using namespace mozilla::gmp; using namespace mozilla::hal; using namespace mozilla::ipc; using namespace mozilla::layers; +using namespace mozilla::layout; using namespace mozilla::net; using namespace mozilla::jsipc; using namespace mozilla::psm; using namespace mozilla::widget; // XXX Workaround for bug 986973 to maintain the existing broken semantics template<> struct nsIConsoleService::COMTypeInfo<nsConsoleService, void> { @@ -5327,30 +5329,33 @@ ContentParent::DeallocPWebBrowserPersist { delete aActor; return true; } bool ContentParent::RecvCreateWindow(PBrowserParent* aThisTab, PBrowserParent* aNewTab, + PRenderFrameParent* aRenderFrame, const uint32_t& aChromeFlags, const bool& aCalledFromJS, const bool& aPositionSpecified, const bool& aSizeSpecified, const nsCString& aURI, const nsString& aName, const nsCString& aFeatures, const nsCString& aBaseURI, const DocShellOriginAttributes& aOpenerOriginAttributes, const float& aFullZoom, nsresult* aResult, bool* aWindowIsNew, InfallibleTArray<FrameScriptInfo>* aFrameScripts, - nsCString* aURLToLoad) + nsCString* aURLToLoad, + TextureFactoryIdentifier* aTextureFactoryIdentifier, + uint64_t* aLayersId) { // We always expect to open a new window here. If we don't, it's an error. *aWindowIsNew = true; // The content process should never be in charge of computing whether or // not a window should be private or remote - the parent will do that. const uint32_t badFlags = nsIWebBrowserChrome::CHROME_PRIVATE_WINDOW @@ -5452,16 +5457,23 @@ ContentParent::RecvCreateWindow(PBrowser openLocation, nsIBrowserDOMWindow::OPEN_NEW, getter_AddRefs(frameLoaderOwner)); if (!frameLoaderOwner) { *aWindowIsNew = false; } newTab->SwapFrameScriptsFrom(*aFrameScripts); + + RenderFrameParent* rfp = static_cast<RenderFrameParent*>(aRenderFrame); + if (!newTab->SetRenderFrame(rfp) || + !newTab->GetRenderFrameInfo(aTextureFactoryIdentifier, aLayersId)) { + *aResult = NS_ERROR_FAILURE; + } + return true; } // WindowWatcher is going to expect a valid URI to open a window // to. If it can't find one, it's going to attempt to figure one // out on its own, which is problematic because it can't access // the document for the remote browser we're opening. Luckily, // TabChild has sent us a baseURI with which we can ensure that @@ -5531,16 +5543,23 @@ ContentParent::RecvCreateWindow(PBrowser if (NS_WARN_IF(NS_FAILED(*aResult))) { return true; } MOZ_ASSERT(TabParent::GetFrom(newRemoteTab) == newTab); newTab->SwapFrameScriptsFrom(*aFrameScripts); + + RenderFrameParent* rfp = static_cast<RenderFrameParent*>(aRenderFrame); + if (!newTab->SetRenderFrame(rfp) || + !newTab->GetRenderFrameInfo(aTextureFactoryIdentifier, aLayersId)) { + *aResult = NS_ERROR_FAILURE; + } + return true; } /* static */ bool ContentParent::PermissionManagerAddref(const ContentParentId& aCpId, const TabId& aTabId) { MOZ_ASSERT(XRE_IsParentProcess(),
--- a/dom/ipc/ContentParent.h +++ b/dom/ipc/ContentParent.h @@ -58,18 +58,23 @@ class TestShellParent; namespace jsipc { class PJavaScriptParent; } // namespace jsipc namespace layers { class PCompositorBridgeParent; class PSharedBufferManagerParent; +struct TextureFactoryIdentifier; } // namespace layers +namespace layout { +class PRenderFrameParent; +} // namespace layout + namespace dom { class Element; class TabParent; class PStorageParent; class ClonedMessageData; class MemoryReport; class TabContext; @@ -492,30 +497,33 @@ public: bool HasGamepadListener() const { return mHasGamepadListener; } void SetNuwaParent(NuwaParent* aNuwaParent) { mNuwaParent = aNuwaParent; } void ForkNewProcess(bool aBlocking); virtual bool RecvCreateWindow(PBrowserParent* aThisTabParent, PBrowserParent* aOpener, + layout::PRenderFrameParent* aRenderFrame, const uint32_t& aChromeFlags, const bool& aCalledFromJS, const bool& aPositionSpecified, const bool& aSizeSpecified, const nsCString& aURI, const nsString& aName, const nsCString& aFeatures, const nsCString& aBaseURI, const DocShellOriginAttributes& aOpenerOriginAttributes, const float& aFullZoom, nsresult* aResult, bool* aWindowIsNew, InfallibleTArray<FrameScriptInfo>* aFrameScripts, - nsCString* aURLToLoad) override; + nsCString* aURLToLoad, + layers::TextureFactoryIdentifier* aTextureFactoryIdentifier, + uint64_t* aLayersId) override; static bool AllocateLayerTreeId(TabParent* aTabParent, uint64_t* aId); protected: void OnChannelConnected(int32_t pid) override; virtual void ActorDestroy(ActorDestroyReason why) override;
--- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -478,20 +478,16 @@ parent: * Child informs the parent that the graphics objects are ready for * compositing. This is sent when all pending changes have been * sent to the compositor and are ready to be shown on the next composite. * @see PCompositor * @see RequestNotifyAfterRemotePaint */ async RemotePaintIsReady(); - sync GetRenderFrameInfo(PRenderFrame aRenderFrame) - returns (TextureFactoryIdentifier textureFactoryIdentifier, - uint64_t layersId); - /** * Sent by the child to the parent to inform it that an update to the * dimensions has been requested, likely through win.moveTo or resizeTo */ async SetDimensions(uint32_t aFlags, int32_t aX, int32_t aY, int32_t aCx, int32_t aCy); prio(high) sync DispatchWheelEvent(WidgetWheelEvent event); prio(high) sync DispatchMouseEvent(WidgetMouseEvent event);
--- a/dom/ipc/PContent.ipdl +++ b/dom/ipc/PContent.ipdl @@ -37,16 +37,17 @@ include protocol PNecko; // PContent and PPluginModule it seems to think that PContent's parent and // child live in the same process! include protocol PGMPContent; include protocol PGMPService; include protocol PPluginModule; include protocol PGMP; include protocol PPrinting; include protocol POfflineCacheUpdate; +include protocol PRenderFrame; include protocol PScreenManager; include protocol PSharedBufferManager; include protocol PSms; include protocol PSpeechSynthesis; include protocol PStorage; include protocol PTelephony; include protocol PTestShell; include protocol PVoicemail; @@ -90,16 +91,17 @@ using mozilla::dom::NativeThreadId from using mozilla::hal::ProcessPriority from "mozilla/HalTypes.h"; using mozilla::gfx::IntSize from "mozilla/gfx/2D.h"; using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h"; using mozilla::dom::ContentParentId from "mozilla/dom/ipc/IdType.h"; using struct LookAndFeelInt from "mozilla/widget/WidgetMessageUtils.h"; using class mozilla::dom::ipc::StructuredCloneData from "ipc/IPCMessageUtils.h"; using mozilla::DataStorageType from "ipc/DataStorageIPCUtils.h"; using mozilla::DocShellOriginAttributes from "mozilla/ipc/BackgroundUtils.h"; +using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h"; union ChromeRegistryItem { ChromePackage; OverrideMapping; SubstitutionMapping; }; @@ -1168,30 +1170,33 @@ parent: /** * Request graphics initialization information from the parent. */ sync GetGraphicsDeviceInitData() returns (DeviceInitData aData); sync CreateWindow(nullable PBrowser aThisTab, PBrowser aNewTab, + PRenderFrame aRenderFrame, uint32_t aChromeFlags, bool aCalledFromJS, bool aPositionSpecified, bool aSizeSpecified, nsCString aURI, nsString aName, nsCString aFeatures, nsCString aBaseURI, DocShellOriginAttributes aOpenerOriginAttributes, float aFullZoom) returns (nsresult rv, bool windowOpened, FrameScriptInfo[] frameScripts, - nsCString urlToLoad); + nsCString urlToLoad, + TextureFactoryIdentifier textureFactoryIdentifier, + uint64_t layersId); sync GetDeviceStorageLocation(nsString type) returns (nsString path); sync GetDeviceStorageLocations() returns (DeviceStorageLocationInfo info); sync GetAndroidSystemInfo()
--- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -884,30 +884,34 @@ TabParent::Show(const ScreenIntSize& siz if (mIsDestroyed) { return; } TextureFactoryIdentifier textureFactoryIdentifier; uint64_t layersId = 0; bool success = false; RenderFrameParent* renderFrame = nullptr; - // If TabParent is initialized by parent side then the RenderFrame must also - // be created here. If TabParent is initialized by child side, - // child side will create RenderFrame. - MOZ_ASSERT(!GetRenderFrame()); if (IsInitedByParent()) { + // If TabParent is initialized by parent side then the RenderFrame must also + // be created here. If TabParent is initialized by child side, + // child side will create RenderFrame. + MOZ_ASSERT(!GetRenderFrame()); RefPtr<nsFrameLoader> frameLoader = GetFrameLoader(); if (frameLoader) { renderFrame = new RenderFrameParent(frameLoader, &success); MOZ_ASSERT(success); layersId = renderFrame->GetLayersId(); renderFrame->GetTextureFactoryIdentifier(&textureFactoryIdentifier); AddTabParentToTable(layersId, this); Unused << SendPRenderFrameConstructor(renderFrame); } + } else { + // Otherwise, the child should have constructed the RenderFrame, + // and we should already know about it. + MOZ_ASSERT(GetRenderFrame()); } nsCOMPtr<nsISupports> container = mFrameElement->OwnerDoc()->GetContainer(); nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(container); nsCOMPtr<nsIWidget> mainWidget; baseWindow->GetMainWidget(getter_AddRefs(mainWidget)); mSizeMode = mainWidget ? mainWidget->SizeMode() : nsSizeMode_Normal; @@ -2573,33 +2577,60 @@ TabParent::AllocPRenderFrameParent() bool TabParent::DeallocPRenderFrameParent(PRenderFrameParent* aFrame) { delete aFrame; return true; } bool -TabParent::RecvGetRenderFrameInfo(PRenderFrameParent* aRenderFrame, - TextureFactoryIdentifier* aTextureFactoryIdentifier, - uint64_t* aLayersId) +TabParent::SetRenderFrame(PRenderFrameParent* aRFParent) { - RenderFrameParent* renderFrame = static_cast<RenderFrameParent*>(aRenderFrame); - renderFrame->GetTextureFactoryIdentifier(aTextureFactoryIdentifier); - *aLayersId = renderFrame->GetLayersId(); + if (IsInitedByParent()) { + return false; + } + + RefPtr<nsFrameLoader> frameLoader = GetFrameLoader(); + + if (!frameLoader) { + return false; + } + + RenderFrameParent* renderFrame = static_cast<RenderFrameParent*>(aRFParent); + bool success = renderFrame->Init(frameLoader); + if (!success) { + return false; + } + + uint64_t layersId = renderFrame->GetLayersId(); + AddTabParentToTable(layersId, this); if (mNeedLayerTreeReadyNotification) { RequestNotifyLayerTreeReady(); mNeedLayerTreeReadyNotification = false; } return true; } bool +TabParent::GetRenderFrameInfo(TextureFactoryIdentifier* aTextureFactoryIdentifier, + uint64_t* aLayersId) +{ + RenderFrameParent* rfp = GetRenderFrame(); + if (!rfp) { + return false; + } + + *aLayersId = rfp->GetLayersId(); + rfp->GetTextureFactoryIdentifier(aTextureFactoryIdentifier); + return true; +} + +bool TabParent::RecvAudioChannelActivityNotification(const uint32_t& aAudioChannel, const bool& aActive) { if (aAudioChannel >= NUMBER_OF_AUDIO_CHANNELS) { return false; } nsCOMPtr<nsIObserverService> os = services::GetObserverService(); @@ -2912,17 +2943,17 @@ class LayerTreeUpdateObserver : public C NS_DispatchToMainThread(runnable); } }; bool TabParent::RequestNotifyLayerTreeReady() { RenderFrameParent* frame = GetRenderFrame(); - if (!frame) { + if (!frame || !frame->IsInitted()) { mNeedLayerTreeReadyNotification = true; } else { CompositorBridgeParent::RequestNotifyLayerTreeReady( frame->GetLayersId(), new LayerTreeUpdateObserver()); } return true; }
--- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -545,16 +545,19 @@ public: // reload the URI associated with the given channel. void OnStartSignedPackageRequest(nsIChannel* aChannel, const nsACString& aPackageId); void AudioChannelChangeNotification(nsPIDOMWindowOuter* aWindow, AudioChannel aAudioChannel, float aVolume, bool aMuted); + bool SetRenderFrame(PRenderFrameParent* aRFParent); + bool GetRenderFrameInfo(TextureFactoryIdentifier* aTextureFactoryIdentifier, + uint64_t* aLayersId); protected: bool ReceiveMessage(const nsString& aMessage, bool aSync, ipc::StructuredCloneData* aData, mozilla::jsipc::CpowHolder* aCpows, nsIPrincipal* aPrincipal, nsTArray<ipc::StructuredCloneData>* aJSONRetVal = nullptr); @@ -571,20 +574,16 @@ protected: nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow; virtual PRenderFrameParent* AllocPRenderFrameParent() override; virtual bool DeallocPRenderFrameParent(PRenderFrameParent* aFrame) override; virtual bool RecvRemotePaintIsReady() override; - virtual bool RecvGetRenderFrameInfo(PRenderFrameParent* aRenderFrame, - TextureFactoryIdentifier* aTextureFactoryIdentifier, - uint64_t* aLayersId) override; - virtual bool RecvSetDimensions(const uint32_t& aFlags, const int32_t& aX, const int32_t& aY, const int32_t& aCx, const int32_t& aCy) override; virtual bool RecvAudioChannelActivityNotification(const uint32_t& aAudioChannel, const bool& aActive) override; bool InitBrowserConfiguration(const nsCString& aURI,