OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/hid/hid_service_linux.h" | 5 #include "device/hid/hid_service_linux.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 265 |
266 // static | 266 // static |
267 void HidServiceLinux::ValidateFdOnBlockingThread( | 267 void HidServiceLinux::ValidateFdOnBlockingThread( |
268 scoped_ptr<ConnectParams> params, | 268 scoped_ptr<ConnectParams> params, |
269 dbus::FileDescriptor fd) { | 269 dbus::FileDescriptor fd) { |
270 base::ThreadRestrictions::AssertIOAllowed(); | 270 base::ThreadRestrictions::AssertIOAllowed(); |
271 | 271 |
272 fd.CheckValidity(); | 272 fd.CheckValidity(); |
273 if (fd.is_valid()) { | 273 if (fd.is_valid()) { |
274 params->device_file = base::File(fd.TakeValue()); | 274 params->device_file = base::File(fd.TakeValue()); |
275 FinishOpen(params.Pass()); | 275 FinishOpen(std::move(params)); |
276 } else { | 276 } else { |
277 HID_LOG(EVENT) << "Permission broker denied access to '" | 277 HID_LOG(EVENT) << "Permission broker denied access to '" |
278 << params->device_info->device_node() << "'."; | 278 << params->device_info->device_node() << "'."; |
279 params->task_runner->PostTask(FROM_HERE, | 279 params->task_runner->PostTask(FROM_HERE, |
280 base::Bind(params->callback, nullptr)); | 280 base::Bind(params->callback, nullptr)); |
281 } | 281 } |
282 } | 282 } |
283 | 283 |
284 #else | 284 #else |
285 | 285 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 // static | 335 // static |
336 void HidServiceLinux::CreateConnection(scoped_ptr<ConnectParams> params) { | 336 void HidServiceLinux::CreateConnection(scoped_ptr<ConnectParams> params) { |
337 DCHECK(params->device_file.IsValid()); | 337 DCHECK(params->device_file.IsValid()); |
338 params->callback.Run(make_scoped_refptr(new HidConnectionLinux( | 338 params->callback.Run(make_scoped_refptr(new HidConnectionLinux( |
339 params->device_info, std::move(params->device_file), | 339 params->device_info, std::move(params->device_file), |
340 params->file_task_runner))); | 340 params->file_task_runner))); |
341 } | 341 } |
342 | 342 |
343 } // namespace device | 343 } // namespace device |
OLD | NEW |