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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage, | 138 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage, |
139 OnHostMsgPostMessage) | 139 OnHostMsgPostMessage) |
140 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetFullscreen, | 140 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetFullscreen, |
141 OnHostMsgSetFullscreen) | 141 OnHostMsgSetFullscreen) |
142 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetScreenSize, | 142 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetScreenSize, |
143 OnHostMsgGetScreenSize) | 143 OnHostMsgGetScreenSize) |
144 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_RequestInputEvents, | 144 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_RequestInputEvents, |
145 OnHostMsgRequestInputEvents) | 145 OnHostMsgRequestInputEvents) |
146 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ClearInputEvents, | 146 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ClearInputEvents, |
147 OnHostMsgClearInputEvents) | 147 OnHostMsgClearInputEvents) |
| 148 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_StartTrackingLatency, |
| 149 OnHostMsgStartTrackingLatency) |
148 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_LockMouse, | 150 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_LockMouse, |
149 OnHostMsgLockMouse) | 151 OnHostMsgLockMouse) |
150 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UnlockMouse, | 152 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UnlockMouse, |
151 OnHostMsgUnlockMouse) | 153 OnHostMsgUnlockMouse) |
152 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetCursor, | 154 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetCursor, |
153 OnHostMsgSetCursor) | 155 OnHostMsgSetCursor) |
154 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetTextInputType, | 156 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetTextInputType, |
155 OnHostMsgSetTextInputType) | 157 OnHostMsgSetTextInputType) |
156 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UpdateCaretPosition, | 158 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UpdateCaretPosition, |
157 OnHostMsgUpdateCaretPosition) | 159 OnHostMsgUpdateCaretPosition) |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 // a sync reply. | 475 // a sync reply. |
474 return ValidateRequestInputEvents(true, event_classes); | 476 return ValidateRequestInputEvents(true, event_classes); |
475 } | 477 } |
476 | 478 |
477 void PPB_Instance_Proxy::ClearInputEventRequest(PP_Instance instance, | 479 void PPB_Instance_Proxy::ClearInputEventRequest(PP_Instance instance, |
478 uint32_t event_classes) { | 480 uint32_t event_classes) { |
479 dispatcher()->Send(new PpapiHostMsg_PPBInstance_ClearInputEvents( | 481 dispatcher()->Send(new PpapiHostMsg_PPBInstance_ClearInputEvents( |
480 API_ID_PPB_INSTANCE, instance, event_classes)); | 482 API_ID_PPB_INSTANCE, instance, event_classes)); |
481 } | 483 } |
482 | 484 |
| 485 void PPB_Instance_Proxy::StartTrackingLatency(PP_Instance instance) { |
| 486 dispatcher()->Send(new PpapiHostMsg_PPBInstance_StartTrackingLatency( |
| 487 API_ID_PPB_INSTANCE, instance)); |
| 488 } |
| 489 |
483 void PPB_Instance_Proxy::ZoomChanged(PP_Instance instance, | 490 void PPB_Instance_Proxy::ZoomChanged(PP_Instance instance, |
484 double factor) { | 491 double factor) { |
485 // Not proxied yet. | 492 // Not proxied yet. |
486 NOTIMPLEMENTED(); | 493 NOTIMPLEMENTED(); |
487 } | 494 } |
488 | 495 |
489 void PPB_Instance_Proxy::ZoomLimitsChanged(PP_Instance instance, | 496 void PPB_Instance_Proxy::ZoomLimitsChanged(PP_Instance instance, |
490 double minimum_factor, | 497 double minimum_factor, |
491 double maximium_factor) { | 498 double maximium_factor) { |
492 // Not proxied yet. | 499 // Not proxied yet. |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 } | 1004 } |
998 } | 1005 } |
999 | 1006 |
1000 void PPB_Instance_Proxy::OnHostMsgClearInputEvents(PP_Instance instance, | 1007 void PPB_Instance_Proxy::OnHostMsgClearInputEvents(PP_Instance instance, |
1001 uint32_t event_classes) { | 1008 uint32_t event_classes) { |
1002 EnterInstanceNoLock enter(instance); | 1009 EnterInstanceNoLock enter(instance); |
1003 if (enter.succeeded()) | 1010 if (enter.succeeded()) |
1004 enter.functions()->ClearInputEventRequest(instance, event_classes); | 1011 enter.functions()->ClearInputEventRequest(instance, event_classes); |
1005 } | 1012 } |
1006 | 1013 |
| 1014 void PPB_Instance_Proxy::OnHostMsgStartTrackingLatency(PP_Instance instance) { |
| 1015 EnterInstanceNoLock enter(instance); |
| 1016 if (enter.succeeded()) |
| 1017 enter.functions()->StartTrackingLatency(instance); |
| 1018 } |
| 1019 |
1007 void PPB_Instance_Proxy::OnHostMsgPostMessage( | 1020 void PPB_Instance_Proxy::OnHostMsgPostMessage( |
1008 PP_Instance instance, | 1021 PP_Instance instance, |
1009 SerializedVarReceiveInput message) { | 1022 SerializedVarReceiveInput message) { |
1010 EnterInstanceNoLock enter(instance); | 1023 EnterInstanceNoLock enter(instance); |
1011 if (!message.is_valid_var()) { | 1024 if (!message.is_valid_var()) { |
1012 PpapiGlobals::Get()->LogWithSource( | 1025 PpapiGlobals::Get()->LogWithSource( |
1013 instance, PP_LOGLEVEL_ERROR, std::string(), kSerializationError); | 1026 instance, PP_LOGLEVEL_ERROR, std::string(), kSerializationError); |
1014 return; | 1027 return; |
1015 } | 1028 } |
1016 | 1029 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 PP_Instance instance) { | 1349 PP_Instance instance) { |
1337 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1350 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1338 GetInstanceData(instance); | 1351 GetInstanceData(instance); |
1339 if (!data) | 1352 if (!data) |
1340 return; // Instance was probably deleted. | 1353 return; // Instance was probably deleted. |
1341 data->should_do_request_surrounding_text = false; | 1354 data->should_do_request_surrounding_text = false; |
1342 } | 1355 } |
1343 | 1356 |
1344 } // namespace proxy | 1357 } // namespace proxy |
1345 } // namespace ppapi | 1358 } // namespace ppapi |
OLD | NEW |