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/dev/ppb_content_decryptor_dev.h" | |
6 #include "ppapi/thunk/thunk.h" | |
7 #include "ppapi/thunk/enter.h" | |
8 #include "ppapi/thunk/ppb_instance_api.h" | |
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); | |
dmichael (off chromium)
2012/08/08 22:24:02
style nit: when you have to go multi-line, you sho
Tom Finegan
2012/08/09 22:45:17
Done.
| |
41 } | |
42 | |
43 void KeyError(PP_Instance instance, | |
44 PP_Var key_system, | |
45 PP_Var session_id, | |
46 int32_t media_error, | |
47 int32_t system_error) { | |
48 EnterInstance enter(instance); | |
49 if (enter.succeeded()) | |
50 enter.functions()->KeyError(instance, key_system, session_id, media_error, | |
51 system_error); | |
52 } | |
53 | |
54 void DeliverBlock(PP_Instance instance, | |
55 PP_Resource decrypted_block, | |
56 uint64_t request_id) { | |
57 EnterInstance enter(instance); | |
58 if (enter.succeeded()) | |
59 enter.functions()->DeliverBlock(instance, decrypted_block, request_id); | |
60 } | |
61 | |
62 void DeliverFrame(PP_Instance instance, | |
63 PP_Resource decrypted_frame, | |
64 uint64_t request_id) { | |
65 EnterInstance enter(instance); | |
66 if (enter.succeeded()) | |
67 enter.functions()->DeliverFrame(instance, decrypted_frame, request_id); | |
68 } | |
69 | |
70 void DeliverSamples(PP_Instance instance, | |
71 PP_Resource decrypted_samples, | |
72 uint64_t request_id) { | |
73 EnterInstance enter(instance); | |
74 if (enter.succeeded()) | |
75 enter.functions()->DeliverSamples(instance, decrypted_samples, request_id); | |
76 } | |
77 | |
78 const PPB_ContentDecryptor_Dev g_ppb_decryption_thunk = { | |
79 &NeedKey, | |
80 &KeyAdded, | |
81 &KeyMessage, | |
82 &KeyError, | |
83 &DeliverBlock, | |
84 &DeliverFrame, | |
85 &DeliverSamples | |
86 }; | |
87 | |
88 } // namespace | |
89 | |
90 const PPB_ContentDecryptor_Dev* GetPPB_ContentDecryptor_Dev_0_1_Thunk() { | |
91 return &g_ppb_decryption_thunk; | |
92 } | |
93 | |
94 } // namespace thunk | |
95 } // namespace ppapi | |
OLD | NEW |