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

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

Issue 383213005: Pepper: Clarify end-of-bitcode-stream behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
index 53cba75139bf61acafdf4e1fddf5174124af636b..3669159f5e387c276daefd2907859bfcdba668fd 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
@@ -444,10 +444,15 @@ void PnaclCoordinator::BitcodeStreamGotData(int32_t pp_error,
NACL_PRId32 ", data=%p)\n", pp_error, data ? &(*data)[0] : 0));
DCHECK(translate_thread_.get());
- translate_thread_->PutBytes(data, pp_error);
- // If pp_error > 0, then it represents the number of bytes received.
- if (data && pp_error > 0)
+ // When we have received data, pp_error is set to the number of bytes
+ // received.
+ if (pp_error > 0) {
+ CHECK(data);
+ translate_thread_->PutBytes(data, pp_error);
pexe_size_ += pp_error;
+ } else {
+ translate_thread_->EndStream();
+ }
}
StreamCallback PnaclCoordinator::GetCallback() {
« no previous file with comments | « no previous file | ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698