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

Side by Side Diff: ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h

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
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 #ifndef PPAPI_SHARED_IMPL_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_
6 #define PPAPI_SHARED_IMPL_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_
7
8 #include <vector>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/values.h"
12 #include "ppapi/c/private/ppb_x509_certificate_private.h"
13 #include "ppapi/shared_impl/resource.h"
14 #include "ppapi/thunk/ppb_x509_certificate_private_api.h"
15
16 namespace IPC {
17 template <class T>
18 struct ParamTraits;
19 }
20
21 namespace ppapi {
22
23 class PPAPI_SHARED_EXPORT PPB_X509Certificate_Fields {
24 public:
25 // Takes ownership of |value|.
26 void SetField(PP_X509Certificate_Private_Field field, base::Value* value);
27 PP_Var GetFieldAsPPVar(PP_X509Certificate_Private_Field field) const;
28
29 private:
30 // Friend so ParamTraits can serialize us.
31 friend struct IPC::ParamTraits<ppapi::PPB_X509Certificate_Fields>;
32
33 base::ListValue values_;
34 };
35
36 //------------------------------------------------------------------------------
37
38 class PPAPI_SHARED_EXPORT PPB_X509Certificate_Private_Shared
39 : public thunk::PPB_X509Certificate_Private_API,
40 public Resource {
41 public:
42 PPB_X509Certificate_Private_Shared(ResourceObjectType type,
43 PP_Instance instance);
44 // Used by tcp_socket_shared_impl to construct a certificate resource from a
45 // server certificate. This object owns the pointer passed in.
46 PPB_X509Certificate_Private_Shared(ResourceObjectType type,
47 PP_Instance instance,
48 PPB_X509Certificate_Fields* fields);
49 virtual ~PPB_X509Certificate_Private_Shared();
50
51 // Resource overrides.
52 virtual PPB_X509Certificate_Private_API*
53 AsPPB_X509Certificate_Private_API() OVERRIDE;
54
55 // PPB_X509Certificate_Private_API implementation.
56 virtual PP_Bool Initialize(const char* bytes, uint32_t length) OVERRIDE;
57 virtual PP_Var GetField(PP_X509Certificate_Private_Field field) OVERRIDE;
58
59 protected:
60 virtual bool ParseDER(const std::vector<char>& der,
61 PPB_X509Certificate_Fields* result);
62
63 private:
64 scoped_ptr<PPB_X509Certificate_Fields> fields_;
65
66 DISALLOW_COPY_AND_ASSIGN(PPB_X509Certificate_Private_Shared);
67 };
68
69 } // namespace ppapi
70
71 #endif // PPAPI_SHARED_IMPL_PRIVATE_X509_CERTIFICATE_PRIVATE_IMPL_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/api_id.h ('k') | ppapi/shared_impl/private/ppb_x509_certificate_private_shared.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698