| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #define NACL_LOG_MODULE_NAME "Plugin_ServiceRuntime" | 7 #define NACL_LOG_MODULE_NAME "Plugin_ServiceRuntime" |
| 8 | 8 |
| 9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" | 9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" |
| 10 | 10 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // Clear the callback to avoid it gets invoked twice. | 231 // Clear the callback to avoid it gets invoked twice. |
| 232 crash_cb_ = pp::CompletionCallback(); | 232 crash_cb_ = pp::CompletionCallback(); |
| 233 } else { | 233 } else { |
| 234 NaClLog(1, | 234 NaClLog(1, |
| 235 "PluginReverseInterface::ReportCrash:" | 235 "PluginReverseInterface::ReportCrash:" |
| 236 " crash_cb_ not valid, skipping\n"); | 236 " crash_cb_ not valid, skipping\n"); |
| 237 } | 237 } |
| 238 } | 238 } |
| 239 | 239 |
| 240 void PluginReverseInterface::ReportExitStatus(int exit_status) { | 240 void PluginReverseInterface::ReportExitStatus(int exit_status) { |
| 241 service_runtime_->set_exit_status(exit_status); | 241 // We do nothing here; reporting exit status is handled through a separate |
| 242 // embedder interface. |
| 242 } | 243 } |
| 243 | 244 |
| 244 int64_t PluginReverseInterface::RequestQuotaForWrite( | 245 int64_t PluginReverseInterface::RequestQuotaForWrite( |
| 245 nacl::string file_id, int64_t offset, int64_t bytes_to_write) { | 246 nacl::string file_id, int64_t offset, int64_t bytes_to_write) { |
| 246 return bytes_to_write; | 247 return bytes_to_write; |
| 247 } | 248 } |
| 248 | 249 |
| 249 ServiceRuntime::ServiceRuntime(Plugin* plugin, | 250 ServiceRuntime::ServiceRuntime(Plugin* plugin, |
| 250 PP_Instance pp_instance, | 251 PP_Instance pp_instance, |
| 251 bool main_service_runtime, | 252 bool main_service_runtime, |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (reverse_service_ != NULL) | 576 if (reverse_service_ != NULL) |
| 576 reverse_service_->Unref(); | 577 reverse_service_->Unref(); |
| 577 | 578 |
| 578 rev_interface_->Unref(); | 579 rev_interface_->Unref(); |
| 579 | 580 |
| 580 anchor_->Unref(); | 581 anchor_->Unref(); |
| 581 NaClCondVarDtor(&cond_); | 582 NaClCondVarDtor(&cond_); |
| 582 NaClMutexDtor(&mu_); | 583 NaClMutexDtor(&mu_); |
| 583 } | 584 } |
| 584 | 585 |
| 585 void ServiceRuntime::set_exit_status(int exit_status) { | |
| 586 nacl::MutexLocker take(&mu_); | |
| 587 if (main_service_runtime_) | |
| 588 plugin_->set_exit_status(exit_status & 0xff); | |
| 589 } | |
| 590 | |
| 591 } // namespace plugin | 586 } // namespace plugin |
| OLD | NEW |