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

Side by Side Diff: content/renderer/mus/render_widget_mus_connection.cc

Issue 2265393002: Refactor compositor event handling path to be callback-based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: creis's review, rebase Created 4 years, 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/renderer/mus/render_widget_mus_connection.h" 5 #include "content/renderer/mus/render_widget_mus_connection.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 return false; 146 return false;
147 } 147 }
148 148
149 void RenderWidgetMusConnection::OnConnectionLost() { 149 void RenderWidgetMusConnection::OnConnectionLost() {
150 DCHECK(thread_checker_.CalledOnValidThread()); 150 DCHECK(thread_checker_.CalledOnValidThread());
151 g_connections.Get().erase(routing_id_); 151 g_connections.Get().erase(routing_id_);
152 delete this; 152 delete this;
153 } 153 }
154 154
155 void RenderWidgetMusConnection::OnWindowInputEvent( 155 void RenderWidgetMusConnection::OnWindowInputEvent(
156 std::unique_ptr<blink::WebInputEvent> input_event, 156 ui::ScopedWebInputEvent input_event,
157 const base::Callback<void(ui::mojom::EventResult)>& ack) { 157 const base::Callback<void(ui::mojom::EventResult)>& ack) {
158 DCHECK(thread_checker_.CalledOnValidThread()); 158 DCHECK(thread_checker_.CalledOnValidThread());
159 // If we don't yet have a RenderWidgetInputHandler then we don't yet have 159 // If we don't yet have a RenderWidgetInputHandler then we don't yet have
160 // an initialized RenderWidget. 160 // an initialized RenderWidget.
161 if (!input_handler_) { 161 if (!input_handler_) {
162 ack.Run(ui::mojom::EventResult::UNHANDLED); 162 ack.Run(ui::mojom::EventResult::UNHANDLED);
163 return; 163 return;
164 } 164 }
165 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an 165 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an
166 // event could timeout and we could receive the next event before we ack the 166 // event could timeout and we could receive the next event before we ack the
167 // previous event. 167 // previous event.
168 // DCHECK(pending_ack_.is_null()); 168 // DCHECK(pending_ack_.is_null());
169 pending_ack_ = ack; 169 pending_ack_ = ack;
170 // TODO(fsamuel, sadrul): Track real latency info. 170 // TODO(fsamuel, sadrul): Track real latency info.
171 ui::LatencyInfo latency_info; 171 ui::LatencyInfo latency_info;
172 input_handler_->HandleInputEvent(*input_event, latency_info, 172 input_handler_->HandleInputEvent(*input_event, latency_info,
173 DISPATCH_TYPE_BLOCKING); 173 DISPATCH_TYPE_BLOCKING);
174 } 174 }
175 175
176 } // namespace content 176 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/mus/render_widget_mus_connection.h ('k') | ui/events/blink/input_handler_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698