summaryrefslogtreecommitdiffstats
path: root/webkit/plugins
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-22 15:55:55 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-22 15:55:55 +0000
commit83c0f7cc5aa3bba61e0b5cdc88635825fdef24c9 (patch)
treea3bbffb480685ad7e2247edb7612d929601807bf /webkit/plugins
parent9454fca36c2e74354b252f9122248c65520d4e47 (diff)
downloadchromium_src-83c0f7cc5aa3bba61e0b5cdc88635825fdef24c9.zip
chromium_src-83c0f7cc5aa3bba61e0b5cdc88635825fdef24c9.tar.gz
chromium_src-83c0f7cc5aa3bba61e0b5cdc88635825fdef24c9.tar.bz2
Merge 82291 - Add an initial crypto interface to fill a given buffer with random data. Thishas the same implementation as the WebKit one on ChromeOS.TEST=noneBUG=noneReview URL: http://codereview.chromium.org/6880053
TBR=brettw@chromium.org BUG=80168 Review URL: http://codereview.chromium.org/6894024 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@82654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r--webkit/plugins/ppapi/plugin_module.cc4
-rw-r--r--webkit/plugins/ppapi/ppb_crypto_impl.cc28
-rw-r--r--webkit/plugins/ppapi/ppb_crypto_impl.h21
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_