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 #include "native_client/src/shared/imc/nacl_imc_c.h" | 7 #include "native_client/src/shared/imc/nacl_imc_c.h" |
8 #include "native_client/src/shared/platform/nacl_time.h" | 8 #include "native_client/src/shared/platform/nacl_time.h" |
9 #include "native_client/src/trusted/desc/nrd_all_modules.h" | 9 #include "native_client/src/trusted/desc/nrd_all_modules.h" |
10 #include "native_client/src/trusted/plugin/nacl_entry_points.h" | 10 #include "native_client/src/trusted/plugin/nacl_entry_points.h" |
11 #include "native_client/src/trusted/plugin/plugin.h" | 11 #include "native_client/src/trusted/plugin/plugin.h" |
12 | 12 |
13 #include "ppapi/c/private/ppb_nacl_private.h" | 13 #include "ppapi/c/private/ppb_nacl_private.h" |
14 #include "ppapi/cpp/module.h" | 14 #include "ppapi/cpp/module.h" |
15 | 15 |
| 16 StartPpapiProxyFunc start_ppapi_proxy; |
| 17 |
16 namespace plugin { | 18 namespace plugin { |
17 | 19 |
18 class ModulePpapi : public pp::Module { | 20 class ModulePpapi : public pp::Module { |
19 public: | 21 public: |
20 ModulePpapi() : pp::Module(), | 22 ModulePpapi() : pp::Module(), |
21 init_was_successful_(false), | 23 init_was_successful_(false), |
22 private_interface_(NULL) { | 24 private_interface_(NULL) { |
23 MODULE_PRINTF(("ModulePpapi::ModulePpapi (this=%p)\n", | 25 MODULE_PRINTF(("ModulePpapi::ModulePpapi (this=%p)\n", |
24 static_cast<void*>(this))); | 26 static_cast<void*>(this))); |
25 } | 27 } |
(...skipping 14 matching lines...) Expand all Loading... |
40 | 42 |
41 if (NULL == private_interface_) { | 43 if (NULL == private_interface_) { |
42 MODULE_PRINTF(("ModulePpapi::Init failed: " | 44 MODULE_PRINTF(("ModulePpapi::Init failed: " |
43 "GetBrowserInterface returned NULL\n")); | 45 "GetBrowserInterface returned NULL\n")); |
44 return false; | 46 return false; |
45 } | 47 } |
46 | 48 |
47 launch_nacl_process = reinterpret_cast<LaunchNaClProcessFunc>( | 49 launch_nacl_process = reinterpret_cast<LaunchNaClProcessFunc>( |
48 private_interface_->LaunchSelLdr); | 50 private_interface_->LaunchSelLdr); |
49 | 51 |
| 52 start_ppapi_proxy = reinterpret_cast<StartPpapiProxyFunc>( |
| 53 private_interface_->StartPpapiProxy); |
| 54 |
50 #if NACL_LINUX || NACL_OSX | 55 #if NACL_LINUX || NACL_OSX |
51 // Note that currently we do not need random numbers inside the | 56 // Note that currently we do not need random numbers inside the |
52 // NaCl trusted plugin on Unix, but NaClSecureRngModuleInit() is | 57 // NaCl trusted plugin on Unix, but NaClSecureRngModuleInit() is |
53 // strict and will raise a fatal error unless we provide it with a | 58 // strict and will raise a fatal error unless we provide it with a |
54 // /dev/urandom FD beforehand. | 59 // /dev/urandom FD beforehand. |
55 NaClSecureRngModuleSetUrandomFd(dup(private_interface_->UrandomFD())); | 60 NaClSecureRngModuleSetUrandomFd(dup(private_interface_->UrandomFD())); |
56 #endif | 61 #endif |
57 | 62 |
58 // In the plugin, we don't need high resolution time of day. | 63 // In the plugin, we don't need high resolution time of day. |
59 NaClAllowLowResolutionTimeOfDay(); | 64 NaClAllowLowResolutionTimeOfDay(); |
(...skipping 29 matching lines...) Expand all Loading... |
89 | 94 |
90 | 95 |
91 namespace pp { | 96 namespace pp { |
92 | 97 |
93 Module* CreateModule() { | 98 Module* CreateModule() { |
94 MODULE_PRINTF(("CreateModule ()\n")); | 99 MODULE_PRINTF(("CreateModule ()\n")); |
95 return new plugin::ModulePpapi(); | 100 return new plugin::ModulePpapi(); |
96 } | 101 } |
97 | 102 |
98 } // namespace pp | 103 } // namespace pp |
OLD | NEW |