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

Side by Side Diff: ui/events/blink/compositor_thread_event_queue.h

Issue 2429953002: Implement compositor thread VSync aligned event queue (Closed)
Patch Set: dtapuska&enne's review: Call |Now()| once per loop; Chromium style; Remove parameterized test Created 4 years, 1 month 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
« no previous file with comments | « ui/events/blink/blink_features.cc ('k') | ui/events/blink/compositor_thread_event_queue.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #ifndef UI_EVENTS_BLINK_COMPOSITOR_THREAD_EVENT_QUEUE_H_
6 #define UI_EVENTS_BLINK_COMPOSITOR_THREAD_EVENT_QUEUE_H_
7
8 #include <deque>
9 #include <memory>
10
11 #include "ui/events/blink/event_with_callback.h"
12
13 namespace ui {
14
15 namespace test {
16 class InputHandlerProxyEventQueueTest;
17 }
18
19 // CompositorThreadEventQueue is a coalescing queue. It will examine
20 // the current events in the queue and will attempt to coalesce with
21 // the last event.
22 class CompositorThreadEventQueue {
23 public:
24 CompositorThreadEventQueue();
25 ~CompositorThreadEventQueue();
26
27 // Adds an event to the queue. The event may be coalesced with the last event.
28 void Queue(std::unique_ptr<EventWithCallback> event,
29 base::TimeTicks timestamp_now);
30
31 std::unique_ptr<EventWithCallback> Pop();
32
33 bool empty() const { return queue_.empty(); }
34
35 size_t size() const { return queue_.size(); }
36
37 private:
38 friend class test::InputHandlerProxyEventQueueTest;
39 using EventQueue = std::deque<std::unique_ptr<EventWithCallback>>;
40 EventQueue queue_;
41
42 DISALLOW_COPY_AND_ASSIGN(CompositorThreadEventQueue);
43 };
44
45 } // namespace ui
46
47 #endif // UI_EVENTS_BLINK_COMPOSITOR_THREAD_EVENT_QUEUE_H_
OLDNEW
« no previous file with comments | « ui/events/blink/blink_features.cc ('k') | ui/events/blink/compositor_thread_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698