Just in case someone screws up and uses it on a non-main thread. Bobby, any reason not to do that?
It already calls XPCJSRuntime::Get(), which calls nsXPConnect::XPConnect(), which will crash when called off the main thread. I suppose a MOZ_RELEASE_ASSERT might be a little friendlier to people debugging it.
Happy to add an assertion there, sure. MOZ_ASSERT is probably good enough given comment 1.
Ah, if we already crash then we can just mark this invalid. I wanted to make sure we didn't accidentally end up with code landing that called this from off-thread, but crashing would presumably make tests turn orange or something... ;)