Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / ppapi / proxy / ppb_x509_certificate_private_proxy.cc
blobdf58f43a6bd967423811fd3bb6d7e24a88f9a97c
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.
5 #include "ppapi/proxy/ppb_x509_certificate_private_proxy.h"
7 #include "ppapi/c/private/ppb_x509_certificate_private.h"
8 #include "ppapi/proxy/plugin_globals.h"
9 #include "ppapi/proxy/ppapi_messages.h"
10 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h"
12 namespace ppapi {
13 namespace proxy {
15 namespace {
17 class X509CertificatePrivate : public PPB_X509Certificate_Private_Shared {
18 public:
19 X509CertificatePrivate(PP_Instance instance);
20 ~X509CertificatePrivate() override;
22 bool ParseDER(const std::vector<char>& der,
23 PPB_X509Certificate_Fields* result) override;
25 private:
26 void SendToBrowser(IPC::Message* msg);
28 DISALLOW_COPY_AND_ASSIGN(X509CertificatePrivate);
31 X509CertificatePrivate::X509CertificatePrivate(PP_Instance instance)
32 : PPB_X509Certificate_Private_Shared(OBJECT_IS_PROXY, instance) {
35 X509CertificatePrivate::~X509CertificatePrivate() {
38 bool X509CertificatePrivate::ParseDER(const std::vector<char>& der,
39 PPB_X509Certificate_Fields* result) {
40 bool succeeded = false;
41 SendToBrowser(
42 new PpapiHostMsg_PPBX509Certificate_ParseDER(der, &succeeded, result));
43 return succeeded;
46 void X509CertificatePrivate::SendToBrowser(IPC::Message* msg) {
47 PluginGlobals::Get()->GetBrowserSender()->Send(msg);
50 } // namespace
52 //------------------------------------------------------------------------------
54 PPB_X509Certificate_Private_Proxy::PPB_X509Certificate_Private_Proxy(
55 Dispatcher* dispatcher)
56 : InterfaceProxy(dispatcher) {
59 PPB_X509Certificate_Private_Proxy::~PPB_X509Certificate_Private_Proxy() {
62 // static
63 PP_Resource PPB_X509Certificate_Private_Proxy::CreateProxyResource(
64 PP_Instance instance) {
65 return (new X509CertificatePrivate(instance))->GetReference();
68 bool PPB_X509Certificate_Private_Proxy::OnMessageReceived(
69 const IPC::Message& msg) {
70 return false;
73 } // namespace proxy
74 } // namespace ppapi