| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/c/private/ppb_x509_certificate_private.h" | 5 #include "ppapi/c/private/ppb_x509_certificate_private.h" |
| 6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
| 7 #include "ppapi/thunk/ppb_x509_certificate_private_api.h" | 7 #include "ppapi/thunk/ppb_x509_certificate_private_api.h" |
| 8 #include "ppapi/thunk/resource_creation_api.h" | 8 #include "ppapi/thunk/resource_creation_api.h" |
| 9 #include "ppapi/thunk/thunk.h" | 9 #include "ppapi/thunk/thunk.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 return 0; | 22 return 0; |
| 23 return enter.functions()->CreateX509CertificatePrivate(instance); | 23 return enter.functions()->CreateX509CertificatePrivate(instance); |
| 24 } | 24 } |
| 25 | 25 |
| 26 PP_Bool IsX509CertificatePrivate(PP_Resource resource) { | 26 PP_Bool IsX509CertificatePrivate(PP_Resource resource) { |
| 27 EnterX509CertificatePrivate enter(resource, false); | 27 EnterX509CertificatePrivate enter(resource, false); |
| 28 return PP_FromBool(enter.succeeded()); | 28 return PP_FromBool(enter.succeeded()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 PP_Bool Initialize(PP_Resource certificate, | 31 PP_Bool Initialize(PP_Resource certificate, |
| 32 const char *bytes, | 32 const char* bytes, |
| 33 uint32_t length) { | 33 uint32_t length) { |
| 34 EnterX509CertificatePrivate enter(certificate, true); | 34 EnterX509CertificatePrivate enter(certificate, true); |
| 35 if (enter.failed()) | 35 if (enter.failed()) |
| 36 return PP_FALSE; | 36 return PP_FALSE; |
| 37 return enter.object()->Initialize(bytes, length); | 37 return enter.object()->Initialize(bytes, length); |
| 38 } | 38 } |
| 39 | 39 |
| 40 PP_Var GetField(PP_Resource certificate, | 40 PP_Var GetField(PP_Resource certificate, |
| 41 PP_X509Certificate_Private_Field field) { | 41 PP_X509Certificate_Private_Field field) { |
| 42 EnterX509CertificatePrivate enter(certificate, true); | 42 EnterX509CertificatePrivate enter(certificate, true); |
| 43 if (enter.failed()) | 43 if (enter.failed()) |
| 44 return PP_MakeUndefined(); | 44 return PP_MakeUndefined(); |
| 45 return enter.object()->GetField(field); | 45 return enter.object()->GetField(field); |
| 46 } | 46 } |
| 47 | 47 |
| 48 const PPB_X509Certificate_Private g_ppb_x509_certificate_thunk = { | 48 const PPB_X509Certificate_Private g_ppb_x509_certificate_thunk = { |
| 49 &Create, | 49 &Create, &IsX509CertificatePrivate, &Initialize, &GetField}; |
| 50 &IsX509CertificatePrivate, | |
| 51 &Initialize, | |
| 52 &GetField | |
| 53 }; | |
| 54 | 50 |
| 55 } // namespace | 51 } // namespace |
| 56 | 52 |
| 57 const PPB_X509Certificate_Private_0_1* | 53 const PPB_X509Certificate_Private_0_1* |
| 58 GetPPB_X509Certificate_Private_0_1_Thunk() { | 54 GetPPB_X509Certificate_Private_0_1_Thunk() { |
| 59 return &g_ppb_x509_certificate_thunk; | 55 return &g_ppb_x509_certificate_thunk; |
| 60 } | 56 } |
| 61 | 57 |
| 62 } // namespace thunk | 58 } // namespace thunk |
| 63 } // namespace ppapi | 59 } // namespace ppapi |
| OLD | NEW |