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
[email protected]
Review URL: https://codereview.chromium.org/666493005
Cr-Commit-Position: refs/heads/master@{#300623}
diff --git a/ipc/ipc_sync_channel.h b/ipc/ipc_sync_channel.h
index 3f62d2f..3593485 100644
--- a/ipc/ipc_sync_channel.h
+++ b/ipc/ipc_sync_channel.h
@@ -91,9 +91,9 @@
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
base::WaitableEvent* shutdown_event);
- virtual ~SyncChannel();
+ ~SyncChannel() override;
- virtual bool Send(Message* message) override;
+ bool Send(Message* message) override;
// Sets the dispatch group for this channel, to only allow re-entrant dispatch
// of messages to other channels in the same group.
@@ -170,17 +170,17 @@
base::WaitableEventWatcher::EventCallback MakeWaitableEventCallback();
private:
- virtual ~SyncContext();
+ ~SyncContext() override;
// ChannelProxy methods that we override.
// Called on the listener thread.
- virtual void Clear() override;
+ void Clear() override;
// Called on the IPC thread.
- virtual bool OnMessageReceived(const Message& msg) override;
- virtual void OnChannelError() override;
- virtual void OnChannelOpened() override;
- virtual void OnChannelClosed() override;
+ bool OnMessageReceived(const Message& msg) override;
+ void OnChannelError() override;
+ void OnChannelOpened() override;
+ void OnChannelClosed() override;
// Cancels all pending Send calls.
void CancelPendingSends();