Backed out changeset 867fcd3e181d (bug 1350634) for leaking in sessionstore's browser-chrome tests

MozReview-Commit-ID: 7NS2GkfZSp0
This commit is contained in:
Phil Ringnalda 2017-04-30 21:14:10 -07:00
parent d7a1f66c55
commit 6b129efd40
13 changed files with 42 additions and 45 deletions

View File

@ -35,7 +35,6 @@
#include "mozilla/layers/IAPZCTreeManager.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/PLayerTransactionChild.h"
#include "mozilla/layers/ShadowLayers.h"
#include "mozilla/layers/WebRenderLayerManager.h"
#include "mozilla/layout/RenderFrameChild.h"
@ -2711,9 +2710,11 @@ TabChild::InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIden
if (lf) {
nsTArray<LayersBackend> backends;
backends.AppendElement(mTextureFactoryIdentifier.mParentBackend);
bool success;
PLayerTransactionChild* shadowManager =
compositorChild->SendPLayerTransactionConstructor(backends, aLayersId);
if (shadowManager) {
compositorChild->SendPLayerTransactionConstructor(backends,
aLayersId, &mTextureFactoryIdentifier, &success);
if (shadowManager && success) {
lf->SetShadowManager(shadowManager);
lf->IdentifyTextureHost(mTextureFactoryIdentifier);
ImageBridgeChild::IdentifyCompositorTextureHost(mTextureFactoryIdentifier);
@ -3096,20 +3097,20 @@ TabChild::ReinitRendering()
wr::AsPipelineId(mLayersId),
&mTextureFactoryIdentifier);
} else {
bool success = false;
bool success;
nsTArray<LayersBackend> ignored;
PLayerTransactionChild* shadowManager = cb->SendPLayerTransactionConstructor(ignored, LayersId());
if (shadowManager &&
shadowManager->SendGetTextureFactoryIdentifier(&mTextureFactoryIdentifier) &&
mTextureFactoryIdentifier.mParentBackend != LayersBackend::LAYERS_NONE)
{
success = true;
}
PLayerTransactionChild* shadowManager =
cb->SendPLayerTransactionConstructor(ignored, LayersId(), &mTextureFactoryIdentifier, &success);
if (!success) {
NS_WARNING("failed to re-allocate layer transaction");
return;
}
if (!shadowManager) {
NS_WARNING("failed to re-construct LayersChild");
return;
}
RefPtr<LayerManager> lm = mPuppetWidget->RecreateLayerManager(shadowManager);
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
lf->IdentifyTextureHost(mTextureFactoryIdentifier);

View File

@ -330,7 +330,9 @@ CompositorBridgeChild::CompositorIsInGPUProcess()
PLayerTransactionChild*
CompositorBridgeChild::AllocPLayerTransactionChild(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId)
const uint64_t& aId,
TextureFactoryIdentifier*,
bool*)
{
LayerTransactionChild* c = new LayerTransactionChild(aId);
c->AddIPDLReference();

View File

@ -248,7 +248,9 @@ private:
virtual PLayerTransactionChild*
AllocPLayerTransactionChild(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId) override;
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool* aSuccess) override;
virtual bool DeallocPLayerTransactionChild(PLayerTransactionChild *aChild) override;

View File

@ -1437,7 +1437,9 @@ CompositorBridgeParent::NewCompositor(const nsTArray<LayersBackend>& aBackendHin
PLayerTransactionParent*
CompositorBridgeParent::AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId)
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool *aSuccess)
{
MOZ_ASSERT(aId == 0);
@ -1445,13 +1447,16 @@ CompositorBridgeParent::AllocPLayerTransactionParent(const nsTArray<LayersBacken
if (!mLayerManager) {
NS_WARNING("Failed to initialise Compositor");
*aSuccess = false;
LayerTransactionParent* p = new LayerTransactionParent(nullptr, this, 0);
p->AddIPDLReference();
return p;
}
mCompositionManager = new AsyncCompositionManager(this, mLayerManager);
*aSuccess = true;
*aTextureFactoryIdentifier = mLayerManager->GetTextureFactoryIdentifier();
LayerTransactionParent* p = new LayerTransactionParent(mLayerManager, this, 0);
p->AddIPDLReference();
return p;

View File

@ -510,7 +510,9 @@ protected:
virtual PLayerTransactionParent*
AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId) override;
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool* aSuccess) override;
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) override;
virtual void ScheduleTask(already_AddRefed<CancelableRunnable>, int);

View File

@ -62,7 +62,9 @@ CrossProcessCompositorBridgeParent::ActorDestroy(ActorDestroyReason aWhy)
PLayerTransactionParent*
CrossProcessCompositorBridgeParent::AllocPLayerTransactionParent(
const nsTArray<LayersBackend>&,
const uint64_t& aId)
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool *aSuccess)
{
MOZ_ASSERT(aId != 0);
@ -83,6 +85,8 @@ CrossProcessCompositorBridgeParent::AllocPLayerTransactionParent(
if (state && state->mLayerManager) {
state->mCrossProcessParent = this;
HostLayerManager* lm = state->mLayerManager;
*aTextureFactoryIdentifier = lm->GetCompositor()->GetTextureFactoryIdentifier();
*aSuccess = true;
LayerTransactionParent* p = new LayerTransactionParent(lm, this, aId);
p->AddIPDLReference();
sIndirectLayerTrees[aId].mLayerTree = p;
@ -93,6 +97,7 @@ CrossProcessCompositorBridgeParent::AllocPLayerTransactionParent(
}
NS_WARNING("Created child without a matching parent?");
*aSuccess = false;
LayerTransactionParent* p = new LayerTransactionParent(nullptr, this, aId);
p->AddIPDLReference();
return p;

View File

@ -91,7 +91,9 @@ public:
virtual PLayerTransactionParent*
AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId) override;
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool *aSuccess) override;
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) override;

View File

@ -1053,17 +1053,5 @@ LayerTransactionParent::RecvRecordPaintTimes(const PaintTiming& aTiming)
return IPC_OK();
}
mozilla::ipc::IPCResult
LayerTransactionParent::RecvGetTextureFactoryIdentifier(TextureFactoryIdentifier* aIdentifier)
{
if (!mLayerManager) {
// Default constructor sets mParentBackend to LAYERS_NONE.
return IPC_OK();
}
*aIdentifier = mLayerManager->GetTextureFactoryIdentifier();
return IPC_OK();
}
} // namespace layers
} // namespace mozilla

View File

@ -141,7 +141,6 @@ protected:
virtual mozilla::ipc::IPCResult RecvSetConfirmedTargetAPZC(const uint64_t& aBlockId,
nsTArray<ScrollableLayerGuid>&& aTargets) override;
virtual mozilla::ipc::IPCResult RecvRecordPaintTimes(const PaintTiming& aTiming) override;
virtual mozilla::ipc::IPCResult RecvGetTextureFactoryIdentifier(TextureFactoryIdentifier* aIdentifier) override;
bool SetLayerAttributes(const OpSetLayerAttributes& aOp);

View File

@ -218,7 +218,8 @@ parent:
// layersBackendHints is an ordered list of preffered backends where
// layersBackendHints[0] is the best backend. If any hints are LayersBackend::LAYERS_NONE
// that hint is ignored.
async PLayerTransaction(LayersBackend[] layersBackendHints, uint64_t id);
sync PLayerTransaction(LayersBackend[] layersBackendHints, uint64_t id)
returns (TextureFactoryIdentifier textureFactoryIdentifier, bool success);
// Notify the compositor that a region of the screen has been invalidated.
async NotifyRegionInvalidated(nsIntRegion region);

View File

@ -18,7 +18,6 @@ using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
using class mozilla::layers::APZTestData from "mozilla/layers/APZTestData.h";
using mozilla::layers::FrameMetrics::ViewID from "FrameMetrics.h";
using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
using mozilla::layers::LayersBackend from "mozilla/layers/LayersTypes.h";
using mozilla::layers::LayerHandle from "mozilla/layers/LayersTypes.h";
using mozilla::layers::CompositableHandle from "mozilla/layers/LayersTypes.h";
@ -119,9 +118,6 @@ parent:
// Query a named property from the last frame
sync RequestProperty(nsString property) returns (float value);
// Return the TextureFactoryIdentifier for this compositor.
sync GetTextureFactoryIdentifier() returns (TextureFactoryIdentifier aIdentifier);
// Tell the compositor to notify APZ that a layer has been confirmed for an
// input event.
async SetConfirmedTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);

View File

@ -1001,6 +1001,8 @@ description =
description =
[PCompositorBridge::StopFrameTimeRecording]
description =
[PCompositorBridge::PLayerTransaction]
description =
[PCompositorBridge::SyncWithCompositor]
description =
[PCompositorBridge::PWebRenderBridge]
@ -1034,8 +1036,6 @@ description =
description =
[PLayerTransaction::RequestProperty]
description =
[PLayerTransaction::GetTextureFactoryIdentifier]
description = bug 1350634
[PUiCompositorController::Pause]
description =
[PUiCompositorController::Resume]

View File

@ -12,7 +12,6 @@
#include "mozilla/layers/CompositorBridgeChild.h"
#include "mozilla/layers/CompositorBridgeParent.h"
#include "mozilla/layers/PLayerTransactionChild.h"
#include "mozilla/layers/ImageBridgeChild.h"
#include "LiveResizeListener.h"
#include "nsBaseWidget.h"
@ -1345,13 +1344,8 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
bool success = false;
if (!backendHints.IsEmpty()) {
shadowManager =
mCompositorBridgeChild->SendPLayerTransactionConstructor(backendHints, 0);
if (shadowManager->SendGetTextureFactoryIdentifier(&textureFactoryIdentifier) &&
textureFactoryIdentifier.mParentBackend != LayersBackend::LAYERS_NONE)
{
success = true;
}
shadowManager = mCompositorBridgeChild->SendPLayerTransactionConstructor(
backendHints, 0, &textureFactoryIdentifier, &success);
}
if (!success) {