OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // From private/ppb_platform_verification_private.idl, | 5 // From private/ppb_platform_verification_private.idl, |
6 // modified Thu Sep 12 11:48:28 2013. | 6 // modified Fri Oct 18 15:02:09 2013. |
7 | 7 |
8 #include "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/private/ppb_platform_verification_private.h" | 10 #include "ppapi/c/private/ppb_platform_verification_private.h" |
11 #include "ppapi/shared_impl/tracked_callback.h" | 11 #include "ppapi/shared_impl/tracked_callback.h" |
12 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
13 #include "ppapi/thunk/ppb_instance_api.h" | 13 #include "ppapi/thunk/ppb_instance_api.h" |
14 #include "ppapi/thunk/ppb_platform_verification_api.h" | 14 #include "ppapi/thunk/ppb_platform_verification_api.h" |
15 #include "ppapi/thunk/resource_creation_api.h" | 15 #include "ppapi/thunk/resource_creation_api.h" |
16 #include "ppapi/thunk/thunk.h" | 16 #include "ppapi/thunk/thunk.h" |
(...skipping 10 matching lines...) Expand all Loading... |
27 return 0; | 27 return 0; |
28 return enter.functions()->CreatePlatformVerificationPrivate(instance); | 28 return enter.functions()->CreatePlatformVerificationPrivate(instance); |
29 } | 29 } |
30 | 30 |
31 PP_Bool IsPlatformVerification(PP_Resource resource) { | 31 PP_Bool IsPlatformVerification(PP_Resource resource) { |
32 VLOG(4) << "PPB_PlatformVerification_Private::IsPlatformVerification()"; | 32 VLOG(4) << "PPB_PlatformVerification_Private::IsPlatformVerification()"; |
33 EnterResource<PPB_PlatformVerification_API> enter(resource, false); | 33 EnterResource<PPB_PlatformVerification_API> enter(resource, false); |
34 return PP_FromBool(enter.succeeded()); | 34 return PP_FromBool(enter.succeeded()); |
35 } | 35 } |
36 | 36 |
37 int32_t CanChallengePlatform(PP_Resource instance, | |
38 PP_Bool* can_challenge_platform, | |
39 struct PP_CompletionCallback callback) { | |
40 VLOG(4) << "PPB_PlatformVerification_Private::CanChallengePlatform()"; | |
41 EnterResource<PPB_PlatformVerification_API> enter(instance, callback, true); | |
42 if (enter.failed()) | |
43 return enter.retval(); | |
44 return enter.SetResult(enter.object()->CanChallengePlatform( | |
45 can_challenge_platform, | |
46 enter.callback())); | |
47 } | |
48 | |
49 int32_t ChallengePlatform(PP_Resource instance, | 37 int32_t ChallengePlatform(PP_Resource instance, |
50 struct PP_Var service_id, | 38 struct PP_Var service_id, |
51 struct PP_Var challenge, | 39 struct PP_Var challenge, |
52 struct PP_Var* signed_data, | 40 struct PP_Var* signed_data, |
53 struct PP_Var* signed_data_signature, | 41 struct PP_Var* signed_data_signature, |
54 struct PP_Var* platform_key_certificate, | 42 struct PP_Var* platform_key_certificate, |
55 struct PP_CompletionCallback callback) { | 43 struct PP_CompletionCallback callback) { |
56 VLOG(4) << "PPB_PlatformVerification_Private::ChallengePlatform()"; | 44 VLOG(4) << "PPB_PlatformVerification_Private::ChallengePlatform()"; |
57 EnterResource<PPB_PlatformVerification_API> enter(instance, callback, true); | 45 EnterResource<PPB_PlatformVerification_API> enter(instance, callback, true); |
58 if (enter.failed()) | 46 if (enter.failed()) |
59 return enter.retval(); | 47 return enter.retval(); |
60 return enter.SetResult(enter.object()->ChallengePlatform( | 48 return enter.SetResult(enter.object()->ChallengePlatform( |
61 service_id, | 49 service_id, |
62 challenge, | 50 challenge, |
63 signed_data, | 51 signed_data, |
64 signed_data_signature, | 52 signed_data_signature, |
65 platform_key_certificate, | 53 platform_key_certificate, |
66 enter.callback())); | 54 enter.callback())); |
67 } | 55 } |
68 | 56 |
69 const PPB_PlatformVerification_Private_0_1 | 57 const PPB_PlatformVerification_Private_0_2 |
70 g_ppb_platformverification_private_thunk_0_1 = { | 58 g_ppb_platformverification_private_thunk_0_2 = { |
71 &Create, | 59 &Create, |
72 &IsPlatformVerification, | 60 &IsPlatformVerification, |
73 &CanChallengePlatform, | |
74 &ChallengePlatform | 61 &ChallengePlatform |
75 }; | 62 }; |
76 | 63 |
77 } // namespace | 64 } // namespace |
78 | 65 |
79 const PPB_PlatformVerification_Private_0_1* | 66 const PPB_PlatformVerification_Private_0_2* |
80 GetPPB_PlatformVerification_Private_0_1_Thunk() { | 67 GetPPB_PlatformVerification_Private_0_2_Thunk() { |
81 return &g_ppb_platformverification_private_thunk_0_1; | 68 return &g_ppb_platformverification_private_thunk_0_2; |
82 } | 69 } |
83 | 70 |
84 } // namespace thunk | 71 } // namespace thunk |
85 } // namespace ppapi | 72 } // namespace ppapi |
OLD | NEW |