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

Side by Side Diff: ppapi/shared_impl/ppb_input_event_shared.cc

Issue 252663002: Track plugin input event latency (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: move InputEventPriavte interface to terfaces_ppb_private.h Created 6 years, 7 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/shared_impl/ppb_input_event_shared.h" 5 #include "ppapi/shared_impl/ppb_input_event_shared.h"
6 6
7 #include "ppapi/shared_impl/ppapi_globals.h"
7 #include "ppapi/shared_impl/var.h" 8 #include "ppapi/shared_impl/var.h"
8 9
9 using ppapi::thunk::PPB_InputEvent_API; 10 using ppapi::thunk::PPB_InputEvent_API;
10 11
11 namespace ppapi { 12 namespace ppapi {
12 13
13 InputEventData::InputEventData() 14 InputEventData::InputEventData()
14 : is_filtered(false), 15 : is_filtered(false),
15 event_type(PP_INPUTEVENT_TYPE_UNDEFINED), 16 event_type(PP_INPUTEVENT_TYPE_UNDEFINED),
16 event_time_stamp(0.0), 17 event_time_stamp(0.0),
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 default: 185 default:
185 return PP_MakeTouchPoint(); 186 return PP_MakeTouchPoint();
186 } 187 }
187 for (size_t i = 0; i < points->size(); i++) { 188 for (size_t i = 0; i < points->size(); i++) {
188 if (points->at(i).id == id) 189 if (points->at(i).id == id)
189 return points->at(i); 190 return points->at(i);
190 } 191 }
191 return PP_MakeTouchPoint(); 192 return PP_MakeTouchPoint();
192 } 193 }
193 194
195 PP_Bool PPB_InputEvent_Shared::TraceInputLatency(PP_Bool has_damage) {
196 ui::LatencyInfo latency = data_.latency_info;
197 if (!latency.FindLatency(ui::INPUT_EVENT_LATENCY_BEGIN_PLUGIN_COMPONENT,
198 0, NULL))
dmichael (off chromium) 2014/05/08 21:47:07 So the call to TraceInputLatency is coming from th
Yufeng Shen (Slow to review) 2014/05/08 23:49:40 hmm, not sure what confuses you. The LatencyInfo i
dmichael (off chromium) 2014/05/09 15:19:33 OK, got it. I was forgetting about it riding along
199 return PP_FALSE;
200 if (has_damage) {
201 PpapiGlobals::Get()->AddLatencyInfo(latency, pp_instance());
202 } else {
203 latency.AddLatencyNumber(
204 ui::INPUT_EVENT_LATENCY_TERMINATED_PLUGIN_COMPONENT, 0, 0);
205 }
206 return PP_TRUE;
207 }
208
194 // static 209 // static
195 PP_Resource PPB_InputEvent_Shared::CreateIMEInputEvent( 210 PP_Resource PPB_InputEvent_Shared::CreateIMEInputEvent(
196 ResourceObjectType type, 211 ResourceObjectType type,
197 PP_Instance instance, 212 PP_Instance instance,
198 PP_InputEvent_Type event_type, 213 PP_InputEvent_Type event_type,
199 PP_TimeTicks time_stamp, 214 PP_TimeTicks time_stamp,
200 struct PP_Var text, 215 struct PP_Var text,
201 uint32_t segment_number, 216 uint32_t segment_number,
202 const uint32_t* segment_offsets, 217 const uint32_t* segment_offsets,
203 int32_t target_segment, 218 int32_t target_segment,
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 return 0; 345 return 0;
331 346
332 InputEventData data; 347 InputEventData data;
333 data.event_type = event_type; 348 data.event_type = event_type;
334 data.event_time_stamp = time_stamp; 349 data.event_time_stamp = time_stamp;
335 data.event_modifiers = modifiers; 350 data.event_modifiers = modifiers;
336 return (new PPB_InputEvent_Shared(type, instance, data))->GetReference(); 351 return (new PPB_InputEvent_Shared(type, instance, data))->GetReference();
337 } 352 }
338 353
339 } // namespace ppapi 354 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698