зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1445662 - Assert that IAPZCTreeManager's helper methods are always on the controller thread. r=rhunt
These two functions (UpdateWheelTransaction and ProcessUnhandledEvent) are only ever called on the concrete APZCTreeManager when the APZ code is living in the GPU process. This is because the calls are made by the IAPZCTreeManager implementation which lives in the UI process, and remoted over PAPZCTreeManager. So the assertion is safe, and will help us guard against inadvertent breakage when we try making a different thread the controller thread in the GPU process. In addition, the WillHandleInput function can be called in the GPU process on the compositor thread, but we will allow it to be called on the main thread as well. In that case we need to ensure we don't try running EventStateManager pref-reading code in the GPU process, and instead preserve the current behaviour of just returning true.
This commit is contained in:
Родитель
323f2093f0
Коммит
cfbe8bb66a
|
@ -1064,7 +1064,7 @@ template<typename PanGestureOrScrollWheelInput>
|
|||
static bool
|
||||
WillHandleInput(const PanGestureOrScrollWheelInput& aPanInput)
|
||||
{
|
||||
if (!NS_IsMainThread()) {
|
||||
if (!XRE_IsParentProcess() || !NS_IsMainThread()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1795,6 +1795,8 @@ void
|
|||
APZCTreeManager::UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint,
|
||||
EventMessage aEventMessage)
|
||||
{
|
||||
APZThreadUtils::AssertOnControllerThread();
|
||||
|
||||
WheelBlockState* txn = mInputQueue->GetActiveWheelTransaction();
|
||||
if (!txn) {
|
||||
return;
|
||||
|
@ -1840,6 +1842,8 @@ APZCTreeManager::ProcessUnhandledEvent(LayoutDeviceIntPoint* aRefPoint,
|
|||
ScrollableLayerGuid* aOutTargetGuid,
|
||||
uint64_t* aOutFocusSequenceNumber)
|
||||
{
|
||||
APZThreadUtils::AssertOnControllerThread();
|
||||
|
||||
// Transform the aRefPoint.
|
||||
// If the event hits an overscrolled APZC, instruct the caller to ignore it.
|
||||
CompositorHitTestInfo hitResult = CompositorHitTestInfo::eInvisibleToHitTest;
|
||||
|
|
Загрузка…
Ссылка в новой задаче