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

Side by Side Diff: content/common/input/web_input_event_queue.h

Issue 2166703003: Implement Main Thread RAF Aligned Input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_main_thread_queue
Patch Set: Created 4 years, 5 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 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_QUEUE_H_ 5 #ifndef CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_QUEUE_H_
6 #define CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_QUEUE_H_ 6 #define CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_QUEUE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 std::unique_ptr<T> Pop() { 50 std::unique_ptr<T> Pop() {
51 std::unique_ptr<T> result; 51 std::unique_ptr<T> result;
52 if (!queue_.empty()) { 52 if (!queue_.empty()) {
53 result.reset(queue_.front().release()); 53 result.reset(queue_.front().release());
54 queue_.pop_front(); 54 queue_.pop_front();
55 } 55 }
56 return result; 56 return result;
57 } 57 }
58 58
59 const std::unique_ptr<T>& Top() {
tdresser 2016/07/20 21:43:08 Why Top instead of front?
60 DCHECK(!empty());
61 return queue_.front();
62 }
63
59 bool empty() const { return queue_.empty(); } 64 bool empty() const { return queue_.empty(); }
60 65
61 size_t size() const { return queue_.size(); } 66 size_t size() const { return queue_.size(); }
62 67
63 private: 68 private:
64 typedef std::deque<std::unique_ptr<T>> EventQueue; 69 typedef std::deque<std::unique_ptr<T>> EventQueue;
65 EventQueue queue_; 70 EventQueue queue_;
66 71
67 DISALLOW_COPY_AND_ASSIGN(WebInputEventQueue); 72 DISALLOW_COPY_AND_ASSIGN(WebInputEventQueue);
68 }; 73 };
69 74
70 } // namespace content 75 } // namespace content
71 76
72 #endif // CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_QUEUE_H_ 77 #endif // CONTENT_COMMON_INPUT_WEB_INPUT_EVENT_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/input/input_event_filter.h » ('j') | content/renderer/input/input_event_filter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698