Commit 40b4fa47 authored by dcheng's avatar dcheng Committed by Commit bot

Standardize usage of virtual/override/final specifiers in device/.

The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

Several formatting edits by clang-format were manually reverted, due to
mangling of some of the more complicate IPC macros.

BUG=417463

Review URL: https://codereview.chromium.org/818093003

Cr-Commit-Position: refs/heads/master@{#309481}
parent 1b3b125e
......@@ -43,7 +43,7 @@ class HidConnectionLinux::Helper : public base::MessagePumpLibevent::Watcher {
has_report_id_ = device_info.has_report_id;
}
virtual ~Helper() { DCHECK(thread_checker_.CalledOnValidThread()); }
~Helper() override { DCHECK(thread_checker_.CalledOnValidThread()); }
// Starts the FileDescriptorWatcher that reads input events from the device.
// Must be called on a thread that has a base::MessageLoopForIO. The helper
......
......@@ -75,9 +75,7 @@ class HidServiceLinux::Helper : public DeviceMonitorLinux::Observer,
base::Bind(&HidServiceLinux::FirstEnumerationComplete, service_));
}
virtual ~Helper() {
DCHECK(thread_checker_.CalledOnValidThread());
}
~Helper() override { DCHECK(thread_checker_.CalledOnValidThread()); }
private:
// DeviceMonitorLinux::Observer:
......
......@@ -30,7 +30,7 @@ class DataSender : public serial::DataSinkClient, public mojo::ErrorHandler {
uint32_t buffer_size,
int32_t fatal_error_value);
~DataSender();
~DataSender() override;
// Starts an asynchronous send of |data|. If the send completes successfully,
// |callback| will be called. Otherwise, |error_callback| will be called with
......
......@@ -22,7 +22,7 @@ class VibrationManagerEmptyImpl : public mojo::InterfaceImpl<VibrationManager> {
private:
VibrationManagerEmptyImpl() {}
virtual ~VibrationManagerEmptyImpl() {}
~VibrationManagerEmptyImpl() override {}
};
} // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment