Bug 1289432 - Miscellaneous function renaming and documentation touchups. r=botond

MozReview-Commit-ID: IEUSxcIb0fN
This commit is contained in:
Kartikaya Gupta 2016-09-14 07:54:37 -04:00
Родитель fd5138db2a
Коммит dd5b4ca612
5 изменённых файлов: 25 добавлений и 25 удалений

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

@ -1059,7 +1059,7 @@ void
APZCTreeManager::UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint,
EventMessage aEventMessage)
{
WheelBlockState* txn = mInputQueue->GetCurrentWheelTransaction();
WheelBlockState* txn = mInputQueue->GetActiveWheelTransaction();
if (!txn) {
return;
}

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

@ -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(

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

@ -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.

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

@ -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()) {

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

@ -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);