Too many system compartments at start-up

2014-03-20 Thread Nicholas Nethercote
Hi, At start-up, with a new profile, Firefox creates more than 230 system compartments. This is about 90 more than a year ago, and it's part of the reason why Firefox uses almost twice as much physical memory at start-up than it did two years ago. (Have a look at https://areweslimyet.com/ for the

Re: Please do not add new web-exposed XPCOM objects

2014-03-20 Thread Bobby Holley
On Thu, Mar 20, 2014 at 5:52 PM, Neil wrote: > >> > Sure, but the old category only installed the object on demand, so this is > a backward step... What is your concern, exactly? Performance? I doubt it's significant. You could define the object with lazy getters if you wanted. bholley ___

Re: Should nsIPrefBranch.set*Pref return NS_ERROR_UNEXPECTED on type mismatch?

2014-03-20 Thread Gavin Sharp
On Thu, Mar 20, 2014 at 10:38 AM, Irving Reid wrote: > For unknown reasons, internal bookkeeping prefs used by AddonManager and > XPIProvider are set to values of the wrong type on some Firefox profiles, > and are now stuck that way. I can write wrapper code on these calls to catch > the error and

Re: Should nsIPrefBranch.set*Pref return NS_ERROR_UNEXPECTED on type mismatch?

2014-03-20 Thread Neil
Irving Reid wrote: For unknown reasons, internal bookkeeping prefs used by AddonManager and XPIProvider are set to values of the wrong type on some Firefox profiles, and are now stuck that way. I can write wrapper code on these calls to catch the error and clear the broken preference, but I w

Re: Please do not add new web-exposed XPCOM objects

2014-03-20 Thread Neil
Bobby Holley wrote: On Tue, Mar 18, 2014 at 6:53 AM, Neil wrote: Let's suppose that I want to provide a global property that provides 5 functions each with a number of string arguments. (Traditionally this would be done using a component in the JavaScript global property category.) How woul

Re: Should nsIPrefBranch.set*Pref return NS_ERROR_UNEXPECTED on type mismatch?

2014-03-20 Thread Gregory Szorc
On 3/20/14, 10:50 AM, Gregory Szorc wrote: On 3/20/14, 10:38 AM, Irving Reid wrote: Looking into some odd exceptions in the Addon Manager (bug 985998), I found that the behaviour of the Preference service is: a) We infer the type of a preference from the data read in from prefs.js (see e.g. htt

Re: Should nsIPrefBranch.set*Pref return NS_ERROR_UNEXPECTED on type mismatch?

2014-03-20 Thread Irving Reid
On 2014-03-20 1:50 PM, Gregory Szorc wrote: On 3/20/14, 10:38 AM, Irving Reid wrote: ... For unknown reasons, internal bookkeeping prefs used by AddonManager and XPIProvider are set to values of the wrong type on some Firefox profiles, and are now stuck that way. I can write wrapper code on the

Re: Should nsIPrefBranch.set*Pref return NS_ERROR_UNEXPECTED on type mismatch?

2014-03-20 Thread Gregory Szorc
On 3/20/14, 10:38 AM, Irving Reid wrote: Looking into some odd exceptions in the Addon Manager (bug 985998), I found that the behaviour of the Preference service is: a) We infer the type of a preference from the data read in from prefs.js (see e.g. http://dxr.mozilla.org/mozilla-central/source/m

Should nsIPrefBranch.set*Pref return NS_ERROR_UNEXPECTED on type mismatch?

2014-03-20 Thread Irving Reid
Looking into some odd exceptions in the Addon Manager (bug 985998), I found that the behaviour of the Preference service is: a) We infer the type of a preference from the data read in from prefs.js (see e.g. http://dxr.mozilla.org/mozilla-central/source/modules/libpref/src/prefread.cpp#288)

Re: Intent to ship: CSS.escape

2014-03-20 Thread Anne van Kesteren
On Thu, Mar 20, 2014 at 3:17 PM, Boris Zbarsky wrote: > http://dev.w3.org/csswg/cssom/#the-css.escape%28%29-method which allows web > pages to create a valid CSS identifier that will parse to a given string. A > typical use case is: > > document.querySelector('#' + CSS.escape(stringIDontControl

Intent to ship: CSS.escape

2014-03-20 Thread Boris Zbarsky
CSS.escape is an API defined at http://dev.w3.org/csswg/cssom/#the-css.escape%28%29-method which allows web pages to create a valid CSS identifier that will parse to a given string. A typical use case is: document.querySelector('#' + CSS.escape(stringIDontControl)) Unless there are objecti

Re: DXR gets multi-line highlighting

2014-03-20 Thread Erik Rose
> Note that for this, analysis of the tip of each of -release, -beta, > -aurora and -esr* would be enough. That's significantly more than just > doing -central, but it's also significantly less than doing every single > revision. That is planned! ___ dev

Re: DXR gets multi-line highlighting

2014-03-20 Thread Erik Rose
Great; stories of personal use habits are incredibly helpful. Thanks! Hmm, that gives me an idea: maybe I'll use Mozilla Moderator at some point to collect some use cases We ought to be able to support coloring and highlighting on old revs within DXR. We'll head that direction, freshly reas

Re: Memory management in features implemented in JS

2014-03-20 Thread smaug
On 03/20/2014 12:37 PM, David Rajchenbach-Teller wrote: So basically, you want to add a finalizer for JS component? No. It would be callback to tell when the thing (wrappedJS) we have a weakref to is going away. And wrappedJS keeps then a weak ref to the JS object. As far as I see, this would b

Re: Memory management in features implemented in JS

2014-03-20 Thread K. Gadd
Keep in mind that es-discuss has hosted frequent, detailed discussions on the topic of weak references and it is quite possible that they could be introduced in ES7 or ES8 (at least based on what has been said on the list), due to their requirement for solving certain problems in large-scale applic

Re: Memory management in features implemented in JS

2014-03-20 Thread David Rajchenbach-Teller
So basically, you want to add a finalizer for JS component? Note that we already have a weak (post-mortem) finalization module for JS, hidden somewhere in mozilla-central. It's not meant to be used for performance critical code, and it provides no guarantees about cycles, but if this is necessary,

Re: Memory management in features implemented in JS

2014-03-20 Thread Gijs Kruitbosch
On 20/03/2014 02:25, Boris Zbarsky wrote: On 3/19/14 9:41 PM, Justin Dolske wrote: It uses a weak reference with the observer service, plus a dummy strong reference (via addEventListener()) to automatically manage the lifetime... When the node/document does away, so does the event listener. Th