Bug 1124452 - Ensure the widget continues to be destroyed on the main thread. r=BenWa
This commit is contained in:
@@ -157,6 +157,7 @@ public:
|
|||||||
int aArg = 0) {}
|
int aArg = 0) {}
|
||||||
|
|
||||||
GeckoContentController() {}
|
GeckoContentController() {}
|
||||||
|
virtual void Destroy() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Protected destructor, to discourage deletion outside of Release():
|
// Protected destructor, to discourage deletion outside of Release():
|
||||||
|
|||||||
@@ -83,3 +83,17 @@ ChromeProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aSc
|
|||||||
{
|
{
|
||||||
APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
|
APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ChromeProcessController::Destroy()
|
||||||
|
{
|
||||||
|
if (MessageLoop::current() != mUILoop) {
|
||||||
|
mUILoop->PostTask(
|
||||||
|
FROM_HERE,
|
||||||
|
NewRunnableMethod(this, &ChromeProcessController::Destroy));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MOZ_ASSERT(MessageLoop::current() == mUILoop);
|
||||||
|
mWidget = nullptr;
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class ChromeProcessController : public mozilla::layers::GeckoContentController
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ChromeProcessController(nsIWidget* aWidget);
|
explicit ChromeProcessController(nsIWidget* aWidget);
|
||||||
|
virtual void Destroy() MOZ_OVERRIDE;
|
||||||
|
|
||||||
// GeckoContentController interface
|
// GeckoContentController interface
|
||||||
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
||||||
|
|||||||
@@ -88,6 +88,13 @@ CompositorParent::LayerTreeState::LayerTreeState()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompositorParent::LayerTreeState::~LayerTreeState()
|
||||||
|
{
|
||||||
|
if (mController) {
|
||||||
|
mController->Destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
typedef map<uint64_t, CompositorParent::LayerTreeState> LayerTreeMap;
|
typedef map<uint64_t, CompositorParent::LayerTreeState> LayerTreeMap;
|
||||||
static LayerTreeMap sIndirectLayerTrees;
|
static LayerTreeMap sIndirectLayerTrees;
|
||||||
static StaticAutoPtr<mozilla::Monitor> sIndirectLayerTreesLock;
|
static StaticAutoPtr<mozilla::Monitor> sIndirectLayerTreesLock;
|
||||||
|
|||||||
@@ -291,6 +291,7 @@ public:
|
|||||||
|
|
||||||
struct LayerTreeState {
|
struct LayerTreeState {
|
||||||
LayerTreeState();
|
LayerTreeState();
|
||||||
|
~LayerTreeState();
|
||||||
nsRefPtr<Layer> mRoot;
|
nsRefPtr<Layer> mRoot;
|
||||||
nsRefPtr<GeckoContentController> mController;
|
nsRefPtr<GeckoContentController> mController;
|
||||||
CompositorParent* mParent;
|
CompositorParent* mParent;
|
||||||
|
|||||||
Reference in New Issue
Block a user