| 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( | 239 void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( |
| 240 OpenManifestEntryResource* p, | 240 OpenManifestEntryResource* p, |
| 241 int32_t err) { | 241 int32_t err) { |
| 242 OpenManifestEntryResource *open_cont; | 242 OpenManifestEntryResource *open_cont; |
| 243 UNREFERENCED_PARAMETER(err); | 243 UNREFERENCED_PARAMETER(err); |
| 244 // CallOnMainThread continuations always called with err == PP_OK. | 244 // CallOnMainThread continuations always called with err == PP_OK. |
| 245 | 245 |
| 246 NaClLog(4, "Entered OpenManifestEntry_MainThreadContinuation\n"); | 246 NaClLog(4, "Entered OpenManifestEntry_MainThreadContinuation\n"); |
| 247 | 247 |
| 248 std::string mapped_url; | 248 std::string mapped_url; |
| 249 if (!manifest_->ResolveKey(p->url, &mapped_url, | 249 std::string cache_identity; |
| 250 if (!manifest_->ResolveKey(p->url, &mapped_url, &cache_identity, |
| 250 p->error_info, &p->pnacl_translate)) { | 251 p->error_info, &p->pnacl_translate)) { |
| 251 NaClLog(4, "OpenManifestEntry_MainThreadContinuation: ResolveKey failed\n"); | 252 NaClLog(4, "OpenManifestEntry_MainThreadContinuation: ResolveKey failed\n"); |
| 252 // Failed, and error_info has the details on what happened. Wake | 253 // Failed, and error_info has the details on what happened. Wake |
| 253 // up requesting thread -- we are done. | 254 // up requesting thread -- we are done. |
| 254 nacl::MutexLocker take(&mu_); | 255 nacl::MutexLocker take(&mu_); |
| 255 *p->op_complete_ptr = true; // done... | 256 *p->op_complete_ptr = true; // done... |
| 256 *p->out_desc = -1; // but failed. | 257 *p->out_desc = -1; // but failed. |
| 257 NaClXCondVarBroadcast(&cv_); | 258 NaClXCondVarBroadcast(&cv_); |
| 258 return; | 259 return; |
| 259 } | 260 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 pp::CompletionCallback translate_callback = | 294 pp::CompletionCallback translate_callback = |
| 294 WeakRefNewCallback( | 295 WeakRefNewCallback( |
| 295 anchor_, | 296 anchor_, |
| 296 this, | 297 this, |
| 297 &PluginReverseInterface::BitcodeTranslate_MainThreadContinuation, | 298 &PluginReverseInterface::BitcodeTranslate_MainThreadContinuation, |
| 298 open_cont); | 299 open_cont); |
| 299 // Will always call the callback on success or failure. | 300 // Will always call the callback on success or failure. |
| 300 pnacl_coordinator_.reset( | 301 pnacl_coordinator_.reset( |
| 301 PnaclCoordinator::BitcodeToNative(plugin_, | 302 PnaclCoordinator::BitcodeToNative(plugin_, |
| 302 mapped_url, | 303 mapped_url, |
| 304 cache_identity, |
| 303 translate_callback)); | 305 translate_callback)); |
| 304 } | 306 } |
| 305 // p is deleted automatically | 307 // p is deleted automatically |
| 306 } | 308 } |
| 307 | 309 |
| 308 void PluginReverseInterface::StreamAsFile_MainThreadContinuation( | 310 void PluginReverseInterface::StreamAsFile_MainThreadContinuation( |
| 309 OpenManifestEntryResource* p, | 311 OpenManifestEntryResource* p, |
| 310 int32_t result) { | 312 int32_t result) { |
| 311 NaClLog(4, | 313 NaClLog(4, |
| 312 "Entered StreamAsFile_MainThreadContinuation\n"); | 314 "Entered StreamAsFile_MainThreadContinuation\n"); |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 nacl::MutexLocker take(&mu_); | 764 nacl::MutexLocker take(&mu_); |
| 763 return exit_status_; | 765 return exit_status_; |
| 764 } | 766 } |
| 765 | 767 |
| 766 void ServiceRuntime::set_exit_status(int exit_status) { | 768 void ServiceRuntime::set_exit_status(int exit_status) { |
| 767 nacl::MutexLocker take(&mu_); | 769 nacl::MutexLocker take(&mu_); |
| 768 exit_status_ = exit_status & 0xff; | 770 exit_status_ = exit_status & 0xff; |
| 769 } | 771 } |
| 770 | 772 |
| 771 } // namespace plugin | 773 } // namespace plugin |
| OLD | NEW |