| 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 PP_NACL_ERROR_SEL_LDR_CREATE_LAUNCHER, | 391 PP_NACL_ERROR_SEL_LDR_CREATE_LAUNCHER, |
| 392 "ServiceRuntime: failed to create sel_ldr launcher"); | 392 "ServiceRuntime: failed to create sel_ldr launcher"); |
| 393 ReportLoadError(error_info); | 393 ReportLoadError(error_info); |
| 394 pp::Module::Get()->core()->CallOnMainThread(0, callback, PP_ERROR_FAILED); | 394 pp::Module::Get()->core()->CallOnMainThread(0, callback, PP_ERROR_FAILED); |
| 395 return; | 395 return; |
| 396 } | 396 } |
| 397 | 397 |
| 398 bool enable_dev_interfaces = | 398 bool enable_dev_interfaces = |
| 399 GetNaClInterface()->DevInterfacesEnabled(pp_instance_); | 399 GetNaClInterface()->DevInterfacesEnabled(pp_instance_); |
| 400 | 400 |
| 401 tmp_subprocess->Start(pp_instance_, | 401 GetNaClInterface()->LaunchSelLdr( |
| 402 main_service_runtime_, | 402 pp_instance_, |
| 403 params.url.c_str(), | 403 PP_FromBool(main_service_runtime_), |
| 404 ¶ms.file_info, | 404 params.url.c_str(), |
| 405 params.uses_irt, | 405 ¶ms.file_info, |
| 406 params.uses_ppapi, | 406 PP_FromBool(params.uses_irt), |
| 407 uses_nonsfi_mode_, | 407 PP_FromBool(params.uses_ppapi), |
| 408 enable_dev_interfaces, | 408 PP_FromBool(uses_nonsfi_mode_), |
| 409 params.enable_dyncode_syscalls, | 409 PP_FromBool(enable_dev_interfaces), |
| 410 params.enable_exception_handling, | 410 PP_FromBool(params.enable_dyncode_syscalls), |
| 411 params.enable_crash_throttling, | 411 PP_FromBool(params.enable_exception_handling), |
| 412 callback); | 412 PP_FromBool(params.enable_crash_throttling), |
| 413 tmp_subprocess->mutable_channel(), |
| 414 callback.pp_completion_callback()); |
| 413 subprocess_.reset(tmp_subprocess.release()); | 415 subprocess_.reset(tmp_subprocess.release()); |
| 414 } | 416 } |
| 415 | 417 |
| 416 bool ServiceRuntime::WaitForSelLdrStart() { | 418 bool ServiceRuntime::WaitForSelLdrStart() { |
| 417 // Time to wait on condvar (for browser to create a new sel_ldr process on | 419 // Time to wait on condvar (for browser to create a new sel_ldr process on |
| 418 // our behalf). Use 6 seconds to be *fairly* conservative. | 420 // our behalf). Use 6 seconds to be *fairly* conservative. |
| 419 // | 421 // |
| 420 // On surfaway, the CallOnMainThread above may never get scheduled | 422 // On surfaway, the CallOnMainThread above may never get scheduled |
| 421 // to unblock this condvar, or the IPC reply from the browser to renderer | 423 // to unblock this condvar, or the IPC reply from the browser to renderer |
| 422 // might get canceled/dropped. However, it is currently important to | 424 // might get canceled/dropped. However, it is currently important to |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 626 |
| 625 nacl::string ServiceRuntime::GetCrashLogOutput() { | 627 nacl::string ServiceRuntime::GetCrashLogOutput() { |
| 626 if (NULL != subprocess_.get()) { | 628 if (NULL != subprocess_.get()) { |
| 627 return subprocess_->GetCrashLogOutput(); | 629 return subprocess_->GetCrashLogOutput(); |
| 628 } else { | 630 } else { |
| 629 return std::string(); | 631 return std::string(); |
| 630 } | 632 } |
| 631 } | 633 } |
| 632 | 634 |
| 633 } // namespace plugin | 635 } // namespace plugin |
| OLD | NEW |