| 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_secure_random.h" | 8 #include "native_client/src/shared/platform/nacl_secure_random.h" |
| 9 #include "native_client/src/shared/platform/nacl_time.h" | 9 #include "native_client/src/shared/platform/nacl_time.h" |
| 10 #include "native_client/src/trusted/desc/nrd_all_modules.h" | 10 #include "native_client/src/trusted/desc/nrd_all_modules.h" |
| 11 | 11 |
| 12 #include "ppapi/native_client/src/trusted/plugin/module_ppapi.h" | 12 #include "ppapi/native_client/src/trusted/plugin/module_ppapi.h" |
| 13 #include "ppapi/native_client/src/trusted/plugin/nacl_entry_points.h" | |
| 14 #include "ppapi/native_client/src/trusted/plugin/plugin.h" | 13 #include "ppapi/native_client/src/trusted/plugin/plugin.h" |
| 15 #include "ppapi/native_client/src/trusted/plugin/utility.h" | 14 #include "ppapi/native_client/src/trusted/plugin/utility.h" |
| 16 | 15 |
| 17 namespace plugin { | 16 namespace plugin { |
| 18 | 17 |
| 19 ModulePpapi::ModulePpapi() : pp::Module(), | 18 ModulePpapi::ModulePpapi() : pp::Module(), |
| 20 init_was_successful_(false), | 19 init_was_successful_(false), |
| 21 private_interface_(NULL) { | 20 private_interface_(NULL) { |
| 22 MODULE_PRINTF(("ModulePpapi::ModulePpapi (this=%p)\n", | 21 MODULE_PRINTF(("ModulePpapi::ModulePpapi (this=%p)\n", |
| 23 static_cast<void*>(this))); | 22 static_cast<void*>(this))); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 37 private_interface_ = reinterpret_cast<const PPB_NaCl_Private*>( | 36 private_interface_ = reinterpret_cast<const PPB_NaCl_Private*>( |
| 38 GetBrowserInterface(PPB_NACL_PRIVATE_INTERFACE)); | 37 GetBrowserInterface(PPB_NACL_PRIVATE_INTERFACE)); |
| 39 | 38 |
| 40 if (NULL == private_interface_) { | 39 if (NULL == private_interface_) { |
| 41 MODULE_PRINTF(("ModulePpapi::Init failed: " | 40 MODULE_PRINTF(("ModulePpapi::Init failed: " |
| 42 "GetBrowserInterface returned NULL\n")); | 41 "GetBrowserInterface returned NULL\n")); |
| 43 return false; | 42 return false; |
| 44 } | 43 } |
| 45 SetNaClInterface(private_interface_); | 44 SetNaClInterface(private_interface_); |
| 46 | 45 |
| 47 launch_nacl_process = reinterpret_cast<LaunchNaClProcessFunc>( | |
| 48 private_interface_->LaunchSelLdr); | |
| 49 | |
| 50 #if NACL_LINUX || NACL_OSX | 46 #if NACL_LINUX || NACL_OSX |
| 51 // Note that currently we do not need random numbers inside the | 47 // Note that currently we do not need random numbers inside the |
| 52 // NaCl trusted plugin on Unix, but NaClSecureRngModuleInit() is | 48 // NaCl trusted plugin on Unix, but NaClSecureRngModuleInit() is |
| 53 // strict and will raise a fatal error unless we provide it with a | 49 // strict and will raise a fatal error unless we provide it with a |
| 54 // /dev/urandom FD beforehand. | 50 // /dev/urandom FD beforehand. |
| 55 NaClSecureRngModuleSetUrandomFd(dup(private_interface_->UrandomFD())); | 51 NaClSecureRngModuleSetUrandomFd(dup(private_interface_->UrandomFD())); |
| 56 #endif | 52 #endif |
| 57 | 53 |
| 58 // In the plugin, we don't need high resolution time of day. | 54 // In the plugin, we don't need high resolution time of day. |
| 59 NaClAllowLowResolutionTimeOfDay(); | 55 NaClAllowLowResolutionTimeOfDay(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 82 | 78 |
| 83 | 79 |
| 84 namespace pp { | 80 namespace pp { |
| 85 | 81 |
| 86 Module* CreateModule() { | 82 Module* CreateModule() { |
| 87 MODULE_PRINTF(("CreateModule ()\n")); | 83 MODULE_PRINTF(("CreateModule ()\n")); |
| 88 return new plugin::ModulePpapi(); | 84 return new plugin::ModulePpapi(); |
| 89 } | 85 } |
| 90 | 86 |
| 91 } // namespace pp | 87 } // namespace pp |
| OLD | NEW |