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

Side by Side Diff: content/browser/renderer_host/input/immediate_input_router.cc

Issue 20356003: Provided batched input delivery with a BufferedInputRouter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BufferedInputRouter unit tests Created 7 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/input/immediate_input_router.h" 5 #include "content/browser/renderer_host/input/immediate_input_router.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "content/browser/renderer_host/input/gesture_event_filter.h" 9 #include "content/browser/renderer_host/input/gesture_event_filter.h"
10 #include "content/browser/renderer_host/input/input_router_client.h" 10 #include "content/browser/renderer_host/input/input_router_client.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 case INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS: return "NO_CONSUMER_EXISTS"; 64 case INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS: return "NO_CONSUMER_EXISTS";
65 default: 65 default:
66 DLOG(WARNING) << "Unhandled InputEventAckState in GetEventAckName.\n"; 66 DLOG(WARNING) << "Unhandled InputEventAckState in GetEventAckName.\n";
67 break; 67 break;
68 } 68 }
69 return ""; 69 return "";
70 } 70 }
71 71
72 } // namespace 72 } // namespace
73 73
74 ImmediateInputRouter::ImmediateInputRouter( 74 ImmediateInputRouter::ImmediateInputRouter(RenderProcessHost* process,
75 RenderProcessHost* process, 75 InputRouterClient* client,
76 InputRouterClient* client, 76 int routing_id)
77 int routing_id)
78 : process_(process), 77 : process_(process),
79 client_(client), 78 client_(client),
80 routing_id_(routing_id), 79 routing_id_(routing_id),
81 select_range_pending_(false), 80 select_range_pending_(false),
82 move_caret_pending_(false), 81 move_caret_pending_(false),
83 mouse_move_pending_(false), 82 mouse_move_pending_(false),
84 mouse_wheel_pending_(false), 83 mouse_wheel_pending_(false),
85 has_touch_handler_(false), 84 has_touch_handler_(false),
86 touch_event_queue_(new TouchEventQueue(this)), 85 touch_event_queue_(new TouchEventQueue(this)),
87 gesture_event_filter_(new GestureEventFilter(this)) { 86 gesture_event_filter_(new GestureEventFilter(this)) {
88 DCHECK(process); 87 DCHECK(process);
89 DCHECK(client); 88 DCHECK(client);
90 } 89 }
91 90
92 ImmediateInputRouter::~ImmediateInputRouter() { 91 ImmediateInputRouter::~ImmediateInputRouter() {
93 } 92 }
94 93
94 void ImmediateInputRouter::Flush() {
95 NOTREACHED() << "ImmediateInputRouter will never request a flush.";
96 }
97
95 bool ImmediateInputRouter::SendInput(IPC::Message* message) { 98 bool ImmediateInputRouter::SendInput(IPC::Message* message) {
96 DCHECK(IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart); 99 DCHECK(IPC_MESSAGE_ID_CLASS(message->type()) == InputMsgStart);
97 scoped_ptr<IPC::Message> scoped_message(message); 100 scoped_ptr<IPC::Message> scoped_message(message);
98 switch (scoped_message->type()) { 101 switch (scoped_message->type()) {
99 // Check for types that require an ACK. 102 // Check for types that require an ACK.
100 case InputMsg_SelectRange::ID: 103 case InputMsg_SelectRange::ID:
101 return SendSelectRange(scoped_message.release()); 104 return SendSelectRange(scoped_message.release());
102 case InputMsg_MoveCaret::ID: 105 case InputMsg_MoveCaret::ID:
103 return SendMoveCaret(scoped_message.release()); 106 return SendMoveCaret(scoped_message.release());
104 case InputMsg_HandleInputEvent::ID: 107 case InputMsg_HandleInputEvent::ID:
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 } 553 }
551 554
552 void ImmediateInputRouter::ProcessTouchAck( 555 void ImmediateInputRouter::ProcessTouchAck(
553 InputEventAckState ack_result, 556 InputEventAckState ack_result,
554 const ui::LatencyInfo& latency_info) { 557 const ui::LatencyInfo& latency_info) {
555 // |touch_event_queue_| will forward to OnTouchEventAck when appropriate. 558 // |touch_event_queue_| will forward to OnTouchEventAck when appropriate.
556 touch_event_queue_->ProcessTouchAck(ack_result, latency_info); 559 touch_event_queue_->ProcessTouchAck(ack_result, latency_info);
557 } 560 }
558 561
559 } // namespace content 562 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698