summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_crypto_proxy.cc
blob: 207b400eccfa5502c7602017b20f03cf25a1009e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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