OLD | NEW |
---|---|
(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 #include "ppapi/c/private/ppb_content_decryptor_private.h" | |
6 #include "ppapi/thunk/thunk.h" | |
7 #include "ppapi/thunk/enter.h" | |
8 #include "ppapi/thunk/ppb_instance_api.h" | |
dmichael (off chromium)
2012/08/15 17:44:37
nit: include order
Tom Finegan
2012/08/16 03:10:48
Done.
| |
9 | |
10 namespace ppapi { | |
11 namespace thunk { | |
12 | |
13 namespace { | |
14 | |
15 void NeedKey(PP_Instance instance, | |
16 PP_Var key_system, | |
17 PP_Var session_id, | |
18 PP_Var init_data) { | |
19 EnterInstance enter(instance); | |
20 if (enter.succeeded()) | |
21 enter.functions()->NeedKey(instance, key_system, session_id, init_data); | |
22 } | |
23 | |
24 void KeyAdded(PP_Instance instance, | |
25 PP_Var key_system, | |
26 PP_Var session_id) { | |
27 EnterInstance enter(instance); | |
28 if (enter.succeeded()) | |
29 enter.functions()->KeyAdded(instance, key_system, session_id); | |
30 } | |
31 | |
32 void KeyMessage(PP_Instance instance, | |
33 PP_Var key_system, | |
34 PP_Var session_id, | |
35 PP_Resource message, | |
36 PP_Var default_url) { | |
37 EnterInstance enter(instance); | |
38 if (enter.succeeded()) { | |
39 enter.functions()->KeyMessage(instance, key_system, session_id, message, | |
40 default_url); | |
41 } | |
42 } | |
43 | |
44 void KeyError(PP_Instance instance, | |
45 PP_Var key_system, | |
46 PP_Var session_id, | |
47 int32_t media_error, | |
48 int32_t system_code) { | |
49 EnterInstance enter(instance); | |
50 if (enter.succeeded()) { | |
51 enter.functions()->KeyError(instance, key_system, session_id, media_error, | |
52 system_code); | |
53 } | |
54 } | |
55 | |
56 void DeliverBlock(PP_Instance instance, | |
57 PP_Resource decrypted_block, | |
58 int32_t request_id) { | |
59 EnterInstance enter(instance); | |
60 if (enter.succeeded()) | |
61 enter.functions()->DeliverBlock(instance, decrypted_block, request_id); | |
62 } | |
63 | |
64 void DeliverFrame(PP_Instance instance, | |
65 PP_Resource decrypted_frame, | |
66 int32_t request_id) { | |
67 EnterInstance enter(instance); | |
68 if (enter.succeeded()) | |
69 enter.functions()->DeliverFrame(instance, decrypted_frame, request_id); | |
70 } | |
71 | |
72 void DeliverSamples(PP_Instance instance, | |
73 PP_Resource decrypted_samples, | |
74 int32_t request_id) { | |
75 EnterInstance enter(instance); | |
76 if (enter.succeeded()) | |
77 enter.functions()->DeliverSamples(instance, decrypted_samples, request_id); | |
78 } | |
79 | |
80 const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { | |
81 &NeedKey, | |
82 &KeyAdded, | |
83 &KeyMessage, | |
84 &KeyError, | |
85 &DeliverBlock, | |
86 &DeliverFrame, | |
87 &DeliverSamples | |
88 }; | |
89 | |
90 } // namespace | |
91 | |
92 const PPB_ContentDecryptor_Private* | |
93 GetPPB_ContentDecryptor_Private_0_1_Thunk() { | |
94 return &g_ppb_decryption_thunk; | |
95 } | |
96 | |
97 } // namespace thunk | |
98 } // namespace ppapi | |
OLD | NEW |