NS_ENSURE_ARG_POINTER(aQueue); *aQueue = 0;  nsCOMPtr<nsIEventQueueService> eventService(do_GetService(kEventQueueServiceCID)); if (eventService) eventService->GetThreadEventQueue(mThread, aQueue); return *aQueue ? NS_OK : NS_ERROR_FAILURE;
NS_PRECONDITION(nsnull != mThreadEventQueue, "EventQueue for thread is null"); NS_ADDREF(mThreadEventQueue); return mThreadEventQueue;
nsWebShell::GetEventQueue(nsIEventQueue **aQueue){  NS_ENSURE_ARG_POINTER(aQueue);  *aQueue = 0;  nsCOMPtr<nsIEventQueueService> eventService(do_GetService(kEventQueueServiceCID));  if (eventService)    eventService->GetThreadEventQueue(mThread, aQueue);  return *aQueue ? NS_OK : NS_ERROR_FAILURE;}