Chromium Code Reviews| Index: components/nacl/loader/nacl_listener.cc |
| diff --git a/components/nacl/loader/nacl_listener.cc b/components/nacl/loader/nacl_listener.cc |
| index 433d9417d2abd291e532156de13b676ba6c57a4c..6871b7231b4ef42936a479b23ddfb244a5ac08d0 100644 |
| --- a/components/nacl/loader/nacl_listener.cc |
| +++ b/components/nacl/loader/nacl_listener.cc |
| @@ -117,6 +117,15 @@ void DebugStubPortSelectedHandler(uint16_t port) { |
| #endif |
| +void FatalLogHandler(const char* buf, size_t bytes) { |
| + NaClTrustedListener::Get()->Send( |
| + new NaClProcessHostMsg_FatalLogReceived(std::string(buf, bytes))); |
| + |
| + // Give the IPC task runner 50ms to try to send the fatal log message. |
| + NaClTrustedListener::Get()->FlushIpcTaskRunner( |
| + base::TimeDelta::FromMilliseconds(50)); |
|
dmichael (off chromium)
2014/07/30 20:18:52
I think I'd rather see a SendFatalLog method on Na
|
| +} |
| + |
| // Creates the PPAPI IPC channel between the NaCl IRT and the host |
| // (browser/renderer) process, and starts to listen it on the thread where |
| // the given message_loop_proxy runs. |
| @@ -281,6 +290,9 @@ void NaClListener::OnStart(const nacl::NaClStartParams& params) { |
| struct NaClApp* nap = NULL; |
| NaClChromeMainInit(); |
| + |
| + NaClSetFatalErrorCallback(&FatalLogHandler); |
| + |
| nap = NaClAppCreate(); |
| if (nap == NULL) { |
| LOG(ERROR) << "NaClAppCreate() failed"; |