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

Side by Side Diff: content/browser/renderer_host/render_widget_host.h

Issue 7044096: Throttle the touch move events sent to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <string> 10 #include <string>
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 583
584 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send. 584 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send.
585 // Unlike mouse moves, mouse wheel events received while one is pending are 585 // Unlike mouse moves, mouse wheel events received while one is pending are
586 // coalesced (by accumulating deltas) if they match the previous event in 586 // coalesced (by accumulating deltas) if they match the previous event in
587 // modifiers. On the Mac, in particular, mouse wheel events are received at a 587 // modifiers. On the Mac, in particular, mouse wheel events are received at a
588 // high rate; not waiting for the ack results in jankiness, and using the same 588 // high rate; not waiting for the ack results in jankiness, and using the same
589 // mechanism as for mouse moves (just dropping old events when multiple ones 589 // mechanism as for mouse moves (just dropping old events when multiple ones
590 // would be queued) results in very slow scrolling. 590 // would be queued) results in very slow scrolling.
591 WheelEventQueue coalesced_mouse_wheel_events_; 591 WheelEventQueue coalesced_mouse_wheel_events_;
592 592
593 #if defined(TOUCH_UI)
594 // True if a touch move event was sent to the renderer view and we are waiting
595 // for a corresponding ACK message.
596 bool touch_move_pending_;
597
598 // If a touch move event comes in while we are waiting for an ACK for a
599 // previously sent touch move event, it will be stored here. A touch event
600 // stores the location of the moved point, instead of the amount that it
601 // moved. So it is not necessary to coalesce the move events (as is done for
602 // mouse wheel events). Storing the most recent event for dispatch is
603 // sufficient.
604 WebKit::WebTouchEvent queued_touch_event_;
605 bool touch_event_is_queued_;
606 #endif
607
593 // The time when an input event was sent to the RenderWidget. 608 // The time when an input event was sent to the RenderWidget.
594 base::TimeTicks input_event_start_time_; 609 base::TimeTicks input_event_start_time_;
595 610
596 // If true, then we should repaint when restoring even if we have a 611 // If true, then we should repaint when restoring even if we have a
597 // backingstore. This flag is set to true if we receive a paint message 612 // backingstore. This flag is set to true if we receive a paint message
598 // while is_hidden_ to true. Even though we tell the render widget to hide 613 // while is_hidden_ to true. Even though we tell the render widget to hide
599 // itself, a paint message could already be in flight at that point. 614 // itself, a paint message could already be in flight at that point.
600 bool needs_repainting_on_restore_; 615 bool needs_repainting_on_restore_;
601 616
602 // This is true if the renderer is currently unresponsive. 617 // This is true if the renderer is currently unresponsive.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 671
657 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; 672 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_;
658 673
659 // The last scroll offset of the render widget. 674 // The last scroll offset of the render widget.
660 gfx::Point last_scroll_offset_; 675 gfx::Point last_scroll_offset_;
661 676
662 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); 677 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost);
663 }; 678 };
664 679
665 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 680 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698