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"
17 class X509CertificatePrivate
: public PPB_X509Certificate_Private_Shared
{
19 X509CertificatePrivate(PP_Instance instance
);
20 ~X509CertificatePrivate() override
;
22 bool ParseDER(const std::vector
<char>& der
,
23 PPB_X509Certificate_Fields
* result
) override
;
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;
42 new PpapiHostMsg_PPBX509Certificate_ParseDER(der
, &succeeded
, result
));
46 void X509CertificatePrivate::SendToBrowser(IPC::Message
* msg
) {
47 PluginGlobals::Get()->GetBrowserSender()->Send(msg
);
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() {
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
) {