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

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

Issue 2846333002: Add a BeginMainFrame fallback to MainThreadEventQueue. (Closed)
Patch Set: Fix tests Created 3 years, 7 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
« no previous file with comments | « no previous file | content/renderer/input/main_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
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 "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 InputEventAckState ack_result, 111 InputEventAckState ack_result,
112 uint32_t touch_event_id); 112 uint32_t touch_event_id);
113 113
114 void SendEventToMainThread(const blink::WebInputEvent* event, 114 void SendEventToMainThread(const blink::WebInputEvent* event,
115 const ui::LatencyInfo& latency, 115 const ui::LatencyInfo& latency,
116 InputEventDispatchType original_dispatch_type); 116 InputEventDispatchType original_dispatch_type);
117 117
118 bool IsRafAlignedInputDisabled() const; 118 bool IsRafAlignedInputDisabled() const;
119 bool IsRafAlignedEvent( 119 bool IsRafAlignedEvent(
120 const std::unique_ptr<MainThreadEventQueueTask>& item) const; 120 const std::unique_ptr<MainThreadEventQueueTask>& item) const;
121 void RafFallbackTimerFired();
122
123 void set_use_raf_fallback_timer(bool use_timer) {
124 use_raf_fallback_timer_ = use_timer;
125 }
121 126
122 friend class QueuedWebInputEvent; 127 friend class QueuedWebInputEvent;
123 friend class MainThreadEventQueueTest; 128 friend class MainThreadEventQueueTest;
124 friend class MainThreadEventQueueInitializationTest; 129 friend class MainThreadEventQueueInitializationTest;
125 MainThreadEventQueueClient* client_; 130 MainThreadEventQueueClient* client_;
126 bool last_touch_start_forced_nonblocking_due_to_fling_; 131 bool last_touch_start_forced_nonblocking_due_to_fling_;
127 bool enable_fling_passive_listener_flag_; 132 bool enable_fling_passive_listener_flag_;
128 bool enable_non_blocking_due_to_main_thread_responsiveness_flag_; 133 bool enable_non_blocking_due_to_main_thread_responsiveness_flag_;
129 base::TimeDelta main_thread_responsiveness_threshold_; 134 base::TimeDelta main_thread_responsiveness_threshold_;
130 bool handle_raf_aligned_touch_input_; 135 bool handle_raf_aligned_touch_input_;
(...skipping 11 matching lines...) Expand all
142 bool sent_post_task_; 147 bool sent_post_task_;
143 base::TimeTicks last_async_touch_move_timestamp_; 148 base::TimeTicks last_async_touch_move_timestamp_;
144 }; 149 };
145 150
146 // Lock used to serialize |shared_state_|. 151 // Lock used to serialize |shared_state_|.
147 base::Lock shared_state_lock_; 152 base::Lock shared_state_lock_;
148 SharedState shared_state_; 153 SharedState shared_state_;
149 154
150 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 155 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
151 blink::scheduler::RendererScheduler* renderer_scheduler_; 156 blink::scheduler::RendererScheduler* renderer_scheduler_;
157 base::OneShotTimer raf_fallback_timer_;
158 bool use_raf_fallback_timer_;
152 159
153 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue); 160 DISALLOW_COPY_AND_ASSIGN(MainThreadEventQueue);
154 }; 161 };
155 162
156 } // namespace content 163 } // namespace content
157 164
158 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_ 165 #endif // CONTENT_RENDERER_INPUT_MAIN_THREAD_EVENT_QUEUE_H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/input/main_thread_event_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698