On 26 March 2018 at 16:53, Ben Kelly <
bke...@mozilla.com> wrote:
> On Mon, Mar 26, 2018 at 10:47 AM, Valentin Gosu <
valent...@gmail.com>
> wrote:
>
>> Yes, that is definitely something we want to fix, but not very
>> straightforward. We have quite a few URI implementations, and a bunch more
>> protocol handlers.
>>
>>
https://github.com/valenting/gecko/wiki/Threadsafe-URIs-prog
>> ress#protocol-handler-implementations
>>
>
> I wonder if it would be worth adding something like:
>
> NS_ThreadsafeNewURI()
>
> That returns an error code if it detects that the URL does not match any
> of the threadsafe URL implementations. This would allow code to try
> threadsafe parsing first and only fall back to a main thread bounce if its
> an oddball URL. Right now we hardcode a bunch of http/https/nsStandardURL
> things in various places to accomplish this.
>
>
I think that's a pretty good strategy. It allows us to progressively move
things from nsIProtocolHandler.newURI to NS_ThreadsafeNewURI.
>
>>
>> On 26 March 2018 at 15:24, Ben Kelly <
bke...@mozilla.com> wrote:
>>
>>> Do we have any plan to be able to use NS_NewURI() off-main-thread? I
>>> thought that was included here, but I see now that it is not. The initial
>>> URL parse OMT is important for truly being able to remove all our "bounce
>>> to the main thread for URL stuff" legacy code.
>>>