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

Side by Side Diff: content/renderer/render_widget.cc

Issue 10826189: Allow disabling input throttle through RendererPreference (for Browser Plugin guests) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated according to darin@'s comments Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 input_method_is_active_(false), 101 input_method_is_active_(false),
102 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), 102 text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
103 can_compose_inline_(true), 103 can_compose_inline_(true),
104 popup_type_(popup_type), 104 popup_type_(popup_type),
105 pending_window_rect_count_(0), 105 pending_window_rect_count_(0),
106 suppress_next_char_events_(false), 106 suppress_next_char_events_(false),
107 is_accelerated_compositing_active_(false), 107 is_accelerated_compositing_active_(false),
108 animation_update_pending_(false), 108 animation_update_pending_(false),
109 invalidation_task_posted_(false), 109 invalidation_task_posted_(false),
110 screen_info_(screen_info), 110 screen_info_(screen_info),
111 device_scale_factor_(1) { 111 device_scale_factor_(1),
112 throttle_input_events_(true) {
112 if (!swapped_out) 113 if (!swapped_out)
113 RenderProcess::current()->AddRefProcess(); 114 RenderProcess::current()->AddRefProcess();
114 DCHECK(RenderThread::Get()); 115 DCHECK(RenderThread::Get());
115 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( 116 has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch(
116 switches::kDisableGpuVsync); 117 switches::kDisableGpuVsync);
117 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) 118 #if defined(OS_CHROMEOS) || defined(OS_MACOSX)
118 device_scale_factor_ = screen_info.verticalDPI / kStandardDPI; 119 device_scale_factor_ = screen_info.verticalDPI / kStandardDPI;
119 // Unless an explicit scale factor was provided for testing, ensure the scale 120 // Unless an explicit scale factor was provided for testing, ensure the scale
120 // is integral. 121 // is integral.
121 if (!CommandLine::ForCurrentProcess()->HasSwitch( 122 if (!CommandLine::ForCurrentProcess()->HasSwitch(
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 suppress_next_char_events_ = true; 577 suppress_next_char_events_ = true;
577 578
578 IPC::Message* response = 579 IPC::Message* response =
579 new ViewHostMsg_HandleInputEvent_ACK(routing_id_, input_event->type, 580 new ViewHostMsg_HandleInputEvent_ACK(routing_id_, input_event->type,
580 processed); 581 processed);
581 bool event_type_gets_rate_limited = 582 bool event_type_gets_rate_limited =
582 input_event->type == WebInputEvent::MouseMove || 583 input_event->type == WebInputEvent::MouseMove ||
583 input_event->type == WebInputEvent::MouseWheel || 584 input_event->type == WebInputEvent::MouseWheel ||
584 WebInputEvent::isTouchEventType(input_event->type); 585 WebInputEvent::isTouchEventType(input_event->type);
585 bool is_input_throttled = 586 bool is_input_throttled =
586 (webwidget_ ? webwidget_->isInputThrottled() : false) || 587 throttle_input_events_ &&
587 paint_aggregator_.HasPendingUpdate(); 588 ((webwidget_ ? webwidget_->isInputThrottled() : false) ||
589 paint_aggregator_.HasPendingUpdate());
588 590
589 if (event_type_gets_rate_limited && is_input_throttled && !is_hidden_) { 591 if (event_type_gets_rate_limited && is_input_throttled && !is_hidden_) {
590 // We want to rate limit the input events in this case, so we'll wait for 592 // We want to rate limit the input events in this case, so we'll wait for
591 // painting to finish before ACKing this message. 593 // painting to finish before ACKing this message.
592 if (pending_input_event_ack_.get()) { 594 if (pending_input_event_ack_.get()) {
593 // As two different kinds of events could cause us to postpone an ack 595 // As two different kinds of events could cause us to postpone an ack
594 // we send it now, if we have one pending. The Browser should never 596 // we send it now, if we have one pending. The Browser should never
595 // send us the same kind of event we are delaying the ack for. 597 // send us the same kind of event we are delaying the ack for.
596 Send(pending_input_event_ack_.release()); 598 Send(pending_input_event_ack_.release());
597 } 599 }
(...skipping 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, down, scroll_far)); 1795 Send(new ViewHostMsg_BeginSmoothScroll(routing_id_, down, scroll_far));
1794 } 1796 }
1795 1797
1796 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { 1798 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) {
1797 return false; 1799 return false;
1798 } 1800 }
1799 1801
1800 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { 1802 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const {
1801 return false; 1803 return false;
1802 } 1804 }
OLDNEW
« no previous file with comments | « content/renderer/render_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698