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

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

Issue 10545036: Add PPAPI decryptor interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert change to ppapi_tests.gypi. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "ppapi/c/dev/ppb_content_decryptor_dev.h"
6 #include "ppapi/thunk/thunk.h"
7 #include "ppapi/thunk/enter.h"
8 #include "ppapi/thunk/ppb_instance_api.h"
9
10 namespace ppapi {
11 namespace thunk {
12
13 namespace {
14
15 void NeedKey(PP_Instance instance,
16 PP_Var key_system,
17 PP_Var session_id,
18 PP_Resource init_data) {
19 EnterInstance enter(instance);
20 if (enter.succeeded()) {
dmichael (off chromium) 2012/07/31 03:36:31 nit: no curly braces for 1-liners
Tom Finegan 2012/08/02 01:12:04 Done.
21 enter.functions()->NeedKey(instance, key_system, session_id, init_data);
22 }
23 }
24
25 void KeyAdded(PP_Instance instance,
26 PP_Var key_system,
27 PP_Var session_id) {
28 EnterInstance enter(instance);
29 if (enter.succeeded()) {
30 enter.functions()->KeyAdded(instance, key_system, session_id);
31 }
32 }
33
34 void KeyMessage(PP_Instance instance,
35 PP_Var key_system,
36 PP_Var session_id,
37 PP_Resource message,
38 PP_Var default_url) {
39 EnterInstance enter(instance);
40 if (enter.succeeded()) {
41 enter.functions()->KeyMessage(instance, key_system, session_id, message,
42 default_url);
43 }
44 }
45
46 void KeyError(PP_Instance instance,
47 PP_Var key_system,
48 PP_Var session_id,
49 uint16_t media_error,
50 uint16_t system_error) {
51 EnterInstance enter(instance);
52 if (enter.succeeded()) {
53 enter.functions()->KeyError(instance, key_system, session_id, media_error,
54 system_error);
55 }
56 }
57
58 void DeliverBlock(PP_Instance instance,
59 PP_Resource decrypted_block,
60 PP_CompletionCallback callback) {
61 EnterInstance enter(instance);
62 if (enter.succeeded()) {
63 enter.functions()->DeliverBlock(instance, decrypted_block, callback);
64 }
65 }
66
67 void DeliverFrame(PP_Instance instance,
68 PP_Resource decrypted_frame,
69 PP_CompletionCallback callback) {
70 EnterInstance enter(instance);
71 if (enter.succeeded()) {
72 enter.functions()->DeliverFrame(instance, decrypted_frame, callback);
73 }
74 }
75
76 void DeliverSamples(PP_Instance instance,
77 PP_Resource decrypted_samples,
78 PP_CompletionCallback callback) {
79 EnterInstance enter(instance);
80 if (enter.succeeded()) {
81 enter.functions()->DeliverSamples(instance, decrypted_samples, callback);
82 }
83 }
84
85 const PPB_ContentDecryptor_Dev g_ppb_decryption_thunk = {
86 &NeedKey,
87 &KeyAdded,
88 &KeyMessage,
89 &KeyError,
90 &DeliverBlock,
91 &DeliverFrame,
92 &DeliverSamples
93 };
94
95 } // namespace
96
97 const PPB_ContentDecryptor_Dev* GetPPB_ContentDecryptor_Dev_0_1_Thunk() {
98 return &g_ppb_decryption_thunk;
99 }
100
101 } // namespace thunk
102 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698