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 "native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" | 6 #include "native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" |
7 | 7 |
8 #include "native_client/src/trusted/plugin/nacl_entry_points.h" | 8 #include "native_client/src/trusted/plugin/nacl_entry_points.h" |
9 | 9 |
| 10 #include "ppapi/cpp/var.h" |
| 11 |
10 LaunchNaClProcessFunc launch_nacl_process = NULL; | 12 LaunchNaClProcessFunc launch_nacl_process = NULL; |
11 | 13 |
12 namespace plugin { | 14 namespace plugin { |
13 | 15 |
14 bool SelLdrLauncherChrome::Start(const char* url) { | 16 bool SelLdrLauncherChrome::Start(const char* url) { |
15 NACL_NOTREACHED(); | 17 NACL_NOTREACHED(); |
16 return false; | 18 return false; |
17 } | 19 } |
18 | 20 |
19 bool SelLdrLauncherChrome::Start(PP_Instance instance, | 21 bool SelLdrLauncherChrome::Start(PP_Instance instance, |
20 const char* url, | 22 const char* url, |
21 bool uses_irt, | 23 bool uses_irt, |
22 bool uses_ppapi, | 24 bool uses_ppapi, |
23 bool enable_ppapi_dev, | 25 bool enable_ppapi_dev, |
24 bool enable_dyncode_syscalls, | 26 bool enable_dyncode_syscalls, |
25 bool enable_exception_handling) { | 27 bool enable_exception_handling, |
| 28 nacl::string* error_message) { |
| 29 *error_message = ""; |
26 if (!launch_nacl_process) | 30 if (!launch_nacl_process) |
27 return false; | 31 return false; |
| 32 PP_Var var_error_message; |
28 // send a synchronous message to the browser process | 33 // send a synchronous message to the browser process |
29 if (launch_nacl_process(instance, | 34 if (launch_nacl_process(instance, |
30 url, | 35 url, |
31 PP_FromBool(uses_irt), | 36 PP_FromBool(uses_irt), |
32 PP_FromBool(uses_ppapi), | 37 PP_FromBool(uses_ppapi), |
33 PP_FromBool(enable_ppapi_dev), | 38 PP_FromBool(enable_ppapi_dev), |
34 PP_FromBool(enable_dyncode_syscalls), | 39 PP_FromBool(enable_dyncode_syscalls), |
35 PP_FromBool(enable_exception_handling), | 40 PP_FromBool(enable_exception_handling), |
36 &channel_) != PP_NACL_OK) { | 41 &channel_, |
| 42 &var_error_message) != PP_NACL_OK) { |
| 43 pp::Var var_error_message_cpp(pp::PASS_REF, var_error_message); |
| 44 if (var_error_message_cpp.is_string()) { |
| 45 *error_message = var_error_message_cpp.AsString(); |
| 46 } |
37 return false; | 47 return false; |
38 } | 48 } |
39 return true; | 49 return true; |
40 } | 50 } |
41 | 51 |
42 } // namespace plugin | 52 } // namespace plugin |
OLD | NEW |