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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 628763003: Support InputRouter recycling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 2 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 in_flight_event_count_(0), 180 in_flight_event_count_(0),
181 in_get_backing_store_(false), 181 in_get_backing_store_(false),
182 ignore_input_events_(false), 182 ignore_input_events_(false),
183 input_method_active_(false), 183 input_method_active_(false),
184 text_direction_updated_(false), 184 text_direction_updated_(false),
185 text_direction_(blink::WebTextDirectionLeftToRight), 185 text_direction_(blink::WebTextDirectionLeftToRight),
186 text_direction_canceled_(false), 186 text_direction_canceled_(false),
187 suppress_next_char_events_(false), 187 suppress_next_char_events_(false),
188 pending_mouse_lock_request_(false), 188 pending_mouse_lock_request_(false),
189 allow_privileged_mouse_lock_(false), 189 allow_privileged_mouse_lock_(false),
190 has_touch_handler_(false),
191 last_input_number_(static_cast<int64>(GetProcess()->GetID()) << 32), 190 last_input_number_(static_cast<int64>(GetProcess()->GetID()) << 32),
192 next_browser_snapshot_id_(1), 191 next_browser_snapshot_id_(1),
193 browser_composite_latency_history_(kBrowserCompositeLatencyHistorySize), 192 browser_composite_latency_history_(kBrowserCompositeLatencyHistorySize),
194 weak_factory_(this) { 193 weak_factory_(this) {
195 CHECK(delegate_); 194 CHECK(delegate_);
196 if (routing_id_ == MSG_ROUTING_NONE) { 195 if (routing_id_ == MSG_ROUTING_NONE) {
197 routing_id_ = process_->GetNextRoutingID(); 196 routing_id_ = process_->GetNextRoutingID();
198 surface_id_ = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( 197 surface_id_ = GpuSurfaceTracker::Get()->AddSurfaceForRenderer(
199 process_->GetID(), 198 process_->GetID(),
200 routing_id_); 199 routing_id_);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 if (delegate_) 385 if (delegate_)
387 delegate_->DidSendScreenRects(this); 386 delegate_->DidSendScreenRects(this);
388 waiting_for_screen_rects_ack_ = true; 387 waiting_for_screen_rects_ack_ = true;
389 } 388 }
390 389
391 void RenderWidgetHostImpl::SuppressNextCharEvents() { 390 void RenderWidgetHostImpl::SuppressNextCharEvents() {
392 suppress_next_char_events_ = true; 391 suppress_next_char_events_ = true;
393 } 392 }
394 393
395 void RenderWidgetHostImpl::FlushInput() { 394 void RenderWidgetHostImpl::FlushInput() {
396 input_router_->Flush(); 395 input_router_->RequestFlushedNotification();
397 if (synthetic_gesture_controller_) 396 if (synthetic_gesture_controller_)
398 synthetic_gesture_controller_->Flush(base::TimeTicks::Now()); 397 synthetic_gesture_controller_->Flush(base::TimeTicks::Now());
399 } 398 }
400 399
401 void RenderWidgetHostImpl::SetNeedsFlush() { 400 void RenderWidgetHostImpl::SetNeedsFlush() {
402 if (view_) 401 if (view_)
403 view_->OnSetNeedsFlushInput(); 402 view_->OnSetNeedsFlushInput();
404 } 403 }
405 404
406 void RenderWidgetHostImpl::Init() { 405 void RenderWidgetHostImpl::Init() {
(...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after
1848 DCHECK_GE(in_flight_event_count_, 0); 1847 DCHECK_GE(in_flight_event_count_, 0);
1849 if (decrement_in_flight_event_count() <= 0) { 1848 if (decrement_in_flight_event_count() <= 0) {
1850 // Cancel pending hung renderer checks since the renderer is responsive. 1849 // Cancel pending hung renderer checks since the renderer is responsive.
1851 StopHangMonitorTimeout(); 1850 StopHangMonitorTimeout();
1852 } else { 1851 } else {
1853 // The renderer is responsive, but there are in-flight events to wait for. 1852 // The renderer is responsive, but there are in-flight events to wait for.
1854 RestartHangMonitorTimeout(); 1853 RestartHangMonitorTimeout();
1855 } 1854 }
1856 } 1855 }
1857 1856
1858 void RenderWidgetHostImpl::OnHasTouchEventHandlers(bool has_handlers) {
1859 has_touch_handler_ = has_handlers;
1860 }
1861
1862 void RenderWidgetHostImpl::DidFlush() { 1857 void RenderWidgetHostImpl::DidFlush() {
1863 if (synthetic_gesture_controller_) 1858 if (synthetic_gesture_controller_)
1864 synthetic_gesture_controller_->OnDidFlushInput(); 1859 synthetic_gesture_controller_->OnDidFlushInput();
1865 if (view_)
1866 view_->OnDidFlushInput();
1867 } 1860 }
1868 1861
1869 void RenderWidgetHostImpl::DidOverscroll(const DidOverscrollParams& params) { 1862 void RenderWidgetHostImpl::DidOverscroll(const DidOverscrollParams& params) {
1870 if (view_) 1863 if (view_)
1871 view_->DidOverscroll(params); 1864 view_->DidOverscroll(params);
1872 } 1865 }
1873 1866
1874 void RenderWidgetHostImpl::OnKeyboardEventAck( 1867 void RenderWidgetHostImpl::OnKeyboardEventAck(
1875 const NativeWebKeyboardEvent& event, 1868 const NativeWebKeyboardEvent& event,
1876 InputEventAckState ack_result) { 1869 InputEventAckState ack_result) {
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2397 } 2390 }
2398 #endif 2391 #endif
2399 2392
2400 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { 2393 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() {
2401 if (view_) 2394 if (view_)
2402 return view_->PreferredReadbackFormat(); 2395 return view_->PreferredReadbackFormat();
2403 return kN32_SkColorType; 2396 return kN32_SkColorType;
2404 } 2397 }
2405 2398
2406 } // namespace content 2399 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698