Commit 3a09fd48 authored by Viet-Trung Luu's avatar Viet-Trung Luu

Mojo: Fixes to current virtual/override style in mojo/edk/.

This was mostly done in https://codereview.chromium.org/668663006/, but:
* it missed things deriving from testing::Test for some reason;
* it didn't touch Windows-only files (for more obvious reasons).

R=sky@chromium.org
BUG=417463

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

Cr-Commit-Position: refs/heads/master@{#300502}
parent d94fd1d6
...@@ -102,7 +102,7 @@ class ScopedTestChannel { ...@@ -102,7 +102,7 @@ class ScopedTestChannel {
class EmbedderTest : public testing::Test { class EmbedderTest : public testing::Test {
public: public:
EmbedderTest() : test_io_thread_(base::TestIOThread::kAutoStart) {} EmbedderTest() : test_io_thread_(base::TestIOThread::kAutoStart) {}
virtual ~EmbedderTest() {} ~EmbedderTest() override {}
protected: protected:
base::TestIOThread* test_io_thread() { return &test_io_thread_; } base::TestIOThread* test_io_thread() { return &test_io_thread_; }
......
...@@ -42,16 +42,16 @@ void WaitReadable(PlatformHandle h) { ...@@ -42,16 +42,16 @@ void WaitReadable(PlatformHandle h) {
class PlatformChannelPairPosixTest : public testing::Test { class PlatformChannelPairPosixTest : public testing::Test {
public: public:
PlatformChannelPairPosixTest() {} PlatformChannelPairPosixTest() {}
virtual ~PlatformChannelPairPosixTest() {} ~PlatformChannelPairPosixTest() override {}
virtual void SetUp() override { void SetUp() override {
// Make sure |SIGPIPE| isn't being ignored. // Make sure |SIGPIPE| isn't being ignored.
struct sigaction action = {}; struct sigaction action = {};
action.sa_handler = SIG_DFL; action.sa_handler = SIG_DFL;
ASSERT_EQ(0, sigaction(SIGPIPE, &action, &old_action_)); ASSERT_EQ(0, sigaction(SIGPIPE, &action, &old_action_));
} }
virtual void TearDown() override { void TearDown() override {
// Restore the |SIGPIPE| handler. // Restore the |SIGPIPE| handler.
ASSERT_EQ(0, sigaction(SIGPIPE, &old_action_, nullptr)); ASSERT_EQ(0, sigaction(SIGPIPE, &old_action_, nullptr));
} }
......
...@@ -33,9 +33,9 @@ class ChannelTest : public testing::Test { ...@@ -33,9 +33,9 @@ class ChannelTest : public testing::Test {
ChannelTest() ChannelTest()
: io_thread_(base::TestIOThread::kAutoStart), : io_thread_(base::TestIOThread::kAutoStart),
init_result_(TRISTATE_UNKNOWN) {} init_result_(TRISTATE_UNKNOWN) {}
virtual ~ChannelTest() {} ~ChannelTest() override {}
virtual void SetUp() override { void SetUp() override {
io_thread_.PostTaskAndWait( io_thread_.PostTaskAndWait(
FROM_HERE, FROM_HERE,
base::Bind(&ChannelTest::SetUpOnIOThread, base::Unretained(this))); base::Bind(&ChannelTest::SetUpOnIOThread, base::Unretained(this)));
......
...@@ -25,10 +25,10 @@ class CoreTestBase : public testing::Test { ...@@ -25,10 +25,10 @@ class CoreTestBase : public testing::Test {
typedef CoreTestBase_MockHandleInfo MockHandleInfo; typedef CoreTestBase_MockHandleInfo MockHandleInfo;
CoreTestBase(); CoreTestBase();
virtual ~CoreTestBase(); ~CoreTestBase() override;
virtual void SetUp() override; void SetUp() override;
virtual void TearDown() override; void TearDown() override;
protected: protected:
// |info| must remain alive until the returned handle is closed. // |info| must remain alive until the returned handle is closed.
......
...@@ -99,7 +99,7 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipe ...@@ -99,7 +99,7 @@ class MOJO_SYSTEM_IMPL_EXPORT MessagePipe
MessagePipe(); MessagePipe();
friend class base::RefCountedThreadSafe<MessagePipe>; friend class base::RefCountedThreadSafe<MessagePipe>;
virtual ~MessagePipe(); ~MessagePipe();
// This is used internally by |WriteMessage()| and by |EnqueueMessage()|. // This is used internally by |WriteMessage()| and by |EnqueueMessage()|.
// |transports| may be non-null only if it's nonempty and |message| has no // |transports| may be non-null only if it's nonempty and |message| has no
......
...@@ -49,7 +49,7 @@ class ChannelThread { ...@@ -49,7 +49,7 @@ class ChannelThread {
class MultiprocessMessagePipeTestBase : public testing::Test { class MultiprocessMessagePipeTestBase : public testing::Test {
public: public:
MultiprocessMessagePipeTestBase(); MultiprocessMessagePipeTestBase();
virtual ~MultiprocessMessagePipeTestBase(); ~MultiprocessMessagePipeTestBase() override;
protected: protected:
void Init(scoped_refptr<ChannelEndpoint> ep); void Init(scoped_refptr<ChannelEndpoint> ep);
......
...@@ -73,16 +73,16 @@ bool WriteTestMessageToHandle(const embedder::PlatformHandle& handle, ...@@ -73,16 +73,16 @@ bool WriteTestMessageToHandle(const embedder::PlatformHandle& handle,
class RawChannelTest : public testing::Test { class RawChannelTest : public testing::Test {
public: public:
RawChannelTest() : io_thread_(base::TestIOThread::kManualStart) {} RawChannelTest() : io_thread_(base::TestIOThread::kManualStart) {}
virtual ~RawChannelTest() {} ~RawChannelTest() override {}
virtual void SetUp() override { void SetUp() override {
embedder::PlatformChannelPair channel_pair; embedder::PlatformChannelPair channel_pair;
handles[0] = channel_pair.PassServerHandle(); handles[0] = channel_pair.PassServerHandle();
handles[1] = channel_pair.PassClientHandle(); handles[1] = channel_pair.PassClientHandle();
io_thread_.Start(); io_thread_.Start();
} }
virtual void TearDown() override { void TearDown() override {
io_thread_.Stop(); io_thread_.Stop();
handles[0].reset(); handles[0].reset();
handles[1].reset(); handles[1].reset();
......
...@@ -72,10 +72,10 @@ base::LazyInstance<VistaOrHigherFunctions> g_vista_or_higher_functions = ...@@ -72,10 +72,10 @@ base::LazyInstance<VistaOrHigherFunctions> g_vista_or_higher_functions =
class RawChannelWin : public RawChannel { class RawChannelWin : public RawChannel {
public: public:
RawChannelWin(embedder::ScopedPlatformHandle handle); RawChannelWin(embedder::ScopedPlatformHandle handle);
virtual ~RawChannelWin(); ~RawChannelWin() override;
// |RawChannel| public methods: // |RawChannel| public methods:
virtual size_t GetSerializedPlatformHandleSize() const override; size_t GetSerializedPlatformHandleSize() const override;
private: private:
// RawChannelIOHandler receives OS notifications for I/O completion. It must // RawChannelIOHandler receives OS notifications for I/O completion. It must
...@@ -109,9 +109,9 @@ class RawChannelWin : public RawChannel { ...@@ -109,9 +109,9 @@ class RawChannelWin : public RawChannel {
// |base::MessageLoopForIO::IOHandler| implementation: // |base::MessageLoopForIO::IOHandler| implementation:
// Must be called on the I/O thread. It could be called before or after // Must be called on the I/O thread. It could be called before or after
// detached from the owner. // detached from the owner.
virtual void OnIOCompleted(base::MessageLoopForIO::IOContext* context, void OnIOCompleted(base::MessageLoopForIO::IOContext* context,
DWORD bytes_transferred, DWORD bytes_transferred,
DWORD error) override; DWORD error) override;
// Must be called on the I/O thread under |owner_->write_lock()|. // Must be called on the I/O thread under |owner_->write_lock()|.
// After this call, the owner must not make any further calls on this // After this call, the owner must not make any further calls on this
...@@ -121,7 +121,7 @@ class RawChannelWin : public RawChannel { ...@@ -121,7 +121,7 @@ class RawChannelWin : public RawChannel {
scoped_ptr<WriteBuffer> write_buffer); scoped_ptr<WriteBuffer> write_buffer);
private: private:
virtual ~RawChannelIOHandler(); ~RawChannelIOHandler() override;
// Returns true if |owner_| has been reset and there is not pending read or // Returns true if |owner_| has been reset and there is not pending read or
// write. // write.
...@@ -160,17 +160,17 @@ class RawChannelWin : public RawChannel { ...@@ -160,17 +160,17 @@ class RawChannelWin : public RawChannel {
}; };
// |RawChannel| private methods: // |RawChannel| private methods:
virtual IOResult Read(size_t* bytes_read) override; IOResult Read(size_t* bytes_read) override;
virtual IOResult ScheduleRead() override; IOResult ScheduleRead() override;
virtual embedder::ScopedPlatformHandleVectorPtr GetReadPlatformHandles( embedder::ScopedPlatformHandleVectorPtr GetReadPlatformHandles(
size_t num_platform_handles, size_t num_platform_handles,
const void* platform_handle_table) override; const void* platform_handle_table) override;
virtual IOResult WriteNoLock(size_t* platform_handles_written, IOResult WriteNoLock(size_t* platform_handles_written,
size_t* bytes_written) override; size_t* bytes_written) override;
virtual IOResult ScheduleWriteNoLock() override; IOResult ScheduleWriteNoLock() override;
virtual bool OnInit() override; bool OnInit() override;
virtual void OnShutdownNoLock(scoped_ptr<ReadBuffer> read_buffer, void OnShutdownNoLock(scoped_ptr<ReadBuffer> read_buffer,
scoped_ptr<WriteBuffer> write_buffer) override; scoped_ptr<WriteBuffer> write_buffer) override;
// Passed to |io_handler_| during initialization. // Passed to |io_handler_| during initialization.
embedder::ScopedPlatformHandle handle_; embedder::ScopedPlatformHandle handle_;
......
...@@ -44,16 +44,16 @@ namespace { ...@@ -44,16 +44,16 @@ namespace {
class RemoteMessagePipeTest : public testing::Test { class RemoteMessagePipeTest : public testing::Test {
public: public:
RemoteMessagePipeTest() : io_thread_(base::TestIOThread::kAutoStart) {} RemoteMessagePipeTest() : io_thread_(base::TestIOThread::kAutoStart) {}
virtual ~RemoteMessagePipeTest() {} ~RemoteMessagePipeTest() override {}
virtual void SetUp() override { void SetUp() override {
io_thread_.PostTaskAndWait( io_thread_.PostTaskAndWait(
FROM_HERE, FROM_HERE,
base::Bind(&RemoteMessagePipeTest::SetUpOnIOThread, base::Bind(&RemoteMessagePipeTest::SetUpOnIOThread,
base::Unretained(this))); base::Unretained(this)));
} }
virtual void TearDown() override { void TearDown() override {
io_thread_.PostTaskAndWait( io_thread_.PostTaskAndWait(
FROM_HERE, FROM_HERE,
base::Bind(&RemoteMessagePipeTest::TearDownOnIOThread, base::Bind(&RemoteMessagePipeTest::TearDownOnIOThread,
......
...@@ -43,7 +43,7 @@ void RevalidateCreateOptions( ...@@ -43,7 +43,7 @@ void RevalidateCreateOptions(
class SharedBufferDispatcherTest : public testing::Test { class SharedBufferDispatcherTest : public testing::Test {
public: public:
SharedBufferDispatcherTest() {} SharedBufferDispatcherTest() {}
virtual ~SharedBufferDispatcherTest() {} ~SharedBufferDispatcherTest() override {}
embedder::PlatformSupport* platform_support() { return &platform_support_; } embedder::PlatformSupport* platform_support() { return &platform_support_; }
......
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