Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: src/IceBrowserCompileServer.cpp

Issue 1052833003: First attempt to capture parser/translation errors in browser. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits and syntax errors. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceBrowserCompileServer.h ('k') | src/IceCompileServer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceBrowserCompileServer.cpp
diff --git a/src/IceBrowserCompileServer.cpp b/src/IceBrowserCompileServer.cpp
index 85c2efe89ebc11ea1530bd54c89111a747744686..92d42e28e2aaa4efc13e9c37236669f10efd04d5 100644
--- a/src/IceBrowserCompileServer.cpp
+++ b/src/IceBrowserCompileServer.cpp
@@ -81,7 +81,8 @@ 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");
+ const std::string Error = gCompileServer->getErrorStream().getContents();
+ return strdup(Error.empty() ? "Some error occurred" : Error.c_str());
}
return nullptr;
}
@@ -142,9 +143,12 @@ void BrowserCompileServer::startCompileThread(int ObjFD) {
LogStream->SetUnbuffered();
EmitStream = getOutputStream(ObjFD);
EmitStream->SetBufferSize(1 << 14);
+ std::unique_ptr<StringStream> ErrStrm(new StringStream());
+ ErrorStream = std::move(ErrStrm);
ELFStream.reset(new ELFStreamer(*EmitStream.get()));
Ctx.reset(new GlobalContext(LogStream.get(), EmitStream.get(),
- ELFStream.get(), Flags));
+ &ErrorStream->getStream(), ELFStream.get(),
+ Flags));
CompileThread = std::thread([this]() {
Ctx->initParserThread();
this->getCompiler().run(ExtraFlags, *Ctx.get(),
« no previous file with comments | « src/IceBrowserCompileServer.h ('k') | src/IceCompileServer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698