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

Side by Side Diff: ppapi/thunk/ppb_platform_verification_private_thunk.cc

Issue 23569005: Add PPAPI interfaces for platform verification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 7 years, 3 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 2013 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 // From private/ppb_platform_verification_private.idl,
6 // modified Wed Sep 4 15:08:43 2013.
7
8 #include "ppapi/c/pp_completion_callback.h"
9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/private/ppb_platform_verification_private.h"
11 #include "ppapi/shared_impl/ppb_platform_verification_shared.h"
12 #include "ppapi/shared_impl/tracked_callback.h"
13 #include "ppapi/thunk/enter.h"
14 #include "ppapi/thunk/ppb_instance_api.h"
15 #include "ppapi/thunk/ppb_platform_verification_api.h"
16 #include "ppapi/thunk/resource_creation_api.h"
17 #include "ppapi/thunk/thunk.h"
18
19 namespace ppapi {
20 namespace thunk {
21
22 namespace {
23
24 PP_Resource Create(PP_Instance instance) {
25 VLOG(4) << "PPB_PlatformVerification_Private::Create()";
26 EnterResourceCreation enter(instance);
27 if (enter.failed())
28 return 0;
29 return enter.functions()->CreatePlatformVerificationPrivate(instance);
30 }
31
32 PP_Bool IsPlatformVerification(PP_Resource resource) {
33 VLOG(4) << "PPB_PlatformVerification_Private::IsPlatformVerification()";
34 EnterResource<PPB_PlatformVerification_API> enter(resource, false);
35 return PP_FromBool(enter.succeeded());
36 }
37
38 PP_Bool CanChallengePlatform(void) {
39 VLOG(4) << "PPB_PlatformVerification_Private::CanChallengePlatform()";
40 return PPB_PlatformVerification_Shared::CanChallengePlatform();
41 }
42
43 int32_t ChallengePlatform(PP_Instance instance,
44 struct PP_Var service_id,
45 struct PP_Var challenge,
46 struct PP_Var* signed_data,
47 struct PP_Var* signed_data_signature,
48 struct PP_Var* platform_key_certificate,
49 struct PP_CompletionCallback callback) {
50 VLOG(4) << "PPB_PlatformVerification_Private::ChallengePlatform()";
51 EnterInstance enter(instance, callback);
52 if (enter.failed())
53 return enter.retval();
54 return enter.SetResult(enter.functions()->ChallengePlatform(
55 instance,
56 service_id,
57 challenge,
58 signed_data,
59 signed_data_signature,
60 platform_key_certificate,
61 enter.callback()));
62 }
63
64 const PPB_PlatformVerification_Private_0_1
65 g_ppb_platformverification_private_thunk_0_1 = {
66 &Create,
67 &IsPlatformVerification,
68 &CanChallengePlatform,
69 &ChallengePlatform
70 };
71
72 } // namespace
73
74 const PPB_PlatformVerification_Private_0_1*
75 GetPPB_PlatformVerification_Private_0_1_Thunk() {
76 return &g_ppb_platformverification_private_thunk_0_1;
77 }
78
79 } // namespace thunk
80 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698