Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "ppapi/c/private/ppb_content_decryptor_private.h" | 5 #include "ppapi/c/private/ppb_content_decryptor_private.h" |
| 6 #include "ppapi/thunk/enter.h" | 6 #include "ppapi/thunk/enter.h" |
| 7 #include "ppapi/thunk/ppb_instance_api.h" | 7 #include "ppapi/thunk/ppb_instance_api.h" |
| 8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
| 9 | 9 |
| 10 namespace ppapi { | 10 namespace ppapi { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 } | 54 } |
| 55 | 55 |
| 56 void DeliverBlock(PP_Instance instance, | 56 void DeliverBlock(PP_Instance instance, |
| 57 PP_Resource decrypted_block, | 57 PP_Resource decrypted_block, |
| 58 const PP_DecryptedBlockInfo* block_info) { | 58 const PP_DecryptedBlockInfo* block_info) { |
| 59 EnterInstance enter(instance); | 59 EnterInstance enter(instance); |
| 60 if (enter.succeeded()) | 60 if (enter.succeeded()) |
| 61 enter.functions()->DeliverBlock(instance, decrypted_block, block_info); | 61 enter.functions()->DeliverBlock(instance, decrypted_block, block_info); |
| 62 } | 62 } |
| 63 | 63 |
| 64 void DecoderDeinitializeDone(PP_Instance instance, | |
| 65 PP_StreamType decoder_type, | |
| 66 uint32_t request_id) { | |
| 67 EnterInstance enter(instance); | |
| 68 if (enter.succeeded()) | |
|
brettw
2012/10/11 20:53:43
Nit: Chrome style says to use {} any time the bloc
Tom Finegan
2012/10/12 05:01:56
Done.
| |
| 69 enter.functions()->DecoderDeinitializeDone(instance, | |
| 70 decoder_type, | |
| 71 request_id); | |
| 72 } | |
| 73 | |
| 74 void DecoderResetDone(PP_Instance instance, | |
| 75 PP_StreamType decoder_type, | |
| 76 uint32_t request_id) { | |
| 77 EnterInstance enter(instance); | |
| 78 if (enter.succeeded()) | |
| 79 enter.functions()->DecoderResetDone(instance, decoder_type, request_id); | |
| 80 } | |
| 81 | |
| 64 void DeliverFrame(PP_Instance instance, | 82 void DeliverFrame(PP_Instance instance, |
| 65 PP_Resource decrypted_frame, | 83 PP_Resource decrypted_frame, |
| 66 const PP_DecryptedFrameInfo* frame_info) { | 84 const PP_DecryptedFrameInfo* frame_info) { |
| 67 EnterInstance enter(instance); | 85 EnterInstance enter(instance); |
| 68 if (enter.succeeded()) | 86 if (enter.succeeded()) |
| 69 enter.functions()->DeliverFrame(instance, decrypted_frame, frame_info); | 87 enter.functions()->DeliverFrame(instance, decrypted_frame, frame_info); |
| 70 } | 88 } |
| 71 | 89 |
| 72 void DeliverSamples(PP_Instance instance, | 90 void DeliverSamples(PP_Instance instance, |
| 73 PP_Resource decrypted_samples, | 91 PP_Resource decrypted_samples, |
| 74 const PP_DecryptedBlockInfo* block_info) { | 92 const PP_DecryptedBlockInfo* block_info) { |
| 75 EnterInstance enter(instance); | 93 EnterInstance enter(instance); |
| 76 if (enter.succeeded()) | 94 if (enter.succeeded()) |
| 77 enter.functions()->DeliverSamples(instance, decrypted_samples, block_info); | 95 enter.functions()->DeliverSamples(instance, decrypted_samples, block_info); |
| 78 } | 96 } |
| 79 | 97 |
| 80 const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { | 98 const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { |
| 81 &NeedKey, | 99 &NeedKey, |
| 82 &KeyAdded, | 100 &KeyAdded, |
| 83 &KeyMessage, | 101 &KeyMessage, |
| 84 &KeyError, | 102 &KeyError, |
| 85 &DeliverBlock, | 103 &DeliverBlock, |
| 104 &DecoderDeinitializeDone, | |
| 105 &DecoderResetDone, | |
| 86 &DeliverFrame, | 106 &DeliverFrame, |
| 87 &DeliverSamples | 107 &DeliverSamples |
| 88 }; | 108 }; |
| 89 | 109 |
| 90 } // namespace | 110 } // namespace |
| 91 | 111 |
| 92 const PPB_ContentDecryptor_Private* | 112 const PPB_ContentDecryptor_Private* |
| 93 GetPPB_ContentDecryptor_Private_0_2_Thunk() { | 113 GetPPB_ContentDecryptor_Private_0_3_Thunk() { |
| 94 return &g_ppb_decryption_thunk; | 114 return &g_ppb_decryption_thunk; |
| 95 } | 115 } |
| 96 | 116 |
| 97 } // namespace thunk | 117 } // namespace thunk |
| 98 } // namespace ppapi | 118 } // namespace ppapi |
| OLD | NEW |