void CancelableBlockState::DispatchImmediate(const InputData& aEvent) const { MOZ_ASSERT(!HasEvents()); MOZ_ASSERT(GetTargetApzc()); DispatchEvent(aEvent); }
void CancelableBlockState::DispatchImmediate(const InputData& aEvent) const { MOZ_ASSERT(!HasEvents()); MOZ_ASSERT(GetTargetApzc()); GetTargetApzc()->HandleInputEvent(aEvent, mTransformToApzc); }
void TouchBlockState::HandleEvents() { while (HasEvents()) { TBS_LOG("%p returning first of %" PRIuSIZE " events\n", this, mEvents.Length()); MultiTouchInput event = mEvents[0]; mEvents.RemoveElementAt(0); DispatchEvent(event); } }
void TouchBlockState::HandleEvents() { while (HasEvents()) { TBS_LOG("%p returning first of %" PRIuSIZE " events\n", this, mEvents.Length()); MultiTouchInput event = mEvents[0]; mEvents.RemoveElementAt(0); GetTargetApzc()->HandleInputEvent(event, mTransformToApzc); } }
void WheelBlockState::HandleEvents() { while (HasEvents()) { TBS_LOG("%p returning first of %lu events\n", this, mEvents.Length()); ScrollWheelInput event = mEvents[0]; mEvents.RemoveElementAt(0); GetTargetApzc()->HandleInputEvent(event, mTransformToApzc); } }
bool AsyncIOManager::WaitResult(u32 handle, AsyncIOResult &result) { std::unique_lock<std::mutex> guard(resultsLock_); ScheduleEvent(IO_EVENT_SYNC); while (HasEvents() && ThreadEnabled() && resultsPending_.find(handle) != resultsPending_.end()) { if (PopResult(handle, result)) { return true; } resultsWait_.wait_for(guard, std::chrono::milliseconds(16)); } return PopResult(handle, result); }
bool AsyncIOManager::WaitResult(u32 handle, AsyncIOResult &result) { lock_guard guard(resultsLock_); ScheduleEvent(IO_EVENT_SYNC); while (HasEvents() && ThreadEnabled() && resultsPending_.find(handle) != resultsPending_.end()) { if (PopResult(handle, result)) { return true; } resultsWait_.wait_for(resultsLock_, 16); } if (PopResult(handle, result)) { return true; } return false; }
u64 AsyncIOManager::ResultFinishTicks(u32 handle) { AsyncIOResult result; lock_guard guard(resultsLock_); ScheduleEvent(IO_EVENT_SYNC); while (HasEvents() && ThreadEnabled() && resultsPending_.find(handle) != resultsPending_.end()) { if (ReadResult(handle, result)) { return result.finishTicks; } resultsWait_.wait_for(resultsLock_, 16); } if (ReadResult(handle, result)) { return result.finishTicks; } return 0; }
u64 AsyncIOManager::ResultFinishTicks(u32 handle) { AsyncIOResult result; std::unique_lock<std::mutex> guard(resultsLock_); ScheduleEvent(IO_EVENT_SYNC); while (HasEvents() && ThreadEnabled() && resultsPending_.find(handle) != resultsPending_.end()) { if (ReadResult(handle, result)) { return result.finishTicks; } resultsWait_.wait_for(guard, std::chrono::milliseconds(16)); } if (ReadResult(handle, result)) { return result.finishTicks; } return 0; }