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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 p->file_info->desc = -1; // but failed. | 361 p->file_info->desc = -1; // but failed. |
362 NaClXCondVarBroadcast(&cv_); | 362 NaClXCondVarBroadcast(&cv_); |
363 } | 363 } |
364 p->MaybeRunCallback(PP_OK); | 364 p->MaybeRunCallback(PP_OK); |
365 return; | 365 return; |
366 } | 366 } |
367 | 367 |
368 if (PnaclUrls::IsPnaclComponent(mapped_url)) { | 368 if (PnaclUrls::IsPnaclComponent(mapped_url)) { |
369 // Special PNaCl support files, that are installed on the | 369 // Special PNaCl support files, that are installed on the |
370 // user machine. | 370 // user machine. |
371 int32_t fd = PnaclResources::GetPnaclFD( | 371 PP_FileHandle handle = plugin_->nacl_interface()->GetReadonlyPnaclFd( |
372 plugin_, | |
373 PnaclUrls::PnaclComponentURLToFilename(mapped_url).c_str()); | 372 PnaclUrls::PnaclComponentURLToFilename(mapped_url).c_str()); |
| 373 int32_t fd = -1; |
| 374 if (handle != PP_kInvalidFileHandle) |
| 375 fd = ConvertFileDescriptor(handle, true); |
| 376 |
374 if (fd < 0) { | 377 if (fd < 0) { |
375 // We checked earlier if the pnacl component wasn't installed | 378 // We checked earlier if the pnacl component wasn't installed |
376 // yet, so this shouldn't happen. At this point, we can't do much | 379 // yet, so this shouldn't happen. At this point, we can't do much |
377 // anymore, so just continue with an invalid fd. | 380 // anymore, so just continue with an invalid fd. |
378 NaClLog(4, | 381 NaClLog(4, |
379 "OpenManifestEntry_MainThreadContinuation: " | 382 "OpenManifestEntry_MainThreadContinuation: " |
380 "GetReadonlyPnaclFd failed\n"); | 383 "GetReadonlyPnaclFd failed\n"); |
381 } | 384 } |
382 { | 385 { |
383 nacl::MutexLocker take(&mu_); | 386 nacl::MutexLocker take(&mu_); |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 838 |
836 nacl::string ServiceRuntime::GetCrashLogOutput() { | 839 nacl::string ServiceRuntime::GetCrashLogOutput() { |
837 if (NULL != subprocess_.get()) { | 840 if (NULL != subprocess_.get()) { |
838 return subprocess_->GetCrashLogOutput(); | 841 return subprocess_->GetCrashLogOutput(); |
839 } else { | 842 } else { |
840 return std::string(); | 843 return std::string(); |
841 } | 844 } |
842 } | 845 } |
843 | 846 |
844 } // namespace plugin | 847 } // namespace plugin |
OLD | NEW |