Make the DOM timeout clamp a preference

RESOLVED FIXED in mozilla2.0b10

Status

()

defect
P1
normal
RESOLVED FIXED
9 years ago
2 months ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

({dev-doc-complete})

Trunk
mozilla2.0b10
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

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
Last Resolved: 9 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
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.