Bug 1122276 - Inline the BuildOverscrollHandoffChain callsite of GetTargetAPZC to avoid re-entering the tree lock and deadlocking. r=botond

This commit is contained in:
Kartikaya Gupta 2015-01-16 17:34:47 -05:00
Родитель 6665c5f98f
Коммит cf0a0f7cc0
2 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -1168,11 +1168,10 @@ APZCTreeManager::HitTestAPZC(const ScreenIntPoint& aPoint)
}
already_AddRefed<AsyncPanZoomController>
APZCTreeManager::GetTargetAPZC(const ScrollableLayerGuid& aGuid,
GuidComparator aComparator)
APZCTreeManager::GetTargetAPZC(const ScrollableLayerGuid& aGuid)
{
MonitorAutoLock lock(mTreeLock);
nsRefPtr<HitTestingTreeNode> node = GetTargetNode(aGuid, aComparator);
nsRefPtr<HitTestingTreeNode> node = GetTargetNode(aGuid, nullptr);
MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
nsRefPtr<AsyncPanZoomController> apzc = node ? node->GetApzc() : nullptr;
return apzc.forget();
@ -1263,8 +1262,9 @@ APZCTreeManager::BuildOverscrollHandoffChain(const nsRefPtr<AsyncPanZoomControll
}
if (!scrollParent) {
ScrollableLayerGuid guid(parent->GetGuid().mLayersId, 0, apzc->GetScrollHandoffParentId());
nsRefPtr<AsyncPanZoomController> scrollParentPtr = GetTargetAPZC(guid, &GuidComparatorIgnoringPresShell);
scrollParent = scrollParentPtr.get();
nsRefPtr<HitTestingTreeNode> node = GetTargetNode(guid, &GuidComparatorIgnoringPresShell);
MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
scrollParent = node ? node->GetApzc() : nullptr;
}
apzc = scrollParent;
}

Просмотреть файл

@ -413,8 +413,7 @@ private:
void AttachNodeToTree(HitTestingTreeNode* aNode,
HitTestingTreeNode* aParent,
HitTestingTreeNode* aNextSibling);
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScrollableLayerGuid& aGuid,
GuidComparator aComparator = nullptr);
already_AddRefed<AsyncPanZoomController> GetTargetAPZC(const ScrollableLayerGuid& aGuid);
already_AddRefed<HitTestingTreeNode> GetTargetNode(const ScrollableLayerGuid& aGuid,
GuidComparator aComparator);
HitTestingTreeNode* FindTargetNode(HitTestingTreeNode* aNode,