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

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

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 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return false; 147 return false;
148 } 148 }
149 149
150 void RenderWidgetMusConnection::OnConnectionLost() { 150 void RenderWidgetMusConnection::OnConnectionLost() {
151 DCHECK(thread_checker_.CalledOnValidThread()); 151 DCHECK(thread_checker_.CalledOnValidThread());
152 g_connections.Get().erase(routing_id_); 152 g_connections.Get().erase(routing_id_);
153 delete this; 153 delete this;
154 } 154 }
155 155
156 void RenderWidgetMusConnection::OnWindowInputEvent( 156 void RenderWidgetMusConnection::OnWindowInputEvent(
157 ui::ScopedWebInputEvent input_event, 157 blink::WebScopedInputEvent input_event,
158 const base::Callback<void(ui::mojom::EventResult)>& ack) { 158 const base::Callback<void(ui::mojom::EventResult)>& ack) {
159 DCHECK(thread_checker_.CalledOnValidThread()); 159 DCHECK(thread_checker_.CalledOnValidThread());
160 // If we don't yet have a RenderWidgetInputHandler then we don't yet have 160 // If we don't yet have a RenderWidgetInputHandler then we don't yet have
161 // an initialized RenderWidget. 161 // an initialized RenderWidget.
162 if (!input_handler_) { 162 if (!input_handler_) {
163 ack.Run(ui::mojom::EventResult::UNHANDLED); 163 ack.Run(ui::mojom::EventResult::UNHANDLED);
164 return; 164 return;
165 } 165 }
166 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an 166 // TODO(fsamuel): It would be nice to add this DCHECK but the reality is an
167 // event could timeout and we could receive the next event before we ack the 167 // event could timeout and we could receive the next event before we ack the
168 // previous event. 168 // previous event.
169 // DCHECK(pending_ack_.is_null()); 169 // DCHECK(pending_ack_.is_null());
170 pending_ack_ = ack; 170 pending_ack_ = ack;
171 // TODO(fsamuel, sadrul): Track real latency info. 171 // TODO(fsamuel, sadrul): Track real latency info.
172 ui::LatencyInfo latency_info; 172 ui::LatencyInfo latency_info;
173 input_handler_->HandleInputEvent(*input_event, latency_info, 173 input_handler_->HandleInputEvent(*input_event, latency_info,
174 DISPATCH_TYPE_BLOCKING); 174 DISPATCH_TYPE_BLOCKING);
175 } 175 }
176 176
177 } // namespace content 177 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698