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

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

Issue 8820001: Send the pending input event ack before the UpdateRect message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/browser/renderer_host/render_widget_host.cc ('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) 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 #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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 if (!message.ReadData(&iter, &data, &data_length)) { 440 if (!message.ReadData(&iter, &data, &data_length)) {
441 handling_input_event_ = false; 441 handling_input_event_ = false;
442 return; 442 return;
443 } 443 }
444 444
445 const WebInputEvent* input_event = 445 const WebInputEvent* input_event =
446 reinterpret_cast<const WebInputEvent*>(data); 446 reinterpret_cast<const WebInputEvent*>(data);
447 447
448 bool prevent_default = false; 448 bool prevent_default = false;
449 if (WebInputEvent::isMouseEventType(input_event->type)) { 449 if (WebInputEvent::isMouseEventType(input_event->type)) {
450 TRACE_EVENT2("renderer", "HandleMouseMove",
darin (slow to review) 2011/12/06 23:19:48 nit: maybe this code would be cleaner with a local
451 "x", static_cast<const WebMouseEvent*>(input_event)->x,
452 "y", static_cast<const WebMouseEvent*>(input_event)->y);
450 prevent_default = WillHandleMouseEvent( 453 prevent_default = WillHandleMouseEvent(
451 *(static_cast<const WebMouseEvent*>(input_event))); 454 *(static_cast<const WebMouseEvent*>(input_event)));
452 } 455 }
453 456
454 bool processed = prevent_default; 457 bool processed = prevent_default;
455 if (!processed && webwidget_) 458 if (!processed && webwidget_)
456 processed = webwidget_->handleInputEvent(*input_event); 459 processed = webwidget_->handleInputEvent(*input_event);
457 460
458 IPC::Message* response = 461 IPC::Message* response =
459 new ViewHostMsg_HandleInputEvent_ACK(routing_id_, input_event->type, 462 new ViewHostMsg_HandleInputEvent_ACK(routing_id_, input_event->type,
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 } else { 835 } else {
833 params.scroll_rect = update.scroll_rect; 836 params.scroll_rect = update.scroll_rect;
834 params.copy_rects.swap(copy_rects); // TODO(darin): clip to bounds? 837 params.copy_rects.swap(copy_rects); // TODO(darin): clip to bounds?
835 } 838 }
836 params.view_size = size_; 839 params.view_size = size_;
837 params.resizer_rect = resizer_rect_; 840 params.resizer_rect = resizer_rect_;
838 params.plugin_window_moves.swap(plugin_window_moves_); 841 params.plugin_window_moves.swap(plugin_window_moves_);
839 params.flags = next_paint_flags_; 842 params.flags = next_paint_flags_;
840 params.scroll_offset = GetScrollOffset(); 843 params.scroll_offset = GetScrollOffset();
841 844
845 if (pending_input_event_ack_.get())
darin (slow to review) 2011/12/06 23:19:48 This probably deserves a comment.
846 Send(pending_input_event_ack_.release());
847
842 update_reply_pending_ = true; 848 update_reply_pending_ = true;
843 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); 849 Send(new ViewHostMsg_UpdateRect(routing_id_, params));
844 next_paint_flags_ = 0; 850 next_paint_flags_ = 0;
845 851
846 UpdateTextInputState(); 852 UpdateTextInputState();
847 UpdateSelectionBounds(); 853 UpdateSelectionBounds();
848 854
849 // Let derived classes know we've painted. 855 // Let derived classes know we've painted.
850 DidInitiatePaint(); 856 DidInitiatePaint();
851 } 857 }
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 } 1494 }
1489 } 1495 }
1490 1496
1491 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { 1497 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) {
1492 return false; 1498 return false;
1493 } 1499 }
1494 1500
1495 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { 1501 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const {
1496 return false; 1502 return false;
1497 } 1503 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698