CEF / Chromium are aggressive about crashing when there's a problem. Fundamentally, I agree with that, but there are cases for us where we'd really like to avoid it.
In our app, the browsers are used to have views on data. So if a particular browser crashes we can handle that, but the problem is it crashes our entire application. 2 places that come to mind are:
1) Timeouts. The one I played around with was kConnectionTimeout in frame_impl.cc. We used to hit this reasonably often, though since the default has been changed from 4 seconds to 10 it's less frequent.
2) Out of memory.
Obviously Out of Memory is very different from Timeouts, but I'd love it if we could find a way to contain the damage to the browser and close the browser and let our overall app try to recover.
Is there a way to tell CEF to just crash the browser? Or possibly even all CEF browsers? But not our entire app?
I see in OnNoMemoryInternal where it specifically calls _exit(). There is PartitionBucket::AllocNewSuperPageSpan which has AllocFlags and it checks for kReturnNull as a potential way in, but the comments suggest that crashing is the way it's designed and possibly not easy to get around (from OnNoMemoryInternal in oom.cc)
// Kill the process. This is important for security since most of code
// does not check the result of memory allocation.
It does throw win::kOomExceptionCode before calling _exit, though I'm not sure whether that's an opportunity for me or not.
The out of memory I'm seeing now is in Chrome_IOThread
I'm not optimistic, but figured it's at least worth asking.