Backed out changeset 7b113a6167e9 (bug 1215265) for mass bustage CLOSED TREE

This commit is contained in:
Wes Kocher 2015-11-22 23:02:18 -08:00
parent f663748358
commit 2e7f2539d9
5 changed files with 19 additions and 39 deletions

View File

@ -49,9 +49,14 @@ CompositorChild::~CompositorChild()
if (mCanSend) {
gfxCriticalError() << "CompositorChild was not deinitialized";
}
if (sCompositor == this) {
sCompositor = nullptr;
}
}
static void DeferredDestroyCompositor(RefPtr<CompositorParent> aCompositorParent,
RefPtr<CompositorChild> aCompositorChild)
{
// Bug 848949 needs to be fixed before
// we can close the channel properly
//aCompositorChild->Close();
}
void
@ -96,17 +101,11 @@ CompositorChild::Destroy()
}
SendStop();
}
/*static*/ void
CompositorChild::ShutdownLayersIPC()
{
if (sCompositor) {
sCompositor->Destroy();
do {
NS_ProcessNextEvent(nullptr, true);
} while (sCompositor);
}
// The DeferredDestroyCompositor task takes ownership of compositorParent and
// will release them when it runs.
MessageLoop::current()->PostTask(FROM_HERE,
NewRunnableFunction(DeferredDestroyCompositor, mCompositorParent, selfRef));
}
bool

View File

@ -123,8 +123,6 @@ public:
bool SendNotifyRegionInvalidated(const nsIntRegion& region);
bool SendRequestNotifyAfterRemotePaint();
static void ShutdownLayersIPC();
private:
// Private destructor, to discourage deletion outside of Release():
virtual ~CompositorChild();

View File

@ -1750,7 +1750,7 @@ public:
// FIXME/bug 774388: work out what shutdown protocol we need.
virtual bool RecvRequestOverfill() override { return true; }
virtual bool RecvWillStop() override { return true; }
virtual bool RecvStop() override;
virtual bool RecvStop() override { return true; }
virtual bool RecvPause() override { return true; }
virtual bool RecvResume() override { return true; }
virtual bool RecvNotifyHidden(const uint64_t& id) override;
@ -1830,7 +1830,6 @@ private:
// Private destructor, to discourage deletion outside of Release():
virtual ~CrossProcessCompositorParent();
void Destroy();
void DeferredDestroy();
// There can be many CPCPs, and IPDL-generated code doesn't hold a
@ -1942,27 +1941,14 @@ CrossProcessCompositorParent::RecvRequestNotifyAfterRemotePaint()
}
void
CrossProcessCompositorParent::Destroy()
CrossProcessCompositorParent::ActorDestroy(ActorDestroyReason aWhy)
{
RefPtr<CompositorLRU> lru = CompositorLRU::GetSingleton();
lru->Remove(this);
}
void
CrossProcessCompositorParent::ActorDestroy(ActorDestroyReason aWhy)
{
Destroy();
}
bool
CrossProcessCompositorParent::RecvStop()
{
Destroy();
// We must keep this object alive untill the code handling message
// reception is finished on this thread.
MessageLoop::current()->PostTask(FROM_HERE,
NewRunnableMethod(this, &CrossProcessCompositorParent::DeferredDestroy));
return true;
MessageLoop::current()->PostTask(
FROM_HERE,
NewRunnableMethod(this, &CrossProcessCompositorParent::DeferredDestroy));
}
PLayerTransactionParent*

View File

@ -745,7 +745,8 @@ gfxPlatform::ShutdownLayersIPC()
}
sLayersIPCIsUp = false;
if (XRE_IsParentProcess()) {
if (XRE_IsParentProcess())
{
// This must happen after the shutdown of media and widgets, which
// are triggered by the NS_XPCOM_SHUTDOWN_OBSERVER_ID notification.
layers::ImageBridgeChild::ShutDown();
@ -754,8 +755,6 @@ gfxPlatform::ShutdownLayersIPC()
#endif
layers::CompositorParent::ShutDown();
} else {
CompositorChild::ShutdownLayersIPC();
}
}

View File

@ -251,14 +251,12 @@ void nsBaseWidget::DestroyCompositor()
RefPtr<CompositorChild> compositorChild = mCompositorChild;
RefPtr<CompositorParent> compositorParent = mCompositorParent;
mCompositorChild->Destroy();
mCompositorChild = nullptr;
}
// Can have base widgets that are things like tooltips
// which don't have CompositorVsyncDispatchers
if (mCompositorVsyncDispatcher) {
mCompositorVsyncDispatcher->Shutdown();
mCompositorVsyncDispatcher = nullptr;
}
}