mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 1122276 - Move lock from GetTargetNode to call sites. r=botond
This commit is contained in:
parent
ff4dd4c94a
commit
6665c5f98f
@ -956,13 +956,13 @@ void
|
||||
APZCTreeManager::UpdateZoomConstraints(const ScrollableLayerGuid& aGuid,
|
||||
const ZoomConstraints& aConstraints)
|
||||
{
|
||||
MonitorAutoLock lock(mTreeLock);
|
||||
nsRefPtr<HitTestingTreeNode> node = GetTargetNode(aGuid, nullptr);
|
||||
MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
|
||||
|
||||
// For a given layers id, non-root APZCs inherit the zoom constraints
|
||||
// of their root.
|
||||
if (node && node->GetApzc()->IsRootForLayersId()) {
|
||||
MonitorAutoLock lock(mTreeLock);
|
||||
UpdateZoomConstraintsRecursively(node.get(), aConstraints);
|
||||
}
|
||||
}
|
||||
@ -1171,6 +1171,7 @@ already_AddRefed<AsyncPanZoomController>
|
||||
APZCTreeManager::GetTargetAPZC(const ScrollableLayerGuid& aGuid,
|
||||
GuidComparator aComparator)
|
||||
{
|
||||
MonitorAutoLock lock(mTreeLock);
|
||||
nsRefPtr<HitTestingTreeNode> node = GetTargetNode(aGuid, aComparator);
|
||||
MOZ_ASSERT(!node || node->GetApzc()); // any node returned must have an APZC
|
||||
nsRefPtr<AsyncPanZoomController> apzc = node ? node->GetApzc() : nullptr;
|
||||
@ -1181,7 +1182,7 @@ already_AddRefed<HitTestingTreeNode>
|
||||
APZCTreeManager::GetTargetNode(const ScrollableLayerGuid& aGuid,
|
||||
GuidComparator aComparator)
|
||||
{
|
||||
MonitorAutoLock lock(mTreeLock);
|
||||
mTreeLock.AssertCurrentThreadOwns();
|
||||
nsRefPtr<HitTestingTreeNode> target = FindTargetNode(mRootNode, aGuid, aComparator);
|
||||
return target.forget();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user