| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/c/pp_time.h" | 9 #include "ppapi/c/pp_time.h" |
| 10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded, | 162 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded, |
| 163 OnHostMsgKeyAdded) | 163 OnHostMsgKeyAdded) |
| 164 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage, | 164 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage, |
| 165 OnHostMsgKeyMessage) | 165 OnHostMsgKeyMessage) |
| 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError, | 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError, |
| 167 OnHostMsgKeyError) | 167 OnHostMsgKeyError) |
| 168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, | 168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, |
| 169 OnHostMsgDeliverBlock) | 169 OnHostMsgDeliverBlock) |
| 170 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitialized, | 170 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderInitialized, |
| 171 OnHostMsgDecoderInitialized) | 171 OnHostMsgDecoderInitialized) |
| 172 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderDeinitializeDone, |
| 173 OnHostMsgDecoderDeinitializeDone) |
| 174 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DecoderResetDone, |
| 175 OnHostMsgDecoderResetDone) |
| 172 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverFrame, | 176 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverFrame, |
| 173 OnHostMsgDeliverFrame) | 177 OnHostMsgDeliverFrame) |
| 174 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverSamples, | 178 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverSamples, |
| 175 OnHostMsgDeliverSamples) | 179 OnHostMsgDeliverSamples) |
| 176 #endif // !defined(OS_NACL) | 180 #endif // !defined(OS_NACL) |
| 177 | 181 |
| 178 // Host -> Plugin messages. | 182 // Host -> Plugin messages. |
| 179 IPC_MESSAGE_HANDLER(PpapiMsg_PPBInstance_MouseLockComplete, | 183 IPC_MESSAGE_HANDLER(PpapiMsg_PPBInstance_MouseLockComplete, |
| 180 OnPluginMsgMouseLockComplete) | 184 OnPluginMsgMouseLockComplete) |
| 181 | 185 |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 PP_Bool success, | 542 PP_Bool success, |
| 539 uint32_t request_id) { | 543 uint32_t request_id) { |
| 540 dispatcher()->Send( | 544 dispatcher()->Send( |
| 541 new PpapiHostMsg_PPBInstance_DecoderInitialized( | 545 new PpapiHostMsg_PPBInstance_DecoderInitialized( |
| 542 API_ID_PPB_INSTANCE, | 546 API_ID_PPB_INSTANCE, |
| 543 instance, | 547 instance, |
| 544 success, | 548 success, |
| 545 request_id)); | 549 request_id)); |
| 546 } | 550 } |
| 547 | 551 |
| 552 void PPB_Instance_Proxy::DecoderDeinitializeDone( |
| 553 PP_Instance instance, |
| 554 PP_DecryptorStreamType decoder_type, |
| 555 uint32_t request_id) { |
| 556 dispatcher()->Send( |
| 557 new PpapiHostMsg_PPBInstance_DecoderDeinitializeDone( |
| 558 API_ID_PPB_INSTANCE, |
| 559 instance, |
| 560 decoder_type, |
| 561 request_id)); |
| 562 } |
| 563 |
| 564 void PPB_Instance_Proxy::DecoderResetDone(PP_Instance instance, |
| 565 PP_DecryptorStreamType decoder_type, |
| 566 uint32_t request_id) { |
| 567 dispatcher()->Send( |
| 568 new PpapiHostMsg_PPBInstance_DecoderResetDone( |
| 569 API_ID_PPB_INSTANCE, |
| 570 instance, |
| 571 decoder_type, |
| 572 request_id)); |
| 573 } |
| 574 |
| 548 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, | 575 void PPB_Instance_Proxy::DeliverFrame(PP_Instance instance, |
| 549 PP_Resource decrypted_frame, | 576 PP_Resource decrypted_frame, |
| 550 const PP_DecryptedFrameInfo* frame_info) { | 577 const PP_DecryptedFrameInfo* frame_info) { |
| 551 Resource* object = | 578 Resource* object = |
| 552 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame); | 579 PpapiGlobals::Get()->GetResourceTracker()->GetResource(decrypted_frame); |
| 553 if (!object || object->pp_instance() != instance) | 580 if (!object || object->pp_instance() != instance) |
| 554 return; | 581 return; |
| 555 | 582 |
| 556 std::string serialized_block_info; | 583 std::string serialized_block_info; |
| 557 if (!SerializeBlockInfo(*frame_info, &serialized_block_info)) | 584 if (!SerializeBlockInfo(*frame_info, &serialized_block_info)) |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 | 994 |
| 968 void PPB_Instance_Proxy::OnHostMsgDecoderInitialized( | 995 void PPB_Instance_Proxy::OnHostMsgDecoderInitialized( |
| 969 PP_Instance instance, | 996 PP_Instance instance, |
| 970 PP_Bool success, | 997 PP_Bool success, |
| 971 uint32_t request_id) { | 998 uint32_t request_id) { |
| 972 EnterInstanceNoLock enter(instance); | 999 EnterInstanceNoLock enter(instance); |
| 973 if (enter.succeeded()) | 1000 if (enter.succeeded()) |
| 974 enter.functions()->DecoderInitialized(instance, success, request_id); | 1001 enter.functions()->DecoderInitialized(instance, success, request_id); |
| 975 } | 1002 } |
| 976 | 1003 |
| 1004 void PPB_Instance_Proxy::OnHostMsgDecoderDeinitializeDone( |
| 1005 PP_Instance instance, |
| 1006 PP_DecryptorStreamType decoder_type, |
| 1007 uint32_t request_id) { |
| 1008 EnterInstanceNoLock enter(instance); |
| 1009 if (enter.succeeded()) |
| 1010 enter.functions()->DecoderDeinitializeDone(instance, |
| 1011 decoder_type, |
| 1012 request_id); |
| 1013 } |
| 1014 |
| 1015 void PPB_Instance_Proxy::OnHostMsgDecoderResetDone( |
| 1016 PP_Instance instance, |
| 1017 PP_DecryptorStreamType decoder_type, |
| 1018 uint32_t request_id) { |
| 1019 EnterInstanceNoLock enter(instance); |
| 1020 if (enter.succeeded()) |
| 1021 enter.functions()->DecoderResetDone(instance, decoder_type, request_id); |
| 1022 } |
| 1023 |
| 977 void PPB_Instance_Proxy::OnHostMsgDeliverFrame( | 1024 void PPB_Instance_Proxy::OnHostMsgDeliverFrame( |
| 978 PP_Instance instance, | 1025 PP_Instance instance, |
| 979 PP_Resource decrypted_frame, | 1026 PP_Resource decrypted_frame, |
| 980 const std::string& serialized_frame_info) { | 1027 const std::string& serialized_frame_info) { |
| 981 PP_DecryptedFrameInfo frame_info; | 1028 PP_DecryptedFrameInfo frame_info; |
| 982 if (!DeserializeBlockInfo(serialized_frame_info, &frame_info)) | 1029 if (!DeserializeBlockInfo(serialized_frame_info, &frame_info)) |
| 983 return; | 1030 return; |
| 984 | 1031 |
| 985 EnterInstanceNoLock enter(instance); | 1032 EnterInstanceNoLock enter(instance); |
| 986 if (enter.succeeded()) | 1033 if (enter.succeeded()) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 PP_Instance instance) { | 1120 PP_Instance instance) { |
| 1074 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1121 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 1075 GetInstanceData(instance); | 1122 GetInstanceData(instance); |
| 1076 if (!data) | 1123 if (!data) |
| 1077 return; // Instance was probably deleted. | 1124 return; // Instance was probably deleted. |
| 1078 data->should_do_request_surrounding_text = false; | 1125 data->should_do_request_surrounding_text = false; |
| 1079 } | 1126 } |
| 1080 | 1127 |
| 1081 } // namespace proxy | 1128 } // namespace proxy |
| 1082 } // namespace ppapi | 1129 } // namespace ppapi |
| OLD | NEW |