| 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 "Requires PNaCl translation -- not supported\n"); | 244 "Requires PNaCl translation -- not supported\n"); |
| 245 nacl::MutexLocker take(&mu_); | 245 nacl::MutexLocker take(&mu_); |
| 246 *p->op_complete_ptr = true; // done... | 246 *p->op_complete_ptr = true; // done... |
| 247 p->file_info->desc = -1; // but failed. | 247 p->file_info->desc = -1; // but failed. |
| 248 NaClXCondVarBroadcast(&cv_); | 248 NaClXCondVarBroadcast(&cv_); |
| 249 return; | 249 return; |
| 250 } | 250 } |
| 251 | 251 |
| 252 if (PnaclUrls::IsPnaclComponent(mapped_url)) { | 252 if (PnaclUrls::IsPnaclComponent(mapped_url)) { |
| 253 // Special PNaCl support files, that are installed on the | 253 // Special PNaCl support files, that are installed on the |
| 254 // user machine. | 254 // user machine. This is usually for libraries, so they are not |
| 255 // executable and don't interact w/ mmap'ing and validation caching. |
| 256 uint64_t file_token_lo; |
| 257 uint64_t file_token_hi; |
| 255 int32_t fd = PnaclResources::GetPnaclFD( | 258 int32_t fd = PnaclResources::GetPnaclFD( |
| 256 plugin_, | 259 plugin_, |
| 257 PnaclUrls::PnaclComponentURLToFilename(mapped_url).c_str()); | 260 PnaclUrls::PnaclComponentURLToFilename(mapped_url).c_str(), |
| 261 false /* is_executable */, |
| 262 &file_token_lo, |
| 263 &file_token_hi); |
| 258 if (fd < 0) { | 264 if (fd < 0) { |
| 259 // We checked earlier if the pnacl component wasn't installed | 265 // We checked earlier if the pnacl component wasn't installed |
| 260 // yet, so this shouldn't happen. At this point, we can't do much | 266 // yet, so this shouldn't happen. At this point, we can't do much |
| 261 // anymore, so just continue with an invalid fd. | 267 // anymore, so just continue with an invalid fd. |
| 262 NaClLog(4, | 268 NaClLog(4, |
| 263 "OpenManifestEntry_MainThreadContinuation: " | 269 "OpenManifestEntry_MainThreadContinuation: " |
| 264 "GetReadonlyPnaclFd failed\n"); | 270 "GetReadonlyPnaclFd failed\n"); |
| 265 } | 271 } |
| 266 nacl::MutexLocker take(&mu_); | 272 nacl::MutexLocker take(&mu_); |
| 267 *p->op_complete_ptr = true; // done! | 273 *p->op_complete_ptr = true; // done! |
| 268 // TODO(ncbray): enable the fast loading and validation paths for this | |
| 269 // type of file. | |
| 270 p->file_info->desc = fd; | 274 p->file_info->desc = fd; |
| 271 NaClXCondVarBroadcast(&cv_); | 275 NaClXCondVarBroadcast(&cv_); |
| 272 NaClLog(4, | 276 NaClLog(4, |
| 273 "OpenManifestEntry_MainThreadContinuation: GetPnaclFd okay\n"); | 277 "OpenManifestEntry_MainThreadContinuation: GetPnaclFd okay\n"); |
| 274 return; | 278 return; |
| 275 } | 279 } |
| 276 | 280 |
| 277 // Hereafter, normal files. | 281 // Hereafter, normal files. |
| 278 | 282 |
| 279 // Because p is owned by the callback of this invocation, so it is necessary | 283 // Because p is owned by the callback of this invocation, so it is necessary |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 | 758 |
| 755 nacl::string ServiceRuntime::GetCrashLogOutput() { | 759 nacl::string ServiceRuntime::GetCrashLogOutput() { |
| 756 if (NULL != subprocess_.get()) { | 760 if (NULL != subprocess_.get()) { |
| 757 return subprocess_->GetCrashLogOutput(); | 761 return subprocess_->GetCrashLogOutput(); |
| 758 } else { | 762 } else { |
| 759 return std::string(); | 763 return std::string(); |
| 760 } | 764 } |
| 761 } | 765 } |
| 762 | 766 |
| 763 } // namespace plugin | 767 } // namespace plugin |
| OLD | NEW |