Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: ppapi/proxy/ppb_x509_certificate_private_proxy.cc

Issue 9693024: Add the PPAPI X509 Certificate interface and implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_x509_certificate_private_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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/proxy/ppb_x509_certificate_private_proxy.h"
6
7 #include "ppapi/c/private/ppb_x509_certificate_private.h"
8 #include "ppapi/proxy/plugin_globals.h"
9 #include "ppapi/proxy/plugin_proxy_delegate.h"
10 #include "ppapi/proxy/ppapi_messages.h"
11 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h"
12
13 namespace ppapi {
14 namespace proxy {
15
16 namespace {
17
18 class X509CertificatePrivate : public PPB_X509Certificate_Private_Shared {
19 public:
20 X509CertificatePrivate(PP_Instance instance);
21 virtual ~X509CertificatePrivate();
22
23 virtual bool ParseDER(const std::vector<char>& der,
24 PPB_X509Certificate_Fields* result) OVERRIDE;
25
26 private:
27 void SendToBrowser(IPC::Message* msg);
28
29 DISALLOW_COPY_AND_ASSIGN(X509CertificatePrivate);
30 };
31
32 X509CertificatePrivate::X509CertificatePrivate(PP_Instance instance)
33 : PPB_X509Certificate_Private_Shared(OBJECT_IS_PROXY, instance) {
34 }
35
36 X509CertificatePrivate::~X509CertificatePrivate() {
37 }
38
39 bool X509CertificatePrivate::ParseDER(const std::vector<char>& der,
40 PPB_X509Certificate_Fields* result) {
41 bool succeeded = false;
42 SendToBrowser(
43 new PpapiHostMsg_PPBX509Certificate_ParseDER(der, &succeeded, result));
44 return succeeded;
45 }
46
47 void X509CertificatePrivate::SendToBrowser(IPC::Message* msg) {
48 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(msg);
49 }
50
51 } // namespace
52
53 //------------------------------------------------------------------------------
54
55 PPB_X509Certificate_Private_Proxy::PPB_X509Certificate_Private_Proxy(
56 Dispatcher* dispatcher)
57 : InterfaceProxy(dispatcher) {
58 }
59
60 PPB_X509Certificate_Private_Proxy::~PPB_X509Certificate_Private_Proxy() {
61 }
62
63 // static
64 PP_Resource PPB_X509Certificate_Private_Proxy::CreateProxyResource(
65 PP_Instance instance) {
66 return (new X509CertificatePrivate(instance))->GetReference();
67 }
68
69 bool PPB_X509Certificate_Private_Proxy::OnMessageReceived(
70 const IPC::Message& msg) {
71 return false;
72 }
73
74 } // namespace proxy
75 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_x509_certificate_private_proxy.h ('k') | ppapi/proxy/resource_creation_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698