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 GetURandomFDFunc get_urandom_fd; | 16 GetURandomFDFunc get_urandom_fd; |
| 17 StartPpapiProxyFunc start_ppapi_proxy; |
17 | 18 |
18 namespace plugin { | 19 namespace plugin { |
19 | 20 |
20 class ModulePpapi : public pp::Module { | 21 class ModulePpapi : public pp::Module { |
21 public: | 22 public: |
22 ModulePpapi() : pp::Module(), | 23 ModulePpapi() : pp::Module(), |
23 init_was_successful_(false), | 24 init_was_successful_(false), |
24 private_interface_(NULL) { | 25 private_interface_(NULL) { |
25 MODULE_PRINTF(("ModulePpapi::ModulePpapi (this=%p)\n", | 26 MODULE_PRINTF(("ModulePpapi::ModulePpapi (this=%p)\n", |
26 static_cast<void*>(this))); | 27 static_cast<void*>(this))); |
(...skipping 14 matching lines...) Expand all Loading... |
41 GetBrowserInterface(PPB_NACL_PRIVATE_INTERFACE)); | 42 GetBrowserInterface(PPB_NACL_PRIVATE_INTERFACE)); |
42 | 43 |
43 if (NULL == private_interface_) { | 44 if (NULL == private_interface_) { |
44 MODULE_PRINTF(("ModulePpapi::Init failed: " | 45 MODULE_PRINTF(("ModulePpapi::Init failed: " |
45 "GetBrowserInterface returned NULL\n")); | 46 "GetBrowserInterface returned NULL\n")); |
46 return false; | 47 return false; |
47 } | 48 } |
48 | 49 |
49 launch_nacl_process = reinterpret_cast<LaunchNaClProcessFunc>( | 50 launch_nacl_process = reinterpret_cast<LaunchNaClProcessFunc>( |
50 private_interface_->LaunchSelLdr); | 51 private_interface_->LaunchSelLdr); |
| 52 start_ppapi_proxy = reinterpret_cast<StartPpapiProxyFunc>( |
| 53 private_interface_->StartPpapiProxy); |
51 get_urandom_fd = private_interface_->UrandomFD; | 54 get_urandom_fd = private_interface_->UrandomFD; |
52 | 55 |
53 // In the plugin, we don't need high resolution time of day. | 56 // In the plugin, we don't need high resolution time of day. |
54 NaClAllowLowResolutionTimeOfDay(); | 57 NaClAllowLowResolutionTimeOfDay(); |
55 NaClNrdAllModulesInit(); | 58 NaClNrdAllModulesInit(); |
56 NaClSrpcModuleInit(); | 59 NaClSrpcModuleInit(); |
57 | 60 |
58 #if NACL_WINDOWS && !defined(NACL_STANDALONE) | 61 #if NACL_WINDOWS && !defined(NACL_STANDALONE) |
59 NaClSetBrokerDuplicateHandleFunc(private_interface_->BrokerDuplicateHandle); | 62 NaClSetBrokerDuplicateHandleFunc(private_interface_->BrokerDuplicateHandle); |
60 #endif | 63 #endif |
(...skipping 23 matching lines...) Expand all Loading... |
84 | 87 |
85 | 88 |
86 namespace pp { | 89 namespace pp { |
87 | 90 |
88 Module* CreateModule() { | 91 Module* CreateModule() { |
89 MODULE_PRINTF(("CreateModule ()\n")); | 92 MODULE_PRINTF(("CreateModule ()\n")); |
90 return new plugin::ModulePpapi(); | 93 return new plugin::ModulePpapi(); |
91 } | 94 } |
92 | 95 |
93 } // namespace pp | 96 } // namespace pp |
OLD | NEW |