From 27efadd78293f5536b455f349797a0490e2f54bb Mon Sep 17 00:00:00 2001 From: "dougt%netscape.com" Date: Thu, 26 Apr 2001 05:28:43 +0000 Subject: [PATCH] Adding a new method that will allow caller to check if there pending events in the elder queue. r=sfraser@netscape.com, danm@netscape.com, b=76075 git-svn-id: svn://10.0.0.236/trunk@93112 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/xpcom/threads/nsEventQueue.cpp | 13 +++++++++++++ mozilla/xpcom/threads/nsIEventQueue.idl | 1 + 2 files changed, 14 insertions(+) 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();