Closed Bug 681555 Opened 8 years ago Closed 8 years ago

Encourage Components.utils.Sandbox callers to specify a sandboxName

Categories

(addons.mozilla.org Graveyard :: Add-on Validation, defect, P3, minor)

Tracking

(Not tracked)

RESOLVED WONTFIX
Q3 2011

People

(Reporter: jruderman, Unassigned)

References

Details

(Whiteboard: [MemShrink:P3])

Add-ons that use sandboxName are less likely to produce *mysterious* memory use increases.
What's the end goal for this bug -- what has to happen for it to be fixed?  Is it just documentation or something else?
A warning from amo-validator if extensions call Components.utils.Sandbox without specifying a name.
Whiteboard: [MemShrink] → [MemShrink:P3]
a?jorgev?

What is the text for this?
Ugh, that constructor interface sucks...

I guess we want to show a warning whenever Components.utils.Sandbox is used in an extension. Trying to figure out when the name is present will always be unreliable, so we shouldn't even try.

The warning should say something like: "Sandbox objects should always be created with a sandboxName to prevent memory problems. Read this documentation for more: https://developer.mozilla.org/en/Components.utils.Sandbox".
Severity: enhancement → minor
Priority: -- → P3
Target Milestone: --- → Q3 2011
(In reply to Jorge Villalobos [:jorgev] from comment #4)
> "Sandbox objects should always be
> created with a sandboxName to prevent memory problems."

Nit: I wouldn't say "to prevent memory problems", I'd say something like "because it helps memory profiling tools provide more information".
In that case it should be an informative message, not a warning.
In bug 681556 the default sandboxName is set to the caller's filename, so there are no more nameless sandboxes in about:memory.

Shouldn't https://developer.mozilla.org/en/Components.utils.Sandbox be updated with "the default value of sandboxName is set to the caller's filename"?
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
> Shouldn't https://developer.mozilla.org/en/Components.utils.Sandbox be
> updated with "the default value of sandboxName is set to the caller's
> filename"?

Yes!  I added "As of Gecko 13, if you don't specify a sandbox name it will default to the caller's filename."  (CC'ing Sheppy in case my use of "Gecko 13" doesn't match the preferred style.)
Resolution: FIXED → WONTFIX
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.