Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ui/events/blink/compositor_thread_event_queue.h" | |
| 6 | |
| 7 namespace ui { | |
| 8 | |
| 9 CompositorThreadEventQueue::CompositorThreadEventQueue() {} | |
| 10 | |
| 11 CompositorThreadEventQueue::~CompositorThreadEventQueue() {} | |
| 12 | |
| 13 void CompositorThreadEventQueue::Queue( | |
| 14 std::unique_ptr<EventWithCallback> event) { | |
| 15 if (!queue_.empty() && queue_.back()->CanCoalesceWith(*event)) { | |
|
tdresser
2016/11/01 18:12:44
This doesn't handle the scroll/pinch/scroll case,
chongz
2016/11/02 21:29:32
No it doesn't. I've filed https://crbug.com/661601
tdresser
2016/11/04 16:51:03
Next CL is fine.
| |
| 16 queue_.back()->CoalesceWith(event.get()); | |
| 17 return; | |
| 18 } | |
| 19 | |
| 20 queue_.emplace_back(std::move(event)); | |
| 21 } | |
| 22 | |
| 23 std::unique_ptr<EventWithCallback> CompositorThreadEventQueue::Pop() { | |
| 24 std::unique_ptr<EventWithCallback> result; | |
| 25 if (!queue_.empty()) { | |
| 26 result.reset(queue_.front().release()); | |
| 27 queue_.pop_front(); | |
| 28 } | |
| 29 return result; | |
| 30 } | |
| 31 | |
| 32 } // namespace ui | |
| OLD | NEW |