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/c/pp_errors.h" | 6 #include "native_client/src/shared/platform/nacl_check.h" |
7 #include "ppapi/cpp/module.h" | |
8 #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" |
9 #include "ppapi/native_client/src/trusted/plugin/utility.h" | |
10 | 8 |
11 namespace plugin { | 9 namespace plugin { |
12 | 10 |
13 bool SelLdrLauncherChrome::Start(const char* url) { | 11 bool SelLdrLauncherChrome::Start(const char* url) { |
14 NACL_NOTREACHED(); | 12 NACL_NOTREACHED(); |
15 return false; | 13 return false; |
16 } | 14 } |
17 | 15 |
18 void SelLdrLauncherChrome::Start( | 16 void SelLdrLauncherChrome::set_channel(NaClHandle channel) { |
19 PP_Instance instance, | 17 CHECK(channel_ == NACL_INVALID_HANDLE); |
20 bool main_service_runtime, | 18 channel_ = channel; |
21 const char* url, | |
22 const PP_NaClFileInfo* file_info, | |
23 bool uses_irt, | |
24 bool uses_ppapi, | |
25 bool uses_nonsfi_mode, | |
26 bool enable_ppapi_dev, | |
27 bool enable_dyncode_syscalls, | |
28 bool enable_exception_handling, | |
29 bool enable_crash_throttling, | |
30 pp::CompletionCallback callback) { | |
31 if (!GetNaClInterface()) { | |
32 pp::Module::Get()->core()->CallOnMainThread(0, callback, PP_ERROR_FAILED); | |
33 return; | |
34 } | |
35 GetNaClInterface()->LaunchSelLdr( | |
36 instance, | |
37 PP_FromBool(main_service_runtime), | |
38 url, | |
39 file_info, | |
40 PP_FromBool(uses_irt), | |
41 PP_FromBool(uses_ppapi), | |
42 PP_FromBool(uses_nonsfi_mode), | |
43 PP_FromBool(enable_ppapi_dev), | |
44 PP_FromBool(enable_dyncode_syscalls), | |
45 PP_FromBool(enable_exception_handling), | |
46 PP_FromBool(enable_crash_throttling), | |
47 &channel_, | |
48 callback.pp_completion_callback()); | |
49 } | 19 } |
50 | 20 |
51 } // namespace plugin | 21 } // namespace plugin |
OLD | NEW |