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 "remoting/host/local_input_monitor.h" | 5 #include "remoting/host/local_input_monitor.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 RID_INPUT, | 167 RID_INPUT, |
168 NULL, | 168 NULL, |
169 &size, | 169 &size, |
170 sizeof(RAWINPUTHEADER)); | 170 sizeof(RAWINPUTHEADER)); |
171 if (result == -1) { | 171 if (result == -1) { |
172 LOG_GETLASTERROR(ERROR) << "GetRawInputData() failed"; | 172 LOG_GETLASTERROR(ERROR) << "GetRawInputData() failed"; |
173 return 0; | 173 return 0; |
174 } | 174 } |
175 | 175 |
176 // Retrieve the input record itself. | 176 // Retrieve the input record itself. |
177 scoped_array<uint8> buffer(new uint8[size]); | 177 scoped_ptr<uint8[]> buffer(new uint8[size]); |
178 RAWINPUT* input = reinterpret_cast<RAWINPUT*>(buffer.get()); | 178 RAWINPUT* input = reinterpret_cast<RAWINPUT*>(buffer.get()); |
179 result = GetRawInputData(input_handle, | 179 result = GetRawInputData(input_handle, |
180 RID_INPUT, | 180 RID_INPUT, |
181 buffer.get(), | 181 buffer.get(), |
182 &size, | 182 &size, |
183 sizeof(RAWINPUTHEADER)); | 183 sizeof(RAWINPUTHEADER)); |
184 if (result == -1) { | 184 if (result == -1) { |
185 LOG_GETLASTERROR(ERROR) << "GetRawInputData() failed"; | 185 LOG_GETLASTERROR(ERROR) << "GetRawInputData() failed"; |
186 return 0; | 186 return 0; |
187 } | 187 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 240 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
241 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 241 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
242 base::WeakPtr<ClientSessionControl> client_session_control) { | 242 base::WeakPtr<ClientSessionControl> client_session_control) { |
243 return scoped_ptr<LocalInputMonitor>( | 243 return scoped_ptr<LocalInputMonitor>( |
244 new LocalInputMonitorWin(caller_task_runner, | 244 new LocalInputMonitorWin(caller_task_runner, |
245 ui_task_runner, | 245 ui_task_runner, |
246 client_session_control)); | 246 client_session_control)); |
247 } | 247 } |
248 | 248 |
249 } // namespace remoting | 249 } // namespace remoting |
OLD | NEW |