Re: Representing a pointer to static in XPConnected JS?

2017-05-05 Thread Boris Zbarsky
On 5/5/17 2:57 PM, Henri Sivonen wrote: I'm not sure what chrome JS runs on non-main threads and if there's non-main-thread chrome JS doing things like obtain an encoding name from a channel and pass it to the UTF8 converter service. There's nothing like that going on. This seems complicated

Re: Representing a pointer to static in XPConnected JS?

2017-05-05 Thread Henri Sivonen
On Fri, May 5, 2017 at 6:02 PM, Boris Zbarsky wrote: > I'm not sure this is going to work in this case. WebIDL interfaces that > don't require refcounting basically require that the JS object owns the C++ > thing; it will delete it when finalized. > > You could do non-virtual no-op refcounting.

Re: Representing a pointer to static in XPConnected JS?

2017-05-05 Thread Boris Zbarsky
On 5/5/17 4:09 AM, Henri Sivonen wrote: On Thu, May 4, 2017 at 7:39 PM, Nathan Froyd wrote: I think you could possibly make your things a WebIDL interface, which don't require refcounting, and magically make the WebIDL interfaces work with XPIDL, but I do not know the details there. I'll keep

Re: Representing a pointer to static in XPConnected JS?

2017-05-05 Thread Henri Sivonen
On Thu, May 4, 2017 at 7:39 PM, Nathan Froyd wrote: > On Thu, May 4, 2017 at 12:32 PM, Henri Sivonen wrote: >> On Thu, May 4, 2017 at 4:27 PM, Nathan Froyd wrote: >>> On Thu, May 4, 2017 at 3:08 AM, Henri Sivonen wrote: Is it feasible (with reasonably low effort) to introduce a new XPIDL >

Re: Representing a pointer to static in XPConnected JS?

2017-05-04 Thread Nathan Froyd
On Thu, May 4, 2017 at 12:32 PM, Henri Sivonen wrote: > On Thu, May 4, 2017 at 4:27 PM, Nathan Froyd wrote: >> On Thu, May 4, 2017 at 3:08 AM, Henri Sivonen wrote: >>> Is it feasible (with reasonably low effort) to introduce a new XPIDL >>> type that is a pointer to a non-refcounted immutable st

Re: Representing a pointer to static in XPConnected JS?

2017-05-04 Thread Henri Sivonen
On Thu, May 4, 2017 at 4:27 PM, Nathan Froyd wrote: > On Thu, May 4, 2017 at 3:08 AM, Henri Sivonen wrote: >> Is it feasible (with reasonably low effort) to introduce a new XPIDL >> type that is a pointer to a non-refcounted immutable static object in >> C++ and still gets bridged to JS? > > You

Re: Representing a pointer to static in XPConnected JS?

2017-05-04 Thread Nathan Froyd
On Thu, May 4, 2017 at 3:08 AM, Henri Sivonen wrote: > Is it feasible (with reasonably low effort) to introduce a new XPIDL > type that is a pointer to a non-refcounted immutable static object in > C++ and still gets bridged to JS? You can certainly have static objects with what amount to dummy A

Re: Representing a pointer to static in XPConnected JS?

2017-05-04 Thread Henri Sivonen
On Thu, May 4, 2017 at 10:08 AM, Henri Sivonen wrote: > Is it feasible (with reasonably low effort) to introduce a new XPIDL > type that is a pointer to a non-refcounted immutable static object in > C++ and still gets bridged to JS? My question was underspecified. At minimum, the JS bridging shou

Representing a pointer to static in XPConnected JS?

2017-05-04 Thread Henri Sivonen
Our codebase has the conceptual design flaw of representing character encodings as nsACStrings holding the name of the encoding instead of having a type-safe representation. This causes ambiguity between strings that are external protocol text designating an encoding ("label" in spec speak; many la