Whitelist window states to persist on ASH app windows.
[chromium-blink-merge.git] / ppapi / thunk / ppb_content_decryptor_private_thunk.cc
blob9450eedcbd6ae61f822263aa465bc99dba9aa6c4
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.
5 // From private/ppb_content_decryptor_private.idl,
6 // modified Tue Apr 16 11:25:44 2013.
8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_content_decryptor_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppb_instance_api.h"
13 #include "ppapi/thunk/resource_creation_api.h"
14 #include "ppapi/thunk/thunk.h"
16 namespace ppapi {
17 namespace thunk {
19 namespace {
21 void NeedKey(PP_Instance instance,
22 struct PP_Var key_system,
23 struct PP_Var session_id,
24 struct PP_Var init_data) {
25 VLOG(4) << "PPB_ContentDecryptor_Private::NeedKey()";
26 EnterInstance enter(instance);
27 if (enter.failed())
28 return;
29 enter.functions()->NeedKey(instance, key_system, session_id, init_data);
32 void KeyAdded(PP_Instance instance,
33 struct PP_Var key_system,
34 struct PP_Var session_id) {
35 VLOG(4) << "PPB_ContentDecryptor_Private::KeyAdded()";
36 EnterInstance enter(instance);
37 if (enter.failed())
38 return;
39 enter.functions()->KeyAdded(instance, key_system, session_id);
42 void KeyMessage(PP_Instance instance,
43 struct PP_Var key_system,
44 struct PP_Var session_id,
45 struct PP_Var message,
46 struct PP_Var default_url) {
47 VLOG(4) << "PPB_ContentDecryptor_Private::KeyMessage()";
48 EnterInstance enter(instance);
49 if (enter.failed())
50 return;
51 enter.functions()->KeyMessage(instance,
52 key_system,
53 session_id,
54 message,
55 default_url);
58 void KeyError(PP_Instance instance,
59 struct PP_Var key_system,
60 struct PP_Var session_id,
61 int32_t media_error,
62 int32_t system_code) {
63 VLOG(4) << "PPB_ContentDecryptor_Private::KeyError()";
64 EnterInstance enter(instance);
65 if (enter.failed())
66 return;
67 enter.functions()->KeyError(instance,
68 key_system,
69 session_id,
70 media_error,
71 system_code);
74 void DeliverBlock(PP_Instance instance,
75 PP_Resource decrypted_block,
76 const struct PP_DecryptedBlockInfo* decrypted_block_info) {
77 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()";
78 EnterInstance enter(instance);
79 if (enter.failed())
80 return;
81 enter.functions()->DeliverBlock(instance,
82 decrypted_block,
83 decrypted_block_info);
86 void DecoderInitializeDone(PP_Instance instance,
87 PP_DecryptorStreamType decoder_type,
88 uint32_t request_id,
89 PP_Bool success) {
90 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()";
91 EnterInstance enter(instance);
92 if (enter.failed())
93 return;
94 enter.functions()->DecoderInitializeDone(instance,
95 decoder_type,
96 request_id,
97 success);
100 void DecoderDeinitializeDone(PP_Instance instance,
101 PP_DecryptorStreamType decoder_type,
102 uint32_t request_id) {
103 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()";
104 EnterInstance enter(instance);
105 if (enter.failed())
106 return;
107 enter.functions()->DecoderDeinitializeDone(instance,
108 decoder_type,
109 request_id);
112 void DecoderResetDone(PP_Instance instance,
113 PP_DecryptorStreamType decoder_type,
114 uint32_t request_id) {
115 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()";
116 EnterInstance enter(instance);
117 if (enter.failed())
118 return;
119 enter.functions()->DecoderResetDone(instance, decoder_type, request_id);
122 void DeliverFrame(PP_Instance instance,
123 PP_Resource decrypted_frame,
124 const struct PP_DecryptedFrameInfo* decrypted_frame_info) {
125 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()";
126 EnterInstance enter(instance);
127 if (enter.failed())
128 return;
129 enter.functions()->DeliverFrame(instance,
130 decrypted_frame,
131 decrypted_frame_info);
134 void DeliverSamples(
135 PP_Instance instance,
136 PP_Resource audio_frames,
137 const struct PP_DecryptedBlockInfo* decrypted_block_info) {
138 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()";
139 EnterInstance enter(instance);
140 if (enter.failed())
141 return;
142 enter.functions()->DeliverSamples(instance,
143 audio_frames,
144 decrypted_block_info);
147 const PPB_ContentDecryptor_Private_0_6
148 g_ppb_contentdecryptor_private_thunk_0_6 = {
149 &NeedKey,
150 &KeyAdded,
151 &KeyMessage,
152 &KeyError,
153 &DeliverBlock,
154 &DecoderInitializeDone,
155 &DecoderDeinitializeDone,
156 &DecoderResetDone,
157 &DeliverFrame,
158 &DeliverSamples
161 } // namespace
163 const PPB_ContentDecryptor_Private_0_6*
164 GetPPB_ContentDecryptor_Private_0_6_Thunk() {
165 return &g_ppb_contentdecryptor_private_thunk_0_6;
168 } // namespace thunk
169 } // namespace ppapi