Introduce AndroidMetricsProvider class.
[chromium-blink-merge.git] / ppapi / thunk / ppb_content_decryptor_private_thunk.cc
blob42836d992d691d2fd84b27800acb5ea7ac4bc194
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 Wed Feb 26 16:37:47 2014.
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 SessionCreated(PP_Instance instance,
20 uint32_t session_id,
21 struct PP_Var web_session_id) {
22 VLOG(4) << "PPB_ContentDecryptor_Private::SessionCreated()";
23 EnterInstance enter(instance);
24 if (enter.failed())
25 return;
26 enter.functions()->SessionCreated(instance, session_id, web_session_id);
29 void SessionMessage(PP_Instance instance,
30 uint32_t session_id,
31 struct PP_Var message,
32 struct PP_Var destination_url) {
33 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()";
34 EnterInstance enter(instance);
35 if (enter.failed())
36 return;
37 enter.functions()->SessionMessage(instance,
38 session_id,
39 message,
40 destination_url);
43 void SessionReady(PP_Instance instance, uint32_t session_id) {
44 VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()";
45 EnterInstance enter(instance);
46 if (enter.failed())
47 return;
48 enter.functions()->SessionReady(instance, session_id);
51 void SessionClosed(PP_Instance instance, uint32_t session_id) {
52 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()";
53 EnterInstance enter(instance);
54 if (enter.failed())
55 return;
56 enter.functions()->SessionClosed(instance, session_id);
59 void SessionError(PP_Instance instance,
60 uint32_t session_id,
61 int32_t media_error,
62 uint32_t system_code) {
63 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()";
64 EnterInstance enter(instance);
65 if (enter.failed())
66 return;
67 enter.functions()->SessionError(instance,
68 session_id,
69 media_error,
70 system_code);
73 void DeliverBlock(PP_Instance instance,
74 PP_Resource decrypted_block,
75 const struct PP_DecryptedBlockInfo* decrypted_block_info) {
76 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()";
77 EnterInstance enter(instance);
78 if (enter.failed())
79 return;
80 enter.functions()->DeliverBlock(instance,
81 decrypted_block,
82 decrypted_block_info);
85 void DecoderInitializeDone(PP_Instance instance,
86 PP_DecryptorStreamType decoder_type,
87 uint32_t request_id,
88 PP_Bool success) {
89 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()";
90 EnterInstance enter(instance);
91 if (enter.failed())
92 return;
93 enter.functions()->DecoderInitializeDone(instance,
94 decoder_type,
95 request_id,
96 success);
99 void DecoderDeinitializeDone(PP_Instance instance,
100 PP_DecryptorStreamType decoder_type,
101 uint32_t request_id) {
102 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()";
103 EnterInstance enter(instance);
104 if (enter.failed())
105 return;
106 enter.functions()->DecoderDeinitializeDone(instance,
107 decoder_type,
108 request_id);
111 void DecoderResetDone(PP_Instance instance,
112 PP_DecryptorStreamType decoder_type,
113 uint32_t request_id) {
114 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()";
115 EnterInstance enter(instance);
116 if (enter.failed())
117 return;
118 enter.functions()->DecoderResetDone(instance, decoder_type, request_id);
121 void DeliverFrame(PP_Instance instance,
122 PP_Resource decrypted_frame,
123 const struct PP_DecryptedFrameInfo* decrypted_frame_info) {
124 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()";
125 EnterInstance enter(instance);
126 if (enter.failed())
127 return;
128 enter.functions()->DeliverFrame(instance,
129 decrypted_frame,
130 decrypted_frame_info);
133 void DeliverSamples(
134 PP_Instance instance,
135 PP_Resource audio_frames,
136 const struct PP_DecryptedSampleInfo* decrypted_sample_info) {
137 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()";
138 EnterInstance enter(instance);
139 if (enter.failed())
140 return;
141 enter.functions()->DeliverSamples(instance,
142 audio_frames,
143 decrypted_sample_info);
146 const PPB_ContentDecryptor_Private_0_11
147 g_ppb_contentdecryptor_private_thunk_0_11 = {
148 &SessionCreated,
149 &SessionMessage,
150 &SessionReady,
151 &SessionClosed,
152 &SessionError,
153 &DeliverBlock,
154 &DecoderInitializeDone,
155 &DecoderDeinitializeDone,
156 &DecoderResetDone,
157 &DeliverFrame,
158 &DeliverSamples
161 } // namespace
163 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_11*
164 GetPPB_ContentDecryptor_Private_0_11_Thunk() {
165 return &g_ppb_contentdecryptor_private_thunk_0_11;
168 } // namespace thunk
169 } // namespace ppapi