diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 22:43:53 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-23 22:43:53 +0000 |
commit | dec76e804867ced17b032571f440adf4945c4d99 (patch) | |
tree | fd798a848d7967b28d89350a55f48285057e2739 /ipc | |
parent | 0695ef4d095a441148ae80a08576c25c2ab8bc40 (diff) | |
download | chromium_src-dec76e804867ced17b032571f440adf4945c4d99.zip chromium_src-dec76e804867ced17b032571f440adf4945c4d99.tar.gz chromium_src-dec76e804867ced17b032571f440adf4945c4d99.tar.bz2 |
FBTF: Move virtual methods to implementation files.
Remove logging.h and other headers where possible.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3461019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60369 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_channel_proxy.cc | 26 | ||||
-rw-r--r-- | ipc/ipc_channel_proxy.h | 24 |
2 files changed, 35 insertions, 15 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc index ddf1ec8..903a71d 100644 --- a/ipc/ipc_channel_proxy.cc +++ b/ipc/ipc_channel_proxy.cc @@ -36,6 +36,28 @@ class SendTask : public Task { //------------------------------------------------------------------------------ +ChannelProxy::MessageFilter::~MessageFilter() {} + +void ChannelProxy::MessageFilter::OnFilterAdded(Channel* channel) {} + +void ChannelProxy::MessageFilter::OnFilterRemoved() {} + +void ChannelProxy::MessageFilter::OnChannelConnected(int32 peer_pid) {} + +void ChannelProxy::MessageFilter::OnChannelError() {} + +void ChannelProxy::MessageFilter::OnChannelClosing() {} + +bool ChannelProxy::MessageFilter::OnMessageReceived(const Message& message) { + return false; +} + +void ChannelProxy::MessageFilter::OnDestruct() { + delete this; +} + +//------------------------------------------------------------------------------ + ChannelProxy::Context::Context(Channel::Listener* listener, MessageFilter* filter, MessageLoop* ipc_message_loop) @@ -248,6 +270,10 @@ ChannelProxy::ChannelProxy(const std::string& channel_id, Channel::Mode mode, Init(channel_id, mode, ipc_thread, create_pipe_now); } +ChannelProxy::~ChannelProxy() { + Close(); +} + void ChannelProxy::Init(const std::string& channel_id, Channel::Mode mode, MessageLoop* ipc_thread_loop, bool create_pipe_now) { if (create_pipe_now) { diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h index bfebcb8..19aea28 100644 --- a/ipc/ipc_channel_proxy.h +++ b/ipc/ipc_channel_proxy.h @@ -55,42 +55,38 @@ class ChannelProxy : public Message::Sender { class MessageFilter : public base::RefCountedThreadSafe<MessageFilter, MessageFilterTraits> { public: - virtual ~MessageFilter() {} + virtual ~MessageFilter(); // Called on the background thread to provide the filter with access to the // channel. Called when the IPC channel is initialized or when AddFilter // is called if the channel is already initialized. - virtual void OnFilterAdded(Channel* channel) {} + virtual void OnFilterAdded(Channel* channel); // Called on the background thread when the filter has been removed from // the ChannelProxy and when the Channel is closing. After a filter is // removed, it will not be called again. - virtual void OnFilterRemoved() {} + virtual void OnFilterRemoved(); // Called to inform the filter that the IPC channel is connected and we // have received the internal Hello message from the peer. - virtual void OnChannelConnected(int32 peer_pid) {} + virtual void OnChannelConnected(int32 peer_pid); // Called when there is an error on the channel, typically that the channel // has been closed. - virtual void OnChannelError() {} + virtual void OnChannelError(); // Called to inform the filter that the IPC channel will be destroyed. // OnFilterRemoved is called immediately after this. - virtual void OnChannelClosing() {} + virtual void OnChannelClosing(); // Return true to indicate that the message was handled, or false to let // the message be handled in the default way. - virtual bool OnMessageReceived(const Message& message) { - return false; - } + virtual bool OnMessageReceived(const Message& message); // Called when the message filter is about to be deleted. This gives // derived classes the option of controlling which thread they're deleted // on etc. - virtual void OnDestruct() { - delete this; - } + virtual void OnDestruct(); }; struct MessageFilterTraits { @@ -111,9 +107,7 @@ class ChannelProxy : public Message::Sender { Channel::Listener* listener, MessageFilter* filter, MessageLoop* ipc_thread_loop); - virtual ~ChannelProxy() { - Close(); - } + virtual ~ChannelProxy(); // Close the IPC::Channel. This operation completes asynchronously, once the // background thread processes the command to close the channel. It is ok to |