Coding style: Naming parameters in lambda expressions

2019-09-05 Thread Simon Giesecke
Hi, we encountered the question of how to name parameters in lambda expressions. For regular functions, the coding style implies that parameter naming should use camelCase with an "a" prefix, and this is also widely done this way. The coding style does not say anything specifically concerning lam

Range-based for and STL-style iterators for nsClassHashtable, nsDataHashtable, nsInterfaceHashtable

2019-10-02 Thread Simon Giesecke
Hi, I recently [1] added STL-style iterators and begin/cbegin/end/cend member functions to nsBaseHashtable. This means that it is now possible to use range-based for and STL algorithms operating on iterators with all of its subclasses, which include nsClassHashtable, nsDataHashtable, nsInterfaceHa

Re: Range-based for and STL-style iterators for nsClassHashtable, nsDataHashtable, nsInterfaceHashtable

2019-10-02 Thread Simon Giesecke
hat? > > Cheers, > > -- Emilio > > [1]: > https://searchfox.org/mozilla-central/rev/f372e8a46ef7659ef61be9938ec2a3ea34d343c6/layout/style/Loader.cpp#673 > > On 10/2/19 3:02 PM, Emilio Cobos Álvarez wrote: > > This is great, thanks for doing this! > > > >

String contenation and temporaries

2019-10-16 Thread Simon Giesecke
Hi, I am wondering if the following is supposed to be safe: Given a function (from https://searchfox.org/mozilla-central/source/dom/indexedDB/ActorsParent.cpp#9290): nsAutoCString MakeColumnPairSelectionList( const nsLiteralCString& aPlainColumnName, const nsLiteralCString& aLocaleAwareC

Intent to prototype and ship: IDBTransaction.commit

2019-12-12 Thread Simon Giesecke
*Summary*: IDBTransaction objects will gain a commit() function that explicitly marks a transaction as not accepting further requests. Currently, IndexedDB only commits a transaction after all associated requests have had their completion event handlers executed, and no new requests have been queue

Re: Improvements to Web IDL exception message strings

2020-02-14 Thread Simon Giesecke
Hi, helpful exception messages are very important, and ensuring that sufficient context is present is a good contribution to that. Thanks for pushing this forward! When starting work on replacing uses of the deprecated ErrorResult::Throw(nsresult), I noticed that the existing error messages show

Recent changes to nsTArray et al.

2020-05-12 Thread Simon Giesecke
Hi, I would like to share some changes (improvements) made to nsTArray and the related array classes from the nsTArray.h header file in the last months. 1. Simon added detection for several accidental misuses or disadvantageous uses at compile-time: 1a. https://bugzil.la/1628715: The member func

Additions to ResultExtensions.h and mozilla::Result

2020-05-19 Thread Simon Giesecke
Hi, as part of https://bugzil.la/1637605 I recently made some additions to the mozilla::Result integration available from mozilla/ResultExtensions.h. It adds several overloads of a ToResultInvoke function template, which kind of combines ToResult and std::invoke. It allows to call a XPCOM style f

Changes to string literals

2020-07-01 Thread Simon Giesecke
Hi, until Bug 1648010, there were some macros widely used for the handling of string literals, i.e. NS_LITERAL_STRING, NS_LITERAL_CSTRING, NS_NAMED_LITERAL_STRING, NS_NAMED_LITERAL_CSTRING. These macros have resp. will have been removed once all patches for that bug landed. The non-NAMED variants

Re: Changes to string literals

2020-07-02 Thread Simon Giesecke
ches though :-) > > Do you intend to update existing documentation at > < > https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Guide/Internal_strings > > > (or move it to firefox source docs)? > > > > Am 01.07.20 um 16:53 schrieb Simon Giesecke: > > H

Re: "static inline" in a header file is stupid, right?

2020-08-03 Thread Simon Giesecke
Hi, I think your original message was meant to be about `static inline` function definitions in a header file. To my understanding, nothing has changed with C++11/14/17 about that. However, I think it wasn't accurate before that, since there is a difference between `static inline` member functions

Improvement to build times through cleanup of C++ include dependencies

2020-12-14 Thread Simon Giesecke
tl;dr Build times on all platforms, in particular for incremental builds, have decreased in the last weeks by landing several cleanups to C++ include dependencies that reduce the aggregated number of included files by about 30%. Hi, Did you notice a reduction in build times lately? This might no

Re: Improvement to build times through cleanup of C++ include dependencies

2020-12-15 Thread Simon Giesecke
3:23 AM, Simon Giesecke wrote: > > I was using some tools to support this, notably ClangBuildAnalyzer [2] > and > > include-what-you-use [3]. ClangBuildAnalyzer helped to detect headers > that > > are expensive to parse throughout the build, and direct efforts to reduce &

Recent changes to C++ XPCOM hashtable class templates

2021-03-25 Thread Simon Giesecke
Hi, TL;DR The XPCOM hashtable types of first choice are now nsTHashMap and nsTHashSet, e.g. nsTHashMap> or nsTHashSet. The interface of nsTHashtable/nsBaseHashtable and its subtypes is maintained, after some changes had been made to these class templates themselves. In particular, nika and janv h