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 <stdint.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/location.h" | 11 #include "base/location.h" |
10 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" |
11 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
13 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
14 #include "base/win/message_window.h" | 17 #include "base/win/message_window.h" |
15 #include "remoting/host/client_session_control.h" | 18 #include "remoting/host/client_session_control.h" |
16 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 19 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
17 | 20 |
18 namespace remoting { | 21 namespace remoting { |
19 | 22 |
20 namespace { | 23 namespace { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 RID_INPUT, | 167 RID_INPUT, |
165 nullptr, | 168 nullptr, |
166 &size, | 169 &size, |
167 sizeof(RAWINPUTHEADER)); | 170 sizeof(RAWINPUTHEADER)); |
168 if (result == static_cast<UINT>(-1)) { | 171 if (result == static_cast<UINT>(-1)) { |
169 PLOG(ERROR) << "GetRawInputData() failed"; | 172 PLOG(ERROR) << "GetRawInputData() failed"; |
170 return 0; | 173 return 0; |
171 } | 174 } |
172 | 175 |
173 // Retrieve the input record itself. | 176 // Retrieve the input record itself. |
174 scoped_ptr<uint8[]> buffer(new uint8[size]); | 177 scoped_ptr<uint8_t[]> buffer(new uint8_t[size]); |
175 RAWINPUT* input = reinterpret_cast<RAWINPUT*>(buffer.get()); | 178 RAWINPUT* input = reinterpret_cast<RAWINPUT*>(buffer.get()); |
176 result = GetRawInputData(input_handle, | 179 result = GetRawInputData(input_handle, |
177 RID_INPUT, | 180 RID_INPUT, |
178 buffer.get(), | 181 buffer.get(), |
179 &size, | 182 &size, |
180 sizeof(RAWINPUTHEADER)); | 183 sizeof(RAWINPUTHEADER)); |
181 if (result == static_cast<UINT>(-1)) { | 184 if (result == static_cast<UINT>(-1)) { |
182 PLOG(ERROR) << "GetRawInputData() failed"; | 185 PLOG(ERROR) << "GetRawInputData() failed"; |
183 return 0; | 186 return 0; |
184 } | 187 } |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 scoped_ptr<LocalInputMonitor> LocalInputMonitor::Create( | 238 scoped_ptr<LocalInputMonitor> LocalInputMonitor::Create( |
236 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 239 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
237 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 240 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
238 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 241 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
239 base::WeakPtr<ClientSessionControl> client_session_control) { | 242 base::WeakPtr<ClientSessionControl> client_session_control) { |
240 return make_scoped_ptr(new LocalInputMonitorWin( | 243 return make_scoped_ptr(new LocalInputMonitorWin( |
241 caller_task_runner, ui_task_runner, client_session_control)); | 244 caller_task_runner, ui_task_runner, client_session_control)); |
242 } | 245 } |
243 | 246 |
244 } // namespace remoting | 247 } // namespace remoting |
OLD | NEW |