Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / ppapi / native_client / src / trusted / plugin / sel_ldr_launcher_chrome.cc
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
3 // found in the LICENSE file.
4
5 #include "native_client/src/include/nacl_macros.h"
6 #include "ppapi/c/pp_errors.h"
7 #include "ppapi/cpp/module.h"
8 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h"
9 #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
10
11 LaunchNaClProcessFunc launch_nacl_process = NULL;
12
13 namespace plugin {
14
15 bool SelLdrLauncherChrome::Start(const char* url) {
16   NACL_NOTREACHED();
17   return false;
18 }
19
20 void SelLdrLauncherChrome::Start(PP_Instance instance,
21                                  const char* url,
22                                  bool uses_irt,
23                                  bool uses_ppapi,
24                                  bool enable_ppapi_dev,
25                                  bool enable_dyncode_syscalls,
26                                  bool enable_exception_handling,
27                                  bool enable_crash_throttling,
28                                  PP_Var* error_message,
29                                  pp::CompletionCallback callback) {
30   if (!launch_nacl_process) {
31     pp::Module::Get()->core()->CallOnMainThread(0, callback, PP_ERROR_FAILED);
32     return;
33   }
34   launch_nacl_process(instance,
35                       url,
36                       PP_FromBool(uses_irt),
37                       PP_FromBool(uses_ppapi),
38                       PP_FromBool(enable_ppapi_dev),
39                       PP_FromBool(enable_dyncode_syscalls),
40                       PP_FromBool(enable_exception_handling),
41                       PP_FromBool(enable_crash_throttling),
42                       &channel_,
43                       error_message,
44                       callback.pp_completion_callback());
45 }
46
47 }  // namespace plugin