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/platform/nacl_time.h" | 8 #include "native_client/src/shared/platform/nacl_time.h" |
8 #include "native_client/src/trusted/desc/nrd_all_modules.h" | 9 #include "native_client/src/trusted/desc/nrd_all_modules.h" |
9 #include "native_client/src/trusted/handle_pass/browser_handle.h" | 10 #include "native_client/src/trusted/handle_pass/browser_handle.h" |
10 #include "native_client/src/trusted/plugin/nacl_entry_points.h" | 11 #include "native_client/src/trusted/plugin/nacl_entry_points.h" |
11 #include "native_client/src/trusted/plugin/plugin.h" | 12 #include "native_client/src/trusted/plugin/plugin.h" |
12 | 13 |
13 #include "ppapi/c/private/ppb_nacl_private.h" | 14 #include "ppapi/c/private/ppb_nacl_private.h" |
14 #include "ppapi/cpp/module.h" | 15 #include "ppapi/cpp/module.h" |
15 | 16 |
16 GetURandomFDFunc get_urandom_fd; | 17 GetURandomFDFunc get_urandom_fd; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 launch_nacl_process = reinterpret_cast<LaunchNaClProcessFunc>( | 50 launch_nacl_process = reinterpret_cast<LaunchNaClProcessFunc>( |
50 private_interface_->LaunchSelLdr); | 51 private_interface_->LaunchSelLdr); |
51 get_urandom_fd = private_interface_->UrandomFD; | 52 get_urandom_fd = private_interface_->UrandomFD; |
52 | 53 |
53 // 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. |
54 NaClAllowLowResolutionTimeOfDay(); | 55 NaClAllowLowResolutionTimeOfDay(); |
55 NaClNrdAllModulesInit(); | 56 NaClNrdAllModulesInit(); |
56 NaClSrpcModuleInit(); | 57 NaClSrpcModuleInit(); |
57 | 58 |
58 #if NACL_WINDOWS && !defined(NACL_STANDALONE) | 59 #if NACL_WINDOWS && !defined(NACL_STANDALONE) |
| 60 // TODO(mseaborn): Remove this call because NaCl's handle_pass |
| 61 // module is replaced by Chrome's BrokerDuplicateHandle() |
| 62 // function. The call to NaClHandlePassBrowserRememberHandle() on |
| 63 // the NaCl side will have to be removed first. |
59 NaClHandlePassBrowserInit(); | 64 NaClHandlePassBrowserInit(); |
| 65 |
| 66 NaClSetBrokerDuplicateHandleFunc(private_interface_->BrokerDuplicateHandle); |
60 #endif | 67 #endif |
| 68 |
61 init_was_successful_ = true; | 69 init_was_successful_ = true; |
62 return true; | 70 return true; |
63 } | 71 } |
64 | 72 |
65 virtual pp::Instance* CreateInstance(PP_Instance pp_instance) { | 73 virtual pp::Instance* CreateInstance(PP_Instance pp_instance) { |
66 MODULE_PRINTF(("ModulePpapi::CreateInstance (pp_instance=%"NACL_PRId32")\n", | 74 MODULE_PRINTF(("ModulePpapi::CreateInstance (pp_instance=%"NACL_PRId32")\n", |
67 pp_instance)); | 75 pp_instance)); |
68 // This must be called from here rather than Init, as it relies on | 76 // This must be called from here rather than Init, as it relies on |
69 // chrome state that is not set at the time Init runs. | 77 // chrome state that is not set at the time Init runs. |
70 private_interface_->EnableBackgroundSelLdrLaunch(); | 78 private_interface_->EnableBackgroundSelLdrLaunch(); |
(...skipping 12 matching lines...) Expand all Loading... |
83 | 91 |
84 | 92 |
85 namespace pp { | 93 namespace pp { |
86 | 94 |
87 Module* CreateModule() { | 95 Module* CreateModule() { |
88 MODULE_PRINTF(("CreateModule ()\n")); | 96 MODULE_PRINTF(("CreateModule ()\n")); |
89 return new plugin::ModulePpapi(); | 97 return new plugin::ModulePpapi(); |
90 } | 98 } |
91 | 99 |
92 } // namespace pp | 100 } // namespace pp |
OLD | NEW |