OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "native_client/src/include/nacl_macros.h" | 5 #include "native_client/src/include/nacl_macros.h" |
6 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" | 6 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" |
7 #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" | 7 #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" |
8 | 8 |
| 9 #include "ppapi/cpp/var.h" |
| 10 |
9 LaunchNaClProcessFunc launch_nacl_process = NULL; | 11 LaunchNaClProcessFunc launch_nacl_process = NULL; |
10 | 12 |
11 namespace plugin { | 13 namespace plugin { |
12 | 14 |
13 bool SelLdrLauncherChrome::Start(const char* url) { | 15 bool SelLdrLauncherChrome::Start(const char* url) { |
14 NACL_NOTREACHED(); | 16 NACL_NOTREACHED(); |
15 return false; | 17 return false; |
16 } | 18 } |
17 | 19 |
18 bool SelLdrLauncherChrome::Start(PP_Instance instance, | 20 bool SelLdrLauncherChrome::Start(PP_Instance instance, |
19 const char* url, | 21 const char* url, |
20 bool uses_irt, | 22 bool uses_irt, |
21 bool uses_ppapi, | 23 bool uses_ppapi, |
22 bool enable_ppapi_dev, | 24 bool enable_ppapi_dev, |
23 bool enable_dyncode_syscalls, | 25 bool enable_dyncode_syscalls, |
24 bool enable_exception_handling) { | 26 bool enable_exception_handling, |
| 27 nacl::string* error_message) { |
| 28 *error_message = ""; |
25 if (!launch_nacl_process) | 29 if (!launch_nacl_process) |
26 return false; | 30 return false; |
| 31 PP_Var var_error_message; |
27 // send a synchronous message to the browser process | 32 // send a synchronous message to the browser process |
28 if (launch_nacl_process(instance, | 33 if (launch_nacl_process(instance, |
29 url, | 34 url, |
30 PP_FromBool(uses_irt), | 35 PP_FromBool(uses_irt), |
31 PP_FromBool(uses_ppapi), | 36 PP_FromBool(uses_ppapi), |
32 PP_FromBool(enable_ppapi_dev), | 37 PP_FromBool(enable_ppapi_dev), |
33 PP_FromBool(enable_dyncode_syscalls), | 38 PP_FromBool(enable_dyncode_syscalls), |
34 PP_FromBool(enable_exception_handling), | 39 PP_FromBool(enable_exception_handling), |
35 &channel_) != PP_NACL_OK) { | 40 &channel_, |
| 41 &var_error_message) != PP_NACL_OK) { |
| 42 pp::Var var_error_message_cpp(pp::PASS_REF, var_error_message); |
| 43 if (var_error_message_cpp.is_string()) { |
| 44 *error_message = var_error_message_cpp.AsString(); |
| 45 } |
36 return false; | 46 return false; |
37 } | 47 } |
38 return true; | 48 return true; |
39 } | 49 } |
40 | 50 |
41 } // namespace plugin | 51 } // namespace plugin |
OLD | NEW |