diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 15:25:55 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 15:25:55 +0000 |
commit | f682ad7ed47cf3cadf5d4c9f12996bb6bd5890f2 (patch) | |
tree | 74e15da4da50e5cbb9be7d6a30f96e83f260def3 /ppapi/proxy/ppb_crypto_proxy.cc | |
parent | 264fda93befd14308dc1703b53c270cbe63e8dc6 (diff) | |
download | chromium_src-f682ad7ed47cf3cadf5d4c9f12996bb6bd5890f2.zip chromium_src-f682ad7ed47cf3cadf5d4c9f12996bb6bd5890f2.tar.gz chromium_src-f682ad7ed47cf3cadf5d4c9f12996bb6bd5890f2.tar.bz2 |
Add an initial crypto interface to fill a given buffer with random data. This
has the same implementation as the WebKit one on ChromeOS.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/6880053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_crypto_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_crypto_proxy.cc | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_crypto_proxy.cc b/ppapi/proxy/ppb_crypto_proxy.cc new file mode 100644 index 0000000..207b400 --- /dev/null +++ b/ppapi/proxy/ppb_crypto_proxy.cc @@ -0,0 +1,54 @@ +// 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 "ppapi/proxy/ppb_crypto_proxy.h" + +#include "ppapi/c/dev/ppb_crypto_dev.h" +#include "ppapi/proxy/interface_id.h" +#include "ppapi/shared_impl/crypto_impl.h" + +namespace pp { +namespace proxy { + +namespace { + +const PPB_Crypto_Dev crypto_interface = { + &pp::shared_impl::CryptoImpl::GetRandomBytes +}; + +InterfaceProxy* CreateCryptoProxy(Dispatcher* dispatcher, + const void* target_interface) { + return new PPB_Crypto_Proxy(dispatcher, target_interface); +} + +} // namespace + +PPB_Crypto_Proxy::PPB_Crypto_Proxy(Dispatcher* dispatcher, + const void* target_interface) + : InterfaceProxy(dispatcher, target_interface) { + NOTREACHED(); // See comment in the header file. +} + +PPB_Crypto_Proxy::~PPB_Crypto_Proxy() { +} + +// static +const InterfaceProxy::Info* PPB_Crypto_Proxy::GetInfo() { + static const Info info = { + &crypto_interface, + PPB_CRYPTO_DEV_INTERFACE, + INTERFACE_ID_PPB_CRYPTO, + false, + &CreateCryptoProxy, + }; + return &info; +} + +bool PPB_Crypto_Proxy::OnMessageReceived(const IPC::Message& msg) { + NOTREACHED(); + return false; +} + +} // namespace proxy +} // namespace pp |