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

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

Issue 265993002: Add Promises for EME (Chromium side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: One more trybot issue Created 6 years, 6 months 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
« no previous file with comments | « ppapi/thunk/interfaces_ppb_private.h ('k') | ppapi/thunk/ppb_instance_api.h » ('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,
6 // modified Wed Feb 26 16:37:47 2014. 6 // modified Thu Jun 5 13:39:15 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 SessionCreated(PP_Instance instance, 19 void PromiseResolved(PP_Instance instance, uint32_t promise_id) {
20 uint32_t session_id, 20 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolved()";
21 struct PP_Var web_session_id) {
22 VLOG(4) << "PPB_ContentDecryptor_Private::SessionCreated()";
23 EnterInstance enter(instance); 21 EnterInstance enter(instance);
24 if (enter.failed()) 22 if (enter.failed())
25 return; 23 return;
26 enter.functions()->SessionCreated(instance, session_id, web_session_id); 24 enter.functions()->PromiseResolved(instance, promise_id);
25 }
26
27 void PromiseResolvedWithSession(PP_Instance instance,
28 uint32_t promise_id,
29 struct PP_Var web_session_id) {
30 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseResolvedWithSession()";
31 EnterInstance enter(instance);
32 if (enter.failed())
33 return;
34 enter.functions()->PromiseResolvedWithSession(instance,
35 promise_id,
36 web_session_id);
37 }
38
39 void PromiseRejected(PP_Instance instance,
40 uint32_t promise_id,
41 PP_CdmExceptionCode exception_code,
42 uint32_t system_code,
43 struct PP_Var error_description) {
44 VLOG(4) << "PPB_ContentDecryptor_Private::PromiseRejected()";
45 EnterInstance enter(instance);
46 if (enter.failed())
47 return;
48 enter.functions()->PromiseRejected(instance,
49 promise_id,
50 exception_code,
51 system_code,
52 error_description);
27 } 53 }
28 54
29 void SessionMessage(PP_Instance instance, 55 void SessionMessage(PP_Instance instance,
30 uint32_t session_id, 56 struct PP_Var web_session_id,
31 struct PP_Var message, 57 struct PP_Var message,
32 struct PP_Var destination_url) { 58 struct PP_Var destination_url) {
33 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()"; 59 VLOG(4) << "PPB_ContentDecryptor_Private::SessionMessage()";
34 EnterInstance enter(instance); 60 EnterInstance enter(instance);
35 if (enter.failed()) 61 if (enter.failed())
36 return; 62 return;
37 enter.functions()->SessionMessage(instance, 63 enter.functions()->SessionMessage(instance,
38 session_id, 64 web_session_id,
39 message, 65 message,
40 destination_url); 66 destination_url);
41 } 67 }
42 68
43 void SessionReady(PP_Instance instance, uint32_t session_id) { 69 void SessionReady(PP_Instance instance, struct PP_Var web_session_id) {
44 VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()"; 70 VLOG(4) << "PPB_ContentDecryptor_Private::SessionReady()";
45 EnterInstance enter(instance); 71 EnterInstance enter(instance);
46 if (enter.failed()) 72 if (enter.failed())
47 return; 73 return;
48 enter.functions()->SessionReady(instance, session_id); 74 enter.functions()->SessionReady(instance, web_session_id);
49 } 75 }
50 76
51 void SessionClosed(PP_Instance instance, uint32_t session_id) { 77 void SessionClosed(PP_Instance instance, struct PP_Var web_session_id) {
52 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()"; 78 VLOG(4) << "PPB_ContentDecryptor_Private::SessionClosed()";
53 EnterInstance enter(instance); 79 EnterInstance enter(instance);
54 if (enter.failed()) 80 if (enter.failed())
55 return; 81 return;
56 enter.functions()->SessionClosed(instance, session_id); 82 enter.functions()->SessionClosed(instance, web_session_id);
57 } 83 }
58 84
59 void SessionError(PP_Instance instance, 85 void SessionError(PP_Instance instance,
60 uint32_t session_id, 86 struct PP_Var web_session_id,
61 int32_t media_error, 87 PP_CdmExceptionCode exception_code,
62 uint32_t system_code) { 88 uint32_t system_code,
89 struct PP_Var error_description) {
63 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()"; 90 VLOG(4) << "PPB_ContentDecryptor_Private::SessionError()";
64 EnterInstance enter(instance); 91 EnterInstance enter(instance);
65 if (enter.failed()) 92 if (enter.failed())
66 return; 93 return;
67 enter.functions()->SessionError(instance, 94 enter.functions()->SessionError(instance,
68 session_id, 95 web_session_id,
69 media_error, 96 exception_code,
70 system_code); 97 system_code,
98 error_description);
71 } 99 }
72 100
73 void DeliverBlock(PP_Instance instance, 101 void DeliverBlock(PP_Instance instance,
74 PP_Resource decrypted_block, 102 PP_Resource decrypted_block,
75 const struct PP_DecryptedBlockInfo* decrypted_block_info) { 103 const struct PP_DecryptedBlockInfo* decrypted_block_info) {
76 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()"; 104 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverBlock()";
77 EnterInstance enter(instance); 105 EnterInstance enter(instance);
78 if (enter.failed()) 106 if (enter.failed())
79 return; 107 return;
80 enter.functions()->DeliverBlock(instance, 108 enter.functions()->DeliverBlock(instance,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 const struct PP_DecryptedSampleInfo* decrypted_sample_info) { 164 const struct PP_DecryptedSampleInfo* decrypted_sample_info) {
137 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()"; 165 VLOG(4) << "PPB_ContentDecryptor_Private::DeliverSamples()";
138 EnterInstance enter(instance); 166 EnterInstance enter(instance);
139 if (enter.failed()) 167 if (enter.failed())
140 return; 168 return;
141 enter.functions()->DeliverSamples(instance, 169 enter.functions()->DeliverSamples(instance,
142 audio_frames, 170 audio_frames,
143 decrypted_sample_info); 171 decrypted_sample_info);
144 } 172 }
145 173
146 const PPB_ContentDecryptor_Private_0_11 174 const PPB_ContentDecryptor_Private_0_12
147 g_ppb_contentdecryptor_private_thunk_0_11 = { 175 g_ppb_contentdecryptor_private_thunk_0_12 = {
148 &SessionCreated, 176 &PromiseResolved,
177 &PromiseResolvedWithSession,
178 &PromiseRejected,
149 &SessionMessage, 179 &SessionMessage,
150 &SessionReady, 180 &SessionReady,
151 &SessionClosed, 181 &SessionClosed,
152 &SessionError, 182 &SessionError,
153 &DeliverBlock, 183 &DeliverBlock,
154 &DecoderInitializeDone, 184 &DecoderInitializeDone,
155 &DecoderDeinitializeDone, 185 &DecoderDeinitializeDone,
156 &DecoderResetDone, 186 &DecoderResetDone,
157 &DeliverFrame, 187 &DeliverFrame,
158 &DeliverSamples 188 &DeliverSamples
159 }; 189 };
160 190
161 } // namespace 191 } // namespace
162 192
163 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_11* 193 PPAPI_THUNK_EXPORT const PPB_ContentDecryptor_Private_0_12*
164 GetPPB_ContentDecryptor_Private_0_11_Thunk() { 194 GetPPB_ContentDecryptor_Private_0_12_Thunk() {
165 return &g_ppb_contentdecryptor_private_thunk_0_11; 195 return &g_ppb_contentdecryptor_private_thunk_0_12;
166 } 196 }
167 197
168 } // namespace thunk 198 } // namespace thunk
169 } // namespace ppapi 199 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/interfaces_ppb_private.h ('k') | ppapi/thunk/ppb_instance_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698