Add a stub __cxa_demangle to disable LLVM's demangler.
[chromium-blink-merge.git] / ppapi / shared_impl / private / ppb_x509_certificate_private_shared.h
blob1eaedbb31556c3f565ca2ac0c6a62366b6797119
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 #ifndef PPAPI_SHARED_IMPL_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_
6 #define PPAPI_SHARED_IMPL_PRIVATE_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_
8 #include <vector>
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"
16 namespace IPC {
17 template <class T>
18 struct ParamTraits;
21 namespace ppapi {
23 class PPAPI_SHARED_EXPORT PPB_X509Certificate_Fields {
24 public:
25 PPB_X509Certificate_Fields();
26 PPB_X509Certificate_Fields(const PPB_X509Certificate_Fields& fields);
28 // Takes ownership of |value|.
29 void SetField(PP_X509Certificate_Private_Field field, base::Value* value);
30 PP_Var GetFieldAsPPVar(PP_X509Certificate_Private_Field field) const;
32 private:
33 // Friend so ParamTraits can serialize us.
34 friend struct IPC::ParamTraits<ppapi::PPB_X509Certificate_Fields>;
36 base::ListValue values_;
39 //------------------------------------------------------------------------------
41 class PPAPI_SHARED_EXPORT PPB_X509Certificate_Private_Shared
42 : public thunk::PPB_X509Certificate_Private_API,
43 public Resource {
44 public:
45 PPB_X509Certificate_Private_Shared(ResourceObjectType type,
46 PP_Instance instance);
47 // Used by tcp_socket_shared_impl to construct a certificate resource from a
48 // server certificate.
49 PPB_X509Certificate_Private_Shared(ResourceObjectType type,
50 PP_Instance instance,
51 const PPB_X509Certificate_Fields& fields);
52 ~PPB_X509Certificate_Private_Shared() override;
54 // Resource overrides.
55 PPB_X509Certificate_Private_API* AsPPB_X509Certificate_Private_API() override;
57 // PPB_X509Certificate_Private_API implementation.
58 PP_Bool Initialize(const char* bytes, uint32_t length) override;
59 PP_Var GetField(PP_X509Certificate_Private_Field field) override;
61 protected:
62 virtual bool ParseDER(const std::vector<char>& der,
63 PPB_X509Certificate_Fields* result);
65 private:
66 scoped_ptr<PPB_X509Certificate_Fields> fields_;
68 DISALLOW_COPY_AND_ASSIGN(PPB_X509Certificate_Private_Shared);
71 } // namespace ppapi
73 #endif // PPAPI_SHARED_IMPL_PRIVATE_X509_CERTIFICATE_PRIVATE_IMPL_H_