Chromium Code Reviews| Index: src/IceBrowserCompileServer.cpp |
| diff --git a/src/IceBrowserCompileServer.cpp b/src/IceBrowserCompileServer.cpp |
| index 85c2efe89ebc11ea1530bd54c89111a747744686..fb8ce1d505a633799c356f11e5998e2a9f57f140 100644 |
| --- a/src/IceBrowserCompileServer.cpp |
| +++ b/src/IceBrowserCompileServer.cpp |
| @@ -81,7 +81,13 @@ char *onEndCallback() { |
| // TODO(jvoung): Also return an error string, and UMA data. |
| // Set up a report_fatal_error handler to grab that string. |
| if (gCompileServer->getErrorCode().value()) { |
| - return strdup("Some error occurred"); |
| + std::string Message("Some error occurred"); |
| + if (ErrorStream) { |
|
jvoung (off chromium)
2015/04/17 18:15:09
ErrorStream *should* be non-null at this point, si
Karl
2015/04/17 21:33:52
I agree that it shouldn't be null. I wasn't 100% s
|
| + std::string Error = ErrorStream->getContents(); |
| + if (!Error.empty()) |
| + Message = Error; |
| + } |
| + return strdup(Message); |
|
jvoung (off chromium)
2015/04/17 18:15:09
strdup is usually given the c_str() -- or am I mis
Karl
2015/04/17 21:33:52
My bad. Fixing.
|
| } |
| return nullptr; |
| } |
| @@ -142,9 +148,10 @@ void BrowserCompileServer::startCompileThread(int ObjFD) { |
| LogStream->SetUnbuffered(); |
| EmitStream = getOutputStream(ObjFD); |
| EmitStream->SetBufferSize(1 << 14); |
| + ErrorStream = new StringStream(); |
| ELFStream.reset(new ELFStreamer(*EmitStream.get())); |
| Ctx.reset(new GlobalContext(LogStream.get(), EmitStream.get(), |
| - ELFStream.get(), Flags)); |
| + ELFStream.get(), Flags. ErrorStream.getStream())); |
|
jvoung (off chromium)
2015/04/17 18:15:09
Should that be a comma instead of a period?
Might
Karl
2015/04/17 21:33:52
Fixed, and moved the streams into a group.
|
| CompileThread = std::thread([this]() { |
| Ctx->initParserThread(); |
| this->getCompiler().run(ExtraFlags, *Ctx.get(), |