зеркало из https://github.com/mozilla/pjs.git
Backing out fix for bug 303484 since it exposed some other issues and doesn't fix any known crashers.
This commit is contained in:
Родитель
f2bd896c9f
Коммит
f8cddec44f
|
@ -609,13 +609,12 @@ nsWindowWatcher::OpenWindowJS(nsIDOMWindow *aParent,
|
|||
|
||||
if (weAreModal) {
|
||||
rv = queueGuard.Push();
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
windowIsModal = PR_TRUE;
|
||||
// in case we added this because weAreModal
|
||||
chromeFlags |= nsIWebBrowserChrome::CHROME_MODAL |
|
||||
nsIWebBrowserChrome::CHROME_DEPENDENT;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
windowIsModal = PR_TRUE;
|
||||
// in case we added this because weAreModal
|
||||
chromeFlags |= nsIWebBrowserChrome::CHROME_MODAL |
|
||||
nsIWebBrowserChrome::CHROME_DEPENDENT;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(mWindowCreator,
|
||||
|
|
|
@ -62,8 +62,6 @@ static PLEventQueue *gEventQueueLogQueue = 0;
|
|||
static PRThread *gEventQueueLogThread = 0;
|
||||
#endif
|
||||
|
||||
#define MAX_EVENTQUEUE_NESTING_DEPTH 12
|
||||
|
||||
// in a real system, these would be members in a header class...
|
||||
static const char gActivatedNotification[] = "nsIEventQueueActivated";
|
||||
static const char gDestroyedNotification[] = "nsIEventQueueDestroyed";
|
||||
|
@ -541,32 +539,26 @@ nsEventQueueImpl::AppendQueue(nsIEventQueue *aQueue)
|
|||
*/
|
||||
rv = NS_ERROR_NO_INTERFACE;
|
||||
|
||||
GetYoungest(getter_AddRefs(end));
|
||||
nsCOMPtr<nsPIEventQueueChain> endChain(do_QueryInterface(end));
|
||||
|
||||
// (be careful doing this outside nsEventQueueService's mEventQMonitor)
|
||||
|
||||
if (endChain) {
|
||||
int depth = 0;
|
||||
nsCOMPtr<nsPIEventQueueChain> chain = endChain;
|
||||
while (chain) {
|
||||
nsCOMPtr<nsIEventQueue> q;
|
||||
chain->GetElder(getter_AddRefs(q));
|
||||
chain = do_QueryInterface(q);
|
||||
++depth;
|
||||
if (depth > MAX_EVENTQUEUE_NESTING_DEPTH)
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
if (depth > 5) {
|
||||
char warning[80];
|
||||
PR_snprintf(warning, sizeof(warning),
|
||||
"event queue chain length is %d. this is almost certainly a leak.", depth);
|
||||
NS_WARNING(warning);
|
||||
}
|
||||
int depth = 0;
|
||||
nsEventQueueImpl *next = this;
|
||||
while (next && depth < 100) {
|
||||
next = NS_STATIC_CAST(nsEventQueueImpl *, next->mYoungerQueue);
|
||||
++depth;
|
||||
}
|
||||
if (depth > 5) {
|
||||
char warning[80];
|
||||
PR_snprintf(warning, sizeof(warning),
|
||||
"event queue chain length is %d. this is almost certainly a leak.", depth);
|
||||
NS_WARNING(warning);
|
||||
}
|
||||
#endif
|
||||
|
||||
// (be careful doing this outside nsEventQueueService's mEventQMonitor)
|
||||
|
||||
GetYoungest(getter_AddRefs(end));
|
||||
nsCOMPtr<nsPIEventQueueChain> endChain(do_QueryInterface(end));
|
||||
if (endChain) {
|
||||
endChain->SetYounger(queueChain);
|
||||
queueChain->SetElder(endChain);
|
||||
rv = NS_OK;
|
||||
|
@ -651,7 +643,7 @@ nsEventQueueImpl::GetYounger(nsIEventQueue **aQueue)
|
|||
*aQueue = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
return CallQueryInterface(mYoungerQueue, aQueue);
|
||||
return mYoungerQueue->QueryInterface(NS_GET_IID(nsIEventQueue), (void**)&aQueue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -661,7 +653,7 @@ nsEventQueueImpl::GetElder(nsIEventQueue **aQueue)
|
|||
*aQueue = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
return CallQueryInterface(mElderQueue, aQueue);
|
||||
return mElderQueue->QueryInterface(NS_GET_IID(nsIEventQueue), (void**)&aQueue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -296,24 +296,20 @@ nsEventQueueServiceImpl::PushThreadEventQueue(nsIEventQueue **aNewQueue)
|
|||
mEventQTable.Put(currentThread, newQueue);
|
||||
}
|
||||
|
||||
// append to the event queue chain -- QI the queue in the hash table
|
||||
nsCOMPtr<nsPIEventQueueChain> ourChain(do_QueryInterface(queue));
|
||||
// append to the event queue chain -- QI the queue in the hash table
|
||||
nsCOMPtr<nsPIEventQueueChain> ourChain(do_QueryInterface(queue));
|
||||
if (ourChain)
|
||||
rv = ourChain->AppendQueue(newQueue); // append new queue to it
|
||||
ourChain->AppendQueue(newQueue); // append new queue to it
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(newQueue);
|
||||
} else {
|
||||
*aNewQueue = newQueue;
|
||||
*aNewQueue = newQueue;
|
||||
|
||||
#if defined(PR_LOGGING) && defined(DEBUG_danm)
|
||||
PLEventQueue *equeue;
|
||||
(*aNewQueue)->GetPLEventQueue(&equeue);
|
||||
PR_LOG(gEventQueueLog, PR_LOG_DEBUG,
|
||||
("EventQueue: Service push queue [queue=%lx]",(long)equeue));
|
||||
++gEventQueueLogCount;
|
||||
PLEventQueue *equeue;
|
||||
(*aNewQueue)->GetPLEventQueue(&equeue);
|
||||
PR_LOG(gEventQueueLog, PR_LOG_DEBUG,
|
||||
("EventQueue: Service push queue [queue=%lx]",(long)equeue));
|
||||
++gEventQueueLogCount;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
// Release the EventQ lock...
|
||||
|
|
Загрузка…
Ссылка в новой задаче