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

Side by Side Diff: device/hid/hid_connection_linux.cc

Issue 818093003: Standardize usage of virtual/override/final specifiers in device/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | device/hid/hid_service_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_connection_linux.h" 5 #include "device/hid/hid_connection_linux.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <linux/hidraw.h> 8 #include <linux/hidraw.h>
9 #include <sys/ioctl.h> 9 #include <sys/ioctl.h>
10 10
(...skipping 25 matching lines...) Expand all
36 base::WeakPtr<HidConnectionLinux> connection, 36 base::WeakPtr<HidConnectionLinux> connection,
37 scoped_refptr<base::SingleThreadTaskRunner> task_runner) 37 scoped_refptr<base::SingleThreadTaskRunner> task_runner)
38 : platform_file_(platform_file), 38 : platform_file_(platform_file),
39 connection_(connection), 39 connection_(connection),
40 task_runner_(task_runner) { 40 task_runner_(task_runner) {
41 // Report buffers must always have room for the report ID. 41 // Report buffers must always have room for the report ID.
42 report_buffer_size_ = device_info.max_input_report_size + 1; 42 report_buffer_size_ = device_info.max_input_report_size + 1;
43 has_report_id_ = device_info.has_report_id; 43 has_report_id_ = device_info.has_report_id;
44 } 44 }
45 45
46 virtual ~Helper() { DCHECK(thread_checker_.CalledOnValidThread()); } 46 ~Helper() override { DCHECK(thread_checker_.CalledOnValidThread()); }
47 47
48 // Starts the FileDescriptorWatcher that reads input events from the device. 48 // Starts the FileDescriptorWatcher that reads input events from the device.
49 // Must be called on a thread that has a base::MessageLoopForIO. The helper 49 // Must be called on a thread that has a base::MessageLoopForIO. The helper
50 // object is owned by the thread where it was started. 50 // object is owned by the thread where it was started.
51 void Start() { 51 void Start() {
52 base::ThreadRestrictions::AssertIOAllowed(); 52 base::ThreadRestrictions::AssertIOAllowed();
53 thread_checker_.DetachFromThread(); 53 thread_checker_.DetachFromThread();
54 if (!base::MessageLoopForIO::current()->WatchFileDescriptor( 54 if (!base::MessageLoopForIO::current()->WatchFileDescriptor(
55 platform_file_, true, base::MessageLoopForIO::WATCH_READ, 55 platform_file_, true, base::MessageLoopForIO::WATCH_READ,
56 &file_watcher_, this)) { 56 &file_watcher_, this)) {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 PendingHidReport report = pending_reports_.front(); 297 PendingHidReport report = pending_reports_.front();
298 298
299 pending_reports_.pop(); 299 pending_reports_.pop();
300 if (CompleteRead(report.buffer, report.size, read.callback)) { 300 if (CompleteRead(report.buffer, report.size, read.callback)) {
301 pending_reads_.pop(); 301 pending_reads_.pop();
302 } 302 }
303 } 303 }
304 } 304 }
305 305
306 } // namespace device 306 } // namespace device
OLDNEW
« no previous file with comments | « no previous file | device/hid/hid_service_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698