From dd5b4ca612a2bcbbc849b9fdfe3a4823e9f69d6d Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta <kgupta@mozilla.com> Date: Wed, 14 Sep 2016 07:54:37 -0400 Subject: [PATCH] Bug 1289432 - Miscellaneous function renaming and documentation touchups. r=botond MozReview-Commit-ID: IEUSxcIb0fN --- gfx/layers/apz/src/APZCTreeManager.cpp | 2 +- gfx/layers/apz/src/AsyncPanZoomController.cpp | 2 +- gfx/layers/apz/src/InputBlockState.h | 1 - gfx/layers/apz/src/InputQueue.cpp | 26 +++++++++---------- gfx/layers/apz/src/InputQueue.h | 19 +++++++------- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index b4e4a94dc6c54..c0460c7196d88 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -1059,7 +1059,7 @@ void APZCTreeManager::UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint, EventMessage aEventMessage) { - WheelBlockState* txn = mInputQueue->GetCurrentWheelTransaction(); + WheelBlockState* txn = mInputQueue->GetActiveWheelTransaction(); if (!txn) { return; } diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 7c4274cb4f913..c84420c634415 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -1675,7 +1675,7 @@ nsEventStatus AsyncPanZoomController::OnScrollWheel(const ScrollWheelInput& aEve if ((delta.x || delta.y) && !CanScrollWithWheel(delta)) { // We can't scroll this apz anymore, so we simply drop the event. - if (mInputQueue->GetCurrentWheelTransaction() && + if (mInputQueue->GetActiveWheelTransaction() && gfxPrefs::MouseScrollTestingEnabled()) { if (RefPtr<GeckoContentController> controller = GetGeckoContentController()) { controller->NotifyMozMouseScrollEvent( diff --git a/gfx/layers/apz/src/InputBlockState.h b/gfx/layers/apz/src/InputBlockState.h index 44367c92152e1..86fb0d03ff72b 100644 --- a/gfx/layers/apz/src/InputBlockState.h +++ b/gfx/layers/apz/src/InputBlockState.h @@ -30,7 +30,6 @@ class PanGestureBlockState; /** * A base class that stores state common to various input blocks. - * Currently, it just stores the overscroll handoff chain. * Note that the InputBlockState constructor acquires the tree lock, so callers * from inside AsyncPanZoomController should ensure that the APZC lock is not * held. diff --git a/gfx/layers/apz/src/InputQueue.cpp b/gfx/layers/apz/src/InputQueue.cpp index eb872246a3895..6bff178accbba 100644 --- a/gfx/layers/apz/src/InputQueue.cpp +++ b/gfx/layers/apz/src/InputQueue.cpp @@ -154,7 +154,7 @@ InputQueue::ReceiveTouchInput(const RefPtr<AsyncPanZoomController>& aTarget, result = nsEventStatus_eConsumeNoDefault; } mQueuedInputs.AppendElement(MakeUnique<QueuedInput>(aEvent.AsMultiTouchInput(), *block)); - ProcessInputBlocks(); + ProcessQueue(); return result; } @@ -206,7 +206,7 @@ InputQueue::ReceiveMouseInput(const RefPtr<AsyncPanZoomController>& aTarget, } mQueuedInputs.AppendElement(MakeUnique<QueuedInput>(aEvent.AsMouseInput(), *block)); - ProcessInputBlocks(); + ProcessQueue(); if (DragTracker::EndsDrag(aEvent)) { block->MarkMouseUpReceived(); @@ -259,9 +259,9 @@ InputQueue::ReceiveScrollWheelInput(const RefPtr<AsyncPanZoomController>& aTarge // target set on the block. In this case the confirmed target (which may be // null) should take priority. This is equivalent to just always using the // target (confirmed or not) from the block, which is what - // ProcessInputBlocks() does. + // ProcessQueue() does. mQueuedInputs.AppendElement(MakeUnique<QueuedInput>(event, *block)); - ProcessInputBlocks(); + ProcessQueue(); return nsEventStatus_eConsumeDoDefault; } @@ -339,9 +339,9 @@ InputQueue::ReceivePanGestureInput(const RefPtr<AsyncPanZoomController>& aTarget // target set on the block. In this case the confirmed target (which may be // null) should take priority. This is equivalent to just always using the // target (confirmed or not) from the block, which is what - // ProcessInputBlocks() does. + // ProcessQueue() does. mQueuedInputs.AppendElement(MakeUnique<QueuedInput>(event.AsPanGestureInput(), *block)); - ProcessInputBlocks(); + ProcessQueue(); return result; } @@ -458,7 +458,7 @@ InputQueue::GetCurrentPanGestureBlock() const } WheelBlockState* -InputQueue::GetCurrentWheelTransaction() const +InputQueue::GetActiveWheelTransaction() const { WheelBlockState* block = mActiveWheelBlock.get(); if (!block || !block->InTransaction()) { @@ -561,7 +561,7 @@ InputQueue::MainThreadTimeout(const uint64_t& aInputBlockId) { firstInput); } if (success) { - ProcessInputBlocks(); + ProcessQueue(); } } @@ -577,7 +577,7 @@ InputQueue::ContentReceivedInputBlock(uint64_t aInputBlockId, bool aPreventDefau block->RecordContentResponseTime(); } if (success) { - ProcessInputBlocks(); + ProcessQueue(); } } @@ -597,7 +597,7 @@ InputQueue::SetConfirmedTargetApzc(uint64_t aInputBlockId, const RefPtr<AsyncPan block->RecordContentResponseTime(); } if (success) { - ProcessInputBlocks(); + ProcessQueue(); } } @@ -620,7 +620,7 @@ InputQueue::ConfirmDragBlock(uint64_t aInputBlockId, const RefPtr<AsyncPanZoomCo block->RecordContentResponseTime(); } if (success) { - ProcessInputBlocks(); + ProcessQueue(); } } @@ -638,12 +638,12 @@ InputQueue::SetAllowedTouchBehavior(uint64_t aInputBlockId, const nsTArray<Touch NS_WARNING("input block is not a touch block"); } if (success) { - ProcessInputBlocks(); + ProcessQueue(); } } void -InputQueue::ProcessInputBlocks() { +InputQueue::ProcessQueue() { APZThreadUtils::AssertOnControllerThread(); while (!mQueuedInputs.IsEmpty()) { diff --git a/gfx/layers/apz/src/InputQueue.h b/gfx/layers/apz/src/InputQueue.h index a7191b288ad11..c851097df595a 100644 --- a/gfx/layers/apz/src/InputQueue.h +++ b/gfx/layers/apz/src/InputQueue.h @@ -33,9 +33,8 @@ class AsyncDragMetrics; class QueuedInput; /** - * This class stores incoming input events, separated into "input blocks", until - * they are ready for handling. Currently input blocks are only created from - * touch input. + * This class stores incoming input events, associated with "input blocks", until + * they are ready for handling. */ class InputQueue { NS_INLINE_DECL_THREADSAFE_REFCOUNTING(InputQueue) @@ -107,15 +106,17 @@ public: DragBlockState* GetCurrentDragBlock() const; PanGestureBlockState* GetCurrentPanGestureBlock() const; /** - * Returns true iff the pending block at the head of the queue is ready for - * handling. + * Returns true iff the pending block at the head of the queue is a touch + * block and is ready for handling. */ bool HasReadyTouchBlock() const; /** - * If there is a wheel transaction, returns the WheelBlockState representing - * the transaction. Otherwise, returns null. + * If there is an active wheel transaction, returns the WheelBlockState + * representing the transaction. Otherwise, returns null. "Active" in this + * function name is the same kind of "active" as in mActiveWheelBlock - that + * is, new incoming wheel events will go into the "active" block. */ - WheelBlockState* GetCurrentWheelTransaction() const; + WheelBlockState* GetActiveWheelTransaction() const; /** * Remove all input blocks from the input queue. */ @@ -181,7 +182,7 @@ private: void ScheduleMainThreadTimeout(const RefPtr<AsyncPanZoomController>& aTarget, CancelableBlockState* aBlock); void MainThreadTimeout(const uint64_t& aInputBlockId); - void ProcessInputBlocks(); + void ProcessQueue(); bool CanDiscardBlock(CancelableBlockState* aBlock); void UpdateActiveApzc(const RefPtr<AsyncPanZoomController>& aNewActive); -- GitLab