Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: ppapi/proxy/ppp_input_event_proxy.cc

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add more comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ppp_input_event_proxy.h" 5 #include "ppapi/proxy/ppp_input_event_proxy.h"
6 6
7 #include "ppapi/c/ppp_input_event.h" 7 #include "ppapi/c/ppp_input_event.h"
8 #include "ppapi/proxy/host_dispatcher.h" 8 #include "ppapi/proxy/host_dispatcher.h"
9 #include "ppapi/proxy/plugin_dispatcher.h" 9 #include "ppapi/proxy/plugin_dispatcher.h"
10 #include "ppapi/proxy/plugin_globals.h"
10 #include "ppapi/proxy/ppapi_messages.h" 11 #include "ppapi/proxy/ppapi_messages.h"
11 #include "ppapi/shared_impl/ppb_input_event_shared.h" 12 #include "ppapi/shared_impl/ppb_input_event_shared.h"
12 #include "ppapi/thunk/enter.h" 13 #include "ppapi/thunk/enter.h"
13 #include "ppapi/thunk/ppb_input_event_api.h" 14 #include "ppapi/thunk/ppb_input_event_api.h"
15 #include "ui/events/latency_info.h"
14 16
15 using ppapi::thunk::EnterResourceNoLock; 17 using ppapi::thunk::EnterResourceNoLock;
16 using ppapi::thunk::PPB_InputEvent_API; 18 using ppapi::thunk::PPB_InputEvent_API;
17 19
18 namespace ppapi { 20 namespace ppapi {
19 namespace proxy { 21 namespace proxy {
20 22
21 namespace { 23 namespace {
22 24
23 #if !defined(OS_NACL) 25 #if !defined(OS_NACL)
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 OnMsgHandleInputEvent) 85 OnMsgHandleInputEvent)
84 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInputEvent_HandleFilteredInputEvent, 86 IPC_MESSAGE_HANDLER(PpapiMsg_PPPInputEvent_HandleFilteredInputEvent,
85 OnMsgHandleFilteredInputEvent) 87 OnMsgHandleFilteredInputEvent)
86 IPC_MESSAGE_UNHANDLED(handled = false) 88 IPC_MESSAGE_UNHANDLED(handled = false)
87 IPC_END_MESSAGE_MAP() 89 IPC_END_MESSAGE_MAP()
88 return handled; 90 return handled;
89 } 91 }
90 92
91 void PPP_InputEvent_Proxy::OnMsgHandleInputEvent(PP_Instance instance, 93 void PPP_InputEvent_Proxy::OnMsgHandleInputEvent(PP_Instance instance,
92 const InputEventData& data) { 94 const InputEventData& data) {
95 PluginGlobals::Get()->AddLatencyInfo(data.latency_info, instance);
93 scoped_refptr<PPB_InputEvent_Shared> resource(new PPB_InputEvent_Shared( 96 scoped_refptr<PPB_InputEvent_Shared> resource(new PPB_InputEvent_Shared(
94 OBJECT_IS_PROXY, instance, data)); 97 OBJECT_IS_PROXY, instance, data));
95 CallWhileUnlocked(ppp_input_event_impl_->HandleInputEvent, 98 CallWhileUnlocked(ppp_input_event_impl_->HandleInputEvent,
96 instance, 99 instance,
97 resource->pp_resource()); 100 resource->pp_resource());
98 } 101 }
99 102
100 void PPP_InputEvent_Proxy::OnMsgHandleFilteredInputEvent( 103 void PPP_InputEvent_Proxy::OnMsgHandleFilteredInputEvent(
101 PP_Instance instance, 104 PP_Instance instance,
102 const InputEventData& data, 105 const InputEventData& data,
103 PP_Bool* result) { 106 PP_Bool* result) {
107 PluginGlobals::Get()->AddLatencyInfo(data.latency_info, instance);
104 scoped_refptr<PPB_InputEvent_Shared> resource(new PPB_InputEvent_Shared( 108 scoped_refptr<PPB_InputEvent_Shared> resource(new PPB_InputEvent_Shared(
105 OBJECT_IS_PROXY, instance, data)); 109 OBJECT_IS_PROXY, instance, data));
106 *result = CallWhileUnlocked(ppp_input_event_impl_->HandleInputEvent, 110 *result = CallWhileUnlocked(ppp_input_event_impl_->HandleInputEvent,
107 instance, 111 instance,
108 resource->pp_resource()); 112 resource->pp_resource());
109 } 113 }
110 114
111 } // namespace proxy 115 } // namespace proxy
112 } // namespace ppapi 116 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698