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

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

Issue 283623002: Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for Web… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 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 | Annotate | Revision Log
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 "base/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "content/browser/gpu/compositor_util.h" 8 #include "content/browser/gpu/compositor_util.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/browser/web_contents/web_contents_impl.h" 10 #include "content/browser/web_contents/web_contents_impl.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (type_ == type) { 104 if (type_ == type) {
105 state_ = state; 105 state_ = state;
106 quit_.Run(); 106 quit_.Run();
107 } 107 }
108 } 108 }
109 109
110 // BrowserMessageFilter: 110 // BrowserMessageFilter:
111 virtual bool OnMessageReceived(const IPC::Message& message, 111 virtual bool OnMessageReceived(const IPC::Message& message,
112 bool* message_was_ok) OVERRIDE { 112 bool* message_was_ok) OVERRIDE {
113 if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) { 113 if (message.type() == InputHostMsg_HandleInputEvent_ACK::ID) {
114 ui::LatencyInfo latency; 114 InputHostMsg_HandleInputEvent_ACK::Param params;
115 WebInputEvent::Type type = WebInputEvent::Undefined; 115 InputHostMsg_HandleInputEvent_ACK::Read(&message, &params);
116 InputEventAckState ack = INPUT_EVENT_ACK_STATE_UNKNOWN; 116 WebInputEvent::Type type = params.a;
117 InputHostMsg_HandleInputEvent_ACK::Read(&message, &type, &ack, &latency); 117 InputEventAckState ack = params.b;
118 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 118 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
119 base::Bind(&InputEventMessageFilter::ReceivedEventAck, 119 base::Bind(&InputEventMessageFilter::ReceivedEventAck,
120 this, type, ack)); 120 this, type, ack));
121 } 121 }
122 return false; 122 return false;
123 } 123 }
124 124
125 base::Closure quit_; 125 base::Closure quit_;
126 WebInputEvent::Type type_; 126 WebInputEvent::Type type_;
127 InputEventAckState state_; 127 InputEventAckState state_;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, filter()->last_ack_state()); 257 EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, filter()->last_ack_state());
258 } 258 }
259 259
260 touch.PressPoint(25, 125); 260 touch.PressPoint(25, 125);
261 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo()); 261 GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
262 filter()->WaitForAck(WebInputEvent::TouchStart); 262 filter()->WaitForAck(WebInputEvent::TouchStart);
263 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state()); 263 EXPECT_EQ(INPUT_EVENT_ACK_STATE_CONSUMED, filter()->last_ack_state());
264 } 264 }
265 265
266 } // namespace content 266 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698