Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h" | 5 #include "ppapi/native_client/src/trusted/plugin/pnacl_translate_thread.h" |
| 6 | 6 |
| 7 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" | 7 #include "native_client/src/trusted/desc/nacl_desc_wrapper.h" |
| 8 #include "ppapi/native_client/src/trusted/plugin/plugin.h" | 8 #include "ppapi/native_client/src/trusted/plugin/plugin.h" |
| 9 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" | 9 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" |
| 10 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" | 10 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 std::vector<char> data; | 193 std::vector<char> data; |
| 194 data.swap(data_buffers_.front()); | 194 data.swap(data_buffers_.front()); |
| 195 data_buffers_.pop_front(); | 195 data_buffers_.pop_front(); |
| 196 NaClXMutexUnlock(&cond_mu_); | 196 NaClXMutexUnlock(&cond_mu_); |
| 197 PLUGIN_PRINTF(("StreamChunk\n")); | 197 PLUGIN_PRINTF(("StreamChunk\n")); |
| 198 if (!llc_subprocess_->InvokeSrpcMethod("StreamChunk", | 198 if (!llc_subprocess_->InvokeSrpcMethod("StreamChunk", |
| 199 "C", | 199 "C", |
| 200 ¶ms, | 200 ¶ms, |
| 201 &data[0], | 201 &data[0], |
| 202 data.size())) { | 202 data.size())) { |
| 203 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, | 203 if (llc_subprocess_->srpc_client()->GetLastError() != |
|
jvoung (off chromium)
2013/09/09 23:24:28
Could leave a comment about the difference in erro
Derek Schuff
2013/09/09 23:45:40
Done.
| |
| 204 "Compile stream chunk failed."); | 204 NACL_SRPC_RESULT_APP_ERROR) { |
| 205 return; | 205 TranslateFailed(ERROR_PNACL_LLC_INTERNAL, |
| 206 "Compile stream chunk failed."); | |
| 207 return; | |
| 208 } | |
| 209 break; | |
| 210 } else { | |
| 211 PLUGIN_PRINTF(("StreamChunk Successful\n")); | |
| 212 core->CallOnMainThread( | |
| 213 0, | |
| 214 coordinator_->GetCompileProgressCallback(data.size()), | |
| 215 PP_OK); | |
| 206 } | 216 } |
| 207 PLUGIN_PRINTF(("StreamChunk Successful\n")); | |
| 208 core->CallOnMainThread( | |
| 209 0, | |
| 210 coordinator_->GetCompileProgressCallback(data.size()), | |
| 211 PP_OK); | |
| 212 } else { | 217 } else { |
| 213 NaClXMutexUnlock(&cond_mu_); | 218 NaClXMutexUnlock(&cond_mu_); |
| 214 } | 219 } |
| 215 } | 220 } |
| 216 PLUGIN_PRINTF(("PnaclTranslateThread done with chunks\n")); | 221 PLUGIN_PRINTF(("PnaclTranslateThread done with chunks\n")); |
| 217 // Finish llc. | 222 // Finish llc. |
| 218 if (!llc_subprocess_->InvokeSrpcMethod("StreamEnd", std::string(), ¶ms)) { | 223 if (!llc_subprocess_->InvokeSrpcMethod("StreamEnd", std::string(), ¶ms)) { |
| 219 PLUGIN_PRINTF(("PnaclTranslateThread StreamEnd failed\n")); | 224 PLUGIN_PRINTF(("PnaclTranslateThread StreamEnd failed\n")); |
| 220 if (llc_subprocess_->srpc_client()->GetLastError() == | 225 if (llc_subprocess_->srpc_client()->GetLastError() == |
| 221 NACL_SRPC_RESULT_APP_ERROR) { | 226 NACL_SRPC_RESULT_APP_ERROR) { |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 353 AbortSubprocesses(); | 358 AbortSubprocesses(); |
| 354 if (translate_thread_ != NULL) | 359 if (translate_thread_ != NULL) |
| 355 NaClThreadJoin(translate_thread_.get()); | 360 NaClThreadJoin(translate_thread_.get()); |
| 356 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); | 361 PLUGIN_PRINTF(("~PnaclTranslateThread joined\n")); |
| 357 NaClCondVarDtor(&buffer_cond_); | 362 NaClCondVarDtor(&buffer_cond_); |
| 358 NaClMutexDtor(&cond_mu_); | 363 NaClMutexDtor(&cond_mu_); |
| 359 NaClMutexDtor(&subprocess_mu_); | 364 NaClMutexDtor(&subprocess_mu_); |
| 360 } | 365 } |
| 361 | 366 |
| 362 } // namespace plugin | 367 } // namespace plugin |
| OLD | NEW |