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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10823077: Throttle SelectRange IPC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 3b93544dbc9bd8efccc9bd2e4549160fc561c4dd..28fa9ebc659705e97945eb8fb0cb892be27b6cb3 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -135,6 +135,8 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
mouse_move_pending_(false),
mouse_wheel_pending_(false),
gesture_event_pending_(false),
+ select_range_in_flight_(false),
+ select_range_pending_(false),
needs_repainting_on_restore_(false),
is_unresponsive_(false),
in_flight_event_count_(0),
@@ -288,6 +290,7 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnMsgUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_BeginSmoothScroll, OnMsgBeginSmoothScroll)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_SelectRange_ACK, OnMsgSelectRangeAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnMsgFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnMsgBlur)
IPC_MESSAGE_HANDLER(ViewHostMsg_HasTouchEventHandlers,
@@ -1513,6 +1516,14 @@ void RenderWidgetHostImpl::TickActiveSmoothScrollGesture() {
}
}
+void RenderWidgetHostImpl::OnMsgSelectRangeAck() {
+ select_range_in_flight_ = false;
+ if (select_range_pending_) {
+ select_range_pending_ = false;
+ SelectRange(pend_select_start_, pend_select_end_);
+ }
+}
+
void RenderWidgetHostImpl::ProcessWheelAck(bool processed) {
mouse_wheel_pending_ = false;
@@ -1816,6 +1827,13 @@ void RenderWidgetHostImpl::ScrollFocusedEditableNodeIntoRect(
void RenderWidgetHostImpl::SelectRange(const gfx::Point& start,
const gfx::Point& end) {
+ if (select_range_in_flight_) {
+ select_range_pending_ = true;
+ pend_select_start_ = start;
+ pend_select_end_ = end;
+ return;
+ }
+ select_range_in_flight_ = true;
Send(new ViewMsg_SelectRange(GetRoutingID(), start, end));
}

Powered by Google App Engine
This is Rietveld 408576698