diff --git a/mozilla/xpcom/threads/nsEventQueue.cpp b/mozilla/xpcom/threads/nsEventQueue.cpp index df887abf4f0..aca9db61516 100644 --- a/mozilla/xpcom/threads/nsEventQueue.cpp +++ b/mozilla/xpcom/threads/nsEventQueue.cpp @@ -337,6 +337,19 @@ nsEventQueueImpl::IsQueueNative(PRBool *aResult) return NS_OK; } +NS_IMETHODIMP +nsEventQueueImpl::PendingEvents(PRBool *aResult) +{ + *aResult = PL_EventAvailable(mEventQueue); + if (!*aResult && mElderQueue) { + nsCOMPtr elder(do_QueryInterface(mElderQueue)); + if (elder) + return elder->EventAvailable(*aResult); + } + return NS_OK; +} + + NS_IMETHODIMP nsEventQueueImpl::ProcessPendingEvents() { diff --git a/mozilla/xpcom/threads/nsIEventQueue.idl b/mozilla/xpcom/threads/nsIEventQueue.idl index 6bcb8d32fc1..f12135781c8 100644 --- a/mozilla/xpcom/threads/nsIEventQueue.idl +++ b/mozilla/xpcom/threads/nsIEventQueue.idl @@ -63,6 +63,7 @@ interface nsIEventQueue : nsISupports [noscript] void postSynchronousEvent(in PLEventPtr aEvent, out voidPtr aResult); + boolean pendingEvents(); void processPendingEvents(); void eventLoop();