Closed Bug 625256 Opened 14 years ago Closed 13 years ago

Make the DOM timeout clamp a preference

Categories

(Core :: DOM: Core & HTML, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla2.0b10

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 1 obsolete file)

This should be pretty easy to do, and would make it easier for nightly testers to experiment with different values, or for us to change the pref early in a release cycles and then backtrack later if issues arise.
Assignee: nobody → bzbarsky
Whiteboard: [need review]
Comment on attachment 503389 [details] [diff] [review]
Make the DOM timeout clamp a pref, but enforce that it's nonnegative.

>diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
>--- a/dom/base/nsGlobalWindow.cpp
>+++ b/dom/base/nsGlobalWindow.cpp
>@@ -265,18 +265,22 @@ PRInt32 gTimeoutCnt                     
> #if !(defined(NS_DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
> static PRBool               gDOMWindowDumpEnabled      = PR_FALSE;
> #endif
> 
> #if defined(DEBUG_bryner) || defined(DEBUG_chb)
> #define DEBUG_PAGE_CACHE
> #endif
> 
>-// The shortest interval/timeout we permit
>-#define DOM_MIN_TIMEOUT_VALUE 6 // 6ms
>+// The default shortest interval/timeout we permit
>+#define DEFAULT_MIN_TIMEOUT_VALUE 10 // 10ms
>+static PRInt32 gMinTimeoutValue;
>+static inline PRInt32 DOMMinTimeoutValue() {
>+  return PR_MAX(gMinTimeoutValue, 0);

NS_MAX?
Er, yes.  Consider that fixed.
Attachment #503389 - Attachment is obsolete: true
Attachment #503389 - Flags: review?(jst)
Attachment #503496 - Flags: review?(jst) → review+
Whiteboard: [need review] → [need approval]
Attachment #503496 - Flags: approval2.0?
Attachment #503496 - Flags: approval2.0? → approval2.0+
Whiteboard: [need approval] → [need landing]
Pushed http://hg.mozilla.org/mozilla-central/rev/0fc37288b720
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla2.0b10
The pref is "dom.min_timeout_value" (in ms) and it should be mentioned on https://developer.mozilla.org/en/DOM/window.setTimeout#Minimum_delay_and_timeout_nesting
Keywords: dev-doc-needed
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: