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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 p->file_info->desc = fd; | 330 p->file_info->desc = fd; |
331 NaClXCondVarBroadcast(&cv_); | 331 NaClXCondVarBroadcast(&cv_); |
332 NaClLog(4, | 332 NaClLog(4, |
333 "OpenManifestEntry_MainThreadContinuation: GetPnaclFd okay\n"); | 333 "OpenManifestEntry_MainThreadContinuation: GetPnaclFd okay\n"); |
334 } | 334 } |
335 } else { | 335 } else { |
336 // Requires PNaCl translation. | 336 // Requires PNaCl translation. |
337 NaClLog(4, | 337 NaClLog(4, |
338 "OpenManifestEntry_MainThreadContinuation: " | 338 "OpenManifestEntry_MainThreadContinuation: " |
339 "pulling down and translating.\n"); | 339 "pulling down and translating.\n"); |
340 if (plugin_->nacl_interface()->IsPnaclEnabled()) { | 340 CHECK(plugin_->nacl_interface()->IsPnaclEnabled()); |
341 pp::CompletionCallback translate_callback = | 341 pp::CompletionCallback translate_callback = |
342 WeakRefNewCallback( | 342 WeakRefNewCallback( |
343 anchor_, | 343 anchor_, |
344 this, | 344 this, |
345 &PluginReverseInterface::BitcodeTranslate_MainThreadContinuation, | 345 &PluginReverseInterface::BitcodeTranslate_MainThreadContinuation, |
346 open_cont); | 346 open_cont); |
347 // Will always call the callback on success or failure. | 347 // Will always call the callback on success or failure. |
348 pnacl_coordinator_.reset( | 348 pnacl_coordinator_.reset( |
349 PnaclCoordinator::BitcodeToNative(plugin_, | 349 PnaclCoordinator::BitcodeToNative(plugin_, |
350 mapped_url, | 350 mapped_url, |
351 pnacl_options, | 351 pnacl_options, |
352 translate_callback)); | 352 translate_callback)); |
353 } else { | |
354 nacl::MutexLocker take(&mu_); | |
355 *p->op_complete_ptr = true; // done... | |
356 p->file_info->desc = -1; // but failed. | |
357 p->error_info->SetReport(ERROR_PNACL_NOT_ENABLED, | |
358 "ServiceRuntime: GetPnaclFd failed -- pnacl not " | |
359 "enabled with --enable-pnacl."); | |
360 NaClXCondVarBroadcast(&cv_); | |
361 return; | |
362 } | |
363 } | 353 } |
364 // p is deleted automatically | 354 // p is deleted automatically |
365 } | 355 } |
366 | 356 |
367 void PluginReverseInterface::StreamAsFile_MainThreadContinuation( | 357 void PluginReverseInterface::StreamAsFile_MainThreadContinuation( |
368 OpenManifestEntryResource* p, | 358 OpenManifestEntryResource* p, |
369 int32_t result) { | 359 int32_t result) { |
370 NaClLog(4, | 360 NaClLog(4, |
371 "Entered StreamAsFile_MainThreadContinuation\n"); | 361 "Entered StreamAsFile_MainThreadContinuation\n"); |
372 | 362 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 866 |
877 nacl::string ServiceRuntime::GetCrashLogOutput() { | 867 nacl::string ServiceRuntime::GetCrashLogOutput() { |
878 if (NULL != subprocess_.get()) { | 868 if (NULL != subprocess_.get()) { |
879 return subprocess_->GetCrashLogOutput(); | 869 return subprocess_->GetCrashLogOutput(); |
880 } else { | 870 } else { |
881 return std::string(); | 871 return std::string(); |
882 } | 872 } |
883 } | 873 } |
884 | 874 |
885 } // namespace plugin | 875 } // namespace plugin |
OLD | NEW |