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

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc

Issue 23946004: PNaCl Coordinator: Run StreamEnd RPC even if StreamChunk fails (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « chrome/test/data/nacl/pnacl_error_handling/pnacl_error_handling.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
index b27bad16590df8d456eb87dc6da9a7bb93c9116d..d51efe45f6ba57103377f2688154f32a48ccfbcb 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc
@@ -200,15 +200,25 @@ void PnaclTranslateThread::DoTranslate() {
&params,
&data[0],
data.size())) {
- TranslateFailed(ERROR_PNACL_LLC_INTERNAL,
- "Compile stream chunk failed.");
- return;
+ if (llc_subprocess_->srpc_client()->GetLastError() !=
+ NACL_SRPC_RESULT_APP_ERROR) {
+ // If the error was reported by the translator, then we fall through
+ // and call StreamEnd, which returns a string describing the error,
+ // which we can then send to the Javascript console. Otherwise just
+ // fail here, since the translator has probably crashed or asserted.
+ TranslateFailed(ERROR_PNACL_LLC_INTERNAL,
+ "Compile stream chunk failed. "
+ "The PNaCl translator has probably crashed.");
+ return;
+ }
+ break;
+ } else {
+ PLUGIN_PRINTF(("StreamChunk Successful\n"));
+ core->CallOnMainThread(
+ 0,
+ coordinator_->GetCompileProgressCallback(data.size()),
+ PP_OK);
}
- PLUGIN_PRINTF(("StreamChunk Successful\n"));
- core->CallOnMainThread(
- 0,
- coordinator_->GetCompileProgressCallback(data.size()),
- PP_OK);
} else {
NaClXMutexUnlock(&cond_mu_);
}
« no previous file with comments | « chrome/test/data/nacl/pnacl_error_handling/pnacl_error_handling.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698