summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authordschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 09:22:46 +0000
committerdschuff@chromium.org <dschuff@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-10 09:22:46 +0000
commitec5bdb1f081e81b0594bbdff87360de77b27645b (patch)
tree80c835722c2c1758d6c4d8aee74276533598a0dd /ppapi
parent5a991a2d02f5506288998ea73b619834f5c10920 (diff)
downloadchromium_src-ec5bdb1f081e81b0594bbdff87360de77b27645b.zip
chromium_src-ec5bdb1f081e81b0594bbdff87360de77b27645b.tar.gz
chromium_src-ec5bdb1f081e81b0594bbdff87360de77b27645b.tar.bz2
PNaCl Coordinator: Run StreamEnd RPC even if StreamChunk fails
If the StreamChunk RPC fails, the coordinator currently reports an error and aborts immedately, but this leaves no useful information for the user or developer. Instead, call the StreamEnd RPC which returns a string describing the error (but only if the RPC error was reported by the application on the other end, and not an error with the RPC itself). Also disable the PnaclErrorHandling test until the translator change in https://codereview.chromium.org/23753003/ rolls into Chrome (since it, combined with this change, will improve the error message reported by the translator). R=jvoung@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3519 TEST=NaClBrowserTestPnacl.ErrorHandling Review URL: https://chromiumcodereview.appspot.com/23946004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.cc26
1 files changed, 18 insertions, 8 deletions
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 b27bad1..d51efe4 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_);
}