Chromium Code Reviews| Index: content/browser/renderer_host/input/touch_event_queue.cc |
| diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc |
| index 9d0394ef162d034a0f43ebe90cb34969011867de..f5f0a478f538666e559ffcb98f603e448b264648 100644 |
| --- a/content/browser/renderer_host/input/touch_event_queue.cc |
| +++ b/content/browser/renderer_host/input/touch_event_queue.cc |
| @@ -69,11 +69,11 @@ class CoalescedWebTouchEvent { |
| return coalesced_event_; |
| } |
| - WebTouchEventWithLatencyList::const_iterator begin() const { |
| + WebTouchEventWithLatencyList::iterator begin() { |
| return events_.begin(); |
| } |
| - WebTouchEventWithLatencyList::const_iterator end() const { |
| + WebTouchEventWithLatencyList::iterator end() { |
| return events_.end(); |
| } |
| @@ -123,7 +123,7 @@ void TouchEventQueue::QueueEvent(const TouchEventWithLatencyInfo& event) { |
| } |
| void TouchEventQueue::ProcessTouchAck(InputEventAckState ack_result, |
| - const ui::LatencyInfo& latency_info) { |
| + ui::LatencyInfo* latency_info) { |
|
jdduke (slow)
2013/10/04 02:22:19
It looks like you can keep this a const ref, same
Yufeng Shen (Slow to review)
2013/10/04 18:03:03
Done.
|
| DCHECK(!dispatching_touch_ack_); |
| if (touch_queue_.empty()) |
| return; |
| @@ -162,16 +162,18 @@ void TouchEventQueue::TryForwardNextEventToRenderer() { |
| client_->SendTouchEventImmediately(touch); |
| break; |
| } |
| + ui::LatencyInfo latency; |
| PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS, |
| - ui::LatencyInfo()); |
| + &latency); |
| } |
| } |
| void TouchEventQueue::FlushQueue() { |
| DCHECK(!dispatching_touch_ack_); |
| + ui::LatencyInfo latency; |
| while (!touch_queue_.empty()) |
| PopTouchEventToClient(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, |
| - ui::LatencyInfo()); |
| + &latency); |
| } |
| size_t TouchEventQueue::GetQueueSize() const { |
| @@ -184,7 +186,7 @@ const TouchEventWithLatencyInfo& TouchEventQueue::GetLatestEvent() const { |
| void TouchEventQueue::PopTouchEventToClient( |
| InputEventAckState ack_result, |
| - const ui::LatencyInfo& renderer_latency_info) { |
| + ui::LatencyInfo* renderer_latency_info) { |
| if (touch_queue_.empty()) |
|
jdduke (slow)
2013/10/04 02:22:19
You're adding renderer_latency_info to latency bel
Yufeng Shen (Slow to review)
2013/10/04 18:03:03
Done.
|
| return; |
| scoped_ptr<CoalescedWebTouchEvent> acked_event(touch_queue_.front()); |
| @@ -194,15 +196,12 @@ void TouchEventQueue::PopTouchEventToClient( |
| // to the renderer, or touch-events being queued. |
| base::AutoReset<bool> dispatching_touch_ack(&dispatching_touch_ack_, true); |
| - base::TimeTicks now = base::TimeTicks::HighResNow(); |
| - for (WebTouchEventWithLatencyList::const_iterator iter = acked_event->begin(), |
| + for (WebTouchEventWithLatencyList::iterator iter = acked_event->begin(), |
| end = acked_event->end(); |
| iter != end; ++iter) { |
| - ui::LatencyInfo* latency = const_cast<ui::LatencyInfo*>(&(iter->latency)); |
| - latency->AddNewLatencyFrom(renderer_latency_info); |
| - latency->AddLatencyNumberWithTimestamp( |
| - ui::INPUT_EVENT_LATENCY_ACKED_COMPONENT, 0, 0, now, 1); |
| - client_->OnTouchEventAck((*iter), ack_result); |
| + ui::LatencyInfo* latency = &(iter->latency); |
| + latency->AddNewLatencyFrom(*renderer_latency_info); |
| + client_->OnTouchEventAck(iter->event, ack_result, latency); |
| } |
| } |