Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: ppapi/thunk/ppb_content_decryptor_private_thunk.cc

Issue 238923007: PPAPI: Format ppapi/thunk using clang-format. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/ppb_console_thunk.cc ('k') | ppapi/thunk/ppb_device_ref_dev_thunk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // From private/ppb_content_decryptor_private.idl, 5 // From private/ppb_content_decryptor_private.idl modified Wed Nov 5 14:29:15
6 // modified Mon Aug 25 13:52:39 2014. 6 // 2014.
7 7
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/private/ppb_content_decryptor_private.h" 9 #include "ppapi/c/private/ppb_content_decryptor_private.h"
10 #include "ppapi/shared_impl/tracked_callback.h" 10 #include "ppapi/shared_impl/tracked_callback.h"
11 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
12 #include "ppapi/thunk/ppapi_thunk_export.h" 12 #include "ppapi/thunk/ppapi_thunk_export.h"
13 13
14 namespace ppapi { 14 namespace ppapi {
15 namespace thunk { 15 namespace thunk {
16 16
17 namespace { 17 namespace {
18 18
19 void PromiseResolved(PP_Instance instance, uint32_t promise_id) { 19 void PromiseResolved(PP_Instance instance, uint32_t promise_id) {
20 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolved()"; 20 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolved()";
21 EnterInstance enter(instance); 21 EnterInstance enter(instance);
22 if (enter.failed()) 22 if (enter.failed())
23 return; 23 return;
24 enter.functions()->PromiseResolved(instance, promise_id); 24 enter.functions()->PromiseResolved(instance, promise_id);
25 } 25 }
26 26
27 void PromiseResolvedWithSession(PP_Instance instance, 27 void PromiseResolvedWithSession(PP_Instance instance,
28 uint32_t promise_id, 28 uint32_t promise_id,
29 struct PP_Var web_session_id) { 29 struct PP_Var web_session_id) {
30 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithSession()"; 30 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithSession()";
31 EnterInstance enter(instance); 31 EnterInstance enter(instance);
32 if (enter.failed()) 32 if (enter.failed())
33 return; 33 return;
34 enter.functions()->PromiseResolvedWithSession(instance, 34 enter.functions()->PromiseResolvedWithSession(instance, promise_id,
35 promise_id,
36 web_session_id); 35 web_session_id);
37 } 36 }
38 37
39 void PromiseResolvedWithKeyIds(PP_Instance instance, 38 void PromiseResolvedWithKeyIds(PP_Instance instance,
40 uint32_t promise_id, 39 uint32_t promise_id,
41 struct PP_Var key_ids_array) { 40 struct PP_Var key_ids_array) {
42 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithKeyIds()"; 41 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithKeyIds()";
43 EnterInstance enter(instance); 42 EnterInstance enter(instance);
44 if (enter.failed()) 43 if (enter.failed())
45 return; 44 return;
46 enter.functions()->PromiseResolvedWithKeyIds(instance, 45 enter.functions()->PromiseResolvedWithKeyIds(instance, promise_id,
47 promise_id,
48 key_ids_array); 46 key_ids_array);
49 } 47 }
50 48
51 void PromiseRejected(PP_Instance instance, 49 void PromiseRejected(PP_Instance instance,
52 uint32_t promise_id, 50 uint32_t promise_id,
53 PP_CdmExceptionCode exception_code, 51 PP_CdmExceptionCode exception_code,
54 uint32_t system_code, 52 uint32_t system_code,
55 struct PP_Var error_description) { 53 struct PP_Var error_description) {
56 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseRejected()"; 54 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseRejected()";
57 EnterInstance enter(instance); 55 EnterInstance enter(instance);
58 if (enter.failed()) 56 if (enter.failed())
59 return; 57 return;
60 enter.functions()->PromiseRejected(instance, 58 enter.functions()->PromiseRejected(instance, promise_id, exception_code,
61 promise_id, 59 system_code, error_description);
62 exception_code,
63 system_code,
64 error_description);
65 } 60 }
66 61
67 void SessionMessage(PP_Instance instance, 62 void SessionMessage(PP_Instance instance,
68 struct PP_Var web_session_id, 63 struct PP_Var web_session_id,
69 struct PP_Var message, 64 struct PP_Var message,
70 struct PP_Var destination_url) { 65 struct PP_Var destination_url) {
71 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()"; 66 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()";
72 EnterInstance enter(instance); 67 EnterInstance enter(instance);
73 if (enter.failed()) 68 if (enter.failed())
74 return; 69 return;
75 enter.functions()->SessionMessage(instance, 70 enter.functions()->SessionMessage(instance, web_session_id, message,
76 web_session_id,
77 message,
78 destination_url); 71 destination_url);
79 } 72 }
80 73
81 void SessionKeysChange(PP_Instance instance, 74 void SessionKeysChange(PP_Instance instance,
82 struct PP_Var web_session_id, 75 struct PP_Var web_session_id,
83 PP_Bool has_additional_usable_key) { 76 PP_Bool has_additional_usable_key) {
84 VLOG(4) << "PPB_ContentDecryptor_Private::SessionKeysChange()"; 77 VLOG(4) << "PPB_ContentDecryptor_Private::SessionKeysChange()";
85 EnterInstance enter(instance); 78 EnterInstance enter(instance);
86 if (enter.failed()) 79 if (enter.failed())
87 return; 80 return;
88 enter.functions()->SessionKeysChange(instance, 81 enter.functions()->SessionKeysChange(instance, web_session_id,
89 web_session_id,
90 has_additional_usable_key); 82 has_additional_usable_key);
91 } 83 }
92 84
93 void SessionExpirationChange(PP_Instance instance, 85 void SessionExpirationChange(PP_Instance instance,
94 struct PP_Var web_session_id, 86 struct PP_Var web_session_id,
95 PP_Time new_expiry_time) { 87 PP_Time new_expiry_time) {
96 VLOG(4) << "PPB_ContentDecryptor_Private::SessionExpirationChange()"; 88 VLOG(4) << "PPB_ContentDecryptor_Private::SessionExpirationChange()";
97 EnterInstance enter(instance); 89 EnterInstance enter(instance);
98 if (enter.failed()) 90 if (enter.failed())
99 return; 91 return;
100 enter.functions()->SessionExpirationChange(instance, 92 enter.functions()->SessionExpirationChange(instance, web_session_id,
101 web_session_id,
102 new_expiry_time); 93 new_expiry_time);
103 } 94 }
104 95
105 void SessionReady(PP_Instance instance, struct PP_Var web_session_id) { 96 void SessionReady(PP_Instance instance, struct PP_Var web_session_id) {
106 VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()"; 97 VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()";
107 EnterInstance enter(instance); 98 EnterInstance enter(instance);
108 if (enter.failed()) 99 if (enter.failed())
109 return; 100 return;
110 enter.functions()->SessionReady(instance, web_session_id); 101 enter.functions()->SessionReady(instance, web_session_id);
111 } 102 }
112 103
113 void SessionClosed(PP_Instance instance, struct PP_Var web_session_id) { 104 void SessionClosed(PP_Instance instance, struct PP_Var web_session_id) {
114 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()"; 105 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()";
115 EnterInstance enter(instance); 106 EnterInstance enter(instance);
116 if (enter.failed()) 107 if (enter.failed())
117 return; 108 return;
118 enter.functions()->SessionClosed(instance, web_session_id); 109 enter.functions()->SessionClosed(instance, web_session_id);
119 } 110 }
120 111
121 void SessionError(PP_Instance instance, 112 void SessionError(PP_Instance instance,
122 struct PP_Var web_session_id, 113 struct PP_Var web_session_id,
123 PP_CdmExceptionCode exception_code, 114 PP_CdmExceptionCode exception_code,
124 uint32_t system_code, 115 uint32_t system_code,
125 struct PP_Var error_description) { 116 struct PP_Var error_description) {
126 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()"; 117 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()";
127 EnterInstance enter(instance); 118 EnterInstance enter(instance);
128 if (enter.failed()) 119 if (enter.failed())
129 return; 120 return;
130 enter.functions()->SessionError(instance, 121 enter.functions()->SessionError(instance, web_session_id, exception_code,
131 web_session_id, 122 system_code, error_description);
132 exception_code,
133 system_code,
134 error_description);
135 } 123 }
136 124
137 void DeliverBlock(PP_Instance instance, 125 void DeliverBlock(PP_Instance instance,
138 PP_Resource decrypted_block, 126 PP_Resource decrypted_block,
139 const struct PP_DecryptedBlockInfo* decrypted_block_info) { 127 const struct PP_DecryptedBlockInfo* decrypted_block_info) {
140 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()"; 128 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()";
141 EnterInstance enter(instance); 129 EnterInstance enter(instance);
142 if (enter.failed()) 130 if (enter.failed())
143 return; 131 return;
144 enter.functions()->DeliverBlock(instance, 132 enter.functions()->DeliverBlock(instance, decrypted_block,
145 decrypted_block,
146 decrypted_block_info); 133 decrypted_block_info);
147 } 134 }
148 135
149 void DecoderInitializeDone(PP_Instance instance, 136 void DecoderInitializeDone(PP_Instance instance,
150 PP_DecryptorStreamType decoder_type, 137 PP_DecryptorStreamType decoder_type,
151 uint32_t request_id, 138 uint32_t request_id,
152 PP_Bool success) { 139 PP_Bool success) {
153 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()"; 140 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderInitializeDone()";
154 EnterInstance enter(instance); 141 EnterInstance enter(instance);
155 if (enter.failed()) 142 if (enter.failed())
156 return; 143 return;
157 enter.functions()->DecoderInitializeDone(instance, 144 enter.functions()->DecoderInitializeDone(instance, decoder_type, request_id,
158 decoder_type,
159 request_id,
160 success); 145 success);
161 } 146 }
162 147
163 void DecoderDeinitializeDone(PP_Instance instance, 148 void DecoderDeinitializeDone(PP_Instance instance,
164 PP_DecryptorStreamType decoder_type, 149 PP_DecryptorStreamType decoder_type,
165 uint32_t request_id) { 150 uint32_t request_id) {
166 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()"; 151 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderDeinitializeDone()";
167 EnterInstance enter(instance); 152 EnterInstance enter(instance);
168 if (enter.failed()) 153 if (enter.failed())
169 return; 154 return;
170 enter.functions()->DecoderDeinitializeDone(instance, 155 enter.functions()->DecoderDeinitializeDone(instance, decoder_type,
171 decoder_type,
172 request_id); 156 request_id);
173 } 157 }
174 158
175 void DecoderResetDone(PP_Instance instance, 159 void DecoderResetDone(PP_Instance instance,
176 PP_DecryptorStreamType decoder_type, 160 PP_DecryptorStreamType decoder_type,
177 uint32_t request_id) { 161 uint32_t request_id) {
178 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()"; 162 VLOG(4) << "PPB_ContentDecryptor_Private::DecoderResetDone()";
179 EnterInstance enter(instance); 163 EnterInstance enter(instance);
180 if (enter.failed()) 164 if (enter.failed())
181 return; 165 return;
182 enter.functions()->DecoderResetDone(instance, decoder_type, request_id); 166 enter.functions()->DecoderResetDone(instance, decoder_type, request_id);
183 } 167 }
184 168
185 void DeliverFrame(PP_Instance instance, 169 void DeliverFrame(PP_Instance instance,
186 PP_Resource decrypted_frame, 170 PP_Resource decrypted_frame,
187 const struct PP_DecryptedFrameInfo* decrypted_frame_info) { 171 const struct PP_DecryptedFrameInfo* decrypted_frame_info) {
188 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()"; 172 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverFrame()";
189 EnterInstance enter(instance); 173 EnterInstance enter(instance);
190 if (enter.failed()) 174 if (enter.failed())
191 return; 175 return;
192 enter.functions()->DeliverFrame(instance, 176 enter.functions()->DeliverFrame(instance, decrypted_frame,
193 decrypted_frame,
194 decrypted_frame_info); 177 decrypted_frame_info);
195 } 178 }
196 179
197 void DeliverSamples( 180 void DeliverSamples(
198 PP_Instance instance, 181 PP_Instance instance,
199 PP_Resource audio_frames, 182 PP_Resource audio_frames,
200 const struct PP_DecryptedSampleInfo* decrypted_sample_info) { 183 const struct PP_DecryptedSampleInfo* decrypted_sample_info) {
201 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()"; 184 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()";
202 EnterInstance enter(instance); 185 EnterInstance enter(instance);
203 if (enter.failed()) 186 if (enter.failed())
204 return; 187 return;
205 enter.functions()->DeliverSamples(instance, 188 enter.functions()->DeliverSamples(instance, audio_frames,
206 audio_frames,
207 decrypted_sample_info); 189 decrypted_sample_info);
208 } 190 }
209 191
210 const PPB_ContentDecryptor_Private_0_12 192 const PPB_ContentDecryptor_Private_0_12
211 g_ppb_contentdecryptor_private_thunk_0_12 = { 193 g_ppb_contentdecryptor_private_thunk_0_12 = {&PromiseResolved,
212 &PromiseResolved, 194 &PromiseResolvedWithSession,
213 &PromiseResolvedWithSession, 195 &PromiseResolvedWithKeyIds,
214 &PromiseResolvedWithKeyIds, 196 &PromiseRejected,
215 &PromiseRejected, 197 &SessionMessage,
216 &SessionMessage, 198 &SessionKeysChange,
217 &SessionKeysChange, 199 &SessionExpirationChange,
218 &SessionExpirationChange, 200 &SessionReady,
219 &SessionReady, 201 &SessionClosed,
220 &SessionClosed, 202 &SessionError,
221 &SessionError, 203 &DeliverBlock,
222 &DeliverBlock, 204 &DecoderInitializeDone,
223 &DecoderInitializeDone, 205 &DecoderDeinitializeDone,
224 &DecoderDeinitializeDone, 206 &DecoderResetDone,
225 &DecoderResetDone, 207 &DeliverFrame,
226 &DeliverFrame, 208 &DeliverSamples};
227 &DeliverSamples
228 };
229 209
230 } // namespace 210 } // namespace
231 211
232 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_12* 212 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_12*
233 GetPPB_ContentDecryptor_Private_0_12_Thunk() { 213 GetPPB_ContentDecryptor_Private_0_12_Thunk() {
234 return &g_ppb_contentdecryptor_private_thunk_0_12; 214 return &g_ppb_contentdecryptor_private_thunk_0_12;
235 } 215 }
236 216
237 } // namespace thunk 217 } // namespace thunk
238 } // namespace ppapi 218 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_console_thunk.cc ('k') | ppapi/thunk/ppb_device_ref_dev_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698