Re: Standardized assertion methods

2014-06-02 Thread Neil
Mike de Boer wrote: * do_check_eq(a, b) —> equal(a, b) There's also strictEqual(a, b) for those like me who were wondering. -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.o

Re: nsRefPtr vs RefPtr

2014-05-13 Thread Neil
Brian Smith wrote: On Mon, May 12, 2014 at 9:36 AM, Kyle Huey wrote: We should get rid of RefPtr, just like we did the MFBT refcounting classes. The main thing stopping a mechanical search and replace is that the two smart pointers have different semantics around already_AddRefed/TemporaryR

PSA: nsCOMPtr is only for interfaces

2014-05-11 Thread Neil
I've landed the last bits of bug 514280 which will help to enforce this. Examples: nsCOMPtr runnable = new MyRunnable(); NS_DispatchToMainThread(runnable); This now fails to compile in debug builds. For simple cases like this just use nsCOMPtr here. For more complex cases (calling non-inter

Re: Callback from xpcom c++ in multi thread scenerio

2014-05-02 Thread Neil
lukaszb wrote: Basicly idea is easy from javascript we call "db wrapper" with take function (callback) as argument (that function implement xpidl interface with scriptable and function annotations), in "db wrapper" component we run thread where real database connection exists and fetch data,

Re: PSA: NS_IMPL_ISUPPORTS and friends are now variadic

2014-04-28 Thread Neil
Birunthan Mohanathas wrote: Note that due to technical details, the new macros will reject uses with zero variadic arguments. In such cases, you will want to continue to use the zero-numbered macro, e.g. NS_IMPL_ISUPPORTS0(nsFoo). I can't help wondering who would need to implement only nsIS

Re: OS.File design issue from bug 961080 (making downloads respect umask)

2014-04-25 Thread Neil
Wesley Hardman wrote: Shouldn't creating a file or directory, simply inherit the permissions from the parent? That is what I would expect (at least on Windows) when saving a file. Why would there be a need to explicitly set the permissions? On Windows, permissions are calculated when a fi

Re: People building and debugging Firefox on Windows wanted

2014-04-24 Thread Neil
Mike Hommey wrote: mk_add_options "export MOZ_DEBUG_FLAGS=-Z7" -Z7 is faster than -Zi? Do VS2013 users need to turn off -FS? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozil

Re: ASSERTION: bad size recorded: 'aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize

2014-04-19 Thread Neil
Kyle Huey wrote: On Fri, Apr 18, 2014 at 4:56 PM, Neil wrote: One of our compilers complains if you try to define something in a different namespace to the one in which you declared it, so the NS_IMPL_ macros need to be in the same namespace as the class. I believe using declarations

Re: ASSERTION: bad size recorded: 'aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize

2014-04-18 Thread Neil
L. David Baron wrote: Classes that use the NS_IMPL_ISUPPORTSn or NS_IMPL_ADDREF + NS_IMPL_RELEASE macros should use the fully qualified class name and not depend on being inside namespace declarations. One of our compilers complains if you try to define something in a different namespace t

Re: Landing c-c-breaking changes that remove c-c-only code from m-c

2014-04-17 Thread Neil
Henri Sivonen wrote: I am not done preparing the removal patches yet, but with my current patch queue I can already get 149 KB off of Android ARMv7 optimized apk size and 138 KB off of Android ARMv7 optimized libxul size. What would be your opinion on the interim use of ifdef (or moz.build e

Re: Oculus VR support & somehwat-non-free code in the tree

2014-04-15 Thread Neil
Mike Hoye wrote: the window-close button being right next to the send button in Thunderbird turns into a real problem after your third coffee, let me tell you. Don't you mean before your third coffee? -- Warning: May contain traces of nuts. ___ dev

Re: Enhancing product security with CSP for internal pages

2014-04-15 Thread Neil
Frederik Braun wrote: On 15.04.2014 00:43, Neil wrote: Frederik Braun wrote: A few months ago I had the idea to add a Content Security Policy (CSP) to our internal pages, like about:newtab for example. So this just applies to about: pages? Primarily yes. I think some people are

Re: Is there any replacement for Domain Policy in CAPS ( Bug 913734 )

2014-04-15 Thread Neil
xunxun wrote: 于 2014/4/15 星期二 6:46, Neil 写道: xunxun wrote: For example, I use the policy by default on my custom build: pref("capability.policy.policynames", "pcxnojs"); pref("capability.policy.pcxnojs.sites", "http://nsclick.baidu.com";); pref("

Re: Is there any replacement for Domain Policy in CAPS ( Bug 913734 )

2014-04-14 Thread Neil
xunxun wrote: For example, I use the policy by default on my custom build: pref("capability.policy.policynames", "pcxnojs"); pref("capability.policy.pcxnojs.sites", "http://nsclick.baidu.com";); pref("capability.policy.pcxnojs.javascript.enabled", "noAccess"); nsclick.baidu.com can cause firef

Re: Enhancing product security with CSP for internal pages

2014-04-14 Thread Neil
Frederik Braun wrote: A few months ago I had the idea to add a Content Security Policy (CSP) to our internal pages, like about:newtab for example. So this just applies to about: pages? -- Warning: May contain traces of nuts. ___ dev-platform mailin

Re: mozilla::Atomic considered harmful

2014-04-02 Thread Neil
Ehsan Akhgari wrote: On 2014-04-01, 8:10 PM, Martin Thomson wrote: count_type tmp = --mRefCnt; if (tmp == 0) { delete this; } And how do we enforce people to write code like the above example using the current Atomic interface? Would WARN_UNUSED_RESULT help here, so that you remember t

Re: MOZ_ASSUME_UNREACHABLE is being misused

2014-03-31 Thread Neil
Joshua Cranmer 🐧 wrote: MOZ_ASSUME_UNREACHABLE_MARKER tells the compiler that this code and everything after it can't be reached, so it need do anything. Clang will delete the code after this branch and decide to not emit any control flow. I have found this to be unhelpful when debugging bec

Re: warp, Facebook's new C/C++ preprocessor

2014-03-28 Thread Neil
Gregory Szorc wrote: I have a patch at https://hg.stage.mozaws.net/gecko-collab/rev/d6ea4c36aa65 that will change the build system to measure different phases of compiler execution. For each compile command, it essentially runs -E + -fsyntax-only + -c as separate commands and measures the res

Re: Warning about "mutating the [[Prototype]] of an object" ?

2014-03-28 Thread Neil
Boris Zbarsky wrote: On 3/28/14 2:15 PM, Gregory Szorc wrote: I'm concerned about this as well. Is the concern the spew, or the performance of changing __proto__? In practice, what gets slow with a changing __proto__ is property access on the object, because the JS engine throws away type

Re: Graceful Platform Degradation

2014-03-28 Thread Neil
Cameron Kaiser wrote: For TenFourFox, I've often toyed with implementing switches for box-shadow, blur, etc., so that people on the very low end of the spec (we still support G3 Macintoshes) can turn these rather expensive features off. I'd rather do that in a web-standard way than a one-off

Re: talk on XPCOM and String APIs

2014-03-26 Thread Neil
L. David Baron wrote: our string APIs (a bit about what the internal string APIs do and why and how to use them) I don't think we currently return terminated strings for string tail or 1-arg substring of a terminated string, I'm sure we could but there doesn't seem to be a big demand for i

Re: Strange ASSERTION: bad width: 'metrics.Width() >= 0', file nsLineLayout.cpp

2014-03-26 Thread Neil
Karl Tomlinson wrote: I'm not familiar with the "directory listing". Try typing / or ftp.mozilla.org into the URL bar. Is this something that would be expected to render reasonably, or does the RTL test include large dimensions that may lead to overflows? There appears to be no visible

Strange ASSERTION: bad width: 'metrics.Width() >= 0', file nsLineLayout.cpp

2014-03-26 Thread Neil
I tried to push a patch which changes the DOM of the HTML directory listing page but it tripped over this assertion while running an RTL test. It seems to be something to do with the reflow caused by the loading of the icons on an RTL directory listing page. What's the next step here? -- War

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.

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

2014-03-18 Thread Neil
Boris Zbarsky wrote: On 3/17/14 9:25 AM, Benjamin Smedberg wrote: Do we not have a safe way now to expose objects and functions to pages (all pages or some pages)? We have a way that can be safe as long as you're really careful about some things. e.g. if your API takes options objects, you

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

2014-03-14 Thread Neil
Boris Zbarsky wrote: Do not add new JavaScript components with DOM_OBJECT classinfo (period; I can't think of reasons this would be needed). Not that I'm planning on adding any new components, but what alternatives are there, particularly for non-core consumers? -- Warning: May contain trac

Re: Use of MOZ_ARRAY_LENGTH for static constants?

2014-03-10 Thread Neil
Ehsan Akhgari wrote: Wanting faster debug builds is a good thing. I doubt that the subject of this thread will give you those though. :-) My suggestions: first, build with --enable-debug --enable-optimize. If that is still slow enough, try profiling the build and see what jumps at you as

Re: IID Abuse

2014-03-07 Thread Neil
Benjamin Smedberg wrote: They key magic was that NS_DECLARE_STATIC_IID_ACCESSOR is specialized on the type itself and not on a dummy class. I had tried specialising on the type itself, but the way I originally did it was only a link error rather than a compile error. I had also tried templat

Re: IID Abuse

2014-03-07 Thread Neil
L. David Baron wrote: On Friday 2014-03-07 01:32 +, Neil wrote: I noticed a couple of places that queried for a concrete class which didn't have its own IID, which means that you end up querying for the base interface instead. Does the solution we use for do_QueryFrame work

IID Abuse

2014-03-06 Thread Neil
Because of the way GetIID/NS_GET_IID works, it's not very easy to get the compiler to tell you when you're doing it wrong. So far I've come up with a way to get the linker to do it. I'm trying to get the compiler to do it, but the results aren't perfect. However along the way I have noticed som

Tabs and spaces

2014-03-02 Thread Neil
I've noticed seven moz.build files containing tabs, I assume this is undesirable? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform

Re: We live in a memory-constrained world

2014-02-28 Thread Neil
Neil wrote: Henri Sivonen wrote: Any chance static atoms could reside as plain old static C data structures in the data segment of libxul.so instead of being heap-allocated? At least under MSVC, they have vtables, so they need to be constructed, so they're not static. Note that

Re: New necko cache?

2014-02-28 Thread Neil
Honza Bambas wrote: The old API talks only to the old cache. It's now used for appcache (Offline Application Cache) only. The old API doesn't emulate the new API well enough; it actually ignores failures to call onCacheEntryCheck, and reads uninitialised memory in that case. -- Warning: M

Re: Use of MOZ_ARRAY_LENGTH for static constants?

2014-02-28 Thread Neil
Ehsan Akhgari wrote: does fixing this enable you dogfood debug builds? I'm not expecting it to be a magic bullet. Where do you suggest I start? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org http

Re: We live in a memory-constrained world

2014-02-28 Thread Neil
Henri Sivonen wrote: Any chance static atoms could reside as plain old static C data structures in the data segment of libxul.so instead of being heap-allocated? At least under MSVC, they have vtables, so they need to be constructed, so they're not static. Note that their string storage is

Re: Including Adobe CMaps

2014-02-27 Thread Neil
Andreas Gal wrote: Could we compress major parts of omni.ja en block? We could for example stick all JS we load at startup into a zip with zero compression and then compress that into an outer zip. I think we already support nested containers like that. Assuming your math is correct even with

Re: Use of MOZ_ARRAY_LENGTH for static constants?

2014-02-27 Thread Neil
Ehsan Akhgari wrote: On 2014-02-26, 4:52 AM, Neil wrote: The one that I spotted is that MSVC is unable to optimise static variables, e.g. when you write static const length = ArrayLength(array); If you write this as a local then the compiler is able to optimise it away in release builds

Re: Use of MOZ_ARRAY_LENGTH for static constants?

2014-02-26 Thread Neil
Ehsan Akhgari wrote: On 2/23/14, 4:05 PM, Neil wrote: Both ArrayLength and MOZ_ARRAY_LENGTH are typesafe when compiled as C++, however ArrayLength has the disadvantage that it's not a constant expression in MSVC. In unoptimised builds this is direly slow as the templated function doe

Use of MOZ_ARRAY_LENGTH for static constants?

2014-02-23 Thread Neil
Both ArrayLength and MOZ_ARRAY_LENGTH are typesafe when compiled as C++, however ArrayLength has the disadvantage that it's not a constant expression in MSVC. In unoptimised builds this is direly slow as the templated function does not even get inlined, but even in optimised builds the MSVC com

Re: Always brace your ifs

2014-02-22 Thread Neil
Joshua Cranmer wrote: Justin Dolske wrote: But really, the best way to fix this would be to use a macro: err = SSLHashSHA1.update(&hashCtx, &foo); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(&hashCtx, &bar); SSL_ENSURE_SUCCESS(err, err); err = SSLHashSHA1.update(&hashCtx,

Re: [Proposal] Move global namespace classes under dom/events to mozilla or mozilla::dom

2014-02-21 Thread Neil
Masayuki Nakano wrote: nsDOMEvent will be just "Event". Well, only if you're using the mozilla::dom namespace. And also the header file name will be "Event.h". Won't it be "mozilla/dom/Event.h" ? -- Warning: May contain traces of nuts. ___ dev-p

Re: How to force winxp compatibility building with vc11

2014-02-21 Thread Neil
JoeS wrote: I tried hacking the following into the tail end of msvc11.bat file in mozilla-build: Try setting MOZ_MAXWINSDK=70100 Alternatively, try installing the SDK 7.1 compilers and use the msvc10.bat file. (You can still use the VS debugger.) -- Warning: May contain traces of nuts. ___

Re: New necko cache?

2014-02-20 Thread Neil
Well, that was confusing. The old contract ID was @mozilla.org/network/cache-service;1 The new contract ID is @mozilla.org/netwerk/cache-storage-service;1 Turns out that there are two differences, not one. -- Warning: May contain traces of nuts. ___ dev

Re: Wasted bytes due to padding (bug 492185)

2014-02-20 Thread Neil
Arpad Borsos wrote: I updated my methodology for finding wasted bytes in https://bugzilla.mozilla.org/show_bug.cgi?id=492185#c35. It just sums up all the stuff that clangs `-Wpadded` warnings gives us. njn suggested I post the complete list, so here goes. Feedback welcome. What do the fracti

Re: DXR now indexing comm-central

2014-02-20 Thread Neil
Erik Rose wrote: One thing I did notice in passing is that DXR doesn't provide a count of results like MXR does. It's on our roadmap (https://wiki.mozilla.org/DXR_Roadmap#UI.2FUX) but a pretty low priority atm. What's your use case, in case we should bump it up? Also I tried looking up

Re: New necko cache?

2014-02-20 Thread Neil
Honza Bambas wrote: On 2/19/2014 11:25 PM, Neil wrote: In particular, the API calls I'm interested in: 1. Given an HTTP or FTP URI, return the size of the cached data How do you do that now? Only way known to me (with the old cache is visit of a cache device). We don't ha

Re: DXR now indexing comm-central

2014-02-20 Thread Neil
Erik Rose wrote: We've just added comm-central to DXR! Great news! One thing I did notice in passing is that DXR doesn't provide a count of results like MXR does. Also I tried looking up the callers of a constexpr function and got no results. Is this because the compiler optimised them

Re: New necko cache?

2014-02-19 Thread Neil
Michal Novotny wrote: On 02/19/2014 11:50 AM, Dao wrote: On 19.02.2014 01:56, Neil wrote: In particular, I understand that there is a preference to toggle the cache. What does application code have to do in order to work with whichever cache has been enabled? Nothing? It's a diff

Re: New necko cache?

2014-02-19 Thread Neil
Honza Bambas wrote: On 2/19/2014 1:56 AM, Neil wrote: Where can I find documentation for the new necko cache? So far I've only turned up some draft planning documents. In particular, I understand that there is a preference to toggle the cache. What does application code have to do in

New necko cache?

2014-02-18 Thread Neil
Where can I find documentation for the new necko cache? So far I've only turned up some draft planning documents. In particular, I understand that there is a preference to toggle the cache. What does application code have to do in order to work with whichever cache has been enabled? -- Warning

Re: DXR UI refresh is live!

2014-02-11 Thread Neil
Edwin Flores wrote: the "click here to view all search results" link I wondered what this was, but it turns out I had disabled JavaScript in that browser. -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozi

Re: Cairo being considered as the basis of a standard C++ drawing API

2014-02-10 Thread Neil
Robert O'Callahan wrote: asm.js code must go through Web platform APIs So the preference would be an API that translates easily to canvas-2D? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org https:

Re: DXR UI refresh is live!

2014-02-08 Thread Neil
Erik Rose wrote: https://blog.mozilla.org/webdev/2014/02/07/dxr-gets-a-huge-ui-refresh/ Why are you double spacing the output and then "fixing" it by hard-coding .7 line spacing for the source and 1.4 for the line numbers? Also although most of your CSS uses classes, some of it uses :firs

Re: A proposal to reduce the number of styles in Mozilla code

2014-01-29 Thread Neil
Bobby Holley wrote: On Tue, Jan 28, 2014 at 7:15 PM, Anthony Jones wrote: There is also some vagueness and inconsistency around: bool MyClass::MyFunction() vs bool MyClass::MyFunction() I'm pretty sure the former is correct per Gecko style. Benjamin can confirm. My understanding is th

Re: Faking a locale move

2014-01-24 Thread Neil
Axel Hecht wrote: On 1/24/14 9:30 AM, Neil wrote: Since we're not allowed to move locale files on branches, is it possible for a jar.mn to refer to locale files from another part of the tree? Yes, these days you can actually do that. Look at what we're doing in mobile/andro

Re: Faking a locale move

2014-01-24 Thread Neil
Axel Hecht wrote: On 1/24/14 9:30 AM, Neil wrote: Since we're not allowed to move locale files on branches, is it possible for a jar.mn to refer to locale files from another part of the tree? Yes, these days you can actually do that. Look at what we're doing in mobile/andro

Re: Transforms and layers

2014-01-24 Thread Neil
Robert O'Callahan wrote: On Thu, Jan 23, 2014 at 12:58 PM, Neil wrote: I have a vague memory of seeing either a m.d.platform or blog post mentioning the use of transforms as an alternative to absolute or relative positioning, in particular avoiding reflows by its use of layers. Does

Faking a locale move

2014-01-24 Thread Neil
Since we're not allowed to move locale files on branches, is it possible for a jar.mn to refer to locale files from another part of the tree? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://l

Re: mozilla::arrayLength

2014-01-23 Thread Neil
Ehsan Akhgari wrote: On 1/22/2014, 7:02 PM, Neil wrote: I noticed that mozilla::arrayLength compiles very inefficiently in debug MSVC 2010 builds. Is there a way to mitigate this? Would bug 963056 help? Of course, but I didn't think of that idea until afterward. -- Warning: May co

mozilla::arrayLength

2014-01-22 Thread Neil
I noticed that mozilla::arrayLength compiles very inefficiently in debug MSVC 2010 builds. Is there a way to mitigate this? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/l

Transforms and layers

2014-01-22 Thread Neil
I have a vague memory of seeing either a m.d.platform or blog post mentioning the use of transforms as an alternative to absolute or relative positioning, in particular avoiding reflows by its use of layers. Does this apply to all transforms, in particular translate(0, 0)? Would it therefore b

Re: Reftests execute differently on Android or b2g?

2014-01-14 Thread Neil
Henri Sivonen wrote: On Wed, Jan 8, 2014 at 9:22 PM, Neil wrote: Ah, but it makes a subtle difference to the way XHR works; from a server, it will parse according to the MIME type, which was HTML in my case, but from a file:// URL, it always parses in XML, even if the document would

Re: Terminating xulrunner?

2014-01-13 Thread Neil
Mike Hommey wrote: I propose that we just stop pretending, and terminate xulrunner How would this affect the ability to build Firefox against the sdk? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla

Re: Sharing string literals

2014-01-10 Thread Neil
Nicholas Nethercote wrote: On Thu, Jan 9, 2014 at 3:33 AM, Neil wrote: Bug 514173 has landed, which makes use of the fact that code living in libxul can reasonably assume that string constants have infinite lifetime, meaning that any literal strings in libxul are shared rather than

Re: Sharing string literals

2014-01-10 Thread Neil
Benjamin Smedberg wrote: On 1/10/2014 12:19 AM, Daniel Holbert wrote: Just to be clear -- does this mean we should strictly prefer str.Assign(NS_LITERAL_STRING("foo")) over str.AssignLiteral("foo") now? For wide strings, I'm pretty sure the pattern we want is AssignLiteral(MOZ_UTF16("foo"))

Sharing string literals

2014-01-09 Thread Neil
Until today Gecko's support for string constants was quite poor. You could create a literal string or a named literal string on the stack and pass it to a method but any operation on the string ended up copying the string. In effect a literal string was a dependent string whose length was known

Re: Reftests execute differently on Android or b2g?

2014-01-08 Thread Neil
L. David Baron wrote: On Wednesday 2014-01-08 19:22 +, Neil wrote: I've tried switching to XHTML to avoid the problem, and the good news is that my XHR now loads before the screenshot is taken. The bad news is that the test still fails, as if the patch wasn't in place. I gu

Re: Reftests execute differently on Android or b2g?

2014-01-08 Thread Neil
Neil wrote: XHR's XML parsing blocks onload but its HTML parsing does not. Actually neither block onload, at least not the way I'm calling it, although the site manages to, so I'm not sure what's going on there... -- Warning: May co

Re: Reftests execute differently on Android or b2g?

2014-01-08 Thread Neil
Andrew Halberstadt wrote: On 01/07/2014 07:23 PM, Neil wrote: I tried to check in a reftest today. Apparently it fails on Android and b2g. The failure mode appears to be that the reftest takes a screenshot before the test has loaded (the page is still blank, whereas it should have a red

Re: Reftests execute differently on Android or b2g?

2014-01-08 Thread Neil
Neil wrote: I tried to check in a reftest today. Apparently it fails on Android and b2g. The failure mode appears to be that the reftest takes a screenshot before the test has loaded (the page is still blank, whereas it should have a red square for failure or a green square for success). Do

Re: JavaScript Style Guide. Emacs mode line.

2014-01-08 Thread Neil
Blair McBride wrote: I'd like to see the removal of the modelines also. A root config file is much cleaner. For the widest possible support of editors, I'd love to see a root .editorconfig file. See http://editorconfig.org/ - it's an editor-neutral config, with plugins for many editors/IDEs

Re: List of deprecated constructs [was Re: A proposal to reduce the number of styles in Mozilla code]

2014-01-07 Thread Neil
Benoit Jacob wrote: I'm scanning a function for possible early returns Good thing you don't have to deal with C++ exceptions then. -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.moz

Reftests execute differently on Android or b2g?

2014-01-07 Thread Neil
I tried to check in a reftest today. Apparently it fails on Android and b2g. The failure mode appears to be that the reftest takes a screenshot before the test has loaded (the page is still blank, whereas it should have a red square for failure or a green square for success). Do reftests execut

Re: Mozilla style guide issues, from a JS point of view

2014-01-07 Thread Neil
Martin Thomson wrote: in JS, a case that I’ve encountered several times: _classMethodName: function ReasonableClassName__classMethodName(argument1, argument2) { I thought that our debugging story had improved sufficiently that we didn't need these fake function names any more. --

Re: List of deprecated constructs [was Re: A proposal to reduce the number of styles in Mozilla code]

2014-01-07 Thread Neil
Benoit Jacob wrote: I would like a random voice in favor of deprecating NS_ENSURE_* for the reason that hiding control flow behind macros is IMO one of the most evil usage patterns of macros. So you're saying that nsresult rv = Foo(); NS_ENSURE_SUCCESS(rv, rv); is hiding the control flow o

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Neil
Ms2ger wrote: On 12/20/2013 10:55 AM, Neil wrote: I thought that it was pretty clear which smart pointer to use: That makes it quite clear it isn't clear: nsCOMPtr - interfaces nsRefPtr - concrete types RefPtr - code imported from WebKit HTH MXR claims we have three types named R

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Neil
Ehsan Akhgari wrote: To be very specific, here's a number of examples of things which our code base doesn't agree on: 1. Line endings Which is probably the easiest and least controversial thing to check for. I blame whoever it was who decided to include a vim that defaults to DOS line endi

Re: On the usefulness of style guides (Was: style guide proposal)

2013-12-20 Thread Neil
Brian Smith wrote: In PSM, we created some scoped pointer wrapper types around NSS data structures (ScopedNSSTypes.h), which are based on the MFBT scoped pointers. And, consequently, PSM has standardized on MFBT smart pointers throughout the module (there should be nsRefPtr in PSM, only RefPt

Re: (un)safety of NS_LITERAL_STRING("...").get()

2013-12-13 Thread Neil
L. David Baron wrote: const PRUnichar *comma = MOZ_UTF16(","); In the case addressed by the referenced bug, the string was used in a call to Append, which meant that this is still inefficient. The patch in the bug fixed this by switching to appending a character rather than a string. If

Re: unified build mode and memory consumption

2013-12-11 Thread Neil
Gregory Szorc wrote: On 11/30/13, 11:16 AM, Gregory Szorc wrote: On 11/30/13, 3:24 AM, smaug wrote: (Before using unified mode I didn't have mem usage problems with gcc and there was never any significant difference in build times comparing to clang.) I filed bug 944842 to have mach repor

Re: unified build mode and memory consumption

2013-11-30 Thread Neil
Gregory Szorc wrote: There are also plans to offer a build mode for non-Gecko developers that downloads a pre-built libxul so these developers don't have to spend many minutes building Gecko. Isn't it already possible to build both Firefox and Thunderbird against the libxul SDK? -- Warning

UTF16 literals

2013-11-28 Thread Neil
Can we guarantee UTF16 literals using MOZ_UTF16("wide string here") these days? I'm just reviewing a patch and it's using the old-style NS_LITERAL_STRING("wide string here").get() pattern all over. -- Warning: May contain traces of nuts. ___ dev-platf

Re: Recent build time improvements due to unified sources

2013-11-28 Thread Neil
Gabriele Svelto wrote: Another common case of OOMs are people building inside a VM. Just yesterday I helped another mozillian figure out why his FxOS build had started to fail. It turned out he was building inside a VM with too many jobs and too little memory dedicated to it. I often build

Re: Support for non-UTF-8 platform charset

2013-11-26 Thread Neil
Henri Sivonen wrote: On Windows, do we really need to pay homage to the pre-NT legacy when doing Save As? How about we just use UTF-8 for "HTML Page, complete" reserialization like on Mac? You'll need a BOM, of course. (MXR turns up so little that it makes me wonder non-UTF-8 support migh

Re: Analyze C++/compiler usage and code stats easily

2013-11-26 Thread Neil
Gregory Szorc wrote: The best way to fetch it is to pull the bookmark tracking it: $ hg pull -B gps/build/measure-compiler http://hg.gregoryszorc.com/gecko-collab Or, look for that bookmark at http://hg.gregoryszorc.com/gecko-collab/bookmarks and track down the changeset. Note that for

Re: Unified builds

2013-11-26 Thread Neil
Ehsan Akhgari wrote: It's hard to say exactly what's going on here without knowing more about how this build is produced. These are intermittent failures on TBPL, mostly starred by philor. It would be really great if you could file a bug about this with more details on how to reproduce this

Re: Recent build time improvements due to unified sources

2013-11-21 Thread Neil
Zack Weinberg wrote: On 2013-11-20 12:37 PM, Benoit Jacob wrote: Talking about ideas for further extending the impact of UNIFIED_SOURCES, it seems that the biggest limitation at the moment is that sources can't be unified between different moz.build's. Because of that, source directories tha

Test errors

2013-11-19 Thread Neil
I was pinged because running the browser-chrome tests in chunks of three makes a test that I reviewed fail by reporting an exception to the console. So I was quite surprised to find all manner of junk seems to get reported to the console in a typical test run, including such goodies as "Refere

Re: Unified builds

2013-11-18 Thread Neil
Boris Zbarsky wrote: On 11/17/13 5:26 PM, Ehsan Akhgari wrote: I don't think that we need to try to fix this problem any more than the general problem of denoting our dependencies explicitly. It's common for you to remove an #include from a header and find dozens of .cpp files in the tree t

Re: Unified builds

2013-11-18 Thread Neil
Ehsan Akhgari wrote: I've started to work on a project in my spare time to switch us to use unified builds for C/C++ compilation. The way that unified builds work is by using the UNIFIED_SOURCES instead of the SOURCES variable in moz.build files. With that, the build system creates files su

Re: Unified builds

2013-11-15 Thread Neil
Ehsan Akhgari wrote: we go down from 1m51s on my machine to 31s And how does that compare to the case where you touch one .cpp file in each subdirectory of layout? -- Warning: May contain traces of nuts. ___ dev-platform mailing list dev-platform@

Re: #ifdefing out mailnews-only code but keeping it in m-c

2013-11-12 Thread Neil
Mike Hommey wrote: Thunderbird is already linking stuff in libxul from c-c. Why wouldn't it be possible to move those bits to c-c and do the same? It's compiling components using the internal API and linking them into libxul because originally the mailnews components didn't compile against

Re: Mozilla development "bootcamp"

2013-11-05 Thread Neil
Gijs Kruitbosch wrote: I don't have all my patches applied all the time. If I work on something, leave it for 2 weeks, and qpush it again, I usually get to do the "fix all the .rej" dance. That's an interesting use case. If changeset evolution replaces mq you could just leave the commit in y

Re: Mozilla development "bootcamp"

2013-11-04 Thread Neil
Gijs Kruitbosch wrote: On 03/11/13, 11:46 , Neil wrote: 14. Rebasing a bitrotted patch 14.0 What it looks like when you qpush a patch that has conflics 14.1 Open a rej file 14.2 Apply the change to the file Shouldn't be necessary these days ;-) Uh, why not? hg pull --rebase wor

Re: Mozilla development "bootcamp"

2013-11-03 Thread Neil
bbo...@gmail.com wrote: 1.4 Initiating an hg clone You'll be lucky. You'll probably need to mention bundles. 2.0 Creating a .mozconfig file Not strictly necessary for the very first build. 4.1 Setting up mercurial.ini info for patch options and author name See also the mach co

Re: Changes to partial tree builds when not building through mach

2013-10-30 Thread Neil
Gregory Szorc wrote: OK, so you run make, make.py, or mozmake to build the tree. Do you ever perform partial tree builds? That is: |make -C dom| or |cd dom; make|. If so, you may be impacted by a recent change to the build system. If you attempt to perform a partial tree build directly with a

Re: Removing a window from the session store

2013-10-23 Thread Neil
Matthew Gertner wrote: The most flexible option might be an API to cause a window to opt out of session saving completely. Probably not relevant to you but on SeaMonkey the secret sauce to opting out of session saving is to remove the windowtype attribute very early on (onload handler is e

Re: Faster builds, now ; on windows, too.

2013-10-23 Thread Neil
Mike Hommey wrote: On Tue, Oct 22, 2013 at 10:06:13AM +0100, Neil wrote: David Rajchenbach-Teller wrote: Wouldn't it be interesting to also have a ./mach build frontend that repackages XUL and js code? Does ./mach build chrome work? make chrome/mach build chrome doesn

Re: Overriding content window methods with chrome functions

2013-10-22 Thread Neil
Matthew Gertner wrote: What exactly do you mean by setting the window to have an app docShell? You mean load it into a browser with type = "chrome"? No, I meant an app frame, but Mark's reply led me to bug 799592 comment 1 where Shane Caraveo says that an app frame doesn't look like it would

<    1   2   3   4   >