Standardize usage of virtual/override/final in ipc/

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
R=agl@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#300623}


CrOS-Libchrome-Original-Commit: fe61fca6faca13c54768ee131dc79c8e06421097
diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc
index cefa29e..07218c6 100644
--- a/ipc/mojo/ipc_channel_mojo_unittest.cc
+++ b/ipc/mojo/ipc_channel_mojo_unittest.cc
@@ -27,9 +27,9 @@
   ListenerThatExpectsOK()
       : received_ok_(false) {}
 
-  virtual ~ListenerThatExpectsOK() {}
+  ~ListenerThatExpectsOK() override {}
 
-  virtual bool OnMessageReceived(const IPC::Message& message) override {
+  bool OnMessageReceived(const IPC::Message& message) override {
     PickleIterator iter(message);
     std::string should_be_ok;
     EXPECT_TRUE(iter.ReadString(&should_be_ok));
@@ -39,7 +39,7 @@
     return true;
   }
 
-  virtual void OnChannelError() override {
+  void OnChannelError() override {
     // The connection should be healthy while the listener is waiting
     // message.  An error can occur after that because the peer
     // process dies.
@@ -79,7 +79,7 @@
 
 class IPCChannelMojoTest : public IPCTestBase {
  protected:
-  virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory(
+  scoped_ptr<IPC::ChannelFactory> CreateChannelFactory(
       const IPC::ChannelHandle& handle,
       base::TaskRunner* runner) override {
     host_.reset(new IPC::ChannelMojoHost(task_runner()));
@@ -87,7 +87,7 @@
                                                  handle);
   }
 
-  virtual bool DidStartClient() override {
+  bool DidStartClient() override {
     bool ok = IPCTestBase::DidStartClient();
     DCHECK(ok);
     host_->OnClientLaunched(client_process());
@@ -106,7 +106,7 @@
       : is_connected_called_(false) {
   }
 
-  virtual void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32 peer_pid) override {
     IPC::TestChannelListener::OnChannelConnected(peer_pid);
     EXPECT_TRUE(base::kNullProcessId != peer_pid);
     is_connected_called_ = true;
@@ -165,15 +165,13 @@
       : has_error_(false) {
   }
 
-  virtual void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32 peer_pid) override {
     base::MessageLoop::current()->Quit();
   }
 
-  virtual bool OnMessageReceived(const IPC::Message& message) override {
-    return true;
-  }
+  bool OnMessageReceived(const IPC::Message& message) override { return true; }
 
-  virtual void OnChannelError() override {
+  void OnChannelError() override {
     has_error_ = true;
     base::MessageLoop::current()->Quit();
   }
@@ -187,7 +185,7 @@
 
 class IPCChannelMojoErrorTest : public IPCTestBase {
  protected:
-  virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory(
+  scoped_ptr<IPC::ChannelFactory> CreateChannelFactory(
       const IPC::ChannelHandle& handle,
       base::TaskRunner* runner) override {
     host_.reset(new IPC::ChannelMojoHost(task_runner()));
@@ -195,7 +193,7 @@
                                                  handle);
   }
 
-  virtual bool DidStartClient() override {
+  bool DidStartClient() override {
     bool ok = IPCTestBase::DidStartClient();
     DCHECK(ok);
     host_->OnClientLaunched(client_process());
@@ -211,11 +209,11 @@
   ListenerThatQuits() {
   }
 
-  virtual bool OnMessageReceived(const IPC::Message& message) override {
+  bool OnMessageReceived(const IPC::Message& message) override {
     return true;
   }
 
-  virtual void OnChannelConnected(int32 peer_pid) override {
+  void OnChannelConnected(int32 peer_pid) override {
     base::MessageLoop::current()->Quit();
   }
 };
@@ -324,9 +322,9 @@
   ListenerThatExpectsFile()
       : sender_(NULL) {}
 
-  virtual ~ListenerThatExpectsFile() {}
+  ~ListenerThatExpectsFile() override {}
 
-  virtual bool OnMessageReceived(const IPC::Message& message) override {
+  bool OnMessageReceived(const IPC::Message& message) override {
     PickleIterator iter(message);
 
     base::ScopedFD fd;
@@ -340,7 +338,7 @@
     return true;
   }
 
-  virtual void OnChannelError() override {
+  void OnChannelError() override {
     NOTREACHED();
   }