| 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 "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 instance, | 532 instance, |
| 533 SerializedVarSendInput(dispatcher(), key_system), | 533 SerializedVarSendInput(dispatcher(), key_system), |
| 534 SerializedVarSendInput(dispatcher(), session_id))); | 534 SerializedVarSendInput(dispatcher(), session_id))); |
| 535 } | 535 } |
| 536 | 536 |
| 537 void PPB_Instance_Proxy::KeyMessage(PP_Instance instance, | 537 void PPB_Instance_Proxy::KeyMessage(PP_Instance instance, |
| 538 PP_Var key_system, | 538 PP_Var key_system, |
| 539 PP_Var session_id, | 539 PP_Var session_id, |
| 540 PP_Resource message, | 540 PP_Resource message, |
| 541 PP_Var default_url) { | 541 PP_Var default_url) { |
| 542 Resource* object = | 542 PP_Resource host_resource = 0; |
| 543 PpapiGlobals::Get()->GetResourceTracker()->GetResource(message); | 543 if (message) { |
| 544 if (!object || object->pp_instance() != instance) | 544 Resource* object = |
| 545 return; | 545 PpapiGlobals::Get()->GetResourceTracker()->GetResource(message); |
| 546 if (!object || object->pp_instance() != instance) |
| 547 return; |
| 548 host_resource = object->host_resource().host_resource(); |
| 549 } |
| 550 |
| 546 dispatcher()->Send( | 551 dispatcher()->Send( |
| 547 new PpapiHostMsg_PPBInstance_KeyMessage( | 552 new PpapiHostMsg_PPBInstance_KeyMessage( |
| 548 API_ID_PPB_INSTANCE, | 553 API_ID_PPB_INSTANCE, |
| 549 instance, | 554 instance, |
| 550 SerializedVarSendInput(dispatcher(), key_system), | 555 SerializedVarSendInput(dispatcher(), key_system), |
| 551 SerializedVarSendInput(dispatcher(), session_id), | 556 SerializedVarSendInput(dispatcher(), session_id), |
| 552 object->host_resource().host_resource(), | 557 host_resource, |
| 553 SerializedVarSendInput(dispatcher(), default_url))); | 558 SerializedVarSendInput(dispatcher(), default_url))); |
| 554 } | 559 } |
| 555 | 560 |
| 556 void PPB_Instance_Proxy::KeyError(PP_Instance instance, | 561 void PPB_Instance_Proxy::KeyError(PP_Instance instance, |
| 557 PP_Var key_system, | 562 PP_Var key_system, |
| 558 PP_Var session_id, | 563 PP_Var session_id, |
| 559 int32_t media_error, | 564 int32_t media_error, |
| 560 int32_t system_code) { | 565 int32_t system_code) { |
| 561 dispatcher()->Send( | 566 dispatcher()->Send( |
| 562 new PpapiHostMsg_PPBInstance_KeyError( | 567 new PpapiHostMsg_PPBInstance_KeyError( |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 PP_Instance instance) { | 1211 PP_Instance instance) { |
| 1207 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1212 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 1208 GetInstanceData(instance); | 1213 GetInstanceData(instance); |
| 1209 if (!data) | 1214 if (!data) |
| 1210 return; // Instance was probably deleted. | 1215 return; // Instance was probably deleted. |
| 1211 data->should_do_request_surrounding_text = false; | 1216 data->should_do_request_surrounding_text = false; |
| 1212 } | 1217 } |
| 1213 | 1218 |
| 1214 } // namespace proxy | 1219 } // namespace proxy |
| 1215 } // namespace ppapi | 1220 } // namespace ppapi |
| OLD | NEW |