| 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/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/pp_time.h" | 8 #include "ppapi/c/pp_time.h" |
| 9 #include "ppapi/c/pp_var.h" | 9 #include "ppapi/c/pp_var.h" |
| 10 #include "ppapi/c/ppb_audio_config.h" | 10 #include "ppapi/c/ppb_audio_config.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NeedKey, | 158 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NeedKey, |
| 159 OnHostMsgNeedKey) | 159 OnHostMsgNeedKey) |
| 160 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded, | 160 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded, |
| 161 OnHostMsgKeyAdded) | 161 OnHostMsgKeyAdded) |
| 162 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage, | 162 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage, |
| 163 OnHostMsgKeyMessage) | 163 OnHostMsgKeyMessage) |
| 164 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError, | 164 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError, |
| 165 OnHostMsgKeyError) | 165 OnHostMsgKeyError) |
| 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, | 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, |
| 167 OnHostMsgDeliverBlock) | 167 OnHostMsgDeliverBlock) |
| 168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderDeinitializeDone, |
| 169 OnHostMsgDecoderDeinitializeDone) |
| 170 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderResetDone, |
| 171 OnHostMsgDecoderResetDone) |
| 168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverFrame, | 172 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverFrame, |
| 169 OnHostMsgDeliverFrame) | 173 OnHostMsgDeliverFrame) |
| 170 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverSamples, | 174 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverSamples, |
| 171 OnHostMsgDeliverSamples) | 175 OnHostMsgDeliverSamples) |
| 172 #endif // !defined(OS_NACL) | 176 #endif // !defined(OS_NACL) |
| 173 | 177 |
| 174 // Host -> Plugin messages. | 178 // Host -> Plugin messages. |
| 175 IPC_MESSAGE_HANDLER(PpapiMsg_PPBInstance_MouseLockComplete, | 179 IPC_MESSAGE_HANDLER(PpapiMsg_PPBInstance_MouseLockComplete, |
| 176 OnPluginMsgMouseLockComplete) | 180 OnPluginMsgMouseLockComplete) |
| 177 | 181 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 if (!SerializeBlockInfo(*block_info, &serialized_block_info)) | 505 if (!SerializeBlockInfo(*block_info, &serialized_block_info)) |
| 502 return; | 506 return; |
| 503 | 507 |
| 504 dispatcher()->Send( | 508 dispatcher()->Send( |
| 505 new PpapiHostMsg_PPBInstance_DeliverBlock(API_ID_PPB_INSTANCE, | 509 new PpapiHostMsg_PPBInstance_DeliverBlock(API_ID_PPB_INSTANCE, |
| 506 instance, | 510 instance, |
| 507 object->host_resource().host_resource(), | 511 object->host_resource().host_resource(), |
| 508 serialized_block_info)); | 512 serialized_block_info)); |
| 509 } | 513 } |
| 510 | 514 |
| 515 void PPB_Instance_Proxy::DecoderDeinitializeDone(PP_Instance instance, |
| 516 PP_StreamType decoder_type, |
| 517 uint32_t request_id) { |
| 518 dispatcher()->Send( |
| 519 new PpapiHostMsg_PPBInstance_DecoderDeinitializeDone( |
| 520 API_ID_PPB_INSTANCE, |
| 521 instance, |
| 522 decoder_type, |
| 523 request_id)); |
| 524 } |
| 525 |
| 526 void PPB_Instance_Proxy::DecoderResetDone(PP_Instance instance, |
| 527 PP_StreamType decoder_type, |
| 528 uint32_t request_id) { |
| 529 dispatcher()->Send( |
| 530 new PpapiHostMsg_PPBInstance_DecoderResetDone( |
| 531 API_ID_PPB_INSTANCE, |
| 532 instance, |
| 533 decoder_type, |
| 534 request_id)); |
| 535 } |
| 536 |
| 511 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, | 537 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, |
| 512 PP_Resource decrypted_frame, | 538 PP_Resource decrypted_frame, |
| 513 const PP_DecryptedFrameInfo* frame_info) { | 539 const PP_DecryptedFrameInfo* frame_info) { |
| 514 Resource* object = | 540 Resource* object = |
| 515 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame); | 541 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame); |
| 516 if (!object || object->pp_instance() != instance) | 542 if (!object || object->pp_instance() != instance) |
| 517 return; | 543 return; |
| 518 | 544 |
| 519 std::string serialized_block_info; | 545 std::string serialized_block_info; |
| 520 if (!SerializeBlockInfo(*frame_info, &serialized_block_info)) | 546 if (!SerializeBlockInfo(*frame_info, &serialized_block_info)) |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 const std::string& serialized_block_info) { | 947 const std::string& serialized_block_info) { |
| 922 PP_DecryptedBlockInfo block_info; | 948 PP_DecryptedBlockInfo block_info; |
| 923 if (!DeserializeBlockInfo(serialized_block_info, &block_info)) | 949 if (!DeserializeBlockInfo(serialized_block_info, &block_info)) |
| 924 return; | 950 return; |
| 925 | 951 |
| 926 EnterInstanceNoLock enter(instance); | 952 EnterInstanceNoLock enter(instance); |
| 927 if (enter.succeeded()) | 953 if (enter.succeeded()) |
| 928 enter.functions()->DeliverBlock(instance, decrypted_block, &block_info); | 954 enter.functions()->DeliverBlock(instance, decrypted_block, &block_info); |
| 929 } | 955 } |
| 930 | 956 |
| 957 void PPB_Instance_Proxy::OnHostMsgDecoderDeinitializeDone( |
| 958 PP_Instance instance, |
| 959 PP_StreamType decoder_type, |
| 960 uint32_t request_id) { |
| 961 EnterInstanceNoLock enter(instance); |
| 962 if (enter.succeeded()) |
| 963 enter.functions()->DecoderDeinitializeDone(instance, |
| 964 decoder_type, |
| 965 request_id); |
| 966 } |
| 967 |
| 968 void PPB_Instance_Proxy::OnHostMsgDecoderResetDone(PP_Instance instance, |
| 969 PP_StreamType decoder_type, |
| 970 uint32_t request_id) { |
| 971 EnterInstanceNoLock enter(instance); |
| 972 if (enter.succeeded()) |
| 973 enter.functions()->DecoderResetDone(instance, decoder_type, request_id); |
| 974 } |
| 975 |
| 931 void PPB_Instance_Proxy::OnHostMsgDeliverFrame( | 976 void PPB_Instance_Proxy::OnHostMsgDeliverFrame( |
| 932 PP_Instance instance, | 977 PP_Instance instance, |
| 933 PP_Resource decrypted_frame, | 978 PP_Resource decrypted_frame, |
| 934 const std::string& serialized_frame_info) { | 979 const std::string& serialized_frame_info) { |
| 935 PP_DecryptedFrameInfo frame_info; | 980 PP_DecryptedFrameInfo frame_info; |
| 936 if (!DeserializeBlockInfo(serialized_frame_info, &frame_info)) | 981 if (!DeserializeBlockInfo(serialized_frame_info, &frame_info)) |
| 937 return; | 982 return; |
| 938 | 983 |
| 939 EnterInstanceNoLock enter(instance); | 984 EnterInstanceNoLock enter(instance); |
| 940 if (enter.succeeded()) | 985 if (enter.succeeded()) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 PP_Instance instance) { | 1072 PP_Instance instance) { |
| 1028 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1073 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 1029 GetInstanceData(instance); | 1074 GetInstanceData(instance); |
| 1030 if (!data) | 1075 if (!data) |
| 1031 return; // Instance was probably deleted. | 1076 return; // Instance was probably deleted. |
| 1032 data->should_do_request_surrounding_text = false; | 1077 data->should_do_request_surrounding_text = false; |
| 1033 } | 1078 } |
| 1034 | 1079 |
| 1035 } // namespace proxy | 1080 } // namespace proxy |
| 1036 } // namespace ppapi | 1081 } // namespace ppapi |
| OLD | NEW |