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 "native_client/src/trusted/plugin/service_runtime.h" | 9 #include "native_client/src/trusted/plugin/service_runtime.h" |
10 | 10 |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 if (err >= PP_OK) { | 459 if (err >= PP_OK) { |
460 *request->bytes_granted = err; | 460 *request->bytes_granted = err; |
461 } else { | 461 } else { |
462 *request->bytes_granted = 0; | 462 *request->bytes_granted = 0; |
463 } | 463 } |
464 *request->op_complete_ptr = true; | 464 *request->op_complete_ptr = true; |
465 NaClXCondVarBroadcast(&cv_); | 465 NaClXCondVarBroadcast(&cv_); |
466 // request automatically deleted | 466 // request automatically deleted |
467 } | 467 } |
468 | 468 |
469 int64_t PluginReverseInterface::RequestQuotaForWrite(nacl::string file_id, | 469 int64_t PluginReverseInterface::RequestQuotaForWrite( |
470 int64_t offset, | 470 nacl::string file_id, int64_t offset, int64_t bytes_to_write) { |
471 int64_t bytes_to_write) { | |
472 NaClLog(4, | 471 NaClLog(4, |
473 "PluginReverseInterface::RequestQuotaForWrite:" | 472 "PluginReverseInterface::RequestQuotaForWrite:" |
474 " (file_id='%s', offset=%"NACL_PRId64", bytes_to_write=%" | 473 " (file_id='%s', offset=%"NACL_PRId64", bytes_to_write=%" |
475 NACL_PRId64")\n", file_id.c_str(), offset, bytes_to_write); | 474 NACL_PRId64")\n", file_id.c_str(), offset, bytes_to_write); |
476 PP_Resource resource; | 475 PP_Resource resource; |
477 { | 476 { |
478 nacl::MutexLocker take(&mu_); | 477 nacl::MutexLocker take(&mu_); |
479 uint64_t file_key = STRTOULL(file_id.c_str(), NULL, 10); | 478 uint64_t file_key = STRTOULL(file_id.c_str(), NULL, 10); |
480 if (quota_map_.find(file_key) == quota_map_.end()) { | 479 if (quota_map_.find(file_key) == quota_map_.end()) { |
481 // Look up failed to find the requested quota managed resource. | 480 // Look up failed to find the requested quota managed resource. |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 nacl::MutexLocker take(&mu_); | 761 nacl::MutexLocker take(&mu_); |
763 return exit_status_; | 762 return exit_status_; |
764 } | 763 } |
765 | 764 |
766 void ServiceRuntime::set_exit_status(int exit_status) { | 765 void ServiceRuntime::set_exit_status(int exit_status) { |
767 nacl::MutexLocker take(&mu_); | 766 nacl::MutexLocker take(&mu_); |
768 exit_status_ = exit_status & 0xff; | 767 exit_status_ = exit_status & 0xff; |
769 } | 768 } |
770 | 769 |
771 } // namespace plugin | 770 } // namespace plugin |
OLD | NEW |