Add ability for NetLogLogger to gather data from more than just NetLog
[chromium-blink-merge.git] / ppapi / thunk / ppb_content_decryptor_private_thunk.cc
blob1a52c0542f3f8ff08c11d8eda9645864f533f566
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 modified Mon Jan 12 17:33:29
6 // 2015.
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/ppapi_thunk_export.h"
14 namespace ppapi {
15 namespace thunk {
17 namespace {
19 void PromiseResolved(PP_Instance instance, uint32_t promise_id) {
20 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolved()";
21 EnterInstance enter(instance);
22 if (enter.failed())
23 return;
24 enter.functions()->PromiseResolved(instance, promise_id);
27 void PromiseResolvedWithSession(PP_Instance instance,
28 uint32_t promise_id,
29 struct PP_Var session_id) {
30 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithSession()";
31 EnterInstance enter(instance);
32 if (enter.failed())
33 return;
34 enter.functions()->PromiseResolvedWithSession(instance, promise_id,
35 session_id);
38 void PromiseRejected(PP_Instance instance,
39 uint32_t promise_id,
40 PP_CdmExceptionCode exception_code,
41 uint32_t system_code,
42 struct PP_Var error_description) {
43 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseRejected()";
44 EnterInstance enter(instance);
45 if (enter.failed())
46 return;
47 enter.functions()->PromiseRejected(instance, promise_id, exception_code,
48 system_code, error_description);
51 void SessionMessage(PP_Instance instance,
52 struct PP_Var session_id,
53 PP_CdmMessageType message_type,
54 struct PP_Var message,
55 struct PP_Var legacy_destination_url) {
56 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()";
57 EnterInstance enter(instance);
58 if (enter.failed())
59 return;
60 enter.functions()->SessionMessage(instance, session_id, message_type, message,
61 legacy_destination_url);
64 void SessionKeysChange(PP_Instance instance,
65 struct PP_Var session_id,
66 PP_Bool has_additional_usable_key,
67 uint32_t key_count,
68 const struct PP_KeyInformation key_information[]) {
69 VLOG(4) << "PPB_ContentDecryptor_Private::SessionKeysChange()";
70 EnterInstance enter(instance);
71 if (enter.failed())
72 return;
73 enter.functions()->SessionKeysChange(instance, session_id,
74 has_additional_usable_key, key_count,
75 key_information);
78 void SessionExpirationChange(PP_Instance instance,
79 struct PP_Var session_id,
80 PP_Time new_expiry_time) {
81 VLOG(4) << "PPB_ContentDecryptor_Private::SessionExpirationChange()";
82 EnterInstance enter(instance);
83 if (enter.failed())
84 return;
85 enter.functions()->SessionExpirationChange(instance, session_id,
86 new_expiry_time);
89 void SessionClosed(PP_Instance instance, struct PP_Var session_id) {
90 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()";
91 EnterInstance enter(instance);
92 if (enter.failed())
93 return;
94 enter.functions()->SessionClosed(instance, session_id);
97 void SessionError(PP_Instance instance,
98 struct PP_Var session_id,
99 PP_CdmExceptionCode exception_code,
100 uint32_t system_code,
101 struct PP_Var error_description) {
102 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()";
103 EnterInstance enter(instance);
104 if (enter.failed())
105 return;
106 enter.functions()->SessionError(instance, session_id, exception_code,
107 system_code, error_description);
110 void DeliverBlock(PP_Instance instance,
111 PP_Resource decrypted_block,
112 const struct PP_DecryptedBlockInfo* decrypted_block_info) {
113 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()";
114 EnterInstance enter(instance);
115 if (enter.failed())
116 return;
117 enter.functions()->DeliverBlock(instance, decrypted_block,
118 decrypted_block_info);
121 void DecoderInitializeDone(PP_Instance instance,
122 PP_DecryptorStreamType decoder_type,
123 uint32_t request_id,
124 PP_Bool success) {
125 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()";
126 EnterInstance enter(instance);
127 if (enter.failed())
128 return;
129 enter.functions()->DecoderInitializeDone(instance, decoder_type, request_id,
130 success);
133 void DecoderDeinitializeDone(PP_Instance instance,
134 PP_DecryptorStreamType decoder_type,
135 uint32_t request_id) {
136 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()";
137 EnterInstance enter(instance);
138 if (enter.failed())
139 return;
140 enter.functions()->DecoderDeinitializeDone(instance, decoder_type,
141 request_id);
144 void DecoderResetDone(PP_Instance instance,
145 PP_DecryptorStreamType decoder_type,
146 uint32_t request_id) {
147 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()";
148 EnterInstance enter(instance);
149 if (enter.failed())
150 return;
151 enter.functions()->DecoderResetDone(instance, decoder_type, request_id);
154 void DeliverFrame(PP_Instance instance,
155 PP_Resource decrypted_frame,
156 const struct PP_DecryptedFrameInfo* decrypted_frame_info) {
157 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()";
158 EnterInstance enter(instance);
159 if (enter.failed())
160 return;
161 enter.functions()->DeliverFrame(instance, decrypted_frame,
162 decrypted_frame_info);
165 void DeliverSamples(
166 PP_Instance instance,
167 PP_Resource audio_frames,
168 const struct PP_DecryptedSampleInfo* decrypted_sample_info) {
169 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()";
170 EnterInstance enter(instance);
171 if (enter.failed())
172 return;
173 enter.functions()->DeliverSamples(instance, audio_frames,
174 decrypted_sample_info);
177 const PPB_ContentDecryptor_Private_0_13
178 g_ppb_contentdecryptor_private_thunk_0_13 = {&PromiseResolved,
179 &PromiseResolvedWithSession,
180 &PromiseRejected,
181 &SessionMessage,
182 &SessionKeysChange,
183 &SessionExpirationChange,
184 &SessionClosed,
185 &SessionError,
186 &DeliverBlock,
187 &DecoderInitializeDone,
188 &DecoderDeinitializeDone,
189 &DecoderResetDone,
190 &DeliverFrame,
191 &DeliverSamples};
193 } // namespace
195 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_13*
196 GetPPB_ContentDecryptor_Private_0_13_Thunk() {
197 return &g_ppb_contentdecryptor_private_thunk_0_13;
200 } // namespace thunk
201 } // namespace ppapi