diff options
Diffstat (limited to 'ipc/mojo')
-rw-r--r-- | ipc/mojo/ipc_channel_mojo.cc | 6 | ||||
-rw-r--r-- | ipc/mojo/ipc_channel_mojo.h | 21 | ||||
-rw-r--r-- | ipc/mojo/ipc_channel_mojo_host.cc | 8 | ||||
-rw-r--r-- | ipc/mojo/ipc_channel_mojo_readers.h | 18 | ||||
-rw-r--r-- | ipc/mojo/ipc_channel_mojo_unittest.cc | 38 | ||||
-rw-r--r-- | ipc/mojo/ipc_mojo_bootstrap.cc | 12 | ||||
-rw-r--r-- | ipc/mojo/ipc_mojo_bootstrap.h | 6 | ||||
-rw-r--r-- | ipc/mojo/ipc_mojo_bootstrap_unittest.cc | 5 | ||||
-rw-r--r-- | ipc/mojo/ipc_mojo_perftest.cc | 7 |
9 files changed, 66 insertions, 55 deletions
diff --git a/ipc/mojo/ipc_channel_mojo.cc b/ipc/mojo/ipc_channel_mojo.cc index a93adf1..a5663411 100644 --- a/ipc/mojo/ipc_channel_mojo.cc +++ b/ipc/mojo/ipc_channel_mojo.cc @@ -27,9 +27,11 @@ class MojoChannelFactory : public ChannelFactory { Channel::Mode mode) : delegate_(delegate), channel_handle_(channel_handle), mode_(mode) {} - std::string GetName() const override { return channel_handle_.name; } + virtual std::string GetName() const override { + return channel_handle_.name; + } - scoped_ptr<Channel> BuildChannel(Listener* listener) override { + virtual scoped_ptr<Channel> BuildChannel(Listener* listener) override { return ChannelMojo::Create(delegate_, channel_handle_, mode_, listener); } diff --git a/ipc/mojo/ipc_channel_mojo.h b/ipc/mojo/ipc_channel_mojo.h index e5a4e33..b307fd4 100644 --- a/ipc/mojo/ipc_channel_mojo.h +++ b/ipc/mojo/ipc_channel_mojo.h @@ -87,21 +87,21 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel, static scoped_ptr<ChannelFactory> CreateClientFactory( const ChannelHandle& channel_handle); - ~ChannelMojo() override; + virtual ~ChannelMojo(); // ChannelMojoHost tells the client handle using this API. void OnClientLaunched(base::ProcessHandle handle); // Channel implementation - bool Connect() override; - void Close() override; - bool Send(Message* message) override; - base::ProcessId GetPeerPID() const override; - base::ProcessId GetSelfPID() const override; + 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; #if defined(OS_POSIX) && !defined(OS_NACL) - int GetClientFileDescriptor() const override; - base::ScopedFD TakeClientFileDescriptor() override; + virtual int GetClientFileDescriptor() const override; + virtual base::ScopedFD TakeClientFileDescriptor() override; // These access protected API of IPC::Message, which has ChannelMojo // as a friend class. @@ -114,8 +114,9 @@ class IPC_MOJO_EXPORT ChannelMojo : public Channel, #endif // defined(OS_POSIX) && !defined(OS_NACL) // MojoBootstrapDelegate implementation - void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle) override; - void OnBootstrapError() override; + virtual void OnPipeAvailable( + mojo::embedder::ScopedPlatformHandle handle) override; + virtual void OnBootstrapError() override; // Called from MessagePipeReader implementations void OnMessageReceived(Message& message); diff --git a/ipc/mojo/ipc_channel_mojo_host.cc b/ipc/mojo/ipc_channel_mojo_host.cc index beb18ee..6f9075a 100644 --- a/ipc/mojo/ipc_channel_mojo_host.cc +++ b/ipc/mojo/ipc_channel_mojo_host.cc @@ -17,12 +17,12 @@ namespace IPC { class ChannelMojoHost::ChannelDelegate : public ChannelMojo::Delegate { public: explicit ChannelDelegate(scoped_refptr<base::TaskRunner> io_task_runner); - ~ChannelDelegate() override; + virtual ~ChannelDelegate(); // ChannelMojo::Delegate - base::WeakPtr<Delegate> ToWeakPtr() override; - void OnChannelCreated(base::WeakPtr<ChannelMojo> channel) override; - scoped_refptr<base::TaskRunner> GetIOTaskRunner() override; + virtual base::WeakPtr<Delegate> ToWeakPtr() override; + virtual void OnChannelCreated(base::WeakPtr<ChannelMojo> channel) override; + virtual scoped_refptr<base::TaskRunner> GetIOTaskRunner() override; // Returns an weak ptr of ChannelDelegate instead of Delegate base::WeakPtr<ChannelDelegate> GetWeakPtr(); diff --git a/ipc/mojo/ipc_channel_mojo_readers.h b/ipc/mojo/ipc_channel_mojo_readers.h index cadf453c..fae62ad 100644 --- a/ipc/mojo/ipc_channel_mojo_readers.h +++ b/ipc/mojo/ipc_channel_mojo_readers.h @@ -33,9 +33,9 @@ class MessageReader : public MessagePipeReader { bool Send(scoped_ptr<Message> message); // MessagePipeReader implementation - void OnMessageReceived() override; - void OnPipeClosed() override; - void OnPipeError(MojoResult error) override; + virtual void OnMessageReceived() override; + virtual void OnPipeClosed() override; + virtual void OnPipeError(MojoResult error) override; private: ChannelMojo* owner_; @@ -52,8 +52,8 @@ class ControlReader : public MessagePipeReader { virtual bool Connect(); // MessagePipeReader implementation - void OnPipeClosed() override; - void OnPipeError(MojoResult error) override; + virtual void OnPipeClosed() override; + virtual void OnPipeError(MojoResult error) override; protected: ChannelMojo* owner_; @@ -65,13 +65,13 @@ class ControlReader : public MessagePipeReader { class ServerControlReader : public ControlReader { public: ServerControlReader(mojo::ScopedMessagePipeHandle pipe, ChannelMojo* owner); - ~ServerControlReader() override; + virtual ~ServerControlReader(); // ControlReader override - bool Connect() override; + virtual bool Connect() override; // MessagePipeReader implementation - void OnMessageReceived() override; + virtual void OnMessageReceived() override; private: MojoResult SendHelloRequest(); @@ -88,7 +88,7 @@ class ClientControlReader : public ControlReader { ClientControlReader(mojo::ScopedMessagePipeHandle pipe, ChannelMojo* owner); // MessagePipeReader implementation - void OnMessageReceived() override; + virtual void OnMessageReceived() override; private: MojoResult RespondHelloRequest(MojoHandle message_channel); diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc index 1697ff7..cefa29e 100644 --- a/ipc/mojo/ipc_channel_mojo_unittest.cc +++ b/ipc/mojo/ipc_channel_mojo_unittest.cc @@ -27,9 +27,9 @@ class ListenerThatExpectsOK : public IPC::Listener { ListenerThatExpectsOK() : received_ok_(false) {} - ~ListenerThatExpectsOK() override {} + virtual ~ListenerThatExpectsOK() {} - bool OnMessageReceived(const IPC::Message& message) override { + virtual 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 @@ class ListenerThatExpectsOK : public IPC::Listener { return true; } - void OnChannelError() override { + virtual 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 ChannelClient { class IPCChannelMojoTest : public IPCTestBase { protected: - scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( + virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( const IPC::ChannelHandle& handle, base::TaskRunner* runner) override { host_.reset(new IPC::ChannelMojoHost(task_runner())); @@ -87,7 +87,7 @@ class IPCChannelMojoTest : public IPCTestBase { handle); } - bool DidStartClient() override { + virtual bool DidStartClient() override { bool ok = IPCTestBase::DidStartClient(); DCHECK(ok); host_->OnClientLaunched(client_process()); @@ -106,7 +106,7 @@ class TestChannelListenerWithExtraExpectations : is_connected_called_(false) { } - void OnChannelConnected(int32 peer_pid) override { + virtual void OnChannelConnected(int32 peer_pid) override { IPC::TestChannelListener::OnChannelConnected(peer_pid); EXPECT_TRUE(base::kNullProcessId != peer_pid); is_connected_called_ = true; @@ -165,13 +165,15 @@ class ListenerExpectingErrors : public IPC::Listener { : has_error_(false) { } - void OnChannelConnected(int32 peer_pid) override { + virtual void OnChannelConnected(int32 peer_pid) override { base::MessageLoop::current()->Quit(); } - bool OnMessageReceived(const IPC::Message& message) override { return true; } + virtual bool OnMessageReceived(const IPC::Message& message) override { + return true; + } - void OnChannelError() override { + virtual void OnChannelError() override { has_error_ = true; base::MessageLoop::current()->Quit(); } @@ -185,7 +187,7 @@ class ListenerExpectingErrors : public IPC::Listener { class IPCChannelMojoErrorTest : public IPCTestBase { protected: - scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( + virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( const IPC::ChannelHandle& handle, base::TaskRunner* runner) override { host_.reset(new IPC::ChannelMojoHost(task_runner())); @@ -193,7 +195,7 @@ class IPCChannelMojoErrorTest : public IPCTestBase { handle); } - bool DidStartClient() override { + virtual bool DidStartClient() override { bool ok = IPCTestBase::DidStartClient(); DCHECK(ok); host_->OnClientLaunched(client_process()); @@ -209,9 +211,11 @@ class ListenerThatQuits : public IPC::Listener { ListenerThatQuits() { } - bool OnMessageReceived(const IPC::Message& message) override { return true; } + virtual bool OnMessageReceived(const IPC::Message& message) override { + return true; + } - void OnChannelConnected(int32 peer_pid) override { + virtual void OnChannelConnected(int32 peer_pid) override { base::MessageLoop::current()->Quit(); } }; @@ -320,9 +324,9 @@ class ListenerThatExpectsFile : public IPC::Listener { ListenerThatExpectsFile() : sender_(NULL) {} - ~ListenerThatExpectsFile() override {} + virtual ~ListenerThatExpectsFile() {} - bool OnMessageReceived(const IPC::Message& message) override { + virtual bool OnMessageReceived(const IPC::Message& message) override { PickleIterator iter(message); base::ScopedFD fd; @@ -336,7 +340,9 @@ class ListenerThatExpectsFile : public IPC::Listener { return true; } - void OnChannelError() override { NOTREACHED(); } + virtual void OnChannelError() override { + NOTREACHED(); + } static std::string GetSendingFileContent() { return "Hello"; diff --git a/ipc/mojo/ipc_mojo_bootstrap.cc b/ipc/mojo/ipc_mojo_bootstrap.cc index 7458265..7233de0 100644 --- a/ipc/mojo/ipc_mojo_bootstrap.cc +++ b/ipc/mojo/ipc_mojo_bootstrap.cc @@ -20,15 +20,15 @@ class MojoServerBootstrap : public MojoBootstrap { public: MojoServerBootstrap(); - void OnClientLaunched(base::ProcessHandle process) override; + virtual void OnClientLaunched(base::ProcessHandle process) override; private: void SendClientPipe(); void SendClientPipeIfReady(); // Listener implementations - bool OnMessageReceived(const Message& message) override; - void OnChannelConnected(int32 peer_pid) override; + virtual bool OnMessageReceived(const Message& message) override; + virtual void OnChannelConnected(int32 peer_pid) override; mojo::embedder::ScopedPlatformHandle server_pipe_; base::ProcessHandle client_process_; @@ -112,12 +112,12 @@ class MojoClientBootstrap : public MojoBootstrap { public: MojoClientBootstrap(); - void OnClientLaunched(base::ProcessHandle process) override; + virtual void OnClientLaunched(base::ProcessHandle process) override; private: // Listener implementations - bool OnMessageReceived(const Message& message) override; - void OnChannelConnected(int32 peer_pid) override; + virtual bool OnMessageReceived(const Message& message) override; + virtual void OnChannelConnected(int32 peer_pid) override; DISALLOW_COPY_AND_ASSIGN(MojoClientBootstrap); }; diff --git a/ipc/mojo/ipc_mojo_bootstrap.h b/ipc/mojo/ipc_mojo_bootstrap.h index 0d007dd..540becf 100644 --- a/ipc/mojo/ipc_mojo_bootstrap.h +++ b/ipc/mojo/ipc_mojo_bootstrap.h @@ -41,7 +41,7 @@ class IPC_MOJO_EXPORT MojoBootstrap : public Listener { Delegate* delegate); MojoBootstrap(); - ~MojoBootstrap() override; + virtual ~MojoBootstrap(); // Start the handshake over the underlying platform channel. bool Connect(); @@ -68,8 +68,8 @@ class IPC_MOJO_EXPORT MojoBootstrap : public Listener { void Init(scoped_ptr<Channel> channel, Delegate* delegate); // Listener implementations - void OnBadMessageReceived(const Message& message) override; - void OnChannelError() override; + virtual void OnBadMessageReceived(const Message& message) override; + virtual void OnChannelError() override; scoped_ptr<Channel> channel_; Delegate* delegate_; diff --git a/ipc/mojo/ipc_mojo_bootstrap_unittest.cc b/ipc/mojo/ipc_mojo_bootstrap_unittest.cc index a071d66..8bffd88 100644 --- a/ipc/mojo/ipc_mojo_bootstrap_unittest.cc +++ b/ipc/mojo/ipc_mojo_bootstrap_unittest.cc @@ -23,8 +23,9 @@ class TestingDelegate : public IPC::MojoBootstrap::Delegate { public: TestingDelegate() : passed_(false) {} - void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle) override; - void OnBootstrapError() override; + virtual void OnPipeAvailable( + mojo::embedder::ScopedPlatformHandle handle) override; + virtual void OnBootstrapError() override; bool passed() const { return passed_; } diff --git a/ipc/mojo/ipc_mojo_perftest.cc b/ipc/mojo/ipc_mojo_perftest.cc index 29e7839..dca405e 100644 --- a/ipc/mojo/ipc_mojo_perftest.cc +++ b/ipc/mojo/ipc_mojo_perftest.cc @@ -29,7 +29,7 @@ public: MojoChannelPerfTest(); - scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( + virtual scoped_ptr<IPC::ChannelFactory> CreateChannelFactory( const IPC::ChannelHandle& handle, base::TaskRunner* runner) override { host_.reset(new IPC::ChannelMojoHost(task_runner())); @@ -37,7 +37,7 @@ public: handle); } - bool DidStartClient() override { + virtual bool DidStartClient() override { bool ok = IPCTestBase::DidStartClient(); DCHECK(ok); host_->OnClientLaunched(client_process()); @@ -73,7 +73,8 @@ class MojoTestClient : public IPC::test::PingPongTestClient { MojoTestClient(); - scoped_ptr<IPC::Channel> CreateChannel(IPC::Listener* listener) override; + virtual scoped_ptr<IPC::Channel> CreateChannel( + IPC::Listener* listener) override; }; MojoTestClient::MojoTestClient() { |