Пример #1
0
void
InputQueue::SetConfirmedTargetApzc(uint64_t aInputBlockId, const RefPtr<AsyncPanZoomController>& aTargetApzc) {
  APZThreadUtils::AssertOnControllerThread();

  INPQ_LOG("got a target apzc; block=%" PRIu64 " guid=%s\n",
    aInputBlockId, aTargetApzc ? Stringify(aTargetApzc->GetGuid()).c_str() : "");
  bool success = false;
  InputData* firstInput = nullptr;
  CancelableBlockState* block = FindBlockForId(aInputBlockId, &firstInput);
  if (block) {
    success = block->SetConfirmedTargetApzc(aTargetApzc,
        InputBlockState::TargetConfirmationState::eConfirmed,
        firstInput);
    block->RecordContentResponseTime();
  }
  if (success) {
    ProcessQueue();
  }
}
Пример #2
0
void
InputQueue::MainThreadTimeout(uint64_t aInputBlockId) {
  APZThreadUtils::AssertOnControllerThread();

  INPQ_LOG("got a main thread timeout; block=%" PRIu64 "\n", aInputBlockId);
  bool success = false;
  InputData* firstInput = nullptr;
  CancelableBlockState* block = FindBlockForId(aInputBlockId, &firstInput);
  if (block) {
    // time out the touch-listener response and also confirm the existing
    // target apzc in the case where the main thread doesn't get back to us
    // fast enough.
    success = block->TimeoutContentResponse();
    success |= block->SetConfirmedTargetApzc(
        block->GetTargetApzc(),
        InputBlockState::TargetConfirmationState::eTimedOut,
        firstInput);
  }
  if (success) {
    ProcessQueue();
  }
}