diff --git a/mozilla/xpcom/public/nsIEventQueueService.h b/mozilla/xpcom/public/nsIEventQueueService.h index aeefa033e53..9113c5e4c11 100644 --- a/mozilla/xpcom/public/nsIEventQueueService.h +++ b/mozilla/xpcom/public/nsIEventQueueService.h @@ -37,6 +37,11 @@ public: NS_IMETHOD DestroyThreadEventQueue(void) = 0; NS_IMETHOD GetThreadEventQueue(PRThread* aThread, PLEventQueue** aResult) = 0; + +#ifdef XP_MAC +// This is ment to be temporary until something better is worked out + NS_IMETHOD ProcessEvents() = 0; +#endif }; #endif /* nsIEventQueueService_h___ */ diff --git a/mozilla/xpcom/src/nsEventQueueService.cpp b/mozilla/xpcom/src/nsEventQueueService.cpp index b16a64be476..c4c2cdc82c3 100644 --- a/mozilla/xpcom/src/nsEventQueueService.cpp +++ b/mozilla/xpcom/src/nsEventQueueService.cpp @@ -109,6 +109,9 @@ public: NS_IMETHOD DestroyThreadEventQueue(void); NS_IMETHOD GetThreadEventQueue(PRThread* aThread, PLEventQueue** aResult); +#ifdef XP_MAC + NS_IMETHOD ProcessEvents(); +#endif // XP_MAC protected: ~nsEventQueueServiceImpl(); @@ -240,7 +243,24 @@ done: PR_ExitMonitor(mEventQMonitor); return rv; } +#ifdef XP_MAC +// Callback from the enumeration of the HashTable. +static PRBool EventDispatchingFunc(nsHashKey *aKey, void *aData, void* closure) +{ + EventQueueEntry* entry = (EventQueueEntry*) aData; + PL_ProcessPendingEvents( entry->GetEventQueue() ); + return true; +} +// MAC specific. Will go away someday +NS_IMETHODIMP nsEventQueueServiceImpl::ProcessEvents() +{ + if ( mEventQTable ) + mEventQTable->Enumerate( EventDispatchingFunc, NULL ); + return NS_OK; +} + +#endif //---------------------------------------------------------------------- static nsEventQueueServiceImpl* gServiceInstance = NULL; diff --git a/mozilla/xpcom/threads/nsEventQueueService.cpp b/mozilla/xpcom/threads/nsEventQueueService.cpp index b16a64be476..c4c2cdc82c3 100644 --- a/mozilla/xpcom/threads/nsEventQueueService.cpp +++ b/mozilla/xpcom/threads/nsEventQueueService.cpp @@ -109,6 +109,9 @@ public: NS_IMETHOD DestroyThreadEventQueue(void); NS_IMETHOD GetThreadEventQueue(PRThread* aThread, PLEventQueue** aResult); +#ifdef XP_MAC + NS_IMETHOD ProcessEvents(); +#endif // XP_MAC protected: ~nsEventQueueServiceImpl(); @@ -240,7 +243,24 @@ done: PR_ExitMonitor(mEventQMonitor); return rv; } +#ifdef XP_MAC +// Callback from the enumeration of the HashTable. +static PRBool EventDispatchingFunc(nsHashKey *aKey, void *aData, void* closure) +{ + EventQueueEntry* entry = (EventQueueEntry*) aData; + PL_ProcessPendingEvents( entry->GetEventQueue() ); + return true; +} +// MAC specific. Will go away someday +NS_IMETHODIMP nsEventQueueServiceImpl::ProcessEvents() +{ + if ( mEventQTable ) + mEventQTable->Enumerate( EventDispatchingFunc, NULL ); + return NS_OK; +} + +#endif //---------------------------------------------------------------------- static nsEventQueueServiceImpl* gServiceInstance = NULL; diff --git a/mozilla/xpcom/threads/nsIEventQueueService.h b/mozilla/xpcom/threads/nsIEventQueueService.h index aeefa033e53..9113c5e4c11 100644 --- a/mozilla/xpcom/threads/nsIEventQueueService.h +++ b/mozilla/xpcom/threads/nsIEventQueueService.h @@ -37,6 +37,11 @@ public: NS_IMETHOD DestroyThreadEventQueue(void) = 0; NS_IMETHOD GetThreadEventQueue(PRThread* aThread, PLEventQueue** aResult) = 0; + +#ifdef XP_MAC +// This is ment to be temporary until something better is worked out + NS_IMETHOD ProcessEvents() = 0; +#endif }; #endif /* nsIEventQueueService_h___ */