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

Side by Side Diff: content/renderer/input/main_thread_event_queue.h

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Fix a few DCHECK hits Created 3 years, 11 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_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ 5 #ifndef CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_
6 #define CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ 6 #define CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/common/input/event_with_latency_info.h" 11 #include "content/common/input/event_with_latency_info.h"
12 #include "content/common/input/input_event_ack_state.h" 12 #include "content/common/input/input_event_ack_state.h"
13 #include "content/common/input/input_event_dispatch_type.h" 13 #include "content/common/input/input_event_dispatch_type.h"
14 #include "content/common/input/web_input_event_queue.h" 14 #include "content/common/input/web_input_event_queue.h"
15 #include "content/public/common/content_features.h" 15 #include "content/public/common/content_features.h"
16 #include "third_party/WebKit/public/platform/WebInputEvent.h" 16 #include "third_party/WebKit/public/platform/WebInputEvent.h"
17 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h" 17 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_schedul er.h"
18 #include "ui/events/blink/web_input_event_traits.h" 18 #include "ui/events/blink/web_input_event_traits.h"
19 #include "ui/events/latency_info.h" 19 #include "ui/events/latency_info.h"
20 20
21 namespace content { 21 namespace content {
22 22
23 class EventWithDispatchType : public ScopedWebInputEventWithLatencyInfo { 23 class EventWithDispatchType : public ScopedWebInputEventWithLatencyInfo {
24 public: 24 public:
25 EventWithDispatchType(ui::ScopedWebInputEvent event, 25 EventWithDispatchType(blink::WebScopedInputEvent event,
26 const ui::LatencyInfo& latency, 26 const ui::LatencyInfo& latency,
27 InputEventDispatchType dispatch_type); 27 InputEventDispatchType dispatch_type);
28 ~EventWithDispatchType(); 28 ~EventWithDispatchType();
29 void CoalesceWith(const EventWithDispatchType& other); 29 void CoalesceWith(const EventWithDispatchType& other);
30 30
31 const std::deque<uint32_t>& blockingCoalescedEventIds() const { 31 const std::deque<uint32_t>& blockingCoalescedEventIds() const {
32 return blocking_coalesced_event_ids_; 32 return blocking_coalesced_event_ids_;
33 } 33 }
34 InputEventDispatchType dispatchType() const { return dispatch_type_; } 34 InputEventDispatchType dispatchType() const { return dispatch_type_; }
35 base::TimeTicks creationTimestamp() const { return creation_timestamp_; } 35 base::TimeTicks creationTimestamp() const { return creation_timestamp_; }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 : public base::RefCountedThreadSafe<MainThreadEventQueue> { 113 : public base::RefCountedThreadSafe<MainThreadEventQueue> {
114 public: 114 public:
115 MainThreadEventQueue( 115 MainThreadEventQueue(
116 int routing_id, 116 int routing_id,
117 MainThreadEventQueueClient* client, 117 MainThreadEventQueueClient* client,
118 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner, 118 const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner,
119 blink::scheduler::RendererScheduler* renderer_scheduler); 119 blink::scheduler::RendererScheduler* renderer_scheduler);
120 120
121 // Called once the compositor has handled |event| and indicated that it is 121 // Called once the compositor has handled |event| and indicated that it is
122 // a non-blocking event to be queued to the main thread. 122 // a non-blocking event to be queued to the main thread.
123 bool HandleEvent(ui::ScopedWebInputEvent event, 123 bool HandleEvent(blink::WebScopedInputEvent event,
124 const ui::LatencyInfo& latency, 124 const ui::LatencyInfo& latency,
125 InputEventDispatchType dispatch_type, 125 InputEventDispatchType dispatch_type,
126 InputEventAckState ack_result); 126 InputEventAckState ack_result);
127 void DispatchRafAlignedInput(); 127 void DispatchRafAlignedInput();
128 128
129 // Call once the main thread has handled an outstanding |type| event 129 // Call once the main thread has handled an outstanding |type| event
130 // in flight. 130 // in flight.
131 void EventHandled(blink::WebInputEvent::Type type, 131 void EventHandled(blink::WebInputEvent::Type type,
132 InputEventAckState ack_result); 132 InputEventAckState ack_result);
133 133
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 173 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
174 blink::scheduler::RendererScheduler* renderer_scheduler_; 174 blink::scheduler::RendererScheduler* renderer_scheduler_;
175 175
176 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue); 176 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue);
177 }; 177 };
178 178
179 } // namespace content 179 } // namespace content
180 180
181 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ 181 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698