OLD | NEW |
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 <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent), | 1000 ForwardInputEvent(key_event, sizeof(WebKeyboardEvent), |
1001 is_keyboard_shortcut); | 1001 is_keyboard_shortcut); |
1002 } | 1002 } |
1003 } | 1003 } |
1004 | 1004 |
1005 void RenderWidgetHostImpl::ForwardInputEvent(const WebInputEvent& input_event, | 1005 void RenderWidgetHostImpl::ForwardInputEvent(const WebInputEvent& input_event, |
1006 int event_size, | 1006 int event_size, |
1007 bool is_keyboard_shortcut) { | 1007 bool is_keyboard_shortcut) { |
1008 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardInputEvent"); | 1008 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::ForwardInputEvent"); |
1009 | 1009 |
| 1010 in_process_event_types_.push(input_event.type); |
| 1011 |
1010 if (!process_->HasConnection()) | 1012 if (!process_->HasConnection()) |
1011 return; | 1013 return; |
1012 | 1014 |
1013 DCHECK(!process_->IgnoreInputEvents()); | 1015 DCHECK(!process_->IgnoreInputEvents()); |
1014 | 1016 |
1015 IPC::Message* message = new ViewMsg_HandleInputEvent(routing_id_); | 1017 IPC::Message* message = new ViewMsg_HandleInputEvent(routing_id_); |
1016 message->WriteData( | 1018 message->WriteData( |
1017 reinterpret_cast<const char*>(&input_event), event_size); | 1019 reinterpret_cast<const char*>(&input_event), event_size); |
1018 // |is_keyboard_shortcut| only makes sense for RawKeyDown events. | 1020 // |is_keyboard_shortcut| only makes sense for RawKeyDown events. |
1019 if (input_event.type == WebInputEvent::RawKeyDown) | 1021 if (input_event.type == WebInputEvent::RawKeyDown) |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 // On other platforms, this will be equivalent to MPArch.RWH_OnMsgUpdateRect. | 1525 // On other platforms, this will be equivalent to MPArch.RWH_OnMsgUpdateRect. |
1524 delta = now - paint_start; | 1526 delta = now - paint_start; |
1525 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta); | 1527 UMA_HISTOGRAM_TIMES("MPArch.RWH_TotalPaintTime", delta); |
1526 UNSHIPPED_TRACE_EVENT_INSTANT1("test_latency", "UpdateRectComplete", | 1528 UNSHIPPED_TRACE_EVENT_INSTANT1("test_latency", "UpdateRectComplete", |
1527 "x+y", params.bitmap_rect.x() + params.bitmap_rect.y()); | 1529 "x+y", params.bitmap_rect.x() + params.bitmap_rect.y()); |
1528 } | 1530 } |
1529 | 1531 |
1530 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, | 1532 void RenderWidgetHostImpl::OnMsgInputEventAck(WebInputEvent::Type event_type, |
1531 bool processed) { | 1533 bool processed) { |
1532 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck"); | 1534 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnMsgInputEventAck"); |
| 1535 DCHECK(!in_process_event_types_.empty() && |
| 1536 in_process_event_types_.front() == event_type); |
| 1537 in_process_event_types_.pop(); |
1533 | 1538 |
1534 // Log the time delta for processing an input event. | 1539 // Log the time delta for processing an input event. |
1535 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; | 1540 TimeDelta delta = TimeTicks::Now() - input_event_start_time_; |
1536 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); | 1541 UMA_HISTOGRAM_TIMES("MPArch.RWH_InputEventDelta", delta); |
1537 | 1542 |
1538 // Cancel pending hung renderer checks since the renderer is responsive. | 1543 // Cancel pending hung renderer checks since the renderer is responsive. |
1539 if (decrement_in_flight_event_count() == 0) | 1544 if (decrement_in_flight_event_count() == 0) |
1540 StopHangMonitorTimeout(); | 1545 StopHangMonitorTimeout(); |
1541 | 1546 |
1542 int type = static_cast<int>(event_type); | 1547 int type = static_cast<int>(event_type); |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2038 // indicate that no callback is in progress (i.e. without this line | 2043 // indicate that no callback is in progress (i.e. without this line |
2039 // DelayedAutoResized will not get called again). | 2044 // DelayedAutoResized will not get called again). |
2040 new_auto_size_.SetSize(0, 0); | 2045 new_auto_size_.SetSize(0, 0); |
2041 if (!should_auto_resize_) | 2046 if (!should_auto_resize_) |
2042 return; | 2047 return; |
2043 | 2048 |
2044 OnRenderAutoResized(new_size); | 2049 OnRenderAutoResized(new_size); |
2045 } | 2050 } |
2046 | 2051 |
2047 } // namespace content | 2052 } // namespace content |
OLD | NEW |