private void skipWebKitEventLocked(DispatchEvent d) { d.mNext = null; if ((d.mFlags & FLAG_PRIVATE) != 0) { recycleDispatchEventLocked(d); } else { d.mFlags |= FLAG_WEBKIT_TIMEOUT; enqueueUiEventUnbatchedLocked(d); } }
public void enqueue(DispatchEvent d) { if (mHead == null) { mHead = d; mTail = d; } else { mTail.mNext = d; mTail = d; } }
private DispatchEvent obtainUninitializedDispatchEventLocked() { DispatchEvent d = mDispatchEventPool; if (d != null) { mDispatchEventPoolSize -= 1; mDispatchEventPool = d.mNext; d.mNext = null; } else { d = new DispatchEvent(); } return d; }
private void recycleDispatchEventLocked(DispatchEvent d) { if (d.mEvent != null) { d.mEvent.recycle(); d.mEvent = null; } if (mDispatchEventPoolSize < MAX_DISPATCH_EVENT_POOL_SIZE) { mDispatchEventPoolSize += 1; d.mNext = mDispatchEventPool; mDispatchEventPool = d; } }
public DispatchEvent dequeue() { DispatchEvent d = mHead; if (d != null) { DispatchEvent next = d.mNext; if (next == null) { mHead = null; mTail = null; } else { mHead = next; d.mNext = null; } } return d; }
private DispatchEvent copyDispatchEventLocked(DispatchEvent d) { DispatchEvent copy = obtainUninitializedDispatchEventLocked(); if (d.mEvent != null) { copy.mEvent = d.mEvent.copy(); } copy.mEventType = d.mEventType; copy.mFlags = d.mFlags; copy.mTimeoutTime = d.mTimeoutTime; copy.mWebKitXOffset = d.mWebKitXOffset; copy.mWebKitYOffset = d.mWebKitYOffset; copy.mWebKitScale = d.mWebKitScale; copy.mNext = d.mNext; return copy; }