Closed Bug 1250234 Opened 8 years ago Closed 8 years ago
Socket::Create And Dispatch Message Event can leave stray exceptions on JSContexts
Say we get into this code. We set up an AutoJSAPI, then do some stuff like allocate strings and blob buffers and whatnot. Those things can throw OOM. And then we just leave it hanging out on the JSContext. The good news is that we can just take ownership of error reporting on the AutoJSAPI and things will be good.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Could we please make AutoJSAPI less error prone to use when dealing with exceptions. It is guaranteed that we'll forget to use TakeOwnershipOfErrorReporting() when needed. I think AutoJSAPI ctor or Init should take some non-optional enum value to indicate the exception handling. Or should AutoJSAPI always handle exceptions and then in some special cases one could prevent that?
> Or should AutoJSAPI always handle exceptions and then in some special cases one could prevent that? That's the plan in general. That's what bug 1072144 is on the way to, for example.
Attachment #8722101 - Flags: review?(khuey) → review+
You need to log in before you can comment on or make changes to this bug.