mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-07 15:12:28 +00:00
Fixing bug 123273. Don't let JS timeouts run with 0 delay, always force at least a 10ms delay. r=bzbarsky@mit.edu, sr=rpotts@netscape.com
This commit is contained in:
parent
57e782b463
commit
53ecd021aa
@ -144,6 +144,9 @@
|
||||
#include "nsIXBLService.h"
|
||||
|
||||
|
||||
#define DOM_MIN_TIMEOUT_VALUE 10 // 10ms
|
||||
|
||||
|
||||
static nsIEntropyCollector* gEntropyCollector = nsnull;
|
||||
static PRInt32 gRefCnt = 0;
|
||||
nsIXPConnect *GlobalWindowImpl::sXPConnect = nsnull;
|
||||
@ -4264,6 +4267,13 @@ GlobalWindowImpl::SetTimeoutOrInterval(PRBool aIsInterval, PRInt32 *aReturn)
|
||||
return ncc->SetExceptionWasThrown(PR_TRUE);
|
||||
}
|
||||
|
||||
if (interval < DOM_MIN_TIMEOUT_VALUE) {
|
||||
// Don't allow timeouts less than DOM_MIN_TIMEOUT_VALUE from
|
||||
// now...
|
||||
|
||||
interval = DOM_MIN_TIMEOUT_VALUE;
|
||||
}
|
||||
|
||||
timeout = new nsTimeoutImpl();
|
||||
if (!timeout)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
Loading…
x
Reference in New Issue
Block a user