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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 instance, | 533 instance, |
534 SerializedVarSendInput(dispatcher(), key_system), | 534 SerializedVarSendInput(dispatcher(), key_system), |
535 SerializedVarSendInput(dispatcher(), session_id))); | 535 SerializedVarSendInput(dispatcher(), session_id))); |
536 } | 536 } |
537 | 537 |
538 void PPB_Instance_Proxy::KeyMessage(PP_Instance instance, | 538 void PPB_Instance_Proxy::KeyMessage(PP_Instance instance, |
539 PP_Var key_system, | 539 PP_Var key_system, |
540 PP_Var session_id, | 540 PP_Var session_id, |
541 PP_Resource message, | 541 PP_Resource message, |
542 PP_Var default_url) { | 542 PP_Var default_url) { |
543 Resource* object = | 543 PP_Resource host_resource = 0; |
dmichael (off chromium)
2012/12/04 15:44:34
Accepting 0 for the PP_Resource is a change to you
xhwang
2012/12/04 18:33:37
Done.
| |
544 PpapiGlobals::Get()->GetResourceTracker()->GetResource(message); | 544 if (message) { |
545 if (!object || object->pp_instance() != instance) | 545 Resource* object = |
546 return; | 546 PpapiGlobals::Get()->GetResourceTracker()->GetResource(message); |
547 if (!object || object->pp_instance() != instance) | |
548 return; | |
549 host_resource = object->host_resource().host_resource(); | |
550 } | |
551 | |
547 dispatcher()->Send( | 552 dispatcher()->Send( |
548 new PpapiHostMsg_PPBInstance_KeyMessage( | 553 new PpapiHostMsg_PPBInstance_KeyMessage( |
549 API_ID_PPB_INSTANCE, | 554 API_ID_PPB_INSTANCE, |
550 instance, | 555 instance, |
551 SerializedVarSendInput(dispatcher(), key_system), | 556 SerializedVarSendInput(dispatcher(), key_system), |
552 SerializedVarSendInput(dispatcher(), session_id), | 557 SerializedVarSendInput(dispatcher(), session_id), |
553 object->host_resource().host_resource(), | 558 host_resource, |
554 SerializedVarSendInput(dispatcher(), default_url))); | 559 SerializedVarSendInput(dispatcher(), default_url))); |
555 } | 560 } |
556 | 561 |
557 void PPB_Instance_Proxy::KeyError(PP_Instance instance, | 562 void PPB_Instance_Proxy::KeyError(PP_Instance instance, |
558 PP_Var key_system, | 563 PP_Var key_system, |
559 PP_Var session_id, | 564 PP_Var session_id, |
560 int32_t media_error, | 565 int32_t media_error, |
561 int32_t system_code) { | 566 int32_t system_code) { |
562 dispatcher()->Send( | 567 dispatcher()->Send( |
563 new PpapiHostMsg_PPBInstance_KeyError( | 568 new PpapiHostMsg_PPBInstance_KeyError( |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1205 PP_Instance instance) { | 1210 PP_Instance instance) { |
1206 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1211 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1207 GetInstanceData(instance); | 1212 GetInstanceData(instance); |
1208 if (!data) | 1213 if (!data) |
1209 return; // Instance was probably deleted. | 1214 return; // Instance was probably deleted. |
1210 data->should_do_request_surrounding_text = false; | 1215 data->should_do_request_surrounding_text = false; |
1211 } | 1216 } |
1212 | 1217 |
1213 } // namespace proxy | 1218 } // namespace proxy |
1214 } // namespace ppapi | 1219 } // namespace ppapi |
OLD | NEW |