| 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 DecoderInitialized(PP_Instance instance, |
| 65 PP_Bool success, |
| 66 uint32_t request_id) { |
| 67 EnterInstance enter(instance); |
| 68 if (enter.succeeded()) |
| 69 enter.functions()->DecoderInitialized(instance, success, request_id); |
| 70 } |
| 71 |
| 64 void DeliverFrame(PP_Instance instance, | 72 void DeliverFrame(PP_Instance instance, |
| 65 PP_Resource decrypted_frame, | 73 PP_Resource decrypted_frame, |
| 66 const PP_DecryptedFrameInfo* frame_info) { | 74 const PP_DecryptedFrameInfo* frame_info) { |
| 67 EnterInstance enter(instance); | 75 EnterInstance enter(instance); |
| 68 if (enter.succeeded()) | 76 if (enter.succeeded()) |
| 69 enter.functions()->DeliverFrame(instance, decrypted_frame, frame_info); | 77 enter.functions()->DeliverFrame(instance, decrypted_frame, frame_info); |
| 70 } | 78 } |
| 71 | 79 |
| 72 void DeliverSamples(PP_Instance instance, | 80 void DeliverSamples(PP_Instance instance, |
| 73 PP_Resource decrypted_samples, | 81 PP_Resource decrypted_samples, |
| 74 const PP_DecryptedBlockInfo* block_info) { | 82 const PP_DecryptedBlockInfo* block_info) { |
| 75 EnterInstance enter(instance); | 83 EnterInstance enter(instance); |
| 76 if (enter.succeeded()) | 84 if (enter.succeeded()) |
| 77 enter.functions()->DeliverSamples(instance, decrypted_samples, block_info); | 85 enter.functions()->DeliverSamples(instance, decrypted_samples, block_info); |
| 78 } | 86 } |
| 79 | 87 |
| 80 const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { | 88 const PPB_ContentDecryptor_Private g_ppb_decryption_thunk = { |
| 81 &NeedKey, | 89 &NeedKey, |
| 82 &KeyAdded, | 90 &KeyAdded, |
| 83 &KeyMessage, | 91 &KeyMessage, |
| 84 &KeyError, | 92 &KeyError, |
| 85 &DeliverBlock, | 93 &DeliverBlock, |
| 94 &DecoderInitialized, |
| 86 &DeliverFrame, | 95 &DeliverFrame, |
| 87 &DeliverSamples | 96 &DeliverSamples |
| 88 }; | 97 }; |
| 89 | 98 |
| 90 } // namespace | 99 } // namespace |
| 91 | 100 |
| 92 const PPB_ContentDecryptor_Private* | 101 const PPB_ContentDecryptor_Private* |
| 93 GetPPB_ContentDecryptor_Private_0_2_Thunk() { | 102 GetPPB_ContentDecryptor_Private_0_3_Thunk() { |
| 94 return &g_ppb_decryption_thunk; | 103 return &g_ppb_decryption_thunk; |
| 95 } | 104 } |
| 96 | 105 |
| 97 } // namespace thunk | 106 } // namespace thunk |
| 98 } // namespace ppapi | 107 } // namespace ppapi |
| OLD | NEW |