diff options
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/plugin_module.cc | 4 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_crypto_impl.cc | 28 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_crypto_impl.h | 21 |
3 files changed, 53 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/plugin_module.cc b/webkit/plugins/ppapi/plugin_module.cc index 7fc683e..a7a7dd2 100644 --- a/webkit/plugins/ppapi/plugin_module.cc +++ b/webkit/plugins/ppapi/plugin_module.cc @@ -17,6 +17,7 @@ #include "ppapi/c/dev/ppb_context_3d_dev.h" #include "ppapi/c/dev/ppb_context_3d_trusted_dev.h" #include "ppapi/c/dev/ppb_console_dev.h" +#include "ppapi/c/dev/ppb_crypto_dev.h" #include "ppapi/c/dev/ppb_cursor_control_dev.h" #include "ppapi/c/dev/ppb_directory_reader_dev.h" #include "ppapi/c/dev/ppb_file_io_dev.h" @@ -70,6 +71,7 @@ #include "webkit/plugins/ppapi/ppb_buffer_impl.h" #include "webkit/plugins/ppapi/ppb_char_set_impl.h" #include "webkit/plugins/ppapi/ppb_console_impl.h" +#include "webkit/plugins/ppapi/ppb_crypto_impl.h" #include "webkit/plugins/ppapi/ppb_cursor_control_impl.h" #include "webkit/plugins/ppapi/ppb_directory_reader_impl.h" #include "webkit/plugins/ppapi/ppb_file_chooser_impl.h" @@ -241,6 +243,8 @@ const void* GetInterface(const char* name) { return PPB_Console_Impl::GetInterface(); if (strcmp(name, PPB_CORE_INTERFACE) == 0) return &core_interface; + if (strcmp(name, PPB_CRYPTO_DEV_INTERFACE) == 0) + return PPB_Crypto_Impl::GetInterface(); if (strcmp(name, PPB_CURSOR_CONTROL_DEV_INTERFACE) == 0) return GetCursorControlInterface(); if (strcmp(name, PPB_DIRECTORYREADER_DEV_INTERFACE) == 0) diff --git a/webkit/plugins/ppapi/ppb_crypto_impl.cc b/webkit/plugins/ppapi/ppb_crypto_impl.cc new file mode 100644 index 0000000..8f3a73b --- /dev/null +++ b/webkit/plugins/ppapi/ppb_crypto_impl.cc @@ -0,0 +1,28 @@ +// Copyright (c) 2011 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_crypto_impl.h" + +#include "ppapi/c/dev/ppb_crypto_dev.h" +#include "ppapi/shared_impl/crypto_impl.h" + +namespace webkit { +namespace ppapi { + +namespace { + +const PPB_Crypto_Dev ppb_crypto = { + &pp::shared_impl::CryptoImpl::GetRandomBytes +}; + +} // namespace + +// static +const PPB_Crypto_Dev* PPB_Crypto_Impl::GetInterface() { + return &ppb_crypto; +} + +} // namespace ppapi +} // namespace webkit + diff --git a/webkit/plugins/ppapi/ppb_crypto_impl.h b/webkit/plugins/ppapi/ppb_crypto_impl.h new file mode 100644 index 0000000..3b3bb48 --- /dev/null +++ b/webkit/plugins/ppapi/ppb_crypto_impl.h @@ -0,0 +1,21 @@ +// Copyright (c) 2011 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. + +#ifndef WEBKIT_PLUGINS_PPAPI_PPB_CRYPTO_IMPL_H_ +#define WEBKIT_PLUGINS_PPAPI_PPB_CRYPTO_IMPL_H_ + +struct PPB_Crypto_Dev; + +namespace webkit { +namespace ppapi { + +class PPB_Crypto_Impl { + public: + static const PPB_Crypto_Dev* GetInterface(); +}; + +} // namespace ppapi +} // namespace webkit + +#endif // WEBKIT_PLUGINS_PPAPI_PPB_CRYPTO_IMPL_H_ |