- add sources.
[platform/framework/web/crosswalk.git] / src / ppapi / cpp / dev / crypto_dev.cc
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ppapi/cpp/dev/crypto_dev.h"
6
7 #include "ppapi/c/dev/ppb_crypto_dev.h"
8 #include "ppapi/cpp/module.h"
9 #include "ppapi/cpp/module_impl.h"
10
11 namespace pp {
12
13 namespace {
14
15 template <> const char* interface_name<PPB_Crypto_Dev_0_1>() {
16   return PPB_CRYPTO_DEV_INTERFACE_0_1;
17 }
18
19 }  // namespace
20
21 bool Crypto_Dev::GetRandomBytes(char* buffer, uint32_t num_bytes) {
22   if (has_interface<PPB_Crypto_Dev_0_1>()) {
23     get_interface<PPB_Crypto_Dev_0_1>()->GetRandomBytes(buffer, num_bytes);
24     return true;
25   }
26   return false;
27 }
28
29 }  // namespace pp