diff options
Diffstat (limited to 'webkit/plugins/ppapi/ppb_nacl_private_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_nacl_private_impl.cc | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/ppb_nacl_private_impl.cc b/webkit/plugins/ppapi/ppb_nacl_private_impl.cc new file mode 100644 index 0000000..90e097c --- /dev/null +++ b/webkit/plugins/ppapi/ppb_nacl_private_impl.cc @@ -0,0 +1,44 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "webkit/plugins/ppapi/ppb_nacl_private_impl.h" + +#include "base/rand_util_c.h" +#include "ppapi/c/private/ppb_nacl_private.h" +#include "webkit/glue/webkit_glue.h" + +namespace webkit { +namespace ppapi { + +namespace { + +bool LaunchSelLdr(const char* alleged_url, int socket_count, + void* imc_handles, void* nacl_process_handle, + int* nacl_process_id) { + return webkit_glue::LaunchSelLdr(alleged_url, socket_count, imc_handles, + nacl_process_handle, nacl_process_id); +} + +int UrandomFD(void) { +#if defined(OS_POSIX) + return GetUrandomFD(); +#else + return 0; +#endif +} + +} // namespace + +const PPB_NaCl_Private ppb_nacl = { + &LaunchSelLdr, + &UrandomFD, +}; + +// static +const PPB_NaCl_Private* PPB_NaCl_Private_Impl::GetInterface() { + return &ppb_nacl; +} + +} // namespace ppapi +} // namespace webkit |