зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1124452 - Ensure the widget continues to be destroyed on the main thread. r=BenWa
--HG-- extra : rebase_source : 012cfddceefea66299e3476d2a4ae831a586ad1c
This commit is contained in:
Родитель
5ce034230b
Коммит
842ba52546
|
@ -157,6 +157,7 @@ public:
|
|||
int aArg = 0) {}
|
||||
|
||||
GeckoContentController() {}
|
||||
virtual void Destroy() {}
|
||||
|
||||
protected:
|
||||
// Protected destructor, to discourage deletion outside of Release():
|
||||
|
|
|
@ -83,3 +83,17 @@ ChromeProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aSc
|
|||
{
|
||||
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:
|
||||
explicit ChromeProcessController(nsIWidget* aWidget);
|
||||
virtual void Destroy() MOZ_OVERRIDE;
|
||||
|
||||
// GeckoContentController interface
|
||||
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;
|
||||
static LayerTreeMap sIndirectLayerTrees;
|
||||
static StaticAutoPtr<mozilla::Monitor> sIndirectLayerTreesLock;
|
||||
|
|
|
@ -291,6 +291,7 @@ public:
|
|||
|
||||
struct LayerTreeState {
|
||||
LayerTreeState();
|
||||
~LayerTreeState();
|
||||
nsRefPtr<Layer> mRoot;
|
||||
nsRefPtr<GeckoContentController> mController;
|
||||
CompositorParent* mParent;
|
||||
|
|
Загрузка…
Ссылка в новой задаче