Bug 1447299 - Move the RunOnControllerThread from APZCTreeManager::SetLongTapEnabled to the caller. r?botond
This is functionally a no-op (it just moves the thread-bouncing code
from inside APZCTreeManager::SetLongTapEnabled to the call site in
APZCTreeManagerParent. The other call site, in
widget/android/nsWindow.cpp, is already known to be running on the
controller thread (which would be the Java UI thread in that case).
This makes the code in APZCTreeManagerParent more consistent and
simplifies the next changes.
MozReview-Commit-ID: 8VfEDVVFNl8
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -2529,19 +2529,18 @@ APZCTreeManager::BuildOverscrollHandoffC
}
return result;
}
void
APZCTreeManager::SetLongTapEnabled(bool aLongTapEnabled)
{
- APZThreadUtils::RunOnControllerThread(
- NewRunnableFunction("SetLongTapEnabledRunnable",
- GestureEventListener::SetLongTapEnabled, aLongTapEnabled));
+ APZThreadUtils::AssertOnControllerThread();
+ GestureEventListener::SetLongTapEnabled(aLongTapEnabled);
}
RefPtr<HitTestingTreeNode>
APZCTreeManager::FindScrollThumbNode(const AsyncDragMetrics& aDragMetrics)
{
RecursiveMutexAutoLock lock(mTreeLock);
return DepthFirstSearch<ReverseIterator>(mRootNode.get(),
--- a/gfx/layers/ipc/APZCTreeManagerParent.cpp
+++ b/gfx/layers/ipc/APZCTreeManagerParent.cpp
@@ -200,16 +200,22 @@ APZCTreeManagerParent::RecvStopAutoscrol
mTreeManager,
&IAPZCTreeManager::StopAutoscroll,
aGuid));
return IPC_OK();
}
mozilla::ipc::IPCResult
-APZCTreeManagerParent::RecvSetLongTapEnabled(const bool& aTapGestureEnabled)
+APZCTreeManagerParent::RecvSetLongTapEnabled(const bool& aLongTapEnabled)
{
- mTreeManager->SetLongTapEnabled(aTapGestureEnabled);
+ APZThreadUtils::RunOnControllerThread(
+ NewRunnableMethod<bool>(
+ "layers::IAPZCTreeManager::SetLongTapEnabled",
+ mTreeManager,
+ &IAPZCTreeManager::SetLongTapEnabled,
+ aLongTapEnabled));
+
return IPC_OK();
}
} // namespace layers
} // namespace mozilla