Chromium Code Reviews| Index: content/renderer/render_view_impl.cc |
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
| index 93479bcf1bd718cd0da2355b5ca3a92d82777561..f322efdc4098ea740b43428cb52817b4985365a1 100644 |
| --- a/content/renderer/render_view_impl.cc |
| +++ b/content/renderer/render_view_impl.cc |
| @@ -1300,8 +1300,16 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) { |
| // Input IPC messages must not be processed if the RenderView is in |
| // swapped out state. |
| - if (is_swapped_out_ && IPC_MESSAGE_ID_CLASS(message.type()) == InputMsgStart) |
| + // TODO(dtapuska): Remove this histogram once we have seen that it actually |
| + // produces results true. See crbug.com/615090 |
|
Charlie Reis
2016/10/27 19:35:17
nit: Move comment next to histogram.
dtapuska
2016/10/28 14:56:55
Done.
|
| + if (is_swapped_out_ && |
| + IPC_MESSAGE_ID_CLASS(message.type()) == InputMsgStart) { |
| + UMA_HISTOGRAM_BOOLEAN("Event.RenderView.DiscardInput", true); |
| + IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message) |
| + IPC_MESSAGE_HANDLER(InputMsg_HandleInputEvent, OnDiscardInputEvent) |
| + IPC_END_MESSAGE_MAP() |
| return false; |
| + } |
| for (auto& observer : observers_) { |
| if (observer.OnMessageReceived(message)) |
| @@ -3037,4 +3045,23 @@ void RenderViewImpl::UpdateWebViewWithDeviceScaleFactor() { |
| PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| } |
| +void RenderViewImpl::OnDiscardInputEvent( |
| + const blink::WebInputEvent* input_event, |
| + const ui::LatencyInfo& latency_info, |
| + InputEventDispatchType dispatch_type) { |
| + if (!input_event || (dispatch_type != DISPATCH_TYPE_BLOCKING && |
| + dispatch_type != DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN)) { |
| + return; |
| + } |
| + |
| + if (dispatch_type == DISPATCH_TYPE_BLOCKING_NOTIFY_MAIN) { |
| + NotifyInputEventHandled(input_event->type, |
| + INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| + } |
| + |
| + std::unique_ptr<InputEventAck> ack( |
| + new InputEventAck(input_event->type, INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| + OnInputEventAck(std::move(ack)); |
| +} |
| + |
| } // namespace content |