Make the DOM timeout clamp a preference

RESOLVED FIXED in mozilla2.0b10

Status

()

Core
DOM
P1
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: bz, Assigned: bz)

Tracking

({dev-doc-complete})

Trunk
mozilla2.0b10
dev-doc-complete
Points:
---
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.
Created attachment 503389 [details] [diff] [review]
Make the DOM timeout clamp a pref, but enforce that it's nonnegative.
Attachment #503389 - Flags: review?(jst)
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)
Created attachment 503496 [details] [diff] [review]
Make the DOM timeout clamp a pref, but enforce that it's nonnegative.
Attachment #503496 - Flags: review?(jst)

Updated

6 years ago
Attachment #503496 - Flags: review?(jst) → review+
Whiteboard: [need review] → [need approval]
Attachment #503496 - Flags: approval2.0?

Updated

6 years ago
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: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla2.0b10

Comment 6

6 years ago
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
Documentation updated:

https://developer.mozilla.org/en/DOM/window.setTimeout#Minimum_delay_and_timeout_nesting
https://developer.mozilla.org/en/Preferences/Mozilla_preferences_for_uber-geeks#DOM_preferences

And added a note to Firefox 4 for developers.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.