Skip to content

Commit

Permalink
Standardize usage of virtual/override/final in ipc/
Browse files Browse the repository at this point in the history
This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree.

BUG=417463
TBR=agl@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#300481}
  • Loading branch information
zetafunction authored and Commit bot committed Oct 21, 2014
1 parent f85fa22 commit 39be52e
Show file tree
Hide file tree
Showing 30 changed files with 241 additions and 275 deletions.
3 changes: 1 addition & 2 deletions ipc/ipc_channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ class IPC_EXPORT Channel : public Sender {
static scoped_ptr<Channel> CreateServer(
const IPC::ChannelHandle &channel_handle, Listener* listener);


virtual ~Channel();
~Channel() override;

// Connect the pipe. On the server side, this will initiate
// waiting for connections. On the client, it attempts to
Expand Down
7 changes: 2 additions & 5 deletions ipc/ipc_channel_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ class PlatformChannelFactory : public ChannelFactory {
: handle_(handle), mode_(mode) {
}

virtual std::string GetName() const override {
return handle_.name;
}
std::string GetName() const override { return handle_.name; }

virtual scoped_ptr<Channel> BuildChannel(
Listener* listener) override {
scoped_ptr<Channel> BuildChannel(Listener* listener) override {
return Channel::Create(handle_, mode_, listener);
}

Expand Down
30 changes: 14 additions & 16 deletions ipc/ipc_channel_posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ class IPC_EXPORT ChannelPosix : public Channel,
public:
ChannelPosix(const IPC::ChannelHandle& channel_handle, Mode mode,
Listener* listener);
virtual ~ChannelPosix();
~ChannelPosix() override;

// Channel implementation
virtual bool Connect() override;
virtual void Close() override;
virtual bool Send(Message* message) override;
virtual base::ProcessId GetPeerPID() const override;
virtual base::ProcessId GetSelfPID() const override;
virtual int GetClientFileDescriptor() const override;
virtual base::ScopedFD TakeClientFileDescriptor() override;
bool Connect() override;
void Close() override;
bool Send(Message* message) override;
base::ProcessId GetPeerPID() const override;
base::ProcessId GetSelfPID() const override;
int GetClientFileDescriptor() const override;
base::ScopedFD TakeClientFileDescriptor() override;

// Returns true if the channel supports listening for connections.
bool AcceptsConnections() const;
Expand Down Expand Up @@ -102,12 +102,10 @@ class IPC_EXPORT ChannelPosix : public Channel,
void QueueCloseFDMessage(int fd, int hops);

// ChannelReader implementation.
virtual ReadState ReadData(char* buffer,
int buffer_len,
int* bytes_read) override;
virtual bool WillDispatchInputMessage(Message* msg) override;
virtual bool DidEmptyInputBuffers() override;
virtual void HandleInternalMessage(const Message& msg) override;
ReadState ReadData(char* buffer, int buffer_len, int* bytes_read) override;
bool WillDispatchInputMessage(Message* msg) override;
bool DidEmptyInputBuffers() override;
void HandleInternalMessage(const Message& msg) override;

#if defined(IPC_USES_READWRITE)
// Reads the next message from the fd_pipe_ and appends them to the
Expand All @@ -129,8 +127,8 @@ class IPC_EXPORT ChannelPosix : public Channel,
void ClearInputFDs();

// MessageLoopForIO::Watcher implementation.
virtual void OnFileCanReadWithoutBlocking(int fd) override;
virtual void OnFileCanWriteWithoutBlocking(int fd) override;
void OnFileCanReadWithoutBlocking(int fd) override;
void OnFileCanWriteWithoutBlocking(int fd) override;

Mode mode_;

Expand Down
12 changes: 6 additions & 6 deletions ipc/ipc_channel_posix_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,35 +45,35 @@ class IPCChannelPosixTestListener : public IPC::Listener {
quit_only_on_message_(quit_only_on_message) {
}

virtual ~IPCChannelPosixTestListener() {}
~IPCChannelPosixTestListener() override {}

virtual bool OnMessageReceived(const IPC::Message& message) override {
bool OnMessageReceived(const IPC::Message& message) override {
EXPECT_EQ(message.type(), kQuitMessage);
status_ = MESSAGE_RECEIVED;
QuitRunLoop();
return true;
}

virtual void OnChannelConnected(int32 peer_pid) override {
void OnChannelConnected(int32 peer_pid) override {
status_ = CONNECTED;
if (!quit_only_on_message_) {
QuitRunLoop();
}
}

virtual void OnChannelError() override {
void OnChannelError() override {
status_ = CHANNEL_ERROR;
QuitRunLoop();
}

virtual void OnChannelDenied() override {
void OnChannelDenied() override {
status_ = DENIED;
if (!quit_only_on_message_) {
QuitRunLoop();
}
}

virtual void OnChannelListenError() override {
void OnChannelListenError() override {
status_ = LISTEN_ERROR;
if (!quit_only_on_message_) {
QuitRunLoop();
Expand Down
12 changes: 6 additions & 6 deletions ipc/ipc_channel_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner);

virtual ~ChannelProxy();
~ChannelProxy() override;

// Initializes the channel proxy. Only call this once to initialize a channel
// proxy that was not initialized in its constructor. If create_pipe_now is
Expand All @@ -98,7 +98,7 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {

// Send a message asynchronously. The message is routed to the background
// thread where it is passed to the IPC::Channel's Send method.
virtual bool Send(Message* message) override;
bool Send(Message* message) override;

// Used to intercept messages as they are received on the background thread.
//
Expand Down Expand Up @@ -152,12 +152,12 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {

protected:
friend class base::RefCountedThreadSafe<Context>;
virtual ~Context();
~Context() override;

// IPC::Listener methods:
virtual bool OnMessageReceived(const Message& message) override;
virtual void OnChannelConnected(int32 peer_pid) override;
virtual void OnChannelError() override;
bool OnMessageReceived(const Message& message) override;
void OnChannelConnected(int32 peer_pid) override;
void OnChannelError() override;

// Like OnMessageReceived but doesn't try the filters.
bool OnMessageReceivedNoFilter(const Message& message);
Expand Down
26 changes: 13 additions & 13 deletions ipc/ipc_channel_proxy_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ namespace {
class QuitListener : public IPC::Listener {
public:
QuitListener() : bad_message_received_(false) {}
virtual ~QuitListener() {}
~QuitListener() override {}

virtual bool OnMessageReceived(const IPC::Message& message) override {
bool OnMessageReceived(const IPC::Message& message) override {
IPC_BEGIN_MESSAGE_MAP(QuitListener, message)
IPC_MESSAGE_HANDLER(WorkerMsg_Quit, OnQuit)
IPC_MESSAGE_HANDLER(TestMsg_BadMessage, OnBadMessage)
IPC_END_MESSAGE_MAP()
return true;
}

virtual void OnBadMessageReceived(const IPC::Message& message) override {
void OnBadMessageReceived(const IPC::Message& message) override {
bad_message_received_ = true;
}

Expand All @@ -76,14 +76,14 @@ class QuitListener : public IPC::Listener {
class ChannelReflectorListener : public IPC::Listener {
public:
ChannelReflectorListener() : channel_(NULL) {}
virtual ~ChannelReflectorListener() {}
~ChannelReflectorListener() override {}

void Init(IPC::Channel* channel) {
DCHECK(!channel_);
channel_ = channel;
}

virtual bool OnMessageReceived(const IPC::Message& message) override {
bool OnMessageReceived(const IPC::Message& message) override {
IPC_BEGIN_MESSAGE_MAP(ChannelReflectorListener, message)
IPC_MESSAGE_HANDLER(TestMsg_Bounce, OnTestBounce)
IPC_MESSAGE_HANDLER(TestMsg_SendBadMessage, OnSendBadMessage)
Expand Down Expand Up @@ -143,32 +143,32 @@ class MessageCountFilter : public IPC::MessageFilter {
last_filter_event_(NONE),
message_filtering_enabled_(false) {}

virtual void OnFilterAdded(IPC::Sender* sender) override {
void OnFilterAdded(IPC::Sender* sender) override {
EXPECT_TRUE(sender);
EXPECT_EQ(NONE, last_filter_event_);
last_filter_event_ = FILTER_ADDED;
}

virtual void OnChannelConnected(int32_t peer_pid) override {
void OnChannelConnected(int32_t peer_pid) override {
EXPECT_EQ(FILTER_ADDED, last_filter_event_);
EXPECT_NE(static_cast<int32_t>(base::kNullProcessId), peer_pid);
last_filter_event_ = CHANNEL_CONNECTED;
}

virtual void OnChannelError() override {
void OnChannelError() override {
EXPECT_EQ(CHANNEL_CONNECTED, last_filter_event_);
last_filter_event_ = CHANNEL_ERROR;
}

virtual void OnChannelClosing() override {
void OnChannelClosing() override {
// We may or may not have gotten OnChannelError; if not, the last event has
// to be OnChannelConnected.
if (last_filter_event_ != CHANNEL_ERROR)
EXPECT_EQ(CHANNEL_CONNECTED, last_filter_event_);
last_filter_event_ = CHANNEL_CLOSING;
}

virtual void OnFilterRemoved() override {
void OnFilterRemoved() override {
// If the channel didn't get a chance to connect, we might see the
// OnFilterRemoved event with no other events preceding it. We still want
// OnFilterRemoved to be called to allow for deleting the Filter.
Expand All @@ -177,7 +177,7 @@ class MessageCountFilter : public IPC::MessageFilter {
last_filter_event_ = FILTER_REMOVED;
}

virtual bool OnMessageReceived(const IPC::Message& message) override {
bool OnMessageReceived(const IPC::Message& message) override {
// We should always get the OnFilterAdded and OnChannelConnected events
// prior to any messages.
EXPECT_EQ(CHANNEL_CONNECTED, last_filter_event_);
Expand All @@ -203,7 +203,7 @@ class MessageCountFilter : public IPC::MessageFilter {
CHECK(false);
}

virtual bool GetSupportedMessageClasses(
bool GetSupportedMessageClasses(
std::vector<uint32>* supported_message_classes) const override {
if (is_global_filter_)
return false;
Expand All @@ -219,7 +219,7 @@ class MessageCountFilter : public IPC::MessageFilter {
FilterEvent last_filter_event() const { return last_filter_event_; }

private:
virtual ~MessageCountFilter() {}
~MessageCountFilter() override {}

size_t messages_received_;
uint32 supported_message_class_;
Expand Down
6 changes: 2 additions & 4 deletions ipc/ipc_channel_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,9 @@ TEST_F(IPCChannelTest, ChannelProxyTest) {
class ChannelListenerWithOnConnectedSend : public IPC::TestChannelListener {
public:
ChannelListenerWithOnConnectedSend() {}
virtual ~ChannelListenerWithOnConnectedSend() {}
~ChannelListenerWithOnConnectedSend() override {}

virtual void OnChannelConnected(int32 peer_pid) override {
SendNextMessage();
}
void OnChannelConnected(int32 peer_pid) override { SendNextMessage(); }
};

#if defined(OS_WIN)
Expand Down
4 changes: 2 additions & 2 deletions ipc/ipc_forwarding_message_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ class IPC_EXPORT ForwardingMessageFilter : public MessageFilter {
void RemoveRoute(int routing_id);

// MessageFilter methods:
virtual bool OnMessageReceived(const Message& message) override;
bool OnMessageReceived(const Message& message) override;

private:
virtual ~ForwardingMessageFilter();
~ForwardingMessageFilter() override;

std::set<int> message_ids_to_filter_;

Expand Down
4 changes: 2 additions & 2 deletions ipc/ipc_fuzzing_tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class FuzzerServerListener : public SimpleListener {
public:
FuzzerServerListener() : message_count_(2), pending_messages_(0) {
}
virtual bool OnMessageReceived(const IPC::Message& msg) override {
bool OnMessageReceived(const IPC::Message& msg) override {
if (msg.routing_id() == MSG_ROUTING_CONTROL) {
++pending_messages_;
IPC_BEGIN_MESSAGE_MAP(FuzzerServerListener, msg)
Expand Down Expand Up @@ -199,7 +199,7 @@ class FuzzerClientListener : public SimpleListener {
FuzzerClientListener() : last_msg_(NULL) {
}

virtual bool OnMessageReceived(const IPC::Message& msg) override {
bool OnMessageReceived(const IPC::Message& msg) override {
last_msg_ = new IPC::Message(msg);
base::MessageLoop::current()->Quit();
return true;
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipc_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class IPC_EXPORT Message : public Pickle {
HAS_SENT_TIME_BIT = 0x80,
};

virtual ~Message();
~Message() override;

Message();

Expand Down
Loading

0 comments on commit 39be52e

Please sign in to comment.