OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/plugins/ppapi/ppb_nacl_util_private_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_nacl_util_private_impl.h" |
6 | 6 |
| 7 #include "base/rand_util_c.h" |
7 #include "ppapi/c/private/ppb_nacl_util_private.h" | 8 #include "ppapi/c/private/ppb_nacl_util_private.h" |
| 9 #include "webkit/glue/webkit_glue.h" |
8 | 10 |
9 namespace webkit { | 11 namespace webkit { |
10 namespace ppapi { | 12 namespace ppapi { |
11 | 13 |
12 namespace { | 14 namespace { |
13 | 15 |
14 int32_t LaunchSelLdr(PP_Resource file_io) { | 16 bool LaunchSelLdr(const char* alleged_url, int socket_count, |
| 17 void* imc_handles, void* nacl_process_handle, |
| 18 int* nacl_process_id) { |
| 19 return webkit_glue::LaunchSelLdr(alleged_url, socket_count, imc_handles, |
| 20 nacl_process_handle, nacl_process_id); |
| 21 } |
| 22 |
| 23 int UrandomFD(void) { |
| 24 #if defined(OS_POSIX) |
| 25 return GetUrandomFD(); |
| 26 #else |
15 return 0; | 27 return 0; |
| 28 #endif |
16 } | 29 } |
17 | 30 |
18 } // namespace | 31 } // namespace |
19 | 32 |
20 const PPB_NaClUtil_Private ppb_nacl_util = { | 33 const PPB_NaClUtil_Private ppb_nacl_util = { |
21 &LaunchSelLdr, | 34 &LaunchSelLdr, |
| 35 &UrandomFD, |
22 }; | 36 }; |
23 | 37 |
24 // static | 38 // static |
25 const PPB_NaClUtil_Private* PPB_NaClUtil_Private_Impl::GetInterface() { | 39 const PPB_NaClUtil_Private* PPB_NaClUtil_Private_Impl::GetInterface() { |
26 return &ppb_nacl_util; | 40 return &ppb_nacl_util; |
27 } | 41 } |
28 | 42 |
29 } // namespace ppapi | 43 } // namespace ppapi |
30 } // namespace webkit | 44 } // namespace webkit |
OLD | NEW |